[STATEMENT]
lemma finite_ran:
  assumes "finite (dom p)"
  shows "finite (ran p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (ran p)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. finite (ran p)
[PROOF STEP]
have "ran p = (\<lambda>x. the (p x)) ` dom p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ran p = (\<lambda>x. the (p x)) ` dom p
[PROOF STEP]
unfolding ran_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {b. \<exists>a. p a = Some b} = (\<lambda>x. the (p x)) ` dom p
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
ran p = (\<lambda>x. the (p x)) ` dom p

goal (1 subgoal):
 1. finite (ran p)
[PROOF STEP]
from this \<open>finite (dom p)\<close>
[PROOF STATE]
proof (chain)
picking this:
ran p = (\<lambda>x. the (p x)) ` dom p
finite (dom p)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
ran p = (\<lambda>x. the (p x)) ` dom p
finite (dom p)

goal (1 subgoal):
 1. finite (ran p)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
finite (ran p)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma open_ball [intro, simp]: "open (ball x e)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. open (ball x e)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. open (ball x e)
[PROOF STEP]
have "open (dist x -` {..<e})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. open (dist x -` {..<e})
[PROOF STEP]
by (intro open_vimage open_lessThan continuous_intros)
[PROOF STATE]
proof (state)
this:
open (dist x -` {..<e})

goal (1 subgoal):
 1. open (ball x e)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
open (dist x -` {..<e})

goal (1 subgoal):
 1. open (ball x e)
[PROOF STEP]
have "dist x -` {..<e} = ball x e"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dist x -` {..<e} = ball x e
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
dist x -` {..<e} = ball x e

goal (1 subgoal):
 1. open (ball x e)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
open (ball x e)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
open (ball x e)

goal (1 subgoal):
 1. open (ball x e)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
open (ball x e)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma obtain_function:
  assumes "finite A"
  assumes "size M = card A"
  shows "\<exists>f. image_mset f (mset_set A) = M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>f. image_mset f (mset_set A) = M
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
finite A
size M = card A

goal (1 subgoal):
 1. \<exists>f. image_mset f (mset_set A) = M
[PROOF STEP]
proof (induct arbitrary: M rule: finite_induct)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>M. size M = card {} \<Longrightarrow> \<exists>f. image_mset f (mset_set {}) = M
 2. \<And>x F M. \<lbrakk>finite F; x \<notin> F; \<And>M. size M = card F \<Longrightarrow> \<exists>f. image_mset f (mset_set F) = M; size M = card (insert x F)\<rbrakk> \<Longrightarrow> \<exists>f. image_mset f (mset_set (insert x F)) = M
[PROOF STEP]
case empty
[PROOF STATE]
proof (state)
this:
size M = card {}

goal (2 subgoals):
 1. \<And>M. size M = card {} \<Longrightarrow> \<exists>f. image_mset f (mset_set {}) = M
 2. \<And>x F M. \<lbrakk>finite F; x \<notin> F; \<And>M. size M = card F \<Longrightarrow> \<exists>f. image_mset f (mset_set F) = M; size M = card (insert x F)\<rbrakk> \<Longrightarrow> \<exists>f. image_mset f (mset_set (insert x F)) = M
[PROOF STEP]
from this
[PROOF STATE]
proof (chain)
picking this:
size M = card {}
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
size M = card {}

goal (1 subgoal):
 1. \<exists>f. image_mset f (mset_set {}) = M
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<exists>f. image_mset f (mset_set {}) = M

goal (1 subgoal):
 1. \<And>x F M. \<lbrakk>finite F; x \<notin> F; \<And>M. size M = card F \<Longrightarrow> \<exists>f. image_mset f (mset_set F) = M; size M = card (insert x F)\<rbrakk> \<Longrightarrow> \<exists>f. image_mset f (mset_set (insert x F)) = M
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x F M. \<lbrakk>finite F; x \<notin> F; \<And>M. size M = card F \<Longrightarrow> \<exists>f. image_mset f (mset_set F) = M; size M = card (insert x F)\<rbrakk> \<Longrightarrow> \<exists>f. image_mset f (mset_set (insert x F)) = M
[PROOF STEP]
case (insert x A)
[PROOF STATE]
proof (state)
this:
finite A
x \<notin> A
size ?M = card A \<Longrightarrow> \<exists>f. image_mset f (mset_set A) = ?M
size M = card (insert x A)

goal (1 subgoal):
 1. \<And>x F M. \<lbrakk>finite F; x \<notin> F; \<And>M. size M = card F \<Longrightarrow> \<exists>f. image_mset f (mset_set F) = M; size M = card (insert x F)\<rbrakk> \<Longrightarrow> \<exists>f. image_mset f (mset_set (insert x F)) = M
[PROOF STEP]
from insert(1,2,4)
[PROOF STATE]
proof (chain)
picking this:
finite A
x \<notin> A
size M = card (insert x A)
[PROOF STEP]
have "size M > 0"
[PROOF STATE]
proof (prove)
using this:
finite A
x \<notin> A
size M = card (insert x A)

goal (1 subgoal):
 1. 0 < size M
[PROOF STEP]
by (simp add: card_gt_0_iff)
[PROOF STATE]
proof (state)
this:
0 < size M

goal (1 subgoal):
 1. \<And>x F M. \<lbrakk>finite F; x \<notin> F; \<And>M. size M = card F \<Longrightarrow> \<exists>f. image_mset f (mset_set F) = M; size M = card (insert x F)\<rbrakk> \<Longrightarrow> \<exists>f. image_mset f (mset_set (insert x F)) = M
[PROOF STEP]
from this
[PROOF STATE]
proof (chain)
picking this:
0 < size M
[PROOF STEP]
obtain y where "y \<in># M"
[PROOF STATE]
proof (prove)
using this:
0 < size M

goal (1 subgoal):
 1. (\<And>y. y \<in># M \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using gr0_implies_Suc size_eq_Suc_imp_elem
[PROOF STATE]
proof (prove)
using this:
0 < size M
0 < ?n \<Longrightarrow> \<exists>m. ?n = Suc m
size ?M = Suc ?n \<Longrightarrow> \<exists>a. a \<in># ?M

goal (1 subgoal):
 1. (\<And>y. y \<in># M \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
y \<in># M

goal (1 subgoal):
 1. \<And>x F M. \<lbrakk>finite F; x \<notin> F; \<And>M. size M = card F \<Longrightarrow> \<exists>f. image_mset f (mset_set F) = M; size M = card (insert x F)\<rbrakk> \<Longrightarrow> \<exists>f. image_mset f (mset_set (insert x F)) = M
[PROOF STEP]
from insert(1,2,4) this
[PROOF STATE]
proof (chain)
picking this:
finite A
x \<notin> A
size M = card (insert x A)
y \<in># M
[PROOF STEP]
have "size (M - {#y#}) = card A"
[PROOF STATE]
proof (prove)
using this:
finite A
x \<notin> A
size M = card (insert x A)
y \<in># M

goal (1 subgoal):
 1. size (M - {#y#}) = card A
[PROOF STEP]
by (simp add: Diff_insert_absorb card_Diff_singleton_if insertI1 size_Diff_submset)
[PROOF STATE]
proof (state)
this:
size (M - {#y#}) = card A

goal (1 subgoal):
 1. \<And>x F M. \<lbrakk>finite F; x \<notin> F; \<And>M. size M = card F \<Longrightarrow> \<exists>f. image_mset f (mset_set F) = M; size M = card (insert x F)\<rbrakk> \<Longrightarrow> \<exists>f. image_mset f (mset_set (insert x F)) = M
[PROOF STEP]
from insert.hyps this
[PROOF STATE]
proof (chain)
picking this:
finite A
x \<notin> A
size ?M = card A \<Longrightarrow> \<exists>f. image_mset f (mset_set A) = ?M
size (M - {#y#}) = card A
[PROOF STEP]
obtain f' where "image_mset f' (mset_set A) = M - {#y#}"
[PROOF STATE]
proof (prove)
using this:
finite A
x \<notin> A
size ?M = card A \<Longrightarrow> \<exists>f. image_mset f (mset_set A) = ?M
size (M - {#y#}) = card A

goal (1 subgoal):
 1. (\<And>f'. image_mset f' (mset_set A) = M - {#y#} \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
image_mset f' (mset_set A) = M - {#y#}

goal (1 subgoal):
 1. \<And>x F M. \<lbrakk>finite F; x \<notin> F; \<And>M. size M = card F \<Longrightarrow> \<exists>f. image_mset f (mset_set F) = M; size M = card (insert x F)\<rbrakk> \<Longrightarrow> \<exists>f. image_mset f (mset_set (insert x F)) = M
[PROOF STEP]
from this
[PROOF STATE]
proof (chain)
picking this:
image_mset f' (mset_set A) = M - {#y#}
[PROOF STEP]
have "image_mset (f'(x := y)) (mset_set (insert x A)) = M"
[PROOF STATE]
proof (prove)
using this:
image_mset f' (mset_set A) = M - {#y#}

goal (1 subgoal):
 1. image_mset (f'(x := y)) (mset_set (insert x A)) = M
[PROOF STEP]
using \<open>finite A\<close> \<open>x \<notin> A\<close> \<open>y \<in># M\<close>
[PROOF STATE]
proof (prove)
using this:
image_mset f' (mset_set A) = M - {#y#}
finite A
x \<notin> A
y \<in># M

goal (1 subgoal):
 1. image_mset (f'(x := y)) (mset_set (insert x A)) = M
[PROOF STEP]
by (simp add: image_mset_fun_upd)
[PROOF STATE]
proof (state)
this:
image_mset (f'(x := y)) (mset_set (insert x A)) = M

goal (1 subgoal):
 1. \<And>x F M. \<lbrakk>finite F; x \<notin> F; \<And>M. size M = card F \<Longrightarrow> \<exists>f. image_mset f (mset_set F) = M; size M = card (insert x F)\<rbrakk> \<Longrightarrow> \<exists>f. image_mset f (mset_set (insert x F)) = M
[PROOF STEP]
from this
[PROOF STATE]
proof (chain)
picking this:
image_mset (f'(x := y)) (mset_set (insert x A)) = M
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
image_mset (f'(x := y)) (mset_set (insert x A)) = M

goal (1 subgoal):
 1. \<exists>f. image_mset f (mset_set (insert x A)) = M
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>f. image_mset f (mset_set (insert x A)) = M

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma io_targets_observable_singleton_ex :
  assumes "observable M"
  and     "io \<in> LS M q1"
shows "\<exists> q2 . io_targets M q1 io = { q2 }"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>q2. io_targets M q1 io = {q2}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>q2. io_targets M q1 io = {q2}
[PROOF STEP]
obtain tr where tr_def : "{ t . path M (io || t) q1 \<and> length io = length t } = { tr }"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>tr. {t. path M (io || t) q1 \<and> length io = length t} = {tr} \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms observable_path_unique_ex
[PROOF STATE]
proof (prove)
using this:
observable M
io \<in> LS M q1
\<lbrakk>observable ?M; ?io \<in> LS ?M ?q; \<And>tr. {t. path ?M (?io || t) ?q \<and> length ?io = length t} = {tr} \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. (\<And>tr. {t. path M (io || t) q1 \<and> length io = length t} = {tr} \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis (mono_tags, lifting))
[PROOF STATE]
proof (state)
this:
{t. path M (io || t) q1 \<and> length io = length t} = {tr}

goal (1 subgoal):
 1. \<exists>q2. io_targets M q1 io = {q2}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
{t. path M (io || t) q1 \<and> length io = length t} = {tr}
[PROOF STEP]
have "io_targets M q1 io = { target (io || tr) q1 }"
[PROOF STATE]
proof (prove)
using this:
{t. path M (io || t) q1 \<and> length io = length t} = {tr}

goal (1 subgoal):
 1. io_targets M q1 io = {target (io || tr) q1}
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
io_targets M q1 io = {target (io || tr) q1}

goal (1 subgoal):
 1. \<exists>q2. io_targets M q1 io = {q2}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
io_targets M q1 io = {target (io || tr) q1}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
io_targets M q1 io = {target (io || tr) q1}

goal (1 subgoal):
 1. \<exists>q2. io_targets M q1 io = {q2}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>q2. io_targets M q1 io = {q2}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Nlt0_iff[simp]:
  assumes nx: "isnormNum x"
  shows "((INum x :: 'a::{field_char_0,linordered_field}) < 0) = 0>\<^sub>N x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (INum x < (0::'a)) = 0>\<^sub>N x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (INum x < (0::'a)) = 0>\<^sub>N x
[PROOF STEP]
obtain a b where x: "x = (a, b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>a b. x = (a, b) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (cases x)
[PROOF STATE]
proof (state)
this:
x = (a, b)

goal (1 subgoal):
 1. (INum x < (0::'a)) = 0>\<^sub>N x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (INum x < (0::'a)) = 0>\<^sub>N x
[PROOF STEP]
proof (cases "a = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. a = 0 \<Longrightarrow> (INum x < (0::'a)) = 0>\<^sub>N x
 2. a \<noteq> 0 \<Longrightarrow> (INum x < (0::'a)) = 0>\<^sub>N x
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
a = 0

goal (2 subgoals):
 1. a = 0 \<Longrightarrow> (INum x < (0::'a)) = 0>\<^sub>N x
 2. a \<noteq> 0 \<Longrightarrow> (INum x < (0::'a)) = 0>\<^sub>N x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a = 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
a = 0

goal (1 subgoal):
 1. (INum x < (0::'a)) = 0>\<^sub>N x
[PROOF STEP]
by (simp add: x Nlt0_def INum_def)
[PROOF STATE]
proof (state)
this:
(INum x < (0::'a)) = 0>\<^sub>N x

goal (1 subgoal):
 1. a \<noteq> 0 \<Longrightarrow> (INum x < (0::'a)) = 0>\<^sub>N x
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. a \<noteq> 0 \<Longrightarrow> (INum x < (0::'a)) = 0>\<^sub>N x
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
a \<noteq> 0

goal (1 subgoal):
 1. a \<noteq> 0 \<Longrightarrow> (INum x < (0::'a)) = 0>\<^sub>N x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a \<noteq> 0
[PROOF STEP]
have b: "(of_int b::'a) > 0"
[PROOF STATE]
proof (prove)
using this:
a \<noteq> 0

goal (1 subgoal):
 1. (0::'a) < of_int b
[PROOF STEP]
using nx
[PROOF STATE]
proof (prove)
using this:
a \<noteq> 0
isnormNum x

goal (1 subgoal):
 1. (0::'a) < of_int b
[PROOF STEP]
by (simp add: x isnormNum_def)
[PROOF STATE]
proof (state)
this:
(0::'a) < of_int b

goal (1 subgoal):
 1. a \<noteq> 0 \<Longrightarrow> (INum x < (0::'a)) = 0>\<^sub>N x
[PROOF STEP]
from pos_divide_less_eq[OF b, where b="of_int a" and a="0::'a"]
[PROOF STATE]
proof (chain)
picking this:
(of_int a / of_int b < (0::'a)) = (of_int a < (0::'a) * of_int b)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(of_int a / of_int b < (0::'a)) = (of_int a < (0::'a) * of_int b)

goal (1 subgoal):
 1. (INum x < (0::'a)) = 0>\<^sub>N x
[PROOF STEP]
by (simp add: x Nlt0_def INum_def)
[PROOF STATE]
proof (state)
this:
(INum x < (0::'a)) = 0>\<^sub>N x

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(INum x < (0::'a)) = 0>\<^sub>N x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma mkArr_restrict_eq:
    assumes "arr (mkArr A B F)"
    shows "mkArr A B (restrict F A) = mkArr A B F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mkArr A B (restrict F A) = mkArr A B F
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
arr (mkArr A B F)

goal (1 subgoal):
 1. mkArr A B (restrict F A) = mkArr A B F
[PROOF STEP]
by (intro mkArr_eqI', auto)


[STATEMENT]
lemma (in group) inv_closed [intro, simp]:
  "x \<in> carrier G ==> inv x \<in> carrier G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> carrier G \<Longrightarrow> inv x \<in> carrier G
[PROOF STEP]
using Units_inv_closed
[PROOF STATE]
proof (prove)
using this:
?x \<in> Units G \<Longrightarrow> inv ?x \<in> carrier G

goal (1 subgoal):
 1. x \<in> carrier G \<Longrightarrow> inv x \<in> carrier G
[PROOF STEP]
by simp


[STATEMENT]
lemma interval_lebesgue_integral_by_parts:
  assumes "a \<le> b"
  assumes cont_f[intro]: "continuous_on {a..b} f"
  assumes cont_g[intro]: "continuous_on {a..b} g"
  assumes [intro]: "\<And>x. x \<in> {a..b} \<Longrightarrow> (F has_field_derivative f x) (at x within {a..b})"
  assumes [intro]: "\<And>x. x \<in> {a..b} \<Longrightarrow> (G has_field_derivative g x) (at x within {a..b})"
  shows "(LBINT x=a..b. F x * g x) = F b * G b - F a * G a - (LBINT x=a..b. f x * G x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. LBINT x=ereal a..ereal b. F x * g x = F b * G b - F a * G a - (LBINT x=ereal a..ereal b. f x * G x)
[PROOF STEP]
using integral_by_parts[of a b f g F G] assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>a \<le> b; continuous_on {a..b} f; continuous_on {a..b} g; \<And>x. x \<in> {a..b} \<Longrightarrow> (F has_real_derivative f x) (at x within {a..b}); \<And>x. x \<in> {a..b} \<Longrightarrow> (G has_real_derivative g x) (at x within {a..b})\<rbrakk> \<Longrightarrow> LBINT x. F x * g x * indicat_real {a..b} x = F b * G b - F a * G a - (LBINT x. f x * G x * indicat_real {a..b} x)
a \<le> b
continuous_on {a..b} f
continuous_on {a..b} g
?x \<in> {a..b} \<Longrightarrow> (F has_real_derivative f ?x) (at ?x within {a..b})
?x \<in> {a..b} \<Longrightarrow> (G has_real_derivative g ?x) (at ?x within {a..b})

goal (1 subgoal):
 1. LBINT x=ereal a..ereal b. F x * g x = F b * G b - F a * G a - (LBINT x=ereal a..ereal b. f x * G x)
[PROOF STEP]
by (simp add: interval_integral_Icc set_lebesgue_integral_def mult_ac)


[STATEMENT]
lemma sum_pos':
  assumes "finite I"
  assumes "\<exists>x\<in>I. f x > (0 :: _ :: linordered_ab_group_add)"
  assumes "\<And>x. x \<in> I \<Longrightarrow> f x \<ge> 0"
  shows   "sum f I > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0::'b) < sum f I
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (0::'b) < sum f I
[PROOF STEP]
from assms(2)
[PROOF STATE]
proof (chain)
picking this:
\<exists>x\<in>I. (0::'b) < f x
[PROOF STEP]
guess x
[PROOF STATE]
proof (prove)
using this:
\<exists>x\<in>I. (0::'b) < f x

goal (1 subgoal):
 1. thesis
goal instantiation:
PROP ?guess \<leadsto> thesis
[PROOF STEP]
by (elim bexE)
[PROOF STATE]
proof (state)
this:
x \<in> I
(0::'b) < f x

goal (1 subgoal):
 1. (0::'b) < sum f I
[PROOF STEP]
note x = this
[PROOF STATE]
proof (state)
this:
x \<in> I
(0::'b) < f x

goal (1 subgoal):
 1. (0::'b) < sum f I
[PROOF STEP]
from x
[PROOF STATE]
proof (chain)
picking this:
x \<in> I
(0::'b) < f x
[PROOF STEP]
have "I = insert x I"
[PROOF STATE]
proof (prove)
using this:
x \<in> I
(0::'b) < f x

goal (1 subgoal):
 1. I = insert x I
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
I = insert x I

goal (1 subgoal):
 1. (0::'b) < sum f I
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
I = insert x I

goal (1 subgoal):
 1. (0::'b) < sum f I
[PROOF STEP]
from assms(1)
[PROOF STATE]
proof (chain)
picking this:
finite I
[PROOF STEP]
have "sum f ... = f x + sum f (I - {x})"
[PROOF STATE]
proof (prove)
using this:
finite I

goal (1 subgoal):
 1. sum f (insert x I) = f x + sum f (I - {x})
[PROOF STEP]
by (rule sum.insert_remove)
[PROOF STATE]
proof (state)
this:
sum f (insert x I) = f x + sum f (I - {x})

goal (1 subgoal):
 1. (0::'b) < sum f I
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
sum f (insert x I) = f x + sum f (I - {x})

goal (1 subgoal):
 1. (0::'b) < sum f I
[PROOF STEP]
from x assms
[PROOF STATE]
proof (chain)
picking this:
x \<in> I
(0::'b) < f x
finite I
\<exists>x\<in>I. (0::'b) < f x
?x \<in> I \<Longrightarrow> (0::'b) \<le> f ?x
[PROOF STEP]
have "... > 0"
[PROOF STATE]
proof (prove)
using this:
x \<in> I
(0::'b) < f x
finite I
\<exists>x\<in>I. (0::'b) < f x
?x \<in> I \<Longrightarrow> (0::'b) \<le> f ?x

goal (1 subgoal):
 1. (0::'b) < f x + sum f (I - {x})
[PROOF STEP]
by (intro add_pos_nonneg sum_nonneg) simp_all
[PROOF STATE]
proof (state)
this:
(0::'b) < f x + sum f (I - {x})

goal (1 subgoal):
 1. (0::'b) < sum f I
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(0::'b) < sum f I
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(0::'b) < sum f I

goal (1 subgoal):
 1. (0::'b) < sum f I
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(0::'b) < sum f I

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma eqs_union[simp]: "eqs x (X \<union> Y) = eqs x X \<union> eqs x Y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eqs x (X \<union> Y) = eqs x X \<union> eqs x Y
[PROOF STEP]
by (auto simp: eqs_def)


[STATEMENT]
lemma pow_res_classes_semialg:
  assumes "S \<in> pow_res_classes n"
  shows "is_semialgebraic 1 (to_R1` S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_semialgebraic 1 ((\<lambda>a. [a]) ` S)
[PROOF STEP]
using pow_res_classes_univ_semialg
    assms(1)  is_univ_semialgebraicE
[PROOF STATE]
proof (prove)
using this:
?S \<in> pow_res_classes ?n \<Longrightarrow> is_univ_semialgebraic ?S
S \<in> pow_res_classes n
is_univ_semialgebraic ?S \<Longrightarrow> is_semialgebraic 1 ((\<lambda>a. [a]) ` ?S)

goal (1 subgoal):
 1. is_semialgebraic 1 ((\<lambda>a. [a]) ` S)
[PROOF STEP]
by blast


[STATEMENT]
lemma points_index_simple_def: "\<B> index ps = card {b \<in> design_support . ps \<subseteq> b}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<B> index ps = card {b \<in> design_support. ps \<subseteq> b}
[PROOF STEP]
using design_support_def points_index_def card_size_filter_eq simple_blocks_eq_sup
[PROOF STATE]
proof (prove)
using this:
design_support \<equiv> set_mset \<B>
?B index ?ps \<equiv> size (filter_mset ((\<subseteq>) ?ps) ?B)
finite ?A \<Longrightarrow> card {a \<in> ?A. ?P a} = size (filter_mset ?P (mset_set ?A))
mset_set design_support = \<B>

goal (1 subgoal):
 1. \<B> index ps = card {b \<in> design_support. ps \<subseteq> b}
[PROOF STEP]
by (metis finite_set_mset)


[STATEMENT]
lemma PiE_mem: "f \<in> Pi\<^sub>E S T \<Longrightarrow> x \<in> S \<Longrightarrow> f x \<in> T x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>f \<in> Pi\<^sub>E S T; x \<in> S\<rbrakk> \<Longrightarrow> f x \<in> T x
[PROOF STEP]
unfolding PiE_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>f \<in> Pi S T \<inter> extensional S; x \<in> S\<rbrakk> \<Longrightarrow> f x \<in> T x
[PROOF STEP]
by auto


[STATEMENT]
lemma prv_eql_subst_trm_id:
  assumes "y \<in> var" "\<phi> \<in> fmla" and "n \<in> num"
  shows "prv (imp (eql (Var y) n) (imp \<phi> (subst \<phi> n y)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prv (imp (eql (Var y) n) (imp \<phi> (subst \<phi> n y)))
[PROOF STEP]
using assms prv_eql_subst_trm
[PROOF STATE]
proof (prove)
using this:
y \<in> var
\<phi> \<in> fmla
n \<in> num
\<lbrakk>?x \<in> var; ?\<phi> \<in> fmla; ?t1.0 \<in> trm; ?t2.0 \<in> trm\<rbrakk> \<Longrightarrow> prv (imp (eql ?t1.0 ?t2.0) (imp (subst ?\<phi> ?t1.0 ?x) (subst ?\<phi> ?t2.0 ?x)))

goal (1 subgoal):
 1. prv (imp (eql (Var y) n) (imp \<phi> (subst \<phi> n y)))
[PROOF STEP]
by (metis Var in_num subst_same_Var)


[STATEMENT]
lemma lt2[intro]:
"!! k1 k2 j1 j2. k1 < j1 \<Longrightarrow> ((k1,k2),(j1,j2)) \<in> lt2"
"!! k1 k2 j1 j2. \<lbrakk>k1 \<le> j1; k2 < j2\<rbrakk> \<Longrightarrow> ((k1,k2),(j1,j2)) \<in> lt2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>k1 k2 j1 j2. k1 < j1 \<Longrightarrow> ((k1, k2), j1, j2) \<in> lt2) &&& (\<And>k1 k2 j1 j2. \<lbrakk>k1 \<le> j1; k2 < j2\<rbrakk> \<Longrightarrow> ((k1, k2), j1, j2) \<in> lt2)
[PROOF STEP]
unfolding lt2_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>k1 k2 j1 j2. k1 < j1 \<Longrightarrow> ((k1, k2), j1, j2) \<in> less_than <*lex*> less_than) &&& (\<And>k1 k2 j1 j2. \<lbrakk>k1 \<le> j1; k2 < j2\<rbrakk> \<Longrightarrow> ((k1, k2), j1, j2) \<in> less_than <*lex*> less_than)
[PROOF STEP]
by auto


[STATEMENT]
lemma \<gamma>_eq_trans:
  "\<gamma>_eq (x,y) \<Longrightarrow> \<gamma>_eq (y,z) \<Longrightarrow> \<gamma>_eq (x,z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<gamma>_eq (x, y); \<gamma>_eq (y, z)\<rbrakk> \<Longrightarrow> \<gamma>_eq (x, z)
[PROOF STEP]
unfolding \<gamma>_eq_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>mean (fst (x, y)) = mean (snd (x, y)) \<and> length (fst (x, y)) = length (snd (x, y)); mean (fst (y, z)) = mean (snd (y, z)) \<and> length (fst (y, z)) = length (snd (y, z))\<rbrakk> \<Longrightarrow> mean (fst (x, z)) = mean (snd (x, z)) \<and> length (fst (x, z)) = length (snd (x, z))
[PROOF STEP]
by simp


[STATEMENT]
lemma set_restriction_finite: "
  \<lbrakk> set_restriction f; finite A \<rbrakk> \<Longrightarrow> finite (f A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>set_restriction f; finite A\<rbrakk> \<Longrightarrow> finite (f A)
[PROOF STEP]
unfolding set_restriction_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<exists>P. \<forall>A. f A = {x \<in> A. P x}; finite A\<rbrakk> \<Longrightarrow> finite (f A)
[PROOF STEP]
by fastforce


[STATEMENT]
lemma mmap_lookup_update':
  "mmap_lookup (mmap_update k v kvs) z = (if k = z then Some v else mmap_lookup kvs z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mmap_lookup (mmap_update k v kvs) z = (if k = z then Some v else mmap_lookup kvs z)
[PROOF STEP]
unfolding mmap_lookup_def mmap_update_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map_of (AList.update k v kvs) z = (if k = z then Some v else map_of kvs z)
[PROOF STEP]
by (auto simp add: update_conv')


[STATEMENT]
lemma homI:
  "\<lbrakk>\<And>x. x \<in> carrier G \<Longrightarrow> h x \<in> carrier H;
    \<And>x y. \<lbrakk>x \<in> carrier G; y \<in> carrier G\<rbrakk> \<Longrightarrow> h (x \<otimes>\<^bsub>G\<^esub> y) = h x \<otimes>\<^bsub>H\<^esub> h y\<rbrakk> \<Longrightarrow> h \<in> hom G H"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<And>x. x \<in> carrier G \<Longrightarrow> h x \<in> carrier H; \<And>x y. \<lbrakk>x \<in> carrier G; y \<in> carrier G\<rbrakk> \<Longrightarrow> h (x \<otimes>\<^bsub>G\<^esub> y) = h x \<otimes>\<^bsub>H\<^esub> h y\<rbrakk> \<Longrightarrow> h \<in> hom G H
[PROOF STEP]
by (auto simp: hom_def)


[STATEMENT]
lemma ENC_FNot: "ENC n (FOV (FNot \<phi>)) = ENC n (FOV \<phi>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ENC n (FOV (FNot \<phi>)) = ENC n (FOV \<phi>)
[PROOF STEP]
unfolding ENC_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. INTERSECT (sorted_list_of_set (valid_ENC n ` FOV (FNot \<phi>))) = INTERSECT (sorted_list_of_set (valid_ENC n ` FOV \<phi>))
[PROOF STEP]
by auto


[STATEMENT]
lemma agg_sum_not_bot_1:
  fixes f :: "'a::finite \<Rightarrow> 'b::aggregation_order"
  assumes "f i \<noteq> bot"
    shows "(\<Sum>\<^sub>k f k) \<noteq> bot"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. aggregation.sum_0 f {k. True} \<noteq> bot
[PROOF STEP]
by (metis assms add_bot aggregation.sum_0.remove finite_code mem_Collect_eq)


[STATEMENT]
lemma f_join_nth: "n < length (xs \<Join>\<^sub>f I) \<Longrightarrow> (xs \<Join>\<^sub>f I) ! n = xs ! (I \<rightarrow> n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n < length (xs \<Join>\<^sub> I) \<Longrightarrow> xs \<Join>\<^sub> I ! n = xs ! (I \<rightarrow> n)
[PROOF STEP]
apply (simp add: f_join_length)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n < card (I \<down>< length xs) \<Longrightarrow> xs \<Join>\<^sub> I ! n = xs ! (I \<rightarrow> n)
[PROOF STEP]
apply (unfold f_join_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n < card (I \<down>< length xs) \<Longrightarrow> f_join_aux xs 0 I ! n = xs ! (I \<rightarrow> n)
[PROOF STEP]
apply (drule back_subst[OF _ cut_less_Int_conv])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n < card (I \<inter> {..<length xs}) \<Longrightarrow> f_join_aux xs 0 I ! n = xs ! (I \<rightarrow> n)
[PROOF STEP]
apply (simp add: f_join_aux_nth atLeast0LessThan cut_less_Int_conv[symmetric] inext_nth_cut_less_eq)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma singleton_independent_set: "v \<in> V \<Longrightarrow> is_independent_set {v}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. v \<in> V \<Longrightarrow> is_independent_set {v}
[PROOF STEP]
by (metis empty_subsetI insert_absorb2 insert_subset is_independent_alt
      singletonD singleton_not_edge vert_adj_def)


[STATEMENT]
lemma fin_maintainedI [intro]:
  assumes "\<And> F f. finite_graph F
           \<Longrightarrow> subgraph F (fst R)
           \<Longrightarrow> extensible (F,fst R) G f
           \<Longrightarrow> graph_homomorphism F G f
           \<Longrightarrow> extensible (F,snd R) G f"
  shows "fin_maintained R G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fin_maintained R G
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>finite_graph ?F; subgraph ?F (fst R); extensible (?F, fst R) G ?f; graph_homomorphism ?F G ?f\<rbrakk> \<Longrightarrow> extensible (?F, snd R) G ?f

goal (1 subgoal):
 1. fin_maintained R G
[PROOF STEP]
unfolding fin_maintained_def
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>finite_graph ?F; subgraph ?F (fst R); extensible (?F, fst R) G ?f; graph_homomorphism ?F G ?f\<rbrakk> \<Longrightarrow> extensible (?F, snd R) G ?f

goal (1 subgoal):
 1. \<forall>F f. finite_graph F \<longrightarrow> subgraph F (fst R) \<longrightarrow> extensible (F, fst R) G f \<longrightarrow> graph_homomorphism F G f \<longrightarrow> extensible (F, snd R) G f
[PROOF STEP]
by auto


[STATEMENT]
lemma powr_complexnumeral [simp]:
  fixes x::complex shows "x powr (numeral n) = x ^ (numeral n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x powr numeral n = x ^ numeral n
[PROOF STEP]
by (metis of_nat_numeral power_zero_numeral powr_nat)


[STATEMENT]
lemma poincare_between_u0v:
  assumes "u \<in> unit_disc" and "v \<in> unit_disc" and "u \<noteq> 0\<^sub>h" and "v \<noteq> 0\<^sub>h"
  shows "poincare_between u 0\<^sub>h v \<longleftrightarrow> (\<exists> k < 0. to_complex u = cor k * to_complex v)" (is "?P u v")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poincare_between u 0\<^sub>h v = (\<exists>k<0. to_complex u = cor k * to_complex v)
[PROOF STEP]
proof (cases "u = v")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. u = v \<Longrightarrow> poincare_between u 0\<^sub>h v = (\<exists>k<0. to_complex u = cor k * to_complex v)
 2. u \<noteq> v \<Longrightarrow> poincare_between u 0\<^sub>h v = (\<exists>k<0. to_complex u = cor k * to_complex v)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
u = v

goal (2 subgoals):
 1. u = v \<Longrightarrow> poincare_between u 0\<^sub>h v = (\<exists>k<0. to_complex u = cor k * to_complex v)
 2. u \<noteq> v \<Longrightarrow> poincare_between u 0\<^sub>h v = (\<exists>k<0. to_complex u = cor k * to_complex v)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
u = v

goal (1 subgoal):
 1. poincare_between u 0\<^sub>h v = (\<exists>k<0. to_complex u = cor k * to_complex v)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
u = v
u \<in> unit_disc
v \<in> unit_disc
u \<noteq> 0\<^sub>h
v \<noteq> 0\<^sub>h

goal (1 subgoal):
 1. poincare_between u 0\<^sub>h v = (\<exists>k<0. to_complex u = cor k * to_complex v)
[PROOF STEP]
using inf_or_of_complex[of v]
[PROOF STATE]
proof (prove)
using this:
u = v
u \<in> unit_disc
v \<in> unit_disc
u \<noteq> 0\<^sub>h
v \<noteq> 0\<^sub>h
v = \<infinity>\<^sub>h \<or> (\<exists>x. v = of_complex x)

goal (1 subgoal):
 1. poincare_between u 0\<^sub>h v = (\<exists>k<0. to_complex u = cor k * to_complex v)
[PROOF STEP]
using poincare_between_sandwich[of u "0\<^sub>h"]
[PROOF STATE]
proof (prove)
using this:
u = v
u \<in> unit_disc
v \<in> unit_disc
u \<noteq> 0\<^sub>h
v \<noteq> 0\<^sub>h
v = \<infinity>\<^sub>h \<or> (\<exists>x. v = of_complex x)
\<lbrakk>u \<in> unit_disc; 0\<^sub>h \<in> unit_disc; poincare_between u 0\<^sub>h u\<rbrakk> \<Longrightarrow> u = 0\<^sub>h

goal (1 subgoal):
 1. poincare_between u 0\<^sub>h v = (\<exists>k<0. to_complex u = cor k * to_complex v)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
poincare_between u 0\<^sub>h v = (\<exists>k<0. to_complex u = cor k * to_complex v)

goal (1 subgoal):
 1. u \<noteq> v \<Longrightarrow> poincare_between u 0\<^sub>h v = (\<exists>k<0. to_complex u = cor k * to_complex v)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. u \<noteq> v \<Longrightarrow> poincare_between u 0\<^sub>h v = (\<exists>k<0. to_complex u = cor k * to_complex v)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
u \<noteq> v

goal (1 subgoal):
 1. u \<noteq> v \<Longrightarrow> poincare_between u 0\<^sub>h v = (\<exists>k<0. to_complex u = cor k * to_complex v)
[PROOF STEP]
have "\<forall> u. u \<in> unit_disc \<and> u \<noteq> 0\<^sub>h \<longrightarrow> ?P u v" (is "?P' v")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>u. u \<in> unit_disc \<and> u \<noteq> 0\<^sub>h \<longrightarrow> poincare_between u 0\<^sub>h v = (\<exists>k<0. to_complex u = cor k * to_complex v)
[PROOF STEP]
proof (rule wlog_rotation_to_positive_x_axis)
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. v \<in> unit_disc
 2. v \<noteq> 0\<^sub>h
 3. \<And>\<phi> u. \<lbrakk>u \<in> unit_disc; u \<noteq> 0\<^sub>h; \<forall>ua. ua \<in> unit_disc \<and> ua \<noteq> 0\<^sub>h \<longrightarrow> poincare_between ua 0\<^sub>h (moebius_pt (moebius_rotation \<phi>) u) = (\<exists>k<0. to_complex ua = cor k * to_complex (moebius_pt (moebius_rotation \<phi>) u))\<rbrakk> \<Longrightarrow> \<forall>ua. ua \<in> unit_disc \<and> ua \<noteq> 0\<^sub>h \<longrightarrow> poincare_between ua 0\<^sub>h u = (\<exists>k<0. to_complex ua = cor k * to_complex u)
 4. \<And>x. \<lbrakk>is_real x; 0 < Re x; Re x < 1\<rbrakk> \<Longrightarrow> \<forall>u. u \<in> unit_disc \<and> u \<noteq> 0\<^sub>h \<longrightarrow> poincare_between u 0\<^sub>h (of_complex x) = (\<exists>k<0. to_complex u = cor k * to_complex (of_complex x))
[PROOF STEP]
fix \<phi> v
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. v \<in> unit_disc
 2. v \<noteq> 0\<^sub>h
 3. \<And>\<phi> u. \<lbrakk>u \<in> unit_disc; u \<noteq> 0\<^sub>h; \<forall>ua. ua \<in> unit_disc \<and> ua \<noteq> 0\<^sub>h \<longrightarrow> poincare_between ua 0\<^sub>h (moebius_pt (moebius_rotation \<phi>) u) = (\<exists>k<0. to_complex ua = cor k * to_complex (moebius_pt (moebius_rotation \<phi>) u))\<rbrakk> \<Longrightarrow> \<forall>ua. ua \<in> unit_disc \<and> ua \<noteq> 0\<^sub>h \<longrightarrow> poincare_between ua 0\<^sub>h u = (\<exists>k<0. to_complex ua = cor k * to_complex u)
 4. \<And>x. \<lbrakk>is_real x; 0 < Re x; Re x < 1\<rbrakk> \<Longrightarrow> \<forall>u. u \<in> unit_disc \<and> u \<noteq> 0\<^sub>h \<longrightarrow> poincare_between u 0\<^sub>h (of_complex x) = (\<exists>k<0. to_complex u = cor k * to_complex (of_complex x))
[PROOF STEP]
let ?M = "moebius_pt (moebius_rotation \<phi>)"
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. v \<in> unit_disc
 2. v \<noteq> 0\<^sub>h
 3. \<And>\<phi> u. \<lbrakk>u \<in> unit_disc; u \<noteq> 0\<^sub>h; \<forall>ua. ua \<in> unit_disc \<and> ua \<noteq> 0\<^sub>h \<longrightarrow> poincare_between ua 0\<^sub>h (moebius_pt (moebius_rotation \<phi>) u) = (\<exists>k<0. to_complex ua = cor k * to_complex (moebius_pt (moebius_rotation \<phi>) u))\<rbrakk> \<Longrightarrow> \<forall>ua. ua \<in> unit_disc \<and> ua \<noteq> 0\<^sub>h \<longrightarrow> poincare_between ua 0\<^sub>h u = (\<exists>k<0. to_complex ua = cor k * to_complex u)
 4. \<And>x. \<lbrakk>is_real x; 0 < Re x; Re x < 1\<rbrakk> \<Longrightarrow> \<forall>u. u \<in> unit_disc \<and> u \<noteq> 0\<^sub>h \<longrightarrow> poincare_between u 0\<^sub>h (of_complex x) = (\<exists>k<0. to_complex u = cor k * to_complex (of_complex x))
[PROOF STEP]
assume 1: "v \<in> unit_disc" "v \<noteq> 0\<^sub>h"
[PROOF STATE]
proof (state)
this:
v \<in> unit_disc
v \<noteq> 0\<^sub>h

goal (4 subgoals):
 1. v \<in> unit_disc
 2. v \<noteq> 0\<^sub>h
 3. \<And>\<phi> u. \<lbrakk>u \<in> unit_disc; u \<noteq> 0\<^sub>h; \<forall>ua. ua \<in> unit_disc \<and> ua \<noteq> 0\<^sub>h \<longrightarrow> poincare_between ua 0\<^sub>h (moebius_pt (moebius_rotation \<phi>) u) = (\<exists>k<0. to_complex ua = cor k * to_complex (moebius_pt (moebius_rotation \<phi>) u))\<rbrakk> \<Longrightarrow> \<forall>ua. ua \<in> unit_disc \<and> ua \<noteq> 0\<^sub>h \<longrightarrow> poincare_between ua 0\<^sub>h u = (\<exists>k<0. to_complex ua = cor k * to_complex u)
 4. \<And>x. \<lbrakk>is_real x; 0 < Re x; Re x < 1\<rbrakk> \<Longrightarrow> \<forall>u. u \<in> unit_disc \<and> u \<noteq> 0\<^sub>h \<longrightarrow> poincare_between u 0\<^sub>h (of_complex x) = (\<exists>k<0. to_complex u = cor k * to_complex (of_complex x))
[PROOF STEP]
assume 2: "?P' (?M v)"
[PROOF STATE]
proof (state)
this:
\<forall>u. u \<in> unit_disc \<and> u \<noteq> 0\<^sub>h \<longrightarrow> poincare_between u 0\<^sub>h (moebius_pt (moebius_rotation \<phi>) v) = (\<exists>k<0. to_complex u = cor k * to_complex (moebius_pt (moebius_rotation \<phi>) v))

goal (4 subgoals):
 1. v \<in> unit_disc
 2. v \<noteq> 0\<^sub>h
 3. \<And>\<phi> u. \<lbrakk>u \<in> unit_disc; u \<noteq> 0\<^sub>h; \<forall>ua. ua \<in> unit_disc \<and> ua \<noteq> 0\<^sub>h \<longrightarrow> poincare_between ua 0\<^sub>h (moebius_pt (moebius_rotation \<phi>) u) = (\<exists>k<0. to_complex ua = cor k * to_complex (moebius_pt (moebius_rotation \<phi>) u))\<rbrakk> \<Longrightarrow> \<forall>ua. ua \<in> unit_disc \<and> ua \<noteq> 0\<^sub>h \<longrightarrow> poincare_between ua 0\<^sub>h u = (\<exists>k<0. to_complex ua = cor k * to_complex u)
 4. \<And>x. \<lbrakk>is_real x; 0 < Re x; Re x < 1\<rbrakk> \<Longrightarrow> \<forall>u. u \<in> unit_disc \<and> u \<noteq> 0\<^sub>h \<longrightarrow> poincare_between u 0\<^sub>h (of_complex x) = (\<exists>k<0. to_complex u = cor k * to_complex (of_complex x))
[PROOF STEP]
show "?P' v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>u. u \<in> unit_disc \<and> u \<noteq> 0\<^sub>h \<longrightarrow> poincare_between u 0\<^sub>h v = (\<exists>k<0. to_complex u = cor k * to_complex v)
[PROOF STEP]
proof (rule allI, rule impI, (erule conjE)+)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>u. \<lbrakk>u \<in> unit_disc; u \<noteq> 0\<^sub>h\<rbrakk> \<Longrightarrow> poincare_between u 0\<^sub>h v = (\<exists>k<0. to_complex u = cor k * to_complex v)
[PROOF STEP]
fix u
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>u. \<lbrakk>u \<in> unit_disc; u \<noteq> 0\<^sub>h\<rbrakk> \<Longrightarrow> poincare_between u 0\<^sub>h v = (\<exists>k<0. to_complex u = cor k * to_complex v)
[PROOF STEP]
assume 3: "u \<in> unit_disc" "u \<noteq> 0\<^sub>h"
[PROOF STATE]
proof (state)
this:
u \<in> unit_disc
u \<noteq> 0\<^sub>h

goal (1 subgoal):
 1. \<And>u. \<lbrakk>u \<in> unit_disc; u \<noteq> 0\<^sub>h\<rbrakk> \<Longrightarrow> poincare_between u 0\<^sub>h v = (\<exists>k<0. to_complex u = cor k * to_complex v)
[PROOF STEP]
have "poincare_between (?M u) 0\<^sub>h (?M v) \<longleftrightarrow> poincare_between u 0\<^sub>h v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poincare_between (moebius_pt (moebius_rotation \<phi>) u) 0\<^sub>h (moebius_pt (moebius_rotation \<phi>) v) = poincare_between u 0\<^sub>h v
[PROOF STEP]
using \<open>u \<in> unit_disc\<close> \<open>v \<in> unit_disc\<close>
[PROOF STATE]
proof (prove)
using this:
u \<in> unit_disc
v \<in> unit_disc

goal (1 subgoal):
 1. poincare_between (moebius_pt (moebius_rotation \<phi>) u) 0\<^sub>h (moebius_pt (moebius_rotation \<phi>) v) = poincare_between u 0\<^sub>h v
[PROOF STEP]
using unit_disc_fix_moebius_preserve_poincare_between unit_disc_fix_rotation zero_in_unit_disc
[PROOF STATE]
proof (prove)
using this:
u \<in> unit_disc
v \<in> unit_disc
\<lbrakk>unit_disc_fix ?M; ?u \<in> unit_disc; ?v \<in> unit_disc; ?w \<in> unit_disc\<rbrakk> \<Longrightarrow> poincare_between (moebius_pt ?M ?u) (moebius_pt ?M ?v) (moebius_pt ?M ?w) = poincare_between ?u ?v ?w
unit_disc_fix (moebius_rotation ?\<phi>)
0\<^sub>h \<in> unit_disc

goal (1 subgoal):
 1. poincare_between (moebius_pt (moebius_rotation \<phi>) u) 0\<^sub>h (moebius_pt (moebius_rotation \<phi>) v) = poincare_between u 0\<^sub>h v
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
poincare_between (moebius_pt (moebius_rotation \<phi>) u) 0\<^sub>h (moebius_pt (moebius_rotation \<phi>) v) = poincare_between u 0\<^sub>h v

goal (1 subgoal):
 1. \<And>u. \<lbrakk>u \<in> unit_disc; u \<noteq> 0\<^sub>h\<rbrakk> \<Longrightarrow> poincare_between u 0\<^sub>h v = (\<exists>k<0. to_complex u = cor k * to_complex v)
[PROOF STEP]
thus "?P u v"
[PROOF STATE]
proof (prove)
using this:
poincare_between (moebius_pt (moebius_rotation \<phi>) u) 0\<^sub>h (moebius_pt (moebius_rotation \<phi>) v) = poincare_between u 0\<^sub>h v

goal (1 subgoal):
 1. poincare_between u 0\<^sub>h v = (\<exists>k<0. to_complex u = cor k * to_complex v)
[PROOF STEP]
using 1 2[rule_format, of "?M u"] 3
[PROOF STATE]
proof (prove)
using this:
poincare_between (moebius_pt (moebius_rotation \<phi>) u) 0\<^sub>h (moebius_pt (moebius_rotation \<phi>) v) = poincare_between u 0\<^sub>h v
v \<in> unit_disc
v \<noteq> 0\<^sub>h
moebius_pt (moebius_rotation \<phi>) u \<in> unit_disc \<and> moebius_pt (moebius_rotation \<phi>) u \<noteq> 0\<^sub>h \<Longrightarrow> poincare_between (moebius_pt (moebius_rotation \<phi>) u) 0\<^sub>h (moebius_pt (moebius_rotation \<phi>) v) = (\<exists>k<0. to_complex (moebius_pt (moebius_rotation \<phi>) u) = cor k * to_complex (moebius_pt (moebius_rotation \<phi>) v))
u \<in> unit_disc
u \<noteq> 0\<^sub>h

goal (1 subgoal):
 1. poincare_between u 0\<^sub>h v = (\<exists>k<0. to_complex u = cor k * to_complex v)
[PROOF STEP]
using inf_or_of_complex[of u] inf_or_of_complex[of v]
[PROOF STATE]
proof (prove)
using this:
poincare_between (moebius_pt (moebius_rotation \<phi>) u) 0\<^sub>h (moebius_pt (moebius_rotation \<phi>) v) = poincare_between u 0\<^sub>h v
v \<in> unit_disc
v \<noteq> 0\<^sub>h
moebius_pt (moebius_rotation \<phi>) u \<in> unit_disc \<and> moebius_pt (moebius_rotation \<phi>) u \<noteq> 0\<^sub>h \<Longrightarrow> poincare_between (moebius_pt (moebius_rotation \<phi>) u) 0\<^sub>h (moebius_pt (moebius_rotation \<phi>) v) = (\<exists>k<0. to_complex (moebius_pt (moebius_rotation \<phi>) u) = cor k * to_complex (moebius_pt (moebius_rotation \<phi>) v))
u \<in> unit_disc
u \<noteq> 0\<^sub>h
u = \<infinity>\<^sub>h \<or> (\<exists>x. u = of_complex x)
v = \<infinity>\<^sub>h \<or> (\<exists>x. v = of_complex x)

goal (1 subgoal):
 1. poincare_between u 0\<^sub>h v = (\<exists>k<0. to_complex u = cor k * to_complex v)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
poincare_between u 0\<^sub>h v = (\<exists>k<0. to_complex u = cor k * to_complex v)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>u. u \<in> unit_disc \<and> u \<noteq> 0\<^sub>h \<longrightarrow> poincare_between u 0\<^sub>h v = (\<exists>k<0. to_complex u = cor k * to_complex v)

goal (3 subgoals):
 1. v \<in> unit_disc
 2. v \<noteq> 0\<^sub>h
 3. \<And>x. \<lbrakk>is_real x; 0 < Re x; Re x < 1\<rbrakk> \<Longrightarrow> \<forall>u. u \<in> unit_disc \<and> u \<noteq> 0\<^sub>h \<longrightarrow> poincare_between u 0\<^sub>h (of_complex x) = (\<exists>k<0. to_complex u = cor k * to_complex (of_complex x))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. v \<in> unit_disc
 2. v \<noteq> 0\<^sub>h
 3. \<And>x. \<lbrakk>is_real x; 0 < Re x; Re x < 1\<rbrakk> \<Longrightarrow> \<forall>u. u \<in> unit_disc \<and> u \<noteq> 0\<^sub>h \<longrightarrow> poincare_between u 0\<^sub>h (of_complex x) = (\<exists>k<0. to_complex u = cor k * to_complex (of_complex x))
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. v \<in> unit_disc
 2. v \<noteq> 0\<^sub>h
 3. \<And>x. \<lbrakk>is_real x; 0 < Re x; Re x < 1\<rbrakk> \<Longrightarrow> \<forall>u. u \<in> unit_disc \<and> u \<noteq> 0\<^sub>h \<longrightarrow> poincare_between u 0\<^sub>h (of_complex x) = (\<exists>k<0. to_complex u = cor k * to_complex (of_complex x))
[PROOF STEP]
assume 1: "is_real x" "0 < Re x" "Re x < 1"
[PROOF STATE]
proof (state)
this:
is_real x
0 < Re x
Re x < 1

goal (3 subgoals):
 1. v \<in> unit_disc
 2. v \<noteq> 0\<^sub>h
 3. \<And>x. \<lbrakk>is_real x; 0 < Re x; Re x < 1\<rbrakk> \<Longrightarrow> \<forall>u. u \<in> unit_disc \<and> u \<noteq> 0\<^sub>h \<longrightarrow> poincare_between u 0\<^sub>h (of_complex x) = (\<exists>k<0. to_complex u = cor k * to_complex (of_complex x))
[PROOF STEP]
hence "x \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
is_real x
0 < Re x
Re x < 1

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

goal (3 subgoals):
 1. v \<in> unit_disc
 2. v \<noteq> 0\<^sub>h
 3. \<And>x. \<lbrakk>is_real x; 0 < Re x; Re x < 1\<rbrakk> \<Longrightarrow> \<forall>u. u \<in> unit_disc \<and> u \<noteq> 0\<^sub>h \<longrightarrow> poincare_between u 0\<^sub>h (of_complex x) = (\<exists>k<0. to_complex u = cor k * to_complex (of_complex x))
[PROOF STEP]
show "?P' (of_complex x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>u. u \<in> unit_disc \<and> u \<noteq> 0\<^sub>h \<longrightarrow> poincare_between u 0\<^sub>h (of_complex x) = (\<exists>k<0. to_complex u = cor k * to_complex (of_complex x))
[PROOF STEP]
proof (rule allI, rule impI, (erule conjE)+)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>u. \<lbrakk>u \<in> unit_disc; u \<noteq> 0\<^sub>h\<rbrakk> \<Longrightarrow> poincare_between u 0\<^sub>h (of_complex x) = (\<exists>k<0. to_complex u = cor k * to_complex (of_complex x))
[PROOF STEP]
fix u
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>u. \<lbrakk>u \<in> unit_disc; u \<noteq> 0\<^sub>h\<rbrakk> \<Longrightarrow> poincare_between u 0\<^sub>h (of_complex x) = (\<exists>k<0. to_complex u = cor k * to_complex (of_complex x))
[PROOF STEP]
assume 2: "u \<in> unit_disc" "u \<noteq> 0\<^sub>h"
[PROOF STATE]
proof (state)
this:
u \<in> unit_disc
u \<noteq> 0\<^sub>h

goal (1 subgoal):
 1. \<And>u. \<lbrakk>u \<in> unit_disc; u \<noteq> 0\<^sub>h\<rbrakk> \<Longrightarrow> poincare_between u 0\<^sub>h (of_complex x) = (\<exists>k<0. to_complex u = cor k * to_complex (of_complex x))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
u \<in> unit_disc
u \<noteq> 0\<^sub>h
[PROOF STEP]
obtain u' where "u = of_complex u'"
[PROOF STATE]
proof (prove)
using this:
u \<in> unit_disc
u \<noteq> 0\<^sub>h

goal (1 subgoal):
 1. (\<And>u'. u = of_complex u' \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using inf_or_of_complex[of u]
[PROOF STATE]
proof (prove)
using this:
u \<in> unit_disc
u \<noteq> 0\<^sub>h
u = \<infinity>\<^sub>h \<or> (\<exists>x. u = of_complex x)

goal (1 subgoal):
 1. (\<And>u'. u = of_complex u' \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
u = of_complex u'

goal (1 subgoal):
 1. \<And>u. \<lbrakk>u \<in> unit_disc; u \<noteq> 0\<^sub>h\<rbrakk> \<Longrightarrow> poincare_between u 0\<^sub>h (of_complex x) = (\<exists>k<0. to_complex u = cor k * to_complex (of_complex x))
[PROOF STEP]
show "?P u (of_complex x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poincare_between u 0\<^sub>h (of_complex x) = (\<exists>k<0. to_complex u = cor k * to_complex (of_complex x))
[PROOF STEP]
using 1 2 \<open>x \<noteq> 0\<close> \<open>u = of_complex u'\<close>
[PROOF STATE]
proof (prove)
using this:
is_real x
0 < Re x
Re x < 1
u \<in> unit_disc
u \<noteq> 0\<^sub>h
x \<noteq> 0
u = of_complex u'

goal (1 subgoal):
 1. poincare_between u 0\<^sub>h (of_complex x) = (\<exists>k<0. to_complex u = cor k * to_complex (of_complex x))
[PROOF STEP]
using poincare_between_rev[of u "0\<^sub>h" "of_complex x"]
[PROOF STATE]
proof (prove)
using this:
is_real x
0 < Re x
Re x < 1
u \<in> unit_disc
u \<noteq> 0\<^sub>h
x \<noteq> 0
u = of_complex u'
\<lbrakk>u \<in> unit_disc; 0\<^sub>h \<in> unit_disc; of_complex x \<in> unit_disc\<rbrakk> \<Longrightarrow> poincare_between u 0\<^sub>h (of_complex x) = poincare_between (of_complex x) 0\<^sub>h u

goal (1 subgoal):
 1. poincare_between u 0\<^sub>h (of_complex x) = (\<exists>k<0. to_complex u = cor k * to_complex (of_complex x))
[PROOF STEP]
using poincare_between_x_axis_u0v[of x u'] \<open>is_real x\<close>
[PROOF STATE]
proof (prove)
using this:
is_real x
0 < Re x
Re x < 1
u \<in> unit_disc
u \<noteq> 0\<^sub>h
x \<noteq> 0
u = of_complex u'
\<lbrakk>u \<in> unit_disc; 0\<^sub>h \<in> unit_disc; of_complex x \<in> unit_disc\<rbrakk> \<Longrightarrow> poincare_between u 0\<^sub>h (of_complex x) = poincare_between (of_complex x) 0\<^sub>h u
\<lbrakk>is_real x; x \<noteq> 0; u' \<noteq> 0\<rbrakk> \<Longrightarrow> poincare_between (of_complex x) 0\<^sub>h (of_complex u') = (is_real u' \<and> Re x * Re u' < 0)
is_real x

goal (1 subgoal):
 1. poincare_between u 0\<^sub>h (of_complex x) = (\<exists>k<0. to_complex u = cor k * to_complex (of_complex x))
[PROOF STEP]
apply (auto simp add: cmod_eq_Re)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>0 < Re x; Re x < 1; \<bar>Re u'\<bar> < 1; u' \<noteq> 0; x \<noteq> 0; u = of_complex u'; is_real x; poincare_between (of_complex u') 0\<^sub>h (of_complex x); poincare_between (of_complex x) 0\<^sub>h (of_complex u'); is_real u'; Re x * Re u' < 0\<rbrakk> \<Longrightarrow> \<exists>k<0. u' = cor k * x
 2. \<And>k. \<lbrakk>0 < Re x; Re x < 1; \<bar>k * Re x\<bar> < 1; x \<noteq> 0; u = of_complex (cor k * x); is_real x; \<not> poincare_between (of_complex (cor k * x)) 0\<^sub>h (of_complex x); \<not> poincare_between (of_complex x) 0\<^sub>h (of_complex (cor k * x)); \<not> Re x * (k * Re x) < 0; k < 0; u' = cor k * x\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
apply (rule_tac x="Re u' / Re x" in exI, simp add: divide_neg_pos algebra_split_simps)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>k. \<lbrakk>0 < Re x; Re x < 1; \<bar>k * Re x\<bar> < 1; x \<noteq> 0; u = of_complex (cor k * x); is_real x; \<not> poincare_between (of_complex (cor k * x)) 0\<^sub>h (of_complex x); \<not> poincare_between (of_complex x) 0\<^sub>h (of_complex (cor k * x)); \<not> Re x * (k * Re x) < 0; k < 0; u' = cor k * x\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
using mult_neg_pos mult_pos_neg
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?a < (0::?'a); (0::?'a) < ?b\<rbrakk> \<Longrightarrow> ?a * ?b < (0::?'a)
\<lbrakk>(0::?'a) < ?a; ?b < (0::?'a)\<rbrakk> \<Longrightarrow> ?a * ?b < (0::?'a)

goal (1 subgoal):
 1. \<And>k. \<lbrakk>0 < Re x; Re x < 1; \<bar>k * Re x\<bar> < 1; x \<noteq> 0; u = of_complex (cor k * x); is_real x; \<not> poincare_between (of_complex (cor k * x)) 0\<^sub>h (of_complex x); \<not> poincare_between (of_complex x) 0\<^sub>h (of_complex (cor k * x)); \<not> Re x * (k * Re x) < 0; k < 0; u' = cor k * x\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
poincare_between u 0\<^sub>h (of_complex x) = (\<exists>k<0. to_complex u = cor k * to_complex (of_complex x))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>u. u \<in> unit_disc \<and> u \<noteq> 0\<^sub>h \<longrightarrow> poincare_between u 0\<^sub>h (of_complex x) = (\<exists>k<0. to_complex u = cor k * to_complex (of_complex x))

goal (2 subgoals):
 1. v \<in> unit_disc
 2. v \<noteq> 0\<^sub>h
[PROOF STEP]
qed fact+
[PROOF STATE]
proof (state)
this:
\<forall>u. u \<in> unit_disc \<and> u \<noteq> 0\<^sub>h \<longrightarrow> poincare_between u 0\<^sub>h v = (\<exists>k<0. to_complex u = cor k * to_complex v)

goal (1 subgoal):
 1. u \<noteq> v \<Longrightarrow> poincare_between u 0\<^sub>h v = (\<exists>k<0. to_complex u = cor k * to_complex v)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<forall>u. u \<in> unit_disc \<and> u \<noteq> 0\<^sub>h \<longrightarrow> poincare_between u 0\<^sub>h v = (\<exists>k<0. to_complex u = cor k * to_complex v)

goal (1 subgoal):
 1. poincare_between u 0\<^sub>h v = (\<exists>k<0. to_complex u = cor k * to_complex v)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<forall>u. u \<in> unit_disc \<and> u \<noteq> 0\<^sub>h \<longrightarrow> poincare_between u 0\<^sub>h v = (\<exists>k<0. to_complex u = cor k * to_complex v)
u \<in> unit_disc
v \<in> unit_disc
u \<noteq> 0\<^sub>h
v \<noteq> 0\<^sub>h

goal (1 subgoal):
 1. poincare_between u 0\<^sub>h v = (\<exists>k<0. to_complex u = cor k * to_complex v)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
poincare_between u 0\<^sub>h v = (\<exists>k<0. to_complex u = cor k * to_complex v)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in sturm_seq) p_nonzero_imp_sign_changes_const:
  "poly p x\<^sub>0 \<noteq> 0 \<Longrightarrow>
       eventually (\<lambda>x. sign_changes ps x = sign_changes ps x\<^sub>0) (at x\<^sub>0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly p x\<^sub>0 \<noteq> 0 \<Longrightarrow> \<forall>\<^sub>F x in at x\<^sub>0. sign_changes ps x = sign_changes ps x\<^sub>0
[PROOF STEP]
using hd_nonzero_imp_sign_changes_const
[PROOF STATE]
proof (prove)
using this:
poly (hd ps) ?x\<^sub>0 \<noteq> 0 \<Longrightarrow> \<forall>\<^sub>F x in at ?x\<^sub>0. sign_changes ps x = sign_changes ps ?x\<^sub>0

goal (1 subgoal):
 1. poly p x\<^sub>0 \<noteq> 0 \<Longrightarrow> \<forall>\<^sub>F x in at x\<^sub>0. sign_changes ps x = sign_changes ps x\<^sub>0
[PROOF STEP]
by simp


[STATEMENT]
lemma prefix_match_semantics_ipset_from_netmask2:
    assumes "valid_prefix pfx"
    shows "prefix_match_semantics pfx (a :: 'i::len word) \<longleftrightarrow>
            a \<in> ipset_from_cidr (pfxm_prefix pfx) (pfxm_length pfx)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prefix_match_semantics pfx a = (a \<in> ipset_from_cidr (pfxm_prefix pfx) (pfxm_length pfx))
[PROOF STEP]
unfolding prefix_match_semantics_ipset_from_netmask[OF assms] pfxm_mask_def ipset_from_cidr_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a \<in> ipset_from_netmask (pfxm_prefix pfx) (~~ mask (LENGTH('i) - pfxm_length pfx))) = (a \<in> ipset_from_netmask (pfxm_prefix pfx) (mask (pfxm_length pfx) << LENGTH('i) - pfxm_length pfx))
[PROOF STEP]
by (metis (full_types) NOT_mask_shifted_lenword word_not_not)


[STATEMENT]
lemma ldeep_T_pos: "\<lbrakk>\<forall>x\<in> set ys. cf x > 0; sel_reasonable f\<rbrakk> \<Longrightarrow> ldeep_T (ldeep_s f xs) cf ys > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>x\<in>set ys. 0 < cf x; sel_reasonable f\<rbrakk> \<Longrightarrow> 0 < ldeep_T (ldeep_s f xs) cf ys
[PROOF STEP]
apply(induction ys arbitrary: xs)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>xs. \<lbrakk>\<forall>x\<in>set []. 0 < cf x; sel_reasonable f\<rbrakk> \<Longrightarrow> 0 < ldeep_T (ldeep_s f xs) cf []
 2. \<And>a ys xs. \<lbrakk>\<And>xs. \<lbrakk>\<forall>x\<in>set ys. 0 < cf x; sel_reasonable f\<rbrakk> \<Longrightarrow> 0 < ldeep_T (ldeep_s f xs) cf ys; \<forall>x\<in>set (a # ys). 0 < cf x; sel_reasonable f\<rbrakk> \<Longrightarrow> 0 < ldeep_T (ldeep_s f xs) cf (a # ys)
[PROOF STEP]
apply(auto simp: ldeep_T_def)[2]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a ys xs. \<lbrakk>\<And>xs. 0 < foldl (\<lambda>a b. a * cf b * ldeep_s f xs b) 1 ys; sel_reasonable f; 0 < cf a; \<forall>x\<in>set ys. 0 < cf x\<rbrakk> \<Longrightarrow> 0 < foldl (\<lambda>a b. a * cf b * ldeep_s f xs b) (cf a * ldeep_s f xs a) ys
[PROOF STEP]
by (metis Groups.comm_monoid_mult_class.mult_1 ldeep_T'_eq_foldl ldeep_s_pos zero_less_mult_iff)


[STATEMENT]
lemma filterlim_at_right_to_top:
  "filterlim f F (at_right (0::real)) \<longleftrightarrow> (LIM x at_top. f (inverse x) :> F)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. filterlim f F (at_right 0) = (LIM x at_top. f (inverse x) :> F)
[PROOF STEP]
unfolding filterlim_def at_right_to_top filtermap_filtermap
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (filtermap (\<lambda>x. f (inverse x)) at_top \<le> F) = (filtermap (\<lambda>x. f (inverse x)) at_top \<le> F)
[PROOF STEP]
..


[STATEMENT]
theorem usubst_fml: "Uvariation \<nu> \<omega> U \<Longrightarrow> usubstappf \<sigma> U \<phi> \<noteq> undeff \<Longrightarrow>
    (\<nu> \<in> fml_sem I (the (usubstappf \<sigma> U \<phi>))) = (\<nu> \<in> fml_sem (adjoint \<sigma> I \<omega>) \<phi>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Uvariation \<nu> \<omega> U; usubstappf \<sigma> U \<phi> \<noteq> undeff\<rbrakk> \<Longrightarrow> (\<nu> \<in> fml_sem I (the (usubstappf \<sigma> U \<phi>))) = (\<nu> \<in> fml_sem (USubst.adjoint \<sigma> I \<omega>) \<phi>)
[PROOF STEP]
using usubst_fml_game
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>Uvariation ?\<nu> ?\<omega> ?U; usubstappf ?\<sigma> ?U ?\<phi> \<noteq> undeff\<rbrakk> \<Longrightarrow> (?\<nu> \<in> fml_sem ?I (the (usubstappf ?\<sigma> ?U ?\<phi>))) = (?\<nu> \<in> fml_sem (USubst.adjoint ?\<sigma> ?I ?\<omega>) ?\<phi>)
\<lbrakk>Uvariation ?\<nu> ?\<omega> ?U; snd (usubstappp ?\<sigma> ?U ?\<alpha>) \<noteq> undefg\<rbrakk> \<Longrightarrow> (?\<nu> \<in> game_sem ?I (the (snd (usubstappp ?\<sigma> ?U ?\<alpha>))) ?X) = (?\<nu> \<in> game_sem (USubst.adjoint ?\<sigma> ?I ?\<omega>) ?\<alpha> ?X)

goal (1 subgoal):
 1. \<lbrakk>Uvariation \<nu> \<omega> U; usubstappf \<sigma> U \<phi> \<noteq> undeff\<rbrakk> \<Longrightarrow> (\<nu> \<in> fml_sem I (the (usubstappf \<sigma> U \<phi>))) = (\<nu> \<in> fml_sem (USubst.adjoint \<sigma> I \<omega>) \<phi>)
[PROOF STEP]
by simp


[STATEMENT]
lemma wide_subcat_antisym:
  assumes "\<AA> \<subseteq>\<^sub>C\<^sub>.\<^sub>w\<^sub>i\<^sub>d\<^sub>e\<^bsub>\<alpha>\<^esub> \<BB>" and "\<BB> \<subseteq>\<^sub>C\<^sub>.\<^sub>w\<^sub>i\<^sub>d\<^sub>e\<^bsub>\<alpha>\<^esub> \<AA>"
  shows "\<AA> = \<BB>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<AA> = \<BB>
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<AA> = \<BB>
[PROOF STEP]
interpret \<AA>\<BB>: wide_subcategory \<alpha> \<AA> \<BB>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<AA> \<subseteq>\<^sub>C\<^sub>.\<^sub>w\<^sub>i\<^sub>d\<^sub>e\<^bsub>\<alpha>\<^esub> \<BB>
[PROOF STEP]
by (rule assms(1))
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<AA> = \<BB>
[PROOF STEP]
interpret \<BB>\<AA>: wide_subcategory \<alpha> \<BB> \<AA>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<BB> \<subseteq>\<^sub>C\<^sub>.\<^sub>w\<^sub>i\<^sub>d\<^sub>e\<^bsub>\<alpha>\<^esub> \<AA>
[PROOF STEP]
by (rule assms(2))
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<AA> = \<BB>
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<AA> = \<BB>
[PROOF STEP]
by (rule subcat_antisym[OF \<AA>\<BB>.subcategory_axioms \<BB>\<AA>.subcategory_axioms])
[PROOF STATE]
proof (state)
this:
\<AA> = \<BB>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma notStep3EqualCoord:
  assumes run: "CHORun LV_M rho HOs coords" and stp:"step r \<noteq> 3"
  shows "coord\<Phi> (rho (Suc r) p) = coord\<Phi> (rho r p)" (is "?P p r")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. coord\<Phi> (rho (Suc r) p) = coord\<Phi> (rho r p)
[PROOF STEP]
by (rule LV_Suc'[OF run, where P="?P"])
     (auto simp: stp next0_def next1_def next2_def)


[STATEMENT]
lemma test_suite_to_io_maximal_finite :
  assumes "implies_completeness T M m"
  and     "is_finite_test_suite T"
  and     "observable M"
shows "finite (test_suite_to_io_maximal M T)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (test_suite_to_io_maximal M T)
[PROOF STEP]
using test_suite_to_io_finite[OF assms(1,2)]
[PROOF STATE]
proof (prove)
using this:
finite (test_suite_to_io M T)

goal (1 subgoal):
 1. finite (test_suite_to_io_maximal M T)
[PROOF STEP]
unfolding test_suite_to_io_maximal_code[OF assms, symmetric]
[PROOF STATE]
proof (prove)
using this:
finite (test_suite_to_io M T)

goal (1 subgoal):
 1. finite {io' \<in> test_suite_to_io M T. \<nexists>io''. io'' \<noteq> [] \<and> io' @ io'' \<in> test_suite_to_io M T}
[PROOF STEP]
by simp


[STATEMENT]
lemma (in group) subgroup_ord_eq:
  assumes "subgroup H G" "x \<in> H"
  shows "group.ord (G\<lparr>carrier := H\<rparr>) x = ord x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. group.ord (G\<lparr>carrier := H\<rparr>) x = ord x
[PROOF STEP]
using nat_pow_consistent ord_def group.ord_def[of "(G\<lparr>carrier := H\<rparr>)" x]
        subgroup.subgroup_is_group[of H G] assms
[PROOF STATE]
proof (prove)
using this:
?x [^] ?n = ?x [^]\<^bsub>G\<lparr>carrier := ?H\<rparr>\<^esub> ?n
ord ?x \<equiv> SOME d. \<forall>n. (?x [^] n = \<one>) = (d dvd n)
Group.group (G\<lparr>carrier := H\<rparr>) \<Longrightarrow> group.ord (G\<lparr>carrier := H\<rparr>) x \<equiv> SOME d. \<forall>n. (x [^]\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> n = \<one>\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub>) = (d dvd n)
\<lbrakk>subgroup H G; Group.group G\<rbrakk> \<Longrightarrow> Group.group (G\<lparr>carrier := H\<rparr>)
subgroup H G
x \<in> H

goal (1 subgoal):
 1. group.ord (G\<lparr>carrier := H\<rparr>) x = ord x
[PROOF STEP]
by simp


[STATEMENT]
lemma vec_of_basis_enum_divide:
  fixes \<psi> \<phi> :: "'a::one_dim"
  shows "vec_of_basis_enum (\<psi> / \<phi>)
   = vec_of_list [vec_index (vec_of_basis_enum \<psi>) 0 / vec_index (vec_of_basis_enum \<phi>) 0]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec_of_basis_enum (\<psi> / \<phi>) = vec_of_list [vec_of_basis_enum \<psi> $ 0 / vec_of_basis_enum \<phi> $ 0]
[PROOF STEP]
by (simp add: divide_inverse vec_of_basis_enum_to_inverse vec_of_basis_enum_times)


[STATEMENT]
lemma relabel_vars_mult:
  assumes "g \<in> I \<rightarrow> J"
  assumes "P \<in> carrier (Pring R I)"
  assumes "Q \<in> carrier (Pring R I)"
  shows "relabel_vars I J g (P \<otimes>\<^bsub>Pring R I\<^esub> Q) = relabel_vars I J g P \<otimes>\<^bsub>Pring R J\<^esub> relabel_vars I J g Q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. relabel_vars I J g (P \<otimes>\<^bsub>Pring R I\<^esub> Q) = relabel_vars I J g P \<otimes>\<^bsub>Pring R J\<^esub> relabel_vars I J g Q
[PROOF STEP]
using assms relabel_vars_is_morphism(1)[of g I J] ring_hom_ring.homh ring_hom_mult
[PROOF STATE]
proof (prove)
using this:
g \<in> I \<rightarrow> J
P \<in> carrier (Pring R I)
Q \<in> carrier (Pring R I)
g \<in> I \<rightarrow> J \<Longrightarrow> ring_hom_ring (Pring R I) (Pring R J) (relabel_vars I J g)
ring_hom_ring ?R ?S ?h \<Longrightarrow> ?h \<in> ring_hom ?R ?S
\<lbrakk>?h \<in> ring_hom ?R ?S; ?x \<in> carrier ?R; ?y \<in> carrier ?R\<rbrakk> \<Longrightarrow> ?h (?x \<otimes>\<^bsub>?R\<^esub> ?y) = ?h ?x \<otimes>\<^bsub>?S\<^esub> ?h ?y

goal (1 subgoal):
 1. relabel_vars I J g (P \<otimes>\<^bsub>Pring R I\<^esub> Q) = relabel_vars I J g P \<otimes>\<^bsub>Pring R J\<^esub> relabel_vars I J g Q
[PROOF STEP]
by (metis (no_types, lifting))


[STATEMENT]
lemma odd_word_imp_even_next:"odd (unat (x::('a::len) word)) \<Longrightarrow> x + 1 = 0 \<or> even (unat (x + 1))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. odd (unat x) \<Longrightarrow> x + 1 = 0 \<or> even (unat (x + 1))
[PROOF STEP]
apply (cut_tac x=x in word_overflow_unat)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>odd (unat x); unat (x + 1) = unat x + 1 \<or> x + 1 = 0\<rbrakk> \<Longrightarrow> x + 1 = 0 \<or> even (unat (x + 1))
[PROOF STEP]
apply clarsimp
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma output_complete_alt_def_h :
  "output_complete M = (\<forall> q x . h M (q,x) \<noteq> {} \<longrightarrow> (\<forall> y \<in> outputs M . \<exists> q' . (y,q') \<in> h M (q,x)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. output_complete M = (\<forall>q x. FSM.h M (q, x) \<noteq> {} \<longrightarrow> (\<forall>y\<in>FSM.outputs M. \<exists>q'. (y, q') \<in> FSM.h M (q, x)))
[PROOF STEP]
by force


[STATEMENT]
lemma mset_ran_empty_iff[simp]:
  "finite r \<Longrightarrow> mset_ran a r = {#} \<longleftrightarrow> r={}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite r \<Longrightarrow> (mset_ran a r = {#}) = (r = {})
[PROOF STEP]
by (auto simp: mset_ran_def mset_set_empty_iff)


[STATEMENT]
lemma Sup_trans_least:
  "\<lbrakk> \<forall>t\<in>S. le_utrans t u; \<And>P. unitary P \<Longrightarrow> unitary (u P) \<rbrakk> \<Longrightarrow> le_utrans (Sup_trans S) u"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>t\<in>S. le_utrans t u; \<And>P. unitary P \<Longrightarrow> unitary (u P)\<rbrakk> \<Longrightarrow> le_utrans (Sup_trans S) u
[PROOF STEP]
unfolding Sup_trans_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>t\<in>S. le_utrans t u; \<And>P. unitary P \<Longrightarrow> unitary (u P)\<rbrakk> \<Longrightarrow> le_utrans (\<lambda>P. Sup_exp {t P |t. t \<in> S}) u
[PROOF STEP]
by(auto intro!:sound_nneg[OF unitary_sound] le_utransI[OF Sup_exp_least])


[STATEMENT]
lemma eint_Min_gr:
  assumes "finite (A::eint set)"
  assumes "\<And>x. x \<in> A \<Longrightarrow> x > c"
  assumes "A \<noteq> {}"
  shows "Min A > c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c < Min A
[PROOF STEP]
using Min_in[of A] assms(2)[of "Min A"] assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>finite A; A \<noteq> {}\<rbrakk> \<Longrightarrow> Min A \<in> A
Min A \<in> A \<Longrightarrow> c < Min A
finite A
?x1 \<in> A \<Longrightarrow> c < ?x1
A \<noteq> {}

goal (1 subgoal):
 1. c < Min A
[PROOF STEP]
by blast


[STATEMENT]
lemma prefixToLevelPrefixToLevelHigherLevel:
  assumes "level \<le> level'"
  shows "prefixToLevel level M = prefixToLevel level (prefixToLevel level' M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prefixToLevel level M = prefixToLevel level (prefixToLevel level' M)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
level \<le> level'

goal (1 subgoal):
 1. prefixToLevel level M = prefixToLevel level (prefixToLevel level' M)
[PROOF STEP]
unfolding prefixToLevel_def
[PROOF STATE]
proof (prove)
using this:
level \<le> level'

goal (1 subgoal):
 1. prefixToLevel_aux M level 0 = prefixToLevel_aux (prefixToLevel_aux M level' 0) level 0
[PROOF STEP]
using prefixToLevel_auxPrefixToLevel_auxHigherLevel[of "level" "level'" "M" "0"]
[PROOF STATE]
proof (prove)
using this:
level \<le> level'
level \<le> level' \<Longrightarrow> prefixToLevel_aux M level 0 = prefixToLevel_aux (prefixToLevel_aux M level' 0) level 0

goal (1 subgoal):
 1. prefixToLevel_aux M level 0 = prefixToLevel_aux (prefixToLevel_aux M level' 0) level 0
[PROOF STEP]
by simp


[STATEMENT]
lemma drop_shiftr: "drop n (to_bl (w >> n)) = take (size w - n) (to_bl w)"
  for w :: "'a::len word"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. drop n (to_bl (w >> n)) = take (size w - n) (to_bl w)
[PROOF STEP]
apply (rule nth_equalityI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. length (drop n (to_bl (w >> n))) = length (take (size w - n) (to_bl w))
 2. \<And>i. i < length (drop n (to_bl (w >> n))) \<Longrightarrow> drop n (to_bl (w >> n)) ! i = take (size w - n) (to_bl w) ! i
[PROOF STEP]
apply (simp_all add: word_size to_bl_nth bit_simps)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma USUP_atLeast_first:
  "(P(n) \<and> (\<Squnion> i \<in> {Suc n..} \<bullet> P(i))) = (\<Squnion> i \<in> {n..} \<bullet> P(i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (P n \<and> (\<Squnion> i \<in> {Suc n..} \<bullet> P i)) = (\<Squnion> i \<in> {n..} \<bullet> P i)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (P n \<and> (\<Squnion> i \<in> {Suc n..} \<bullet> P i)) = (\<Squnion> i \<in> {n..} \<bullet> P i)
[PROOF STEP]
have "insert n {Suc n..} = {n..}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. insert n {Suc n..} = {n..}
[PROOF STEP]
by (auto)
[PROOF STATE]
proof (state)
this:
insert n {Suc n..} = {n..}

goal (1 subgoal):
 1. (P n \<and> (\<Squnion> i \<in> {Suc n..} \<bullet> P i)) = (\<Squnion> i \<in> {n..} \<bullet> P i)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
insert n {Suc n..} = {n..}

goal (1 subgoal):
 1. (P n \<and> (\<Squnion> i \<in> {Suc n..} \<bullet> P i)) = (\<Squnion> i \<in> {n..} \<bullet> P i)
[PROOF STEP]
by (metis USUP_insert conj_upred_def)
[PROOF STATE]
proof (state)
this:
(P n \<and> (\<Squnion> i \<in> {Suc n..} \<bullet> P i)) = (\<Squnion> i \<in> {n..} \<bullet> P i)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma fact_code [code]:
  "fact n = (of_nat (fold_atLeastAtMost_nat ((*)) 2 n 1) :: 'a::semiring_char_0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fact n = of_nat (fold_atLeastAtMost_nat (*) 2 n 1)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. fact n = of_nat (fold_atLeastAtMost_nat (*) 2 n 1)
[PROOF STEP]
have "fact n = (of_nat (\<Prod>{1..n}) :: 'a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fact n = of_nat (\<Prod>{1..n})
[PROOF STEP]
by (simp add: fact_prod)
[PROOF STATE]
proof (state)
this:
fact n = of_nat (\<Prod>{1..n})

goal (1 subgoal):
 1. fact n = of_nat (fold_atLeastAtMost_nat (*) 2 n 1)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
fact n = of_nat (\<Prod>{1..n})

goal (1 subgoal):
 1. fact n = of_nat (fold_atLeastAtMost_nat (*) 2 n 1)
[PROOF STEP]
have "\<Prod>{1..n} = \<Prod>{2..n}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Prod>{1..n} = \<Prod>{2..n}
[PROOF STEP]
by (intro prod.mono_neutral_right) auto
[PROOF STATE]
proof (state)
this:
\<Prod>{1..n} = \<Prod>{2..n}

goal (1 subgoal):
 1. fact n = of_nat (fold_atLeastAtMost_nat (*) 2 n 1)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<Prod>{1..n} = \<Prod>{2..n}

goal (1 subgoal):
 1. fact n = of_nat (fold_atLeastAtMost_nat (*) 2 n 1)
[PROOF STEP]
have "\<dots> = fold_atLeastAtMost_nat ((*)) 2 n 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Prod>{2..n} = fold_atLeastAtMost_nat (*) 2 n 1
[PROOF STEP]
by (simp add: prod_atLeastAtMost_code)
[PROOF STATE]
proof (state)
this:
\<Prod>{2..n} = fold_atLeastAtMost_nat (*) 2 n 1

goal (1 subgoal):
 1. fact n = of_nat (fold_atLeastAtMost_nat (*) 2 n 1)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
fact n = of_nat (fold_atLeastAtMost_nat (*) 2 n 1)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
fact n = of_nat (fold_atLeastAtMost_nat (*) 2 n 1)

goal (1 subgoal):
 1. fact n = of_nat (fold_atLeastAtMost_nat (*) 2 n 1)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
fact n = of_nat (fold_atLeastAtMost_nat (*) 2 n 1)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma rawpsubstT_suc:
assumes "r \<in> trm" and "snd ` (set txs) \<subseteq> var" and "fst ` (set txs) \<subseteq> trm"
shows "rawpsubstT (suc r) txs = suc (rawpsubstT r txs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rawpsubstT (suc r) txs = suc (rawpsubstT r txs)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
r \<in> trm
snd ` set txs \<subseteq> var
fst ` set txs \<subseteq> trm

goal (1 subgoal):
 1. rawpsubstT (suc r) txs = suc (rawpsubstT r txs)
[PROOF STEP]
apply(induct txs arbitrary: r)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>r. \<lbrakk>r \<in> trm; snd ` set [] \<subseteq> var; fst ` set [] \<subseteq> trm\<rbrakk> \<Longrightarrow> rawpsubstT (suc r) [] = suc (rawpsubstT r [])
 2. \<And>a txs r. \<lbrakk>\<And>r. \<lbrakk>r \<in> trm; snd ` set txs \<subseteq> var; fst ` set txs \<subseteq> trm\<rbrakk> \<Longrightarrow> rawpsubstT (suc r) txs = suc (rawpsubstT r txs); r \<in> trm; snd ` set (a # txs) \<subseteq> var; fst ` set (a # txs) \<subseteq> trm\<rbrakk> \<Longrightarrow> rawpsubstT (suc r) (a # txs) = suc (rawpsubstT r (a # txs))
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>r_ \<in> trm; snd ` set [] \<subseteq> var; fst ` set [] \<subseteq> trm\<rbrakk> \<Longrightarrow> rawpsubstT (suc r_) [] = suc (rawpsubstT r_ [])
[PROOF STEP]
by simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a txs r. \<lbrakk>\<And>r. \<lbrakk>r \<in> trm; snd ` set txs \<subseteq> var; fst ` set txs \<subseteq> trm\<rbrakk> \<Longrightarrow> rawpsubstT (suc r) txs = suc (rawpsubstT r txs); r \<in> trm; snd ` set (a # txs) \<subseteq> var; fst ` set (a # txs) \<subseteq> trm\<rbrakk> \<Longrightarrow> rawpsubstT (suc r) (a # txs) = suc (rawpsubstT r (a # txs))
[PROOF STEP]
subgoal for tx txs r
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<And>r. \<lbrakk>r \<in> trm; snd ` set txs \<subseteq> var; fst ` set txs \<subseteq> trm\<rbrakk> \<Longrightarrow> rawpsubstT (suc r) txs = suc (rawpsubstT r txs); r \<in> trm; snd ` set (tx # txs) \<subseteq> var; fst ` set (tx # txs) \<subseteq> trm\<rbrakk> \<Longrightarrow> rawpsubstT (suc r) (tx # txs) = suc (rawpsubstT r (tx # txs))
[PROOF STEP]
by (cases tx) auto
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
.


[STATEMENT]
lemma continuous_at_real_range:
  fixes f :: "'a::real_normed_vector \<Rightarrow> real"
  shows "continuous (at x) f \<longleftrightarrow> (\<forall>e>0. \<exists>d>0. \<forall>x'. norm(x' - x) < d --> \<bar>f x' - f x\<bar> < e)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. isCont f x = (\<forall>e>0. \<exists>d>0. \<forall>x'. norm (x' - x) < d \<longrightarrow> \<bar>f x' - f x\<bar> < e)
[PROOF STEP]
unfolding continuous_at
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<midarrow>x\<rightarrow> f x = (\<forall>e>0. \<exists>d>0. \<forall>x'. norm (x' - x) < d \<longrightarrow> \<bar>f x' - f x\<bar> < e)
[PROOF STEP]
unfolding Lim_at
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>e>0. \<exists>d>0. \<forall>xa. 0 < dist xa x \<and> dist xa x < d \<longrightarrow> dist (f xa) (f x) < e) = (\<forall>e>0. \<exists>d>0. \<forall>x'. norm (x' - x) < d \<longrightarrow> \<bar>f x' - f x\<bar> < e)
[PROOF STEP]
unfolding dist_norm
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>e>0. \<exists>d>0. \<forall>xa. 0 < norm (xa - x) \<and> norm (xa - x) < d \<longrightarrow> norm (f xa - f x) < e) = (\<forall>e>0. \<exists>d>0. \<forall>x'. norm (x' - x) < d \<longrightarrow> \<bar>f x' - f x\<bar> < e)
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>e. \<lbrakk>\<forall>e>0. \<exists>d>0. \<forall>xa. xa \<noteq> x \<and> norm (xa - x) < d \<longrightarrow> \<bar>f xa - f x\<bar> < e; 0 < e\<rbrakk> \<Longrightarrow> \<exists>d>0. \<forall>x'. norm (x' - x) < d \<longrightarrow> \<bar>f x' - f x\<bar> < e
 2. \<And>e. \<lbrakk>\<forall>e>0. \<exists>d>0. \<forall>x'. norm (x' - x) < d \<longrightarrow> \<bar>f x' - f x\<bar> < e; 0 < e\<rbrakk> \<Longrightarrow> \<exists>d>0. \<forall>xa. xa \<noteq> x \<and> norm (xa - x) < d \<longrightarrow> \<bar>f xa - f x\<bar> < e
[PROOF STEP]
apply (erule_tac x=e in allE, auto)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>e d. \<lbrakk>0 < e; 0 < d; \<forall>xa. xa \<noteq> x \<and> norm (xa - x) < d \<longrightarrow> \<bar>f xa - f x\<bar> < e\<rbrakk> \<Longrightarrow> \<exists>d>0. \<forall>x'. norm (x' - x) < d \<longrightarrow> \<bar>f x' - f x\<bar> < e
 2. \<And>e. \<lbrakk>\<forall>e>0. \<exists>d>0. \<forall>x'. norm (x' - x) < d \<longrightarrow> \<bar>f x' - f x\<bar> < e; 0 < e\<rbrakk> \<Longrightarrow> \<exists>d>0. \<forall>xa. xa \<noteq> x \<and> norm (xa - x) < d \<longrightarrow> \<bar>f xa - f x\<bar> < e
[PROOF STEP]
apply (rule_tac x=d in exI, auto)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>e d x'. \<lbrakk>0 < e; 0 < d; \<forall>xa. xa \<noteq> x \<and> norm (xa - x) < d \<longrightarrow> \<bar>f xa - f x\<bar> < e; norm (x' - x) < d\<rbrakk> \<Longrightarrow> \<bar>f x' - f x\<bar> < e
 2. \<And>e. \<lbrakk>\<forall>e>0. \<exists>d>0. \<forall>x'. norm (x' - x) < d \<longrightarrow> \<bar>f x' - f x\<bar> < e; 0 < e\<rbrakk> \<Longrightarrow> \<exists>d>0. \<forall>xa. xa \<noteq> x \<and> norm (xa - x) < d \<longrightarrow> \<bar>f xa - f x\<bar> < e
[PROOF STEP]
apply (erule_tac x=x' in allE, auto)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>e. \<lbrakk>\<forall>e>0. \<exists>d>0. \<forall>x'. norm (x' - x) < d \<longrightarrow> \<bar>f x' - f x\<bar> < e; 0 < e\<rbrakk> \<Longrightarrow> \<exists>d>0. \<forall>xa. xa \<noteq> x \<and> norm (xa - x) < d \<longrightarrow> \<bar>f xa - f x\<bar> < e
[PROOF STEP]
apply (erule_tac x=e in allE, auto)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma convex_onD_Icc:
  assumes "convex_on {x..y} f" "x \<le> (y :: _ :: {real_vector,preorder})"
  shows "\<And>t. t \<ge> 0 \<Longrightarrow> t \<le> 1 \<Longrightarrow>
    f ((1 - t) *\<^sub>R x + t *\<^sub>R y) \<le> (1 - t) * f x + t * f y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>t. \<lbrakk>0 \<le> t; t \<le> 1\<rbrakk> \<Longrightarrow> f ((1 - t) *\<^sub>R x + t *\<^sub>R y) \<le> (1 - t) * f x + t * f y
[PROOF STEP]
using assms(2)
[PROOF STATE]
proof (prove)
using this:
x \<le> y

goal (1 subgoal):
 1. \<And>t. \<lbrakk>0 \<le> t; t \<le> 1\<rbrakk> \<Longrightarrow> f ((1 - t) *\<^sub>R x + t *\<^sub>R y) \<le> (1 - t) * f x + t * f y
[PROOF STEP]
by (intro convex_onD [OF assms(1)]) simp_all


[STATEMENT]
lemma bounded_subset: "bounded T \<Longrightarrow> S \<subseteq> T \<Longrightarrow> bounded S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>bounded T; S \<subseteq> T\<rbrakk> \<Longrightarrow> bounded S
[PROOF STEP]
by (metis bounded_def subset_eq)


[STATEMENT]
lemma fps_conv_radius_shift [simp]:
  "fps_conv_radius (fps_shift n f) = fps_conv_radius f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fps_conv_radius (fps_shift n f) = fps_conv_radius f
[PROOF STEP]
by (simp add: fps_conv_radius_def fps_shift_def conv_radius_shift)


[STATEMENT]
lemma circline_type_zero_card_eq1_0:
  assumes "circline_type H = 0" and "0\<^sub>h \<in> circline_set H"
  shows "circline_set H = {0\<^sub>h}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. circline_set H = {0\<^sub>h}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
circline_type H = 0
0\<^sub>h \<in> circline_set H

goal (1 subgoal):
 1. circline_set H = {0\<^sub>h}
[PROOF STEP]
unfolding circline_set_def
[PROOF STATE]
proof (prove)
using this:
circline_type H = 0
0\<^sub>h \<in> Collect (on_circline H)

goal (1 subgoal):
 1. Collect (on_circline H) = {0\<^sub>h}
[PROOF STEP]
proof(safe)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>circline_type H = 0; on_circline H 0\<^sub>h; x \<notin> {}; on_circline H x\<rbrakk> \<Longrightarrow> x = 0\<^sub>h
[PROOF STEP]
fix z
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>circline_type H = 0; on_circline H 0\<^sub>h; x \<notin> {}; on_circline H x\<rbrakk> \<Longrightarrow> x = 0\<^sub>h
[PROOF STEP]
assume "on_circline H z" "circline_type H = 0" "on_circline H 0\<^sub>h"
[PROOF STATE]
proof (state)
this:
on_circline H z
circline_type H = 0
on_circline H 0\<^sub>h

goal (1 subgoal):
 1. \<And>x. \<lbrakk>circline_type H = 0; on_circline H 0\<^sub>h; x \<notin> {}; on_circline H x\<rbrakk> \<Longrightarrow> x = 0\<^sub>h
[PROOF STEP]
hence "H = circline_point_0"
[PROOF STATE]
proof (prove)
using this:
on_circline H z
circline_type H = 0
on_circline H 0\<^sub>h

goal (1 subgoal):
 1. H = circline_point_0
[PROOF STEP]
using unique_circline_type_zero_0'
[PROOF STATE]
proof (prove)
using this:
on_circline H z
circline_type H = 0
on_circline H 0\<^sub>h
(circline_type circline_point_0 = 0 \<and> 0\<^sub>h \<in> circline_set circline_point_0) \<and> (\<forall>H. circline_type H = 0 \<and> 0\<^sub>h \<in> circline_set H \<longrightarrow> H = circline_point_0)

goal (1 subgoal):
 1. H = circline_point_0
[PROOF STEP]
unfolding circline_set_def
[PROOF STATE]
proof (prove)
using this:
on_circline H z
circline_type H = 0
on_circline H 0\<^sub>h
(circline_type circline_point_0 = 0 \<and> 0\<^sub>h \<in> Collect (on_circline circline_point_0)) \<and> (\<forall>H. circline_type H = 0 \<and> 0\<^sub>h \<in> Collect (on_circline H) \<longrightarrow> H = circline_point_0)

goal (1 subgoal):
 1. H = circline_point_0
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
H = circline_point_0

goal (1 subgoal):
 1. \<And>x. \<lbrakk>circline_type H = 0; on_circline H 0\<^sub>h; x \<notin> {}; on_circline H x\<rbrakk> \<Longrightarrow> x = 0\<^sub>h
[PROOF STEP]
thus "z = 0\<^sub>h"
[PROOF STATE]
proof (prove)
using this:
H = circline_point_0

goal (1 subgoal):
 1. z = 0\<^sub>h
[PROOF STEP]
using \<open>on_circline H z\<close>
[PROOF STATE]
proof (prove)
using this:
H = circline_point_0
on_circline H z

goal (1 subgoal):
 1. z = 0\<^sub>h
[PROOF STEP]
by (transfer, transfer) (case_tac z, case_tac H, force simp add: vec_cnj_def)
[PROOF STATE]
proof (state)
this:
z = 0\<^sub>h

goal:
No subgoals!
[PROOF STEP]
qed