[STATEMENT]
lemma dsum_bound:
  assumes p: "p division_of (cbox a b)"
    and "norm c \<le> e"
  shows "norm (sum (\<lambda>l. content l *\<^sub>R c) p) \<le> e * content(cbox a b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (\<Sum>l\<in>p. content l *\<^sub>R c) \<le> e * content (cbox a b)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. norm (\<Sum>l\<in>p. content l *\<^sub>R c) \<le> e * content (cbox a b)
[PROOF STEP]
have sumeq: "(\<Sum>i\<in>p. \<bar>content i\<bar>) = sum content p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i\<in>p. \<bar>content i\<bar>) = sum content p
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<in>p. \<bar>content i\<bar>) = sum content p

goal (1 subgoal):
 1. norm (\<Sum>l\<in>p. content l *\<^sub>R c) \<le> e * content (cbox a b)
[PROOF STEP]
have e: "0 \<le> e"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> e
[PROOF STEP]
using assms(2) norm_ge_zero order_trans
[PROOF STATE]
proof (prove)
using this:
norm c \<le> e
0 \<le> norm ?x
\<lbrakk>?x \<le> ?y; ?y \<le> ?z\<rbrakk> \<Longrightarrow> ?x \<le> ?z

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

goal (1 subgoal):
 1. norm (\<Sum>l\<in>p. content l *\<^sub>R c) \<le> e * content (cbox a b)
[PROOF STEP]
have "norm (sum (\<lambda>l. content l *\<^sub>R c) p) \<le> (\<Sum>i\<in>p. norm (content i *\<^sub>R c))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (\<Sum>l\<in>p. content l *\<^sub>R c) \<le> (\<Sum>i\<in>p. norm (content i *\<^sub>R c))
[PROOF STEP]
using norm_sum
[PROOF STATE]
proof (prove)
using this:
norm (sum ?f ?A) \<le> (\<Sum>i\<in>?A. norm (?f i))

goal (1 subgoal):
 1. norm (\<Sum>l\<in>p. content l *\<^sub>R c) \<le> (\<Sum>i\<in>p. norm (content i *\<^sub>R c))
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
norm (\<Sum>l\<in>p. content l *\<^sub>R c) \<le> (\<Sum>i\<in>p. norm (content i *\<^sub>R c))

goal (1 subgoal):
 1. norm (\<Sum>l\<in>p. content l *\<^sub>R c) \<le> e * content (cbox a b)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
norm (\<Sum>l\<in>p. content l *\<^sub>R c) \<le> (\<Sum>i\<in>p. norm (content i *\<^sub>R c))

goal (1 subgoal):
 1. norm (\<Sum>l\<in>p. content l *\<^sub>R c) \<le> e * content (cbox a b)
[PROOF STEP]
have "...  \<le> e * (\<Sum>i\<in>p. \<bar>content i\<bar>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i\<in>p. norm (content i *\<^sub>R c)) \<le> e * (\<Sum>i\<in>p. \<bar>content i\<bar>)
[PROOF STEP]
by (simp add: sum_distrib_left[symmetric] mult.commute assms(2) mult_right_mono sum_nonneg)
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<in>p. norm (content i *\<^sub>R c)) \<le> e * (\<Sum>i\<in>p. \<bar>content i\<bar>)

goal (1 subgoal):
 1. norm (\<Sum>l\<in>p. content l *\<^sub>R c) \<le> e * content (cbox a b)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<in>p. norm (content i *\<^sub>R c)) \<le> e * (\<Sum>i\<in>p. \<bar>content i\<bar>)

goal (1 subgoal):
 1. norm (\<Sum>l\<in>p. content l *\<^sub>R c) \<le> e * content (cbox a b)
[PROOF STEP]
have "... \<le> e * content (cbox a b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. e * (\<Sum>i\<in>p. \<bar>content i\<bar>) \<le> e * content (cbox a b)
[PROOF STEP]
by (metis additive_content_division p eq_iff sumeq)
[PROOF STATE]
proof (state)
this:
e * (\<Sum>i\<in>p. \<bar>content i\<bar>) \<le> e * content (cbox a b)

goal (1 subgoal):
 1. norm (\<Sum>l\<in>p. content l *\<^sub>R c) \<le> e * content (cbox a b)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
norm (\<Sum>l\<in>p. content l *\<^sub>R c) \<le> e * content (cbox a b)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
norm (\<Sum>l\<in>p. content l *\<^sub>R c) \<le> e * content (cbox a b)

goal (1 subgoal):
 1. norm (\<Sum>l\<in>p. content l *\<^sub>R c) \<le> e * content (cbox a b)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
norm (\<Sum>l\<in>p. content l *\<^sub>R c) \<le> e * content (cbox a b)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma vimage_l_image_r: "\<lbrakk> ob-`Q \<subseteq> P; Q \<subseteq> range ob \<rbrakk> \<Longrightarrow> Q \<subseteq> ob`P"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>ob -` Q \<subseteq> P; Q \<subseteq> range ob\<rbrakk> \<Longrightarrow> Q \<subseteq> ob ` P
[PROOF STEP]
by (drule image_mono [where f=ob], auto)


[STATEMENT]
lemma deg_pm_minus_le: "deg_pm (t - s) \<le> deg_pm (t::_ \<Rightarrow>\<^sub>0 nat)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. deg_pm (t - s) \<le> deg_pm t
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. deg_pm (t - s) \<le> deg_pm t
[PROOF STEP]
have "keys (t - s) \<subseteq> keys t"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. keys (t - s) \<subseteq> keys t
[PROOF STEP]
by (rule, simp add: lookup_minus in_keys_iff)
[PROOF STATE]
proof (state)
this:
keys (t - s) \<subseteq> keys t

goal (1 subgoal):
 1. deg_pm (t - s) \<le> deg_pm t
[PROOF STEP]
hence "deg_pm (t - s) = (\<Sum>x\<in>keys t. lookup (t - s) x)"
[PROOF STATE]
proof (prove)
using this:
keys (t - s) \<subseteq> keys t

goal (1 subgoal):
 1. deg_pm (t - s) = sum (lookup (t - s)) (keys t)
[PROOF STEP]
using finite_keys
[PROOF STATE]
proof (prove)
using this:
keys (t - s) \<subseteq> keys t
finite (keys ?f)

goal (1 subgoal):
 1. deg_pm (t - s) = sum (lookup (t - s)) (keys t)
[PROOF STEP]
by (rule deg_pm_superset)
[PROOF STATE]
proof (state)
this:
deg_pm (t - s) = sum (lookup (t - s)) (keys t)

goal (1 subgoal):
 1. deg_pm (t - s) \<le> deg_pm t
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
deg_pm (t - s) = sum (lookup (t - s)) (keys t)

goal (1 subgoal):
 1. deg_pm (t - s) \<le> deg_pm t
[PROOF STEP]
have "\<dots> \<le> (\<Sum>x\<in>keys t. lookup t x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum (lookup (t - s)) (keys t) \<le> sum (lookup t) (keys t)
[PROOF STEP]
by (rule sum_mono) (simp add: lookup_minus)
[PROOF STATE]
proof (state)
this:
sum (lookup (t - s)) (keys t) \<le> sum (lookup t) (keys t)

goal (1 subgoal):
 1. deg_pm (t - s) \<le> deg_pm t
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
sum (lookup (t - s)) (keys t) \<le> sum (lookup t) (keys t)

goal (1 subgoal):
 1. deg_pm (t - s) \<le> deg_pm t
[PROOF STEP]
have "\<dots> = deg_pm t"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum (lookup t) (keys t) = deg_pm t
[PROOF STEP]
by (rule sym, rule deg_pm_superset, fact subset_refl, fact finite_keys)
[PROOF STATE]
proof (state)
this:
sum (lookup t) (keys t) = deg_pm t

goal (1 subgoal):
 1. deg_pm (t - s) \<le> deg_pm t
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
deg_pm (t - s) \<le> deg_pm t
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
deg_pm (t - s) \<le> deg_pm t

goal (1 subgoal):
 1. deg_pm (t - s) \<le> deg_pm t
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
deg_pm (t - s) \<le> deg_pm t

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in domain) unitary_monom_eq_var_pow:
  assumes "subring K R" shows "monom \<one> n = X [^]\<^bsub>K[X]\<^esub> n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. local.monom \<one> n = X [^]\<^bsub>K [X]\<^esub> n
[PROOF STEP]
using poly_mult_var[OF assms var_pow_closed[OF assms]]
[PROOF STATE]
proof (prove)
using this:
X [^]\<^bsub>K [X]\<^esub> ?n1 \<otimes>\<^bsub>K [X]\<^esub> X = (if X [^]\<^bsub>K [X]\<^esub> ?n1 = [] then [] else X [^]\<^bsub>K [X]\<^esub> ?n1 @ [\<zero>])

goal (1 subgoal):
 1. local.monom \<one> n = X [^]\<^bsub>K [X]\<^esub> n
[PROOF STEP]
unfolding nat_pow_def monom_def
[PROOF STATE]
proof (prove)
using this:
rec_nat \<one>\<^bsub>K [X]\<^esub> (\<lambda>u b. b \<otimes>\<^bsub>K [X]\<^esub> X) ?n1 \<otimes>\<^bsub>K [X]\<^esub> X = (if rec_nat \<one>\<^bsub>K [X]\<^esub> (\<lambda>u b. b \<otimes>\<^bsub>K [X]\<^esub> X) ?n1 = [] then [] else rec_nat \<one>\<^bsub>K [X]\<^esub> (\<lambda>u b. b \<otimes>\<^bsub>K [X]\<^esub> X) ?n1 @ [\<zero>])

goal (1 subgoal):
 1. \<one> # replicate n \<zero> = rec_nat \<one>\<^bsub>K [X]\<^esub> (\<lambda>u b. b \<otimes>\<^bsub>K [X]\<^esub> X) n
[PROOF STEP]
by (induct n) (auto simp add: univ_poly_one, metis append_Cons replicate_append_same)


[STATEMENT]
lemma vec_mod_to_int_vec: "vec_mod (to_int_vec (v :: 'a mod_ring vec)) = to_int_vec v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec_mod (to_int_vec v) = to_int_vec v
[PROOF STEP]
using mod_to_int_mod_ring
[PROOF STATE]
proof (prove)
using this:
to_int_mod_ring ?x mod m = to_int_mod_ring ?x

goal (1 subgoal):
 1. vec_mod (to_int_vec v) = to_int_vec v
[PROOF STEP]
by (intro eq_vecI, simp_all)


[STATEMENT]
lemma unat_mult_power_lem:
  assumes kv: "k < 2 ^ (LENGTH('a::len) - sz)"
  shows "unat (2 ^ sz * of_nat k :: (('a::len) word)) = 2 ^ sz * k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. unat (2 ^ sz * word_of_nat k) = 2 ^ sz * k
[PROOF STEP]
proof (cases \<open>sz < LENGTH('a)\<close>)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. sz < LENGTH('a) \<Longrightarrow> unat (2 ^ sz * word_of_nat k) = 2 ^ sz * k
 2. \<not> sz < LENGTH('a) \<Longrightarrow> unat (2 ^ sz * word_of_nat k) = 2 ^ sz * k
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
sz < LENGTH('a)

goal (2 subgoals):
 1. sz < LENGTH('a) \<Longrightarrow> unat (2 ^ sz * word_of_nat k) = 2 ^ sz * k
 2. \<not> sz < LENGTH('a) \<Longrightarrow> unat (2 ^ sz * word_of_nat k) = 2 ^ sz * k
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
k < 2 ^ (LENGTH('a) - sz)
sz < LENGTH('a)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
k < 2 ^ (LENGTH('a) - sz)
sz < LENGTH('a)

goal (1 subgoal):
 1. unat (2 ^ sz * word_of_nat k) = 2 ^ sz * k
[PROOF STEP]
by (simp add: unat_word_ariths take_bit_eq_mod mod_simps unsigned_of_nat)
      (simp add: take_bit_nat_eq_self_iff nat_less_power_trans flip: take_bit_eq_mod)
[PROOF STATE]
proof (state)
this:
unat (2 ^ sz * word_of_nat k) = 2 ^ sz * k

goal (1 subgoal):
 1. \<not> sz < LENGTH('a) \<Longrightarrow> unat (2 ^ sz * word_of_nat k) = 2 ^ sz * k
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> sz < LENGTH('a) \<Longrightarrow> unat (2 ^ sz * word_of_nat k) = 2 ^ sz * k
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> sz < LENGTH('a)

goal (1 subgoal):
 1. \<not> sz < LENGTH('a) \<Longrightarrow> unat (2 ^ sz * word_of_nat k) = 2 ^ sz * k
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
k < 2 ^ (LENGTH('a) - sz)
\<not> sz < LENGTH('a)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
k < 2 ^ (LENGTH('a) - sz)
\<not> sz < LENGTH('a)

goal (1 subgoal):
 1. unat (2 ^ sz * word_of_nat k) = 2 ^ sz * k
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
unat (2 ^ sz * word_of_nat k) = 2 ^ sz * k

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma suminf_split_head':
  "summable (f :: nat \<Rightarrow> 'x :: real_normed_vector) \<Longrightarrow> suminf f = f 0 + (\<Sum>n. f (Suc n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. summable f \<Longrightarrow> suminf f = f 0 + (\<Sum>n. f (Suc n))
[PROOF STEP]
by (auto simp: suminf_split_head)


[STATEMENT]
lemma unique_default_example3: "succ_tran \<lparr>nodes = {vertex_1, vertex_2}, edges = {(vertex_2, vertex_1)}\<rparr> vertex_2 = {vertex_1}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. succ_tran \<lparr>nodes = {vertex_1, vertex_2}, edges = {(vertex_2, vertex_1)}\<rparr> vertex_2 = {vertex_1}
[PROOF STEP]
apply (simp add: succ_tran_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {e2. (vertex_2, e2) \<in> {(vertex_2, vertex_1)}\<^sup>+} = {vertex_1}
[PROOF STEP]
by (metis (lifting, no_types) Collect_cong Range.intros Range_empty Range_insert mem_Collect_eq singleton_conv singleton_iff trancl.r_into_trancl trancl_range)


[STATEMENT]
lemma subtype_irrefl:
  "\<tau> < \<tau> \<Longrightarrow> False"
  for \<tau> :: "'a type"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<tau> < \<tau> \<Longrightarrow> False
[PROOF STEP]
apply (induct \<tau>, auto)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>\<And>xa. \<lbrakk>xa \<in> fmran' x; xa < xa\<rbrakk> \<Longrightarrow> False; Tuple x < Tuple x\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
apply (erule type_less_x_Tuple', auto)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x xa. \<lbrakk>\<And>xa. \<lbrakk>xa \<in> fmran' x; xa < xa\<rbrakk> \<Longrightarrow> False; xa \<in> fmran' x; (xa, xa) \<in> {(x, y). x \<sqsubset> y}\<^sup>+\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
unfolding less_type_def tranclp_unfold
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x xa. \<lbrakk>\<And>xa. \<lbrakk>xa \<in> fmran' x; (xa, xa) \<in> {(x, y). x \<sqsubset> y}\<^sup>+\<rbrakk> \<Longrightarrow> False; xa \<in> fmran' x; (xa, xa) \<in> {(x, y). x \<sqsubset> y}\<^sup>+\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
by auto


[STATEMENT]
lemma finite_imp_closed: "finite S \<Longrightarrow> closed S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite S \<Longrightarrow> closed S
[PROOF STEP]
by (induct pred: finite) simp_all


[STATEMENT]
lemma length_maskedDB_zero:
  "\<lbrakk> roundup emBits 8 * 8 - emBits \<le> length maskedDB\<rbrakk>
  \<Longrightarrow> length (maskedDB_zero maskedDB emBits) = length maskedDB"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. roundup emBits 8 * 8 - emBits \<le> length maskedDB \<Longrightarrow> length (maskedDB_zero maskedDB emBits) = length maskedDB
[PROOF STEP]
by (simp add: maskedDB_zero_def length_bv_prepend)


[STATEMENT]
lemma Abs_freelist_in_FreeGroup: "ss \<in> lists S \<Longrightarrow> Abs_freelist ss \<in> FreeGroup S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ss \<in> lists S \<Longrightarrow> Abs_freelist ss \<in> FreeGroup S
[PROOF STEP]
using proper_signed_list_map_uniform_snd
[PROOF STATE]
proof (prove)
using this:
proper_signed_list (map (\<lambda>s. (s, ?b)) ?as)

goal (1 subgoal):
 1. ss \<in> lists S \<Longrightarrow> Abs_freelist ss \<in> FreeGroup S
[PROOF STEP]
by (fastforce intro: FreeGroupI_transfer)


[STATEMENT]
lemma omega_closed_add [intro]:
  assumes "\<alpha> \<in> elts \<omega>" "\<beta> \<in> elts \<omega>" shows "\<alpha>+\<beta> \<in> elts \<omega>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<alpha> + \<beta> \<in> elts \<omega>
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<alpha> + \<beta> \<in> elts \<omega>
[PROOF STEP]
obtain m n where "\<alpha> = ord_of_nat m" "\<beta> = ord_of_nat n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>m n. \<lbrakk>\<alpha> = ord_of_nat m; \<beta> = ord_of_nat n\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms elts_\<omega>
[PROOF STATE]
proof (prove)
using this:
\<alpha> \<in> elts \<omega>
\<beta> \<in> elts \<omega>
elts \<omega> = {\<alpha>. \<exists>n. \<alpha> = ord_of_nat n}

goal (1 subgoal):
 1. (\<And>m n. \<lbrakk>\<alpha> = ord_of_nat m; \<beta> = ord_of_nat n\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<alpha> = ord_of_nat m
\<beta> = ord_of_nat n

goal (1 subgoal):
 1. \<alpha> + \<beta> \<in> elts \<omega>
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<alpha> = ord_of_nat m
\<beta> = ord_of_nat n
[PROOF STEP]
have "\<alpha>+\<beta> = ord_of_nat (m+n)"
[PROOF STATE]
proof (prove)
using this:
\<alpha> = ord_of_nat m
\<beta> = ord_of_nat n

goal (1 subgoal):
 1. \<alpha> + \<beta> = ord_of_nat (m + n)
[PROOF STEP]
using ord_of_nat_add
[PROOF STATE]
proof (prove)
using this:
\<alpha> = ord_of_nat m
\<beta> = ord_of_nat n
ord_of_nat (?m + ?n) = ord_of_nat ?m + ord_of_nat ?n

goal (1 subgoal):
 1. \<alpha> + \<beta> = ord_of_nat (m + n)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<alpha> + \<beta> = ord_of_nat (m + n)

goal (1 subgoal):
 1. \<alpha> + \<beta> \<in> elts \<omega>
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<alpha> + \<beta> = ord_of_nat (m + n)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<alpha> + \<beta> = ord_of_nat (m + n)

goal (1 subgoal):
 1. \<alpha> + \<beta> \<in> elts \<omega>
[PROOF STEP]
by (simp add: \<omega>_def)
[PROOF STATE]
proof (state)
this:
\<alpha> + \<beta> \<in> elts \<omega>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma cnf_singleton_false: "(\<exists>a'\<in>set as. \<not> cnf_to_bool \<gamma> [a']) \<longleftrightarrow> \<not> cnf_to_bool \<gamma> as"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>a'\<in>set as. \<not> cnf_to_bool \<gamma> [a']) = (\<not> cnf_to_bool \<gamma> as)
[PROOF STEP]
by(induction \<gamma> as rule: cnf_to_bool.induct) (simp_all)


[STATEMENT]
lemma concat_eq_Nil_conv [simp]: "(concat xss = []) = (\<forall>xs \<in> set xss. xs = [])"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (concat xss = []) = (\<forall>xs\<in>set xss. xs = [])
[PROOF STEP]
by (induct xss) auto


[STATEMENT]
lemma fun_of_list_Cons [simp]:
  "fun_of_list i (x # xs) g = fun_of_list (i + 1) xs (g(i:=x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fun_of_list i (x # xs) g = fun_of_list (i + 1) xs (g(i := x))
[PROOF STEP]
by (auto simp add: fun_eq_iff fun_of_list_def nth_Cons'
    nat_diff_distrib [of "int (Suc 0)", simplified, symmetric]
    diff_diff_eq)


[STATEMENT]
lemma snd_scaleR [simp]: "snd (scaleR r A) = scaleR r (snd A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. snd (r *\<^sub>R A) = r *\<^sub>R snd A
[PROOF STEP]
unfolding scaleR_prod_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. snd (r *\<^sub>R fst A, r *\<^sub>R snd A) = r *\<^sub>R snd A
[PROOF STEP]
by simp


[STATEMENT]
lemma integrable_MAX:
  fixes f:: "_ \<Rightarrow> _ \<Rightarrow> real"
  shows "\<lbrakk> finite I;  I \<noteq> {};  \<And>i. i \<in> I \<Longrightarrow> integrable M (f i) \<rbrakk>
  \<Longrightarrow> integrable M (\<lambda>x. MAX i\<in>I. f i x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite I; I \<noteq> {}; \<And>i. i \<in> I \<Longrightarrow> integrable M (f i)\<rbrakk> \<Longrightarrow> integrable M (\<lambda>x. MAX i\<in>I. f i x)
[PROOF STEP]
by (induct rule: finite_ne_induct) simp+


[STATEMENT]
lemma linear_componentwise:
  fixes f:: "'a::field ^'m \<Rightarrow> 'a ^ 'n"
  assumes lf: "Vector_Spaces.linear (*s) (*s) f"
  shows "(f x)$j = sum (\<lambda>i. (x$i) * (f (axis i 1)$j)) (UNIV :: 'm set)" (is "?lhs = ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f x $ j = (\<Sum>i\<in>UNIV. x $ i * f (axis i (1::'a)) $ j)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. f x $ j = (\<Sum>i\<in>UNIV. x $ i * f (axis i (1::'a)) $ j)
[PROOF STEP]
interpret lf: Vector_Spaces.linear "(*s)" "(*s)" f
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Vector_Spaces.linear (*s) (*s) f
[PROOF STEP]
using lf
[PROOF STATE]
proof (prove)
using this:
Vector_Spaces.linear (*s) (*s) f

goal (1 subgoal):
 1. Vector_Spaces.linear (*s) (*s) f
[PROOF STEP]
.
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. f x $ j = (\<Sum>i\<in>UNIV. x $ i * f (axis i (1::'a)) $ j)
[PROOF STEP]
let ?M = "(UNIV :: 'm set)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. f x $ j = (\<Sum>i\<in>UNIV. x $ i * f (axis i (1::'a)) $ j)
[PROOF STEP]
let ?N = "(UNIV :: 'n set)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. f x $ j = (\<Sum>i\<in>UNIV. x $ i * f (axis i (1::'a)) $ j)
[PROOF STEP]
have fM: "finite ?M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite UNIV
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
finite UNIV

goal (1 subgoal):
 1. f x $ j = (\<Sum>i\<in>UNIV. x $ i * f (axis i (1::'a)) $ j)
[PROOF STEP]
have "?rhs = (sum (\<lambda>i. (x$i) *s (f (axis i 1))) ?M)$j"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i\<in>UNIV. x $ i * f (axis i (1::'a)) $ j) = (\<Sum>i\<in>UNIV. x $ i *s f (axis i (1::'a))) $ j
[PROOF STEP]
unfolding sum_component
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i\<in>UNIV. x $ i * f (axis i (1::'a)) $ j) = (\<Sum>xa\<in>UNIV. (x $ xa *s f (axis xa (1::'a))) $ j)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<in>UNIV. x $ i * f (axis i (1::'a)) $ j) = (\<Sum>i\<in>UNIV. x $ i *s f (axis i (1::'a))) $ j

goal (1 subgoal):
 1. f x $ j = (\<Sum>i\<in>UNIV. x $ i * f (axis i (1::'a)) $ j)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<Sum>i\<in>UNIV. x $ i * f (axis i (1::'a)) $ j) = (\<Sum>i\<in>UNIV. x $ i *s f (axis i (1::'a))) $ j
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<Sum>i\<in>UNIV. x $ i * f (axis i (1::'a)) $ j) = (\<Sum>i\<in>UNIV. x $ i *s f (axis i (1::'a))) $ j

goal (1 subgoal):
 1. f x $ j = (\<Sum>i\<in>UNIV. x $ i * f (axis i (1::'a)) $ j)
[PROOF STEP]
unfolding lf.sum[symmetric] lf.scale[symmetric]
[PROOF STATE]
proof (prove)
using this:
(\<Sum>i\<in>UNIV. x $ i * f (axis i (1::'a)) $ j) = f (\<Sum>i\<in>UNIV. x $ i *s axis i (1::'a)) $ j

goal (1 subgoal):
 1. f x $ j = (\<Sum>i\<in>UNIV. x $ i * f (axis i (1::'a)) $ j)
[PROOF STEP]
unfolding basis_expansion
[PROOF STATE]
proof (prove)
using this:
(\<Sum>i\<in>UNIV. x $ i * f (axis i (1::'a)) $ j) = f x $ j

goal (1 subgoal):
 1. f x $ j = (\<Sum>i\<in>UNIV. x $ i * f (axis i (1::'a)) $ j)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
f x $ j = (\<Sum>i\<in>UNIV. x $ i * f (axis i (1::'a)) $ j)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in group) int_pow_consistent: \<^marker>\<open>contributor \<open>Paulo Em?lio de Vilhena\<close>\<close>
  assumes "subgroup H G" "x \<in> H"
  shows "x [^] (n :: int) = x [^]\<^bsub>(G \<lparr> carrier := H \<rparr>)\<^esub> n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x [^] n = x [^]\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> n
[PROOF STEP]
proof (cases)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. ?P \<Longrightarrow> x [^] n = x [^]\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> n
 2. \<not> ?P \<Longrightarrow> x [^] n = x [^]\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> n
[PROOF STEP]
assume ge: "n \<ge> 0"
[PROOF STATE]
proof (state)
this:
0 \<le> n

goal (2 subgoals):
 1. ?P \<Longrightarrow> x [^] n = x [^]\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> n
 2. \<not> ?P \<Longrightarrow> x [^] n = x [^]\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> n
[PROOF STEP]
hence "x [^] n = x [^] (nat n)"
[PROOF STATE]
proof (prove)
using this:
0 \<le> n

goal (1 subgoal):
 1. x [^] n = x [^] nat n
[PROOF STEP]
using int_pow_def2 [of G]
[PROOF STATE]
proof (prove)
using this:
0 \<le> n
?a [^] ?z = (if ?z < 0 then inv (?a [^] nat (- ?z)) else ?a [^] nat ?z)

goal (1 subgoal):
 1. x [^] n = x [^] nat n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x [^] n = x [^] nat n

goal (2 subgoals):
 1. ?P \<Longrightarrow> x [^] n = x [^]\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> n
 2. \<not> ?P \<Longrightarrow> x [^] n = x [^]\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
x [^] n = x [^] nat n

goal (2 subgoals):
 1. ?P \<Longrightarrow> x [^] n = x [^]\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> n
 2. \<not> ?P \<Longrightarrow> x [^] n = x [^]\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> n
[PROOF STEP]
have " ... = x [^]\<^bsub>(G \<lparr> carrier := H \<rparr>)\<^esub> (nat n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x [^] nat n = x [^]\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> nat n
[PROOF STEP]
using nat_pow_consistent
[PROOF STATE]
proof (prove)
using this:
?x [^] ?n = ?x [^]\<^bsub>G\<lparr>carrier := ?H\<rparr>\<^esub> ?n

goal (1 subgoal):
 1. x [^] nat n = x [^]\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> nat n
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
x [^] nat n = x [^]\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> nat n

goal (2 subgoals):
 1. ?P \<Longrightarrow> x [^] n = x [^]\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> n
 2. \<not> ?P \<Longrightarrow> x [^] n = x [^]\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
x [^] nat n = x [^]\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> nat n

goal (2 subgoals):
 1. ?P \<Longrightarrow> x [^] n = x [^]\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> n
 2. \<not> ?P \<Longrightarrow> x [^] n = x [^]\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> n
[PROOF STEP]
have " ... = x [^]\<^bsub>(G \<lparr> carrier := H \<rparr>)\<^esub> n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x [^]\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> nat n = x [^]\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> n
[PROOF STEP]
by (metis ge int_nat_eq int_pow_int)
[PROOF STATE]
proof (state)
this:
x [^]\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> nat n = x [^]\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> n

goal (2 subgoals):
 1. ?P \<Longrightarrow> x [^] n = x [^]\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> n
 2. \<not> ?P \<Longrightarrow> x [^] n = x [^]\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> n
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
x [^] n = x [^]\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
x [^] n = x [^]\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> n

goal (1 subgoal):
 1. x [^] n = x [^]\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> n
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
x [^] n = x [^]\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> n

goal (1 subgoal):
 1. \<not> 0 \<le> n \<Longrightarrow> x [^] n = x [^]\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> n
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> 0 \<le> n \<Longrightarrow> x [^] n = x [^]\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> n
[PROOF STEP]
assume "\<not> n \<ge> 0"
[PROOF STATE]
proof (state)
this:
\<not> 0 \<le> n

goal (1 subgoal):
 1. \<not> 0 \<le> n \<Longrightarrow> x [^] n = x [^]\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> n
[PROOF STEP]
hence lt: "n < 0"
[PROOF STATE]
proof (prove)
using this:
\<not> 0 \<le> n

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

goal (1 subgoal):
 1. \<not> 0 \<le> n \<Longrightarrow> x [^] n = x [^]\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> n
[PROOF STEP]
hence "x [^] n = inv (x [^] (nat (- n)))"
[PROOF STATE]
proof (prove)
using this:
n < 0

goal (1 subgoal):
 1. x [^] n = inv (x [^] nat (- n))
[PROOF STEP]
using int_pow_def2 [of G]
[PROOF STATE]
proof (prove)
using this:
n < 0
?a [^] ?z = (if ?z < 0 then inv (?a [^] nat (- ?z)) else ?a [^] nat ?z)

goal (1 subgoal):
 1. x [^] n = inv (x [^] nat (- n))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x [^] n = inv (x [^] nat (- n))

goal (1 subgoal):
 1. \<not> 0 \<le> n \<Longrightarrow> x [^] n = x [^]\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
x [^] n = inv (x [^] nat (- n))

goal (1 subgoal):
 1. \<not> 0 \<le> n \<Longrightarrow> x [^] n = x [^]\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> n
[PROOF STEP]
have " ... = (inv x) [^] (nat (- n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inv (x [^] nat (- n)) = inv x [^] nat (- n)
[PROOF STEP]
by (metis assms nat_pow_inv subgroup.mem_carrier)
[PROOF STATE]
proof (state)
this:
inv (x [^] nat (- n)) = inv x [^] nat (- n)

goal (1 subgoal):
 1. \<not> 0 \<le> n \<Longrightarrow> x [^] n = x [^]\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
inv (x [^] nat (- n)) = inv x [^] nat (- n)

goal (1 subgoal):
 1. \<not> 0 \<le> n \<Longrightarrow> x [^] n = x [^]\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> n
[PROOF STEP]
have " ... = (inv\<^bsub>(G \<lparr> carrier := H \<rparr>)\<^esub> x) [^]\<^bsub>(G \<lparr> carrier := H \<rparr>)\<^esub> (nat (- n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inv x [^] nat (- n) = inv\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> x [^]\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> nat (- n)
[PROOF STEP]
using m_inv_consistent[OF assms] nat_pow_consistent
[PROOF STATE]
proof (prove)
using this:
inv\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> x = inv x
?x [^] ?n = ?x [^]\<^bsub>G\<lparr>carrier := ?H\<rparr>\<^esub> ?n

goal (1 subgoal):
 1. inv x [^] nat (- n) = inv\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> x [^]\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> nat (- n)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
inv x [^] nat (- n) = inv\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> x [^]\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> nat (- n)

goal (1 subgoal):
 1. \<not> 0 \<le> n \<Longrightarrow> x [^] n = x [^]\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
inv x [^] nat (- n) = inv\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> x [^]\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> nat (- n)

goal (1 subgoal):
 1. \<not> 0 \<le> n \<Longrightarrow> x [^] n = x [^]\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> n
[PROOF STEP]
have " ... = inv\<^bsub>(G \<lparr> carrier := H \<rparr>)\<^esub> (x [^]\<^bsub>(G \<lparr> carrier := H \<rparr>)\<^esub> (nat (- n)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inv\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> x [^]\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> nat (- n) = inv\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> (x [^]\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> nat (- n))
[PROOF STEP]
using group.nat_pow_inv[OF subgroup.subgroup_is_group[OF assms(1) is_group]] assms(2)
[PROOF STATE]
proof (prove)
using this:
?x \<in> carrier (G\<lparr>carrier := H\<rparr>) \<Longrightarrow> inv\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> ?x [^]\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> ?i = inv\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> (?x [^]\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> ?i)
x \<in> H

goal (1 subgoal):
 1. inv\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> x [^]\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> nat (- n) = inv\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> (x [^]\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> nat (- n))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
inv\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> x [^]\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> nat (- n) = inv\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> (x [^]\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> nat (- n))

goal (1 subgoal):
 1. \<not> 0 \<le> n \<Longrightarrow> x [^] n = x [^]\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
inv\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> x [^]\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> nat (- n) = inv\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> (x [^]\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> nat (- n))

goal (1 subgoal):
 1. \<not> 0 \<le> n \<Longrightarrow> x [^] n = x [^]\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> n
[PROOF STEP]
have " ... = x [^]\<^bsub>(G \<lparr> carrier := H \<rparr>)\<^esub> n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inv\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> (x [^]\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> nat (- n)) = x [^]\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> n
[PROOF STEP]
by (simp add: int_pow_def2 lt)
[PROOF STATE]
proof (state)
this:
inv\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> (x [^]\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> nat (- n)) = x [^]\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> n

goal (1 subgoal):
 1. \<not> 0 \<le> n \<Longrightarrow> x [^] n = x [^]\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> n
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
x [^] n = x [^]\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
x [^] n = x [^]\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> n

goal (1 subgoal):
 1. x [^] n = x [^]\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> n
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
x [^] n = x [^]\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> n

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma row_add_iterate_eq_row_add:
  fixes A::"'a::{ring_1}^'n^'m::{mod_type}"
  assumes a_not_i: "a \<noteq> i"
  and n: "n<nrows A"
  and "to_nat a \<le> n"
  shows "(row_add_iterate A n i j) $ a $ b = (row_add A a i (- A $ a $ j)) $ a $ b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. row_add_iterate A n i j $ a $ b = row_add A a i (- A $ a $ j) $ a $ b
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
a \<noteq> i
n < nrows A
mod_type_class.to_nat a \<le> n

goal (1 subgoal):
 1. row_add_iterate A n i j $ a $ b = row_add A a i (- A $ a $ j) $ a $ b
[PROOF STEP]
proof (induct n arbitrary: A)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>A. \<lbrakk>a \<noteq> i; 0 < nrows A; mod_type_class.to_nat a \<le> 0\<rbrakk> \<Longrightarrow> row_add_iterate A 0 i j $ a $ b = row_add A a i (- A $ a $ j) $ a $ b
 2. \<And>n A. \<lbrakk>\<And>A. \<lbrakk>a \<noteq> i; n < nrows A; mod_type_class.to_nat a \<le> n\<rbrakk> \<Longrightarrow> row_add_iterate A n i j $ a $ b = row_add A a i (- A $ a $ j) $ a $ b; a \<noteq> i; Suc n < nrows A; mod_type_class.to_nat a \<le> Suc n\<rbrakk> \<Longrightarrow> row_add_iterate A (Suc n) i j $ a $ b = row_add A a i (- A $ a $ j) $ a $ b
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:
a \<noteq> i
0 < nrows A
mod_type_class.to_nat a \<le> 0

goal (2 subgoals):
 1. \<And>A. \<lbrakk>a \<noteq> i; 0 < nrows A; mod_type_class.to_nat a \<le> 0\<rbrakk> \<Longrightarrow> row_add_iterate A 0 i j $ a $ b = row_add A a i (- A $ a $ j) $ a $ b
 2. \<And>n A. \<lbrakk>\<And>A. \<lbrakk>a \<noteq> i; n < nrows A; mod_type_class.to_nat a \<le> n\<rbrakk> \<Longrightarrow> row_add_iterate A n i j $ a $ b = row_add A a i (- A $ a $ j) $ a $ b; a \<noteq> i; Suc n < nrows A; mod_type_class.to_nat a \<le> Suc n\<rbrakk> \<Longrightarrow> row_add_iterate A (Suc n) i j $ a $ b = row_add A a i (- A $ a $ j) $ a $ b
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. row_add_iterate A 0 i j $ a $ b = row_add A a i (- A $ a $ j) $ a $ b
[PROOF STEP]
unfolding row_add_iterate.simps
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if i = (0::'m) then A else row_add A (0::'m) i (- A $ (0::'m) $ j)) $ a $ b = row_add A a i (- A $ a $ j) $ a $ b
[PROOF STEP]
using "0.prems"(3) a_not_i to_nat_eq_0 least_mod_type
[PROOF STATE]
proof (prove)
using this:
mod_type_class.to_nat a \<le> 0
a \<noteq> i
(mod_type_class.to_nat ?x = 0) = (?x = (0::?'a))
(0::?'a) \<le> ?n

goal (1 subgoal):
 1. (if i = (0::'m) then A else row_add A (0::'m) i (- A $ (0::'m) $ j)) $ a $ b = row_add A a i (- A $ a $ j) $ a $ b
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
row_add_iterate A 0 i j $ a $ b = row_add A a i (- A $ a $ j) $ a $ b

goal (1 subgoal):
 1. \<And>n A. \<lbrakk>\<And>A. \<lbrakk>a \<noteq> i; n < nrows A; mod_type_class.to_nat a \<le> n\<rbrakk> \<Longrightarrow> row_add_iterate A n i j $ a $ b = row_add A a i (- A $ a $ j) $ a $ b; a \<noteq> i; Suc n < nrows A; mod_type_class.to_nat a \<le> Suc n\<rbrakk> \<Longrightarrow> row_add_iterate A (Suc n) i j $ a $ b = row_add A a i (- A $ a $ j) $ a $ b
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n A. \<lbrakk>\<And>A. \<lbrakk>a \<noteq> i; n < nrows A; mod_type_class.to_nat a \<le> n\<rbrakk> \<Longrightarrow> row_add_iterate A n i j $ a $ b = row_add A a i (- A $ a $ j) $ a $ b; a \<noteq> i; Suc n < nrows A; mod_type_class.to_nat a \<le> Suc n\<rbrakk> \<Longrightarrow> row_add_iterate A (Suc n) i j $ a $ b = row_add A a i (- A $ a $ j) $ a $ b
[PROOF STEP]
fix n and A::"'a::{ring_1}^'n^'m::{mod_type}"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n A. \<lbrakk>\<And>A. \<lbrakk>a \<noteq> i; n < nrows A; mod_type_class.to_nat a \<le> n\<rbrakk> \<Longrightarrow> row_add_iterate A n i j $ a $ b = row_add A a i (- A $ a $ j) $ a $ b; a \<noteq> i; Suc n < nrows A; mod_type_class.to_nat a \<le> Suc n\<rbrakk> \<Longrightarrow> row_add_iterate A (Suc n) i j $ a $ b = row_add A a i (- A $ a $ j) $ a $ b
[PROOF STEP]
assume hyp: "(\<And>A::'a::{ring_1}^'n^'m::{mod_type}. a \<noteq> i \<Longrightarrow> n < nrows A  \<Longrightarrow> to_nat a \<le> n
    \<Longrightarrow> row_add_iterate A n i j $ a $ b = row_add A a i (- A $ a $ j) $ a $ b)"
    and a_not_i: "a \<noteq> i"
    and suc_n_less_card: "Suc n < nrows A"
    and a_le_suc_n: "to_nat a \<le> Suc n"
[PROOF STATE]
proof (state)
this:
\<lbrakk>a \<noteq> i; n < nrows ?A; mod_type_class.to_nat a \<le> n\<rbrakk> \<Longrightarrow> row_add_iterate ?A n i j $ a $ b = row_add ?A a i (- ?A $ a $ j) $ a $ b
a \<noteq> i
Suc n < nrows A
mod_type_class.to_nat a \<le> Suc n

goal (1 subgoal):
 1. \<And>n A. \<lbrakk>\<And>A. \<lbrakk>a \<noteq> i; n < nrows A; mod_type_class.to_nat a \<le> n\<rbrakk> \<Longrightarrow> row_add_iterate A n i j $ a $ b = row_add A a i (- A $ a $ j) $ a $ b; a \<noteq> i; Suc n < nrows A; mod_type_class.to_nat a \<le> Suc n\<rbrakk> \<Longrightarrow> row_add_iterate A (Suc n) i j $ a $ b = row_add A a i (- A $ a $ j) $ a $ b
[PROOF STEP]
show "row_add_iterate A (Suc n) i j $ a $ b = row_add A a i (- A $ a $ j) $ a $ b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. row_add_iterate A (Suc n) i j $ a $ b = row_add A a i (- A $ a $ j) $ a $ b
[PROOF STEP]
proof (cases "Suc n = to_nat i")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. Suc n = mod_type_class.to_nat i \<Longrightarrow> row_add_iterate A (Suc n) i j $ a $ b = row_add A a i (- A $ a $ j) $ a $ b
 2. Suc n \<noteq> mod_type_class.to_nat i \<Longrightarrow> row_add_iterate A (Suc n) i j $ a $ b = row_add A a i (- A $ a $ j) $ a $ b
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
Suc n = mod_type_class.to_nat i

goal (2 subgoals):
 1. Suc n = mod_type_class.to_nat i \<Longrightarrow> row_add_iterate A (Suc n) i j $ a $ b = row_add A a i (- A $ a $ j) $ a $ b
 2. Suc n \<noteq> mod_type_class.to_nat i \<Longrightarrow> row_add_iterate A (Suc n) i j $ a $ b = row_add A a i (- A $ a $ j) $ a $ b
[PROOF STEP]
show "row_add_iterate A (Suc n) i j $ a $ b = row_add A a i (- A $ a $ j) $ a $ b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. row_add_iterate A (Suc n) i j $ a $ b = row_add A a i (- A $ a $ j) $ a $ b
[PROOF STEP]
unfolding row_add_iterate.simps if_P[OF True]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. row_add_iterate A n i j $ a $ b = row_add A a i (- A $ a $ j) $ a $ b
[PROOF STEP]
apply (rule hyp[OF a_not_i], auto simp add: Suc_lessD suc_n_less_card)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mod_type_class.to_nat a \<le> n
[PROOF STEP]
by (metis True a_le_suc_n a_not_i le_SucE to_nat_eq)
[PROOF STATE]
proof (state)
this:
row_add_iterate A (Suc n) i j $ a $ b = row_add A a i (- A $ a $ j) $ a $ b

goal (1 subgoal):
 1. Suc n \<noteq> mod_type_class.to_nat i \<Longrightarrow> row_add_iterate A (Suc n) i j $ a $ b = row_add A a i (- A $ a $ j) $ a $ b
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Suc n \<noteq> mod_type_class.to_nat i \<Longrightarrow> row_add_iterate A (Suc n) i j $ a $ b = row_add A a i (- A $ a $ j) $ a $ b
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
Suc n \<noteq> mod_type_class.to_nat i

goal (1 subgoal):
 1. Suc n \<noteq> mod_type_class.to_nat i \<Longrightarrow> row_add_iterate A (Suc n) i j $ a $ b = row_add A a i (- A $ a $ j) $ a $ b
[PROOF STEP]
note Suc_n_not_i=False
[PROOF STATE]
proof (state)
this:
Suc n \<noteq> mod_type_class.to_nat i

goal (1 subgoal):
 1. Suc n \<noteq> mod_type_class.to_nat i \<Longrightarrow> row_add_iterate A (Suc n) i j $ a $ b = row_add A a i (- A $ a $ j) $ a $ b
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. row_add_iterate A (Suc n) i j $ a $ b = row_add A a i (- A $ a $ j) $ a $ b
[PROOF STEP]
unfolding row_add_iterate.simps if_not_P[OF False]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. row_add_iterate (row_add A (mod_type_class.from_nat (Suc n)) i (- A $ mod_type_class.from_nat (Suc n) $ j)) n i j $ a $ b = row_add A a i (- A $ a $ j) $ a $ b
[PROOF STEP]
proof (cases "to_nat a = Suc n")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. mod_type_class.to_nat a = Suc n \<Longrightarrow> row_add_iterate (row_add A (mod_type_class.from_nat (Suc n)) i (- A $ mod_type_class.from_nat (Suc n) $ j)) n i j $ a $ b = row_add A a i (- A $ a $ j) $ a $ b
 2. mod_type_class.to_nat a \<noteq> Suc n \<Longrightarrow> row_add_iterate (row_add A (mod_type_class.from_nat (Suc n)) i (- A $ mod_type_class.from_nat (Suc n) $ j)) n i j $ a $ b = row_add A a i (- A $ a $ j) $ a $ b
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
mod_type_class.to_nat a = Suc n

goal (2 subgoals):
 1. mod_type_class.to_nat a = Suc n \<Longrightarrow> row_add_iterate (row_add A (mod_type_class.from_nat (Suc n)) i (- A $ mod_type_class.from_nat (Suc n) $ j)) n i j $ a $ b = row_add A a i (- A $ a $ j) $ a $ b
 2. mod_type_class.to_nat a \<noteq> Suc n \<Longrightarrow> row_add_iterate (row_add A (mod_type_class.from_nat (Suc n)) i (- A $ mod_type_class.from_nat (Suc n) $ j)) n i j $ a $ b = row_add A a i (- A $ a $ j) $ a $ b
[PROOF STEP]
show "row_add_iterate (row_add A (from_nat (Suc n)) i (- A $ from_nat (Suc n) $ j)) n i j $ a $ b = row_add A a i (- A $ a $ j) $ a $ b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. row_add_iterate (row_add A (mod_type_class.from_nat (Suc n)) i (- A $ mod_type_class.from_nat (Suc n) $ j)) n i j $ a $ b = row_add A a i (- A $ a $ j) $ a $ b
[PROOF STEP]
by (metis Suc_le_lessD True order_refl less_imp_le row_add_iterate_preserves_greater_than_n suc_n_less_card to_nat_from_nat nrows_def)
[PROOF STATE]
proof (state)
this:
row_add_iterate (row_add A (mod_type_class.from_nat (Suc n)) i (- A $ mod_type_class.from_nat (Suc n) $ j)) n i j $ a $ b = row_add A a i (- A $ a $ j) $ a $ b

goal (1 subgoal):
 1. mod_type_class.to_nat a \<noteq> Suc n \<Longrightarrow> row_add_iterate (row_add A (mod_type_class.from_nat (Suc n)) i (- A $ mod_type_class.from_nat (Suc n) $ j)) n i j $ a $ b = row_add A a i (- A $ a $ j) $ a $ b
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. mod_type_class.to_nat a \<noteq> Suc n \<Longrightarrow> row_add_iterate (row_add A (mod_type_class.from_nat (Suc n)) i (- A $ mod_type_class.from_nat (Suc n) $ j)) n i j $ a $ b = row_add A a i (- A $ a $ j) $ a $ b
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
mod_type_class.to_nat a \<noteq> Suc n

goal (1 subgoal):
 1. mod_type_class.to_nat a \<noteq> Suc n \<Longrightarrow> row_add_iterate (row_add A (mod_type_class.from_nat (Suc n)) i (- A $ mod_type_class.from_nat (Suc n) $ j)) n i j $ a $ b = row_add A a i (- A $ a $ j) $ a $ b
[PROOF STEP]
define A' where "A' = row_add A (from_nat (Suc n)) i (- A $ from_nat (Suc n) $ j)"
[PROOF STATE]
proof (state)
this:
A' = row_add A (mod_type_class.from_nat (Suc n)) i (- A $ mod_type_class.from_nat (Suc n) $ j)

goal (1 subgoal):
 1. mod_type_class.to_nat a \<noteq> Suc n \<Longrightarrow> row_add_iterate (row_add A (mod_type_class.from_nat (Suc n)) i (- A $ mod_type_class.from_nat (Suc n) $ j)) n i j $ a $ b = row_add A a i (- A $ a $ j) $ a $ b
[PROOF STEP]
have rw: "row_add_iterate A' n i j $ a $ b = row_add A' a i (- A' $ a $ j) $ a $ b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. row_add_iterate A' n i j $ a $ b = row_add A' a i (- A' $ a $ j) $ a $ b
[PROOF STEP]
proof (rule hyp)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. a \<noteq> i
 2. n < nrows A'
 3. mod_type_class.to_nat a \<le> n
[PROOF STEP]
show "a \<noteq> i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<noteq> i
[PROOF STEP]
using a_not_i
[PROOF STATE]
proof (prove)
using this:
a \<noteq> i

goal (1 subgoal):
 1. a \<noteq> i
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
a \<noteq> i

goal (2 subgoals):
 1. n < nrows A'
 2. mod_type_class.to_nat a \<le> n
[PROOF STEP]
show "n < nrows A'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n < nrows A'
[PROOF STEP]
using suc_n_less_card
[PROOF STATE]
proof (prove)
using this:
Suc n < nrows A

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

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

goal (1 subgoal):
 1. mod_type_class.to_nat a \<le> n
[PROOF STEP]
show "to_nat a \<le> n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mod_type_class.to_nat a \<le> n
[PROOF STEP]
using False a_le_suc_n
[PROOF STATE]
proof (prove)
using this:
mod_type_class.to_nat a \<noteq> Suc n
mod_type_class.to_nat a \<le> Suc n

goal (1 subgoal):
 1. mod_type_class.to_nat a \<le> n
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
mod_type_class.to_nat a \<le> n

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
row_add_iterate A' n i j $ a $ b = row_add A' a i (- A' $ a $ j) $ a $ b

goal (1 subgoal):
 1. mod_type_class.to_nat a \<noteq> Suc n \<Longrightarrow> row_add_iterate (row_add A (mod_type_class.from_nat (Suc n)) i (- A $ mod_type_class.from_nat (Suc n) $ j)) n i j $ a $ b = row_add A a i (- A $ a $ j) $ a $ b
[PROOF STEP]
have rw1: "row_add A (from_nat (Suc n)) i (- A $ from_nat (Suc n) $ j) $ a $ b = A $ a $ b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. row_add A (mod_type_class.from_nat (Suc n)) i (- A $ mod_type_class.from_nat (Suc n) $ j) $ a $ b = A $ a $ b
[PROOF STEP]
unfolding row_add_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<chi>ia ja. if ia = mod_type_class.from_nat (Suc n) then A $ mod_type_class.from_nat (Suc n) $ ja + - A $ mod_type_class.from_nat (Suc n) $ j * A $ i $ ja else A $ ia $ ja) $ a $ b = A $ a $ b
[PROOF STEP]
using False suc_n_less_card
[PROOF STATE]
proof (prove)
using this:
mod_type_class.to_nat a \<noteq> Suc n
Suc n < nrows A

goal (1 subgoal):
 1. (\<chi>ia ja. if ia = mod_type_class.from_nat (Suc n) then A $ mod_type_class.from_nat (Suc n) $ ja + - A $ mod_type_class.from_nat (Suc n) $ j * A $ i $ ja else A $ ia $ ja) $ a $ b = A $ a $ b
[PROOF STEP]
unfolding nrows_def
[PROOF STATE]
proof (prove)
using this:
mod_type_class.to_nat a \<noteq> Suc n
Suc n < CARD('m)

goal (1 subgoal):
 1. (\<chi>ia ja. if ia = mod_type_class.from_nat (Suc n) then A $ mod_type_class.from_nat (Suc n) $ ja + - A $ mod_type_class.from_nat (Suc n) $ j * A $ i $ ja else A $ ia $ ja) $ a $ b = A $ a $ b
[PROOF STEP]
by (auto simp add: to_nat_from_nat_id)
[PROOF STATE]
proof (state)
this:
row_add A (mod_type_class.from_nat (Suc n)) i (- A $ mod_type_class.from_nat (Suc n) $ j) $ a $ b = A $ a $ b

goal (1 subgoal):
 1. mod_type_class.to_nat a \<noteq> Suc n \<Longrightarrow> row_add_iterate (row_add A (mod_type_class.from_nat (Suc n)) i (- A $ mod_type_class.from_nat (Suc n) $ j)) n i j $ a $ b = row_add A a i (- A $ a $ j) $ a $ b
[PROOF STEP]
have rw2: "row_add A (from_nat (Suc n)) i (- A $ from_nat (Suc n) $ j) $ a $ j = A $ a $ j"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. row_add A (mod_type_class.from_nat (Suc n)) i (- A $ mod_type_class.from_nat (Suc n) $ j) $ a $ j = A $ a $ j
[PROOF STEP]
unfolding row_add_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<chi>ia ja. if ia = mod_type_class.from_nat (Suc n) then A $ mod_type_class.from_nat (Suc n) $ ja + - A $ mod_type_class.from_nat (Suc n) $ j * A $ i $ ja else A $ ia $ ja) $ a $ j = A $ a $ j
[PROOF STEP]
using False suc_n_less_card
[PROOF STATE]
proof (prove)
using this:
mod_type_class.to_nat a \<noteq> Suc n
Suc n < nrows A

goal (1 subgoal):
 1. (\<chi>ia ja. if ia = mod_type_class.from_nat (Suc n) then A $ mod_type_class.from_nat (Suc n) $ ja + - A $ mod_type_class.from_nat (Suc n) $ j * A $ i $ ja else A $ ia $ ja) $ a $ j = A $ a $ j
[PROOF STEP]
unfolding nrows_def
[PROOF STATE]
proof (prove)
using this:
mod_type_class.to_nat a \<noteq> Suc n
Suc n < CARD('m)

goal (1 subgoal):
 1. (\<chi>ia ja. if ia = mod_type_class.from_nat (Suc n) then A $ mod_type_class.from_nat (Suc n) $ ja + - A $ mod_type_class.from_nat (Suc n) $ j * A $ i $ ja else A $ ia $ ja) $ a $ j = A $ a $ j
[PROOF STEP]
by (auto simp add: to_nat_from_nat_id)
[PROOF STATE]
proof (state)
this:
row_add A (mod_type_class.from_nat (Suc n)) i (- A $ mod_type_class.from_nat (Suc n) $ j) $ a $ j = A $ a $ j

goal (1 subgoal):
 1. mod_type_class.to_nat a \<noteq> Suc n \<Longrightarrow> row_add_iterate (row_add A (mod_type_class.from_nat (Suc n)) i (- A $ mod_type_class.from_nat (Suc n) $ j)) n i j $ a $ b = row_add A a i (- A $ a $ j) $ a $ b
[PROOF STEP]
have rw3: "row_add A (from_nat (Suc n)) i (- A $ from_nat (Suc n) $ j) $ i $ b = A $ i $ b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. row_add A (mod_type_class.from_nat (Suc n)) i (- A $ mod_type_class.from_nat (Suc n) $ j) $ i $ b = A $ i $ b
[PROOF STEP]
unfolding row_add_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<chi>ia ja. if ia = mod_type_class.from_nat (Suc n) then A $ mod_type_class.from_nat (Suc n) $ ja + - A $ mod_type_class.from_nat (Suc n) $ j * A $ i $ ja else A $ ia $ ja) $ i $ b = A $ i $ b
[PROOF STEP]
using Suc_n_not_i suc_n_less_card
[PROOF STATE]
proof (prove)
using this:
Suc n \<noteq> mod_type_class.to_nat i
Suc n < nrows A

goal (1 subgoal):
 1. (\<chi>ia ja. if ia = mod_type_class.from_nat (Suc n) then A $ mod_type_class.from_nat (Suc n) $ ja + - A $ mod_type_class.from_nat (Suc n) $ j * A $ i $ ja else A $ ia $ ja) $ i $ b = A $ i $ b
[PROOF STEP]
unfolding nrows_def
[PROOF STATE]
proof (prove)
using this:
Suc n \<noteq> mod_type_class.to_nat i
Suc n < CARD('m)

goal (1 subgoal):
 1. (\<chi>ia ja. if ia = mod_type_class.from_nat (Suc n) then A $ mod_type_class.from_nat (Suc n) $ ja + - A $ mod_type_class.from_nat (Suc n) $ j * A $ i $ ja else A $ ia $ ja) $ i $ b = A $ i $ b
[PROOF STEP]
by (auto simp add: to_nat_from_nat_id)
[PROOF STATE]
proof (state)
this:
row_add A (mod_type_class.from_nat (Suc n)) i (- A $ mod_type_class.from_nat (Suc n) $ j) $ i $ b = A $ i $ b

goal (1 subgoal):
 1. mod_type_class.to_nat a \<noteq> Suc n \<Longrightarrow> row_add_iterate (row_add A (mod_type_class.from_nat (Suc n)) i (- A $ mod_type_class.from_nat (Suc n) $ j)) n i j $ a $ b = row_add A a i (- A $ a $ j) $ a $ b
[PROOF STEP]
show  "row_add_iterate A' n i j $ a $ b = row_add A a i (- A $ a $ j) $ a $ b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. row_add_iterate A' n i j $ a $ b = row_add A a i (- A $ a $ j) $ a $ b
[PROOF STEP]
unfolding rw row_add_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<chi>ia ja. if ia = a then A' $ a $ ja + - A' $ a $ j * A' $ i $ ja else A' $ ia $ ja) $ a $ b = (\<chi>ia ja. if ia = a then A $ a $ ja + - A $ a $ j * A $ i $ ja else A $ ia $ ja) $ a $ b
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A' $ a $ b - A' $ a $ j * A' $ i $ b = A $ a $ b - A $ a $ j * A $ i $ b
[PROOF STEP]
unfolding A'_def rw1 rw2 rw3
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A $ a $ b - A $ a $ j * A $ i $ b = A $ a $ b - A $ a $ j * A $ i $ b
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
row_add_iterate A' n i j $ a $ b = row_add A a i (- A $ a $ j) $ a $ b

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
row_add_iterate A (Suc n) i j $ a $ b = row_add A a i (- A $ a $ j) $ a $ b

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
row_add_iterate A (Suc n) i j $ a $ b = row_add A a i (- A $ a $ j) $ a $ b

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma jumpF_pathstart_linepath:
  "jumpF_pathstart (linepath a b) z =
    (if Re a = Re z \<and> Im a\<noteq>Im z \<and> Re b \<noteq> Re a then
        if (Im a>Im z \<and> Re b > Re a) \<or> (Im a<Im z \<and> Re b < Re a) then 1/2 else -1/2
     else 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. jumpF_pathstart (linepath a b) z = (if Re a = Re z \<and> Im a \<noteq> Im z \<and> Re b \<noteq> Re a then if Im z < Im a \<and> Re a < Re b \<or> Im a < Im z \<and> Re b < Re a then 1 / 2 else - 1 / 2 else 0)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. jumpF_pathstart (linepath a b) z = (if Re a = Re z \<and> Im a \<noteq> Im z \<and> Re b \<noteq> Re a then if Im z < Im a \<and> Re a < Re b \<or> Im a < Im z \<and> Re b < Re a then 1 / 2 else - 1 / 2 else 0)
[PROOF STEP]
define f where "f=(\<lambda>t. (Im b - Im a )* t + (Im a - Im z))"
[PROOF STATE]
proof (state)
this:
f = (\<lambda>t. (Im b - Im a) * t + (Im a - Im z))

goal (1 subgoal):
 1. jumpF_pathstart (linepath a b) z = (if Re a = Re z \<and> Im a \<noteq> Im z \<and> Re b \<noteq> Re a then if Im z < Im a \<and> Re a < Re b \<or> Im a < Im z \<and> Re b < Re a then 1 / 2 else - 1 / 2 else 0)
[PROOF STEP]
define g where "g=(\<lambda>t. (Re b - Re a )* t + (Re a - Re z))"
[PROOF STATE]
proof (state)
this:
g = (\<lambda>t. (Re b - Re a) * t + (Re a - Re z))

goal (1 subgoal):
 1. jumpF_pathstart (linepath a b) z = (if Re a = Re z \<and> Im a \<noteq> Im z \<and> Re b \<noteq> Re a then if Im z < Im a \<and> Re a < Re b \<or> Im a < Im z \<and> Re b < Re a then 1 / 2 else - 1 / 2 else 0)
[PROOF STEP]
have jump_eq:"jumpF_pathstart (linepath a b) z = jumpF (\<lambda>t. f t/g t) (at_right 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. jumpF_pathstart (linepath a b) z = jumpF (\<lambda>t. f t / g t) (at_right 0)
[PROOF STEP]
unfolding jumpF_pathstart_def f_def linepath_def g_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. jumpF (\<lambda>t. Im ((1 - t) *\<^sub>R a + t *\<^sub>R b - z) / Re ((1 - t) *\<^sub>R a + t *\<^sub>R b - z)) (at_right 0) = jumpF (\<lambda>t. ((Im b - Im a) * t + (Im a - Im z)) / ((Re b - Re a) * t + (Re a - Re z))) (at_right 0)
[PROOF STEP]
by (auto simp add:algebra_simps)
[PROOF STATE]
proof (state)
this:
jumpF_pathstart (linepath a b) z = jumpF (\<lambda>t. f t / g t) (at_right 0)

goal (1 subgoal):
 1. jumpF_pathstart (linepath a b) z = (if Re a = Re z \<and> Im a \<noteq> Im z \<and> Re b \<noteq> Re a then if Im z < Im a \<and> Re a < Re b \<or> Im a < Im z \<and> Re b < Re a then 1 / 2 else - 1 / 2 else 0)
[PROOF STEP]
have ?thesis when "Re a\<noteq>Re z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. jumpF_pathstart (linepath a b) z = (if Re a = Re z \<and> Im a \<noteq> Im z \<and> Re b \<noteq> Re a then if Im z < Im a \<and> Re a < Re b \<or> Im a < Im z \<and> Re b < Re a then 1 / 2 else - 1 / 2 else 0)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. jumpF_pathstart (linepath a b) z = (if Re a = Re z \<and> Im a \<noteq> Im z \<and> Re b \<noteq> Re a then if Im z < Im a \<and> Re a < Re b \<or> Im a < Im z \<and> Re b < Re a then 1 / 2 else - 1 / 2 else 0)
[PROOF STEP]
have "jumpF_pathstart (linepath a b) z = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. jumpF_pathstart (linepath a b) z = 0
[PROOF STEP]
unfolding jumpF_pathstart_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. jumpF (\<lambda>t. Im (linepath a b t - z) / Re (linepath a b t - z)) (at_right 0) = 0
[PROOF STEP]
apply (rule jumpF_im_divide_Re_0)
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. path (\<lambda>t. linepath a b t - z)
 2. Re (linepath a b 0 - z) \<noteq> 0
 3. 0 \<le> 0
 4. 0 < 1
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Re (linepath a b 0) = Re z \<Longrightarrow> False
[PROOF STEP]
by (auto simp add:linepath_def that)
[PROOF STATE]
proof (state)
this:
jumpF_pathstart (linepath a b) z = 0

goal (1 subgoal):
 1. jumpF_pathstart (linepath a b) z = (if Re a = Re z \<and> Im a \<noteq> Im z \<and> Re b \<noteq> Re a then if Im z < Im a \<and> Re a < Re b \<or> Im a < Im z \<and> Re b < Re a then 1 / 2 else - 1 / 2 else 0)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
jumpF_pathstart (linepath a b) z = 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
jumpF_pathstart (linepath a b) z = 0

goal (1 subgoal):
 1. jumpF_pathstart (linepath a b) z = (if Re a = Re z \<and> Im a \<noteq> Im z \<and> Re b \<noteq> Re a then if Im z < Im a \<and> Re a < Re b \<or> Im a < Im z \<and> Re b < Re a then 1 / 2 else - 1 / 2 else 0)
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
jumpF_pathstart (linepath a b) z = 0
Re a \<noteq> Re z

goal (1 subgoal):
 1. jumpF_pathstart (linepath a b) z = (if Re a = Re z \<and> Im a \<noteq> Im z \<and> Re b \<noteq> Re a then if Im z < Im a \<and> Re a < Re b \<or> Im a < Im z \<and> Re b < Re a then 1 / 2 else - 1 / 2 else 0)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
jumpF_pathstart (linepath a b) z = (if Re a = Re z \<and> Im a \<noteq> Im z \<and> Re b \<noteq> Re a then if Im z < Im a \<and> Re a < Re b \<or> Im a < Im z \<and> Re b < Re a then 1 / 2 else - 1 / 2 else 0)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
Re a \<noteq> Re z \<Longrightarrow> jumpF_pathstart (linepath a b) z = (if Re a = Re z \<and> Im a \<noteq> Im z \<and> Re b \<noteq> Re a then if Im z < Im a \<and> Re a < Re b \<or> Im a < Im z \<and> Re b < Re a then 1 / 2 else - 1 / 2 else 0)

goal (1 subgoal):
 1. jumpF_pathstart (linepath a b) z = (if Re a = Re z \<and> Im a \<noteq> Im z \<and> Re b \<noteq> Re a then if Im z < Im a \<and> Re a < Re b \<or> Im a < Im z \<and> Re b < Re a then 1 / 2 else - 1 / 2 else 0)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
Re a \<noteq> Re z \<Longrightarrow> jumpF_pathstart (linepath a b) z = (if Re a = Re z \<and> Im a \<noteq> Im z \<and> Re b \<noteq> Re a then if Im z < Im a \<and> Re a < Re b \<or> Im a < Im z \<and> Re b < Re a then 1 / 2 else - 1 / 2 else 0)

goal (1 subgoal):
 1. jumpF_pathstart (linepath a b) z = (if Re a = Re z \<and> Im a \<noteq> Im z \<and> Re b \<noteq> Re a then if Im z < Im a \<and> Re a < Re b \<or> Im a < Im z \<and> Re b < Re a then 1 / 2 else - 1 / 2 else 0)
[PROOF STEP]
have ?thesis when "Re a=Re z" "Im a = Im z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. jumpF_pathstart (linepath a b) z = (if Re a = Re z \<and> Im a \<noteq> Im z \<and> Re b \<noteq> Re a then if Im z < Im a \<and> Re a < Re b \<or> Im a < Im z \<and> Re b < Re a then 1 / 2 else - 1 / 2 else 0)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. jumpF_pathstart (linepath a b) z = (if Re a = Re z \<and> Im a \<noteq> Im z \<and> Re b \<noteq> Re a then if Im z < Im a \<and> Re a < Re b \<or> Im a < Im z \<and> Re b < Re a then 1 / 2 else - 1 / 2 else 0)
[PROOF STEP]
define c where "c=(Im b - Im a) / (Re b - Re a)"
[PROOF STATE]
proof (state)
this:
c = (Im b - Im a) / (Re b - Re a)

goal (1 subgoal):
 1. jumpF_pathstart (linepath a b) z = (if Re a = Re z \<and> Im a \<noteq> Im z \<and> Re b \<noteq> Re a then if Im z < Im a \<and> Re a < Re b \<or> Im a < Im z \<and> Re b < Re a then 1 / 2 else - 1 / 2 else 0)
[PROOF STEP]
have "jumpF (\<lambda>t. f t/g t) (at_right 0) = jumpF (\<lambda>_. c) (at_right 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. jumpF (\<lambda>t. f t / g t) (at_right 0) = jumpF (\<lambda>_. c) (at_right 0)
[PROOF STEP]
proof (rule jumpF_cong)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. at_right 0 = at_right 0
 2. \<forall>\<^sub>F x in at_right 0. f x / g x = c
[PROOF STEP]
show "\<forall>\<^sub>F x in at_right 0. f x / g x = c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_right 0. f x / g x = c
[PROOF STEP]
unfolding eventually_at_right f_def g_def c_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>ba>0. \<forall>y>0. y < ba \<longrightarrow> ((Im b - Im a) * y + (Im a - Im z)) / ((Re b - Re a) * y + (Re a - Re z)) = (Im b - Im a) / (Re b - Re a)
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
Re a = Re z
Im a = Im z

goal (1 subgoal):
 1. \<exists>ba>0. \<forall>y>0. y < ba \<longrightarrow> ((Im b - Im a) * y + (Im a - Im z)) / ((Re b - Re a) * y + (Re a - Re z)) = (Im b - Im a) / (Re b - Re a)
[PROOF STEP]
apply (intro exI[where x=1])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Re a = Re z; Im a = Im z\<rbrakk> \<Longrightarrow> 0 < 1 \<and> (\<forall>y>0. y < 1 \<longrightarrow> ((Im b - Im a) * y + (Im a - Im z)) / ((Re b - Re a) * y + (Re a - Re z)) = (Im b - Im a) / (Re b - Re a))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in at_right 0. f x / g x = c

goal (1 subgoal):
 1. at_right 0 = at_right 0
[PROOF STEP]
qed simp
[PROOF STATE]
proof (state)
this:
jumpF (\<lambda>t. f t / g t) (at_right 0) = jumpF (\<lambda>_. c) (at_right 0)

goal (1 subgoal):
 1. jumpF_pathstart (linepath a b) z = (if Re a = Re z \<and> Im a \<noteq> Im z \<and> Re b \<noteq> Re a then if Im z < Im a \<and> Re a < Re b \<or> Im a < Im z \<and> Re b < Re a then 1 / 2 else - 1 / 2 else 0)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
jumpF (\<lambda>t. f t / g t) (at_right 0) = jumpF (\<lambda>_. c) (at_right 0)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
jumpF (\<lambda>t. f t / g t) (at_right 0) = jumpF (\<lambda>_. c) (at_right 0)

goal (1 subgoal):
 1. jumpF_pathstart (linepath a b) z = (if Re a = Re z \<and> Im a \<noteq> Im z \<and> Re b \<noteq> Re a then if Im z < Im a \<and> Re a < Re b \<or> Im a < Im z \<and> Re b < Re a then 1 / 2 else - 1 / 2 else 0)
[PROOF STEP]
using jump_eq that
[PROOF STATE]
proof (prove)
using this:
jumpF (\<lambda>t. f t / g t) (at_right 0) = jumpF (\<lambda>_. c) (at_right 0)
jumpF_pathstart (linepath a b) z = jumpF (\<lambda>t. f t / g t) (at_right 0)
Re a = Re z
Im a = Im z

goal (1 subgoal):
 1. jumpF_pathstart (linepath a b) z = (if Re a = Re z \<and> Im a \<noteq> Im z \<and> Re b \<noteq> Re a then if Im z < Im a \<and> Re a < Re b \<or> Im a < Im z \<and> Re b < Re a then 1 / 2 else - 1 / 2 else 0)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
jumpF_pathstart (linepath a b) z = (if Re a = Re z \<and> Im a \<noteq> Im z \<and> Re b \<noteq> Re a then if Im z < Im a \<and> Re a < Re b \<or> Im a < Im z \<and> Re b < Re a then 1 / 2 else - 1 / 2 else 0)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<lbrakk>Re a = Re z; Im a = Im z\<rbrakk> \<Longrightarrow> jumpF_pathstart (linepath a b) z = (if Re a = Re z \<and> Im a \<noteq> Im z \<and> Re b \<noteq> Re a then if Im z < Im a \<and> Re a < Re b \<or> Im a < Im z \<and> Re b < Re a then 1 / 2 else - 1 / 2 else 0)

goal (1 subgoal):
 1. jumpF_pathstart (linepath a b) z = (if Re a = Re z \<and> Im a \<noteq> Im z \<and> Re b \<noteq> Re a then if Im z < Im a \<and> Re a < Re b \<or> Im a < Im z \<and> Re b < Re a then 1 / 2 else - 1 / 2 else 0)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<lbrakk>Re a = Re z; Im a = Im z\<rbrakk> \<Longrightarrow> jumpF_pathstart (linepath a b) z = (if Re a = Re z \<and> Im a \<noteq> Im z \<and> Re b \<noteq> Re a then if Im z < Im a \<and> Re a < Re b \<or> Im a < Im z \<and> Re b < Re a then 1 / 2 else - 1 / 2 else 0)

goal (1 subgoal):
 1. jumpF_pathstart (linepath a b) z = (if Re a = Re z \<and> Im a \<noteq> Im z \<and> Re b \<noteq> Re a then if Im z < Im a \<and> Re a < Re b \<or> Im a < Im z \<and> Re b < Re a then 1 / 2 else - 1 / 2 else 0)
[PROOF STEP]
have ?thesis when "Re a=Re z" "Re b = Re a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. jumpF_pathstart (linepath a b) z = (if Re a = Re z \<and> Im a \<noteq> Im z \<and> Re b \<noteq> Re a then if Im z < Im a \<and> Re a < Re b \<or> Im a < Im z \<and> Re b < Re a then 1 / 2 else - 1 / 2 else 0)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. jumpF_pathstart (linepath a b) z = (if Re a = Re z \<and> Im a \<noteq> Im z \<and> Re b \<noteq> Re a then if Im z < Im a \<and> Re a < Re b \<or> Im a < Im z \<and> Re b < Re a then 1 / 2 else - 1 / 2 else 0)
[PROOF STEP]
have "(\<lambda>t. f t/g t) = (\<lambda>_. 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>t. f t / g t) = (\<lambda>_. 0)
[PROOF STEP]
unfolding f_def g_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>t. ((Im b - Im a) * t + (Im a - Im z)) / ((Re b - Re a) * t + (Re a - Re z))) = (\<lambda>_. 0)
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
Re a = Re z
Re b = Re a

goal (1 subgoal):
 1. (\<lambda>t. ((Im b - Im a) * t + (Im a - Im z)) / ((Re b - Re a) * t + (Re a - Re z))) = (\<lambda>_. 0)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<lambda>t. f t / g t) = (\<lambda>_. 0)

goal (1 subgoal):
 1. jumpF_pathstart (linepath a b) z = (if Re a = Re z \<and> Im a \<noteq> Im z \<and> Re b \<noteq> Re a then if Im z < Im a \<and> Re a < Re b \<or> Im a < Im z \<and> Re b < Re a then 1 / 2 else - 1 / 2 else 0)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>t. f t / g t) = (\<lambda>_. 0)
[PROOF STEP]
have "jumpF (\<lambda>t. f t/g t) (at_right 0) = jumpF (\<lambda>_. 0) (at_right 0)"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>t. f t / g t) = (\<lambda>_. 0)

goal (1 subgoal):
 1. jumpF (\<lambda>t. f t / g t) (at_right 0) = jumpF (\<lambda>_. 0) (at_right 0)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
jumpF (\<lambda>t. f t / g t) (at_right 0) = jumpF (\<lambda>_. 0) (at_right 0)

goal (1 subgoal):
 1. jumpF_pathstart (linepath a b) z = (if Re a = Re z \<and> Im a \<noteq> Im z \<and> Re b \<noteq> Re a then if Im z < Im a \<and> Re a < Re b \<or> Im a < Im z \<and> Re b < Re a then 1 / 2 else - 1 / 2 else 0)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
jumpF (\<lambda>t. f t / g t) (at_right 0) = jumpF (\<lambda>_. 0) (at_right 0)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
jumpF (\<lambda>t. f t / g t) (at_right 0) = jumpF (\<lambda>_. 0) (at_right 0)

goal (1 subgoal):
 1. jumpF_pathstart (linepath a b) z = (if Re a = Re z \<and> Im a \<noteq> Im z \<and> Re b \<noteq> Re a then if Im z < Im a \<and> Re a < Re b \<or> Im a < Im z \<and> Re b < Re a then 1 / 2 else - 1 / 2 else 0)
[PROOF STEP]
using jump_eq that
[PROOF STATE]
proof (prove)
using this:
jumpF (\<lambda>t. f t / g t) (at_right 0) = jumpF (\<lambda>_. 0) (at_right 0)
jumpF_pathstart (linepath a b) z = jumpF (\<lambda>t. f t / g t) (at_right 0)
Re a = Re z
Re b = Re a

goal (1 subgoal):
 1. jumpF_pathstart (linepath a b) z = (if Re a = Re z \<and> Im a \<noteq> Im z \<and> Re b \<noteq> Re a then if Im z < Im a \<and> Re a < Re b \<or> Im a < Im z \<and> Re b < Re a then 1 / 2 else - 1 / 2 else 0)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
jumpF_pathstart (linepath a b) z = (if Re a = Re z \<and> Im a \<noteq> Im z \<and> Re b \<noteq> Re a then if Im z < Im a \<and> Re a < Re b \<or> Im a < Im z \<and> Re b < Re a then 1 / 2 else - 1 / 2 else 0)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<lbrakk>Re a = Re z; Re b = Re a\<rbrakk> \<Longrightarrow> jumpF_pathstart (linepath a b) z = (if Re a = Re z \<and> Im a \<noteq> Im z \<and> Re b \<noteq> Re a then if Im z < Im a \<and> Re a < Re b \<or> Im a < Im z \<and> Re b < Re a then 1 / 2 else - 1 / 2 else 0)

goal (1 subgoal):
 1. jumpF_pathstart (linepath a b) z = (if Re a = Re z \<and> Im a \<noteq> Im z \<and> Re b \<noteq> Re a then if Im z < Im a \<and> Re a < Re b \<or> Im a < Im z \<and> Re b < Re a then 1 / 2 else - 1 / 2 else 0)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<lbrakk>Re a = Re z; Re b = Re a\<rbrakk> \<Longrightarrow> jumpF_pathstart (linepath a b) z = (if Re a = Re z \<and> Im a \<noteq> Im z \<and> Re b \<noteq> Re a then if Im z < Im a \<and> Re a < Re b \<or> Im a < Im z \<and> Re b < Re a then 1 / 2 else - 1 / 2 else 0)

goal (1 subgoal):
 1. jumpF_pathstart (linepath a b) z = (if Re a = Re z \<and> Im a \<noteq> Im z \<and> Re b \<noteq> Re a then if Im z < Im a \<and> Re a < Re b \<or> Im a < Im z \<and> Re b < Re a then 1 / 2 else - 1 / 2 else 0)
[PROOF STEP]
have ?thesis when "Re a = Re z" "(Im a>Im z \<and> Re b > Re a) \<or> (Im a<Im z \<and> Re b < Re a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. jumpF_pathstart (linepath a b) z = (if Re a = Re z \<and> Im a \<noteq> Im z \<and> Re b \<noteq> Re a then if Im z < Im a \<and> Re a < Re b \<or> Im a < Im z \<and> Re b < Re a then 1 / 2 else - 1 / 2 else 0)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. jumpF_pathstart (linepath a b) z = (if Re a = Re z \<and> Im a \<noteq> Im z \<and> Re b \<noteq> Re a then if Im z < Im a \<and> Re a < Re b \<or> Im a < Im z \<and> Re b < Re a then 1 / 2 else - 1 / 2 else 0)
[PROOF STEP]
have "LIM x at_right 0. f x / g x :> at_top"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. LIM x at_right 0. f x / g x :> at_top
[PROOF STEP]
apply (subst filterlim_divide_at_bot_at_top_iff[of _ "Im a - Im z"])
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. (f \<longlongrightarrow> Im a - Im z) (at_right 0)
 2. Im a - Im z \<noteq> 0
 3. (g \<longlongrightarrow> 0) (at_right 0) \<and> (g has_sgnx sgn (Im a - Im z)) (at_right 0)
[PROOF STEP]
unfolding f_def g_def
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. ((\<lambda>t. (Im b - Im a) * t + (Im a - Im z)) \<longlongrightarrow> Im a - Im z) (at_right 0)
 2. Im a - Im z \<noteq> 0
 3. ((\<lambda>t. (Re b - Re a) * t + (Re a - Re z)) \<longlongrightarrow> 0) (at_right 0) \<and> ((\<lambda>t. (Re b - Re a) * t + (Re a - Re z)) has_sgnx sgn (Im a - Im z)) (at_right 0)
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
Re a = Re z
Im z < Im a \<and> Re a < Re b \<or> Im a < Im z \<and> Re b < Re a

goal (3 subgoals):
 1. ((\<lambda>t. (Im b - Im a) * t + (Im a - Im z)) \<longlongrightarrow> Im a - Im z) (at_right 0)
 2. Im a - Im z \<noteq> 0
 3. ((\<lambda>t. (Re b - Re a) * t + (Re a - Re z)) \<longlongrightarrow> 0) (at_right 0) \<and> ((\<lambda>t. (Re b - Re a) * t + (Re a - Re z)) has_sgnx sgn (Im a - Im z)) (at_right 0)
[PROOF STEP]
by (auto intro!:tendsto_eq_intros sgnx_eq_intros)
[PROOF STATE]
proof (state)
this:
LIM x at_right 0. f x / g x :> at_top

goal (1 subgoal):
 1. jumpF_pathstart (linepath a b) z = (if Re a = Re z \<and> Im a \<noteq> Im z \<and> Re b \<noteq> Re a then if Im z < Im a \<and> Re a < Re b \<or> Im a < Im z \<and> Re b < Re a then 1 / 2 else - 1 / 2 else 0)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
LIM x at_right 0. f x / g x :> at_top
[PROOF STEP]
have "jumpF (\<lambda>t. f t/g t) (at_right 0) = 1/2"
[PROOF STATE]
proof (prove)
using this:
LIM x at_right 0. f x / g x :> at_top

goal (1 subgoal):
 1. jumpF (\<lambda>t. f t / g t) (at_right 0) = 1 / 2
[PROOF STEP]
unfolding jumpF_def
[PROOF STATE]
proof (prove)
using this:
LIM x at_right 0. f x / g x :> at_top

goal (1 subgoal):
 1. (if LIM t at_right 0. f t / g t :> at_top then 1 / 2 else if LIM t at_right 0. f t / g t :> at_bot then - 1 / 2 else 0) = 1 / 2
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
jumpF (\<lambda>t. f t / g t) (at_right 0) = 1 / 2

goal (1 subgoal):
 1. jumpF_pathstart (linepath a b) z = (if Re a = Re z \<and> Im a \<noteq> Im z \<and> Re b \<noteq> Re a then if Im z < Im a \<and> Re a < Re b \<or> Im a < Im z \<and> Re b < Re a then 1 / 2 else - 1 / 2 else 0)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
jumpF (\<lambda>t. f t / g t) (at_right 0) = 1 / 2
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
jumpF (\<lambda>t. f t / g t) (at_right 0) = 1 / 2

goal (1 subgoal):
 1. jumpF_pathstart (linepath a b) z = (if Re a = Re z \<and> Im a \<noteq> Im z \<and> Re b \<noteq> Re a then if Im z < Im a \<and> Re a < Re b \<or> Im a < Im z \<and> Re b < Re a then 1 / 2 else - 1 / 2 else 0)
[PROOF STEP]
using jump_eq that
[PROOF STATE]
proof (prove)
using this:
jumpF (\<lambda>t. f t / g t) (at_right 0) = 1 / 2
jumpF_pathstart (linepath a b) z = jumpF (\<lambda>t. f t / g t) (at_right 0)
Re a = Re z
Im z < Im a \<and> Re a < Re b \<or> Im a < Im z \<and> Re b < Re a

goal (1 subgoal):
 1. jumpF_pathstart (linepath a b) z = (if Re a = Re z \<and> Im a \<noteq> Im z \<and> Re b \<noteq> Re a then if Im z < Im a \<and> Re a < Re b \<or> Im a < Im z \<and> Re b < Re a then 1 / 2 else - 1 / 2 else 0)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
jumpF_pathstart (linepath a b) z = (if Re a = Re z \<and> Im a \<noteq> Im z \<and> Re b \<noteq> Re a then if Im z < Im a \<and> Re a < Re b \<or> Im a < Im z \<and> Re b < Re a then 1 / 2 else - 1 / 2 else 0)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<lbrakk>Re a = Re z; Im z < Im a \<and> Re a < Re b \<or> Im a < Im z \<and> Re b < Re a\<rbrakk> \<Longrightarrow> jumpF_pathstart (linepath a b) z = (if Re a = Re z \<and> Im a \<noteq> Im z \<and> Re b \<noteq> Re a then if Im z < Im a \<and> Re a < Re b \<or> Im a < Im z \<and> Re b < Re a then 1 / 2 else - 1 / 2 else 0)

goal (1 subgoal):
 1. jumpF_pathstart (linepath a b) z = (if Re a = Re z \<and> Im a \<noteq> Im z \<and> Re b \<noteq> Re a then if Im z < Im a \<and> Re a < Re b \<or> Im a < Im z \<and> Re b < Re a then 1 / 2 else - 1 / 2 else 0)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<lbrakk>Re a = Re z; Im z < Im a \<and> Re a < Re b \<or> Im a < Im z \<and> Re b < Re a\<rbrakk> \<Longrightarrow> jumpF_pathstart (linepath a b) z = (if Re a = Re z \<and> Im a \<noteq> Im z \<and> Re b \<noteq> Re a then if Im z < Im a \<and> Re a < Re b \<or> Im a < Im z \<and> Re b < Re a then 1 / 2 else - 1 / 2 else 0)

goal (1 subgoal):
 1. jumpF_pathstart (linepath a b) z = (if Re a = Re z \<and> Im a \<noteq> Im z \<and> Re b \<noteq> Re a then if Im z < Im a \<and> Re a < Re b \<or> Im a < Im z \<and> Re b < Re a then 1 / 2 else - 1 / 2 else 0)
[PROOF STEP]
have ?thesis when "Re a = Re z" "Im a\<noteq>Im z" "Re b \<noteq> Re a"
      "\<not> ((Im a>Im z \<and> Re b > Re a) \<or> (Im a<Im z \<and> Re b < Re a))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. jumpF_pathstart (linepath a b) z = (if Re a = Re z \<and> Im a \<noteq> Im z \<and> Re b \<noteq> Re a then if Im z < Im a \<and> Re a < Re b \<or> Im a < Im z \<and> Re b < Re a then 1 / 2 else - 1 / 2 else 0)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. jumpF_pathstart (linepath a b) z = (if Re a = Re z \<and> Im a \<noteq> Im z \<and> Re b \<noteq> Re a then if Im z < Im a \<and> Re a < Re b \<or> Im a < Im z \<and> Re b < Re a then 1 / 2 else - 1 / 2 else 0)
[PROOF STEP]
have "(Im a>Im z \<and> Re b < Re a) \<or> (Im a<Im z \<and> Re b > Re a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Im z < Im a \<and> Re b < Re a \<or> Im a < Im z \<and> Re a < Re b
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
Re a = Re z
Im a \<noteq> Im z
Re b \<noteq> Re a
\<not> (Im z < Im a \<and> Re a < Re b \<or> Im a < Im z \<and> Re b < Re a)

goal (1 subgoal):
 1. Im z < Im a \<and> Re b < Re a \<or> Im a < Im z \<and> Re a < Re b
[PROOF STEP]
by argo
[PROOF STATE]
proof (state)
this:
Im z < Im a \<and> Re b < Re a \<or> Im a < Im z \<and> Re a < Re b

goal (1 subgoal):
 1. jumpF_pathstart (linepath a b) z = (if Re a = Re z \<and> Im a \<noteq> Im z \<and> Re b \<noteq> Re a then if Im z < Im a \<and> Re a < Re b \<or> Im a < Im z \<and> Re b < Re a then 1 / 2 else - 1 / 2 else 0)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
Im z < Im a \<and> Re b < Re a \<or> Im a < Im z \<and> Re a < Re b
[PROOF STEP]
have "LIM x at_right 0. f x / g x :> at_bot"
[PROOF STATE]
proof (prove)
using this:
Im z < Im a \<and> Re b < Re a \<or> Im a < Im z \<and> Re a < Re b

goal (1 subgoal):
 1. LIM x at_right 0. f x / g x :> at_bot
[PROOF STEP]
apply (subst filterlim_divide_at_bot_at_top_iff[of _ "Im a - Im z"])
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. Im z < Im a \<and> Re b < Re a \<or> Im a < Im z \<and> Re a < Re b \<Longrightarrow> (f \<longlongrightarrow> Im a - Im z) (at_right 0)
 2. Im z < Im a \<and> Re b < Re a \<or> Im a < Im z \<and> Re a < Re b \<Longrightarrow> Im a - Im z \<noteq> 0
 3. Im z < Im a \<and> Re b < Re a \<or> Im a < Im z \<and> Re a < Re b \<Longrightarrow> (g \<longlongrightarrow> 0) (at_right 0) \<and> (g has_sgnx - sgn (Im a - Im z)) (at_right 0)
[PROOF STEP]
unfolding f_def g_def
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. Im z < Im a \<and> Re b < Re a \<or> Im a < Im z \<and> Re a < Re b \<Longrightarrow> ((\<lambda>t. (Im b - Im a) * t + (Im a - Im z)) \<longlongrightarrow> Im a - Im z) (at_right 0)
 2. Im z < Im a \<and> Re b < Re a \<or> Im a < Im z \<and> Re a < Re b \<Longrightarrow> Im a - Im z \<noteq> 0
 3. Im z < Im a \<and> Re b < Re a \<or> Im a < Im z \<and> Re a < Re b \<Longrightarrow> ((\<lambda>t. (Re b - Re a) * t + (Re a - Re z)) \<longlongrightarrow> 0) (at_right 0) \<and> ((\<lambda>t. (Re b - Re a) * t + (Re a - Re z)) has_sgnx - sgn (Im a - Im z)) (at_right 0)
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
Re a = Re z
Im a \<noteq> Im z
Re b \<noteq> Re a
\<not> (Im z < Im a \<and> Re a < Re b \<or> Im a < Im z \<and> Re b < Re a)

goal (3 subgoals):
 1. Im z < Im a \<and> Re b < Re a \<or> Im a < Im z \<and> Re a < Re b \<Longrightarrow> ((\<lambda>t. (Im b - Im a) * t + (Im a - Im z)) \<longlongrightarrow> Im a - Im z) (at_right 0)
 2. Im z < Im a \<and> Re b < Re a \<or> Im a < Im z \<and> Re a < Re b \<Longrightarrow> Im a - Im z \<noteq> 0
 3. Im z < Im a \<and> Re b < Re a \<or> Im a < Im z \<and> Re a < Re b \<Longrightarrow> ((\<lambda>t. (Re b - Re a) * t + (Re a - Re z)) \<longlongrightarrow> 0) (at_right 0) \<and> ((\<lambda>t. (Re b - Re a) * t + (Re a - Re z)) has_sgnx - sgn (Im a - Im z)) (at_right 0)
[PROOF STEP]
by (auto intro!:tendsto_eq_intros sgnx_eq_intros)
[PROOF STATE]
proof (state)
this:
LIM x at_right 0. f x / g x :> at_bot

goal (1 subgoal):
 1. jumpF_pathstart (linepath a b) z = (if Re a = Re z \<and> Im a \<noteq> Im z \<and> Re b \<noteq> Re a then if Im z < Im a \<and> Re a < Re b \<or> Im a < Im z \<and> Re b < Re a then 1 / 2 else - 1 / 2 else 0)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
LIM x at_right 0. f x / g x :> at_bot

goal (1 subgoal):
 1. jumpF_pathstart (linepath a b) z = (if Re a = Re z \<and> Im a \<noteq> Im z \<and> Re b \<noteq> Re a then if Im z < Im a \<and> Re a < Re b \<or> Im a < Im z \<and> Re b < Re a then 1 / 2 else - 1 / 2 else 0)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
LIM x at_right 0. f x / g x :> at_bot
[PROOF STEP]
have "\<not> (LIM x at_right 0. f x / g x :> at_top)"
[PROOF STATE]
proof (prove)
using this:
LIM x at_right 0. f x / g x :> at_bot

goal (1 subgoal):
 1. \<not> (LIM x at_right 0. f x / g x :> at_top)
[PROOF STEP]
using filterlim_at_top_at_bot
[PROOF STATE]
proof (prove)
using this:
LIM x at_right 0. f x / g x :> at_bot
\<lbrakk>filterlim ?f at_top ?F; filterlim ?f at_bot ?F; ?F \<noteq> bot\<rbrakk> \<Longrightarrow> False

goal (1 subgoal):
 1. \<not> (LIM x at_right 0. f x / g x :> at_top)
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
\<not> (LIM x at_right 0. f x / g x :> at_top)

goal (1 subgoal):
 1. jumpF_pathstart (linepath a b) z = (if Re a = Re z \<and> Im a \<noteq> Im z \<and> Re b \<noteq> Re a then if Im z < Im a \<and> Re a < Re b \<or> Im a < Im z \<and> Re b < Re a then 1 / 2 else - 1 / 2 else 0)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
LIM x at_right 0. f x / g x :> at_bot
\<not> (LIM x at_right 0. f x / g x :> at_top)
[PROOF STEP]
have "jumpF (\<lambda>t. f t/g t) (at_right 0) = - 1/2"
[PROOF STATE]
proof (prove)
using this:
LIM x at_right 0. f x / g x :> at_bot
\<not> (LIM x at_right 0. f x / g x :> at_top)

goal (1 subgoal):
 1. jumpF (\<lambda>t. f t / g t) (at_right 0) = - 1 / 2
[PROOF STEP]
unfolding jumpF_def
[PROOF STATE]
proof (prove)
using this:
LIM x at_right 0. f x / g x :> at_bot
\<not> (LIM x at_right 0. f x / g x :> at_top)

goal (1 subgoal):
 1. (if LIM t at_right 0. f t / g t :> at_top then 1 / 2 else if LIM t at_right 0. f t / g t :> at_bot then - 1 / 2 else 0) = - 1 / 2
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
jumpF (\<lambda>t. f t / g t) (at_right 0) = - 1 / 2

goal (1 subgoal):
 1. jumpF_pathstart (linepath a b) z = (if Re a = Re z \<and> Im a \<noteq> Im z \<and> Re b \<noteq> Re a then if Im z < Im a \<and> Re a < Re b \<or> Im a < Im z \<and> Re b < Re a then 1 / 2 else - 1 / 2 else 0)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
jumpF (\<lambda>t. f t / g t) (at_right 0) = - 1 / 2
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
jumpF (\<lambda>t. f t / g t) (at_right 0) = - 1 / 2

goal (1 subgoal):
 1. jumpF_pathstart (linepath a b) z = (if Re a = Re z \<and> Im a \<noteq> Im z \<and> Re b \<noteq> Re a then if Im z < Im a \<and> Re a < Re b \<or> Im a < Im z \<and> Re b < Re a then 1 / 2 else - 1 / 2 else 0)
[PROOF STEP]
using jump_eq that
[PROOF STATE]
proof (prove)
using this:
jumpF (\<lambda>t. f t / g t) (at_right 0) = - 1 / 2
jumpF_pathstart (linepath a b) z = jumpF (\<lambda>t. f t / g t) (at_right 0)
Re a = Re z
Im a \<noteq> Im z
Re b \<noteq> Re a
\<not> (Im z < Im a \<and> Re a < Re b \<or> Im a < Im z \<and> Re b < Re a)

goal (1 subgoal):
 1. jumpF_pathstart (linepath a b) z = (if Re a = Re z \<and> Im a \<noteq> Im z \<and> Re b \<noteq> Re a then if Im z < Im a \<and> Re a < Re b \<or> Im a < Im z \<and> Re b < Re a then 1 / 2 else - 1 / 2 else 0)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
jumpF_pathstart (linepath a b) z = (if Re a = Re z \<and> Im a \<noteq> Im z \<and> Re b \<noteq> Re a then if Im z < Im a \<and> Re a < Re b \<or> Im a < Im z \<and> Re b < Re a then 1 / 2 else - 1 / 2 else 0)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<lbrakk>Re a = Re z; Im a \<noteq> Im z; Re b \<noteq> Re a; \<not> (Im z < Im a \<and> Re a < Re b \<or> Im a < Im z \<and> Re b < Re a)\<rbrakk> \<Longrightarrow> jumpF_pathstart (linepath a b) z = (if Re a = Re z \<and> Im a \<noteq> Im z \<and> Re b \<noteq> Re a then if Im z < Im a \<and> Re a < Re b \<or> Im a < Im z \<and> Re b < Re a then 1 / 2 else - 1 / 2 else 0)

goal (1 subgoal):
 1. jumpF_pathstart (linepath a b) z = (if Re a = Re z \<and> Im a \<noteq> Im z \<and> Re b \<noteq> Re a then if Im z < Im a \<and> Re a < Re b \<or> Im a < Im z \<and> Re b < Re a then 1 / 2 else - 1 / 2 else 0)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
Re a \<noteq> Re z \<Longrightarrow> jumpF_pathstart (linepath a b) z = (if Re a = Re z \<and> Im a \<noteq> Im z \<and> Re b \<noteq> Re a then if Im z < Im a \<and> Re a < Re b \<or> Im a < Im z \<and> Re b < Re a then 1 / 2 else - 1 / 2 else 0)
\<lbrakk>Re a = Re z; Im a = Im z\<rbrakk> \<Longrightarrow> jumpF_pathstart (linepath a b) z = (if Re a = Re z \<and> Im a \<noteq> Im z \<and> Re b \<noteq> Re a then if Im z < Im a \<and> Re a < Re b \<or> Im a < Im z \<and> Re b < Re a then 1 / 2 else - 1 / 2 else 0)
\<lbrakk>Re a = Re z; Re b = Re a\<rbrakk> \<Longrightarrow> jumpF_pathstart (linepath a b) z = (if Re a = Re z \<and> Im a \<noteq> Im z \<and> Re b \<noteq> Re a then if Im z < Im a \<and> Re a < Re b \<or> Im a < Im z \<and> Re b < Re a then 1 / 2 else - 1 / 2 else 0)
\<lbrakk>Re a = Re z; Im z < Im a \<and> Re a < Re b \<or> Im a < Im z \<and> Re b < Re a\<rbrakk> \<Longrightarrow> jumpF_pathstart (linepath a b) z = (if Re a = Re z \<and> Im a \<noteq> Im z \<and> Re b \<noteq> Re a then if Im z < Im a \<and> Re a < Re b \<or> Im a < Im z \<and> Re b < Re a then 1 / 2 else - 1 / 2 else 0)
\<lbrakk>Re a = Re z; Im a \<noteq> Im z; Re b \<noteq> Re a; \<not> (Im z < Im a \<and> Re a < Re b \<or> Im a < Im z \<and> Re b < Re a)\<rbrakk> \<Longrightarrow> jumpF_pathstart (linepath a b) z = (if Re a = Re z \<and> Im a \<noteq> Im z \<and> Re b \<noteq> Re a then if Im z < Im a \<and> Re a < Re b \<or> Im a < Im z \<and> Re b < Re a then 1 / 2 else - 1 / 2 else 0)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
Re a \<noteq> Re z \<Longrightarrow> jumpF_pathstart (linepath a b) z = (if Re a = Re z \<and> Im a \<noteq> Im z \<and> Re b \<noteq> Re a then if Im z < Im a \<and> Re a < Re b \<or> Im a < Im z \<and> Re b < Re a then 1 / 2 else - 1 / 2 else 0)
\<lbrakk>Re a = Re z; Im a = Im z\<rbrakk> \<Longrightarrow> jumpF_pathstart (linepath a b) z = (if Re a = Re z \<and> Im a \<noteq> Im z \<and> Re b \<noteq> Re a then if Im z < Im a \<and> Re a < Re b \<or> Im a < Im z \<and> Re b < Re a then 1 / 2 else - 1 / 2 else 0)
\<lbrakk>Re a = Re z; Re b = Re a\<rbrakk> \<Longrightarrow> jumpF_pathstart (linepath a b) z = (if Re a = Re z \<and> Im a \<noteq> Im z \<and> Re b \<noteq> Re a then if Im z < Im a \<and> Re a < Re b \<or> Im a < Im z \<and> Re b < Re a then 1 / 2 else - 1 / 2 else 0)
\<lbrakk>Re a = Re z; Im z < Im a \<and> Re a < Re b \<or> Im a < Im z \<and> Re b < Re a\<rbrakk> \<Longrightarrow> jumpF_pathstart (linepath a b) z = (if Re a = Re z \<and> Im a \<noteq> Im z \<and> Re b \<noteq> Re a then if Im z < Im a \<and> Re a < Re b \<or> Im a < Im z \<and> Re b < Re a then 1 / 2 else - 1 / 2 else 0)
\<lbrakk>Re a = Re z; Im a \<noteq> Im z; Re b \<noteq> Re a; \<not> (Im z < Im a \<and> Re a < Re b \<or> Im a < Im z \<and> Re b < Re a)\<rbrakk> \<Longrightarrow> jumpF_pathstart (linepath a b) z = (if Re a = Re z \<and> Im a \<noteq> Im z \<and> Re b \<noteq> Re a then if Im z < Im a \<and> Re a < Re b \<or> Im a < Im z \<and> Re b < Re a then 1 / 2 else - 1 / 2 else 0)

goal (1 subgoal):
 1. jumpF_pathstart (linepath a b) z = (if Re a = Re z \<and> Im a \<noteq> Im z \<and> Re b \<noteq> Re a then if Im z < Im a \<and> Re a < Re b \<or> Im a < Im z \<and> Re b < Re a then 1 / 2 else - 1 / 2 else 0)
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
jumpF_pathstart (linepath a b) z = (if Re a = Re z \<and> Im a \<noteq> Im z \<and> Re b \<noteq> Re a then if Im z < Im a \<and> Re a < Re b \<or> Im a < Im z \<and> Re b < Re a then 1 / 2 else - 1 / 2 else 0)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma real_sum_gt_zero_less: "(0 < s + (-w::real)) \<Longrightarrow> (w < s)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < s + - w \<Longrightarrow> w < s
[PROOF STEP]
by (simp add: linorder_not_le [symmetric] real_le_eq_diff [of s])


[STATEMENT]
lemma offs_pred_ub:
 "\<lbrakk>offs_pred ns ub xs index key mi ma; i < length ns;
   0 < offs_num (length ns) xs index key mi ma i\<rbrakk> \<Longrightarrow>
     ns ! i + offs_num (length ns) xs index key mi ma i \<le> ub"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>offs_pred ns ub xs index key mi ma; i < length ns; 0 < offs_num (length ns) xs index key mi ma i\<rbrakk> \<Longrightarrow> ns ! i + offs_num (length ns) xs index key mi ma i \<le> ub
[PROOF STEP]
by (drule offs_pred_ub_aux, assumption+, simp)


[STATEMENT]
lemma P_def':
  assumes "t \<in> T"
  assumes "fixed_point \<in> T \<rightarrow>\<^sub>C X"
  shows "(P fixed_point) t = x0 + ivl_integral t0 t (\<lambda>x. f x (fixed_point x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. apply_bcontfun (P fixed_point) t = x0 + ivl_integral t0 t (\<lambda>x. f x (apply_bcontfun fixed_point x))
[PROOF STEP]
by (simp add: P_eq_P_inner assms P_inner_def)


[STATEMENT]
lemma vimage_l_image_r: "\<lbrakk> ob-`Q \<subseteq> P; Q \<subseteq> range ob \<rbrakk> \<Longrightarrow> Q \<subseteq> ob`P"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>ob -` Q \<subseteq> P; Q \<subseteq> range ob\<rbrakk> \<Longrightarrow> Q \<subseteq> ob ` P
[PROOF STEP]
by (drule image_mono [where f=ob], auto)


[STATEMENT]
lemma map_of_append: "map_of (ps @ qs) x =
  (case map_of ps x of None \<Rightarrow> map_of qs x | Some y \<Rightarrow> Some y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map_of (ps @ qs) x = (case map_of ps x of None \<Rightarrow> map_of qs x | Some y \<Rightarrow> Some y)
[PROOF STEP]
by(induction ps)(auto)


[STATEMENT]
lemma in_arcs_add_arc_iff:
  "in_arcs (add_arc a) u = (if head G a = u then insert a (in_arcs G u) else in_arcs G u)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. in_arcs (add_arc a) u = (if head G a = u then insert a (in_arcs G u) else in_arcs G u)
[PROOF STEP]
by auto


[STATEMENT]
lemma (in prob_space) prob_space_bind:
  assumes ae: "AE x in M. prob_space (N x)"
    and N[measurable]: "N \<in> measurable M (subprob_algebra S)"
  shows "prob_space (M \<bind> N)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prob_space (M \<bind> N)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. emeasure (M \<bind> N) (space (M \<bind> N)) = 1
[PROOF STEP]
have "emeasure (M \<bind> N) (space (M \<bind> N)) = (\<integral>\<^sup>+x. emeasure (N x) (space (N x)) \<partial>M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. emeasure (M \<bind> N) (space (M \<bind> N)) = \<integral>\<^sup>+ x. emeasure (N x) (space (N x)) \<partial>M
[PROOF STEP]
by (subst emeasure_bind[where N=S])
       (auto simp: not_empty space_bind[OF sets_kernel] subprob_measurableD[OF N] intro!: nn_integral_cong)
[PROOF STATE]
proof (state)
this:
emeasure (M \<bind> N) (space (M \<bind> N)) = \<integral>\<^sup>+ x. emeasure (N x) (space (N x)) \<partial>M

goal (1 subgoal):
 1. emeasure (M \<bind> N) (space (M \<bind> N)) = 1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
emeasure (M \<bind> N) (space (M \<bind> N)) = \<integral>\<^sup>+ x. emeasure (N x) (space (N x)) \<partial>M

goal (1 subgoal):
 1. emeasure (M \<bind> N) (space (M \<bind> N)) = 1
[PROOF STEP]
have "\<dots> = (\<integral>\<^sup>+x. 1 \<partial>M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+ x. emeasure (N x) (space (N x)) \<partial>M = \<integral>\<^sup>+ x. 1 \<partial>M
[PROOF STEP]
using ae
[PROOF STATE]
proof (prove)
using this:
AE x in M. prob_space (N x)

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. emeasure (N x) (space (N x)) \<partial>M = \<integral>\<^sup>+ x. 1 \<partial>M
[PROOF STEP]
by (intro nn_integral_cong_AE, eventually_elim) (rule prob_space.emeasure_space_1)
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. emeasure (N x) (space (N x)) \<partial>M = \<integral>\<^sup>+ x. 1 \<partial>M

goal (1 subgoal):
 1. emeasure (M \<bind> N) (space (M \<bind> N)) = 1
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
emeasure (M \<bind> N) (space (M \<bind> N)) = \<integral>\<^sup>+ x. 1 \<partial>M
[PROOF STEP]
show "emeasure (M \<bind> N) (space (M \<bind> N)) = 1"
[PROOF STATE]
proof (prove)
using this:
emeasure (M \<bind> N) (space (M \<bind> N)) = \<integral>\<^sup>+ x. 1 \<partial>M

goal (1 subgoal):
 1. emeasure (M \<bind> N) (space (M \<bind> N)) = 1
[PROOF STEP]
by (simp add: emeasure_space_1)
[PROOF STATE]
proof (state)
this:
emeasure (M \<bind> N) (space (M \<bind> N)) = 1

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma VPi_I:
  assumes "\<And>x. x \<in> elts A \<Longrightarrow> b x \<in> elts (B x)"
  shows "VLambda A b \<in> elts (VPi A B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. VLambda A b \<in> elts (VPi A B)
[PROOF STEP]
proof (clarsimp simp: VPi_def, intro conjI impI)
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. small {f. f \<le> VSigma A B \<and> elts A \<subseteq> Domain (pairs f) \<and> single_valued (pairs f)} \<Longrightarrow> VLambda A b \<le> VSigma A B
 2. small {f. f \<le> VSigma A B \<and> elts A \<subseteq> Domain (pairs f) \<and> single_valued (pairs f)} \<Longrightarrow> elts A \<subseteq> Domain (pairs (VLambda A b))
 3. small {f. f \<le> VSigma A B \<and> elts A \<subseteq> Domain (pairs f) \<and> single_valued (pairs f)} \<Longrightarrow> single_valued (pairs (VLambda A b))
 4. small {f. f \<le> VSigma A B \<and> elts A \<subseteq> Domain (pairs f) \<and> single_valued (pairs f)}
[PROOF STEP]
show "VLambda A b \<le> VSigma A B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. VLambda A b \<le> VSigma A B
[PROOF STEP]
by (auto simp: assms VLambda_def split: if_split_asm)
[PROOF STATE]
proof (state)
this:
VLambda A b \<le> VSigma A B

goal (3 subgoals):
 1. small {f. f \<le> VSigma A B \<and> elts A \<subseteq> Domain (pairs f) \<and> single_valued (pairs f)} \<Longrightarrow> elts A \<subseteq> Domain (pairs (VLambda A b))
 2. small {f. f \<le> VSigma A B \<and> elts A \<subseteq> Domain (pairs f) \<and> single_valued (pairs f)} \<Longrightarrow> single_valued (pairs (VLambda A b))
 3. small {f. f \<le> VSigma A B \<and> elts A \<subseteq> Domain (pairs f) \<and> single_valued (pairs f)}
[PROOF STEP]
show "elts A \<subseteq> Domain (pairs (VLambda A b))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. elts A \<subseteq> Domain (pairs (VLambda A b))
[PROOF STEP]
by (force simp: VLambda_def pairs_iff_elts)
[PROOF STATE]
proof (state)
this:
elts A \<subseteq> Domain (pairs (VLambda A b))

goal (2 subgoals):
 1. small {f. f \<le> VSigma A B \<and> elts A \<subseteq> Domain (pairs f) \<and> single_valued (pairs f)} \<Longrightarrow> single_valued (pairs (VLambda A b))
 2. small {f. f \<le> VSigma A B \<and> elts A \<subseteq> Domain (pairs f) \<and> single_valued (pairs f)}
[PROOF STEP]
show "single_valued (pairs (VLambda A b))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. single_valued (pairs (VLambda A b))
[PROOF STEP]
by (auto simp: VLambda_def single_valued_def pairs_iff_elts)
[PROOF STATE]
proof (state)
this:
single_valued (pairs (VLambda A b))

goal (1 subgoal):
 1. small {f. f \<le> VSigma A B \<and> elts A \<subseteq> Domain (pairs f) \<and> single_valued (pairs f)}
[PROOF STEP]
show "small {f. f \<le> VSigma A B \<and> elts A \<subseteq> Domain (pairs f) \<and> single_valued (pairs f)}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. small {f. f \<le> VSigma A B \<and> elts A \<subseteq> Domain (pairs f) \<and> single_valued (pairs f)}
[PROOF STEP]
by (metis (mono_tags, lifting) down VPow_iff mem_Collect_eq subsetI)
[PROOF STATE]
proof (state)
this:
small {f. f \<le> VSigma A B \<and> elts A \<subseteq> Domain (pairs f) \<and> single_valued (pairs f)}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma convex_UNIV[intro,simp]: "convex UNIV"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. convex UNIV
[PROOF STEP]
unfolding convex_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>UNIV. \<forall>y\<in>UNIV. \<forall>u\<ge>0. \<forall>v\<ge>0. u + v = 1 \<longrightarrow> u *\<^sub>R x + v *\<^sub>R y \<in> UNIV
[PROOF STEP]
by auto


[STATEMENT]
lemma projecting_Int:
     "[| projecting C h F XA' XA;  projecting C h F XB' XB |]
      ==> projecting C h F (XA' \<inter> XB') (XA \<inter> XB)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>projecting C h F XA' XA; projecting C h F XB' XB\<rbrakk> \<Longrightarrow> projecting C h F (XA' \<inter> XB') (XA \<inter> XB)
[PROOF STEP]
by (unfold projecting_def, blast)


[STATEMENT]
lemma unit_disc_fix_f_circline_direct:
  assumes "unit_disc_fix M" and "f = moebius_pt M"
  shows "unit_disc_fix_f_circline f H = moebius_circline M H"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. unit_disc_fix_f_circline f H = moebius_circline M H
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. unit_disc_fix_f_circline f H = moebius_circline M H
[PROOF STEP]
have "M = (THE M. unit_disc_fix M \<and> f = moebius_pt M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. M = (THE M. unit_disc_fix M \<and> f = moebius_pt M)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
unit_disc_fix M
f = moebius_pt M

goal (1 subgoal):
 1. M = (THE M. unit_disc_fix M \<and> f = moebius_pt M)
[PROOF STEP]
using theI_unique[of "\<lambda> M. unit_disc_fix M \<and> f = moebius_pt M" M]
[PROOF STATE]
proof (prove)
using this:
unit_disc_fix M
f = moebius_pt M
\<exists>!x. unit_disc_fix x \<and> f = moebius_pt x \<Longrightarrow> (unit_disc_fix M \<and> f = moebius_pt M) = (M = (THE M. unit_disc_fix M \<and> f = moebius_pt M))

goal (1 subgoal):
 1. M = (THE M. unit_disc_fix M \<and> f = moebius_pt M)
[PROOF STEP]
using unique_moebius_pt[of M]
[PROOF STATE]
proof (prove)
using this:
unit_disc_fix M
f = moebius_pt M
\<exists>!x. unit_disc_fix x \<and> f = moebius_pt x \<Longrightarrow> (unit_disc_fix M \<and> f = moebius_pt M) = (M = (THE M. unit_disc_fix M \<and> f = moebius_pt M))
moebius_pt M = moebius_pt ?M2.0 \<Longrightarrow> M = ?M2.0

goal (1 subgoal):
 1. M = (THE M. unit_disc_fix M \<and> f = moebius_pt M)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
M = (THE M. unit_disc_fix M \<and> f = moebius_pt M)

goal (1 subgoal):
 1. unit_disc_fix_f_circline f H = moebius_circline M H
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
M = (THE M. unit_disc_fix M \<and> f = moebius_pt M)

goal (1 subgoal):
 1. unit_disc_fix_f_circline f H = moebius_circline M H
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
M = (THE M. unit_disc_fix M \<and> f = moebius_pt M)
unit_disc_fix M
f = moebius_pt M

goal (1 subgoal):
 1. unit_disc_fix_f_circline f H = moebius_circline M H
[PROOF STEP]
unfolding unit_disc_fix_f_circline_def
[PROOF STATE]
proof (prove)
using this:
M = (THE M. unit_disc_fix M \<and> f = moebius_pt M)
unit_disc_fix M
f = moebius_pt M

goal (1 subgoal):
 1. (if \<exists>M. unit_disc_fix M \<and> f = moebius_pt M then moebius_circline (THE M. unit_disc_fix M \<and> f = moebius_pt M) H else if \<exists>M. unit_disc_fix M \<and> f = moebius_pt M \<circ> conjugate then (moebius_circline (THE M. unit_disc_fix M \<and> f = moebius_pt M \<circ> conjugate) \<circ> conjugate_circline) H else H) = moebius_circline M H
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
unit_disc_fix_f_circline f H = moebius_circline M H

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma set_integrable_subset:
  fixes M A B and f :: "_ \<Rightarrow> _ :: {banach, second_countable_topology}"
  assumes "set_integrable M A f" "B \<in> sets M" "B \<subseteq> A"
  shows "set_integrable M B f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set_integrable M B f
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. set_integrable M B f
[PROOF STEP]
have "set_integrable M B (\<lambda>x. indicator A x *\<^sub>R f x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set_integrable M B (\<lambda>x. indicat_real A x *\<^sub>R f x)
[PROOF STEP]
using assms integrable_mult_indicator set_integrable_def
[PROOF STATE]
proof (prove)
using this:
set_integrable M A f
B \<in> sets M
B \<subseteq> A
\<lbrakk>?A \<in> sets ?M; integrable ?M ?f\<rbrakk> \<Longrightarrow> integrable ?M (\<lambda>x. indicat_real ?A x *\<^sub>R ?f x)
set_integrable ?M ?A ?f \<equiv> integrable ?M (\<lambda>x. indicat_real ?A x *\<^sub>R ?f x)

goal (1 subgoal):
 1. set_integrable M B (\<lambda>x. indicat_real A x *\<^sub>R f x)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
set_integrable M B (\<lambda>x. indicat_real A x *\<^sub>R f x)

goal (1 subgoal):
 1. set_integrable M B f
[PROOF STEP]
with \<open>B \<subseteq> A\<close>
[PROOF STATE]
proof (chain)
picking this:
B \<subseteq> A
set_integrable M B (\<lambda>x. indicat_real A x *\<^sub>R f x)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
B \<subseteq> A
set_integrable M B (\<lambda>x. indicat_real A x *\<^sub>R f x)

goal (1 subgoal):
 1. set_integrable M B f
[PROOF STEP]
unfolding set_integrable_def
[PROOF STATE]
proof (prove)
using this:
B \<subseteq> A
integrable M (\<lambda>x. indicat_real B x *\<^sub>R indicat_real A x *\<^sub>R f x)

goal (1 subgoal):
 1. integrable M (\<lambda>x. indicat_real B x *\<^sub>R f x)
[PROOF STEP]
by (simp add: indicator_inter_arith[symmetric] Int_absorb2)
[PROOF STATE]
proof (state)
this:
set_integrable M B f

goal:
No subgoals!
[PROOF STEP]
qed