[STATEMENT]
lemma fill_holes_arbitrary:
  assumes lCs: "length Cs = length ts"
    and lss: "length ss = length ts"
    and rec: "\<And> i. i < length ts \<Longrightarrow> num_holes (Cs ! i) = length (ss ! i) \<and> f (Cs ! i) (ss ! i) = ts ! i"
  shows "map (\<lambda>i. f (Cs ! i) (partition_holes (concat ss) Cs ! i)) [0 ..< length Cs] = ts"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map (\<lambda>i. f (Cs ! i) (partition_holes (concat ss) Cs ! i)) [0..<length Cs] = ts
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. map (\<lambda>i. f (Cs ! i) (partition_holes (concat ss) Cs ! i)) [0..<length Cs] = ts
[PROOF STEP]
have "sum_list (map num_holes Cs) = length (concat ss)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum_list (map num_holes Cs) = length (concat ss)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
length Cs = length ts
length ss = length ts
?i < length ts \<Longrightarrow> num_holes (Cs ! ?i) = length (ss ! ?i) \<and> f (Cs ! ?i) (ss ! ?i) = ts ! ?i

goal (1 subgoal):
 1. sum_list (map num_holes Cs) = length (concat ss)
[PROOF STEP]
by (auto simp: length_concat map_nth_eq_conv intro: arg_cong[of _ _ "sum_list"])
[PROOF STATE]
proof (state)
this:
sum_list (map num_holes Cs) = length (concat ss)

goal (1 subgoal):
 1. map (\<lambda>i. f (Cs ! i) (partition_holes (concat ss) Cs ! i)) [0..<length Cs] = ts
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
sum_list (map num_holes Cs) = length (concat ss)

goal (1 subgoal):
 1. map (\<lambda>i. f (Cs ! i) (partition_holes (concat ss) Cs ! i)) [0..<length Cs] = ts
[PROOF STEP]
have "partition_holes (concat ss) Cs = ss"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. partition_holes (concat ss) Cs = ss
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
length Cs = length ts
length ss = length ts
?i < length ts \<Longrightarrow> num_holes (Cs ! ?i) = length (ss ! ?i) \<and> f (Cs ! ?i) (ss ! ?i) = ts ! ?i

goal (1 subgoal):
 1. partition_holes (concat ss) Cs = ss
[PROOF STEP]
by (auto intro: partition_by_concat_id)
[PROOF STATE]
proof (state)
this:
partition_holes (concat ss) Cs = ss

goal (1 subgoal):
 1. map (\<lambda>i. f (Cs ! i) (partition_holes (concat ss) Cs ! i)) [0..<length Cs] = ts
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
sum_list (map num_holes Cs) = length (concat ss)
partition_holes (concat ss) Cs = ss
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
sum_list (map num_holes Cs) = length (concat ss)
partition_holes (concat ss) Cs = ss

goal (1 subgoal):
 1. map (\<lambda>i. f (Cs ! i) (partition_holes (concat ss) Cs ! i)) [0..<length Cs] = ts
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
sum_list (map num_holes Cs) = length (concat ss)
partition_holes (concat ss) Cs = ss
length Cs = length ts
length ss = length ts
?i < length ts \<Longrightarrow> num_holes (Cs ! ?i) = length (ss ! ?i) \<and> f (Cs ! ?i) (ss ! ?i) = ts ! ?i

goal (1 subgoal):
 1. map (\<lambda>i. f (Cs ! i) (partition_holes (concat ss) Cs ! i)) [0..<length Cs] = ts
[PROOF STEP]
by (auto intro: nth_equalityI)
[PROOF STATE]
proof (state)
this:
map (\<lambda>i. f (Cs ! i) (partition_holes (concat ss) Cs ! i)) [0..<length Cs] = ts

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma mem_interior_convex_shrink:
  fixes S :: "'a::euclidean_space set"
  assumes "convex S"
    and "c \<in> interior S"
    and "x \<in> S"
    and "0 < e"
    and "e \<le> 1"
  shows "x - e *\<^sub>R (x - c) \<in> interior S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x - e *\<^sub>R (x - c) \<in> interior S
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x - e *\<^sub>R (x - c) \<in> interior S
[PROOF STEP]
obtain d where "d > 0" and d: "ball c d \<subseteq> S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>d. \<lbrakk>0 < d; ball c d \<subseteq> S\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms(2)
[PROOF STATE]
proof (prove)
using this:
c \<in> interior S

goal (1 subgoal):
 1. (\<And>d. \<lbrakk>0 < d; ball c d \<subseteq> S\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding mem_interior
[PROOF STATE]
proof (prove)
using this:
\<exists>e>0. ball c e \<subseteq> S

goal (1 subgoal):
 1. (\<And>d. \<lbrakk>0 < d; ball c d \<subseteq> S\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 < d
ball c d \<subseteq> S

goal (1 subgoal):
 1. x - e *\<^sub>R (x - c) \<in> interior S
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x - e *\<^sub>R (x - c) \<in> interior S
[PROOF STEP]
unfolding mem_interior
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>ea>0. ball (x - e *\<^sub>R (x - c)) ea \<subseteq> S
[PROOF STEP]
proof (intro exI subsetI conjI)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. 0 < ?e
 2. \<And>xa. xa \<in> ball (x - e *\<^sub>R (x - c)) ?e \<Longrightarrow> xa \<in> S
[PROOF STEP]
fix y
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. 0 < ?e
 2. \<And>xa. xa \<in> ball (x - e *\<^sub>R (x - c)) ?e \<Longrightarrow> xa \<in> S
[PROOF STEP]
assume "y \<in> ball (x - e *\<^sub>R (x - c)) (e*d)"
[PROOF STATE]
proof (state)
this:
y \<in> ball (x - e *\<^sub>R (x - c)) (e * d)

goal (2 subgoals):
 1. 0 < ?e
 2. \<And>xa. xa \<in> ball (x - e *\<^sub>R (x - c)) ?e \<Longrightarrow> xa \<in> S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
y \<in> ball (x - e *\<^sub>R (x - c)) (e * d)
[PROOF STEP]
have as: "dist (x - e *\<^sub>R (x - c)) y < e * d"
[PROOF STATE]
proof (prove)
using this:
y \<in> ball (x - e *\<^sub>R (x - c)) (e * d)

goal (1 subgoal):
 1. dist (x - e *\<^sub>R (x - c)) y < e * d
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
dist (x - e *\<^sub>R (x - c)) y < e * d

goal (2 subgoals):
 1. 0 < ?e
 2. \<And>xa. xa \<in> ball (x - e *\<^sub>R (x - c)) ?e \<Longrightarrow> xa \<in> S
[PROOF STEP]
have *: "y = (1 - (1 - e)) *\<^sub>R ((1 / e) *\<^sub>R y - ((1 - e) / e) *\<^sub>R x) + (1 - e) *\<^sub>R x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y = (1 - (1 - e)) *\<^sub>R ((1 / e) *\<^sub>R y - ((1 - e) / e) *\<^sub>R x) + (1 - e) *\<^sub>R x
[PROOF STEP]
using \<open>e > 0\<close>
[PROOF STATE]
proof (prove)
using this:
0 < e

goal (1 subgoal):
 1. y = (1 - (1 - e)) *\<^sub>R ((1 / e) *\<^sub>R y - ((1 - e) / e) *\<^sub>R x) + (1 - e) *\<^sub>R x
[PROOF STEP]
by (auto simp add: scaleR_left_diff_distrib scaleR_right_diff_distrib)
[PROOF STATE]
proof (state)
this:
y = (1 - (1 - e)) *\<^sub>R ((1 / e) *\<^sub>R y - ((1 - e) / e) *\<^sub>R x) + (1 - e) *\<^sub>R x

goal (2 subgoals):
 1. 0 < ?e
 2. \<And>xa. xa \<in> ball (x - e *\<^sub>R (x - c)) ?e \<Longrightarrow> xa \<in> S
[PROOF STEP]
have "c - ((1 / e) *\<^sub>R y - ((1 - e) / e) *\<^sub>R x) = (1 / e) *\<^sub>R (e *\<^sub>R c - y + (1 - e) *\<^sub>R x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c - ((1 / e) *\<^sub>R y - ((1 - e) / e) *\<^sub>R x) = (1 / e) *\<^sub>R (e *\<^sub>R c - y + (1 - e) *\<^sub>R x)
[PROOF STEP]
using \<open>e > 0\<close>
[PROOF STATE]
proof (prove)
using this:
0 < e

goal (1 subgoal):
 1. c - ((1 / e) *\<^sub>R y - ((1 - e) / e) *\<^sub>R x) = (1 / e) *\<^sub>R (e *\<^sub>R c - y + (1 - e) *\<^sub>R x)
[PROOF STEP]
by (auto simp add: euclidean_eq_iff[where 'a='a] field_simps inner_simps)
[PROOF STATE]
proof (state)
this:
c - ((1 / e) *\<^sub>R y - ((1 - e) / e) *\<^sub>R x) = (1 / e) *\<^sub>R (e *\<^sub>R c - y + (1 - e) *\<^sub>R x)

goal (2 subgoals):
 1. 0 < ?e
 2. \<And>xa. xa \<in> ball (x - e *\<^sub>R (x - c)) ?e \<Longrightarrow> xa \<in> S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
c - ((1 / e) *\<^sub>R y - ((1 - e) / e) *\<^sub>R x) = (1 / e) *\<^sub>R (e *\<^sub>R c - y + (1 - e) *\<^sub>R x)
[PROOF STEP]
have "dist c ((1 / e) *\<^sub>R y - ((1 - e) / e) *\<^sub>R x) = \<bar>1/e\<bar> * norm (e *\<^sub>R c - y + (1 - e) *\<^sub>R x)"
[PROOF STATE]
proof (prove)
using this:
c - ((1 / e) *\<^sub>R y - ((1 - e) / e) *\<^sub>R x) = (1 / e) *\<^sub>R (e *\<^sub>R c - y + (1 - e) *\<^sub>R x)

goal (1 subgoal):
 1. dist c ((1 / e) *\<^sub>R y - ((1 - e) / e) *\<^sub>R x) = \<bar>1 / e\<bar> * norm (e *\<^sub>R c - y + (1 - e) *\<^sub>R x)
[PROOF STEP]
by (simp add: dist_norm)
[PROOF STATE]
proof (state)
this:
dist c ((1 / e) *\<^sub>R y - ((1 - e) / e) *\<^sub>R x) = \<bar>1 / e\<bar> * norm (e *\<^sub>R c - y + (1 - e) *\<^sub>R x)

goal (2 subgoals):
 1. 0 < ?e
 2. \<And>xa. xa \<in> ball (x - e *\<^sub>R (x - c)) ?e \<Longrightarrow> xa \<in> S
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
dist c ((1 / e) *\<^sub>R y - ((1 - e) / e) *\<^sub>R x) = \<bar>1 / e\<bar> * norm (e *\<^sub>R c - y + (1 - e) *\<^sub>R x)

goal (2 subgoals):
 1. 0 < ?e
 2. \<And>xa. xa \<in> ball (x - e *\<^sub>R (x - c)) ?e \<Longrightarrow> xa \<in> S
[PROOF STEP]
have "\<dots> = \<bar>1/e\<bar> * norm (x - e *\<^sub>R (x - c) - y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>1 / e\<bar> * norm (e *\<^sub>R c - y + (1 - e) *\<^sub>R x) = \<bar>1 / e\<bar> * norm (x - e *\<^sub>R (x - c) - y)
[PROOF STEP]
by (auto intro!:arg_cong[where f=norm] simp add: algebra_simps)
[PROOF STATE]
proof (state)
this:
\<bar>1 / e\<bar> * norm (e *\<^sub>R c - y + (1 - e) *\<^sub>R x) = \<bar>1 / e\<bar> * norm (x - e *\<^sub>R (x - c) - y)

goal (2 subgoals):
 1. 0 < ?e
 2. \<And>xa. xa \<in> ball (x - e *\<^sub>R (x - c)) ?e \<Longrightarrow> xa \<in> S
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<bar>1 / e\<bar> * norm (e *\<^sub>R c - y + (1 - e) *\<^sub>R x) = \<bar>1 / e\<bar> * norm (x - e *\<^sub>R (x - c) - y)

goal (2 subgoals):
 1. 0 < ?e
 2. \<And>xa. xa \<in> ball (x - e *\<^sub>R (x - c)) ?e \<Longrightarrow> xa \<in> S
[PROOF STEP]
have "\<dots> < d"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>1 / e\<bar> * norm (x - e *\<^sub>R (x - c) - y) < d
[PROOF STEP]
using as[unfolded dist_norm] and \<open>e > 0\<close>
[PROOF STATE]
proof (prove)
using this:
norm (x - e *\<^sub>R (x - c) - y) < e * d
0 < e

goal (1 subgoal):
 1. \<bar>1 / e\<bar> * norm (x - e *\<^sub>R (x - c) - y) < d
[PROOF STEP]
by (auto simp add:pos_divide_less_eq[OF \<open>e > 0\<close>] mult.commute)
[PROOF STATE]
proof (state)
this:
\<bar>1 / e\<bar> * norm (x - e *\<^sub>R (x - c) - y) < d

goal (2 subgoals):
 1. 0 < ?e
 2. \<And>xa. xa \<in> ball (x - e *\<^sub>R (x - c)) ?e \<Longrightarrow> xa \<in> S
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
dist c ((1 / e) *\<^sub>R y - ((1 - e) / e) *\<^sub>R x) < d
[PROOF STEP]
have "(1 - (1 - e)) *\<^sub>R ((1 / e) *\<^sub>R y - ((1 - e) / e) *\<^sub>R x) + (1 - e) *\<^sub>R x \<in> S"
[PROOF STATE]
proof (prove)
using this:
dist c ((1 / e) *\<^sub>R y - ((1 - e) / e) *\<^sub>R x) < d

goal (1 subgoal):
 1. (1 - (1 - e)) *\<^sub>R ((1 / e) *\<^sub>R y - ((1 - e) / e) *\<^sub>R x) + (1 - e) *\<^sub>R x \<in> S
[PROOF STEP]
using assms(3-5) d
[PROOF STATE]
proof (prove)
using this:
dist c ((1 / e) *\<^sub>R y - ((1 - e) / e) *\<^sub>R x) < d
x \<in> S
0 < e
e \<le> 1
ball c d \<subseteq> S

goal (1 subgoal):
 1. (1 - (1 - e)) *\<^sub>R ((1 / e) *\<^sub>R y - ((1 - e) / e) *\<^sub>R x) + (1 - e) *\<^sub>R x \<in> S
[PROOF STEP]
by (intro convexD_alt [OF \<open>convex S\<close>]) (auto intro: convexD_alt [OF \<open>convex S\<close>])
[PROOF STATE]
proof (state)
this:
(1 - (1 - e)) *\<^sub>R ((1 / e) *\<^sub>R y - ((1 - e) / e) *\<^sub>R x) + (1 - e) *\<^sub>R x \<in> S

goal (2 subgoals):
 1. 0 < ?e
 2. \<And>xa. xa \<in> ball (x - e *\<^sub>R (x - c)) ?e \<Longrightarrow> xa \<in> S
[PROOF STEP]
with \<open>e > 0\<close>
[PROOF STATE]
proof (chain)
picking this:
0 < e
(1 - (1 - e)) *\<^sub>R ((1 / e) *\<^sub>R y - ((1 - e) / e) *\<^sub>R x) + (1 - e) *\<^sub>R x \<in> S
[PROOF STEP]
show "y \<in> S"
[PROOF STATE]
proof (prove)
using this:
0 < e
(1 - (1 - e)) *\<^sub>R ((1 / e) *\<^sub>R y - ((1 - e) / e) *\<^sub>R x) + (1 - e) *\<^sub>R x \<in> S

goal (1 subgoal):
 1. y \<in> S
[PROOF STEP]
by (auto simp add: scaleR_left_diff_distrib scaleR_right_diff_distrib)
[PROOF STATE]
proof (state)
this:
y \<in> S

goal (1 subgoal):
 1. 0 < e * d
[PROOF STEP]
qed (use \<open>e>0\<close> \<open>d>0\<close> in auto)
[PROOF STATE]
proof (state)
this:
x - e *\<^sub>R (x - c) \<in> interior S

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma open_existence_ivl0:
  assumes x : "x \<in> X"
  shows "\<exists>a b. a < 0 \<and> 0 < b \<and> {a..b} \<subseteq> existence_ivl0 x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>a b. a < 0 \<and> 0 < b \<and> {a..b} \<subseteq> existence_ivl0 x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>a b. a < 0 \<and> 0 < b \<and> {a..b} \<subseteq> existence_ivl0 x
[PROOF STEP]
have a1:"0 \<in> existence_ivl0 x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<in> existence_ivl0 x
[PROOF STEP]
by (simp add: x)
[PROOF STATE]
proof (state)
this:
0 \<in> existence_ivl0 x

goal (1 subgoal):
 1. \<exists>a b. a < 0 \<and> 0 < b \<and> {a..b} \<subseteq> existence_ivl0 x
[PROOF STEP]
have a2: "open (existence_ivl0 x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. open (existence_ivl0 x)
[PROOF STEP]
by (simp add: x)
[PROOF STATE]
proof (state)
this:
open (existence_ivl0 x)

goal (1 subgoal):
 1. \<exists>a b. a < 0 \<and> 0 < b \<and> {a..b} \<subseteq> existence_ivl0 x
[PROOF STEP]
from a1 a2
[PROOF STATE]
proof (chain)
picking this:
0 \<in> existence_ivl0 x
open (existence_ivl0 x)
[PROOF STEP]
obtain d where "d > 0" "ball 0 d \<subseteq> existence_ivl0 x"
[PROOF STATE]
proof (prove)
using this:
0 \<in> existence_ivl0 x
open (existence_ivl0 x)

goal (1 subgoal):
 1. (\<And>d. \<lbrakk>0 < d; ball 0 d \<subseteq> existence_ivl0 x\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using openE
[PROOF STATE]
proof (prove)
using this:
0 \<in> existence_ivl0 x
open (existence_ivl0 x)
\<lbrakk>open ?S; ?x \<in> ?S; \<And>e. \<lbrakk>0 < e; ball ?x e \<subseteq> ?S\<rbrakk> \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. (\<And>d. \<lbrakk>0 < d; ball 0 d \<subseteq> existence_ivl0 x\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
0 < d
ball 0 d \<subseteq> existence_ivl0 x

goal (1 subgoal):
 1. \<exists>a b. a < 0 \<and> 0 < b \<and> {a..b} \<subseteq> existence_ivl0 x
[PROOF STEP]
have "{-d/2..d/2} \<subseteq> ball 0 d"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {- d / 2..d / 2} \<subseteq> ball 0 d
[PROOF STEP]
using \<open>0 < d\<close> dist_norm mem_ball
[PROOF STATE]
proof (prove)
using this:
0 < d
dist ?x ?y = norm (?x - ?y)
(?y \<in> ball ?x ?e) = (dist ?x ?y < ?e)

goal (1 subgoal):
 1. {- d / 2..d / 2} \<subseteq> ball 0 d
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{- d / 2..d / 2} \<subseteq> ball 0 d

goal (1 subgoal):
 1. \<exists>a b. a < 0 \<and> 0 < b \<and> {a..b} \<subseteq> existence_ivl0 x
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
{- d / 2..d / 2} \<subseteq> ball 0 d

goal (1 subgoal):
 1. \<exists>a b. a < 0 \<and> 0 < b \<and> {a..b} \<subseteq> existence_ivl0 x
[PROOF STEP]
by (smt \<open>0 < d\<close> \<open>ball 0 d \<subseteq> existence_ivl0 x\<close> divide_minus_left half_gt_zero order_trans)
[PROOF STATE]
proof (state)
this:
\<exists>a b. a < 0 \<and> 0 < b \<and> {a..b} \<subseteq> existence_ivl0 x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma vangle_scaleR:
  "vangle (k *\<^sub>R v) w = vangle v w" "vangle w (k *\<^sub>R v) = vangle w v" if "k > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vangle (k *\<^sub>R v) w = vangle v w &&& vangle w (k *\<^sub>R v) = vangle w v
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
0 < k

goal (1 subgoal):
 1. vangle (k *\<^sub>R v) w = vangle v w &&& vangle w (k *\<^sub>R v) = vangle w v
[PROOF STEP]
by (auto simp: vangle_def)


[STATEMENT]
lemma H_compose_smooth_on: "k-smooth_on S (\<lambda>x. H (g x))" if "k-smooth_on S g" "open S"
  for g :: "_ \<Rightarrow> _::euclidean_space"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. k-smooth_on S (\<lambda>x. H (g x))
[PROOF STEP]
using smooth_on_compose[OF H_smooth_on that]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>open UNIV; g ` S \<subseteq> UNIV\<rbrakk> \<Longrightarrow> k-smooth_on S (H \<circ> g)

goal (1 subgoal):
 1. k-smooth_on S (\<lambda>x. H (g x))
[PROOF STEP]
by (auto simp: o_def)


[STATEMENT]
lemma uniqueness_poly_equality:
  fixes f g :: "'a :: {factorial_ring_gcd,semiring_gcd_mult_normalize} poly"
  assumes cop: "coprime f g"
  and deg: "B = 0 \<or> degree B < degree f" "B' = 0 \<or> degree B' < degree f"
  and f: "f \<noteq> 0" and eq: "A * f + B * g = A' * f + B' * g"
  shows "A = A'" "B = B'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A = A' &&& B = B'
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. A = A'
 2. B = B'
[PROOF STEP]
from eq
[PROOF STATE]
proof (chain)
picking this:
A * f + B * g = A' * f + B' * g
[PROOF STEP]
have *: "(A - A') * f = (B' - B) * g"
[PROOF STATE]
proof (prove)
using this:
A * f + B * g = A' * f + B' * g

goal (1 subgoal):
 1. (A - A') * f = (B' - B) * g
[PROOF STEP]
by (simp add: field_simps)
[PROOF STATE]
proof (state)
this:
(A - A') * f = (B' - B) * g

goal (2 subgoals):
 1. A = A'
 2. B = B'
[PROOF STEP]
hence "f dvd (B' - B) * g"
[PROOF STATE]
proof (prove)
using this:
(A - A') * f = (B' - B) * g

goal (1 subgoal):
 1. f dvd (B' - B) * g
[PROOF STEP]
unfolding dvd_def
[PROOF STATE]
proof (prove)
using this:
(A - A') * f = (B' - B) * g

goal (1 subgoal):
 1. \<exists>k. (B' - B) * g = f * k
[PROOF STEP]
by (intro exI[of _ "A - A'"], auto simp: field_simps)
[PROOF STATE]
proof (state)
this:
f dvd (B' - B) * g

goal (2 subgoals):
 1. A = A'
 2. B = B'
[PROOF STEP]
with cop[simplified]
[PROOF STATE]
proof (chain)
picking this:
algebraic_semidom_class.coprime f g
f dvd (B' - B) * g
[PROOF STEP]
have dvd: "f dvd (B' - B)"
[PROOF STATE]
proof (prove)
using this:
algebraic_semidom_class.coprime f g
f dvd (B' - B) * g

goal (1 subgoal):
 1. f dvd B' - B
[PROOF STEP]
by (simp add: coprime_dvd_mult_right_iff ac_simps)
[PROOF STATE]
proof (state)
this:
f dvd B' - B

goal (2 subgoals):
 1. A = A'
 2. B = B'
[PROOF STEP]
from divides_degree[OF this]
[PROOF STATE]
proof (chain)
picking this:
degree f \<le> degree (B' - B) \<or> B' - B = 0
[PROOF STEP]
have "degree f \<le> degree (B' - B) \<or> B = B'"
[PROOF STATE]
proof (prove)
using this:
degree f \<le> degree (B' - B) \<or> B' - B = 0

goal (1 subgoal):
 1. degree f \<le> degree (B' - B) \<or> B = B'
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
degree f \<le> degree (B' - B) \<or> B = B'

goal (2 subgoals):
 1. A = A'
 2. B = B'
[PROOF STEP]
with degree_diff_le_max[of B' B] deg
[PROOF STATE]
proof (chain)
picking this:
degree (B' - B) \<le> max (degree B') (degree B)
B = 0 \<or> degree B < degree f
B' = 0 \<or> degree B' < degree f
degree f \<le> degree (B' - B) \<or> B = B'
[PROOF STEP]
show "B = B'"
[PROOF STATE]
proof (prove)
using this:
degree (B' - B) \<le> max (degree B') (degree B)
B = 0 \<or> degree B < degree f
B' = 0 \<or> degree B' < degree f
degree f \<le> degree (B' - B) \<or> B = B'

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

goal (1 subgoal):
 1. A = A'
[PROOF STEP]
with * f
[PROOF STATE]
proof (chain)
picking this:
(A - A') * f = (B' - B) * g
f \<noteq> 0
B = B'
[PROOF STEP]
show "A = A'"
[PROOF STATE]
proof (prove)
using this:
(A - A') * f = (B' - B) * g
f \<noteq> 0
B = B'

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma quantale_hom_closed_map:
  fixes f :: "'a::quantale_with_dual \<Rightarrow> 'b::quantale_with_dual"
  shows "(f \<in> quantale_homset) \<Longrightarrow> (radj f \<in> quantale_closed_maps)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<in> quantale_homset \<Longrightarrow> radj f \<in> quantale_closed_maps
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. f \<in> quantale_homset \<Longrightarrow> radj f \<in> quantale_closed_maps
[PROOF STEP]
assume h: "f \<in> quantale_homset"
[PROOF STATE]
proof (state)
this:
f \<in> quantale_homset

goal (1 subgoal):
 1. f \<in> quantale_homset \<Longrightarrow> radj f \<in> quantale_closed_maps
[PROOF STEP]
have "\<forall>x y. f (radj f x) \<cdot> f (radj f y) \<le> x \<cdot> y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x y. f (radj f x) \<cdot> f (radj f y) \<le> x \<cdot> y
[PROOF STEP]
by (metis adj_def h order_refl psrpq.mult_isol_var quantale_hom_radj)
[PROOF STATE]
proof (state)
this:
\<forall>x y. f (radj f x) \<cdot> f (radj f y) \<le> x \<cdot> y

goal (1 subgoal):
 1. f \<in> quantale_homset \<Longrightarrow> radj f \<in> quantale_closed_maps
[PROOF STEP]
hence "\<forall>x y. f (radj f x \<cdot> radj f y) \<le> x \<cdot> y"
[PROOF STATE]
proof (prove)
using this:
\<forall>x y. f (radj f x) \<cdot> f (radj f y) \<le> x \<cdot> y

goal (1 subgoal):
 1. \<forall>x y. f (radj f x \<cdot> radj f y) \<le> x \<cdot> y
[PROOF STEP]
by (metis h quantale_homset_iff)
[PROOF STATE]
proof (state)
this:
\<forall>x y. f (radj f x \<cdot> radj f y) \<le> x \<cdot> y

goal (1 subgoal):
 1. f \<in> quantale_homset \<Longrightarrow> radj f \<in> quantale_closed_maps
[PROOF STEP]
hence "\<forall>x y. radj f x \<cdot> radj f y \<le> radj f (x \<cdot> y)"
[PROOF STATE]
proof (prove)
using this:
\<forall>x y. f (radj f x \<cdot> radj f y) \<le> x \<cdot> y

goal (1 subgoal):
 1. \<forall>x y. radj f x \<cdot> radj f y \<le> radj f (x \<cdot> y)
[PROOF STEP]
using adj_def h quantale_hom_radj
[PROOF STATE]
proof (prove)
using this:
\<forall>x y. f (radj f x \<cdot> radj f y) \<le> x \<cdot> y
?f \<stileturn> ?g = (\<forall>x y. (?f x \<le> y) = (x \<le> ?g y))
f \<in> quantale_homset
?f \<in> quantale_homset \<Longrightarrow> ?f \<stileturn> radj ?f

goal (1 subgoal):
 1. \<forall>x y. radj f x \<cdot> radj f y \<le> radj f (x \<cdot> y)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<forall>x y. radj f x \<cdot> radj f y \<le> radj f (x \<cdot> y)

goal (1 subgoal):
 1. f \<in> quantale_homset \<Longrightarrow> radj f \<in> quantale_closed_maps
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<forall>x y. radj f x \<cdot> radj f y \<le> radj f (x \<cdot> y)

goal (1 subgoal):
 1. radj f \<in> quantale_closed_maps
[PROOF STEP]
by (simp add: quantale_closed_maps_iff)
[PROOF STATE]
proof (state)
this:
radj f \<in> quantale_closed_maps

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma in_mset_fold_plus_iff[iff]: "x \<in># fold_mset (+) M NN \<longleftrightarrow> x \<in># M \<or> (\<exists>N. N \<in># NN \<and> x \<in># N)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<in># fold_mset (+) M NN) = (x \<in># M \<or> (\<exists>N. N \<in># NN \<and> x \<in># N))
[PROOF STEP]
by (induct NN) auto


[STATEMENT]
lemma ereal_sums_minus:
  fixes f::"nat \<Rightarrow> ereal"
  assumes "f sums a"
    and "\<And>n. \<bar>f n\<bar> \<noteq> \<infinity>"
  shows "(\<lambda>n. - f n) sums -a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. - f n) sums - a
[PROOF STEP]
proof (cases "\<bar>a\<bar> = \<infinity>")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<bar>a\<bar> = \<infinity> \<Longrightarrow> (\<lambda>n. - f n) sums - a
 2. \<bar>a\<bar> \<noteq> \<infinity> \<Longrightarrow> (\<lambda>n. - f n) sums - a
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<bar>a\<bar> \<noteq> \<infinity>

goal (2 subgoals):
 1. \<bar>a\<bar> = \<infinity> \<Longrightarrow> (\<lambda>n. - f n) sums - a
 2. \<bar>a\<bar> \<noteq> \<infinity> \<Longrightarrow> (\<lambda>n. - f n) sums - a
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<bar>a\<bar> \<noteq> \<infinity>

goal (1 subgoal):
 1. (\<lambda>n. - f n) sums - a
[PROOF STEP]
using assms ereal_sums_not_infty_minus
[PROOF STATE]
proof (prove)
using this:
\<bar>a\<bar> \<noteq> \<infinity>
f sums a
\<bar>f ?n\<bar> \<noteq> \<infinity>
\<lbrakk>?f sums ?a; \<bar>?a\<bar> \<noteq> \<infinity>\<rbrakk> \<Longrightarrow> (\<lambda>n. - ?f n) sums - ?a

goal (1 subgoal):
 1. (\<lambda>n. - f n) sums - a
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<lambda>n. - f n) sums - a

goal (1 subgoal):
 1. \<bar>a\<bar> = \<infinity> \<Longrightarrow> (\<lambda>n. - f n) sums - a
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<bar>a\<bar> = \<infinity> \<Longrightarrow> (\<lambda>n. - f n) sums - a
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
\<bar>a\<bar> = \<infinity>

goal (1 subgoal):
 1. \<bar>a\<bar> = \<infinity> \<Longrightarrow> (\<lambda>n. - f n) sums - a
[PROOF STEP]
hence "a = \<infinity> \<or> a = - \<infinity>"
[PROOF STATE]
proof (prove)
using this:
\<bar>a\<bar> = \<infinity>

goal (1 subgoal):
 1. a = \<infinity> \<or> a = - \<infinity>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
a = \<infinity> \<or> a = - \<infinity>

goal (1 subgoal):
 1. \<bar>a\<bar> = \<infinity> \<Longrightarrow> (\<lambda>n. - f n) sums - a
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
a = \<infinity> \<or> a = - \<infinity>

goal (1 subgoal):
 1. (\<lambda>n. - f n) sums - a
[PROOF STEP]
using assms ereal_sums_Pinfty ereal_sums_Minfty
[PROOF STATE]
proof (prove)
using this:
a = \<infinity> \<or> a = - \<infinity>
f sums a
\<bar>f ?n\<bar> \<noteq> \<infinity>
\<lbrakk>?f sums \<infinity>; \<And>n. \<bar>?f n\<bar> \<noteq> \<infinity>\<rbrakk> \<Longrightarrow> (\<lambda>n. - ?f n) sums - \<infinity>
\<lbrakk>?f sums - \<infinity>; \<And>n. \<bar>?f n\<bar> \<noteq> \<infinity>\<rbrakk> \<Longrightarrow> (\<lambda>n. - ?f n) sums \<infinity>

goal (1 subgoal):
 1. (\<lambda>n. - f n) sums - a
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<lambda>n. - f n) sums - a

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma compact_imp_seq_compact:
  fixes U :: "'a :: first_countable_topology set"
  assumes "compact U"
  shows "seq_compact U"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. seq_compact U
[PROOF STEP]
unfolding seq_compact_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>f. (\<forall>n. f n \<in> U) \<longrightarrow> (\<exists>l\<in>U. \<exists>r. strict_mono r \<and> (f \<circ> r) \<longlonglongrightarrow> l)
[PROOF STEP]
proof safe
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>f. \<forall>n. f n \<in> U \<Longrightarrow> \<exists>l\<in>U. \<exists>r. strict_mono r \<and> (f \<circ> r) \<longlonglongrightarrow> l
[PROOF STEP]
fix X :: "nat \<Rightarrow> 'a"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>f. \<forall>n. f n \<in> U \<Longrightarrow> \<exists>l\<in>U. \<exists>r. strict_mono r \<and> (f \<circ> r) \<longlonglongrightarrow> l
[PROOF STEP]
assume "\<forall>n. X n \<in> U"
[PROOF STATE]
proof (state)
this:
\<forall>n. X n \<in> U

goal (1 subgoal):
 1. \<And>f. \<forall>n. f n \<in> U \<Longrightarrow> \<exists>l\<in>U. \<exists>r. strict_mono r \<and> (f \<circ> r) \<longlonglongrightarrow> l
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>n. X n \<in> U
[PROOF STEP]
have "eventually (\<lambda>x. x \<in> U) (filtermap X sequentially)"
[PROOF STATE]
proof (prove)
using this:
\<forall>n. X n \<in> U

goal (1 subgoal):
 1. \<forall>\<^sub>F x in filtermap X sequentially. x \<in> U
[PROOF STEP]
by (auto simp: eventually_filtermap)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in filtermap X sequentially. x \<in> U

goal (1 subgoal):
 1. \<And>f. \<forall>n. f n \<in> U \<Longrightarrow> \<exists>l\<in>U. \<exists>r. strict_mono r \<and> (f \<circ> r) \<longlonglongrightarrow> l
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in filtermap X sequentially. x \<in> U

goal (1 subgoal):
 1. \<And>f. \<forall>n. f n \<in> U \<Longrightarrow> \<exists>l\<in>U. \<exists>r. strict_mono r \<and> (f \<circ> r) \<longlonglongrightarrow> l
[PROOF STEP]
have "filtermap X sequentially \<noteq> bot"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. filtermap X sequentially \<noteq> bot
[PROOF STEP]
by (simp add: trivial_limit_def eventually_filtermap)
[PROOF STATE]
proof (state)
this:
filtermap X sequentially \<noteq> bot

goal (1 subgoal):
 1. \<And>f. \<forall>n. f n \<in> U \<Longrightarrow> \<exists>l\<in>U. \<exists>r. strict_mono r \<and> (f \<circ> r) \<longlonglongrightarrow> l
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F x in filtermap X sequentially. x \<in> U
filtermap X sequentially \<noteq> bot
[PROOF STEP]
obtain x where "x \<in> U" and x: "inf (nhds x) (filtermap X sequentially) \<noteq> bot" (is "?F \<noteq> _")
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in filtermap X sequentially. x \<in> U
filtermap X sequentially \<noteq> bot

goal (1 subgoal):
 1. (\<And>x. \<lbrakk>x \<in> U; inf (nhds x) (filtermap X sequentially) \<noteq> bot\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using \<open>compact U\<close>
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in filtermap X sequentially. x \<in> U
filtermap X sequentially \<noteq> bot
compact U

goal (1 subgoal):
 1. (\<And>x. \<lbrakk>x \<in> U; inf (nhds x) (filtermap X sequentially) \<noteq> bot\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp: compact_filter)
[PROOF STATE]
proof (state)
this:
x \<in> U
inf (nhds x) (filtermap X sequentially) \<noteq> bot

goal (1 subgoal):
 1. \<And>f. \<forall>n. f n \<in> U \<Longrightarrow> \<exists>l\<in>U. \<exists>r. strict_mono r \<and> (f \<circ> r) \<longlonglongrightarrow> l
[PROOF STEP]
from countable_basis_at_decseq[of x]
[PROOF STATE]
proof (chain)
picking this:
(\<And>A. \<lbrakk>\<And>i. open (A i); \<And>i. x \<in> A i; \<And>S. \<lbrakk>open S; x \<in> S\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F i in sequentially. A i \<subseteq> S\<rbrakk> \<Longrightarrow> ?thesis) \<Longrightarrow> ?thesis
[PROOF STEP]
obtain A where A:
      "\<And>i. open (A i)"
      "\<And>i. x \<in> A i"
      "\<And>S. open S \<Longrightarrow> x \<in> S \<Longrightarrow> eventually (\<lambda>i. A i \<subseteq> S) sequentially"
[PROOF STATE]
proof (prove)
using this:
(\<And>A. \<lbrakk>\<And>i. open (A i); \<And>i. x \<in> A i; \<And>S. \<lbrakk>open S; x \<in> S\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F i in sequentially. A i \<subseteq> S\<rbrakk> \<Longrightarrow> ?thesis) \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. (\<And>A. \<lbrakk>\<And>i. open (A i); \<And>i. x \<in> A i; \<And>S. \<lbrakk>open S; x \<in> S\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F i in sequentially. A i \<subseteq> S\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
open (A ?i)
x \<in> A ?i
\<lbrakk>open ?S; x \<in> ?S\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F i in sequentially. A i \<subseteq> ?S

goal (1 subgoal):
 1. \<And>f. \<forall>n. f n \<in> U \<Longrightarrow> \<exists>l\<in>U. \<exists>r. strict_mono r \<and> (f \<circ> r) \<longlonglongrightarrow> l
[PROOF STEP]
define s where "s n i = (SOME j. i < j \<and> X j \<in> A (Suc n))" for n i
[PROOF STATE]
proof (state)
this:
s ?n ?i = (SOME j. ?i < j \<and> X j \<in> A (Suc ?n))

goal (1 subgoal):
 1. \<And>f. \<forall>n. f n \<in> U \<Longrightarrow> \<exists>l\<in>U. \<exists>r. strict_mono r \<and> (f \<circ> r) \<longlonglongrightarrow> l
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
s ?n ?i = (SOME j. ?i < j \<and> X j \<in> A (Suc ?n))

goal (1 subgoal):
 1. \<And>f. \<forall>n. f n \<in> U \<Longrightarrow> \<exists>l\<in>U. \<exists>r. strict_mono r \<and> (f \<circ> r) \<longlonglongrightarrow> l
[PROOF STEP]
fix n i
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>f. \<forall>n. f n \<in> U \<Longrightarrow> \<exists>l\<in>U. \<exists>r. strict_mono r \<and> (f \<circ> r) \<longlonglongrightarrow> l
[PROOF STEP]
have "\<exists>a. i < a \<and> X a \<in> A (Suc n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>a>i. X a \<in> A (Suc n)
[PROOF STEP]
proof (rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> (\<exists>a>i. X a \<in> A (Suc n)) \<Longrightarrow> False
[PROOF STEP]
assume "\<not> (\<exists>a>i. X a \<in> A (Suc n))"
[PROOF STATE]
proof (state)
this:
\<not> (\<exists>a>i. X a \<in> A (Suc n))

goal (1 subgoal):
 1. \<not> (\<exists>a>i. X a \<in> A (Suc n)) \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> (\<exists>a>i. X a \<in> A (Suc n))
[PROOF STEP]
have "\<And>a. Suc i \<le> a \<Longrightarrow> X a \<notin> A (Suc n)"
[PROOF STATE]
proof (prove)
using this:
\<not> (\<exists>a>i. X a \<in> A (Suc n))

goal (1 subgoal):
 1. \<And>a. Suc i \<le> a \<Longrightarrow> X a \<notin> A (Suc n)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Suc i \<le> ?a \<Longrightarrow> X ?a \<notin> A (Suc n)

goal (1 subgoal):
 1. \<not> (\<exists>a>i. X a \<in> A (Suc n)) \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
Suc i \<le> ?a \<Longrightarrow> X ?a \<notin> A (Suc n)
[PROOF STEP]
have "eventually (\<lambda>x. x \<notin> A (Suc n)) (filtermap X sequentially)"
[PROOF STATE]
proof (prove)
using this:
Suc i \<le> ?a \<Longrightarrow> X ?a \<notin> A (Suc n)

goal (1 subgoal):
 1. \<forall>\<^sub>F x in filtermap X sequentially. x \<notin> A (Suc n)
[PROOF STEP]
by (auto simp: eventually_filtermap eventually_sequentially)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in filtermap X sequentially. x \<notin> A (Suc n)

goal (1 subgoal):
 1. \<not> (\<exists>a>i. X a \<in> A (Suc n)) \<Longrightarrow> False
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in filtermap X sequentially. x \<notin> A (Suc n)

goal (1 subgoal):
 1. \<not> (\<exists>a>i. X a \<in> A (Suc n)) \<Longrightarrow> False
[PROOF STEP]
have "eventually (\<lambda>x. x \<in> A (Suc n)) (nhds x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F x in nhds x. x \<in> A (Suc n)
[PROOF STEP]
using A(1,2)[of "Suc n"]
[PROOF STATE]
proof (prove)
using this:
open (A (Suc n))
x \<in> A (Suc n)

goal (1 subgoal):
 1. \<forall>\<^sub>F x in nhds x. x \<in> A (Suc n)
[PROOF STEP]
by (auto simp: eventually_nhds)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in nhds x. x \<in> A (Suc n)

goal (1 subgoal):
 1. \<not> (\<exists>a>i. X a \<in> A (Suc n)) \<Longrightarrow> False
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F x in filtermap X sequentially. x \<notin> A (Suc n)
\<forall>\<^sub>F x in nhds x. x \<in> A (Suc n)
[PROOF STEP]
have "eventually (\<lambda>x. False) ?F"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in filtermap X sequentially. x \<notin> A (Suc n)
\<forall>\<^sub>F x in nhds x. x \<in> A (Suc n)

goal (1 subgoal):
 1. \<forall>\<^sub>F x in inf (nhds x) (filtermap X sequentially). False
[PROOF STEP]
by (auto simp: eventually_inf)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in inf (nhds x) (filtermap X sequentially). False

goal (1 subgoal):
 1. \<not> (\<exists>a>i. X a \<in> A (Suc n)) \<Longrightarrow> False
[PROOF STEP]
with x
[PROOF STATE]
proof (chain)
picking this:
inf (nhds x) (filtermap X sequentially) \<noteq> bot
\<forall>\<^sub>F x in inf (nhds x) (filtermap X sequentially). False
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
inf (nhds x) (filtermap X sequentially) \<noteq> bot
\<forall>\<^sub>F x in inf (nhds x) (filtermap X sequentially). False

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<exists>a>i. X a \<in> A (Suc n)

goal (1 subgoal):
 1. \<And>f. \<forall>n. f n \<in> U \<Longrightarrow> \<exists>l\<in>U. \<exists>r. strict_mono r \<and> (f \<circ> r) \<longlonglongrightarrow> l
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>a>i. X a \<in> A (Suc n)
[PROOF STEP]
have "i < s n i" "X (s n i) \<in> A (Suc n)"
[PROOF STATE]
proof (prove)
using this:
\<exists>a>i. X a \<in> A (Suc n)

goal (1 subgoal):
 1. i < s n i &&& X (s n i) \<in> A (Suc n)
[PROOF STEP]
unfolding s_def
[PROOF STATE]
proof (prove)
using this:
\<exists>a>i. X a \<in> A (Suc n)

goal (1 subgoal):
 1. i < (SOME j. i < j \<and> X j \<in> A (Suc n)) &&& X (SOME j. i < j \<and> X j \<in> A (Suc n)) \<in> A (Suc n)
[PROOF STEP]
by (auto intro: someI2_ex)
[PROOF STATE]
proof (state)
this:
i < s n i
X (s n i) \<in> A (Suc n)

goal (1 subgoal):
 1. \<And>f. \<forall>n. f n \<in> U \<Longrightarrow> \<exists>l\<in>U. \<exists>r. strict_mono r \<and> (f \<circ> r) \<longlonglongrightarrow> l
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
?i2 < s ?n2 ?i2
X (s ?n2 ?i2) \<in> A (Suc ?n2)

goal (1 subgoal):
 1. \<And>f. \<forall>n. f n \<in> U \<Longrightarrow> \<exists>l\<in>U. \<exists>r. strict_mono r \<and> (f \<circ> r) \<longlonglongrightarrow> l
[PROOF STEP]
note s = this
[PROOF STATE]
proof (state)
this:
?i2 < s ?n2 ?i2
X (s ?n2 ?i2) \<in> A (Suc ?n2)

goal (1 subgoal):
 1. \<And>f. \<forall>n. f n \<in> U \<Longrightarrow> \<exists>l\<in>U. \<exists>r. strict_mono r \<and> (f \<circ> r) \<longlonglongrightarrow> l
[PROOF STEP]
define r where "r = rec_nat (s 0 0) s"
[PROOF STATE]
proof (state)
this:
r = rec_nat (s 0 0) s

goal (1 subgoal):
 1. \<And>f. \<forall>n. f n \<in> U \<Longrightarrow> \<exists>l\<in>U. \<exists>r. strict_mono r \<and> (f \<circ> r) \<longlonglongrightarrow> l
[PROOF STEP]
have "strict_mono r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. strict_mono r
[PROOF STEP]
by (auto simp: r_def s strict_mono_Suc_iff)
[PROOF STATE]
proof (state)
this:
strict_mono r

goal (1 subgoal):
 1. \<And>f. \<forall>n. f n \<in> U \<Longrightarrow> \<exists>l\<in>U. \<exists>r. strict_mono r \<and> (f \<circ> r) \<longlonglongrightarrow> l
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
strict_mono r

goal (1 subgoal):
 1. \<And>f. \<forall>n. f n \<in> U \<Longrightarrow> \<exists>l\<in>U. \<exists>r. strict_mono r \<and> (f \<circ> r) \<longlonglongrightarrow> l
[PROOF STEP]
have "(\<lambda>n. X (r n)) \<longlonglongrightarrow> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. X (r n)) \<longlonglongrightarrow> x
[PROOF STEP]
proof (rule topological_tendstoI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>S. \<lbrakk>open S; x \<in> S\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F x in sequentially. X (r x) \<in> S
[PROOF STEP]
fix S
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>S. \<lbrakk>open S; x \<in> S\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F x in sequentially. X (r x) \<in> S
[PROOF STEP]
assume "open S" "x \<in> S"
[PROOF STATE]
proof (state)
this:
open S
x \<in> S

goal (1 subgoal):
 1. \<And>S. \<lbrakk>open S; x \<in> S\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F x in sequentially. X (r x) \<in> S
[PROOF STEP]
with A(3)
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>open ?S; x \<in> ?S\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F i in sequentially. A i \<subseteq> ?S
open S
x \<in> S
[PROOF STEP]
have "eventually (\<lambda>i. A i \<subseteq> S) sequentially"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>open ?S; x \<in> ?S\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F i in sequentially. A i \<subseteq> ?S
open S
x \<in> S

goal (1 subgoal):
 1. \<forall>\<^sub>F i in sequentially. A i \<subseteq> S
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F i in sequentially. A i \<subseteq> S

goal (1 subgoal):
 1. \<And>S. \<lbrakk>open S; x \<in> S\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F x in sequentially. X (r x) \<in> S
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F i in sequentially. A i \<subseteq> S

goal (1 subgoal):
 1. \<And>S. \<lbrakk>open S; x \<in> S\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F x in sequentially. X (r x) \<in> S
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F i in sequentially. A i \<subseteq> S

goal (1 subgoal):
 1. \<And>S. \<lbrakk>open S; x \<in> S\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F x in sequentially. X (r x) \<in> S
[PROOF STEP]
fix i
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>S. \<lbrakk>open S; x \<in> S\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F x in sequentially. X (r x) \<in> S
[PROOF STEP]
assume "Suc 0 \<le> i"
[PROOF STATE]
proof (state)
this:
Suc 0 \<le> i

goal (1 subgoal):
 1. \<And>S. \<lbrakk>open S; x \<in> S\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F x in sequentially. X (r x) \<in> S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
Suc 0 \<le> i
[PROOF STEP]
have "X (r i) \<in> A i"
[PROOF STATE]
proof (prove)
using this:
Suc 0 \<le> i

goal (1 subgoal):
 1. X (r i) \<in> A i
[PROOF STEP]
by (cases i) (simp_all add: r_def s)
[PROOF STATE]
proof (state)
this:
X (r i) \<in> A i

goal (1 subgoal):
 1. \<And>S. \<lbrakk>open S; x \<in> S\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F x in sequentially. X (r x) \<in> S
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
Suc 0 \<le> ?i2 \<Longrightarrow> X (r ?i2) \<in> A ?i2

goal (1 subgoal):
 1. \<And>S. \<lbrakk>open S; x \<in> S\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F x in sequentially. X (r x) \<in> S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
Suc 0 \<le> ?i2 \<Longrightarrow> X (r ?i2) \<in> A ?i2
[PROOF STEP]
have "eventually (\<lambda>i. X (r i) \<in> A i) sequentially"
[PROOF STATE]
proof (prove)
using this:
Suc 0 \<le> ?i2 \<Longrightarrow> X (r ?i2) \<in> A ?i2

goal (1 subgoal):
 1. \<forall>\<^sub>F i in sequentially. X (r i) \<in> A i
[PROOF STEP]
by (auto simp: eventually_sequentially)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F i in sequentially. X (r i) \<in> A i

goal (1 subgoal):
 1. \<And>S. \<lbrakk>open S; x \<in> S\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F x in sequentially. X (r x) \<in> S
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F i in sequentially. A i \<subseteq> S
\<forall>\<^sub>F i in sequentially. X (r i) \<in> A i
[PROOF STEP]
show "eventually (\<lambda>i. X (r i) \<in> S) sequentially"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F i in sequentially. A i \<subseteq> S
\<forall>\<^sub>F i in sequentially. X (r i) \<in> A i

goal (1 subgoal):
 1. \<forall>\<^sub>F i in sequentially. X (r i) \<in> S
[PROOF STEP]
by eventually_elim auto
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F i in sequentially. X (r i) \<in> S

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<lambda>n. X (r n)) \<longlonglongrightarrow> x

goal (1 subgoal):
 1. \<And>f. \<forall>n. f n \<in> U \<Longrightarrow> \<exists>l\<in>U. \<exists>r. strict_mono r \<and> (f \<circ> r) \<longlonglongrightarrow> l
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
strict_mono r
(\<lambda>n. X (r n)) \<longlonglongrightarrow> x
[PROOF STEP]
show "\<exists>x \<in> U. \<exists>r. strict_mono r \<and> (X \<circ> r) \<longlonglongrightarrow> x"
[PROOF STATE]
proof (prove)
using this:
strict_mono r
(\<lambda>n. X (r n)) \<longlonglongrightarrow> x

goal (1 subgoal):
 1. \<exists>x\<in>U. \<exists>r. strict_mono r \<and> (X \<circ> r) \<longlonglongrightarrow> x
[PROOF STEP]
using \<open>x \<in> U\<close>
[PROOF STATE]
proof (prove)
using this:
strict_mono r
(\<lambda>n. X (r n)) \<longlonglongrightarrow> x
x \<in> U

goal (1 subgoal):
 1. \<exists>x\<in>U. \<exists>r. strict_mono r \<and> (X \<circ> r) \<longlonglongrightarrow> x
[PROOF STEP]
by (auto simp: convergent_def comp_def)
[PROOF STATE]
proof (state)
this:
\<exists>x\<in>U. \<exists>r. strict_mono r \<and> (X \<circ> r) \<longlonglongrightarrow> x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma minus_times_le_abs: "- (err * B) \<le> \<bar>B\<bar>" if "-1 \<le> err" "err \<le> 1" for err::real
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - (err * B) \<le> \<bar>B\<bar>
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. - (err * B) \<le> \<bar>B\<bar>
[PROOF STEP]
have [simp]: "abs err \<le> 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>err\<bar> \<le> 1
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
- 1 \<le> err
err \<le> 1

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

goal (1 subgoal):
 1. - (err * B) \<le> \<bar>B\<bar>
[PROOF STEP]
have "- (err * B) \<le> abs (- err * B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - (err * B) \<le> \<bar>- err * B\<bar>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
- (err * B) \<le> \<bar>- err * B\<bar>

goal (1 subgoal):
 1. - (err * B) \<le> \<bar>B\<bar>
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
- (err * B) \<le> \<bar>- err * B\<bar>

goal (1 subgoal):
 1. - (err * B) \<le> \<bar>B\<bar>
[PROOF STEP]
have "\<dots> \<le> abs B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>- err * B\<bar> \<le> \<bar>B\<bar>
[PROOF STEP]
by (auto simp: abs_mult intro!: mult_left_le_one_le)
[PROOF STATE]
proof (state)
this:
\<bar>- err * B\<bar> \<le> \<bar>B\<bar>

goal (1 subgoal):
 1. - (err * B) \<le> \<bar>B\<bar>
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
- (err * B) \<le> \<bar>B\<bar>
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
- (err * B) \<le> \<bar>B\<bar>

goal (1 subgoal):
 1. - (err * B) \<le> \<bar>B\<bar>
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
- (err * B) \<le> \<bar>B\<bar>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ftranclD:
  "(x, y) |\<in>| R|\<^sup>+| \<Longrightarrow> \<exists>z. (x, z) |\<in>| R \<and> (z = y \<or> (z, y) |\<in>| R|\<^sup>+|)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x, y) |\<in>| R|\<^sup>+| \<Longrightarrow> \<exists>z. (x, z) |\<in>| R \<and> (z = y \<or> (z, y) |\<in>| R|\<^sup>+|)
[PROOF STEP]
by (induct rule: ftrancl_induct) (auto, meson ftrancl_into_trancl)


[STATEMENT]
lemma cblinfun_blinfun_transfer_compose[cblinfun_blinfun_transfer]:
  includes lifting_syntax
  shows "(blinfun_cblinfun_eq ===> blinfun_cblinfun_eq ===> blinfun_cblinfun_eq) (o\<^sub>L) (o\<^sub>C\<^sub>L)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (blinfun_cblinfun_eq ===> blinfun_cblinfun_eq ===> blinfun_cblinfun_eq) (o\<^sub>L) (o\<^sub>C\<^sub>L)
[PROOF STEP]
unfolding rel_fun_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x y. blinfun_cblinfun_eq x y \<longrightarrow> (\<forall>xa ya. blinfun_cblinfun_eq xa ya \<longrightarrow> blinfun_cblinfun_eq (x o\<^sub>L xa) (y o\<^sub>C\<^sub>L ya))
[PROOF STEP]
apply transfer
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>{f. bounded_linear f}. \<forall>y\<in>{f. bounded_clinear f}. x = y \<longrightarrow> (\<forall>xa\<in>{f. bounded_linear f}. \<forall>ya\<in>{f. bounded_clinear f}. xa = ya \<longrightarrow> x \<circ> xa = y \<circ> ya)
[PROOF STEP]
by auto


[STATEMENT]
lemma ring_id_pow_closed:
"(ring_id)[^]\<^bsub>Fun Zp\<^esub> (n::nat) \<in> carrier (Fun Zp)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ring_id [^]\<^bsub>function_ring (carrier Zp) Zp\<^esub> n \<in> carrier (function_ring (carrier Zp) Zp)
[PROOF STEP]
by (simp add: function_ring_is_monoid monoid.nat_pow_closed)


[STATEMENT]
lemma embed_measure_count_space':
    "inj_on f A \<Longrightarrow> embed_measure (count_space A) f = count_space (f`A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on f A \<Longrightarrow> embed_measure (count_space A) f = count_space (f ` A)
[PROOF STEP]
apply (subst distr_bij_count_space[of f A "f`A", symmetric])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. inj_on f A \<Longrightarrow> bij_betw f A (f ` A)
 2. inj_on f A \<Longrightarrow> embed_measure (count_space A) f = distr (count_space A) (count_space (f ` A)) f
[PROOF STEP]
apply (simp add: inj_on_def bij_betw_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on f A \<Longrightarrow> embed_measure (count_space A) f = distr (count_space A) (count_space (f ` A)) f
[PROOF STEP]
apply (subst embed_measure_eq_distr')
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. inj_on f A \<Longrightarrow> inj_on f (space (count_space A))
 2. inj_on f A \<Longrightarrow> distr (count_space A) (embed_measure (count_space A) f) f = distr (count_space A) (count_space (f ` A)) f
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on f A \<Longrightarrow> distr (count_space A) (embed_measure (count_space A) f) f = distr (count_space A) (count_space (f ` A)) f
[PROOF STEP]
apply(auto 4 3 intro!: measure_eqI imageI simp add: sets_embed_measure' subset_image_iff)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>Aa. \<lbrakk>inj_on f A; Aa \<subseteq> A\<rbrakk> \<Longrightarrow> emeasure (distr (count_space A) (embed_measure (count_space A) f) f) (f ` Aa) = emeasure (distr (count_space A) (count_space (f ` A)) f) (f ` Aa)
[PROOF STEP]
apply (subst (1 2) emeasure_distr)
[PROOF STATE]
proof (prove)
goal (5 subgoals):
 1. \<And>Aa. \<lbrakk>inj_on f A; Aa \<subseteq> A\<rbrakk> \<Longrightarrow> f \<in> count_space A \<rightarrow>\<^sub>M count_space (f ` A)
 2. \<And>Aa. \<lbrakk>inj_on f A; Aa \<subseteq> A\<rbrakk> \<Longrightarrow> f ` Aa \<in> sets (count_space (f ` A))
 3. \<And>Aa. \<lbrakk>inj_on f A; Aa \<subseteq> A\<rbrakk> \<Longrightarrow> f \<in> count_space A \<rightarrow>\<^sub>M embed_measure (count_space A) f
 4. \<And>Aa. \<lbrakk>inj_on f A; Aa \<subseteq> A\<rbrakk> \<Longrightarrow> f ` Aa \<in> sets (embed_measure (count_space A) f)
 5. \<And>Aa. \<lbrakk>inj_on f A; Aa \<subseteq> A\<rbrakk> \<Longrightarrow> emeasure (count_space A) (f -` f ` Aa \<inter> space (count_space A)) = emeasure (count_space A) (f -` f ` Aa \<inter> space (count_space A))
[PROOF STEP]
apply (auto simp: space_embed_measure sets_embed_measure')
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma left_null_space_eq_null_space_transpose: "left_null_space A = null_space (transpose A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. left_null_space A = null_space (Finite_Cartesian_Product.transpose A)
[PROOF STEP]
unfolding null_space_def left_null_space_def transpose_vector
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {x. Finite_Cartesian_Product.transpose A *v x = 0} = {x. Finite_Cartesian_Product.transpose A *v x = 0}
[PROOF STEP]
..


[STATEMENT]
lemma lg_maxr: "\<lbrakk>Suc 0 < x; Suc 0 < y\<rbrakk> \<Longrightarrow>
                      rec_exec rec_lg [x, y] = Maxr lgR [x, y] x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Suc 0 < x; Suc 0 < y\<rbrakk> \<Longrightarrow> rec_exec rec_lg [x, y] = Maxr lgR [x, y] x
[PROOF STEP]
proof(simp add: rec_exec.simps rec_lg_def Let_def)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>Suc 0 < x; Suc 0 < y\<rbrakk> \<Longrightarrow> rec_exec (rec_maxr (Cn 3 rec_le [Cn 3 rec_power [recf.id 3 (Suc 0), recf.id 3 2], recf.id 3 0])) [x, y, x] = Maxr lgR [x, y] x
[PROOF STEP]
assume h: "Suc 0 < x" "Suc 0 < y"
[PROOF STATE]
proof (state)
this:
Suc 0 < x
Suc 0 < y

goal (1 subgoal):
 1. \<lbrakk>Suc 0 < x; Suc 0 < y\<rbrakk> \<Longrightarrow> rec_exec (rec_maxr (Cn 3 rec_le [Cn 3 rec_power [recf.id 3 (Suc 0), recf.id 3 2], recf.id 3 0])) [x, y, x] = Maxr lgR [x, y] x
[PROOF STEP]
let ?rR = "(Cn 3 rec_le [Cn 3 rec_power
               [recf.id 3 (Suc 0), recf.id 3 2], recf.id 3 0])"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>Suc 0 < x; Suc 0 < y\<rbrakk> \<Longrightarrow> rec_exec (rec_maxr (Cn 3 rec_le [Cn 3 rec_power [recf.id 3 (Suc 0), recf.id 3 2], recf.id 3 0])) [x, y, x] = Maxr lgR [x, y] x
[PROOF STEP]
have "rec_exec (rec_maxr ?rR) ([x, y] @ [x])
              = Maxr ((\<lambda> args. 0 < rec_exec ?rR args)) [x, y] x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rec_exec (rec_maxr (Cn 3 rec_le [Cn 3 rec_power [recf.id 3 (Suc 0), recf.id 3 2], recf.id 3 0])) ([x, y] @ [x]) = Maxr (\<lambda>args. 0 < rec_exec (Cn 3 rec_le [Cn 3 rec_power [recf.id 3 (Suc 0), recf.id 3 2], recf.id 3 0]) args) [x, y] x
[PROOF STEP]
proof(rule Maxr_lemma)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. primerec (Cn 3 rec_le [Cn 3 rec_power [recf.id 3 (Suc 0), recf.id 3 2], recf.id 3 0]) (Suc (length [x, y]))
[PROOF STEP]
show "primerec (Cn 3 rec_le [Cn 3 rec_power
              [recf.id 3 (Suc 0), recf.id 3 2], recf.id 3 0]) (Suc (length [x, y]))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. primerec (Cn 3 rec_le [Cn 3 rec_power [recf.id 3 (Suc 0), recf.id 3 2], recf.id 3 0]) (Suc (length [x, y]))
[PROOF STEP]
apply(auto simp: numeral_3_eq_3)+
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
primerec (Cn 3 rec_le [Cn 3 rec_power [recf.id 3 (Suc 0), recf.id 3 2], recf.id 3 0]) (Suc (length [x, y]))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
rec_exec (rec_maxr (Cn 3 rec_le [Cn 3 rec_power [recf.id 3 (Suc 0), recf.id 3 2], recf.id 3 0])) ([x, y] @ [x]) = Maxr (\<lambda>args. 0 < rec_exec (Cn 3 rec_le [Cn 3 rec_power [recf.id 3 (Suc 0), recf.id 3 2], recf.id 3 0]) args) [x, y] x

goal (1 subgoal):
 1. \<lbrakk>Suc 0 < x; Suc 0 < y\<rbrakk> \<Longrightarrow> rec_exec (rec_maxr (Cn 3 rec_le [Cn 3 rec_power [recf.id 3 (Suc 0), recf.id 3 2], recf.id 3 0])) [x, y, x] = Maxr lgR [x, y] x
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
rec_exec (rec_maxr (Cn 3 rec_le [Cn 3 rec_power [recf.id 3 (Suc 0), recf.id 3 2], recf.id 3 0])) ([x, y] @ [x]) = Maxr (\<lambda>args. 0 < rec_exec (Cn 3 rec_le [Cn 3 rec_power [recf.id 3 (Suc 0), recf.id 3 2], recf.id 3 0]) args) [x, y] x

goal (1 subgoal):
 1. \<lbrakk>Suc 0 < x; Suc 0 < y\<rbrakk> \<Longrightarrow> rec_exec (rec_maxr (Cn 3 rec_le [Cn 3 rec_power [recf.id 3 (Suc 0), recf.id 3 2], recf.id 3 0])) [x, y, x] = Maxr lgR [x, y] x
[PROOF STEP]
have "Maxr lgR [x, y] x = Maxr ((\<lambda> args. 0 < rec_exec ?rR args)) [x, y] x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Maxr lgR [x, y] x = Maxr (\<lambda>args. 0 < rec_exec (Cn 3 rec_le [Cn 3 rec_power [recf.id 3 (Suc 0), recf.id 3 2], recf.id 3 0]) args) [x, y] x
[PROOF STEP]
apply(simp add: rec_exec.simps power_lemma)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Maxr lgR [x, y] x = Maxr (\<lambda>args. args ! Suc 0 ^ args ! 2 \<le> args ! 0) [x, y] x
[PROOF STEP]
apply(simp add: Maxr.simps lgR.simps)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
Maxr lgR [x, y] x = Maxr (\<lambda>args. 0 < rec_exec (Cn 3 rec_le [Cn 3 rec_power [recf.id 3 (Suc 0), recf.id 3 2], recf.id 3 0]) args) [x, y] x

goal (1 subgoal):
 1. \<lbrakk>Suc 0 < x; Suc 0 < y\<rbrakk> \<Longrightarrow> rec_exec (rec_maxr (Cn 3 rec_le [Cn 3 rec_power [recf.id 3 (Suc 0), recf.id 3 2], recf.id 3 0])) [x, y, x] = Maxr lgR [x, y] x
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
rec_exec (rec_maxr (Cn 3 rec_le [Cn 3 rec_power [recf.id 3 (Suc 0), recf.id 3 2], recf.id 3 0])) ([x, y] @ [x]) = Maxr (\<lambda>args. 0 < rec_exec (Cn 3 rec_le [Cn 3 rec_power [recf.id 3 (Suc 0), recf.id 3 2], recf.id 3 0]) args) [x, y] x
Maxr lgR [x, y] x = Maxr (\<lambda>args. 0 < rec_exec (Cn 3 rec_le [Cn 3 rec_power [recf.id 3 (Suc 0), recf.id 3 2], recf.id 3 0]) args) [x, y] x
[PROOF STEP]
show "rec_exec (rec_maxr ?rR) [x, y, x] = Maxr lgR [x, y] x"
[PROOF STATE]
proof (prove)
using this:
rec_exec (rec_maxr (Cn 3 rec_le [Cn 3 rec_power [recf.id 3 (Suc 0), recf.id 3 2], recf.id 3 0])) ([x, y] @ [x]) = Maxr (\<lambda>args. 0 < rec_exec (Cn 3 rec_le [Cn 3 rec_power [recf.id 3 (Suc 0), recf.id 3 2], recf.id 3 0]) args) [x, y] x
Maxr lgR [x, y] x = Maxr (\<lambda>args. 0 < rec_exec (Cn 3 rec_le [Cn 3 rec_power [recf.id 3 (Suc 0), recf.id 3 2], recf.id 3 0]) args) [x, y] x

goal (1 subgoal):
 1. rec_exec (rec_maxr (Cn 3 rec_le [Cn 3 rec_power [recf.id 3 (Suc 0), recf.id 3 2], recf.id 3 0])) [x, y, x] = Maxr lgR [x, y] x
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
rec_exec (rec_maxr (Cn 3 rec_le [Cn 3 rec_power [recf.id 3 (Suc 0), recf.id 3 2], recf.id 3 0])) [x, y, x] = Maxr lgR [x, y] x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma same_level_path_number_Calls_eq_number_Returns:
  "\<lbrakk>same_level_path as; \<forall>a \<in> set as. valid_edge a\<rbrakk> \<Longrightarrow>
  length [a\<leftarrow>as. \<exists>Q r p fs. kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs] = length [a\<leftarrow>as. \<exists>Q p f. kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>same_level_path as; \<forall>a\<in>set as. valid_edge a\<rbrakk> \<Longrightarrow> length (filter (\<lambda>a. \<exists>Q r p fs. kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs) as) = length (filter (\<lambda>a. \<exists>Q p f. kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f) as)
[PROOF STEP]
by(fastforce dest:slpa_number_Calls_eq_number_Returns simp:same_level_path_def)


[STATEMENT]
lemma uMult_left_commute: "a *\<^sub># (b *\<^sub># c) = b *\<^sub># (a *\<^sub># c)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a *\<^sub># (b *\<^sub># c) = b *\<^sub># (a *\<^sub># c)
[PROOF STEP]
unfolding uMult_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Lambda> x y. Discr (undiscr x * undiscr y))\<cdot>a\<cdot>((\<Lambda> x y. Discr (undiscr x * undiscr y))\<cdot>b\<cdot>c) = (\<Lambda> x y. Discr (undiscr x * undiscr y))\<cdot>b\<cdot>((\<Lambda> x y. Discr (undiscr x * undiscr y))\<cdot>a\<cdot>c)
[PROOF STEP]
by simp


[STATEMENT]
lemma limitin_atin_self:
   "limitin Y f (f a) (atin X a) \<longleftrightarrow>
        f a \<in> topspace Y \<and>
        (a \<in> topspace X
         \<longrightarrow> (\<forall>V. openin Y V \<and> f a \<in> V
                  \<longrightarrow> (\<exists>U. openin X U \<and> a \<in> U \<and> f ` U \<subseteq> V)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. limitin Y f (f a) (atin X a) = (f a \<in> topspace Y \<and> (a \<in> topspace X \<longrightarrow> (\<forall>V. openin Y V \<and> f a \<in> V \<longrightarrow> (\<exists>U. openin X U \<and> a \<in> U \<and> f ` U \<subseteq> V))))
[PROOF STEP]
unfolding limitin_atin
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f a \<in> topspace Y \<and> (a \<in> topspace X \<longrightarrow> (\<forall>V. openin Y V \<and> f a \<in> V \<longrightarrow> (\<exists>U. openin X U \<and> a \<in> U \<and> f ` (U - {a}) \<subseteq> V)))) = (f a \<in> topspace Y \<and> (a \<in> topspace X \<longrightarrow> (\<forall>V. openin Y V \<and> f a \<in> V \<longrightarrow> (\<exists>U. openin X U \<and> a \<in> U \<and> f ` U \<subseteq> V))))
[PROOF STEP]
by fastforce


[STATEMENT]
lemma Rel2Mon_if:
  "Rel2Mon {(s, t). if b s then (s, t) \<in> Mon2Rel c O lfp (\<Gamma> b (Mon2Rel c)) else s = t} \<sigma> =
  (if b \<sigma> then Rel2Mon (Mon2Rel c O lfp (\<Gamma> b (Mon2Rel c))) \<sigma> else Some ((), \<sigma>))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Rel2Mon {(s, t). if b s then (s, t) \<in> Mon2Rel c O lfp (\<Gamma> b (Mon2Rel c)) else s = t} \<sigma> = (if b \<sigma> then Rel2Mon (Mon2Rel c O lfp (\<Gamma> b (Mon2Rel c))) \<sigma> else Some ((), \<sigma>))
[PROOF STEP]
by (simp add: Rel2Mon_def)


[STATEMENT]
lemma fps_lcm:
  assumes [simp]: "f \<noteq> 0" "g \<noteq> 0"
  shows   "lcm f g = fps_X ^ max (subdegree f) (subdegree g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lcm f g = fps_X ^ max (subdegree f) (subdegree g)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. lcm f g = fps_X ^ max (subdegree f) (subdegree g)
[PROOF STEP]
let ?m = "max (subdegree f) (subdegree g)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. lcm f g = fps_X ^ max (subdegree f) (subdegree g)
[PROOF STEP]
show "lcm f g = fps_X ^ ?m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lcm f g = fps_X ^ max (subdegree f) (subdegree g)
[PROOF STEP]
proof (rule sym, rule lcmI)
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. f dvd fps_X ^ max (subdegree f) (subdegree g)
 2. g dvd fps_X ^ max (subdegree f) (subdegree g)
 3. \<And>d. \<lbrakk>f dvd d; g dvd d\<rbrakk> \<Longrightarrow> fps_X ^ max (subdegree f) (subdegree g) dvd d
 4. normalize (fps_X ^ max (subdegree f) (subdegree g)) = fps_X ^ max (subdegree f) (subdegree g)
[PROOF STEP]
fix d
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. f dvd fps_X ^ max (subdegree f) (subdegree g)
 2. g dvd fps_X ^ max (subdegree f) (subdegree g)
 3. \<And>d. \<lbrakk>f dvd d; g dvd d\<rbrakk> \<Longrightarrow> fps_X ^ max (subdegree f) (subdegree g) dvd d
 4. normalize (fps_X ^ max (subdegree f) (subdegree g)) = fps_X ^ max (subdegree f) (subdegree g)
[PROOF STEP]
assume "f dvd d" "g dvd d"
[PROOF STATE]
proof (state)
this:
f dvd d
g dvd d

goal (4 subgoals):
 1. f dvd fps_X ^ max (subdegree f) (subdegree g)
 2. g dvd fps_X ^ max (subdegree f) (subdegree g)
 3. \<And>d. \<lbrakk>f dvd d; g dvd d\<rbrakk> \<Longrightarrow> fps_X ^ max (subdegree f) (subdegree g) dvd d
 4. normalize (fps_X ^ max (subdegree f) (subdegree g)) = fps_X ^ max (subdegree f) (subdegree g)
[PROOF STEP]
thus "fps_X ^ ?m dvd d"
[PROOF STATE]
proof (prove)
using this:
f dvd d
g dvd d

goal (1 subgoal):
 1. fps_X ^ max (subdegree f) (subdegree g) dvd d
[PROOF STEP]
by (cases "d = 0") (simp_all add: fps_dvd_iff)
[PROOF STATE]
proof (state)
this:
fps_X ^ max (subdegree f) (subdegree g) dvd d

goal (3 subgoals):
 1. f dvd fps_X ^ max (subdegree f) (subdegree g)
 2. g dvd fps_X ^ max (subdegree f) (subdegree g)
 3. normalize (fps_X ^ max (subdegree f) (subdegree g)) = fps_X ^ max (subdegree f) (subdegree g)
[PROOF STEP]
qed (simp_all add: fps_dvd_iff)
[PROOF STATE]
proof (state)
this:
lcm f g = fps_X ^ max (subdegree f) (subdegree g)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Peirce: \<open>\<turnstile> ((p \<rightarrow> q) \<rightarrow> p) \<rightarrow> p\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<turnstile> ((p \<rightarrow> q) \<rightarrow> p) \<rightarrow> p
[PROOF STEP]
using MP PR Simp Swap Tran
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<turnstile> ?p \<rightarrow> ?q; \<turnstile> ?p\<rbrakk> \<Longrightarrow> \<turnstile> ?q
\<turnstile> (?p \<rightarrow> ?q) \<rightarrow> ?p \<Longrightarrow> \<turnstile> ?p
\<turnstile> ?p \<rightarrow> ?q \<rightarrow> ?p
\<turnstile> (?p \<rightarrow> ?q \<rightarrow> ?r) \<rightarrow> ?q \<rightarrow> ?p \<rightarrow> ?r
\<turnstile> (?p \<rightarrow> ?q) \<rightarrow> (?q \<rightarrow> ?r) \<rightarrow> ?p \<rightarrow> ?r

goal (1 subgoal):
 1. \<turnstile> ((p \<rightarrow> q) \<rightarrow> p) \<rightarrow> p
[PROOF STEP]
by meson


[STATEMENT]
theorem "~ (\<forall>j (i::int). j \<le> i --> (\<exists>x y. 0 \<le> x & 0 \<le> y & 3 * x + 5 * y = i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> (\<forall>j i. j \<le> i \<longrightarrow> (\<exists>x y. 0 \<le> x \<and> 0 \<le> y \<and> 3 * x + 5 * y = i))
[PROOF STEP]
by presburger


[STATEMENT]
lemma injective_into_1d_imp_open_map_UNIV:
  fixes f :: "'a::euclidean_space \<Rightarrow> real"
  assumes "open T" "continuous_on S f" "inj_on f S" "T \<subseteq> S"
    shows "open (f ` T)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. open (f ` T)
[PROOF STEP]
apply (rule invariance_of_domain_gen [OF \<open>open T\<close>])
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. continuous_on T f
 2. inj_on f T
 3. DIM(real) \<le> DIM('a)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
open T
continuous_on S f
inj_on f S
T \<subseteq> S

goal (3 subgoals):
 1. continuous_on T f
 2. inj_on f T
 3. DIM(real) \<le> DIM('a)
[PROOF STEP]
apply (auto simp: elim: continuous_on_subset subset_inj_on)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma of_nat_neq_iff_word:
      "x mod 2 ^ LENGTH('a) \<noteq> y mod 2 ^ LENGTH('a) \<Longrightarrow>
         (((of_nat x)::('a::len) word) \<noteq> of_nat y) = (x \<noteq> y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x mod 2 ^ LENGTH('a) \<noteq> y mod 2 ^ LENGTH('a) \<Longrightarrow> (word_of_nat x \<noteq> word_of_nat y) = (x \<noteq> y)
[PROOF STEP]
apply (rule iffI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>x mod 2 ^ LENGTH('a) \<noteq> y mod 2 ^ LENGTH('a); word_of_nat x \<noteq> word_of_nat y\<rbrakk> \<Longrightarrow> x \<noteq> y
 2. \<lbrakk>x mod 2 ^ LENGTH('a) \<noteq> y mod 2 ^ LENGTH('a); x \<noteq> y\<rbrakk> \<Longrightarrow> word_of_nat x \<noteq> word_of_nat y
[PROOF STEP]
apply (case_tac "x = y")
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<lbrakk>x mod 2 ^ LENGTH('a) \<noteq> y mod 2 ^ LENGTH('a); word_of_nat x \<noteq> word_of_nat y; x = y\<rbrakk> \<Longrightarrow> x \<noteq> y
 2. \<lbrakk>x mod 2 ^ LENGTH('a) \<noteq> y mod 2 ^ LENGTH('a); word_of_nat x \<noteq> word_of_nat y; x \<noteq> y\<rbrakk> \<Longrightarrow> x \<noteq> y
 3. \<lbrakk>x mod 2 ^ LENGTH('a) \<noteq> y mod 2 ^ LENGTH('a); x \<noteq> y\<rbrakk> \<Longrightarrow> word_of_nat x \<noteq> word_of_nat y
[PROOF STEP]
apply (subst (asm) of_nat_eq_iff[symmetric])
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<lbrakk>of_nat (x mod 2 ^ LENGTH('a)) \<noteq> of_nat (y mod 2 ^ LENGTH('a)); word_of_nat x \<noteq> word_of_nat y; x = y\<rbrakk> \<Longrightarrow> x \<noteq> y
 2. \<lbrakk>x mod 2 ^ LENGTH('a) \<noteq> y mod 2 ^ LENGTH('a); word_of_nat x \<noteq> word_of_nat y; x \<noteq> y\<rbrakk> \<Longrightarrow> x \<noteq> y
 3. \<lbrakk>x mod 2 ^ LENGTH('a) \<noteq> y mod 2 ^ LENGTH('a); x \<noteq> y\<rbrakk> \<Longrightarrow> word_of_nat x \<noteq> word_of_nat y
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x mod 2 ^ LENGTH('a) \<noteq> y mod 2 ^ LENGTH('a); x \<noteq> y; word_of_nat x = word_of_nat y\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
apply (case_tac "((of_nat x)::('a::len) word) = of_nat y")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>x mod 2 ^ LENGTH('a) \<noteq> y mod 2 ^ LENGTH('a); x \<noteq> y; word_of_nat x = word_of_nat y; word_of_nat x = word_of_nat y\<rbrakk> \<Longrightarrow> False
 2. \<lbrakk>x mod 2 ^ LENGTH('a) \<noteq> y mod 2 ^ LENGTH('a); x \<noteq> y; word_of_nat x = word_of_nat y; word_of_nat x \<noteq> word_of_nat y\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x mod 2 ^ LENGTH('a) \<noteq> y mod 2 ^ LENGTH('a); x \<noteq> y; word_of_nat x = word_of_nat y\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
apply (metis unat_of_nat)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma sum_pos_ex_elem_pos: "(0::int) < (\<Sum>m\<in>M. f m) \<Longrightarrow> \<exists>m\<in>M. 0 < f m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < sum f M \<Longrightarrow> \<exists>m\<in>M. 0 < f m
[PROOF STEP]
by (meson not_le sum_nonpos)


[STATEMENT]
lemma hypnat_infinite_has_nonstandard_iff: "infinite A \<longleftrightarrow> hypnat_of_nat ` A < *s* A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. infinite A = (hypnat_of_nat ` A \<subset> *s* A)
[PROOF STEP]
by (metis finite_starsetNat_iff hypnat_infinite_has_nonstandard nless_le)


[STATEMENT]
lemma dims_A':
shows "dim_row (A' ws) = prod_list (nths (Tensor.dims (A ws)) {n. even n})"
and "dim_col (A' ws) = prod_list (nths (Tensor.dims (A ws)) {n. odd n})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_row (A' ws) = prod_list (nths (dims (A ws)) (Collect even)) &&& dim_col (A' ws) = prod_list (nths (dims (A ws)) {n. odd n})
[PROOF STEP]
unfolding A'_def matricize_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_row (mat (prod_list (nths (dims (A ws)) (Collect even))) (prod_list (nths (dims (A ws)) (- Collect even))) (\<lambda>(r, c). lookup (A ws) (weave (Collect even) (digit_encode (nths (dims (A ws)) (Collect even)) r) (digit_encode (nths (dims (A ws)) (- Collect even)) c)))) = prod_list (nths (dims (A ws)) (Collect even)) &&& dim_col (mat (prod_list (nths (dims (A ws)) (Collect even))) (prod_list (nths (dims (A ws)) (- Collect even))) (\<lambda>(r, c). lookup (A ws) (weave (Collect even) (digit_encode (nths (dims (A ws)) (Collect even)) r) (digit_encode (nths (dims (A ws)) (- Collect even)) c)))) = prod_list (nths (dims (A ws)) {n. odd n})
[PROOF STEP]
by (simp_all add: A_def Collect_neg_eq)


[STATEMENT]
lemma ereal_max_0: "max 0 (ereal r) = ereal (max 0 r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. max 0 (ereal r) = ereal (max 0 r)
[PROOF STEP]
by (auto simp: zero_ereal_def)


[STATEMENT]
theorem (in abelian_group_hom) A_FactGroup_iso_set:
  "h ` carrier G = carrier H
   \<Longrightarrow> (\<lambda>X. the_elem (h`X)) \<in> iso (G A_Mod (a_kernel G H h)) (add_monoid H)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. h ` carrier G = carrier H \<Longrightarrow> (\<lambda>X. the_elem (h ` X)) \<in> Group.iso (G A_Mod a_kernel G H h) (add_monoid H)
[PROOF STEP]
by (rule group_hom.FactGroup_iso_set[OF a_group_hom,
    folded a_kernel_def A_FactGroup_def, simplified ring_record_simps])


[STATEMENT]
lemma "[12, mod 10, 4] = {12, 22, 32, 42, 52}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [ 12, mod 10, 4 ] = {12, 22, 32, 42, 52}
[PROOF STEP]
apply (simp only: iMODb_conv)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [\<dots>4] \<otimes> 10 \<oplus> 12 = {12, 22, 32, 42, 52}
[PROOF STEP]
apply (simp add: iT_defs iT_Mult_def iT_Plus_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. n + 12) ` (\<lambda>n. n * 10) ` {..4} = {12, 22, 32, 42, 52}
[PROOF STEP]
apply (simp add: atMost_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. x + 12) ` (\<lambda>x. x * 10) ` {x. x \<le> 4} = {12, 22, 32, 42, 52}
[PROOF STEP]
apply safe
[PROOF STATE]
proof (prove)
goal (6 subgoals):
 1. \<And>x xa xb. \<lbrakk>xb * 10 + 12 \<noteq> 12; xb * 10 + 12 \<noteq> 22; xb * 10 + 12 \<noteq> 32; xb * 10 + 12 \<noteq> 42; xb * 10 + 12 \<notin> {}; xb \<le> 4\<rbrakk> \<Longrightarrow> xb * 10 + 12 = 52
 2. \<And>x. 12 \<in> (\<lambda>x. x + 12) ` (\<lambda>x. x * 10) ` {x. x \<le> 4}
 3. \<And>x. 22 \<in> (\<lambda>x. x + 12) ` (\<lambda>x. x * 10) ` {x. x \<le> 4}
 4. \<And>x. 32 \<in> (\<lambda>x. x + 12) ` (\<lambda>x. x * 10) ` {x. x \<le> 4}
 5. \<And>x. 42 \<in> (\<lambda>x. x + 12) ` (\<lambda>x. x * 10) ` {x. x \<le> 4}
 6. \<And>x. 52 \<in> (\<lambda>x. x + 12) ` (\<lambda>x. x * 10) ` {x. x \<le> 4}
[PROOF STEP]
apply simp+
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma ChiPlus_ChiRel_NoCycle_2 [rule_format]:
 "\<lbrakk> (T,S) \<in> ChiPlus A\<rbrakk> \<Longrightarrow>  (S,T) \<in> (ChiRel A) \<longrightarrow>
   (insert S (insert T ({U. (T,U) \<in> ChiPlus A \<and> (U,S) \<in> ChiPlus A})))  \<inter> (ChiRel A `` {S}) \<noteq> {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (T, S) \<in> ChiPlus A \<Longrightarrow> (S, T) \<in> ChiRel A \<longrightarrow> insert S (insert T {U. (T, U) \<in> ChiPlus A \<and> (U, S) \<in> ChiPlus A}) \<inter> ChiRel A `` {S} \<noteq> {}
[PROOF STEP]
apply (unfold ChiPlus_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (T, S) \<in> (ChiRel A)\<^sup>+ \<Longrightarrow> (S, T) \<in> ChiRel A \<longrightarrow> insert S (insert T {U. (T, U) \<in> (ChiRel A)\<^sup>+ \<and> (U, S) \<in> (ChiRel A)\<^sup>+}) \<inter> ChiRel A `` {S} \<noteq> {}
[PROOF STEP]
apply (rule_tac a="T" and b="S" and r="(ChiRel A)" in converse_trancl_induct)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. (T, S) \<in> (ChiRel A)\<^sup>+ \<Longrightarrow> (T, S) \<in> (ChiRel A)\<^sup>+
 2. \<And>y. \<lbrakk>(T, S) \<in> (ChiRel A)\<^sup>+; (y, S) \<in> ChiRel A\<rbrakk> \<Longrightarrow> (S, y) \<in> ChiRel A \<longrightarrow> insert S (insert y {U. (y, U) \<in> (ChiRel A)\<^sup>+ \<and> (U, S) \<in> (ChiRel A)\<^sup>+}) \<inter> ChiRel A `` {S} \<noteq> {}
 3. \<And>y z. \<lbrakk>(T, S) \<in> (ChiRel A)\<^sup>+; (y, z) \<in> ChiRel A; (z, S) \<in> (ChiRel A)\<^sup>+; (S, z) \<in> ChiRel A \<longrightarrow> insert S (insert z {U. (z, U) \<in> (ChiRel A)\<^sup>+ \<and> (U, S) \<in> (ChiRel A)\<^sup>+}) \<inter> ChiRel A `` {S} \<noteq> {}\<rbrakk> \<Longrightarrow> (S, y) \<in> ChiRel A \<longrightarrow> insert S (insert y {U. (y, U) \<in> (ChiRel A)\<^sup>+ \<and> (U, S) \<in> (ChiRel A)\<^sup>+}) \<inter> ChiRel A `` {S} \<noteq> {}
[PROOF STEP]
apply (unfold Image_def Int_def)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. (T, S) \<in> (ChiRel A)\<^sup>+ \<Longrightarrow> (T, S) \<in> (ChiRel A)\<^sup>+
 2. \<And>y. \<lbrakk>(T, S) \<in> (ChiRel A)\<^sup>+; (y, S) \<in> ChiRel A\<rbrakk> \<Longrightarrow> (S, y) \<in> ChiRel A \<longrightarrow> {x \<in> insert S (insert y {U. (y, U) \<in> (ChiRel A)\<^sup>+ \<and> (U, S) \<in> (ChiRel A)\<^sup>+}). x \<in> {y. \<exists>x\<in>{S}. (x, y) \<in> ChiRel A}} \<noteq> {}
 3. \<And>y z. \<lbrakk>(T, S) \<in> (ChiRel A)\<^sup>+; (y, z) \<in> ChiRel A; (z, S) \<in> (ChiRel A)\<^sup>+; (S, z) \<in> ChiRel A \<longrightarrow> {x \<in> insert S (insert z {U. (z, U) \<in> (ChiRel A)\<^sup>+ \<and> (U, S) \<in> (ChiRel A)\<^sup>+}). x \<in> {y. \<exists>x\<in>{S}. (x, y) \<in> ChiRel A}} \<noteq> {}\<rbrakk> \<Longrightarrow> (S, y) \<in> ChiRel A \<longrightarrow> {x \<in> insert S (insert y {U. (y, U) \<in> (ChiRel A)\<^sup>+ \<and> (U, S) \<in> (ChiRel A)\<^sup>+}). x \<in> {y. \<exists>x\<in>{S}. (x, y) \<in> ChiRel A}} \<noteq> {}
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma JHS_Tr1_1:"\<lbrakk>Group G; 0 < r; 0 < s; compseries G r f; compseries G s g\<rbrakk> \<Longrightarrow> f (Suc ((r * s - Suc 0) div s)) \<diamondop>\<^bsub>G\<^esub> (f ((r * s - Suc 0) div s) \<inter> g ((r * s - Suc 0) mod s)) = f (r - Suc 0) \<inter> g (s - Suc 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Group G; 0 < r; 0 < s; compseries G r f; compseries G s g\<rbrakk> \<Longrightarrow> f (Suc ((r * s - Suc 0) div s)) \<diamondop>\<^bsub>G\<^esub> f ((r * s - Suc 0) div s) \<inter> g ((r * s - Suc 0) mod s) = f (r - Suc 0) \<inter> g (s - Suc 0)
[PROOF STEP]
apply (frule r_s_div_s [of "r" "s"], assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Group G; 0 < r; 0 < s; compseries G r f; compseries G s g; (r * s - Suc 0) div s = r - Suc 0\<rbrakk> \<Longrightarrow> f (Suc ((r * s - Suc 0) div s)) \<diamondop>\<^bsub>G\<^esub> f ((r * s - Suc 0) div s) \<inter> g ((r * s - Suc 0) mod s) = f (r - Suc 0) \<inter> g (s - Suc 0)
[PROOF STEP]
apply (frule r_s_mod_s [of "r" "s"], assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Group G; 0 < r; 0 < s; compseries G r f; compseries G s g; (r * s - Suc 0) div s = r - Suc 0; (r * s - Suc 0) mod s = s - Suc 0\<rbrakk> \<Longrightarrow> f (Suc ((r * s - Suc 0) div s)) \<diamondop>\<^bsub>G\<^esub> f ((r * s - Suc 0) div s) \<inter> g ((r * s - Suc 0) mod s) = f (r - Suc 0) \<inter> g (s - Suc 0)
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Group G; 0 < r; 0 < s; compseries G r f; compseries G s g; (r * s - Suc 0) div s = r - Suc 0; (r * s - Suc 0) mod s = s - Suc 0\<rbrakk> \<Longrightarrow> f r \<diamondop>\<^bsub>G\<^esub> f (r - Suc 0) \<inter> g (s - Suc 0) = f (r - Suc 0) \<inter> g (s - Suc 0)
[PROOF STEP]
apply (subst Group.compseriesTr3 [of "G" "r" "f"], assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Group G; 0 < r; 0 < s; compseries G r f; compseries G s g; (r * s - Suc 0) div s = r - Suc 0; (r * s - Suc 0) mod s = s - Suc 0\<rbrakk> \<Longrightarrow> {\<one>\<^bsub>G\<^esub>} \<diamondop>\<^bsub>G\<^esub> f (r - Suc 0) \<inter> g (s - Suc 0) = f (r - Suc 0) \<inter> g (s - Suc 0)
[PROOF STEP]
apply (frule Group.compseriesTr0 [of "G" "r" "f" "r - Suc 0"], assumption+)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>Group G; 0 < r; 0 < s; compseries G r f; compseries G s g; (r * s - Suc 0) div s = r - Suc 0; (r * s - Suc 0) mod s = s - Suc 0\<rbrakk> \<Longrightarrow> r - Suc 0 \<le> r
 2. \<lbrakk>Group G; 0 < r; 0 < s; compseries G r f; compseries G s g; (r * s - Suc 0) div s = r - Suc 0; (r * s - Suc 0) mod s = s - Suc 0; G \<guillemotright> f (r - Suc 0) \<rbrakk> \<Longrightarrow> {\<one>\<^bsub>G\<^esub>} \<diamondop>\<^bsub>G\<^esub> f (r - Suc 0) \<inter> g (s - Suc 0) = f (r - Suc 0) \<inter> g (s - Suc 0)
[PROOF STEP]
apply (simp add:less_mem_of_Nset)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Group G; 0 < r; 0 < s; compseries G r f; compseries G s g; (r * s - Suc 0) div s = r - Suc 0; (r * s - Suc 0) mod s = s - Suc 0; G \<guillemotright> f (r - Suc 0) \<rbrakk> \<Longrightarrow> {\<one>\<^bsub>G\<^esub>} \<diamondop>\<^bsub>G\<^esub> f (r - Suc 0) \<inter> g (s - Suc 0) = f (r - Suc 0) \<inter> g (s - Suc 0)
[PROOF STEP]
apply (frule Group.compseriesTr0 [of "G" "s" "g" "s - Suc 0"], assumption+)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>Group G; 0 < r; 0 < s; compseries G r f; compseries G s g; (r * s - Suc 0) div s = r - Suc 0; (r * s - Suc 0) mod s = s - Suc 0; G \<guillemotright> f (r - Suc 0) \<rbrakk> \<Longrightarrow> s - Suc 0 \<le> s
 2. \<lbrakk>Group G; 0 < r; 0 < s; compseries G r f; compseries G s g; (r * s - Suc 0) div s = r - Suc 0; (r * s - Suc 0) mod s = s - Suc 0; G \<guillemotright> f (r - Suc 0) ; G \<guillemotright> g (s - Suc 0) \<rbrakk> \<Longrightarrow> {\<one>\<^bsub>G\<^esub>} \<diamondop>\<^bsub>G\<^esub> f (r - Suc 0) \<inter> g (s - Suc 0) = f (r - Suc 0) \<inter> g (s - Suc 0)
[PROOF STEP]
apply (simp add:less_mem_of_Nset)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Group G; 0 < r; 0 < s; compseries G r f; compseries G s g; (r * s - Suc 0) div s = r - Suc 0; (r * s - Suc 0) mod s = s - Suc 0; G \<guillemotright> f (r - Suc 0) ; G \<guillemotright> g (s - Suc 0) \<rbrakk> \<Longrightarrow> {\<one>\<^bsub>G\<^esub>} \<diamondop>\<^bsub>G\<^esub> f (r - Suc 0) \<inter> g (s - Suc 0) = f (r - Suc 0) \<inter> g (s - Suc 0)
[PROOF STEP]
apply (frule Group.inter_sgs [of "G" "f (r - (Suc 0))" "g (s - Suc 0)"],
                                                          assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Group G; 0 < r; 0 < s; compseries G r f; compseries G s g; (r * s - Suc 0) div s = r - Suc 0; (r * s - Suc 0) mod s = s - Suc 0; G \<guillemotright> f (r - Suc 0) ; G \<guillemotright> g (s - Suc 0) ; G \<guillemotright> f (r - Suc 0) \<inter> g (s - Suc 0) \<rbrakk> \<Longrightarrow> {\<one>\<^bsub>G\<^esub>} \<diamondop>\<^bsub>G\<^esub> f (r - Suc 0) \<inter> g (s - Suc 0) = f (r - Suc 0) \<inter> g (s - Suc 0)
[PROOF STEP]
apply (rule Group.s_top_l_unit, assumption+)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma sinh_conv_sin: "sinh z = -\<i> * sin (\<i>*z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sinh z = - \<i> * sin (\<i> * z)
[PROOF STEP]
by (simp add: sinh_field_def sin_i_times exp_minus)


[STATEMENT]
lemma upper_bound3:
  fixes b::nat
    and v::int
      defines "x \<equiv> - (2 ^ (b - 1)) + (v + 2 ^ (b - 1)) mod 2 ^ b"
    assumes "b>0"
    shows "x < 2^(b-1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x < 2 ^ (b - 1)
[PROOF STEP]
using upper_bound2 assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>0 < ?b; ?c < 2 ^ ?b; 0 \<le> ?c\<rbrakk> \<Longrightarrow> ?c - 2 ^ (?b - 1) < 2 ^ (?b - 1)
x \<equiv> - (2 ^ (b - 1)) + (v + 2 ^ (b - 1)) mod 2 ^ b
0 < b

goal (1 subgoal):
 1. x < 2 ^ (b - 1)
[PROOF STEP]
by auto


[STATEMENT]
lemma filter_sup_symmetric:
  "filter_sup F G = filter_sup G F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. filter_sup F G = filter_sup G F
[PROOF STEP]
unfolding filter_sup_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {z. \<exists>x\<in>F. \<exists>y\<in>G. x \<sqinter> y \<le> z} = {z. \<exists>x\<in>G. \<exists>y\<in>F. x \<sqinter> y \<le> z}
[PROOF STEP]
using inf.commute
[PROOF STATE]
proof (prove)
using this:
?a \<sqinter> ?b = ?b \<sqinter> ?a

goal (1 subgoal):
 1. {z. \<exists>x\<in>F. \<exists>y\<in>G. x \<sqinter> y \<le> z} = {z. \<exists>x\<in>G. \<exists>y\<in>F. x \<sqinter> y \<le> z}
[PROOF STEP]
by fastforce


[STATEMENT]
lemma sets_not_eq:"\<lbrakk>A \<noteq> B; B \<subseteq> A\<rbrakk> \<Longrightarrow> \<exists>a\<in>A. a \<notin> B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>A \<noteq> B; B \<subseteq> A\<rbrakk> \<Longrightarrow> \<exists>a\<in>A. a \<notin> B
[PROOF STEP]
by blast


[STATEMENT]
lemma hyperb_ineq_4_points' [mono_intros]:
  "Min {Gromov_product_at (e::'a) x y, Gromov_product_at e y z, Gromov_product_at e z t} \<le> Gromov_product_at e x t + 2 * deltaG(TYPE('a))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Min {Gromov_product_at e x y, Gromov_product_at e y z, Gromov_product_at e z t} \<le> Gromov_product_at e x t + 2 * deltaG TYPE('a)
[PROOF STEP]
using hyperb_ineq_4_points[of e x y z t]
[PROOF STATE]
proof (prove)
using this:
Min {Gromov_product_at e x y, Gromov_product_at e y z, Gromov_product_at e z t} - 2 * deltaG TYPE('a) \<le> Gromov_product_at e x t

goal (1 subgoal):
 1. Min {Gromov_product_at e x y, Gromov_product_at e y z, Gromov_product_at e z t} \<le> Gromov_product_at e x t + 2 * deltaG TYPE('a)
[PROOF STEP]
by auto


[STATEMENT]
lemma odd_p: "odd p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. odd p
[PROOF STEP]
using p_ge_2 p_prime prime_odd_nat
[PROOF STATE]
proof (prove)
using this:
2 < p
prime p
\<lbrakk>prime ?p; 2 < ?p\<rbrakk> \<Longrightarrow> odd ?p

goal (1 subgoal):
 1. odd p
[PROOF STEP]
by blast


[STATEMENT]
lemma (in Semilat) plus_le_conv [simp]:
  "\<lbrakk> x \<in> A; y \<in> A; z \<in> A \<rbrakk> \<Longrightarrow> (x \<squnion>\<^sub>f y \<sqsubseteq>\<^sub>r z) = (x \<sqsubseteq>\<^sub>r z \<and> y \<sqsubseteq>\<^sub>r z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<in> A; y \<in> A; z \<in> A\<rbrakk> \<Longrightarrow> (x \<squnion>\<^bsub>f\<^esub> y \<sqsubseteq>\<^bsub>r\<^esub> z) = (x \<sqsubseteq>\<^bsub>r\<^esub> z \<and> y \<sqsubseteq>\<^bsub>r\<^esub> z)
[PROOF STEP]
(*<*)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<in> A; y \<in> A; z \<in> A\<rbrakk> \<Longrightarrow> (x \<squnion>\<^bsub>f\<^esub> y \<sqsubseteq>\<^bsub>r\<^esub> z) = (x \<sqsubseteq>\<^bsub>r\<^esub> z \<and> y \<sqsubseteq>\<^bsub>r\<^esub> z)
[PROOF STEP]
by (blast intro: ub1 ub2 lub order_trans)


[STATEMENT]
lemma "(x - y \<le> z) = (x \<le> z + (y::real))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x - y \<le> z) = (x \<le> z + y)
[PROOF STEP]
by arith


[STATEMENT]
lemma helper: "(A::int) * B + B = (A+1) * B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A * B + B = (A + 1) * B
[PROOF STEP]
by(auto simp: distrib_right)


[STATEMENT]
lemma "(inv upOne) n = n - 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inv upOne n = n - 1
[PROOF STEP]
by (rule Hilbert_Choice.inv_f_eq[of upOne "n - 1" n, OF inj_upOne], simp)


[STATEMENT]
lemma step_4_push_small_size_ok_1: "\<lbrakk>
  invar (States dir big small);
  4 \<le> remaining_steps (States dir big small);
  (step^^4) (States dir big (Small.push x small)) = States dir' big' small';
  remaining_steps (States dir big small) + 1 \<le> 4 * size small
\<rbrakk> \<Longrightarrow> remaining_steps (States dir' big' small') + 1 \<le> 4 * size small'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>invar (States dir big small); 4 \<le> remaining_steps (States dir big small); (step ^^ 4) (States dir big (Small.push x small)) = States dir' big' small'; remaining_steps (States dir big small) + 1 \<le> 4 * size small\<rbrakk> \<Longrightarrow> remaining_steps (States dir' big' small') + 1 \<le> 4 * size small'
[PROOF STEP]
by (smt (z3) add.commute add_leD1 add_le_mono le_add1 le_add_diff_inverse2 mult_Suc_right nat_1_add_1 numeral_Bit0 step_n_push_size_small step_4_remaining_steps_push_small)


[STATEMENT]
lemma star_n_minus: "- star_n X = star_n (\<lambda>n. -(X n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - star_n X = star_n (\<lambda>n. - X n)
[PROOF STEP]
by (simp only: star_minus_def starfun_star_n)


[STATEMENT]
lemma circline_type_neg_card_gt3:
  assumes "circline_type H < 0"
  shows "\<exists> A B C. A \<noteq> B \<and> A \<noteq> C \<and> B \<noteq> C \<and> {A, B, C} \<subseteq> circline_set H"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>A B C. A \<noteq> B \<and> A \<noteq> C \<and> B \<noteq> C \<and> {A, B, C} \<subseteq> circline_set H
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>A B C. A \<noteq> B \<and> A \<noteq> C \<and> B \<noteq> C \<and> {A, B, C} \<subseteq> circline_set H
[PROOF STEP]
obtain M H' where "moebius_circline M H = H'" "circline_diag H'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>M H'. \<lbrakk>moebius_circline M H = H'; circline_diag H'\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using circline_diagonalize[of H] assms
[PROOF STATE]
proof (prove)
using this:
\<exists>M H'. moebius_circline M H = H' \<and> circline_diag H'
circline_type H < 0

goal (1 subgoal):
 1. (\<And>M H'. \<lbrakk>moebius_circline M H = H'; circline_diag H'\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
moebius_circline M H = H'
circline_diag H'

goal (1 subgoal):
 1. \<exists>A B C. A \<noteq> B \<and> A \<noteq> C \<and> B \<noteq> C \<and> {A, B, C} \<subseteq> circline_set H
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
moebius_circline M H = H'
circline_diag H'

goal (1 subgoal):
 1. \<exists>A B C. A \<noteq> B \<and> A \<noteq> C \<and> B \<noteq> C \<and> {A, B, C} \<subseteq> circline_set H
[PROOF STEP]
hence "circline_type H' < 0"
[PROOF STATE]
proof (prove)
using this:
moebius_circline M H = H'
circline_diag H'

goal (1 subgoal):
 1. circline_type H' < 0
[PROOF STEP]
using assms moebius_preserve_circline_type
[PROOF STATE]
proof (prove)
using this:
moebius_circline M H = H'
circline_diag H'
circline_type H < 0
circline_type (moebius_circline ?M ?H) = circline_type ?H

goal (1 subgoal):
 1. circline_type H' < 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
circline_type H' < 0

goal (1 subgoal):
 1. \<exists>A B C. A \<noteq> B \<and> A \<noteq> C \<and> B \<noteq> C \<and> {A, B, C} \<subseteq> circline_set H
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
moebius_circline M H = H'
circline_diag H'
circline_type H' < 0
[PROOF STEP]
obtain A B C where "A \<noteq> B" "A \<noteq> C" "B \<noteq> C" "{A, B, C} \<subseteq> circline_set H'"
[PROOF STATE]
proof (prove)
using this:
moebius_circline M H = H'
circline_diag H'
circline_type H' < 0

goal (1 subgoal):
 1. (\<And>A B C. \<lbrakk>A \<noteq> B; A \<noteq> C; B \<noteq> C; {A, B, C} \<subseteq> circline_set H'\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using circline_type_neg_card_gt3_diag[of H']
[PROOF STATE]
proof (prove)
using this:
moebius_circline M H = H'
circline_diag H'
circline_type H' < 0
\<lbrakk>circline_type H' < 0; circline_diag H'\<rbrakk> \<Longrightarrow> \<exists>A B C. A \<noteq> B \<and> A \<noteq> C \<and> B \<noteq> C \<and> {A, B, C} \<subseteq> circline_set H'

goal (1 subgoal):
 1. (\<And>A B C. \<lbrakk>A \<noteq> B; A \<noteq> C; B \<noteq> C; {A, B, C} \<subseteq> circline_set H'\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
A \<noteq> B
A \<noteq> C
B \<noteq> C
{A, B, C} \<subseteq> circline_set H'

goal (1 subgoal):
 1. \<exists>A B C. A \<noteq> B \<and> A \<noteq> C \<and> B \<noteq> C \<and> {A, B, C} \<subseteq> circline_set H
[PROOF STEP]
let ?iM = "moebius_inv M"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>A B C. A \<noteq> B \<and> A \<noteq> C \<and> B \<noteq> C \<and> {A, B, C} \<subseteq> circline_set H
[PROOF STEP]
have "moebius_circline ?iM H' = H"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. moebius_circline (moebius_inv M) H' = H
[PROOF STEP]
using \<open>moebius_circline M H = H'\<close>[symmetric]
[PROOF STATE]
proof (prove)
using this:
H' = moebius_circline M H

goal (1 subgoal):
 1. moebius_circline (moebius_inv M) H' = H
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
moebius_circline (moebius_inv M) H' = H

goal (1 subgoal):
 1. \<exists>A B C. A \<noteq> B \<and> A \<noteq> C \<and> B \<noteq> C \<and> {A, B, C} \<subseteq> circline_set H
[PROOF STEP]
let ?A = "moebius_pt ?iM A" and ?B= "moebius_pt ?iM B" and ?C = "moebius_pt ?iM C"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>A B C. A \<noteq> B \<and> A \<noteq> C \<and> B \<noteq> C \<and> {A, B, C} \<subseteq> circline_set H
[PROOF STEP]
have "?A \<in> circline_set H"  "?B \<in> circline_set H"  "?C \<in> circline_set H"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. moebius_pt (moebius_inv M) A \<in> circline_set H &&& moebius_pt (moebius_inv M) B \<in> circline_set H &&& moebius_pt (moebius_inv M) C \<in> circline_set H
[PROOF STEP]
using \<open>moebius_circline ?iM H' = H\<close>[symmetric] \<open>{A, B, C} \<subseteq> circline_set H'\<close>
[PROOF STATE]
proof (prove)
using this:
H = moebius_circline (moebius_inv M) H'
{A, B, C} \<subseteq> circline_set H'

goal (1 subgoal):
 1. moebius_pt (moebius_inv M) A \<in> circline_set H &&& moebius_pt (moebius_inv M) B \<in> circline_set H &&& moebius_pt (moebius_inv M) C \<in> circline_set H
[PROOF STEP]
by simp_all
[PROOF STATE]
proof (state)
this:
moebius_pt (moebius_inv M) A \<in> circline_set H
moebius_pt (moebius_inv M) B \<in> circline_set H
moebius_pt (moebius_inv M) C \<in> circline_set H

goal (1 subgoal):
 1. \<exists>A B C. A \<noteq> B \<and> A \<noteq> C \<and> B \<noteq> C \<and> {A, B, C} \<subseteq> circline_set H
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
moebius_pt (moebius_inv M) A \<in> circline_set H
moebius_pt (moebius_inv M) B \<in> circline_set H
moebius_pt (moebius_inv M) C \<in> circline_set H

goal (1 subgoal):
 1. \<exists>A B C. A \<noteq> B \<and> A \<noteq> C \<and> B \<noteq> C \<and> {A, B, C} \<subseteq> circline_set H
[PROOF STEP]
have "?A \<noteq> ?B" "?A \<noteq> ?C" "?B \<noteq> ?C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. moebius_pt (moebius_inv M) A \<noteq> moebius_pt (moebius_inv M) B &&& moebius_pt (moebius_inv M) A \<noteq> moebius_pt (moebius_inv M) C &&& moebius_pt (moebius_inv M) B \<noteq> moebius_pt (moebius_inv M) C
[PROOF STEP]
using \<open>A \<noteq> B\<close> \<open>A \<noteq> C\<close> \<open>B \<noteq> C\<close>
[PROOF STATE]
proof (prove)
using this:
A \<noteq> B
A \<noteq> C
B \<noteq> C

goal (1 subgoal):
 1. moebius_pt (moebius_inv M) A \<noteq> moebius_pt (moebius_inv M) B &&& moebius_pt (moebius_inv M) A \<noteq> moebius_pt (moebius_inv M) C &&& moebius_pt (moebius_inv M) B \<noteq> moebius_pt (moebius_inv M) C
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
moebius_pt (moebius_inv M) A \<noteq> moebius_pt (moebius_inv M) B
moebius_pt (moebius_inv M) A \<noteq> moebius_pt (moebius_inv M) C
moebius_pt (moebius_inv M) B \<noteq> moebius_pt (moebius_inv M) C

goal (1 subgoal):
 1. \<exists>A B C. A \<noteq> B \<and> A \<noteq> C \<and> B \<noteq> C \<and> {A, B, C} \<subseteq> circline_set H
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
moebius_pt (moebius_inv M) A \<in> circline_set H
moebius_pt (moebius_inv M) B \<in> circline_set H
moebius_pt (moebius_inv M) C \<in> circline_set H
moebius_pt (moebius_inv M) A \<noteq> moebius_pt (moebius_inv M) B
moebius_pt (moebius_inv M) A \<noteq> moebius_pt (moebius_inv M) C
moebius_pt (moebius_inv M) B \<noteq> moebius_pt (moebius_inv M) C
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
moebius_pt (moebius_inv M) A \<in> circline_set H
moebius_pt (moebius_inv M) B \<in> circline_set H
moebius_pt (moebius_inv M) C \<in> circline_set H
moebius_pt (moebius_inv M) A \<noteq> moebius_pt (moebius_inv M) B
moebius_pt (moebius_inv M) A \<noteq> moebius_pt (moebius_inv M) C
moebius_pt (moebius_inv M) B \<noteq> moebius_pt (moebius_inv M) C

goal (1 subgoal):
 1. \<exists>A B C. A \<noteq> B \<and> A \<noteq> C \<and> B \<noteq> C \<and> {A, B, C} \<subseteq> circline_set H
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>A B C. A \<noteq> B \<and> A \<noteq> C \<and> B \<noteq> C \<and> {A, B, C} \<subseteq> circline_set H

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma image_image_id_if[simp]: "(\<And>x. f(f x) = x) \<Longrightarrow> f ` f ` M = M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>x. f (f x) = x) \<Longrightarrow> f ` f ` M = M
[PROOF STEP]
by (auto simp: image_iff)


[STATEMENT]
lemma space_restrict_space2 [simp]: "\<Omega> \<in> sets M \<Longrightarrow> space (restrict_space M \<Omega>) = \<Omega>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Omega> \<in> sets M \<Longrightarrow> space (restrict_space M \<Omega>) = \<Omega>
[PROOF STEP]
by (simp add: space_restrict_space sets.sets_into_space)


[STATEMENT]
lemma integral_inner_left[simp]: "(c \<noteq> 0 \<Longrightarrow> integrable M f) \<Longrightarrow> (\<integral> x. f x \<bullet> c \<partial>M) = integral\<^sup>L M f \<bullet> c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (c \<noteq> (0::'a) \<Longrightarrow> integrable M f) \<Longrightarrow> LINT x|M. f x \<bullet> c = integral\<^sup>L M f \<bullet> c
[PROOF STEP]
by (intro has_bochner_integral_integral_eq has_bochner_integral_integrable has_bochner_integral_inner_left)


[STATEMENT]
lemma f_range_on_V_axiom_on_rationalizes_on:
  assumes "f_range_on A f"
  assumes "V_axiom_on A f"
  shows "rationalizes_on A f (rwp_on A f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rationalizes_on A f (rwp_on A f)
[PROOF STEP]
using %invisible assms rwp_on_Field[OF assms(1)]
[PROOF STATE]
proof (prove)
using this:
f_range_on A f
V_axiom_on A f
Field (rwp_on A f) \<subseteq> A

goal (1 subgoal):
 1. rationalizes_on A f (rwp_on A f)
[PROOF STEP]
unfolding V_axiom_on_def rationalizes_on_def greatest_def f_range_on_def rwp_on_def
[PROOF STATE]
proof (prove)
using this:
\<forall>B\<subseteq>A. f B \<subseteq> B
\<forall>B\<subseteq>A. \<forall>y\<in>B. (\<forall>x\<in>B. (x, y) \<in> {(x, y). \<exists>B\<subseteq>A. x \<in> B \<and> y \<in> f B}) \<longrightarrow> y \<in> f B
Field {(x, y). \<exists>B\<subseteq>A. x \<in> B \<and> y \<in> f B} \<subseteq> A

goal (1 subgoal):
 1. \<forall>B\<subseteq>A. f B = {x \<in> B. \<forall>y\<in>B. (y, x) \<in> {(x, y). \<exists>B\<subseteq>A. x \<in> B \<and> y \<in> f B}}
[PROOF STEP]
by auto


[STATEMENT]
lemma invariant3pI: "(\<And>s tl s'. \<lbrakk> s \<in> I; r s tl s' \<rbrakk> \<Longrightarrow> s' \<in> I) \<Longrightarrow> invariant3p r I"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>s tl s'. \<lbrakk>s \<in> I; r s tl s'\<rbrakk> \<Longrightarrow> s' \<in> I) \<Longrightarrow> invariant3p r I
[PROOF STEP]
unfolding invariant3p_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>s tl s'. \<lbrakk>s \<in> I; r s tl s'\<rbrakk> \<Longrightarrow> s' \<in> I) \<Longrightarrow> \<forall>s tl s'. s \<in> I \<longrightarrow> r s tl s' \<longrightarrow> s' \<in> I
[PROOF STEP]
by blast


[STATEMENT]
lemma islimpt_punctured: "x islimpt S = x islimpt (S-{x})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x islimpt S = x islimpt S - {x}
[PROOF STEP]
unfolding islimpt_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>T. x \<in> T \<longrightarrow> open T \<longrightarrow> (\<exists>y\<in>S. y \<in> T \<and> y \<noteq> x)) = (\<forall>T. x \<in> T \<longrightarrow> open T \<longrightarrow> (\<exists>y\<in>S - {x}. y \<in> T \<and> y \<noteq> x))
[PROOF STEP]
by blast


[STATEMENT]
lemma inorder_baliR:
  "inorder(baliR l a r) = inorder l @ a # inorder r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Tree2.inorder (baliR l a r) = Tree2.inorder l @ a # Tree2.inorder r
[PROOF STEP]
by(cases "(l,a,r)" rule: baliR.cases) (auto)


[STATEMENT]
lemma cong3_symmetry:
  assumes "A B C Cong3 A' B' C'"
  shows "A' B' C' Cong3 A B C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A' B' C' Cong3 A B C
[PROOF STEP]
by (simp add: assms cong_3_sym)


[STATEMENT]
lemma parts_trans: "\<lbrakk> X\<in> parts G;  G \<subseteq> parts H \<rbrakk> \<Longrightarrow> X\<in> parts H"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>X \<in> parts G; G \<subseteq> parts H\<rbrakk> \<Longrightarrow> X \<in> parts H
[PROOF STEP]
by (drule parts_mono, blast)


[STATEMENT]
lemma absn_subst: "((Abs^^n) s)[t/k] = (Abs^^n) (s[liftn n t 0/k+n])"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (Abs ^^ n) s[t/k] = (Abs ^^ n) (s[liftn n t 0/k + n])
[PROOF STEP]
by (induction n arbitrary: t k) (simp_all add: liftn_lift_swap)


[STATEMENT]
lemma wqo_on_multisets:
  assumes "wqo_on P A"
  shows "wqo_on (mulex_on P A)\<^sup>=\<^sup>= (multisets A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wqo_on (mulex_on P A)\<^sup>=\<^sup>= (multisets A)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. transp_on (mulex_on P A)\<^sup>=\<^sup>= (multisets A)
 2. almost_full_on (mulex_on P A)\<^sup>=\<^sup>= (multisets A)
[PROOF STEP]
from transp_on_mulex_on [of P A "multisets A"]
[PROOF STATE]
proof (chain)
picking this:
transp_on (mulex_on P A) (multisets A)
[PROOF STEP]
show "transp_on (mulex_on P A)\<^sup>=\<^sup>= (multisets A)"
[PROOF STATE]
proof (prove)
using this:
transp_on (mulex_on P A) (multisets A)

goal (1 subgoal):
 1. transp_on (mulex_on P A)\<^sup>=\<^sup>= (multisets A)
[PROOF STEP]
unfolding transp_on_def
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>multisets A. \<forall>y\<in>multisets A. \<forall>z\<in>multisets A. mulex_on P A x y \<and> mulex_on P A y z \<longrightarrow> mulex_on P A x z

goal (1 subgoal):
 1. \<forall>x\<in>multisets A. \<forall>y\<in>multisets A. \<forall>z\<in>multisets A. (mulex_on P A)\<^sup>=\<^sup>= x y \<and> (mulex_on P A)\<^sup>=\<^sup>= y z \<longrightarrow> (mulex_on P A)\<^sup>=\<^sup>= x z
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
transp_on (mulex_on P A)\<^sup>=\<^sup>= (multisets A)

goal (1 subgoal):
 1. almost_full_on (mulex_on P A)\<^sup>=\<^sup>= (multisets A)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. almost_full_on (mulex_on P A)\<^sup>=\<^sup>= (multisets A)
[PROOF STEP]
from almost_full_on_multisets [OF assms [THEN wqo_on_imp_almost_full_on]]
[PROOF STATE]
proof (chain)
picking this:
almost_full_on (mulex_on P A)\<^sup>=\<^sup>= (multisets A)
[PROOF STEP]
show "almost_full_on (mulex_on P A)\<^sup>=\<^sup>= (multisets A)"
[PROOF STATE]
proof (prove)
using this:
almost_full_on (mulex_on P A)\<^sup>=\<^sup>= (multisets A)

goal (1 subgoal):
 1. almost_full_on (mulex_on P A)\<^sup>=\<^sup>= (multisets A)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
almost_full_on (mulex_on P A)\<^sup>=\<^sup>= (multisets A)

goal:
No subgoals!
[PROOF STEP]
qed