[STATEMENT]
lemma additive_guard_split:
  fixes t::"('s::finite \<Rightarrow> real) \<Rightarrow> 's \<Rightarrow> real"
  assumes additive: "additive t"
      and ht: "healthy t"
      and sP: "sound P"
  shows "t P x = (\<Sum>y\<in>{s.   G s}. P y * t \<guillemotleft>\<lambda>z. z = y\<guillemotright> x) +
                 (\<Sum>y\<in>{s. \<not> G s}. P y * t \<guillemotleft>\<lambda>z. z = y\<guillemotright> x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. t P x = (\<Sum>y\<in>{s. G s}. P y * t \<guillemotleft> \<lambda>z. z = y \<guillemotright> x) + (\<Sum>y\<in>{s. \<not> G s}. P y * t \<guillemotleft> \<lambda>z. z = y \<guillemotright> x)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. t P x = (\<Sum>y\<in>{s. G s}. P y * t \<guillemotleft> \<lambda>z. z = y \<guillemotright> x) + (\<Sum>y\<in>{s. \<not> G s}. P y * t \<guillemotleft> \<lambda>z. z = y \<guillemotright> x)
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
Transformers.additive t
healthy t
sound P
[PROOF STEP]
have "t P x = (\<Sum>y\<in>UNIV. P y * t \<guillemotleft>\<lambda>z. z = y\<guillemotright> x)"
[PROOF STATE]
proof (prove)
using this:
Transformers.additive t
healthy t
sound P

goal (1 subgoal):
 1. t P x = (\<Sum>y\<in>UNIV. P y * t \<guillemotleft> \<lambda>z. z = y \<guillemotright> x)
[PROOF STEP]
by(rule additive_delta_split)
[PROOF STATE]
proof (state)
this:
t P x = (\<Sum>y\<in>UNIV. P y * t \<guillemotleft> \<lambda>z. z = y \<guillemotright> x)

goal (1 subgoal):
 1. t P x = (\<Sum>y\<in>{s. G s}. P y * t \<guillemotleft> \<lambda>z. z = y \<guillemotright> x) + (\<Sum>y\<in>{s. \<not> G s}. P y * t \<guillemotleft> \<lambda>z. z = y \<guillemotright> x)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
t P x = (\<Sum>y\<in>UNIV. P y * t \<guillemotleft> \<lambda>z. z = y \<guillemotright> x)

goal (1 subgoal):
 1. t P x = (\<Sum>y\<in>{s. G s}. P y * t \<guillemotleft> \<lambda>z. z = y \<guillemotright> x) + (\<Sum>y\<in>{s. \<not> G s}. P y * t \<guillemotleft> \<lambda>z. z = y \<guillemotright> x)
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
t P x = (\<Sum>y\<in>UNIV. P y * t \<guillemotleft> \<lambda>z. z = y \<guillemotright> x)

goal (1 subgoal):
 1. t P x = (\<Sum>y\<in>{s. G s}. P y * t \<guillemotleft> \<lambda>z. z = y \<guillemotright> x) + (\<Sum>y\<in>{s. \<not> G s}. P y * t \<guillemotleft> \<lambda>z. z = y \<guillemotright> x)
[PROOF STEP]
have "UNIV = {s. G s} \<union> {s. \<not> G s}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. UNIV = {s. G s} \<union> {s. \<not> G s}
[PROOF STEP]
by(auto)
[PROOF STATE]
proof (state)
this:
UNIV = {s. G s} \<union> {s. \<not> G s}

goal (1 subgoal):
 1. t P x = (\<Sum>y\<in>{s. G s}. P y * t \<guillemotleft> \<lambda>z. z = y \<guillemotright> x) + (\<Sum>y\<in>{s. \<not> G s}. P y * t \<guillemotleft> \<lambda>z. z = y \<guillemotright> x)
[PROOF STEP]
hence "(\<Sum>y\<in>UNIV. P y * t \<guillemotleft>\<lambda>z. z = y\<guillemotright> x) =
           (\<Sum>y\<in>{s. G s} \<union> {s. \<not> G s}. P y * t \<guillemotleft>\<lambda>z. z = y\<guillemotright> x)"
[PROOF STATE]
proof (prove)
using this:
UNIV = {s. G s} \<union> {s. \<not> G s}

goal (1 subgoal):
 1. (\<Sum>y\<in>UNIV. P y * t \<guillemotleft> \<lambda>z. z = y \<guillemotright> x) = (\<Sum>y\<in>{s. G s} \<union> {s. \<not> G s}. P y * t \<guillemotleft> \<lambda>z. z = y \<guillemotright> x)
[PROOF STEP]
by(simp)
[PROOF STATE]
proof (state)
this:
(\<Sum>y\<in>UNIV. P y * t \<guillemotleft> \<lambda>z. z = y \<guillemotright> x) = (\<Sum>y\<in>{s. G s} \<union> {s. \<not> G s}. P y * t \<guillemotleft> \<lambda>z. z = y \<guillemotright> x)

goal (1 subgoal):
 1. t P x = (\<Sum>y\<in>{s. G s}. P y * t \<guillemotleft> \<lambda>z. z = y \<guillemotright> x) + (\<Sum>y\<in>{s. \<not> G s}. P y * t \<guillemotleft> \<lambda>z. z = y \<guillemotright> x)
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
(\<Sum>y\<in>UNIV. P y * t \<guillemotleft> \<lambda>z. z = y \<guillemotright> x) = (\<Sum>y\<in>{s. G s} \<union> {s. \<not> G s}. P y * t \<guillemotleft> \<lambda>z. z = y \<guillemotright> x)

goal (1 subgoal):
 1. t P x = (\<Sum>y\<in>{s. G s}. P y * t \<guillemotleft> \<lambda>z. z = y \<guillemotright> x) + (\<Sum>y\<in>{s. \<not> G s}. P y * t \<guillemotleft> \<lambda>z. z = y \<guillemotright> x)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>y\<in>UNIV. P y * t \<guillemotleft> \<lambda>z. z = y \<guillemotright> x) = (\<Sum>y\<in>{s. G s} \<union> {s. \<not> G s}. P y * t \<guillemotleft> \<lambda>z. z = y \<guillemotright> x)

goal (1 subgoal):
 1. t P x = (\<Sum>y\<in>{s. G s}. P y * t \<guillemotleft> \<lambda>z. z = y \<guillemotright> x) + (\<Sum>y\<in>{s. \<not> G s}. P y * t \<guillemotleft> \<lambda>z. z = y \<guillemotright> x)
[PROOF STEP]
have "(\<Sum>y\<in>{s. G s} \<union> {s. \<not> G s}. P y * t \<guillemotleft>\<lambda>z. z = y\<guillemotright> x) =
        (\<Sum>y\<in>{s.   G s}. P y * t \<guillemotleft>\<lambda>z. z = y\<guillemotright> x) +
        (\<Sum>y\<in>{s. \<not> G s}. P y * t \<guillemotleft>\<lambda>z. z = y\<guillemotright> x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>y\<in>{s. G s} \<union> {s. \<not> G s}. P y * t \<guillemotleft> \<lambda>z. z = y \<guillemotright> x) = (\<Sum>y\<in>{s. G s}. P y * t \<guillemotleft> \<lambda>z. z = y \<guillemotright> x) + (\<Sum>y\<in>{s. \<not> G s}. P y * t \<guillemotleft> \<lambda>z. z = y \<guillemotright> x)
[PROOF STEP]
by(auto intro:sum.union_disjoint)
[PROOF STATE]
proof (state)
this:
(\<Sum>y\<in>{s. G s} \<union> {s. \<not> G s}. P y * t \<guillemotleft> \<lambda>z. z = y \<guillemotright> x) = (\<Sum>y\<in>{s. G s}. P y * t \<guillemotleft> \<lambda>z. z = y \<guillemotright> x) + (\<Sum>y\<in>{s. \<not> G s}. P y * t \<guillemotleft> \<lambda>z. z = y \<guillemotright> x)

goal (1 subgoal):
 1. t P x = (\<Sum>y\<in>{s. G s}. P y * t \<guillemotleft> \<lambda>z. z = y \<guillemotright> x) + (\<Sum>y\<in>{s. \<not> G s}. P y * t \<guillemotleft> \<lambda>z. z = y \<guillemotright> x)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
t P x = (\<Sum>y\<in>{s. G s}. P y * t \<guillemotleft> \<lambda>z. z = y \<guillemotright> x) + (\<Sum>y\<in>{s. \<not> G s}. P y * t \<guillemotleft> \<lambda>z. z = y \<guillemotright> x)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
t P x = (\<Sum>y\<in>{s. G s}. P y * t \<guillemotleft> \<lambda>z. z = y \<guillemotright> x) + (\<Sum>y\<in>{s. \<not> G s}. P y * t \<guillemotleft> \<lambda>z. z = y \<guillemotright> x)

goal (1 subgoal):
 1. t P x = (\<Sum>y\<in>{s. G s}. P y * t \<guillemotleft> \<lambda>z. z = y \<guillemotright> x) + (\<Sum>y\<in>{s. \<not> G s}. P y * t \<guillemotleft> \<lambda>z. z = y \<guillemotright> x)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
t P x = (\<Sum>y\<in>{s. G s}. P y * t \<guillemotleft> \<lambda>z. z = y \<guillemotright> x) + (\<Sum>y\<in>{s. \<not> G s}. P y * t \<guillemotleft> \<lambda>z. z = y \<guillemotright> x)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in monoid_mult) prod_list_prod_nth:
  "prod_list xs = (\<Prod>i = 0..< length xs. xs ! i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prod_list xs = prod ((!) xs) {0..<length xs}
[PROOF STEP]
using interv_prod_list_conv_prod_set_nat [of "(!) xs" 0 "length xs"]
[PROOF STATE]
proof (prove)
using this:
prod_list (map ((!) xs) [0..<length xs]) = prod ((!) xs) (set [0..<length xs])

goal (1 subgoal):
 1. prod_list xs = prod ((!) xs) {0..<length xs}
[PROOF STEP]
by (simp add: map_nth)


[STATEMENT]
lemma gcd_nnn: "0<n \<Longrightarrow> n = gcd n n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < n \<Longrightarrow> n = Arith2.gcd n n
[PROOF STEP]
apply (unfold gcd_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < n \<Longrightarrow> n = (SOME x. cd x n n \<and> (\<forall>y. cd y n n \<longrightarrow> y \<le> x))
[PROOF STEP]
apply (frule cd_nnn)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < n; cd n n n\<rbrakk> \<Longrightarrow> n = (SOME x. cd x n n \<and> (\<forall>y. cd y n n \<longrightarrow> y \<le> x))
[PROOF STEP]
apply (rule some_equality [symmetric])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>0 < n; cd n n n\<rbrakk> \<Longrightarrow> cd n n n \<and> (\<forall>y. cd y n n \<longrightarrow> y \<le> n)
 2. \<And>x. \<lbrakk>0 < n; cd n n n; cd x n n \<and> (\<forall>y. cd y n n \<longrightarrow> y \<le> x)\<rbrakk> \<Longrightarrow> x = n
[PROOF STEP]
apply (blast dest: cd_le)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>0 < n; cd n n n; cd x n n \<and> (\<forall>y. cd y n n \<longrightarrow> y \<le> x)\<rbrakk> \<Longrightarrow> x = n
[PROOF STEP]
apply (blast intro: le_antisym dest: cd_le)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma minus_of_nat: "f (gm x (of_nat n)) = f x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f (gm x (of_nat n)) = f x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. f (gm x (of_nat n)) = f x
[PROOF STEP]
have "f (g x (- of_nat n)) = f (g (g x (- of_nat n)) (of_nat n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f (g x (- of_nat n)) = f (g (g x (- of_nat n)) (of_nat n))
[PROOF STEP]
by (rule plus_of_nat[symmetric])
[PROOF STATE]
proof (state)
this:
f (g x (- of_nat n)) = f (g (g x (- of_nat n)) (of_nat n))

goal (1 subgoal):
 1. f (gm x (of_nat n)) = f x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
f (g x (- of_nat n)) = f (g (g x (- of_nat n)) (of_nat n))

goal (1 subgoal):
 1. f (gm x (of_nat n)) = f x
[PROOF STEP]
have "\<dots> = f (g (g x (of_int (- of_nat n))) (of_int (of_nat n)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f (g (g x (- of_nat n)) (of_nat n)) = f (g (g x (of_int (- int n))) (of_int (int n)))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
f (g (g x (- of_nat n)) (of_nat n)) = f (g (g x (of_int (- int n))) (of_int (int n)))

goal (1 subgoal):
 1. f (gm x (of_nat n)) = f x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
f (g (g x (- of_nat n)) (of_nat n)) = f (g (g x (of_int (- int n))) (of_int (int n)))

goal (1 subgoal):
 1. f (gm x (of_nat n)) = f x
[PROOF STEP]
have "\<dots> = f x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f (g (g x (of_int (- int n))) (of_int (int n))) = f x
[PROOF STEP]
by (subst periodic_arg_plus_distrib [symmetric]) (simp add: periodic_arg_plus_0)
[PROOF STATE]
proof (state)
this:
f (g (g x (of_int (- int n))) (of_int (int n))) = f x

goal (1 subgoal):
 1. f (gm x (of_nat n)) = f x
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
f (g x (- of_nat n)) = f x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
f (g x (- of_nat n)) = f x

goal (1 subgoal):
 1. f (gm x (of_nat n)) = f x
[PROOF STEP]
by (simp add: minus_eq)
[PROOF STATE]
proof (state)
this:
f (gm x (of_nat n)) = f x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma dim_poly_dim_vec_equiv:
  "dim_vec (lpoly_to_vec p) = dim_poly p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_vec (lpoly_to_vec p) = dim_poly p
[PROOF STEP]
using lpoly_to_vec.simps
[PROOF STATE]
proof (prove)
using this:
lpoly_to_vec ?p = vec (dim_poly ?p) (Abstract_Linear_Poly.coeff ?p)

goal (1 subgoal):
 1. dim_vec (lpoly_to_vec p) = dim_poly p
[PROOF STEP]
by auto


[STATEMENT]
lemma iAll_cong: "\<box> t I. f t = g t \<Longrightarrow> (\<box> t I. P (f t) t) = (\<box> t I. P (g t) t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<box> t I. f t = g t \<Longrightarrow> (\<box> t I. P (f t) t) = (\<box> t I. P (g t) t)
[PROOF STEP]
unfolding iTL_defs
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>t\<in>I. f t = g t \<Longrightarrow> (\<forall>t\<in>I. P (f t) t) = (\<forall>t\<in>I. P (g t) t)
[PROOF STEP]
by simp


[STATEMENT]
lemma psi_inv_exp:
"\<psi>^i * \<psi>inv ^i = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<psi> ^ i * \<psi>inv ^ i = 1
[PROOF STEP]
using left_right_inverse_power psi_psiinv
[PROOF STATE]
proof (prove)
using this:
?x * ?y = (1::?'a) \<Longrightarrow> ?x ^ ?n * ?y ^ ?n = (1::?'a)
\<psi> * \<psi>inv = 1

goal (1 subgoal):
 1. \<psi> ^ i * \<psi>inv ^ i = 1
[PROOF STEP]
by blast


[STATEMENT]
lemma has_field_derivative_transform_within:
  assumes "(f has_field_derivative f') (at a within S)"
    and "0 < d"
    and "a \<in> S"
    and "\<And>x. \<lbrakk>x \<in> S; dist x a < d\<rbrakk> \<Longrightarrow> f x = g x"
  shows "(g has_field_derivative f') (at a within S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (g has_field_derivative f') (at a within S)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
(f has_field_derivative f') (at a within S)
0 < d
a \<in> S
\<lbrakk>?x \<in> S; dist ?x a < d\<rbrakk> \<Longrightarrow> f ?x = g ?x

goal (1 subgoal):
 1. (g has_field_derivative f') (at a within S)
[PROOF STEP]
unfolding has_field_derivative_def
[PROOF STATE]
proof (prove)
using this:
(f has_derivative (*) f') (at a within S)
0 < d
a \<in> S
\<lbrakk>?x \<in> S; dist ?x a < d\<rbrakk> \<Longrightarrow> f ?x = g ?x

goal (1 subgoal):
 1. (g has_derivative (*) f') (at a within S)
[PROOF STEP]
by (metis has_derivative_transform_within)


[STATEMENT]
lemma remove_term_sum: "remove_term m p + monom m (coeff p m) = p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. remove_term m p + monom m (coeff p m) = p
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. remove_term m p + monom m (coeff p m) = p
[PROOF STEP]
have "coeff p = (\<lambda>m'. (coeff p m' when m' \<noteq> m) + ((coeff p m) when m'=m))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. coeff p = (\<lambda>m'. (coeff p m' when m' \<noteq> m) + (coeff p m when m' = m))
[PROOF STEP]
unfolding when_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. coeff p = (\<lambda>m'. (if m' \<noteq> m then coeff p m' else (0::'a)) + (if m' = m then coeff p m else (0::'a)))
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
coeff p = (\<lambda>m'. (coeff p m' when m' \<noteq> m) + (coeff p m when m' = m))

goal (1 subgoal):
 1. remove_term m p + monom m (coeff p m) = p
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
coeff p = (\<lambda>m'. (coeff p m' when m' \<noteq> m) + (coeff p m when m' = m))

goal (1 subgoal):
 1. remove_term m p + monom m (coeff p m) = p
[PROOF STEP]
have "coeff (remove_term m p + monom m (coeff p m)) = ..."
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. coeff (remove_term m p + monom m (coeff p m)) = (\<lambda>m'. (coeff p m' when m' \<noteq> m) + (coeff p m when m' = m))
[PROOF STEP]
using remove_term_coeff coeff_monom coeff_add
[PROOF STATE]
proof (prove)
using this:
coeff (remove_term ?m0.0 ?p) ?m = (coeff ?p ?m when ?m \<noteq> ?m0.0)
coeff (monom ?m ?a) ?m' = (?a when ?m' = ?m)
coeff ?p ?m + coeff ?q ?m = coeff (?p + ?q) ?m

goal (1 subgoal):
 1. coeff (remove_term m p + monom m (coeff p m)) = (\<lambda>m'. (coeff p m' when m' \<noteq> m) + (coeff p m when m' = m))
[PROOF STEP]
by (metis (no_types))
[PROOF STATE]
proof (state)
this:
coeff (remove_term m p + monom m (coeff p m)) = (\<lambda>m'. (coeff p m' when m' \<noteq> m) + (coeff p m when m' = m))

goal (1 subgoal):
 1. remove_term m p + monom m (coeff p m) = p
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
coeff p = (\<lambda>m'. (coeff p m' when m' \<noteq> m) + (coeff p m when m' = m))
coeff (remove_term m p + monom m (coeff p m)) = (\<lambda>m'. (coeff p m' when m' \<noteq> m) + (coeff p m when m' = m))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
coeff p = (\<lambda>m'. (coeff p m' when m' \<noteq> m) + (coeff p m when m' = m))
coeff (remove_term m p + monom m (coeff p m)) = (\<lambda>m'. (coeff p m' when m' \<noteq> m) + (coeff p m when m' = m))

goal (1 subgoal):
 1. remove_term m p + monom m (coeff p m) = p
[PROOF STEP]
using coeff_eq
[PROOF STATE]
proof (prove)
using this:
coeff p = (\<lambda>m'. (coeff p m' when m' \<noteq> m) + (coeff p m when m' = m))
coeff (remove_term m p + monom m (coeff p m)) = (\<lambda>m'. (coeff p m' when m' \<noteq> m) + (coeff p m when m' = m))
(coeff ?p = coeff ?q) = (?p = ?q)

goal (1 subgoal):
 1. remove_term m p + monom m (coeff p m) = p
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
remove_term m p + monom m (coeff p m) = p

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma fun_eq_trans: fixes t1::func and t2::func and t3::func
  assumes t12: "t1 \<sim> t2" and t23: "t2 \<sim> t3" shows "t1 \<sim> t3"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. t1 \<sim> t3
[PROOF STEP]
using t12 t23
[PROOF STATE]
proof (prove)
using this:
t1 \<sim> t2
t2 \<sim> t3

goal (1 subgoal):
 1. t1 \<sim> t3
[PROOF STEP]
unfolding fun_eq_def
[PROOF STATE]
proof (prove)
using this:
t1 \<lesssim> t2 \<and> t2 \<lesssim> t1
t2 \<lesssim> t3 \<and> t3 \<lesssim> t2

goal (1 subgoal):
 1. t1 \<lesssim> t3 \<and> t3 \<lesssim> t1
[PROOF STEP]
apply clarify
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>t1 \<lesssim> t2; t2 \<lesssim> t1; t2 \<lesssim> t3; t3 \<lesssim> t2\<rbrakk> \<Longrightarrow> t1 \<lesssim> t3 \<and> t3 \<lesssim> t1
[PROOF STEP]
apply (rule conjI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>t1 \<lesssim> t2; t2 \<lesssim> t1; t2 \<lesssim> t3; t3 \<lesssim> t2\<rbrakk> \<Longrightarrow> t1 \<lesssim> t3
 2. \<lbrakk>t1 \<lesssim> t2; t2 \<lesssim> t1; t2 \<lesssim> t3; t3 \<lesssim> t2\<rbrakk> \<Longrightarrow> t3 \<lesssim> t1
[PROOF STEP]
apply (rule fun_le_trans)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<lbrakk>t1 \<lesssim> t2; t2 \<lesssim> t1; t2 \<lesssim> t3; t3 \<lesssim> t2\<rbrakk> \<Longrightarrow> t1 \<lesssim> ?t2.7
 2. \<lbrakk>t1 \<lesssim> t2; t2 \<lesssim> t1; t2 \<lesssim> t3; t3 \<lesssim> t2\<rbrakk> \<Longrightarrow> ?t2.7 \<lesssim> t3
 3. \<lbrakk>t1 \<lesssim> t2; t2 \<lesssim> t1; t2 \<lesssim> t3; t3 \<lesssim> t2\<rbrakk> \<Longrightarrow> t3 \<lesssim> t1
[PROOF STEP]
apply assumption
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>t1 \<lesssim> t2; t2 \<lesssim> t1; t2 \<lesssim> t3; t3 \<lesssim> t2\<rbrakk> \<Longrightarrow> t2 \<lesssim> t3
 2. \<lbrakk>t1 \<lesssim> t2; t2 \<lesssim> t1; t2 \<lesssim> t3; t3 \<lesssim> t2\<rbrakk> \<Longrightarrow> t3 \<lesssim> t1
[PROOF STEP]
apply assumption
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>t1 \<lesssim> t2; t2 \<lesssim> t1; t2 \<lesssim> t3; t3 \<lesssim> t2\<rbrakk> \<Longrightarrow> t3 \<lesssim> t1
[PROOF STEP]
apply (rule fun_le_trans)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>t1 \<lesssim> t2; t2 \<lesssim> t1; t2 \<lesssim> t3; t3 \<lesssim> t2\<rbrakk> \<Longrightarrow> t3 \<lesssim> ?t2.10
 2. \<lbrakk>t1 \<lesssim> t2; t2 \<lesssim> t1; t2 \<lesssim> t3; t3 \<lesssim> t2\<rbrakk> \<Longrightarrow> ?t2.10 \<lesssim> t1
[PROOF STEP]
apply assumption
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>t1 \<lesssim> t2; t2 \<lesssim> t1; t2 \<lesssim> t3; t3 \<lesssim> t2\<rbrakk> \<Longrightarrow> t2 \<lesssim> t1
[PROOF STEP]
apply assumption
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma metric_uniform_limit_imp_uniform_limit:
  assumes f: "uniform_limit S f a F"
  assumes le: "eventually (\<lambda>x. \<forall>y\<in>S. dist (g x y) (b y) \<le> dist (f x y) (a y)) F"
  shows "uniform_limit S g b F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. uniform_limit S g b F
[PROOF STEP]
proof (rule uniform_limitI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>e. 0 < e \<Longrightarrow> \<forall>\<^sub>F n in F. \<forall>x\<in>S. dist (g n x) (b x) < e
[PROOF STEP]
fix e :: real
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>e. 0 < e \<Longrightarrow> \<forall>\<^sub>F n in F. \<forall>x\<in>S. dist (g n x) (b x) < e
[PROOF STEP]
assume "0 < e"
[PROOF STATE]
proof (state)
this:
0 < e

goal (1 subgoal):
 1. \<And>e. 0 < e \<Longrightarrow> \<forall>\<^sub>F n in F. \<forall>x\<in>S. dist (g n x) (b x) < e
[PROOF STEP]
from uniform_limitD[OF f this] le
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F n in F. \<forall>x\<in>S. dist (f n x) (a x) < e
\<forall>\<^sub>F x in F. \<forall>y\<in>S. dist (g x y) (b y) \<le> dist (f x y) (a y)
[PROOF STEP]
show "\<forall>\<^sub>F x in F. \<forall>y\<in>S. dist (g x y) (b y) < e"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F n in F. \<forall>x\<in>S. dist (f n x) (a x) < e
\<forall>\<^sub>F x in F. \<forall>y\<in>S. dist (g x y) (b y) \<le> dist (f x y) (a y)

goal (1 subgoal):
 1. \<forall>\<^sub>F x in F. \<forall>y\<in>S. dist (g x y) (b y) < e
[PROOF STEP]
by eventually_elim force
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in F. \<forall>y\<in>S. dist (g x y) (b y) < e

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma "List.find P l = Some p \<Longrightarrow> \<exists>p \<in> set l . P p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. List.find P l = Some p \<Longrightarrow> \<exists>p\<in>set l. P p
[PROOF STEP]
by (induction l) (auto split: if_splits)


[STATEMENT]
lemma resultant_zero_iff_common_root_complex: fixes f g :: "complex poly"
  assumes g: "g \<noteq> 0"
shows "resultant f g = 0 \<longleftrightarrow> (\<exists> x. poly f x = 0 \<and> poly g x = 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (resultant f g = 0) = (\<exists>x. poly f x = 0 \<and> poly g x = 0)
[PROOF STEP]
proof (cases "degree g = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. degree g = 0 \<Longrightarrow> (resultant f g = 0) = (\<exists>x. poly f x = 0 \<and> poly g x = 0)
 2. degree g \<noteq> 0 \<Longrightarrow> (resultant f g = 0) = (\<exists>x. poly f x = 0 \<and> poly g x = 0)
[PROOF STEP]
case deg: False
[PROOF STATE]
proof (state)
this:
degree g \<noteq> 0

goal (2 subgoals):
 1. degree g = 0 \<Longrightarrow> (resultant f g = 0) = (\<exists>x. poly f x = 0 \<and> poly g x = 0)
 2. degree g \<noteq> 0 \<Longrightarrow> (resultant f g = 0) = (\<exists>x. poly f x = 0 \<and> poly g x = 0)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (resultant f g = 0) = (\<exists>x. poly f x = 0 \<and> poly g x = 0)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. resultant f g = 0 \<Longrightarrow> \<exists>x. poly f x = 0 \<and> poly g x = 0
 2. \<exists>x. poly f x = 0 \<and> poly g x = 0 \<Longrightarrow> resultant f g = 0
[PROOF STEP]
assume "\<exists> x. poly f x = 0 \<and> poly g x = 0"
[PROOF STATE]
proof (state)
this:
\<exists>x. poly f x = 0 \<and> poly g x = 0

goal (2 subgoals):
 1. resultant f g = 0 \<Longrightarrow> \<exists>x. poly f x = 0 \<and> poly g x = 0
 2. \<exists>x. poly f x = 0 \<and> poly g x = 0 \<Longrightarrow> resultant f g = 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>x. poly f x = 0 \<and> poly g x = 0
[PROOF STEP]
obtain x where "poly f x = 0" "poly g x = 0"
[PROOF STATE]
proof (prove)
using this:
\<exists>x. poly f x = 0 \<and> poly g x = 0

goal (1 subgoal):
 1. (\<And>x. \<lbrakk>poly f x = 0; poly g x = 0\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
poly f x = 0
poly g x = 0

goal (2 subgoals):
 1. resultant f g = 0 \<Longrightarrow> \<exists>x. poly f x = 0 \<and> poly g x = 0
 2. \<exists>x. poly f x = 0 \<and> poly g x = 0 \<Longrightarrow> resultant f g = 0
[PROOF STEP]
from resultant_zero[OF _ this] deg
[PROOF STATE]
proof (chain)
picking this:
0 < degree f \<or> 0 < degree g \<Longrightarrow> resultant f g = 0
degree g \<noteq> 0
[PROOF STEP]
show "resultant f g = 0"
[PROOF STATE]
proof (prove)
using this:
0 < degree f \<or> 0 < degree g \<Longrightarrow> resultant f g = 0
degree g \<noteq> 0

goal (1 subgoal):
 1. resultant f g = 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
resultant f g = 0

goal (1 subgoal):
 1. resultant f g = 0 \<Longrightarrow> \<exists>x. poly f x = 0 \<and> poly g x = 0
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. resultant f g = 0 \<Longrightarrow> \<exists>x. poly f x = 0 \<and> poly g x = 0
[PROOF STEP]
assume "resultant f g = 0"
[PROOF STATE]
proof (state)
this:
resultant f g = 0

goal (1 subgoal):
 1. resultant f g = 0 \<Longrightarrow> \<exists>x. poly f x = 0 \<and> poly g x = 0
[PROOF STEP]
from resultant_zero_imp_common_factor[OF _ this] deg
[PROOF STATE]
proof (chain)
picking this:
0 < degree f \<or> 0 < degree g \<Longrightarrow> \<not> comm_monoid_mult_class.coprime f g
degree g \<noteq> 0
[PROOF STEP]
have "\<not> coprime f g"
[PROOF STATE]
proof (prove)
using this:
0 < degree f \<or> 0 < degree g \<Longrightarrow> \<not> comm_monoid_mult_class.coprime f g
degree g \<noteq> 0

goal (1 subgoal):
 1. \<not> comm_monoid_mult_class.coprime f g
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<not> comm_monoid_mult_class.coprime f g

goal (1 subgoal):
 1. resultant f g = 0 \<Longrightarrow> \<exists>x. poly f x = 0 \<and> poly g x = 0
[PROOF STEP]
from this[unfolded not_coprime_iff_common_factor]
[PROOF STATE]
proof (chain)
picking this:
\<exists>r. r dvd f \<and> r dvd g \<and> \<not> is_unit r
[PROOF STEP]
obtain r where
       rf: "r dvd f" and rg: "r dvd g" and r: "\<not> is_unit r"
[PROOF STATE]
proof (prove)
using this:
\<exists>r. r dvd f \<and> r dvd g \<and> \<not> is_unit r

goal (1 subgoal):
 1. (\<And>r. \<lbrakk>r dvd f; r dvd g; \<not> is_unit r\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
r dvd f
r dvd g
\<not> is_unit r

goal (1 subgoal):
 1. resultant f g = 0 \<Longrightarrow> \<exists>x. poly f x = 0 \<and> poly g x = 0
[PROOF STEP]
from rg g
[PROOF STATE]
proof (chain)
picking this:
r dvd g
g \<noteq> 0
[PROOF STEP]
have r0: "r \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
r dvd g
g \<noteq> 0

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

goal (1 subgoal):
 1. resultant f g = 0 \<Longrightarrow> \<exists>x. poly f x = 0 \<and> poly g x = 0
[PROOF STEP]
with r
[PROOF STATE]
proof (chain)
picking this:
\<not> is_unit r
r \<noteq> 0
[PROOF STEP]
have degr: "degree r \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
\<not> is_unit r
r \<noteq> 0

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

goal (1 subgoal):
 1. resultant f g = 0 \<Longrightarrow> \<exists>x. poly f x = 0 \<and> poly g x = 0
[PROOF STEP]
hence "\<not> constant (poly r)"
[PROOF STATE]
proof (prove)
using this:
degree r \<noteq> 0

goal (1 subgoal):
 1. \<not> constant (poly r)
[PROOF STEP]
by (simp add: constant_degree)
[PROOF STATE]
proof (state)
this:
\<not> constant (poly r)

goal (1 subgoal):
 1. resultant f g = 0 \<Longrightarrow> \<exists>x. poly f x = 0 \<and> poly g x = 0
[PROOF STEP]
from fundamental_theorem_of_algebra[OF this]
[PROOF STATE]
proof (chain)
picking this:
\<exists>z. poly r z = 0
[PROOF STEP]
obtain a where root: "poly r a = 0"
[PROOF STATE]
proof (prove)
using this:
\<exists>z. poly r z = 0

goal (1 subgoal):
 1. (\<And>a. poly r a = 0 \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
poly r a = 0

goal (1 subgoal):
 1. resultant f g = 0 \<Longrightarrow> \<exists>x. poly f x = 0 \<and> poly g x = 0
[PROOF STEP]
from rf rg root
[PROOF STATE]
proof (chain)
picking this:
r dvd f
r dvd g
poly r a = 0
[PROOF STEP]
show "\<exists> x. poly f x = 0 \<and> poly g x = 0"
[PROOF STATE]
proof (prove)
using this:
r dvd f
r dvd g
poly r a = 0

goal (1 subgoal):
 1. \<exists>x. poly f x = 0 \<and> poly g x = 0
[PROOF STEP]
by (intro exI[of _ a], auto simp: dvd_def)
[PROOF STATE]
proof (state)
this:
\<exists>x. poly f x = 0 \<and> poly g x = 0

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(resultant f g = 0) = (\<exists>x. poly f x = 0 \<and> poly g x = 0)

goal (1 subgoal):
 1. degree g = 0 \<Longrightarrow> (resultant f g = 0) = (\<exists>x. poly f x = 0 \<and> poly g x = 0)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. degree g = 0 \<Longrightarrow> (resultant f g = 0) = (\<exists>x. poly f x = 0 \<and> poly g x = 0)
[PROOF STEP]
case deg: True
[PROOF STATE]
proof (state)
this:
degree g = 0

goal (1 subgoal):
 1. degree g = 0 \<Longrightarrow> (resultant f g = 0) = (\<exists>x. poly f x = 0 \<and> poly g x = 0)
[PROOF STEP]
from degree0_coeffs[OF deg]
[PROOF STATE]
proof (chain)
picking this:
\<exists>a. g = [:a:]
[PROOF STEP]
obtain c where gc: "g = [:c:]"
[PROOF STATE]
proof (prove)
using this:
\<exists>a. g = [:a:]

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

goal (1 subgoal):
 1. degree g = 0 \<Longrightarrow> (resultant f g = 0) = (\<exists>x. poly f x = 0 \<and> poly g x = 0)
[PROOF STEP]
from gc g
[PROOF STATE]
proof (chain)
picking this:
g = [:c:]
g \<noteq> 0
[PROOF STEP]
have c: "c \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
g = [:c:]
g \<noteq> 0

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

goal (1 subgoal):
 1. degree g = 0 \<Longrightarrow> (resultant f g = 0) = (\<exists>x. poly f x = 0 \<and> poly g x = 0)
[PROOF STEP]
hence "resultant f g \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
c \<noteq> 0

goal (1 subgoal):
 1. resultant f g \<noteq> 0
[PROOF STEP]
unfolding gc resultant_const
[PROOF STATE]
proof (prove)
using this:
c \<noteq> 0

goal (1 subgoal):
 1. c ^ degree f \<noteq> 0
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
resultant f g \<noteq> 0

goal (1 subgoal):
 1. degree g = 0 \<Longrightarrow> (resultant f g = 0) = (\<exists>x. poly f x = 0 \<and> poly g x = 0)
[PROOF STEP]
with gc c
[PROOF STATE]
proof (chain)
picking this:
g = [:c:]
c \<noteq> 0
resultant f g \<noteq> 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
g = [:c:]
c \<noteq> 0
resultant f g \<noteq> 0

goal (1 subgoal):
 1. (resultant f g = 0) = (\<exists>x. poly f x = 0 \<and> poly g x = 0)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(resultant f g = 0) = (\<exists>x. poly f x = 0 \<and> poly g x = 0)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma coord_partial_eval_pvar:
  assumes "\<one> \<noteq> \<zero>"
  assumes "as \<in> carrier (R\<^bsup>n\<^esup>)"
  assumes "i \<in> S \<inter> {..<n}"
  shows "coord_partial_eval R S as (pvar R i) = coord_const (as!i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. coord_partial_eval R S as (pvar R i) = R.indexed_const (as ! i)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. coord_partial_eval R S as (pvar R i) = R.indexed_const (as ! i)
[PROOF STEP]
have 0: "i \<in> S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i \<in> S
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<one> \<noteq> \<zero>
as \<in> carrier (R\<^bsup>n\<^esup>)
i \<in> S \<inter> {..<n}

goal (1 subgoal):
 1. i \<in> S
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
i \<in> S

goal (1 subgoal):
 1. coord_partial_eval R S as (pvar R i) = R.indexed_const (as ! i)
[PROOF STEP]
have "i < length as"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i < length as
[PROOF STEP]
by (metis IntD2 assms(2) assms(3) cartesian_power_car_memE lessThan_iff)
[PROOF STATE]
proof (state)
this:
i < length as

goal (1 subgoal):
 1. coord_partial_eval R S as (pvar R i) = R.indexed_const (as ! i)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
i < length as
[PROOF STEP]
have "(point_to_eval_map R as i) = as!i"
[PROOF STATE]
proof (prove)
using this:
i < length as

goal (1 subgoal):
 1. (if i < length as then as ! i else \<zero>) = as ! i
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
(if i < length as then as ! i else \<zero>) = as ! i

goal (1 subgoal):
 1. coord_partial_eval R S as (pvar R i) = R.indexed_const (as ! i)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(if i < length as then as ! i else \<zero>) = as ! i
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(if i < length as then as ! i else \<zero>) = as ! i

goal (1 subgoal):
 1. coord_partial_eval R S as (pvar R i) = R.indexed_const (as ! i)
[PROOF STEP]
unfolding coord_partial_eval_def var_to_IP_def
[PROOF STATE]
proof (prove)
using this:
(if i < length as then as ! i else \<zero>) = as ! i

goal (1 subgoal):
 1. poly_eval R S (\<lambda>i. if i < length as then as ! i else \<zero>) (mset_to_IP R {#i#}) = R.indexed_const (as ! i)
[PROOF STEP]
using 0 assms point_to_eval_map_closed[of as n]
        R.poly_eval_index[of "point_to_eval_map R as" S i ]
[PROOF STATE]
proof (prove)
using this:
(if i < length as then as ! i else \<zero>) = as ! i
i \<in> S
\<one> \<noteq> \<zero>
as \<in> carrier (R\<^bsup>n\<^esup>)
i \<in> S \<inter> {..<n}
as \<in> carrier (R\<^bsup>n\<^esup>) \<Longrightarrow> (\<lambda>i. if i < length as then as ! i else \<zero>) \<in> UNIV \<rightarrow> carrier R
\<lbrakk>\<one> \<noteq> \<zero>; (\<lambda>i. if i < length as then as ! i else \<zero>) \<in> UNIV \<rightarrow> carrier R\<rbrakk> \<Longrightarrow> poly_eval R S (\<lambda>i. if i < length as then as ! i else \<zero>) (mset_to_IP R {#i#}) = (if i \<in> S then R.indexed_const (if i < length as then as ! i else \<zero>) else mset_to_IP R {#i#})

goal (1 subgoal):
 1. poly_eval R S (\<lambda>i. if i < length as then as ! i else \<zero>) (mset_to_IP R {#i#}) = R.indexed_const (as ! i)
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
coord_partial_eval R S as (pvar R i) = R.indexed_const (as ! i)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma closed_Un [continuous_intros, intro]: "closed S \<Longrightarrow> closed T \<Longrightarrow> closed (S \<union> T)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>closed S; closed T\<rbrakk> \<Longrightarrow> closed (S \<union> T)
[PROOF STEP]
unfolding closed_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>open (- S); open (- T)\<rbrakk> \<Longrightarrow> open (- (S \<union> T))
[PROOF STEP]
by auto


[STATEMENT]
lemma inf_right_dist_sup:
  "(-y \<squnion> -z) \<sqinter> -x = (-y \<sqinter> -x) \<squnion> (-z \<sqinter> -x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (- y \<squnion> - z) \<sqinter> - x = - y \<sqinter> - x \<squnion> - z \<sqinter> - x
[PROOF STEP]
by (metis inf_commutative inf_left_dist_sup sub_sup_closed)


[STATEMENT]
lemma ipoly_smult_0_iff: assumes c: "c \<noteq> 0"
  shows "(ipoly (smult c p) x = (0 :: real)) = (ipoly p x = 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (poly (real_of_int_poly (smult c p)) x = 0) = (poly (real_of_int_poly p) x = 0)
[PROOF STEP]
using c
[PROOF STATE]
proof (prove)
using this:
c \<noteq> 0

goal (1 subgoal):
 1. (poly (real_of_int_poly (smult c p)) x = 0) = (poly (real_of_int_poly p) x = 0)
[PROOF STEP]
by (simp add: hom_distribs)


[STATEMENT]
lemma two_power_eq:
  "\<lbrakk>n < LENGTH('a); m < LENGTH('a)\<rbrakk>
   \<Longrightarrow> ((2::'a::len word) ^ n = 2 ^ m) = (n = m)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>n < LENGTH('a); m < LENGTH('a)\<rbrakk> \<Longrightarrow> (2 ^ n = 2 ^ m) = (n = m)
[PROOF STEP]
apply safe
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>n < LENGTH('a); m < LENGTH('a); 2 ^ n = 2 ^ m\<rbrakk> \<Longrightarrow> n = m
[PROOF STEP]
apply (rule order_antisym)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>n < LENGTH('a); m < LENGTH('a); 2 ^ n = 2 ^ m\<rbrakk> \<Longrightarrow> n \<le> m
 2. \<lbrakk>n < LENGTH('a); m < LENGTH('a); 2 ^ n = 2 ^ m\<rbrakk> \<Longrightarrow> m \<le> n
[PROOF STEP]
apply (simp add: power_le_mono[where 'a='a])+
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma gauss_int_norm_uminus [simp]: "gauss_int_norm (-z) = gauss_int_norm z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. gauss_int_norm (- z) = gauss_int_norm z
[PROOF STEP]
by (simp add: gauss_int_norm_def)


[STATEMENT]
lemma erfc_has_field_derivative:
  "(erfc has_field_derivative -of_real (2 / sqrt pi) * exp (-(z^2))) (at z within A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (erfc has_field_derivative - of_real (2 / sqrt pi) * exp (- z\<^sup>2)) (at z within A)
[PROOF STEP]
unfolding erfc_def [abs_def]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>z. (1::'a) - erf z) has_field_derivative - of_real (2 / sqrt pi) * exp (- z\<^sup>2)) (at z within A)
[PROOF STEP]
by (auto intro!: derivative_eq_intros)


[STATEMENT]
lemma (in monoid) isgcd_divides_r:
  assumes "b divides a"
    and "a \<in> carrier G"  "b \<in> carrier G"
  shows "b gcdof a b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. b gcdof a b
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
b divides a
a \<in> carrier G
b \<in> carrier G

goal (1 subgoal):
 1. b gcdof a b
[PROOF STEP]
unfolding isgcd_def
[PROOF STATE]
proof (prove)
using this:
b divides a
a \<in> carrier G
b \<in> carrier G

goal (1 subgoal):
 1. b divides a \<and> b divides b \<and> (\<forall>y\<in>carrier G. y divides a \<and> y divides b \<longrightarrow> y divides b)
[PROOF STEP]
by fast


[STATEMENT]
lemma (in monoid_mult) prod_list_prod_nth: "prod_list xs = (\<Prod>i<length xs. xs ! i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prod_list xs = prod ((!) xs) {..<length xs}
[PROOF STEP]
by (induction xs) (auto simp: prod.lessThan_Suc_shift simp del: prod.lessThan_Suc)


[STATEMENT]
lemma type_to_set1:
  shows "class.nontriv TYPE('b)" (is ?a) and "m=CARD('b)" (is ?b)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. class.nontriv TYPE('b) &&& m = CARD('b)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. class.nontriv TYPE('b)
 2. m = CARD('b)
[PROOF STEP]
from local_typedef1
[PROOF STATE]
proof (chain)
picking this:
\<exists>Rep Abs. type_definition Rep Abs {0..<int m}
[PROOF STEP]
obtain Rep::"('b \<Rightarrow> int)" and Abs
    where t: "type_definition Rep Abs {0..<m :: int}"
[PROOF STATE]
proof (prove)
using this:
\<exists>Rep Abs. type_definition Rep Abs {0..<int m}

goal (1 subgoal):
 1. (\<And>Rep Abs. type_definition Rep Abs {0..<int m} \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
type_definition Rep Abs {0..<int m}

goal (2 subgoals):
 1. class.nontriv TYPE('b)
 2. m = CARD('b)
[PROOF STEP]
have "card (UNIV :: 'b set) = card {0..<m}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. CARD('b) = card {0..<m}
[PROOF STEP]
using t type_definition.card
[PROOF STATE]
proof (prove)
using this:
type_definition Rep Abs {0..<int m}
type_definition ?Rep ?Abs ?A \<Longrightarrow> CARD(?'b) = card ?A

goal (1 subgoal):
 1. CARD('b) = card {0..<m}
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
CARD('b) = card {0..<m}

goal (2 subgoals):
 1. class.nontriv TYPE('b)
 2. m = CARD('b)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
CARD('b) = card {0..<m}

goal (2 subgoals):
 1. class.nontriv TYPE('b)
 2. m = CARD('b)
[PROOF STEP]
have "... = m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card {0..<m} = m
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
card {0..<m} = m

goal (2 subgoals):
 1. class.nontriv TYPE('b)
 2. m = CARD('b)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
CARD('b) = m
[PROOF STEP]
show ?b
[PROOF STATE]
proof (prove)
using this:
CARD('b) = m

goal (1 subgoal):
 1. m = CARD('b)
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
m = CARD('b)

goal (1 subgoal):
 1. class.nontriv TYPE('b)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
m = CARD('b)
[PROOF STEP]
show ?a
[PROOF STATE]
proof (prove)
using this:
m = CARD('b)

goal (1 subgoal):
 1. class.nontriv TYPE('b)
[PROOF STEP]
unfolding class.nontriv_def
[PROOF STATE]
proof (prove)
using this:
m = CARD('b)

goal (1 subgoal):
 1. 1 < CARD('b)
[PROOF STEP]
using m
[PROOF STATE]
proof (prove)
using this:
m = CARD('b)
1 < m

goal (1 subgoal):
 1. 1 < CARD('b)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
class.nontriv TYPE('b)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma drlex_pm_trans: "drlex_pm s t \<Longrightarrow> drlex_pm t u \<Longrightarrow> drlex_pm s u"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>drlex_pm s t; drlex_pm t u\<rbrakk> \<Longrightarrow> drlex_pm s u
[PROOF STEP]
unfolding drlex_pm_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>dord_pm (\<lambda>s t. lex_pm t s) s t; dord_pm (\<lambda>s t. lex_pm t s) t u\<rbrakk> \<Longrightarrow> dord_pm (\<lambda>s t. lex_pm t s) s u
[PROOF STEP]
using lex_pm_trans
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>lex_pm ?s ?t; lex_pm ?t ?u\<rbrakk> \<Longrightarrow> lex_pm ?s ?u

goal (1 subgoal):
 1. \<lbrakk>dord_pm (\<lambda>s t. lex_pm t s) s t; dord_pm (\<lambda>s t. lex_pm t s) t u\<rbrakk> \<Longrightarrow> dord_pm (\<lambda>s t. lex_pm t s) s u
[PROOF STEP]
by (rule dord_pm_trans)


[STATEMENT]
lemma eventually_all_finite2:
  fixes P :: "('a::finite) \<Rightarrow> 'b \<Rightarrow> bool"
  assumes h:"\<forall>i. eventually (P i) F"
  shows "eventually (\<lambda>x. \<forall>i. P i x) F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F x in F. \<forall>i. P i x
[PROOF STEP]
proof(unfold eventually_def)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Rep_filter F (\<lambda>x. \<forall>i. P i x)
[PROOF STEP]
let ?F = "Rep_filter F"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Rep_filter F (\<lambda>x. \<forall>i. P i x)
[PROOF STEP]
have obs: "\<forall>i. ?F (P i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>i. Rep_filter F (P i)
[PROOF STEP]
using h
[PROOF STATE]
proof (prove)
using this:
\<forall>i. eventually (P i) F

goal (1 subgoal):
 1. \<forall>i. Rep_filter F (P i)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>i. Rep_filter F (P i)

goal (1 subgoal):
 1. Rep_filter F (\<lambda>x. \<forall>i. P i x)
[PROOF STEP]
have "?F (\<lambda>x. \<forall>i \<in> UNIV. P i x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Rep_filter F (\<lambda>x. \<forall>i\<in>UNIV. P i x)
[PROOF STEP]
apply(rule finite_induct)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. finite UNIV
 2. Rep_filter F (\<lambda>x. \<forall>i\<in>{}. P i x)
 3. \<And>x Fa. \<lbrakk>finite Fa; x \<notin> Fa; Rep_filter F (\<lambda>x. \<forall>i\<in>Fa. P i x)\<rbrakk> \<Longrightarrow> Rep_filter F (\<lambda>xa. \<forall>i\<in>insert x Fa. P i xa)
[PROOF STEP]
by(auto intro: eventually_conj simp: obs h)
[PROOF STATE]
proof (state)
this:
Rep_filter F (\<lambda>x. \<forall>i\<in>UNIV. P i x)

goal (1 subgoal):
 1. Rep_filter F (\<lambda>x. \<forall>i. P i x)
[PROOF STEP]
thus "?F (\<lambda>x. \<forall>i. P i x)"
[PROOF STATE]
proof (prove)
using this:
Rep_filter F (\<lambda>x. \<forall>i\<in>UNIV. P i x)

goal (1 subgoal):
 1. Rep_filter F (\<lambda>x. \<forall>i. P i x)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Rep_filter F (\<lambda>x. \<forall>i. P i x)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma conjugate_square_greater_0_vec[simp]:
  fixes v :: "'a :: {conjugatable_ordered_ring,semiring_no_zero_divisors} vec"
  assumes "v \<in> carrier_vec n"
  shows "v \<bullet>c v > 0 \<longleftrightarrow> v \<noteq> 0\<^sub>v n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((0::'a) < v \<bullet>c v) = (v \<noteq> 0\<^sub>v n)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
v \<in> carrier_vec n

goal (1 subgoal):
 1. ((0::'a) < v \<bullet>c v) = (v \<noteq> 0\<^sub>v n)
[PROOF STEP]
by (auto simp: less_le)


[STATEMENT]
lemma stream_pred_coinduct[case_names stream_pred, coinduct pred: pred_stream]:
    assumes "R w"
    assumes "\<And> a w. R (a ## w) \<Longrightarrow> P a \<and> R w"
    shows "pred_stream P w"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pred_stream P w
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
R w
R (?a ## ?w) \<Longrightarrow> P ?a \<and> R ?w

goal (1 subgoal):
 1. pred_stream P w
[PROOF STEP]
unfolding stream.pred_rel eq_onp_def
[PROOF STATE]
proof (prove)
using this:
R w
R (?a ## ?w) \<Longrightarrow> P ?a \<and> R ?w

goal (1 subgoal):
 1. stream_all2 (\<lambda>x y. P x \<and> x = y) w w
[PROOF STEP]
by (coinduction arbitrary: w) (auto)


[STATEMENT]
lemma triangle_set_graph_edge_ss:
  assumes "uedges Gnew \<subseteq> uedges G"
  assumes "uverts Gnew = uverts G"
  shows "triangle_set Gnew \<subseteq> triangle_set G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. triangle_set Gnew \<subseteq> triangle_set G
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
uedges Gnew \<subseteq> uedges G
uverts Gnew = uverts G

goal (1 subgoal):
 1. triangle_set Gnew \<subseteq> triangle_set G
[PROOF STEP]
unfolding triangle_set_def
[PROOF STATE]
proof (prove)
using this:
uedges Gnew \<subseteq> uedges G
uverts Gnew = uverts G

goal (1 subgoal):
 1. {{x, y, z} |x y z. triangle_in_graph x y z Gnew} \<subseteq> {{x, y, z} |x y z. triangle_in_graph x y z G}
[PROOF STEP]
by (blast intro: triangle_in_graph_ss)


[STATEMENT]
lemma degree_none[simp]: "\<not> v  \<in> V \<Longrightarrow> degree v = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. v \<notin> V \<Longrightarrow> degree v = 0
[PROOF STEP]
using degree_def degree_no_loops has_loop_in_verts incident_edges_sedges incident_sedges_empty
[PROOF STATE]
proof (prove)
using this:
degree ?v \<equiv> card (incident_sedges ?v) + 2 * card (incident_loops ?v)
\<not> has_loop ?v \<Longrightarrow> degree ?v = card (incident_edges ?v)
has_loop ?v \<Longrightarrow> ?v \<in> V
\<not> has_loop ?v \<Longrightarrow> incident_edges ?v = incident_sedges ?v
?v \<notin> V \<Longrightarrow> incident_sedges ?v = {}

goal (1 subgoal):
 1. v \<notin> V \<Longrightarrow> degree v = 0
[PROOF STEP]
by auto


[STATEMENT]
lemma inc_vec_of_bij_betw:
  assumes "inj_on f (set Vs)"
  assumes "bl \<subseteq> (set Vs)"
  shows "inc_vec_of Vs bl = inc_vec_of (map f Vs) (f ` bl)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inc_vec_of Vs bl = inc_vec_of (map f Vs) (f ` bl)
[PROOF STEP]
proof (intro eq_vecI, simp_all add: inc_vec_dim)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i. i < length Vs \<Longrightarrow> inc_vec_of Vs bl $ i = inc_vec_of (map f Vs) (f ` bl) $ i
[PROOF STEP]
fix i
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i. i < length Vs \<Longrightarrow> inc_vec_of Vs bl $ i = inc_vec_of (map f Vs) (f ` bl) $ i
[PROOF STEP]
assume "i < length Vs"
[PROOF STATE]
proof (state)
this:
i < length Vs

goal (1 subgoal):
 1. \<And>i. i < length Vs \<Longrightarrow> inc_vec_of Vs bl $ i = inc_vec_of (map f Vs) (f ` bl) $ i
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
i < length Vs
[PROOF STEP]
have "Vs ! i \<in> bl \<longleftrightarrow> (map f Vs) ! i \<in> (f ` bl)"
[PROOF STATE]
proof (prove)
using this:
i < length Vs

goal (1 subgoal):
 1. (Vs ! i \<in> bl) = (map f Vs ! i \<in> f ` bl)
[PROOF STEP]
by (metis assms(1) assms(2) inj_on_image_mem_iff nth_map nth_mem)
[PROOF STATE]
proof (state)
this:
(Vs ! i \<in> bl) = (map f Vs ! i \<in> f ` bl)

goal (1 subgoal):
 1. \<And>i. i < length Vs \<Longrightarrow> inc_vec_of Vs bl $ i = inc_vec_of (map f Vs) (f ` bl) $ i
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(Vs ! i \<in> bl) = (map f Vs ! i \<in> f ` bl)
[PROOF STEP]
show "inc_vec_of Vs bl $ i = inc_vec_of (map f Vs) (f ` bl) $ i"
[PROOF STATE]
proof (prove)
using this:
(Vs ! i \<in> bl) = (map f Vs ! i \<in> f ` bl)

goal (1 subgoal):
 1. inc_vec_of Vs bl $ i = inc_vec_of (map f Vs) (f ` bl) $ i
[PROOF STEP]
using inc_vec_index
[PROOF STATE]
proof (prove)
using this:
(Vs ! i \<in> bl) = (map f Vs ! i \<in> f ` bl)
?i < length ?Vs \<Longrightarrow> inc_vec_of ?Vs ?bl $ ?i = (if ?Vs ! ?i \<in> ?bl then 1::?'b else (0::?'b))

goal (1 subgoal):
 1. inc_vec_of Vs bl $ i = inc_vec_of (map f Vs) (f ` bl) $ i
[PROOF STEP]
by (metis \<open>i < length Vs\<close> length_map)
[PROOF STATE]
proof (state)
this:
inc_vec_of Vs bl $ i = inc_vec_of (map f Vs) (f ` bl) $ i

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma pow_list_set :
  "set (map set (pow_list xs)) = Pow (set xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (map set (pow_list xs)) = Pow (set xs)
[PROOF STEP]
proof (induction xs)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. set (map set (pow_list [])) = Pow (set [])
 2. \<And>a xs. set (map set (pow_list xs)) = Pow (set xs) \<Longrightarrow> set (map set (pow_list (a # xs))) = Pow (set (a # xs))
[PROOF STEP]
case Nil
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. set (map set (pow_list [])) = Pow (set [])
 2. \<And>a xs. set (map set (pow_list xs)) = Pow (set xs) \<Longrightarrow> set (map set (pow_list (a # xs))) = Pow (set (a # xs))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (map set (pow_list [])) = Pow (set [])
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
set (map set (pow_list [])) = Pow (set [])

goal (1 subgoal):
 1. \<And>a xs. set (map set (pow_list xs)) = Pow (set xs) \<Longrightarrow> set (map set (pow_list (a # xs))) = Pow (set (a # xs))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a xs. set (map set (pow_list xs)) = Pow (set xs) \<Longrightarrow> set (map set (pow_list (a # xs))) = Pow (set (a # xs))
[PROOF STEP]
case (Cons x xs)
[PROOF STATE]
proof (state)
this:
set (map set (pow_list xs)) = Pow (set xs)

goal (1 subgoal):
 1. \<And>a xs. set (map set (pow_list xs)) = Pow (set xs) \<Longrightarrow> set (map set (pow_list (a # xs))) = Pow (set (a # xs))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
set (map set (pow_list xs)) = Pow (set xs)

goal (1 subgoal):
 1. \<And>a xs. set (map set (pow_list xs)) = Pow (set xs) \<Longrightarrow> set (map set (pow_list (a # xs))) = Pow (set (a # xs))
[PROOF STEP]
have "Pow (set (x # xs)) = Pow (set xs) \<union> (image (insert x) (Pow (set xs)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Pow (set (x # xs)) = Pow (set xs) \<union> insert x ` Pow (set xs)
[PROOF STEP]
by (simp add: Pow_insert)
[PROOF STATE]
proof (state)
this:
Pow (set (x # xs)) = Pow (set xs) \<union> insert x ` Pow (set xs)

goal (1 subgoal):
 1. \<And>a xs. set (map set (pow_list xs)) = Pow (set xs) \<Longrightarrow> set (map set (pow_list (a # xs))) = Pow (set (a # xs))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
Pow (set (x # xs)) = Pow (set xs) \<union> insert x ` Pow (set xs)

goal (1 subgoal):
 1. \<And>a xs. set (map set (pow_list xs)) = Pow (set xs) \<Longrightarrow> set (map set (pow_list (a # xs))) = Pow (set (a # xs))
[PROOF STEP]
have "set (map set (pow_list (x#xs)))
                  = set (map set (pow_list xs)) \<union> (image (insert x) (set (map set (pow_list xs))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (map set (pow_list (x # xs))) = set (map set (pow_list xs)) \<union> insert x ` set (map set (pow_list xs))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. set (map set (pow_list (x # xs))) = set (map set (pow_list xs)) \<union> insert x ` set (map set (pow_list xs))
[PROOF STEP]
have "\<And> ys . ys \<in> set (map set (pow_list (x#xs)))
            \<Longrightarrow> ys \<in> set (map set (pow_list xs)) \<union> (image (insert x) (set (map set (pow_list xs))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>ys. ys \<in> set (map set (pow_list (x # xs))) \<Longrightarrow> ys \<in> set (map set (pow_list xs)) \<union> insert x ` set (map set (pow_list xs))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>ys. ys \<in> set (map set (pow_list (x # xs))) \<Longrightarrow> ys \<in> set (map set (pow_list xs)) \<union> insert x ` set (map set (pow_list xs))
[PROOF STEP]
fix ys
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>ys. ys \<in> set (map set (pow_list (x # xs))) \<Longrightarrow> ys \<in> set (map set (pow_list xs)) \<union> insert x ` set (map set (pow_list xs))
[PROOF STEP]
assume "ys \<in> set (map set (pow_list (x#xs)))"
[PROOF STATE]
proof (state)
this:
ys \<in> set (map set (pow_list (x # xs)))

goal (1 subgoal):
 1. \<And>ys. ys \<in> set (map set (pow_list (x # xs))) \<Longrightarrow> ys \<in> set (map set (pow_list xs)) \<union> insert x ` set (map set (pow_list xs))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
ys \<in> set (map set (pow_list (x # xs)))
[PROOF STEP]
consider (a) "ys \<in> set (map set (pow_list xs))" |
                    (b) "ys \<in> set (map set (map ((#) x) (pow_list xs)))"
[PROOF STATE]
proof (prove)
using this:
ys \<in> set (map set (pow_list (x # xs)))

goal (1 subgoal):
 1. \<lbrakk>ys \<in> set (map set (pow_list xs)) \<Longrightarrow> thesis; ys \<in> set (map set (map ((#) x) (pow_list xs))) \<Longrightarrow> thesis\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
unfolding pow_list.simps Let_def
[PROOF STATE]
proof (prove)
using this:
ys \<in> set (map set (pow_list xs @ map ((#) x) (pow_list xs)))

goal (1 subgoal):
 1. \<lbrakk>ys \<in> set (map set (pow_list xs)) \<Longrightarrow> thesis; ys \<in> set (map set (map ((#) x) (pow_list xs))) \<Longrightarrow> thesis\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<lbrakk>ys \<in> set (map set (pow_list xs)) \<Longrightarrow> ?thesis; ys \<in> set (map set (map ((#) x) (pow_list xs))) \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. \<And>ys. ys \<in> set (map set (pow_list (x # xs))) \<Longrightarrow> ys \<in> set (map set (pow_list xs)) \<union> insert x ` set (map set (pow_list xs))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>ys \<in> set (map set (pow_list xs)) \<Longrightarrow> ?thesis; ys \<in> set (map set (map ((#) x) (pow_list xs))) \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis
[PROOF STEP]
show "ys \<in> set (map set (pow_list xs)) \<union> (image (insert x) (set (map set (pow_list xs))))"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>ys \<in> set (map set (pow_list xs)) \<Longrightarrow> ?thesis; ys \<in> set (map set (map ((#) x) (pow_list xs))) \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. ys \<in> set (map set (pow_list xs)) \<union> insert x ` set (map set (pow_list xs))
[PROOF STEP]
by (cases; auto)
[PROOF STATE]
proof (state)
this:
ys \<in> set (map set (pow_list xs)) \<union> insert x ` set (map set (pow_list xs))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
?ys \<in> set (map set (pow_list (x # xs))) \<Longrightarrow> ?ys \<in> set (map set (pow_list xs)) \<union> insert x ` set (map set (pow_list xs))

goal (1 subgoal):
 1. set (map set (pow_list (x # xs))) = set (map set (pow_list xs)) \<union> insert x ` set (map set (pow_list xs))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
?ys \<in> set (map set (pow_list (x # xs))) \<Longrightarrow> ?ys \<in> set (map set (pow_list xs)) \<union> insert x ` set (map set (pow_list xs))

goal (1 subgoal):
 1. set (map set (pow_list (x # xs))) = set (map set (pow_list xs)) \<union> insert x ` set (map set (pow_list xs))
[PROOF STEP]
have "\<And> ys . ys \<in> set (map set (pow_list xs))
                            \<union> (image (insert x) (set (map set (pow_list xs))))
                    \<Longrightarrow> ys \<in> set (map set (pow_list (x#xs)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>ys. ys \<in> set (map set (pow_list xs)) \<union> insert x ` set (map set (pow_list xs)) \<Longrightarrow> ys \<in> set (map set (pow_list (x # xs)))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>ys. ys \<in> set (map set (pow_list xs)) \<union> insert x ` set (map set (pow_list xs)) \<Longrightarrow> ys \<in> set (map set (pow_list (x # xs)))
[PROOF STEP]
fix ys
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>ys. ys \<in> set (map set (pow_list xs)) \<union> insert x ` set (map set (pow_list xs)) \<Longrightarrow> ys \<in> set (map set (pow_list (x # xs)))
[PROOF STEP]
assume "ys \<in> set (map set (pow_list xs))
                            \<union> (image (insert x) (set (map set (pow_list xs))))"
[PROOF STATE]
proof (state)
this:
ys \<in> set (map set (pow_list xs)) \<union> insert x ` set (map set (pow_list xs))

goal (1 subgoal):
 1. \<And>ys. ys \<in> set (map set (pow_list xs)) \<union> insert x ` set (map set (pow_list xs)) \<Longrightarrow> ys \<in> set (map set (pow_list (x # xs)))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
ys \<in> set (map set (pow_list xs)) \<union> insert x ` set (map set (pow_list xs))
[PROOF STEP]
consider (a) "ys \<in> set (map set (pow_list xs))" |
                    (b) "ys \<in> (image (insert x) (set (map set (pow_list xs))))"
[PROOF STATE]
proof (prove)
using this:
ys \<in> set (map set (pow_list xs)) \<union> insert x ` set (map set (pow_list xs))

goal (1 subgoal):
 1. \<lbrakk>ys \<in> set (map set (pow_list xs)) \<Longrightarrow> thesis; ys \<in> insert x ` set (map set (pow_list xs)) \<Longrightarrow> thesis\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<lbrakk>ys \<in> set (map set (pow_list xs)) \<Longrightarrow> ?thesis; ys \<in> insert x ` set (map set (pow_list xs)) \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. \<And>ys. ys \<in> set (map set (pow_list xs)) \<union> insert x ` set (map set (pow_list xs)) \<Longrightarrow> ys \<in> set (map set (pow_list (x # xs)))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>ys \<in> set (map set (pow_list xs)) \<Longrightarrow> ?thesis; ys \<in> insert x ` set (map set (pow_list xs)) \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis
[PROOF STEP]
show "ys \<in> set (map set (pow_list (x#xs)))"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>ys \<in> set (map set (pow_list xs)) \<Longrightarrow> ?thesis; ys \<in> insert x ` set (map set (pow_list xs)) \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. ys \<in> set (map set (pow_list (x # xs)))
[PROOF STEP]
unfolding pow_list.simps Let_def
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>ys \<in> set (map set (pow_list xs)) \<Longrightarrow> ?thesis; ys \<in> insert x ` set (map set (pow_list xs)) \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. ys \<in> set (map set (pow_list xs @ map ((#) x) (pow_list xs)))
[PROOF STEP]
by (cases; auto)
[PROOF STATE]
proof (state)
this:
ys \<in> set (map set (pow_list (x # xs)))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
?ys \<in> set (map set (pow_list xs)) \<union> insert x ` set (map set (pow_list xs)) \<Longrightarrow> ?ys \<in> set (map set (pow_list (x # xs)))

goal (1 subgoal):
 1. set (map set (pow_list (x # xs))) = set (map set (pow_list xs)) \<union> insert x ` set (map set (pow_list xs))
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
?ys \<in> set (map set (pow_list (x # xs))) \<Longrightarrow> ?ys \<in> set (map set (pow_list xs)) \<union> insert x ` set (map set (pow_list xs))
?ys \<in> set (map set (pow_list xs)) \<union> insert x ` set (map set (pow_list xs)) \<Longrightarrow> ?ys \<in> set (map set (pow_list (x # xs)))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
?ys \<in> set (map set (pow_list (x # xs))) \<Longrightarrow> ?ys \<in> set (map set (pow_list xs)) \<union> insert x ` set (map set (pow_list xs))
?ys \<in> set (map set (pow_list xs)) \<union> insert x ` set (map set (pow_list xs)) \<Longrightarrow> ?ys \<in> set (map set (pow_list (x # xs)))

goal (1 subgoal):
 1. set (map set (pow_list (x # xs))) = set (map set (pow_list xs)) \<union> insert x ` set (map set (pow_list xs))
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
set (map set (pow_list (x # xs))) = set (map set (pow_list xs)) \<union> insert x ` set (map set (pow_list xs))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
set (map set (pow_list (x # xs))) = set (map set (pow_list xs)) \<union> insert x ` set (map set (pow_list xs))

goal (1 subgoal):
 1. \<And>a xs. set (map set (pow_list xs)) = Pow (set xs) \<Longrightarrow> set (map set (pow_list (a # xs))) = Pow (set (a # xs))
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
set (map set (pow_list xs)) = Pow (set xs)
Pow (set (x # xs)) = Pow (set xs) \<union> insert x ` Pow (set xs)
set (map set (pow_list (x # xs))) = set (map set (pow_list xs)) \<union> insert x ` set (map set (pow_list xs))
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
set (map set (pow_list xs)) = Pow (set xs)
Pow (set (x # xs)) = Pow (set xs) \<union> insert x ` Pow (set xs)
set (map set (pow_list (x # xs))) = set (map set (pow_list xs)) \<union> insert x ` set (map set (pow_list xs))

goal (1 subgoal):
 1. set (map set (pow_list (x # xs))) = Pow (set (x # xs))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
set (map set (pow_list (x # xs))) = Pow (set (x # xs))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Lm: "L \<ge> m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. m \<le> L
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. m \<le> L
[PROOF STEP]
have "m \<le> l ^ l"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. m \<le> l ^ l
[PROOF STEP]
unfolding L_def m_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. k ^ 4 \<le> l ^ l
[PROOF STEP]
unfolding kl2 power_mult[symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. l ^ (2 * 4) \<le> l ^ l
[PROOF STEP]
by (intro power_increasing, insert l8, auto)
[PROOF STATE]
proof (state)
this:
m \<le> l ^ l

goal (1 subgoal):
 1. m \<le> L
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
m \<le> l ^ l

goal (1 subgoal):
 1. m \<le> L
[PROOF STEP]
have "\<dots> \<le> (p - 1) ^ l"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. l ^ l \<le> (p - 1) ^ l
[PROOF STEP]
by (rule power_mono, insert pl, auto)
[PROOF STATE]
proof (state)
this:
l ^ l \<le> (p - 1) ^ l

goal (1 subgoal):
 1. m \<le> L
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
l ^ l \<le> (p - 1) ^ l

goal (1 subgoal):
 1. m \<le> L
[PROOF STEP]
have "\<dots> \<le> fact l * (p - 1) ^ l"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (p - 1) ^ l \<le> fact l * (p - 1) ^ l
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(p - 1) ^ l \<le> fact l * (p - 1) ^ l

goal (1 subgoal):
 1. m \<le> L
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(p - 1) ^ l \<le> fact l * (p - 1) ^ l

goal (1 subgoal):
 1. m \<le> L
[PROOF STEP]
have "\<dots> \<le> L"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fact l * (p - 1) ^ l \<le> L
[PROOF STEP]
unfolding L_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fact l * (p - 1) ^ l \<le> fact l * (p - 1) ^ l
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
fact l * (p - 1) ^ l \<le> L

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

goal (1 subgoal):
 1. m \<le> L
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
m \<le> L

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma mrbst_push_down_correct':
  assumes "finite (A :: 'a :: linorder set)" "x \<in> A"
  shows   "do {l \<leftarrow> random_bst {y\<in>A. y < x}; r \<leftarrow> random_bst {y\<in>A. y > x}; mrbst_push_down l x r} =
             random_bst A" (is "?lhs = ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. random_bst {y \<in> A. y < x} \<bind> (\<lambda>l. random_bst {y \<in> A. x < y} \<bind> mrbst_push_down l x) = random_bst A
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. random_bst {y \<in> A. y < x} \<bind> (\<lambda>l. random_bst {y \<in> A. x < y} \<bind> mrbst_push_down l x) = random_bst A
[PROOF STEP]
have "?lhs = random_bst ({x} \<union> {y\<in>A. y < x} \<union> {y\<in>A. y > x})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. random_bst {y \<in> A. y < x} \<bind> (\<lambda>l. random_bst {y \<in> A. x < y} \<bind> mrbst_push_down l x) = random_bst ({x} \<union> {y \<in> A. y < x} \<union> {y \<in> A. x < y})
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
finite A
x \<in> A

goal (1 subgoal):
 1. random_bst {y \<in> A. y < x} \<bind> (\<lambda>l. random_bst {y \<in> A. x < y} \<bind> mrbst_push_down l x) = random_bst ({x} \<union> {y \<in> A. y < x} \<union> {y \<in> A. x < y})
[PROOF STEP]
by (intro mrbst_push_down_correct) auto
[PROOF STATE]
proof (state)
this:
random_bst {y \<in> A. y < x} \<bind> (\<lambda>l. random_bst {y \<in> A. x < y} \<bind> mrbst_push_down l x) = random_bst ({x} \<union> {y \<in> A. y < x} \<union> {y \<in> A. x < y})

goal (1 subgoal):
 1. random_bst {y \<in> A. y < x} \<bind> (\<lambda>l. random_bst {y \<in> A. x < y} \<bind> mrbst_push_down l x) = random_bst A
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
random_bst {y \<in> A. y < x} \<bind> (\<lambda>l. random_bst {y \<in> A. x < y} \<bind> mrbst_push_down l x) = random_bst ({x} \<union> {y \<in> A. y < x} \<union> {y \<in> A. x < y})

goal (1 subgoal):
 1. random_bst {y \<in> A. y < x} \<bind> (\<lambda>l. random_bst {y \<in> A. x < y} \<bind> mrbst_push_down l x) = random_bst A
[PROOF STEP]
have "{x} \<union> {y\<in>A. y < x} \<union> {y\<in>A. y > x} = A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {x} \<union> {y \<in> A. y < x} \<union> {y \<in> A. x < y} = A
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
finite A
x \<in> A

goal (1 subgoal):
 1. {x} \<union> {y \<in> A. y < x} \<union> {y \<in> A. x < y} = A
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{x} \<union> {y \<in> A. y < x} \<union> {y \<in> A. x < y} = A

goal (1 subgoal):
 1. random_bst {y \<in> A. y < x} \<bind> (\<lambda>l. random_bst {y \<in> A. x < y} \<bind> mrbst_push_down l x) = random_bst A
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
random_bst {y \<in> A. y < x} \<bind> (\<lambda>l. random_bst {y \<in> A. x < y} \<bind> mrbst_push_down l x) = random_bst A
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
random_bst {y \<in> A. y < x} \<bind> (\<lambda>l. random_bst {y \<in> A. x < y} \<bind> mrbst_push_down l x) = random_bst A

goal (1 subgoal):
 1. random_bst {y \<in> A. y < x} \<bind> (\<lambda>l. random_bst {y \<in> A. x < y} \<bind> mrbst_push_down l x) = random_bst A
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
random_bst {y \<in> A. y < x} \<bind> (\<lambda>l. random_bst {y \<in> A. x < y} \<bind> mrbst_push_down l x) = random_bst A

goal:
No subgoals!
[PROOF STEP]
qed