[STATEMENT]
lemma apply_cltn2_abs:
  assumes "x \<noteq> 0" and "invertible A"
  shows "apply_cltn2 (proj2_abs x) (cltn2_abs A) = proj2_abs (x v* A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. apply_cltn2 (proj2_abs x) (cltn2_abs A) = proj2_abs (x v* A)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. apply_cltn2 (proj2_abs x) (cltn2_abs A) = proj2_abs (x v* A)
[PROOF STEP]
from proj2_rep_abs2 and \<open>x \<noteq> 0\<close>
[PROOF STATE]
proof (chain)
picking this:
?v \<noteq> 0 \<Longrightarrow> \<exists>k. k \<noteq> 0 \<and> proj2_rep (proj2_abs ?v) = k *\<^sub>R ?v
x \<noteq> 0
[PROOF STEP]
obtain k where "k \<noteq> 0" and "proj2_rep (proj2_abs x) = k *\<^sub>R x"
[PROOF STATE]
proof (prove)
using this:
?v \<noteq> 0 \<Longrightarrow> \<exists>k. k \<noteq> 0 \<and> proj2_rep (proj2_abs ?v) = k *\<^sub>R ?v
x \<noteq> 0

goal (1 subgoal):
 1. (\<And>k. \<lbrakk>k \<noteq> 0; proj2_rep (proj2_abs x) = k *\<^sub>R x\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
k \<noteq> 0
proj2_rep (proj2_abs x) = k *\<^sub>R x

goal (1 subgoal):
 1. apply_cltn2 (proj2_abs x) (cltn2_abs A) = proj2_abs (x v* A)
[PROOF STEP]
from cltn2_rep_abs2 and \<open>invertible A\<close>
[PROOF STATE]
proof (chain)
picking this:
invertible ?A \<Longrightarrow> \<exists>k. k \<noteq> 0 \<and> cltn2_rep (cltn2_abs ?A) = k *\<^sub>R ?A
invertible A
[PROOF STEP]
obtain c where "c \<noteq> 0" and "cltn2_rep (cltn2_abs A) = c *\<^sub>R A"
[PROOF STATE]
proof (prove)
using this:
invertible ?A \<Longrightarrow> \<exists>k. k \<noteq> 0 \<and> cltn2_rep (cltn2_abs ?A) = k *\<^sub>R ?A
invertible A

goal (1 subgoal):
 1. (\<And>c. \<lbrakk>c \<noteq> 0; cltn2_rep (cltn2_abs A) = c *\<^sub>R A\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
c \<noteq> 0
cltn2_rep (cltn2_abs A) = c *\<^sub>R A

goal (1 subgoal):
 1. apply_cltn2 (proj2_abs x) (cltn2_abs A) = proj2_abs (x v* A)
[PROOF STEP]
from \<open>k \<noteq> 0\<close> and \<open>c \<noteq> 0\<close>
[PROOF STATE]
proof (chain)
picking this:
k \<noteq> 0
c \<noteq> 0
[PROOF STEP]
have "k * c \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
k \<noteq> 0
c \<noteq> 0

goal (1 subgoal):
 1. k * c \<noteq> 0
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
k * c \<noteq> 0

goal (1 subgoal):
 1. apply_cltn2 (proj2_abs x) (cltn2_abs A) = proj2_abs (x v* A)
[PROOF STEP]
from \<open>proj2_rep (proj2_abs x) = k *\<^sub>R x\<close> and \<open>cltn2_rep (cltn2_abs A) = c *\<^sub>R A\<close>
[PROOF STATE]
proof (chain)
picking this:
proj2_rep (proj2_abs x) = k *\<^sub>R x
cltn2_rep (cltn2_abs A) = c *\<^sub>R A
[PROOF STEP]
have "proj2_rep (proj2_abs x) v* cltn2_rep (cltn2_abs A) = (k*c) *\<^sub>R (x v* A)"
[PROOF STATE]
proof (prove)
using this:
proj2_rep (proj2_abs x) = k *\<^sub>R x
cltn2_rep (cltn2_abs A) = c *\<^sub>R A

goal (1 subgoal):
 1. proj2_rep (proj2_abs x) v* cltn2_rep (cltn2_abs A) = (k * c) *\<^sub>R (x v* A)
[PROOF STEP]
by (simp add: scaleR_vector_matrix_assoc vector_scaleR_matrix_ac)
[PROOF STATE]
proof (state)
this:
proj2_rep (proj2_abs x) v* cltn2_rep (cltn2_abs A) = (k * c) *\<^sub>R (x v* A)

goal (1 subgoal):
 1. apply_cltn2 (proj2_abs x) (cltn2_abs A) = proj2_abs (x v* A)
[PROOF STEP]
with \<open>k * c \<noteq> 0\<close>
[PROOF STATE]
proof (chain)
picking this:
k * c \<noteq> 0
proj2_rep (proj2_abs x) v* cltn2_rep (cltn2_abs A) = (k * c) *\<^sub>R (x v* A)
[PROOF STEP]
show "apply_cltn2 (proj2_abs x) (cltn2_abs A) = proj2_abs (x v* A)"
[PROOF STATE]
proof (prove)
using this:
k * c \<noteq> 0
proj2_rep (proj2_abs x) v* cltn2_rep (cltn2_abs A) = (k * c) *\<^sub>R (x v* A)

goal (1 subgoal):
 1. apply_cltn2 (proj2_abs x) (cltn2_abs A) = proj2_abs (x v* A)
[PROOF STEP]
unfolding apply_cltn2_def
[PROOF STATE]
proof (prove)
using this:
k * c \<noteq> 0
proj2_rep (proj2_abs x) v* cltn2_rep (cltn2_abs A) = (k * c) *\<^sub>R (x v* A)

goal (1 subgoal):
 1. proj2_abs (proj2_rep (proj2_abs x) v* cltn2_rep (cltn2_abs A)) = proj2_abs (x v* A)
[PROOF STEP]
by (simp add: proj2_abs_mult)
[PROOF STATE]
proof (state)
this:
apply_cltn2 (proj2_abs x) (cltn2_abs A) = proj2_abs (x v* A)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma eigenvalue_imp_nonzero_dim: assumes "A \<in> carrier_mat n n"
  and "eigenvalue A ev"
  shows "n > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < n
[PROOF STEP]
proof (cases n)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. n = 0 \<Longrightarrow> 0 < n
 2. \<And>nat. n = Suc nat \<Longrightarrow> 0 < n
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:
n = 0

goal (2 subgoals):
 1. n = 0 \<Longrightarrow> 0 < n
 2. \<And>nat. n = Suc nat \<Longrightarrow> 0 < n
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
A \<in> carrier_mat n n
eigenvalue A ev
[PROOF STEP]
obtain v where "eigenvector A v ev"
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat n n
eigenvalue A ev

goal (1 subgoal):
 1. (\<And>v. eigenvector A v ev \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding eigenvalue_def
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat n n
\<exists>v. eigenvector A v ev

goal (1 subgoal):
 1. (\<And>v. eigenvector A v ev \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
eigenvector A v ev

goal (2 subgoals):
 1. n = 0 \<Longrightarrow> 0 < n
 2. \<And>nat. n = Suc nat \<Longrightarrow> 0 < n
[PROOF STEP]
from this[unfolded eigenvector_def] assms 0
[PROOF STATE]
proof (chain)
picking this:
v \<in> carrier_vec (dim_row A) \<and> v \<noteq> 0\<^sub>v (dim_row A) \<and> A *\<^sub>v v = ev \<cdot>\<^sub>v v
A \<in> carrier_mat n n
eigenvalue A ev
n = 0
[PROOF STEP]
have "v \<in> carrier_vec 0" "v \<noteq> 0\<^sub>v 0"
[PROOF STATE]
proof (prove)
using this:
v \<in> carrier_vec (dim_row A) \<and> v \<noteq> 0\<^sub>v (dim_row A) \<and> A *\<^sub>v v = ev \<cdot>\<^sub>v v
A \<in> carrier_mat n n
eigenvalue A ev
n = 0

goal (1 subgoal):
 1. v \<in> carrier_vec 0 &&& v \<noteq> 0\<^sub>v 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
v \<in> carrier_vec 0
v \<noteq> 0\<^sub>v 0

goal (2 subgoals):
 1. n = 0 \<Longrightarrow> 0 < n
 2. \<And>nat. n = Suc nat \<Longrightarrow> 0 < n
[PROOF STEP]
hence False
[PROOF STATE]
proof (prove)
using this:
v \<in> carrier_vec 0
v \<noteq> 0\<^sub>v 0

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

goal (2 subgoals):
 1. n = 0 \<Longrightarrow> 0 < n
 2. \<And>nat. n = Suc nat \<Longrightarrow> 0 < n
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
False

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

goal (1 subgoal):
 1. \<And>nat. n = Suc nat \<Longrightarrow> 0 < n
[PROOF STEP]
qed simp


[STATEMENT]
lemma union_list_language[simp]:
    assumes "\<Inter> (dca.alphabet ` set AA) = \<Union> (dca.alphabet ` set AA)"
    shows "DCA.language (union_list AA) = \<Union> (DCA.language ` set AA)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. DCA.language (union_list AA) = \<Union> (DCA.language ` set AA)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<Inter> (dca.alphabet ` set AA) = \<Union> (dca.alphabet ` set AA)

goal (1 subgoal):
 1. DCA.language (union_list AA) = \<Union> (DCA.language ` set AA)
[PROOF STEP]
by simp


[STATEMENT]
lemma isCont_If_ge:
  fixes a :: "'a :: linorder_topology"
  assumes "continuous (at_left a) g" and f: "(f \<longlongrightarrow> g a) (at_right a)"
  shows "isCont (\<lambda>x. if x \<le> a then g x else f x) a" (is "isCont ?gf a")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. isCont (\<lambda>x. if x \<le> a then g x else f x) a
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. isCont (\<lambda>x. if x \<le> a then g x else f x) a
[PROOF STEP]
have g: "(g \<longlongrightarrow> g a) (at_left a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (g \<longlongrightarrow> g a) (at_left a)
[PROOF STEP]
using assms continuous_within
[PROOF STATE]
proof (prove)
using this:
continuous (at_left a) g
(f \<longlongrightarrow> g a) (at_right a)
continuous (at ?x within ?s) ?f = (?f \<longlongrightarrow> ?f ?x) (at ?x within ?s)

goal (1 subgoal):
 1. (g \<longlongrightarrow> g a) (at_left a)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(g \<longlongrightarrow> g a) (at_left a)

goal (1 subgoal):
 1. isCont (\<lambda>x. if x \<le> a then g x else f x) a
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. isCont (\<lambda>x. if x \<le> a then g x else f x) a
[PROOF STEP]
unfolding isCont_def continuous_within
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. if x \<le> a then g x else f x) \<midarrow>a\<rightarrow> (if a \<le> a then g a else f a)
[PROOF STEP]
proof (intro filterlim_split_at; simp)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. ((\<lambda>x. if x \<le> a then g x else f x) \<longlongrightarrow> g a) (at_left a)
 2. ((\<lambda>x. if x \<le> a then g x else f x) \<longlongrightarrow> g a) (at_right a)
[PROOF STEP]
show "(?gf \<longlongrightarrow> g a) (at_left a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. if x \<le> a then g x else f x) \<longlongrightarrow> g a) (at_left a)
[PROOF STEP]
by (subst filterlim_cong[OF refl refl, where g=g]) (simp_all add: eventually_at_filter less_le g)
[PROOF STATE]
proof (state)
this:
((\<lambda>x. if x \<le> a then g x else f x) \<longlongrightarrow> g a) (at_left a)

goal (1 subgoal):
 1. ((\<lambda>x. if x \<le> a then g x else f x) \<longlongrightarrow> g a) (at_right a)
[PROOF STEP]
show "(?gf \<longlongrightarrow> g a) (at_right a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. if x \<le> a then g x else f x) \<longlongrightarrow> g a) (at_right a)
[PROOF STEP]
by (subst filterlim_cong[OF refl refl, where g=f]) (simp_all add: eventually_at_filter less_le f)
[PROOF STATE]
proof (state)
this:
((\<lambda>x. if x \<le> a then g x else f x) \<longlongrightarrow> g a) (at_right a)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
isCont (\<lambda>x. if x \<le> a then g x else f x) a

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma zero_not_in_nonzero:
"\<zero>\<^bsub>R\<^esub> \<notin> nonzero R"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<zero>\<^bsub>R\<^esub> \<notin> nonzero R
[PROOF STEP]
unfolding nonzero_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<zero>\<^bsub>R\<^esub> \<notin> {a \<in> carrier R. a \<noteq> \<zero>\<^bsub>R\<^esub>}
[PROOF STEP]
by blast


[STATEMENT]
lemma separating_UNIV[simp]: \<open>separating TYPE(_) UNIV\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. separating TYPE('a) UNIV
[PROOF STEP]
unfolding separating_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>F G. clinear F \<longrightarrow> clinear G \<longrightarrow> (\<forall>x\<in>UNIV. F x = G x) \<longrightarrow> F = G
[PROOF STEP]
by auto


[STATEMENT]
lemma sorted_is_sorted_list_of_set:
  assumes "is_sorted_list_of_set A xs"
  shows "sorted(xs)" and "distinct(xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sorted xs &&& distinct xs
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
is_sorted_list_of_set A xs

goal (1 subgoal):
 1. sorted xs &&& distinct xs
[PROOF STEP]
proof (induct xs arbitrary: A)
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. \<And>A. is_sorted_list_of_set A [] \<Longrightarrow> sorted []
 2. \<And>A. is_sorted_list_of_set A [] \<Longrightarrow> distinct []
 3. \<And>a xs A. \<lbrakk>\<And>A. is_sorted_list_of_set A xs \<Longrightarrow> sorted xs; \<And>A. is_sorted_list_of_set A xs \<Longrightarrow> distinct xs; is_sorted_list_of_set A (a # xs)\<rbrakk> \<Longrightarrow> sorted (a # xs)
 4. \<And>a xs A. \<lbrakk>\<And>A. is_sorted_list_of_set A xs \<Longrightarrow> sorted xs; \<And>A. is_sorted_list_of_set A xs \<Longrightarrow> distinct xs; is_sorted_list_of_set A (a # xs)\<rbrakk> \<Longrightarrow> distinct (a # xs)
[PROOF STEP]
show "sorted []"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sorted []
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
sorted []

goal (3 subgoals):
 1. \<And>A. is_sorted_list_of_set A [] \<Longrightarrow> distinct []
 2. \<And>a xs A. \<lbrakk>\<And>A. is_sorted_list_of_set A xs \<Longrightarrow> sorted xs; \<And>A. is_sorted_list_of_set A xs \<Longrightarrow> distinct xs; is_sorted_list_of_set A (a # xs)\<rbrakk> \<Longrightarrow> sorted (a # xs)
 3. \<And>a xs A. \<lbrakk>\<And>A. is_sorted_list_of_set A xs \<Longrightarrow> sorted xs; \<And>A. is_sorted_list_of_set A xs \<Longrightarrow> distinct xs; is_sorted_list_of_set A (a # xs)\<rbrakk> \<Longrightarrow> distinct (a # xs)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>A. is_sorted_list_of_set A [] \<Longrightarrow> distinct []
 2. \<And>a xs A. \<lbrakk>\<And>A. is_sorted_list_of_set A xs \<Longrightarrow> sorted xs; \<And>A. is_sorted_list_of_set A xs \<Longrightarrow> distinct xs; is_sorted_list_of_set A (a # xs)\<rbrakk> \<Longrightarrow> sorted (a # xs)
 3. \<And>a xs A. \<lbrakk>\<And>A. is_sorted_list_of_set A xs \<Longrightarrow> sorted xs; \<And>A. is_sorted_list_of_set A xs \<Longrightarrow> distinct xs; is_sorted_list_of_set A (a # xs)\<rbrakk> \<Longrightarrow> distinct (a # xs)
[PROOF STEP]
show "distinct []"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distinct []
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
distinct []

goal (2 subgoals):
 1. \<And>a xs A. \<lbrakk>\<And>A. is_sorted_list_of_set A xs \<Longrightarrow> sorted xs; \<And>A. is_sorted_list_of_set A xs \<Longrightarrow> distinct xs; is_sorted_list_of_set A (a # xs)\<rbrakk> \<Longrightarrow> sorted (a # xs)
 2. \<And>a xs A. \<lbrakk>\<And>A. is_sorted_list_of_set A xs \<Longrightarrow> sorted xs; \<And>A. is_sorted_list_of_set A xs \<Longrightarrow> distinct xs; is_sorted_list_of_set A (a # xs)\<rbrakk> \<Longrightarrow> distinct (a # xs)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>a xs A. \<lbrakk>\<And>A. is_sorted_list_of_set A xs \<Longrightarrow> sorted xs; \<And>A. is_sorted_list_of_set A xs \<Longrightarrow> distinct xs; is_sorted_list_of_set A (a # xs)\<rbrakk> \<Longrightarrow> sorted (a # xs)
 2. \<And>a xs A. \<lbrakk>\<And>A. is_sorted_list_of_set A xs \<Longrightarrow> sorted xs; \<And>A. is_sorted_list_of_set A xs \<Longrightarrow> distinct xs; is_sorted_list_of_set A (a # xs)\<rbrakk> \<Longrightarrow> distinct (a # xs)
[PROOF STEP]
fix A :: "'a set"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>a xs A. \<lbrakk>\<And>A. is_sorted_list_of_set A xs \<Longrightarrow> sorted xs; \<And>A. is_sorted_list_of_set A xs \<Longrightarrow> distinct xs; is_sorted_list_of_set A (a # xs)\<rbrakk> \<Longrightarrow> sorted (a # xs)
 2. \<And>a xs A. \<lbrakk>\<And>A. is_sorted_list_of_set A xs \<Longrightarrow> sorted xs; \<And>A. is_sorted_list_of_set A xs \<Longrightarrow> distinct xs; is_sorted_list_of_set A (a # xs)\<rbrakk> \<Longrightarrow> distinct (a # xs)
[PROOF STEP]
case (Cons x xs)
[PROOF STATE]
proof (state)
this:
is_sorted_list_of_set ?A xs \<Longrightarrow> sorted xs
is_sorted_list_of_set ?A xs \<Longrightarrow> distinct xs

goal (2 subgoals):
 1. \<And>a xs A. \<lbrakk>\<And>A. is_sorted_list_of_set A xs \<Longrightarrow> sorted xs; \<And>A. is_sorted_list_of_set A xs \<Longrightarrow> distinct xs; is_sorted_list_of_set A (a # xs)\<rbrakk> \<Longrightarrow> sorted (a # xs)
 2. \<And>a xs A. \<lbrakk>\<And>A. is_sorted_list_of_set A xs \<Longrightarrow> sorted xs; \<And>A. is_sorted_list_of_set A xs \<Longrightarrow> distinct xs; is_sorted_list_of_set A (a # xs)\<rbrakk> \<Longrightarrow> distinct (a # xs)
[PROOF STEP]
note hyps = this
[PROOF STATE]
proof (state)
this:
is_sorted_list_of_set ?A xs \<Longrightarrow> sorted xs
is_sorted_list_of_set ?A xs \<Longrightarrow> distinct xs

goal (2 subgoals):
 1. \<And>a xs A. \<lbrakk>\<And>A. is_sorted_list_of_set A xs \<Longrightarrow> sorted xs; \<And>A. is_sorted_list_of_set A xs \<Longrightarrow> distinct xs; is_sorted_list_of_set A (a # xs)\<rbrakk> \<Longrightarrow> sorted (a # xs)
 2. \<And>a xs A. \<lbrakk>\<And>A. is_sorted_list_of_set A xs \<Longrightarrow> sorted xs; \<And>A. is_sorted_list_of_set A xs \<Longrightarrow> distinct xs; is_sorted_list_of_set A (a # xs)\<rbrakk> \<Longrightarrow> distinct (a # xs)
[PROOF STEP]
assume isl: "is_sorted_list_of_set A (x # xs)"
[PROOF STATE]
proof (state)
this:
is_sorted_list_of_set A (x # xs)

goal (2 subgoals):
 1. \<And>a xs A. \<lbrakk>\<And>A. is_sorted_list_of_set A xs \<Longrightarrow> sorted xs; \<And>A. is_sorted_list_of_set A xs \<Longrightarrow> distinct xs; is_sorted_list_of_set A (a # xs)\<rbrakk> \<Longrightarrow> sorted (a # xs)
 2. \<And>a xs A. \<lbrakk>\<And>A. is_sorted_list_of_set A xs \<Longrightarrow> sorted xs; \<And>A. is_sorted_list_of_set A xs \<Longrightarrow> distinct xs; is_sorted_list_of_set A (a # xs)\<rbrakk> \<Longrightarrow> distinct (a # xs)
[PROOF STEP]
hence srt: "(\<forall>i<length xs - Suc 0. xs ! i < xs ! Suc i)"
[PROOF STATE]
proof (prove)
using this:
is_sorted_list_of_set A (x # xs)

goal (1 subgoal):
 1. \<forall>i<length xs - Suc 0. xs ! i < xs ! Suc i
[PROOF STEP]
using less_diff_conv
[PROOF STATE]
proof (prove)
using this:
is_sorted_list_of_set A (x # xs)
(?i < ?j - ?k) = (?i + ?k < ?j)

goal (1 subgoal):
 1. \<forall>i<length xs - Suc 0. xs ! i < xs ! Suc i
[PROOF STEP]
by (auto simp add: is_sorted_list_of_set_def)
[PROOF STATE]
proof (state)
this:
\<forall>i<length xs - Suc 0. xs ! i < xs ! Suc i

goal (2 subgoals):
 1. \<And>a xs A. \<lbrakk>\<And>A. is_sorted_list_of_set A xs \<Longrightarrow> sorted xs; \<And>A. is_sorted_list_of_set A xs \<Longrightarrow> distinct xs; is_sorted_list_of_set A (a # xs)\<rbrakk> \<Longrightarrow> sorted (a # xs)
 2. \<And>a xs A. \<lbrakk>\<And>A. is_sorted_list_of_set A xs \<Longrightarrow> sorted xs; \<And>A. is_sorted_list_of_set A xs \<Longrightarrow> distinct xs; is_sorted_list_of_set A (a # xs)\<rbrakk> \<Longrightarrow> distinct (a # xs)
[PROOF STEP]
with hyps(1)
[PROOF STATE]
proof (chain)
picking this:
is_sorted_list_of_set ?A xs \<Longrightarrow> sorted xs
\<forall>i<length xs - Suc 0. xs ! i < xs ! Suc i
[PROOF STEP]
have srtd: "sorted xs"
[PROOF STATE]
proof (prove)
using this:
is_sorted_list_of_set ?A xs \<Longrightarrow> sorted xs
\<forall>i<length xs - Suc 0. xs ! i < xs ! Suc i

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

goal (2 subgoals):
 1. \<And>a xs A. \<lbrakk>\<And>A. is_sorted_list_of_set A xs \<Longrightarrow> sorted xs; \<And>A. is_sorted_list_of_set A xs \<Longrightarrow> distinct xs; is_sorted_list_of_set A (a # xs)\<rbrakk> \<Longrightarrow> sorted (a # xs)
 2. \<And>a xs A. \<lbrakk>\<And>A. is_sorted_list_of_set A xs \<Longrightarrow> sorted xs; \<And>A. is_sorted_list_of_set A xs \<Longrightarrow> distinct xs; is_sorted_list_of_set A (a # xs)\<rbrakk> \<Longrightarrow> distinct (a # xs)
[PROOF STEP]
with isl
[PROOF STATE]
proof (chain)
picking this:
is_sorted_list_of_set A (x # xs)
sorted xs
[PROOF STEP]
show "sorted (x # xs)"
[PROOF STATE]
proof (prove)
using this:
is_sorted_list_of_set A (x # xs)
sorted xs

goal (1 subgoal):
 1. sorted (x # xs)
[PROOF STEP]
apply (auto simp add: is_sorted_list_of_set_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>xa. \<lbrakk>sorted xs; xa \<in> set xs; \<forall>i<length xs. (x # xs) ! i < xs ! i; A = insert x (set xs)\<rbrakk> \<Longrightarrow> x \<le> xa
[PROOF STEP]
apply (metis (mono_tags, lifting) all_nth_imp_all_set less_le_trans linorder_not_less not_less_iff_gr_or_eq nth_Cons_0 sorted_iff_nth_mono zero_order(3))
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
sorted (x # xs)

goal (1 subgoal):
 1. \<And>a xs A. \<lbrakk>\<And>A. is_sorted_list_of_set A xs \<Longrightarrow> sorted xs; \<And>A. is_sorted_list_of_set A xs \<Longrightarrow> distinct xs; is_sorted_list_of_set A (a # xs)\<rbrakk> \<Longrightarrow> distinct (a # xs)
[PROOF STEP]
from srt hyps(2)
[PROOF STATE]
proof (chain)
picking this:
\<forall>i<length xs - Suc 0. xs ! i < xs ! Suc i
is_sorted_list_of_set ?A xs \<Longrightarrow> distinct xs
[PROOF STEP]
have "distinct xs"
[PROOF STATE]
proof (prove)
using this:
\<forall>i<length xs - Suc 0. xs ! i < xs ! Suc i
is_sorted_list_of_set ?A xs \<Longrightarrow> distinct xs

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

goal (1 subgoal):
 1. \<And>a xs A. \<lbrakk>\<And>A. is_sorted_list_of_set A xs \<Longrightarrow> sorted xs; \<And>A. is_sorted_list_of_set A xs \<Longrightarrow> distinct xs; is_sorted_list_of_set A (a # xs)\<rbrakk> \<Longrightarrow> distinct (a # xs)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
distinct xs
[PROOF STEP]
have False if "x \<in> set xs"
[PROOF STATE]
proof (prove)
using this:
distinct xs

goal (1 subgoal):
 1. False
[PROOF STEP]
using distinct_Ex1 [OF _ that] isl
[PROOF STATE]
proof (prove)
using this:
distinct xs
distinct xs \<Longrightarrow> \<exists>!i. i < length xs \<and> xs ! i = x
is_sorted_list_of_set A (x # xs)

goal (1 subgoal):
 1. False
[PROOF STEP]
unfolding is_sorted_list_of_set_def
[PROOF STATE]
proof (prove)
using this:
distinct xs
distinct xs \<Longrightarrow> \<exists>!i. i < length xs \<and> xs ! i = x
(\<forall>i<length (x # xs) - 1. (x # xs) ! i < (x # xs) ! (i + 1)) \<and> set (x # xs) = A

goal (1 subgoal):
 1. False
[PROOF STEP]
by (metis add.commute add_diff_cancel_left' leD length_Cons less_le not_gr_zero nth_Cons' plus_1_eq_Suc sorted_iff_nth_mono srtd)
[PROOF STATE]
proof (state)
this:
x \<in> set xs \<Longrightarrow> False

goal (1 subgoal):
 1. \<And>a xs A. \<lbrakk>\<And>A. is_sorted_list_of_set A xs \<Longrightarrow> sorted xs; \<And>A. is_sorted_list_of_set A xs \<Longrightarrow> distinct xs; is_sorted_list_of_set A (a # xs)\<rbrakk> \<Longrightarrow> distinct (a # xs)
[PROOF STEP]
with isl \<open>distinct xs\<close>
[PROOF STATE]
proof (chain)
picking this:
is_sorted_list_of_set A (x # xs)
distinct xs
x \<in> set xs \<Longrightarrow> False
[PROOF STEP]
show "distinct (x # xs)"
[PROOF STATE]
proof (prove)
using this:
is_sorted_list_of_set A (x # xs)
distinct xs
x \<in> set xs \<Longrightarrow> False

goal (1 subgoal):
 1. distinct (x # xs)
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
distinct (x # xs)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma deg_pm_hom_components:
  assumes "q1 \<in> hom_components p" and "q2 \<in> hom_components p" and "t1 \<in> keys q1" and "t2 \<in> keys q2"
  shows "deg_pm t1 = deg_pm t2 \<longleftrightarrow> q1 = q2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (deg_pm t1 = deg_pm t2) = (q1 = q2)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (deg_pm t1 = deg_pm t2) = (q1 = q2)
[PROOF STEP]
from assms(1)
[PROOF STATE]
proof (chain)
picking this:
q1 \<in> hom_components p
[PROOF STEP]
obtain s1 where "s1 \<in> keys p" and q1: "q1 = hom_component p (deg_pm s1)"
[PROOF STATE]
proof (prove)
using this:
q1 \<in> hom_components p

goal (1 subgoal):
 1. (\<And>s1. \<lbrakk>s1 \<in> keys p; q1 = hom_component p (deg_pm s1)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (rule hom_componentsE)
[PROOF STATE]
proof (state)
this:
s1 \<in> keys p
q1 = hom_component p (deg_pm s1)

goal (1 subgoal):
 1. (deg_pm t1 = deg_pm t2) = (q1 = q2)
[PROOF STEP]
from assms(3)
[PROOF STATE]
proof (chain)
picking this:
t1 \<in> keys q1
[PROOF STEP]
have t1: "deg_pm t1 = deg_pm s1"
[PROOF STATE]
proof (prove)
using this:
t1 \<in> keys q1

goal (1 subgoal):
 1. deg_pm t1 = deg_pm s1
[PROOF STEP]
unfolding q1
[PROOF STATE]
proof (prove)
using this:
t1 \<in> keys (hom_component p (deg_pm s1))

goal (1 subgoal):
 1. deg_pm t1 = deg_pm s1
[PROOF STEP]
by (rule keys_hom_componentD)
[PROOF STATE]
proof (state)
this:
deg_pm t1 = deg_pm s1

goal (1 subgoal):
 1. (deg_pm t1 = deg_pm t2) = (q1 = q2)
[PROOF STEP]
from assms(2)
[PROOF STATE]
proof (chain)
picking this:
q2 \<in> hom_components p
[PROOF STEP]
obtain s2 where "s2 \<in> keys p" and q2: "q2 = hom_component p (deg_pm s2)"
[PROOF STATE]
proof (prove)
using this:
q2 \<in> hom_components p

goal (1 subgoal):
 1. (\<And>s2. \<lbrakk>s2 \<in> keys p; q2 = hom_component p (deg_pm s2)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (rule hom_componentsE)
[PROOF STATE]
proof (state)
this:
s2 \<in> keys p
q2 = hom_component p (deg_pm s2)

goal (1 subgoal):
 1. (deg_pm t1 = deg_pm t2) = (q1 = q2)
[PROOF STEP]
from assms(4)
[PROOF STATE]
proof (chain)
picking this:
t2 \<in> keys q2
[PROOF STEP]
have t2: "deg_pm t2 = deg_pm s2"
[PROOF STATE]
proof (prove)
using this:
t2 \<in> keys q2

goal (1 subgoal):
 1. deg_pm t2 = deg_pm s2
[PROOF STEP]
unfolding q2
[PROOF STATE]
proof (prove)
using this:
t2 \<in> keys (hom_component p (deg_pm s2))

goal (1 subgoal):
 1. deg_pm t2 = deg_pm s2
[PROOF STEP]
by (rule keys_hom_componentD)
[PROOF STATE]
proof (state)
this:
deg_pm t2 = deg_pm s2

goal (1 subgoal):
 1. (deg_pm t1 = deg_pm t2) = (q1 = q2)
[PROOF STEP]
from \<open>s1 \<in> keys p\<close>
[PROOF STATE]
proof (chain)
picking this:
s1 \<in> keys p
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
s1 \<in> keys p

goal (1 subgoal):
 1. (deg_pm t1 = deg_pm t2) = (q1 = q2)
[PROOF STEP]
by (auto simp: q1 q2 t1 t2 dest: hom_component_inject)
[PROOF STATE]
proof (state)
this:
(deg_pm t1 = deg_pm t2) = (q1 = q2)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma degree_power_eq: "p \<noteq> 0 \<Longrightarrow> degree ((p :: 'a :: idom poly) ^ n) = n * degree p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p \<noteq> 0 \<Longrightarrow> degree (p ^ n) = n * degree p
[PROOF STEP]
by (induction n) (simp_all add: degree_mult_eq)


[STATEMENT]
lemma circline_ex_line:
  assumes "A = 0" and "BC \<noteq> 0" and "cl = circline A BC D"
  shows "\<exists> z1 z2. z1 \<noteq> z2 \<and> cl = line z1 z2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>z1 z2. z1 \<noteq> z2 \<and> cl = line z1 z2
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>z1 z2. z1 \<noteq> z2 \<and> cl = line z1 z2
[PROOF STEP]
let ?z1 = "- cor D * BC / (2 * BC * cnj BC)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>z1 z2. z1 \<noteq> z2 \<and> cl = line z1 z2
[PROOF STEP]
let ?z2 = "?z1 + \<i> * sgn (if 0 < Arg BC then - BC else BC)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>z1 z2. z1 \<noteq> z2 \<and> cl = line z1 z2
[PROOF STEP]
have "?z1 \<noteq> ?z2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - cor D * BC / (2 * BC * cnj BC) \<noteq> - cor D * BC / (2 * BC * cnj BC) + \<i> * sgn (if 0 < Arg BC then - BC else BC)
[PROOF STEP]
using \<open>BC \<noteq> 0\<close>
[PROOF STATE]
proof (prove)
using this:
BC \<noteq> 0

goal (1 subgoal):
 1. - cor D * BC / (2 * BC * cnj BC) \<noteq> - cor D * BC / (2 * BC * cnj BC) + \<i> * sgn (if 0 < Arg BC then - BC else BC)
[PROOF STEP]
by (simp add: sgn_eq)
[PROOF STATE]
proof (state)
this:
- cor D * BC / (2 * BC * cnj BC) \<noteq> - cor D * BC / (2 * BC * cnj BC) + \<i> * sgn (if 0 < Arg BC then - BC else BC)

goal (1 subgoal):
 1. \<exists>z1 z2. z1 \<noteq> z2 \<and> cl = line z1 z2
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
- cor D * BC / (2 * BC * cnj BC) \<noteq> - cor D * BC / (2 * BC * cnj BC) + \<i> * sgn (if 0 < Arg BC then - BC else BC)

goal (1 subgoal):
 1. \<exists>z1 z2. z1 \<noteq> z2 \<and> cl = line z1 z2
[PROOF STEP]
using circline_line[OF assms, of ?z1 ?z2] \<open>BC \<noteq> 0\<close>
[PROOF STATE]
proof (prove)
using this:
- cor D * BC / (2 * BC * cnj BC) \<noteq> - cor D * BC / (2 * BC * cnj BC) + \<i> * sgn (if 0 < Arg BC then - BC else BC)
\<lbrakk>- cor D * BC / (2 * BC * cnj BC) = - cor D * BC / (2 * BC * cnj BC); - cor D * BC / (2 * BC * cnj BC) + \<i> * sgn (if 0 < Arg BC then - BC else BC) = - cor D * BC / (2 * BC * cnj BC) + \<i> * sgn (if 0 < Arg BC then - BC else BC)\<rbrakk> \<Longrightarrow> cl = line (- cor D * BC / (2 * BC * cnj BC)) (- cor D * BC / (2 * BC * cnj BC) + \<i> * sgn (if 0 < Arg BC then - BC else BC))
BC \<noteq> 0

goal (1 subgoal):
 1. \<exists>z1 z2. z1 \<noteq> z2 \<and> cl = line z1 z2
[PROOF STEP]
by (rule_tac x="?z1" in exI, rule_tac x="?z2" in exI, simp)
[PROOF STATE]
proof (state)
this:
\<exists>z1 z2. z1 \<noteq> z2 \<and> cl = line z1 z2

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in Finite_Graph) simplePath_length_less_V:
  assumes UIV: "u\<in>V"
  assumes P: "isSimplePath u p v"
  shows "length p < card V"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length p < card V
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. length p < card V
[PROOF STEP]
from P
[PROOF STATE]
proof (chain)
picking this:
isSimplePath u p v
[PROOF STEP]
have 1: "isPath u p v" and 2: "distinct (pathVertices u p)"
[PROOF STATE]
proof (prove)
using this:
isSimplePath u p v

goal (1 subgoal):
 1. isPath u p v &&& distinct (pathVertices u p)
[PROOF STEP]
by (auto simp: isSimplePath_def)
[PROOF STATE]
proof (state)
this:
isPath u p v
distinct (pathVertices u p)

goal (1 subgoal):
 1. length p < card V
[PROOF STEP]
from pathVertices_edgeset[OF UIV 1]
[PROOF STATE]
proof (chain)
picking this:
set (pathVertices u p) \<subseteq> V
[PROOF STEP]
have "set (pathVertices u p) \<subseteq> V"
[PROOF STATE]
proof (prove)
using this:
set (pathVertices u p) \<subseteq> V

goal (1 subgoal):
 1. set (pathVertices u p) \<subseteq> V
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
set (pathVertices u p) \<subseteq> V

goal (1 subgoal):
 1. length p < card V
[PROOF STEP]
with 2 finite_V
[PROOF STATE]
proof (chain)
picking this:
distinct (pathVertices u p)
finite V
set (pathVertices u p) \<subseteq> V
[PROOF STEP]
have "length (pathVertices u p) \<le> card V"
[PROOF STATE]
proof (prove)
using this:
distinct (pathVertices u p)
finite V
set (pathVertices u p) \<subseteq> V

goal (1 subgoal):
 1. length (pathVertices u p) \<le> card V
[PROOF STEP]
using distinct_card card_mono
[PROOF STATE]
proof (prove)
using this:
distinct (pathVertices u p)
finite V
set (pathVertices u p) \<subseteq> V
distinct ?xs \<Longrightarrow> card (set ?xs) = length ?xs
\<lbrakk>finite ?B; ?A \<subseteq> ?B\<rbrakk> \<Longrightarrow> card ?A \<le> card ?B

goal (1 subgoal):
 1. length (pathVertices u p) \<le> card V
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
length (pathVertices u p) \<le> card V

goal (1 subgoal):
 1. length p < card V
[PROOF STEP]
hence "length p + 1 \<le> card V"
[PROOF STATE]
proof (prove)
using this:
length (pathVertices u p) \<le> card V

goal (1 subgoal):
 1. length p + 1 \<le> card V
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
length p + 1 \<le> card V

goal (1 subgoal):
 1. length p < card V
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
length p + 1 \<le> card V

goal (1 subgoal):
 1. length p < card V
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
length p < card V

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma beukers_integral3_integrable:
  "set_integrable lborel D' (\<lambda>(w,x,y). (x*(1-x)*y*(1-y)*w*(1-w))^n / (1-(1-x*y)*w)^(n+1))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set_integrable lborel D' (\<lambda>(w, x, y). (x * (1 - x) * y * (1 - y) * w * (1 - w)) ^ n / (1 - (1 - x * y) * w) ^ (n + 1))
[PROOF STEP]
unfolding case_prod_unfold
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set_integrable lborel D' (\<lambda>p. (fst (snd p) * (1 - fst (snd p)) * snd (snd p) * (1 - snd (snd p)) * fst p * (1 - fst p)) ^ n / (1 - (1 - fst (snd p) * snd (snd p)) * fst p) ^ (n + 1))
[PROOF STEP]
using less_imp_le[OF beukers_denom_ineq] beukers_nn_integral3_finite
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?x1 \<in> {0<..<1}; ?y1 \<in> {0<..<1}; ?z1 \<in> {0..1}\<rbrakk> \<Longrightarrow> (1 - ?x1 * ?y1) * ?z1 \<le> 1
local.beukers_nn_integral3 < \<infinity>

goal (1 subgoal):
 1. set_integrable lborel D' (\<lambda>p. (fst (snd p) * (1 - fst (snd p)) * snd (snd p) * (1 - snd (snd p)) * fst p * (1 - fst p)) ^ n / (1 - (1 - fst (snd p) * snd (snd p)) * fst p) ^ (n + 1))
[PROOF STEP]
by (intro set_integrableI_nonneg AE_I2 impI)
     (auto simp: D'_def set_borel_measurable_def beukers_nn_integral3_def case_prod_unfold
           simp flip: lborel_prod intro!: divide_nonneg_nonneg mult_nonneg_nonneg)


[STATEMENT]
lemma cauchy_diff [simp]:
  assumes "cauchy X" "cauchy Y"
  shows "cauchy (\<lambda>n. X n - Y n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cauchy (\<lambda>n. X n - Y n)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
cauchy X
cauchy Y

goal (1 subgoal):
 1. cauchy (\<lambda>n. X n - Y n)
[PROOF STEP]
unfolding diff_conv_add_uminus
[PROOF STATE]
proof (prove)
using this:
cauchy X
cauchy Y

goal (1 subgoal):
 1. cauchy (\<lambda>n. X n + - Y n)
[PROOF STEP]
by (simp del: add_uminus_conv_diff)


[STATEMENT]
lemma sr_Disj: "fv Q1 = fv Q2 \<Longrightarrow> sr (Disj Q1 Q2) = (sr Q1 \<and> sr Q2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fv Q1 = fv Q2 \<Longrightarrow> sr (Disj Q1 Q2) = (sr Q1 \<and> sr Q2)
[PROOF STEP]
by (auto 0 4 simp: sr_def nongens_def elim!: ap.cases elim: gen.cases intro: gen.intros)


[STATEMENT]
lemma indep_sets_reindex:
  assumes "inj_on f I"
  shows "indep_sets A (f ` I) = indep_sets (\<lambda>i. A (f i)) I"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. indep_sets A (f ` I) = indep_sets (\<lambda>i. A (f i)) I
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. indep_sets A (f ` I) = indep_sets (\<lambda>i. A (f i)) I
[PROOF STEP]
have a:"\<And>J g. J \<subseteq> I \<Longrightarrow> (\<Prod>j \<in> f ` J. g j) = (\<Prod>j \<in> J. g (f j))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>J g. J \<subseteq> I \<Longrightarrow> prod g (f ` J) = (\<Prod>j\<in>J. g (f j))
[PROOF STEP]
by (metis assms prod.reindex_cong subset_inj_on)
[PROOF STATE]
proof (state)
this:
?J11 \<subseteq> I \<Longrightarrow> prod ?g11 (f ` ?J11) = (\<Prod>j\<in>?J11. ?g11 (f j))

goal (1 subgoal):
 1. indep_sets A (f ` I) = indep_sets (\<lambda>i. A (f i)) I
[PROOF STEP]
have "J \<subseteq> I \<Longrightarrow> (\<Pi>\<^sub>E i \<in> J. A (f i)) = (\<lambda>a. restrict (a \<circ> f) J) ` PiE (f ` J) A" for J
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. J \<subseteq> I \<Longrightarrow> (\<Pi>\<^sub>E i\<in>J. A (f i)) = (\<lambda>a. restrict (a \<circ> f) J) ` Pi\<^sub>E (f ` J) A
[PROOF STEP]
using assms inj_on_subset
[PROOF STATE]
proof (prove)
using this:
inj_on f I
\<lbrakk>inj_on ?f ?A; ?B \<subseteq> ?A\<rbrakk> \<Longrightarrow> inj_on ?f ?B

goal (1 subgoal):
 1. J \<subseteq> I \<Longrightarrow> (\<Pi>\<^sub>E i\<in>J. A (f i)) = (\<lambda>a. restrict (a \<circ> f) J) ` Pi\<^sub>E (f ` J) A
[PROOF STEP]
by (subst PiE_reindex[symmetric]) auto
[PROOF STATE]
proof (state)
this:
?J12 \<subseteq> I \<Longrightarrow> (\<Pi>\<^sub>E i\<in>?J12. A (f i)) = (\<lambda>a. restrict (a \<circ> f) ?J12) ` Pi\<^sub>E (f ` ?J12) A

goal (1 subgoal):
 1. indep_sets A (f ` I) = indep_sets (\<lambda>i. A (f i)) I
[PROOF STEP]
hence b:"\<And>P J. J \<subseteq> I \<Longrightarrow>  (\<And>x. P x = P (restrict x J)) \<Longrightarrow> (\<forall>A' \<in> \<Pi>\<^sub>E i \<in> J. A (f i). P A') =  (\<forall>A'\<in>PiE (f ` J) A. P (A' \<circ> f))"
[PROOF STATE]
proof (prove)
using this:
?J12 \<subseteq> I \<Longrightarrow> (\<Pi>\<^sub>E i\<in>?J12. A (f i)) = (\<lambda>a. restrict (a \<circ> f) ?J12) ` Pi\<^sub>E (f ` ?J12) A

goal (1 subgoal):
 1. \<And>P J. \<lbrakk>J \<subseteq> I; \<And>x. P x = P (restrict x J)\<rbrakk> \<Longrightarrow> (\<forall>A'\<in>\<Pi>\<^sub>E i\<in>J. A (f i). P A') = (\<forall>A'\<in>Pi\<^sub>E (f ` J) A. P (A' \<circ> f))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<lbrakk>?J12 \<subseteq> I; \<And>x. ?P12 x = ?P12 (restrict x ?J12)\<rbrakk> \<Longrightarrow> (\<forall>A'\<in>\<Pi>\<^sub>E i\<in>?J12. A (f i). ?P12 A') = (\<forall>A'\<in>Pi\<^sub>E (f ` ?J12) A. ?P12 (A' \<circ> f))

goal (1 subgoal):
 1. indep_sets A (f ` I) = indep_sets (\<lambda>i. A (f i)) I
[PROOF STEP]
have c:"\<And>J. J \<subseteq> I \<Longrightarrow> finite (f ` J) = finite J"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>J. J \<subseteq> I \<Longrightarrow> finite (f ` J) = finite J
[PROOF STEP]
by (meson assms finite_image_iff inj_on_subset)
[PROOF STATE]
proof (state)
this:
?J12 \<subseteq> I \<Longrightarrow> finite (f ` ?J12) = finite ?J12

goal (1 subgoal):
 1. indep_sets A (f ` I) = indep_sets (\<lambda>i. A (f i)) I
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. indep_sets A (f ` I) = indep_sets (\<lambda>i. A (f i)) I
[PROOF STEP]
by (simp add:indep_sets_def all_subset_image a c)
     (simp add:make_ext b cong:restrict_cong)+
[PROOF STATE]
proof (state)
this:
indep_sets A (f ` I) = indep_sets (\<lambda>i. A (f i)) I

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma oLimit_le_oStrictLimit: "oLimit f \<le> oStrictLimit f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. oLimit f \<le> oStrictLimit f
[PROOF STEP]
apply (rule oLimit_leI, clarify)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. f n \<le> oStrictLimit f
[PROOF STEP]
apply (rule order_less_imp_le)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. f n < oStrictLimit f
[PROOF STEP]
apply (rule oStrictLimit_ub)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma LIMSEQ_const_div:
    assumes "f \<longlonglongrightarrow> a" "c \<noteq> 0"
    shows "(\<lambda>x. f x / c) \<longlonglongrightarrow> a / c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. f x / c) \<longlonglongrightarrow> a / c
[PROOF STEP]
using LIMSEQ_const_mult[where c = "1/c"] assms
[PROOF STATE]
proof (prove)
using this:
f \<longlonglongrightarrow> ?a \<Longrightarrow> (\<lambda>x. 1 / c * f x) \<longlonglongrightarrow> 1 / c * ?a
f \<longlonglongrightarrow> a
c \<noteq> 0

goal (1 subgoal):
 1. (\<lambda>x. f x / c) \<longlonglongrightarrow> a / c
[PROOF STEP]
by simp


[STATEMENT]
lemma nths_take: "nths xs {j. j < m} = take m xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nths xs {j. j < m} = take m xs
[PROOF STEP]
apply (induct xs arbitrary: m)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>m. nths [] {j. j < m} = take m []
 2. \<And>a xs m. (\<And>m. nths xs {j. j < m} = take m xs) \<Longrightarrow> nths (a # xs) {j. j < m} = take m (a # xs)
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a xs m. (\<And>m. nths xs {j. j < m} = take m xs) \<Longrightarrow> nths (a # xs) {j. j < m} = take m (a # xs)
[PROOF STEP]
apply (case_tac m)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>a xs m. \<lbrakk>\<And>m. nths xs {j. j < m} = take m xs; m = 0\<rbrakk> \<Longrightarrow> nths (a # xs) {j. j < m} = take m (a # xs)
 2. \<And>a xs m nat. \<lbrakk>\<And>m. nths xs {j. j < m} = take m xs; m = Suc nat\<rbrakk> \<Longrightarrow> nths (a # xs) {j. j < m} = take m (a # xs)
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a xs m nat. \<lbrakk>\<And>m. nths xs {j. j < m} = take m xs; m = Suc nat\<rbrakk> \<Longrightarrow> nths (a # xs) {j. j < m} = take m (a # xs)
[PROOF STEP]
apply (simp add: nths_Cons)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma quasi_isometry_subset:
  assumes "X \<subseteq> Y" "\<And>y. y \<in> Y \<Longrightarrow> \<exists>x\<in>X. dist x y \<le> C" "C \<ge> 0"
  shows "1 C-quasi_isometry_between X Y (\<lambda>x. x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 C -quasi_isometry_between X Y (\<lambda>x. x)
[PROOF STEP]
unfolding quasi_isometry_between_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 C -quasi_isometry_on X (\<lambda>x. x) \<and> (\<lambda>x. x) ` X \<subseteq> Y \<and> (\<forall>y\<in>Y. \<exists>x\<in>X. dist x y \<le> C)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
X \<subseteq> Y
?y \<in> Y \<Longrightarrow> \<exists>x\<in>X. dist x ?y \<le> C
0 \<le> C

goal (1 subgoal):
 1. 1 C -quasi_isometry_on X (\<lambda>x. x) \<and> (\<lambda>x. x) ` X \<subseteq> Y \<and> (\<forall>y\<in>Y. \<exists>x\<in>X. dist x y \<le> C)
[PROOF STEP]
by auto


[STATEMENT]
theorem sum_associativity: "x \<oplus> (y \<oplus> z) = (x \<oplus> y) \<oplus> z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<oplus> (y \<oplus> z) = (x \<oplus> y) \<oplus> z
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x \<oplus> (y \<oplus> z) = (x \<oplus> y) \<oplus> z
[PROOF STEP]
have  "\<forall> w. O w (x \<oplus> (y \<oplus> z)) \<longleftrightarrow> O w ((x \<oplus> y) \<oplus> z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>w. O w (x \<oplus> (y \<oplus> z)) = O w ((x \<oplus> y) \<oplus> z)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>w. O w (x \<oplus> (y \<oplus> z)) = O w ((x \<oplus> y) \<oplus> z)
[PROOF STEP]
fix w
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>w. O w (x \<oplus> (y \<oplus> z)) = O w ((x \<oplus> y) \<oplus> z)
[PROOF STEP]
have "O w (x \<oplus> (y \<oplus> z)) \<longleftrightarrow> (O w x \<or> O w y) \<or> O w z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. O w (x \<oplus> (y \<oplus> z)) = ((O w x \<or> O w y) \<or> O w z)
[PROOF STEP]
using right_associated_sum
[PROOF STATE]
proof (prove)
using this:
O ?w (?x \<oplus> (?y \<oplus> ?z)) = (O ?w ?x \<or> O ?w ?y \<or> O ?w ?z)

goal (1 subgoal):
 1. O w (x \<oplus> (y \<oplus> z)) = ((O w x \<or> O w y) \<or> O w z)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
O w (x \<oplus> (y \<oplus> z)) = ((O w x \<or> O w y) \<or> O w z)

goal (1 subgoal):
 1. \<And>w. O w (x \<oplus> (y \<oplus> z)) = O w ((x \<oplus> y) \<oplus> z)
[PROOF STEP]
with left_associated_sum
[PROOF STATE]
proof (chain)
picking this:
O ?w ((?x \<oplus> ?y) \<oplus> ?z) = ((O ?w ?x \<or> O ?w ?y) \<or> O ?w ?z)
O w (x \<oplus> (y \<oplus> z)) = ((O w x \<or> O w y) \<or> O w z)
[PROOF STEP]
show
      "O w (x \<oplus> (y \<oplus> z)) \<longleftrightarrow> O w ((x \<oplus> y) \<oplus> z)"
[PROOF STATE]
proof (prove)
using this:
O ?w ((?x \<oplus> ?y) \<oplus> ?z) = ((O ?w ?x \<or> O ?w ?y) \<or> O ?w ?z)
O w (x \<oplus> (y \<oplus> z)) = ((O w x \<or> O w y) \<or> O w z)

goal (1 subgoal):
 1. O w (x \<oplus> (y \<oplus> z)) = O w ((x \<oplus> y) \<oplus> z)
[PROOF STEP]
by (rule ssubst)
[PROOF STATE]
proof (state)
this:
O w (x \<oplus> (y \<oplus> z)) = O w ((x \<oplus> y) \<oplus> z)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>w. O w (x \<oplus> (y \<oplus> z)) = O w ((x \<oplus> y) \<oplus> z)

goal (1 subgoal):
 1. x \<oplus> (y \<oplus> z) = (x \<oplus> y) \<oplus> z
[PROOF STEP]
with overlap_extensionality
[PROOF STATE]
proof (chain)
picking this:
(?x = ?y) = (\<forall>z. O z ?x = O z ?y)
\<forall>w. O w (x \<oplus> (y \<oplus> z)) = O w ((x \<oplus> y) \<oplus> z)
[PROOF STEP]
show "x \<oplus> (y \<oplus> z) = (x \<oplus> y) \<oplus> z"
[PROOF STATE]
proof (prove)
using this:
(?x = ?y) = (\<forall>z. O z ?x = O z ?y)
\<forall>w. O w (x \<oplus> (y \<oplus> z)) = O w ((x \<oplus> y) \<oplus> z)

goal (1 subgoal):
 1. x \<oplus> (y \<oplus> z) = (x \<oplus> y) \<oplus> z
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
x \<oplus> (y \<oplus> z) = (x \<oplus> y) \<oplus> z

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma decode_encode_A_eq:
  "\<lbrakk> inj_on (enc::'a \<Rightarrow>'b) (A::'a set);
    dec = (\<lambda>w. (if (\<exists>t\<in>A. enc t = w) then (THE t. t\<in>A \<and> enc t = w) else (SOME t. t \<in> A)))\<rbrakk>
  \<Longrightarrow> \<forall>w. w \<in> enc`A \<longrightarrow> enc(dec(w)) = w"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>inj_on enc A; dec = (\<lambda>w. if \<exists>t\<in>A. enc t = w then THE t. t \<in> A \<and> enc t = w else SOME t. t \<in> A)\<rbrakk> \<Longrightarrow> \<forall>w. w \<in> enc ` A \<longrightarrow> enc (dec w) = w
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>w. \<lbrakk>inj_on enc A; dec = (\<lambda>w. if \<exists>t\<in>A. enc t = w then THE t. t \<in> A \<and> enc t = w else SOME t. t \<in> A)\<rbrakk> \<Longrightarrow> w \<in> enc ` A \<longrightarrow> enc (dec w) = w
[PROOF STEP]
fix w
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>w. \<lbrakk>inj_on enc A; dec = (\<lambda>w. if \<exists>t\<in>A. enc t = w then THE t. t \<in> A \<and> enc t = w else SOME t. t \<in> A)\<rbrakk> \<Longrightarrow> w \<in> enc ` A \<longrightarrow> enc (dec w) = w
[PROOF STEP]
assume inj_enc: "inj_on enc A"
    and dec_def: "dec = (\<lambda>w. if \<exists>t\<in>A. enc t = w then THE t. t \<in> A \<and> enc t = w else SOME t. t \<in> A)"
[PROOF STATE]
proof (state)
this:
inj_on enc A
dec = (\<lambda>w. if \<exists>t\<in>A. enc t = w then THE t. t \<in> A \<and> enc t = w else SOME t. t \<in> A)

goal (1 subgoal):
 1. \<And>w. \<lbrakk>inj_on enc A; dec = (\<lambda>w. if \<exists>t\<in>A. enc t = w then THE t. t \<in> A \<and> enc t = w else SOME t. t \<in> A)\<rbrakk> \<Longrightarrow> w \<in> enc ` A \<longrightarrow> enc (dec w) = w
[PROOF STEP]
show "w \<in> enc ` A \<longrightarrow> enc (dec w) = w"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. w \<in> enc ` A \<longrightarrow> enc (dec w) = w
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. w \<in> enc ` A \<Longrightarrow> enc (dec w) = w
[PROOF STEP]
assume "w \<in> enc ` A"
[PROOF STATE]
proof (state)
this:
w \<in> enc ` A

goal (1 subgoal):
 1. w \<in> enc ` A \<Longrightarrow> enc (dec w) = w
[PROOF STEP]
from dec_def
[PROOF STATE]
proof (chain)
picking this:
dec = (\<lambda>w. if \<exists>t\<in>A. enc t = w then THE t. t \<in> A \<and> enc t = w else SOME t. t \<in> A)
[PROOF STEP]
have
      dec_def': "dec = (\<lambda>w. (if (\<exists>t\<in>A. enc t = w) then (the_inv_into A enc) w else (SOME t. t \<in> A)))"
[PROOF STATE]
proof (prove)
using this:
dec = (\<lambda>w. if \<exists>t\<in>A. enc t = w then THE t. t \<in> A \<and> enc t = w else SOME t. t \<in> A)

goal (1 subgoal):
 1. dec = (\<lambda>w. if \<exists>t\<in>A. enc t = w then the_inv_into A enc w else SOME t. t \<in> A)
[PROOF STEP]
by (rule dec_is_inv_on_A)
[PROOF STATE]
proof (state)
this:
dec = (\<lambda>w. if \<exists>t\<in>A. enc t = w then the_inv_into A enc w else SOME t. t \<in> A)

goal (1 subgoal):
 1. w \<in> enc ` A \<Longrightarrow> enc (dec w) = w
[PROOF STEP]
with \<open>w \<in> enc ` A\<close> and inj_enc
[PROOF STATE]
proof (chain)
picking this:
w \<in> enc ` A
inj_on enc A
dec = (\<lambda>w. if \<exists>t\<in>A. enc t = w then the_inv_into A enc w else SOME t. t \<in> A)
[PROOF STEP]
show "enc (dec w) = w"
[PROOF STATE]
proof (prove)
using this:
w \<in> enc ` A
inj_on enc A
dec = (\<lambda>w. if \<exists>t\<in>A. enc t = w then the_inv_into A enc w else SOME t. t \<in> A)

goal (1 subgoal):
 1. enc (dec w) = w
[PROOF STEP]
by (auto simp add: the_inv_into_f_f)
[PROOF STATE]
proof (state)
this:
enc (dec w) = w

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
w \<in> enc ` A \<longrightarrow> enc (dec w) = w

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma null_setsI[intro]: "emeasure M A = 0 \<Longrightarrow> A \<in> sets M \<Longrightarrow> A \<in> null_sets M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>emeasure M A = 0; A \<in> sets M\<rbrakk> \<Longrightarrow> A \<in> null_sets M
[PROOF STEP]
unfolding null_sets_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>emeasure M A = 0; A \<in> sets M\<rbrakk> \<Longrightarrow> A \<in> {N \<in> sets M. emeasure M N = 0}
[PROOF STEP]
by simp


[STATEMENT]
lemma of_int_floor_cancel [simp]: "of_int \<lfloor>x\<rfloor> = x \<longleftrightarrow> (\<exists>n::int. x = of_int n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (of_int \<lfloor>x\<rfloor> = x) = (\<exists>n. x = of_int n)
[PROOF STEP]
by (metis floor_of_int)


[STATEMENT]
lemma in_JF1rel:
  "JF1rel R x y \<longleftrightarrow> (\<exists> z. z \<in> JF1in (Collect (case_prod R)) \<and> JF1map fst z = x \<and> JF1map snd z = y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. JF1rel R x y = (\<exists>z. z \<in> JF1in {(x, y). R x y} \<and> JF1map fst z = x \<and> JF1map snd z = y)
[PROOF STEP]
by (rule predicate2_eqD[OF trans[OF JF1rel_def OO_Grp_alt]])


[STATEMENT]
lemma has_integral_cong:
  assumes "\<And>x. x \<in> s \<Longrightarrow> f x = g x"
  shows "(f has_integral i) s = (g has_integral i) s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f has_integral i) s = (g has_integral i) s
[PROOF STEP]
using has_integral_eq[of s f g] has_integral_eq[of s g f] assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<And>x. x \<in> s \<Longrightarrow> f x = g x; (f has_integral ?k) s\<rbrakk> \<Longrightarrow> (g has_integral ?k) s
\<lbrakk>\<And>x. x \<in> s \<Longrightarrow> g x = f x; (g has_integral ?k) s\<rbrakk> \<Longrightarrow> (f has_integral ?k) s
?x \<in> s \<Longrightarrow> f ?x = g ?x

goal (1 subgoal):
 1. (f has_integral i) s = (g has_integral i) s
[PROOF STEP]
by auto


[STATEMENT]
lemma Fract_le_one_iff: "0 < b \<Longrightarrow> Fract a b \<le> 1 \<longleftrightarrow> a \<le> b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < b \<Longrightarrow> (Fract a b \<le> 1) = (a \<le> b)
[PROOF STEP]
by (simp add: One_rat_def mult_le_cancel_right)


[STATEMENT]
lemma substitutes_on_antimono:
  assumes "substitutes_on B f"
  assumes "A \<subseteq> B"
  shows "substitutes_on A f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. substitutes_on A f
[PROOF STEP]
using %invisible assms
[PROOF STATE]
proof (prove)
using this:
substitutes_on B f
A \<subseteq> B

goal (1 subgoal):
 1. substitutes_on A f
[PROOF STEP]
unfolding substitutes_on_def2
[PROOF STATE]
proof (prove)
using this:
\<forall>Ba\<subseteq>B. \<forall>a\<in>B. \<forall>b\<in>B. b \<notin> f (insert b Ba) \<longrightarrow> b \<notin> f (insert a (insert b Ba))
A \<subseteq> B

goal (1 subgoal):
 1. \<forall>B\<subseteq>A. \<forall>a\<in>A. \<forall>b\<in>A. b \<notin> f (insert b B) \<longrightarrow> b \<notin> f (insert a (insert b B))
[PROOF STEP]
by auto


[STATEMENT]
theorem dist0_sd2r_2:
  assumes "\<delta> > - v\<^sub>o / a\<^sub>o"
  assumes "s\<^sub>o - s\<^sub>e > safe_distance_2r"
  shows "s\<^sub>o - s\<^sub>e > distance0_2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distance0_2 < s\<^sub>o - s\<^sub>e
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. distance0_2 < s\<^sub>o - s\<^sub>e
[PROOF STEP]
have "- v\<^sub>e\<^sup>2 / 2 / a\<^sub>e \<ge> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> - v\<^sub>e\<^sup>2 / 2 / a\<^sub>e
[PROOF STEP]
using zero_le_power2 hyps(3) divide_nonneg_neg
[PROOF STATE]
proof (prove)
using this:
(0::?'a) \<le> ?a\<^sup>2
a\<^sub>e < 0
\<lbrakk>(0::?'a) \<le> ?x; ?y < (0::?'a)\<rbrakk> \<Longrightarrow> ?x / ?y \<le> (0::?'a)

goal (1 subgoal):
 1. 0 \<le> - v\<^sub>e\<^sup>2 / 2 / a\<^sub>e
[PROOF STEP]
by (auto simp add:field_simps)
[PROOF STATE]
proof (state)
this:
0 \<le> - v\<^sub>e\<^sup>2 / 2 / a\<^sub>e

goal (1 subgoal):
 1. distance0_2 < s\<^sub>o - s\<^sub>e
[PROOF STEP]
hence "v\<^sub>e * \<delta> - v\<^sub>e\<^sup>2 / 2 / a\<^sub>e + v\<^sub>o\<^sup>2 / 2 / a\<^sub>o \<ge> v\<^sub>e * \<delta> + v\<^sub>o\<^sup>2 / 2 / a\<^sub>o"
[PROOF STATE]
proof (prove)
using this:
0 \<le> - v\<^sub>e\<^sup>2 / 2 / a\<^sub>e

goal (1 subgoal):
 1. v\<^sub>e * \<delta> + v\<^sub>o\<^sup>2 / 2 / a\<^sub>o \<le> v\<^sub>e * \<delta> - v\<^sub>e\<^sup>2 / 2 / a\<^sub>e + v\<^sub>o\<^sup>2 / 2 / a\<^sub>o
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
v\<^sub>e * \<delta> + v\<^sub>o\<^sup>2 / 2 / a\<^sub>o \<le> v\<^sub>e * \<delta> - v\<^sub>e\<^sup>2 / 2 / a\<^sub>e + v\<^sub>o\<^sup>2 / 2 / a\<^sub>o

goal (1 subgoal):
 1. distance0_2 < s\<^sub>o - s\<^sub>e
[PROOF STEP]
hence "safe_distance_2r \<ge> distance0_2"
[PROOF STATE]
proof (prove)
using this:
v\<^sub>e * \<delta> + v\<^sub>o\<^sup>2 / 2 / a\<^sub>o \<le> v\<^sub>e * \<delta> - v\<^sub>e\<^sup>2 / 2 / a\<^sub>e + v\<^sub>o\<^sup>2 / 2 / a\<^sub>o

goal (1 subgoal):
 1. distance0_2 \<le> safe_distance_2r
[PROOF STEP]
using safe_distance_2r_def distance0_2_def
[PROOF STATE]
proof (prove)
using this:
v\<^sub>e * \<delta> + v\<^sub>o\<^sup>2 / 2 / a\<^sub>o \<le> v\<^sub>e * \<delta> - v\<^sub>e\<^sup>2 / 2 / a\<^sub>e + v\<^sub>o\<^sup>2 / 2 / a\<^sub>o
safe_distance_2r = v\<^sub>e * \<delta> - v\<^sub>e\<^sup>2 / 2 / a\<^sub>e + v\<^sub>o\<^sup>2 / 2 / a\<^sub>o
distance0_2 = v\<^sub>e * \<delta> + 1 / 2 * v\<^sub>o\<^sup>2 / a\<^sub>o

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

goal (1 subgoal):
 1. distance0_2 < s\<^sub>o - s\<^sub>e
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
distance0_2 \<le> safe_distance_2r

goal (1 subgoal):
 1. distance0_2 < s\<^sub>o - s\<^sub>e
[PROOF STEP]
using assms(2)
[PROOF STATE]
proof (prove)
using this:
distance0_2 \<le> safe_distance_2r
safe_distance_2r < s\<^sub>o - s\<^sub>e

goal (1 subgoal):
 1. distance0_2 < s\<^sub>o - s\<^sub>e
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
distance0_2 < s\<^sub>o - s\<^sub>e

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma fun_rel_id[relator_props]: "\<lbrakk>R1=Id; R2=Id\<rbrakk> \<Longrightarrow> R1 \<rightarrow> R2 = Id"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>R1 = Id; R2 = Id\<rbrakk> \<Longrightarrow> R1 \<rightarrow> R2 = Id
[PROOF STEP]
by (auto simp: fun_rel_def)


[STATEMENT]
lemma chain_prepend_coinduct[case_names chain]:
  "X x \<Longrightarrow> (\<And>x. X x \<Longrightarrow>
    (\<exists>z. x = LCons z LNil) \<or>
    (\<exists>y xs zs. x = LCons y (prepend zs xs) \<and>
      (X xs \<or> chain R xs) \<and> chain R (llist_of (y # zs @ [lhd xs])))) \<Longrightarrow> chain R x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>X x; \<And>x. X x \<Longrightarrow> (\<exists>z. x = LCons z LNil) \<or> (\<exists>y xs zs. x = LCons y (prepend zs xs) \<and> (X xs \<or> chain R xs) \<and> chain R (llist_of (y # zs @ [lhd xs])))\<rbrakk> \<Longrightarrow> chain R x
[PROOF STEP]
by (subst chain_chain', erule chain'.coinduct) (force simp: chain_chain')


[STATEMENT]
lemma butlastIsSubset:
  shows "set (butlast list) \<subseteq> set list"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (butlast list) \<subseteq> set list
[PROOF STEP]
by (induct list) (auto split: if_split_asm)


[STATEMENT]
lemma set_inf_impl: "finite \<Q>fin \<Longrightarrow> \<forall>(_, Qeq) \<in> \<Q>fin. finite Qeq \<Longrightarrow> set (inf_impl \<Q>fin Q) = inf \<Q>fin Q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite \<Q>fin; \<forall>(uu_, Qeq)\<in>\<Q>fin. finite Qeq\<rbrakk> \<Longrightarrow> set (inf_impl \<Q>fin Q) = Restrict_Frees.inf \<Q>fin Q
[PROOF STEP]
by (fastforce simp: inf_def inf_impl_def image_iff)


[STATEMENT]
lemma RECT_mono_ref[refine_mono]:
  "\<lbrakk>trimono B; \<And>D x. B D x \<le> B' D x\<rbrakk> \<Longrightarrow> RECT B x \<le> RECT B' x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>trimono B; \<And>D x. B D x \<le> B' D x\<rbrakk> \<Longrightarrow> REC\<^sub>T B x \<le> REC\<^sub>T B' x
[PROOF STEP]
unfolding RECT_gfp_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>trimono B; \<And>D x. B D x \<le> B' D x\<rbrakk> \<Longrightarrow> (if trimono B then gfp B x else top) \<le> (if trimono B' then gfp B' x else top)
[PROOF STEP]
apply clarsimp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>trimono B; \<And>D x. B D x \<le> B' D x; trimono B'\<rbrakk> \<Longrightarrow> gfp B x \<le> gfp B' x
[PROOF STEP]
apply (rule gfp_mono[THEN le_funD])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>Z. \<lbrakk>trimono B; \<And>D x. B D x \<le> B' D x; trimono B'\<rbrakk> \<Longrightarrow> B Z \<le> B' Z
[PROOF STEP]
by (rule le_funI)


[STATEMENT]
lemma monom_subst[simp]: "eval_poly \<alpha> (monom_subst \<sigma> m) = eval_monom (\<lambda> v. eval_poly \<alpha> (\<sigma> v)) m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eval_poly \<alpha> (monom_subst \<sigma> m) = eval_monom (\<lambda>v. eval_poly \<alpha> (\<sigma> v)) m
[PROOF STEP]
unfolding monom_subst_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eval_poly \<alpha> (monom_list_subst \<sigma> (monom_list m)) = eval_monom (\<lambda>v. eval_poly \<alpha> (\<sigma> v)) m
[PROOF STEP]
proof (transfer fixing: \<alpha> \<sigma>, clarsimp)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>m. monom_inv m \<Longrightarrow> eval_poly \<alpha> (monom_list_subst \<sigma> m) = eval_monom_list (\<lambda>v. eval_poly \<alpha> (\<sigma> v)) m
[PROOF STEP]
fix m
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>m. monom_inv m \<Longrightarrow> eval_poly \<alpha> (monom_list_subst \<sigma> m) = eval_monom_list (\<lambda>v. eval_poly \<alpha> (\<sigma> v)) m
[PROOF STEP]
show "monom_inv m \<Longrightarrow> eval_poly \<alpha> (monom_list_subst \<sigma> m) = eval_monom_list (\<lambda>v. eval_poly \<alpha> (\<sigma> v)) m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. monom_inv m \<Longrightarrow> eval_poly \<alpha> (monom_list_subst \<sigma> m) = eval_monom_list (\<lambda>v. eval_poly \<alpha> (\<sigma> v)) m
[PROOF STEP]
by (induct m, simp add: one_poly_def, auto simp: field_simps monom_inv_ConsD)
[PROOF STATE]
proof (state)
this:
monom_inv m \<Longrightarrow> eval_poly \<alpha> (monom_list_subst \<sigma> m) = eval_monom_list (\<lambda>v. eval_poly \<alpha> (\<sigma> v)) m

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma continuous_blinfun_matrix:
  fixes f:: "'b::t2_space \<Rightarrow> 'a::real_normed_vector \<Rightarrow>\<^sub>L 'c::real_inner"
  assumes "continuous F f"
  shows "continuous F (\<lambda>x. (f x) j \<bullet> i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous F (\<lambda>x. blinfun_apply (f x) j \<bullet> i)
[PROOF STEP]
by (rule bounded_linear.continuous[OF bounded_linear_blinfun_matrix assms])


[STATEMENT]
lemma span_alt:
  "span B = {(\<Sum>x | f x \<noteq> 0. f x *s x) | f. {x. f x \<noteq> 0} \<subseteq> B \<and> finite {x. f x \<noteq> 0}}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. span B = {\<Sum>x | f x \<noteq> (0::'a). f x *s x |f. {x. f x \<noteq> (0::'a)} \<subseteq> B \<and> finite {x. f x \<noteq> (0::'a)}}
[PROOF STEP]
unfolding span_explicit'
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {\<Sum>v | f v \<noteq> (0::'a). f v *s v |f. finite {v. f v \<noteq> (0::'a)} \<and> (\<forall>v. f v \<noteq> (0::'a) \<longrightarrow> v \<in> B)} = {\<Sum>x | f x \<noteq> (0::'a). f x *s x |f. {x. f x \<noteq> (0::'a)} \<subseteq> B \<and> finite {x. f x \<noteq> (0::'a)}}
[PROOF STEP]
by auto


[STATEMENT]
lemma set_compP:
 "((C,D,fs,ms') \<in> set(compP f P)) =
  (\<exists>ms. (C,D,fs,ms) \<in> set P \<and> ms' = map (compM f) ms)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((C, D, fs, ms') \<in> set (compP f P)) = (\<exists>ms. (C, D, fs, ms) \<in> set P \<and> ms' = map (compM f) ms)
[PROOF STEP]
(*<*)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((C, D, fs, ms') \<in> set (compP f P)) = (\<exists>ms. (C, D, fs, ms) \<in> set P \<and> ms' = map (compM f) ms)
[PROOF STEP]
by(fastforce simp add:compP_def compC_def image_iff Bex_def)


[STATEMENT]
theorem Gromov_hyperbolic_invariant_under_quasi_isometry':
  assumes "quasi_isometric (UNIV::('a::geodesic_space) set) (UNIV::('b::Gromov_hyperbolic_space) set)"
  shows "\<exists>delta. Gromov_hyperbolic_subset delta (UNIV::'a set)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>delta. Gromov_hyperbolic_subset delta UNIV
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>delta. Gromov_hyperbolic_subset delta UNIV
[PROOF STEP]
obtain C lambda f where f: "lambda C-quasi_isometry_between (UNIV::'a set) (UNIV::'b set) f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>lambda C f. lambda C -quasi_isometry_between UNIV UNIV f \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
quasi_isometric UNIV UNIV

goal (1 subgoal):
 1. (\<And>lambda C f. lambda C -quasi_isometry_between UNIV UNIV f \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding quasi_isometric_def
[PROOF STATE]
proof (prove)
using this:
\<exists>lambda C. Ex (lambda C -quasi_isometry_between UNIV UNIV)

goal (1 subgoal):
 1. (\<And>lambda C f. lambda C -quasi_isometry_between UNIV UNIV f \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
lambda C -quasi_isometry_between UNIV UNIV f

goal (1 subgoal):
 1. \<exists>delta. Gromov_hyperbolic_subset delta UNIV
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>delta. Gromov_hyperbolic_subset delta UNIV
[PROOF STEP]
using Gromov_hyperbolic_invariant_under_quasi_isometry_explicit'[OF quasi_isometry_betweenD(1)[OF f]]
[PROOF STATE]
proof (prove)
using this:
Gromov_hyperbolic_subset (752 * lambda ^ 3 * (C + deltaG TYPE('b))) UNIV

goal (1 subgoal):
 1. \<exists>delta. Gromov_hyperbolic_subset delta UNIV
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>delta. Gromov_hyperbolic_subset delta UNIV

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in infinite_coin_toss_space) bernoulli_stream_pseudo_prob_rec':
  fixes x
  assumes "pseudo_proj_True n x = x"
  shows "measure M (pseudo_proj_True (Suc n) -`{x}) =
    (measure M (pseudo_proj_True n-`{x}) * prob_component p x n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prob (pseudo_proj_True (Suc n) -` {x}) = prob (pseudo_proj_True n -` {x}) * prob_component p x n
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. prob (pseudo_proj_True (Suc n) -` {x}) = prob (pseudo_proj_True n -` {x}) * prob_component p x n
[PROOF STEP]
have "pseudo_proj_True (Suc n) -`{x} = {w. (stake (Suc n) w = stake (Suc n) x)}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pseudo_proj_True (Suc n) -` {x} = {w. stake (Suc n) w = stake (Suc n) x}
[PROOF STEP]
using pseudo_proj_True_preimage_stake
    assms
[PROOF STATE]
proof (prove)
using this:
?w = pseudo_proj_True ?n ?w \<Longrightarrow> pseudo_proj_True ?n -` {?w} = {x. stake ?n x = stake ?n ?w}
pseudo_proj_True n x = x

goal (1 subgoal):
 1. pseudo_proj_True (Suc n) -` {x} = {w. stake (Suc n) w = stake (Suc n) x}
[PROOF STEP]
by (metis pseudo_proj_True_Suc_proj)
[PROOF STATE]
proof (state)
this:
pseudo_proj_True (Suc n) -` {x} = {w. stake (Suc n) w = stake (Suc n) x}

goal (1 subgoal):
 1. prob (pseudo_proj_True (Suc n) -` {x}) = prob (pseudo_proj_True n -` {x}) * prob_component p x n
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
pseudo_proj_True (Suc n) -` {x} = {w. stake (Suc n) w = stake (Suc n) x}

goal (1 subgoal):
 1. prob (pseudo_proj_True (Suc n) -` {x}) = prob (pseudo_proj_True n -` {x}) * prob_component p x n
[PROOF STEP]
have "pseudo_proj_True n -`{x} = {w. (stake n w = stake n x)}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pseudo_proj_True n -` {x} = {w. stake n w = stake n x}
[PROOF STEP]
using pseudo_proj_True_preimage_stake
    assms
[PROOF STATE]
proof (prove)
using this:
?w = pseudo_proj_True ?n ?w \<Longrightarrow> pseudo_proj_True ?n -` {?w} = {x. stake ?n x = stake ?n ?w}
pseudo_proj_True n x = x

goal (1 subgoal):
 1. pseudo_proj_True n -` {x} = {w. stake n w = stake n x}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
pseudo_proj_True n -` {x} = {w. stake n w = stake n x}

goal (1 subgoal):
 1. prob (pseudo_proj_True (Suc n) -` {x}) = prob (pseudo_proj_True n -` {x}) * prob_component p x n
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
pseudo_proj_True (Suc n) -` {x} = {w. stake (Suc n) w = stake (Suc n) x}
pseudo_proj_True n -` {x} = {w. stake n w = stake n x}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
pseudo_proj_True (Suc n) -` {x} = {w. stake (Suc n) w = stake (Suc n) x}
pseudo_proj_True n -` {x} = {w. stake n w = stake n x}

goal (1 subgoal):
 1. prob (pseudo_proj_True (Suc n) -` {x}) = prob (pseudo_proj_True n -` {x}) * prob_component p x n
[PROOF STEP]
using assms bernoulli_stream_element_prob_rec'
[PROOF STATE]
proof (prove)
using this:
pseudo_proj_True (Suc n) -` {x} = {w. stake (Suc n) w = stake (Suc n) x}
pseudo_proj_True n -` {x} = {w. stake n w = stake n x}
pseudo_proj_True n x = x
\<lbrakk>?M = bernoulli_stream ?p; 0 \<le> ?p; ?p \<le> 1\<rbrakk> \<Longrightarrow> \<P>(w in ?M. stake (Suc ?n) w = stake (Suc ?n) ?x) = \<P>(w in ?M. stake ?n w = stake ?n ?x) * prob_component ?p ?x ?n

goal (1 subgoal):
 1. prob (pseudo_proj_True (Suc n) -` {x}) = prob (pseudo_proj_True n -` {x}) * prob_component p x n
[PROOF STEP]
by (simp add: bernoulli bernoulli_stream_space p_gt_0 p_lt_1)
[PROOF STATE]
proof (state)
this:
prob (pseudo_proj_True (Suc n) -` {x}) = prob (pseudo_proj_True n -` {x}) * prob_component p x n

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma S_diff_T_diff: "S x - S (x / 2) \<le> T x - 2 * T (x / 2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. S x - S (x / 2) \<le> T x - 2 * T (x / 2)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. S x - S (x / 2) \<le> T x - 2 * T (x / 2)
[PROOF STEP]
note fin = fin[of _ x]
[PROOF STATE]
proof (state)
this:
?X \<subseteq> {n. real n \<le> x} \<Longrightarrow> finite ?X

goal (1 subgoal):
 1. S x - S (x / 2) \<le> T x - 2 * T (x / 2)
[PROOF STEP]
have T_diff_eq:
    "T x - 2 * T (x / 2) = sum_upto (\<lambda>n. a n * (\<lfloor>x / n\<rfloor> - 2 * \<lfloor>x / (2 * n)\<rfloor>)) (x / 2) +
        (\<Sum>n | n > 0 \<and> real n \<in> {x/2<..x}. a n * \<lfloor>x / n\<rfloor>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. T x - 2 * T (x / 2) = sum_upto (\<lambda>n. a n * real_of_int (\<lfloor>x / real n\<rfloor> - 2 * \<lfloor>x / real (2 * n)\<rfloor>)) (x / 2) + (\<Sum>n | 0 < n \<and> real n \<in> {x / 2<..x}. a n * real_of_int \<lfloor>x / real n\<rfloor>)
[PROOF STEP]
unfolding T_def dirichlet_prod'_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum_upto (\<lambda>m. a m * real_of_int \<lfloor>x / real m\<rfloor>) x - 2 * sum_upto (\<lambda>m. a m * real_of_int \<lfloor>x / 2 / real m\<rfloor>) (x / 2) = sum_upto (\<lambda>n. a n * real_of_int (\<lfloor>x / real n\<rfloor> - 2 * \<lfloor>x / real (2 * n)\<rfloor>)) (x / 2) + (\<Sum>n | 0 < n \<and> real n \<in> {x / 2<..x}. a n * real_of_int \<lfloor>x / real n\<rfloor>)
[PROOF STEP]
by (subst split[where \<alpha> = "1/2"])
       (simp_all add: sum_upto_def sum_subtractf ring_distribs
                      sum_distrib_left sum_distrib_right mult_ac)
[PROOF STATE]
proof (state)
this:
T x - 2 * T (x / 2) = sum_upto (\<lambda>n. a n * real_of_int (\<lfloor>x / real n\<rfloor> - 2 * \<lfloor>x / real (2 * n)\<rfloor>)) (x / 2) + (\<Sum>n | 0 < n \<and> real n \<in> {x / 2<..x}. a n * real_of_int \<lfloor>x / real n\<rfloor>)

goal (1 subgoal):
 1. S x - S (x / 2) \<le> T x - 2 * T (x / 2)
[PROOF STEP]
have "S x - S (x / 2) = (\<Sum>n | n > 0 \<and> real n \<in> {x/2<..x}. a n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. S x - S (x / 2) = (\<Sum>n | 0 < n \<and> real n \<in> {x / 2<..x}. a n)
[PROOF STEP]
unfolding S_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum_upto a x - sum_upto a (x / 2) = (\<Sum>n | 0 < n \<and> real n \<in> {x / 2<..x}. a n)
[PROOF STEP]
by (subst split[where \<alpha> = "1 / 2"]) (auto simp: sum_upto_def)
[PROOF STATE]
proof (state)
this:
S x - S (x / 2) = (\<Sum>n | 0 < n \<and> real n \<in> {x / 2<..x}. a n)

goal (1 subgoal):
 1. S x - S (x / 2) \<le> T x - 2 * T (x / 2)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
S x - S (x / 2) = (\<Sum>n | 0 < n \<and> real n \<in> {x / 2<..x}. a n)

goal (1 subgoal):
 1. S x - S (x / 2) \<le> T x - 2 * T (x / 2)
[PROOF STEP]
have "\<dots> = (\<Sum>n | n > 0 \<and> real n \<in> {x/2<..x}. a n * \<lfloor>x / n\<rfloor>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>n | 0 < n \<and> real n \<in> {x / 2<..x}. a n) = (\<Sum>n | 0 < n \<and> real n \<in> {x / 2<..x}. a n * real_of_int \<lfloor>x / real n\<rfloor>)
[PROOF STEP]
proof (intro sum.cong)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. {n. 0 < n \<and> real n \<in> {x / 2<..x}} = {n. 0 < n \<and> real n \<in> {x / 2<..x}}
 2. \<And>xa. xa \<in> {n. 0 < n \<and> real n \<in> {x / 2<..x}} \<Longrightarrow> a xa = a xa * real_of_int \<lfloor>x / real xa\<rfloor>
[PROOF STEP]
fix n
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. {n. 0 < n \<and> real n \<in> {x / 2<..x}} = {n. 0 < n \<and> real n \<in> {x / 2<..x}}
 2. \<And>xa. xa \<in> {n. 0 < n \<and> real n \<in> {x / 2<..x}} \<Longrightarrow> a xa = a xa * real_of_int \<lfloor>x / real xa\<rfloor>
[PROOF STEP]
assume "n \<in> {n. n > 0 \<and> real n \<in> {x/2<..x}}"
[PROOF STATE]
proof (state)
this:
n \<in> {n. 0 < n \<and> real n \<in> {x / 2<..x}}

goal (2 subgoals):
 1. {n. 0 < n \<and> real n \<in> {x / 2<..x}} = {n. 0 < n \<and> real n \<in> {x / 2<..x}}
 2. \<And>xa. xa \<in> {n. 0 < n \<and> real n \<in> {x / 2<..x}} \<Longrightarrow> a xa = a xa * real_of_int \<lfloor>x / real xa\<rfloor>
[PROOF STEP]
hence "x / n \<ge> 1" "x / n < 2"
[PROOF STATE]
proof (prove)
using this:
n \<in> {n. 0 < n \<and> real n \<in> {x / 2<..x}}

goal (1 subgoal):
 1. 1 \<le> x / real n &&& x / real n < 2
[PROOF STEP]
by (auto simp: field_simps)
[PROOF STATE]
proof (state)
this:
1 \<le> x / real n
x / real n < 2

goal (2 subgoals):
 1. {n. 0 < n \<and> real n \<in> {x / 2<..x}} = {n. 0 < n \<and> real n \<in> {x / 2<..x}}
 2. \<And>xa. xa \<in> {n. 0 < n \<and> real n \<in> {x / 2<..x}} \<Longrightarrow> a xa = a xa * real_of_int \<lfloor>x / real xa\<rfloor>
[PROOF STEP]
hence "\<lfloor>x / n\<rfloor> = 1"
[PROOF STATE]
proof (prove)
using this:
1 \<le> x / real n
x / real n < 2

goal (1 subgoal):
 1. \<lfloor>x / real n\<rfloor> = 1
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
\<lfloor>x / real n\<rfloor> = 1

goal (2 subgoals):
 1. {n. 0 < n \<and> real n \<in> {x / 2<..x}} = {n. 0 < n \<and> real n \<in> {x / 2<..x}}
 2. \<And>xa. xa \<in> {n. 0 < n \<and> real n \<in> {x / 2<..x}} \<Longrightarrow> a xa = a xa * real_of_int \<lfloor>x / real xa\<rfloor>
[PROOF STEP]
thus "a n = a n * \<lfloor>x / n\<rfloor>"
[PROOF STATE]
proof (prove)
using this:
\<lfloor>x / real n\<rfloor> = 1

goal (1 subgoal):
 1. a n = a n * real_of_int \<lfloor>x / real n\<rfloor>
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
a n = a n * real_of_int \<lfloor>x / real n\<rfloor>

goal (1 subgoal):
 1. {n. 0 < n \<and> real n \<in> {x / 2<..x}} = {n. 0 < n \<and> real n \<in> {x / 2<..x}}
[PROOF STEP]
qed auto
[PROOF STATE]
proof (state)
this:
(\<Sum>n | 0 < n \<and> real n \<in> {x / 2<..x}. a n) = (\<Sum>n | 0 < n \<and> real n \<in> {x / 2<..x}. a n * real_of_int \<lfloor>x / real n\<rfloor>)

goal (1 subgoal):
 1. S x - S (x / 2) \<le> T x - 2 * T (x / 2)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>n | 0 < n \<and> real n \<in> {x / 2<..x}. a n) = (\<Sum>n | 0 < n \<and> real n \<in> {x / 2<..x}. a n * real_of_int \<lfloor>x / real n\<rfloor>)

goal (1 subgoal):
 1. S x - S (x / 2) \<le> T x - 2 * T (x / 2)
[PROOF STEP]
have "\<dots> = 0 + \<dots>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>n | 0 < n \<and> real n \<in> {x / 2<..x}. a n * real_of_int \<lfloor>x / real n\<rfloor>) = 0 + (\<Sum>n | 0 < n \<and> real n \<in> {x / 2<..x}. a n * real_of_int \<lfloor>x / real n\<rfloor>)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<Sum>n | 0 < n \<and> real n \<in> {x / 2<..x}. a n * real_of_int \<lfloor>x / real n\<rfloor>) = 0 + (\<Sum>n | 0 < n \<and> real n \<in> {x / 2<..x}. a n * real_of_int \<lfloor>x / real n\<rfloor>)

goal (1 subgoal):
 1. S x - S (x / 2) \<le> T x - 2 * T (x / 2)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>n | 0 < n \<and> real n \<in> {x / 2<..x}. a n * real_of_int \<lfloor>x / real n\<rfloor>) = 0 + (\<Sum>n | 0 < n \<and> real n \<in> {x / 2<..x}. a n * real_of_int \<lfloor>x / real n\<rfloor>)

goal (1 subgoal):
 1. S x - S (x / 2) \<le> T x - 2 * T (x / 2)
[PROOF STEP]
have "0 \<le> sum_upto (\<lambda>n. a n * (\<lfloor>x / n\<rfloor> - 2 * \<lfloor>x / (2 * n)\<rfloor>)) (x / 2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> sum_upto (\<lambda>n. a n * real_of_int (\<lfloor>x / real n\<rfloor> - 2 * \<lfloor>x / real (2 * n)\<rfloor>)) (x / 2)
[PROOF STEP]
unfolding sum_upto_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> (\<Sum>n\<in>{i. 0 < i \<and> real i \<le> x / 2}. a n * real_of_int (\<lfloor>x / real n\<rfloor> - 2 * \<lfloor>x / real (2 * n)\<rfloor>))
[PROOF STEP]
proof (intro sum_nonneg mult_nonneg_nonneg a_nonneg)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>xa. xa \<in> {i. 0 < i \<and> real i \<le> x / 2} \<Longrightarrow> 0 < xa
 2. \<And>xa. xa \<in> {i. 0 < i \<and> real i \<le> x / 2} \<Longrightarrow> 0 \<le> real_of_int (\<lfloor>x / real xa\<rfloor> - 2 * \<lfloor>x / real (2 * xa)\<rfloor>)
[PROOF STEP]
fix n
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>xa. xa \<in> {i. 0 < i \<and> real i \<le> x / 2} \<Longrightarrow> 0 < xa
 2. \<And>xa. xa \<in> {i. 0 < i \<and> real i \<le> x / 2} \<Longrightarrow> 0 \<le> real_of_int (\<lfloor>x / real xa\<rfloor> - 2 * \<lfloor>x / real (2 * xa)\<rfloor>)
[PROOF STEP]
assume "n \<in> {n. n > 0 \<and> real n \<le> x / 2}"
[PROOF STATE]
proof (state)
this:
n \<in> {n. 0 < n \<and> real n \<le> x / 2}

goal (2 subgoals):
 1. \<And>xa. xa \<in> {i. 0 < i \<and> real i \<le> x / 2} \<Longrightarrow> 0 < xa
 2. \<And>xa. xa \<in> {i. 0 < i \<and> real i \<le> x / 2} \<Longrightarrow> 0 \<le> real_of_int (\<lfloor>x / real xa\<rfloor> - 2 * \<lfloor>x / real (2 * xa)\<rfloor>)
[PROOF STEP]
hence "x / real n \<ge> 2"
[PROOF STATE]
proof (prove)
using this:
n \<in> {n. 0 < n \<and> real n \<le> x / 2}

goal (1 subgoal):
 1. 2 \<le> x / real n
[PROOF STEP]
by (auto simp: field_simps)
[PROOF STATE]
proof (state)
this:
2 \<le> x / real n

goal (2 subgoals):
 1. \<And>xa. xa \<in> {i. 0 < i \<and> real i \<le> x / 2} \<Longrightarrow> 0 < xa
 2. \<And>xa. xa \<in> {i. 0 < i \<and> real i \<le> x / 2} \<Longrightarrow> 0 \<le> real_of_int (\<lfloor>x / real xa\<rfloor> - 2 * \<lfloor>x / real (2 * xa)\<rfloor>)
[PROOF STEP]
thus "real_of_int (\<lfloor>x / n\<rfloor> - 2 * \<lfloor>x / (2 * n)\<rfloor>) \<ge> 0"
[PROOF STATE]
proof (prove)
using this:
2 \<le> x / real n

goal (1 subgoal):
 1. 0 \<le> real_of_int (\<lfloor>x / real n\<rfloor> - 2 * \<lfloor>x / real (2 * n)\<rfloor>)
[PROOF STEP]
using le_mult_floor[of 2 "x / (2 * n)"]
[PROOF STATE]
proof (prove)
using this:
2 \<le> x / real n
\<lbrakk>0 \<le> 2; 0 \<le> x / real (2 * n)\<rbrakk> \<Longrightarrow> \<lfloor>2\<rfloor> * \<lfloor>x / real (2 * n)\<rfloor> \<le> \<lfloor>2 * (x / real (2 * n))\<rfloor>

goal (1 subgoal):
 1. 0 \<le> real_of_int (\<lfloor>x / real n\<rfloor> - 2 * \<lfloor>x / real (2 * n)\<rfloor>)
[PROOF STEP]
by (simp add: mult_ac)
[PROOF STATE]
proof (state)
this:
0 \<le> real_of_int (\<lfloor>x / real n\<rfloor> - 2 * \<lfloor>x / real (2 * n)\<rfloor>)

goal (1 subgoal):
 1. \<And>xa. xa \<in> {i. 0 < i \<and> real i \<le> x / 2} \<Longrightarrow> 0 < xa
[PROOF STEP]
qed auto
[PROOF STATE]
proof (state)
this:
0 \<le> sum_upto (\<lambda>n. a n * real_of_int (\<lfloor>x / real n\<rfloor> - 2 * \<lfloor>x / real (2 * n)\<rfloor>)) (x / 2)

goal (1 subgoal):
 1. S x - S (x / 2) \<le> T x - 2 * T (x / 2)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
0 \<le> sum_upto (\<lambda>n. a n * real_of_int (\<lfloor>x / real n\<rfloor> - 2 * \<lfloor>x / real (2 * n)\<rfloor>)) (x / 2)

goal (1 subgoal):
 1. S x - S (x / 2) \<le> T x - 2 * T (x / 2)
[PROOF STEP]
have "\<dots> + (\<Sum>n | n > 0 \<and> real n \<in> {x/2<..x}. a n * \<lfloor>x / n\<rfloor>) = T x - 2 * T (x / 2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum_upto (\<lambda>n. a n * real_of_int (\<lfloor>x / real n\<rfloor> - 2 * \<lfloor>x / real (2 * n)\<rfloor>)) (x / 2) + (\<Sum>n | 0 < n \<and> real n \<in> {x / 2<..x}. a n * real_of_int \<lfloor>x / real n\<rfloor>) = T x - 2 * T (x / 2)
[PROOF STEP]
using T_diff_eq
[PROOF STATE]
proof (prove)
using this:
T x - 2 * T (x / 2) = sum_upto (\<lambda>n. a n * real_of_int (\<lfloor>x / real n\<rfloor> - 2 * \<lfloor>x / real (2 * n)\<rfloor>)) (x / 2) + (\<Sum>n | 0 < n \<and> real n \<in> {x / 2<..x}. a n * real_of_int \<lfloor>x / real n\<rfloor>)

goal (1 subgoal):
 1. sum_upto (\<lambda>n. a n * real_of_int (\<lfloor>x / real n\<rfloor> - 2 * \<lfloor>x / real (2 * n)\<rfloor>)) (x / 2) + (\<Sum>n | 0 < n \<and> real n \<in> {x / 2<..x}. a n * real_of_int \<lfloor>x / real n\<rfloor>) = T x - 2 * T (x / 2)
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
sum_upto (\<lambda>n. a n * real_of_int (\<lfloor>x / real n\<rfloor> - 2 * \<lfloor>x / real (2 * n)\<rfloor>)) (x / 2) + (\<Sum>n | 0 < n \<and> real n \<in> {x / 2<..x}. a n * real_of_int \<lfloor>x / real n\<rfloor>) = T x - 2 * T (x / 2)

goal (1 subgoal):
 1. S x - S (x / 2) \<le> T x - 2 * T (x / 2)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<And>xa y. xa \<le> y \<Longrightarrow> xa + (\<Sum>n | 0 < n \<and> real n \<in> {x / 2<..x}. a n * real_of_int \<lfloor>x / real n\<rfloor>) \<le> y + (\<Sum>n | 0 < n \<and> real n \<in> {x / 2<..x}. a n * real_of_int \<lfloor>x / real n\<rfloor>)) \<Longrightarrow> S x - S (x / 2) \<le> T x - 2 * T (x / 2)
[PROOF STEP]
show "S x - S (x / 2) \<le> T x - 2 * T (x / 2)"
[PROOF STATE]
proof (prove)
using this:
(\<And>xa y. xa \<le> y \<Longrightarrow> xa + (\<Sum>n | 0 < n \<and> real n \<in> {x / 2<..x}. a n * real_of_int \<lfloor>x / real n\<rfloor>) \<le> y + (\<Sum>n | 0 < n \<and> real n \<in> {x / 2<..x}. a n * real_of_int \<lfloor>x / real n\<rfloor>)) \<Longrightarrow> S x - S (x / 2) \<le> T x - 2 * T (x / 2)

goal (1 subgoal):
 1. S x - S (x / 2) \<le> T x - 2 * T (x / 2)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
S x - S (x / 2) \<le> T x - 2 * T (x / 2)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma list_all2_nthD:
  "\<lbrakk> list_all2 P xs ys; p < size xs \<rbrakk> \<Longrightarrow> P (xs!p) (ys!p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>list_all2 P xs ys; p < length xs\<rbrakk> \<Longrightarrow> P (xs ! p) (ys ! p)
[PROOF STEP]
by (simp add: list_all2_conv_all_nth)


[STATEMENT]
lemma deleteMin_correct:
    assumes "q\<noteq>empty"
    shows "to_mset (deleteMin q) = to_mset q - {# findMin q #}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. to_mset (deleteMin q) = to_mset q - {#findMin q#}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
q \<noteq> local.empty

goal (1 subgoal):
 1. to_mset (deleteMin q) = to_mset q - {#findMin q#}
[PROOF STEP]
apply (unfold findMin_def deleteMin_def to_mset_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. q \<noteq> local.empty \<Longrightarrow> BinomialHeapStruc.queue_to_multiset (Rep_BinomialHeap (if q = local.empty then local.empty else Abs_BinomialHeap (BinomialHeapStruc.deleteMin (Rep_BinomialHeap q)))) = BinomialHeapStruc.queue_to_multiset (Rep_BinomialHeap q) - {#BinomialHeapStruc.findMin (Rep_BinomialHeap q)#}
[PROOF STEP]
apply (simp_all add: empty_rep BinomialHeapStruc.deleteMin_correct)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma of_int_floor_cancel [simp]: "of_int \<lfloor>x\<rfloor> = x \<longleftrightarrow> (\<exists>n::int. x = of_int n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (of_int \<lfloor>x\<rfloor> = x) = (\<exists>n. x = of_int n)
[PROOF STEP]
by (metis floor_of_int)


[STATEMENT]
lemma minus_mult_scalar_minus [simp]: "(- p) \<odot> (- q) = p \<odot> q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - p \<odot> - q = p \<odot> q
[PROOF STEP]
by simp


[STATEMENT]
lemma le_utrans_trans[trans]:
  "\<lbrakk> le_utrans x y; le_utrans y z \<rbrakk> \<Longrightarrow> le_utrans x z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>le_utrans x y; le_utrans y z\<rbrakk> \<Longrightarrow> le_utrans x z
[PROOF STEP]
unfolding le_utrans_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>P. unitary P \<longrightarrow> x P \<tturnstile> y P; \<forall>P. unitary P \<longrightarrow> y P \<tturnstile> z P\<rbrakk> \<Longrightarrow> \<forall>P. unitary P \<longrightarrow> x P \<tturnstile> z P
[PROOF STEP]
by(blast dest:order_trans)


[STATEMENT]
lemma pos_mult_pos_ge:
  "[|x > (0::int); n>=0 |] ==> n * x >= n*1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < x; 0 \<le> n\<rbrakk> \<Longrightarrow> n * 1 \<le> n * x
[PROOF STEP]
apply (simp only: mult_left_mono)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma span_empty: "span {} = {zero V}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. span {} = {\<zero>\<^bsub>V\<^esub>}
[PROOF STEP]
unfolding finite_span[OF finite.emptyI empty_subsetI]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {lincomb a {} |a. a \<in> {} \<rightarrow> carrier K} = {\<zero>\<^bsub>V\<^esub>}
[PROOF STEP]
unfolding lincomb_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {\<Oplus>\<^bsub>V\<^esub>v\<in>{}. a v \<odot>\<^bsub>V\<^esub> v |a. a \<in> {} \<rightarrow> carrier K} = {\<zero>\<^bsub>V\<^esub>}
[PROOF STEP]
by simp


[STATEMENT]
lemma T_endpow_list_apply_commute :
  "map T (map (\<lambda>S. S v) (map endpow [0..<n]))
        = map (\<lambda>S. S v) (map ((\<circ>) T) (map endpow [0..<n]))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map T (map (\<lambda>S. S v) (map endpow [0..<n])) = map (\<lambda>S. S v) (map ((\<circ>) T) (map endpow [0..<n]))
[PROOF STEP]
by (induct n) auto


[STATEMENT]
lemma Scons_mono: "[| M<=M';  N<=N' |] ==> Scons M N <= Scons M' N'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>M \<subseteq> M'; N \<subseteq> N'\<rbrakk> \<Longrightarrow> Scons M N \<subseteq> Scons M' N'
[PROOF STEP]
by (simp add: Scons_def, blast)


[STATEMENT]
lemma acyclic_3a_spannable_implies_6:
  assumes "acyclic_3a x"
      and "spannable x"
      and "symmetric x"
    shows "acyclic_6 x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. acyclic_6 x
[PROOF STEP]
by (smt acyclic_6_def acyclic_3a_def assms conv_isotone le_supI spannable_def)


[STATEMENT]
lemma foo29: "\<lbrakk>dom (C a) \<noteq> {}; dom (C a) \<inter> dom (C b) = {}\<rbrakk> \<Longrightarrow> a \<noteq> b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>dom (C a) \<noteq> {}; dom (C a) \<inter> dom (C b) = {}\<rbrakk> \<Longrightarrow> a \<noteq> b
[PROOF STEP]
by auto


[STATEMENT]
lemma div_set_prime:
  assumes "prime n"
  shows "properdiv_set n = {1}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. properdiv_set n = {1}
[PROOF STEP]
using assms properdiv_set prime_nat_iff proper_divisor_def
[PROOF STATE]
proof (prove)
using this:
prime n
properdiv_set ?m = {n. n properdiv ?m}
prime ?n = (1 < ?n \<and> (\<forall>m. m dvd ?n \<longrightarrow> m = 1 \<or> m = ?n))
?n properdiv ?m \<equiv> 1 \<le> ?n \<and> ?n < ?m \<and> ?n dvd ?m

goal (1 subgoal):
 1. properdiv_set n = {1}
[PROOF STEP]
by (metis (no_types, lifting) Collect_cong One_nat_def divisor_def divisor_set divisor_set_one
 dvd_1_left empty_iff insert_iff mem_Collect_eq order_less_irrefl)


[STATEMENT]
lemma span_alt:
  "span B = {(\<Sum>x | f x \<noteq> 0. f x *s x) | f. {x. f x \<noteq> 0} \<subseteq> B \<and> finite {x. f x \<noteq> 0}}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. span B = {\<Sum>x | f x \<noteq> (0::'a). f x *s x |f. {x. f x \<noteq> (0::'a)} \<subseteq> B \<and> finite {x. f x \<noteq> (0::'a)}}
[PROOF STEP]
unfolding span_explicit'
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {\<Sum>v | f v \<noteq> (0::'a). f v *s v |f. finite {v. f v \<noteq> (0::'a)} \<and> (\<forall>v. f v \<noteq> (0::'a) \<longrightarrow> v \<in> B)} = {\<Sum>x | f x \<noteq> (0::'a). f x *s x |f. {x. f x \<noteq> (0::'a)} \<subseteq> B \<and> finite {x. f x \<noteq> (0::'a)}}
[PROOF STEP]
by auto


[STATEMENT]
lemma model_to_dimacs_model_sound_exists:
  "1 < n_vars \<Longrightarrow> (\<forall>v\<in>atoms f. 0 < v \<and> v < n_vars) \<Longrightarrow> is_cnf f \<Longrightarrow> M \<Turnstile> f \<Longrightarrow>
        \<exists>M_dimacs. dimacs_model M_dimacs (cnf_to_dimacs f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>1 < n_vars; \<forall>v\<in>atoms f. 0 < v \<and> v < n_vars; is_cnf f; M \<Turnstile> f\<rbrakk> \<Longrightarrow> \<exists>M_dimacs. dimacs_model M_dimacs (cnf_to_dimacs f)
[PROOF STEP]
using model_to_dimacs_model_sound
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>1 < ?n_vars; \<forall>v\<in>atoms ?f. 0 < v \<and> v < ?n_vars; is_cnf ?f; ?M \<Turnstile> ?f\<rbrakk> \<Longrightarrow> dimacs_model (model_to_dimacs_model ?M [1..<?n_vars]) (cnf_to_dimacs ?f)

goal (1 subgoal):
 1. \<lbrakk>1 < n_vars; \<forall>v\<in>atoms f. 0 < v \<and> v < n_vars; is_cnf f; M \<Turnstile> f\<rbrakk> \<Longrightarrow> \<exists>M_dimacs. dimacs_model M_dimacs (cnf_to_dimacs f)
[PROOF STEP]
by metis


[STATEMENT]
lemma funpow_invs:
  assumes "m \<le> n" and inv: "\<And>x. f (g x) = x"
  shows "(f ^^ m) ((g ^^ n) x) = (g ^^ (n - m)) x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f ^^ m) ((g ^^ n) x) = (g ^^ (n - m)) x
[PROOF STEP]
using \<open>m \<le> n\<close>
[PROOF STATE]
proof (prove)
using this:
m \<le> n

goal (1 subgoal):
 1. (f ^^ m) ((g ^^ n) x) = (g ^^ (n - m)) x
[PROOF STEP]
proof (induction m)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. 0 \<le> n \<Longrightarrow> (f ^^ 0) ((g ^^ n) x) = (g ^^ (n - 0)) x
 2. \<And>m. \<lbrakk>m \<le> n \<Longrightarrow> (f ^^ m) ((g ^^ n) x) = (g ^^ (n - m)) x; Suc m \<le> n\<rbrakk> \<Longrightarrow> (f ^^ Suc m) ((g ^^ n) x) = (g ^^ (n - Suc m)) x
[PROOF STEP]
case (Suc m)
[PROOF STATE]
proof (state)
this:
m \<le> n \<Longrightarrow> (f ^^ m) ((g ^^ n) x) = (g ^^ (n - m)) x
Suc m \<le> n

goal (2 subgoals):
 1. 0 \<le> n \<Longrightarrow> (f ^^ 0) ((g ^^ n) x) = (g ^^ (n - 0)) x
 2. \<And>m. \<lbrakk>m \<le> n \<Longrightarrow> (f ^^ m) ((g ^^ n) x) = (g ^^ (n - m)) x; Suc m \<le> n\<rbrakk> \<Longrightarrow> (f ^^ Suc m) ((g ^^ n) x) = (g ^^ (n - Suc m)) x
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
m \<le> n \<Longrightarrow> (f ^^ m) ((g ^^ n) x) = (g ^^ (n - m)) x
Suc m \<le> n

goal (2 subgoals):
 1. 0 \<le> n \<Longrightarrow> (f ^^ 0) ((g ^^ n) x) = (g ^^ (n - 0)) x
 2. \<And>m. \<lbrakk>m \<le> n \<Longrightarrow> (f ^^ m) ((g ^^ n) x) = (g ^^ (n - m)) x; Suc m \<le> n\<rbrakk> \<Longrightarrow> (f ^^ Suc m) ((g ^^ n) x) = (g ^^ (n - Suc m)) x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
m \<le> n \<Longrightarrow> (f ^^ m) ((g ^^ n) x) = (g ^^ (n - m)) x
Suc m \<le> n
[PROOF STEP]
have "n - m = Suc (n - Suc m)"
[PROOF STATE]
proof (prove)
using this:
m \<le> n \<Longrightarrow> (f ^^ m) ((g ^^ n) x) = (g ^^ (n - m)) x
Suc m \<le> n

goal (1 subgoal):
 1. n - m = Suc (n - Suc m)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
n - m = Suc (n - Suc m)

goal (2 subgoals):
 1. 0 \<le> n \<Longrightarrow> (f ^^ 0) ((g ^^ n) x) = (g ^^ (n - 0)) x
 2. \<And>m. \<lbrakk>m \<le> n \<Longrightarrow> (f ^^ m) ((g ^^ n) x) = (g ^^ (n - m)) x; Suc m \<le> n\<rbrakk> \<Longrightarrow> (f ^^ Suc m) ((g ^^ n) x) = (g ^^ (n - Suc m)) x
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
m \<le> n \<Longrightarrow> (f ^^ m) ((g ^^ n) x) = (g ^^ (n - m)) x
Suc m \<le> n
n - m = Suc (n - Suc m)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
m \<le> n \<Longrightarrow> (f ^^ m) ((g ^^ n) x) = (g ^^ (n - m)) x
Suc m \<le> n
n - m = Suc (n - Suc m)

goal (1 subgoal):
 1. (f ^^ Suc m) ((g ^^ n) x) = (g ^^ (n - Suc m)) x
[PROOF STEP]
by (auto simp: inv)
[PROOF STATE]
proof (state)
this:
(f ^^ Suc m) ((g ^^ n) x) = (g ^^ (n - Suc m)) x

goal (1 subgoal):
 1. 0 \<le> n \<Longrightarrow> (f ^^ 0) ((g ^^ n) x) = (g ^^ (n - 0)) x
[PROOF STEP]
qed simp


[STATEMENT]
lemma set_eqE2:
  fixes R (structure)
  assumes "A {.=} B"
    and "\<lbrakk> \<forall>a \<in> A. \<exists>b \<in> B. a .= b; \<forall>b \<in> B. \<exists>a \<in> A. b .= a \<rbrakk> \<Longrightarrow> P"
  shows "P"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
A {.=} B
\<lbrakk>\<forall>a\<in>A. \<exists>b\<in>B. a .= b; \<forall>b\<in>B. \<exists>a\<in>A. b .= a\<rbrakk> \<Longrightarrow> P

goal (1 subgoal):
 1. P
[PROOF STEP]
unfolding set_eq_def
[PROOF STATE]
proof (prove)
using this:
(\<forall>x\<in>A. x .\<in> B) \<and> (\<forall>x\<in>B. x .\<in> A)
\<lbrakk>\<forall>a\<in>A. \<exists>b\<in>B. a .= b; \<forall>b\<in>B. \<exists>a\<in>A. b .= a\<rbrakk> \<Longrightarrow> P

goal (1 subgoal):
 1. P
[PROOF STEP]
by (simp add: elem_def)


[STATEMENT]
lemma add_right_cancel[simp]: "b \<oplus>\<^sub>a a = c \<oplus>\<^sub>a a \<longleftrightarrow> b = c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (b \<oplus>\<^sub>a a = c \<oplus>\<^sub>a a) = (b = c)
[PROOF STEP]
by (blast dest: add_right_imp_eq)


[STATEMENT]
lemma p_less_eq_lem1:
  "\<lbrakk>\<not> (x::('e::linorder,'a::linorder) LP) \<le> z;
  (x + y) \<le> z\<rbrakk>
  \<Longrightarrow> y \<le> z "
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<not> x \<le> z; x + y \<le> z\<rbrakk> \<Longrightarrow> y \<le> z
[PROOF STEP]
apply (cases x,auto simp add: plus_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x21 x22. \<lbrakk>\<not> LP x21 x22 \<le> z; p_min (LP x21 x22) y \<le> z; x = LP x21 x22\<rbrakk> \<Longrightarrow> y \<le> z
[PROOF STEP]
apply (cases y, auto)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x21 x22 x21a x22a. \<lbrakk>\<not> LP x21 x22 \<le> z; LP (max x21 x21a) (min x22 x22a) \<le> z; x = LP x21 x22; y = LP x21a x22a\<rbrakk> \<Longrightarrow> LP x21a x22a \<le> z
[PROOF STEP]
apply (cases z, auto simp add: plesseq_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x21 x22 x21a x22a x21b x22b. \<lbrakk>\<not> x22 \<le> x22b; min x22 x22a \<le> x22b; x = LP x21 x22; y = LP x21a x22a; z = LP x21b x22b\<rbrakk> \<Longrightarrow> x22a \<le> x22b
[PROOF STEP]
apply (metis min_le_iff_disj)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma subtopology_Times:
  shows "subtopology (prod_topology X Y) (S \<times> T) = prod_topology (subtopology X S) (subtopology Y T)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subtopology (prod_topology X Y) (S \<times> T) = prod_topology (subtopology X S) (subtopology Y T)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. subtopology (prod_topology X Y) (S \<times> T) = prod_topology (subtopology X S) (subtopology Y T)
[PROOF STEP]
have "((\<lambda>U. \<exists>S T. U = S \<times> T \<and> openin X S \<and> openin Y T) relative_to S \<times> T) =
        (\<lambda>U. \<exists>S' T'. U = S' \<times> T' \<and> (openin X relative_to S) S' \<and> (openin Y relative_to T) T')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>U. \<exists>S T. U = S \<times> T \<and> openin X S \<and> openin Y T) relative_to S \<times> T = (\<lambda>U. \<exists>S' T'. U = S' \<times> T' \<and> (openin X relative_to S) S' \<and> (openin Y relative_to T) T')
[PROOF STEP]
by (auto simp: relative_to_def Times_Int_Times fun_eq_iff) metis
[PROOF STATE]
proof (state)
this:
(\<lambda>U. \<exists>S T. U = S \<times> T \<and> openin X S \<and> openin Y T) relative_to S \<times> T = (\<lambda>U. \<exists>S' T'. U = S' \<times> T' \<and> (openin X relative_to S) S' \<and> (openin Y relative_to T) T')

goal (1 subgoal):
 1. subtopology (prod_topology X Y) (S \<times> T) = prod_topology (subtopology X S) (subtopology Y T)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>U. \<exists>S T. U = S \<times> T \<and> openin X S \<and> openin Y T) relative_to S \<times> T = (\<lambda>U. \<exists>S' T'. U = S' \<times> T' \<and> (openin X relative_to S) S' \<and> (openin Y relative_to T) T')
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<lambda>U. \<exists>S T. U = S \<times> T \<and> openin X S \<and> openin Y T) relative_to S \<times> T = (\<lambda>U. \<exists>S' T'. U = S' \<times> T' \<and> (openin X relative_to S) S' \<and> (openin Y relative_to T) T')

goal (1 subgoal):
 1. subtopology (prod_topology X Y) (S \<times> T) = prod_topology (subtopology X S) (subtopology Y T)
[PROOF STEP]
by (simp add: topology_eq openin_prod_topology arbitrary_union_of_relative_to flip: openin_relative_to)
[PROOF STATE]
proof (state)
this:
subtopology (prod_topology X Y) (S \<times> T) = prod_topology (subtopology X S) (subtopology Y T)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Fract_le_one_iff: "0 < b \<Longrightarrow> Fract a b \<le> 1 \<longleftrightarrow> a \<le> b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < b \<Longrightarrow> (Fract a b \<le> 1) = (a \<le> b)
[PROOF STEP]
by (simp add: One_rat_def mult_le_cancel_right)


[STATEMENT]
lemma Nset_injTr1:"\<lbrakk> \<forall>l \<le>(Suc n). f l \<le> (Suc n); inj_on f {i. i \<le> (Suc n)};
                    f (Suc n) = Suc n \<rbrakk> \<Longrightarrow> inj_on f {i. i \<le> n}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>l\<le>Suc n. f l \<le> Suc n; inj_on f {i. i \<le> Suc n}; f (Suc n) = Suc n\<rbrakk> \<Longrightarrow> inj_on f {i. i \<le> n}
[PROOF STEP]
by (cut_tac Nset_injTr0[of f n], simp, simp)


[STATEMENT]
lemma reals_power_lt_ex:
  fixes x y :: real
  assumes xp: "x > 0"
    and y1: "y > 1"
  shows "\<exists>k>0. (1/y)^k < x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>k>0. (1 / y) ^ k < x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>k>0. (1 / y) ^ k < x
[PROOF STEP]
have yp: "y > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < y
[PROOF STEP]
using y1
[PROOF STATE]
proof (prove)
using this:
1 < y

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

goal (1 subgoal):
 1. \<exists>k>0. (1 / y) ^ k < x
[PROOF STEP]
from reals_Archimedean2[of "max 0 (- log y x) + 1"]
[PROOF STATE]
proof (chain)
picking this:
\<exists>n. max 0 (- log y x) + 1 < real n
[PROOF STEP]
obtain k :: nat where k: "real k > max 0 (- log y x) + 1"
[PROOF STATE]
proof (prove)
using this:
\<exists>n. max 0 (- log y x) + 1 < real n

goal (1 subgoal):
 1. (\<And>k. max 0 (- log y x) + 1 < real k \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
max 0 (- log y x) + 1 < real k

goal (1 subgoal):
 1. \<exists>k>0. (1 / y) ^ k < x
[PROOF STEP]
from k
[PROOF STATE]
proof (chain)
picking this:
max 0 (- log y x) + 1 < real k
[PROOF STEP]
have kp: "k > 0"
[PROOF STATE]
proof (prove)
using this:
max 0 (- log y x) + 1 < real k

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

goal (1 subgoal):
 1. \<exists>k>0. (1 / y) ^ k < x
[PROOF STEP]
from k
[PROOF STATE]
proof (chain)
picking this:
max 0 (- log y x) + 1 < real k
[PROOF STEP]
have "real k > - log y x"
[PROOF STATE]
proof (prove)
using this:
max 0 (- log y x) + 1 < real k

goal (1 subgoal):
 1. - log y x < real k
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
- log y x < real k

goal (1 subgoal):
 1. \<exists>k>0. (1 / y) ^ k < x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
- log y x < real k
[PROOF STEP]
have "ln y * real k > - ln x"
[PROOF STATE]
proof (prove)
using this:
- log y x < real k

goal (1 subgoal):
 1. - ln x < ln y * real k
[PROOF STEP]
unfolding log_def
[PROOF STATE]
proof (prove)
using this:
- (ln x / ln y) < real k

goal (1 subgoal):
 1. - ln x < ln y * real k
[PROOF STEP]
using ln_gt_zero_iff[OF yp] y1
[PROOF STATE]
proof (prove)
using this:
- (ln x / ln y) < real k
(0 < ln y) = (1 < y)
1 < y

goal (1 subgoal):
 1. - ln x < ln y * real k
[PROOF STEP]
by (simp add: minus_divide_left field_simps del: minus_divide_left[symmetric])
[PROOF STATE]
proof (state)
this:
- ln x < ln y * real k

goal (1 subgoal):
 1. \<exists>k>0. (1 / y) ^ k < x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
- ln x < ln y * real k
[PROOF STEP]
have "ln y * real k + ln x > 0"
[PROOF STATE]
proof (prove)
using this:
- ln x < ln y * real k

goal (1 subgoal):
 1. 0 < ln y * real k + ln x
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
0 < ln y * real k + ln x

goal (1 subgoal):
 1. \<exists>k>0. (1 / y) ^ k < x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 < ln y * real k + ln x
[PROOF STEP]
have "exp (real k * ln y + ln x) > exp 0"
[PROOF STATE]
proof (prove)
using this:
0 < ln y * real k + ln x

goal (1 subgoal):
 1. exp 0 < exp (real k * ln y + ln x)
[PROOF STEP]
by (simp add: ac_simps)
[PROOF STATE]
proof (state)
this:
exp 0 < exp (real k * ln y + ln x)

goal (1 subgoal):
 1. \<exists>k>0. (1 / y) ^ k < x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
exp 0 < exp (real k * ln y + ln x)
[PROOF STEP]
have "y ^ k * x > 1"
[PROOF STATE]
proof (prove)
using this:
exp 0 < exp (real k * ln y + ln x)

goal (1 subgoal):
 1. 1 < y ^ k * x
[PROOF STEP]
unfolding exp_zero exp_add exp_of_nat_mult exp_ln [OF xp] exp_ln [OF yp]
[PROOF STATE]
proof (prove)
using this:
1 < y ^ k * x

goal (1 subgoal):
 1. 1 < y ^ k * x
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
1 < y ^ k * x

goal (1 subgoal):
 1. \<exists>k>0. (1 / y) ^ k < x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
1 < y ^ k * x
[PROOF STEP]
have "x > (1 / y)^k"
[PROOF STATE]
proof (prove)
using this:
1 < y ^ k * x

goal (1 subgoal):
 1. (1 / y) ^ k < x
[PROOF STEP]
using yp
[PROOF STATE]
proof (prove)
using this:
1 < y ^ k * x
0 < y

goal (1 subgoal):
 1. (1 / y) ^ k < x
[PROOF STEP]
by (simp add: field_simps)
[PROOF STATE]
proof (state)
this:
(1 / y) ^ k < x

goal (1 subgoal):
 1. \<exists>k>0. (1 / y) ^ k < x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(1 / y) ^ k < x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(1 / y) ^ k < x

goal (1 subgoal):
 1. \<exists>k>0. (1 / y) ^ k < x
[PROOF STEP]
using kp
[PROOF STATE]
proof (prove)
using this:
(1 / y) ^ k < x
0 < k

goal (1 subgoal):
 1. \<exists>k>0. (1 / y) ^ k < x
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>k>0. (1 / y) ^ k < x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma s2p_union_hom: "s2p (A \<union> B) = (s2p A) \<squnion> (s2p B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. s2p (A \<union> B) = s2p A \<squnion> s2p B
[PROOF STEP]
by (auto simp: s2p_def)