[STATEMENT]
lemma lemma_termdiff2:
  fixes h :: "'a::field"
  assumes h: "h \<noteq> 0"
  shows "((z + h) ^ n - z ^ n) / h - of_nat n * z ^ (n - Suc 0) =
         h * (\<Sum>p< n - Suc 0. \<Sum>q< n - Suc 0 - p. (z + h) ^ q * z ^ (n - 2 - q))"
    (is "?lhs = ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((z + h) ^ n - z ^ n) / h - of_nat n * z ^ (n - Suc 0) = h * (\<Sum>p<n - Suc 0. \<Sum>q<n - Suc 0 - p. (z + h) ^ q * z ^ (n - 2 - q))
[PROOF STEP]
proof (cases n)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. n = 0 \<Longrightarrow> ((z + h) ^ n - z ^ n) / h - of_nat n * z ^ (n - Suc 0) = h * (\<Sum>p<n - Suc 0. \<Sum>q<n - Suc 0 - p. (z + h) ^ q * z ^ (n - 2 - q))
 2. \<And>nat. n = Suc nat \<Longrightarrow> ((z + h) ^ n - z ^ n) / h - of_nat n * z ^ (n - Suc 0) = h * (\<Sum>p<n - Suc 0. \<Sum>q<n - Suc 0 - p. (z + h) ^ q * z ^ (n - 2 - q))
[PROOF STEP]
case (Suc m)
[PROOF STATE]
proof (state)
this:
n = Suc m

goal (2 subgoals):
 1. n = 0 \<Longrightarrow> ((z + h) ^ n - z ^ n) / h - of_nat n * z ^ (n - Suc 0) = h * (\<Sum>p<n - Suc 0. \<Sum>q<n - Suc 0 - p. (z + h) ^ q * z ^ (n - 2 - q))
 2. \<And>nat. n = Suc nat \<Longrightarrow> ((z + h) ^ n - z ^ n) / h - of_nat n * z ^ (n - Suc 0) = h * (\<Sum>p<n - Suc 0. \<Sum>q<n - Suc 0 - p. (z + h) ^ q * z ^ (n - 2 - q))
[PROOF STEP]
have 0: "\<And>x k. (\<Sum>n<Suc k. h * (z ^ x * (z ^ (k - n) * (h + z) ^ n))) =
                 (\<Sum>j<Suc k.  h * ((h + z) ^ j * z ^ (x + k - j)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x k. (\<Sum>n<Suc k. h * (z ^ x * (z ^ (k - n) * (h + z) ^ n))) = (\<Sum>j<Suc k. h * ((h + z) ^ j * z ^ (x + k - j)))
[PROOF STEP]
by (auto simp add: power_add [symmetric] mult.commute intro: sum.cong)
[PROOF STATE]
proof (state)
this:
(\<Sum>n<Suc ?k. h * (z ^ ?x * (z ^ (?k - n) * (h + z) ^ n))) = (\<Sum>j<Suc ?k. h * ((h + z) ^ j * z ^ (?x + ?k - j)))

goal (2 subgoals):
 1. n = 0 \<Longrightarrow> ((z + h) ^ n - z ^ n) / h - of_nat n * z ^ (n - Suc 0) = h * (\<Sum>p<n - Suc 0. \<Sum>q<n - Suc 0 - p. (z + h) ^ q * z ^ (n - 2 - q))
 2. \<And>nat. n = Suc nat \<Longrightarrow> ((z + h) ^ n - z ^ n) / h - of_nat n * z ^ (n - Suc 0) = h * (\<Sum>p<n - Suc 0. \<Sum>q<n - Suc 0 - p. (z + h) ^ q * z ^ (n - 2 - q))
[PROOF STEP]
have *: "(\<Sum>i<m. z ^ i * ((z + h) ^ (m - i) - z ^ (m - i))) =
           (\<Sum>i<m. \<Sum>j<m - i. h * ((z + h) ^ j * z ^ (m - Suc j)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i<m. z ^ i * ((z + h) ^ (m - i) - z ^ (m - i))) = (\<Sum>i<m. \<Sum>j<m - i. h * ((z + h) ^ j * z ^ (m - Suc j)))
[PROOF STEP]
by (force simp add: less_iff_Suc_add sum_distrib_left diff_power_eq_sum ac_simps 0
        simp del: sum.lessThan_Suc power_Suc intro: sum.cong)
[PROOF STATE]
proof (state)
this:
(\<Sum>i<m. z ^ i * ((z + h) ^ (m - i) - z ^ (m - i))) = (\<Sum>i<m. \<Sum>j<m - i. h * ((z + h) ^ j * z ^ (m - Suc j)))

goal (2 subgoals):
 1. n = 0 \<Longrightarrow> ((z + h) ^ n - z ^ n) / h - of_nat n * z ^ (n - Suc 0) = h * (\<Sum>p<n - Suc 0. \<Sum>q<n - Suc 0 - p. (z + h) ^ q * z ^ (n - 2 - q))
 2. \<And>nat. n = Suc nat \<Longrightarrow> ((z + h) ^ n - z ^ n) / h - of_nat n * z ^ (n - Suc 0) = h * (\<Sum>p<n - Suc 0. \<Sum>q<n - Suc 0 - p. (z + h) ^ q * z ^ (n - 2 - q))
[PROOF STEP]
have "h * ?lhs = (z + h) ^ n - z ^ n - h * of_nat n * z ^ (n - Suc 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. h * (((z + h) ^ n - z ^ n) / h - of_nat n * z ^ (n - Suc 0)) = (z + h) ^ n - z ^ n - h * of_nat n * z ^ (n - Suc 0)
[PROOF STEP]
by (simp add: right_diff_distrib diff_divide_distrib h mult.assoc [symmetric])
[PROOF STATE]
proof (state)
this:
h * (((z + h) ^ n - z ^ n) / h - of_nat n * z ^ (n - Suc 0)) = (z + h) ^ n - z ^ n - h * of_nat n * z ^ (n - Suc 0)

goal (2 subgoals):
 1. n = 0 \<Longrightarrow> ((z + h) ^ n - z ^ n) / h - of_nat n * z ^ (n - Suc 0) = h * (\<Sum>p<n - Suc 0. \<Sum>q<n - Suc 0 - p. (z + h) ^ q * z ^ (n - 2 - q))
 2. \<And>nat. n = Suc nat \<Longrightarrow> ((z + h) ^ n - z ^ n) / h - of_nat n * z ^ (n - Suc 0) = h * (\<Sum>p<n - Suc 0. \<Sum>q<n - Suc 0 - p. (z + h) ^ q * z ^ (n - 2 - q))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
h * (((z + h) ^ n - z ^ n) / h - of_nat n * z ^ (n - Suc 0)) = (z + h) ^ n - z ^ n - h * of_nat n * z ^ (n - Suc 0)

goal (2 subgoals):
 1. n = 0 \<Longrightarrow> ((z + h) ^ n - z ^ n) / h - of_nat n * z ^ (n - Suc 0) = h * (\<Sum>p<n - Suc 0. \<Sum>q<n - Suc 0 - p. (z + h) ^ q * z ^ (n - 2 - q))
 2. \<And>nat. n = Suc nat \<Longrightarrow> ((z + h) ^ n - z ^ n) / h - of_nat n * z ^ (n - Suc 0) = h * (\<Sum>p<n - Suc 0. \<Sum>q<n - Suc 0 - p. (z + h) ^ q * z ^ (n - 2 - q))
[PROOF STEP]
have "... = h * ((\<Sum>p<Suc m. (z + h) ^ p * z ^ (m - p)) - of_nat (Suc m) * z ^ m)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (z + h) ^ n - z ^ n - h * of_nat n * z ^ (n - Suc 0) = h * ((\<Sum>p<Suc m. (z + h) ^ p * z ^ (m - p)) - of_nat (Suc m) * z ^ m)
[PROOF STEP]
by (simp add: Suc diff_power_eq_sum h right_diff_distrib [symmetric] mult.assoc
        del: power_Suc sum.lessThan_Suc of_nat_Suc)
[PROOF STATE]
proof (state)
this:
(z + h) ^ n - z ^ n - h * of_nat n * z ^ (n - Suc 0) = h * ((\<Sum>p<Suc m. (z + h) ^ p * z ^ (m - p)) - of_nat (Suc m) * z ^ m)

goal (2 subgoals):
 1. n = 0 \<Longrightarrow> ((z + h) ^ n - z ^ n) / h - of_nat n * z ^ (n - Suc 0) = h * (\<Sum>p<n - Suc 0. \<Sum>q<n - Suc 0 - p. (z + h) ^ q * z ^ (n - 2 - q))
 2. \<And>nat. n = Suc nat \<Longrightarrow> ((z + h) ^ n - z ^ n) / h - of_nat n * z ^ (n - Suc 0) = h * (\<Sum>p<n - Suc 0. \<Sum>q<n - Suc 0 - p. (z + h) ^ q * z ^ (n - 2 - q))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(z + h) ^ n - z ^ n - h * of_nat n * z ^ (n - Suc 0) = h * ((\<Sum>p<Suc m. (z + h) ^ p * z ^ (m - p)) - of_nat (Suc m) * z ^ m)

goal (2 subgoals):
 1. n = 0 \<Longrightarrow> ((z + h) ^ n - z ^ n) / h - of_nat n * z ^ (n - Suc 0) = h * (\<Sum>p<n - Suc 0. \<Sum>q<n - Suc 0 - p. (z + h) ^ q * z ^ (n - 2 - q))
 2. \<And>nat. n = Suc nat \<Longrightarrow> ((z + h) ^ n - z ^ n) / h - of_nat n * z ^ (n - Suc 0) = h * (\<Sum>p<n - Suc 0. \<Sum>q<n - Suc 0 - p. (z + h) ^ q * z ^ (n - 2 - q))
[PROOF STEP]
have "... = h * ((\<Sum>p<Suc m. (z + h) ^ (m - p) * z ^ p) - of_nat (Suc m) * z ^ m)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. h * ((\<Sum>p<Suc m. (z + h) ^ p * z ^ (m - p)) - of_nat (Suc m) * z ^ m) = h * ((\<Sum>p<Suc m. (z + h) ^ (m - p) * z ^ p) - of_nat (Suc m) * z ^ m)
[PROOF STEP]
by (subst sum.nat_diff_reindex[symmetric]) simp
[PROOF STATE]
proof (state)
this:
h * ((\<Sum>p<Suc m. (z + h) ^ p * z ^ (m - p)) - of_nat (Suc m) * z ^ m) = h * ((\<Sum>p<Suc m. (z + h) ^ (m - p) * z ^ p) - of_nat (Suc m) * z ^ m)

goal (2 subgoals):
 1. n = 0 \<Longrightarrow> ((z + h) ^ n - z ^ n) / h - of_nat n * z ^ (n - Suc 0) = h * (\<Sum>p<n - Suc 0. \<Sum>q<n - Suc 0 - p. (z + h) ^ q * z ^ (n - 2 - q))
 2. \<And>nat. n = Suc nat \<Longrightarrow> ((z + h) ^ n - z ^ n) / h - of_nat n * z ^ (n - Suc 0) = h * (\<Sum>p<n - Suc 0. \<Sum>q<n - Suc 0 - p. (z + h) ^ q * z ^ (n - 2 - q))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
h * ((\<Sum>p<Suc m. (z + h) ^ p * z ^ (m - p)) - of_nat (Suc m) * z ^ m) = h * ((\<Sum>p<Suc m. (z + h) ^ (m - p) * z ^ p) - of_nat (Suc m) * z ^ m)

goal (2 subgoals):
 1. n = 0 \<Longrightarrow> ((z + h) ^ n - z ^ n) / h - of_nat n * z ^ (n - Suc 0) = h * (\<Sum>p<n - Suc 0. \<Sum>q<n - Suc 0 - p. (z + h) ^ q * z ^ (n - 2 - q))
 2. \<And>nat. n = Suc nat \<Longrightarrow> ((z + h) ^ n - z ^ n) / h - of_nat n * z ^ (n - Suc 0) = h * (\<Sum>p<n - Suc 0. \<Sum>q<n - Suc 0 - p. (z + h) ^ q * z ^ (n - 2 - q))
[PROOF STEP]
have "... = h * (\<Sum>i<Suc m. (z + h) ^ (m - i) * z ^ i - z ^ m)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. h * ((\<Sum>p<Suc m. (z + h) ^ (m - p) * z ^ p) - of_nat (Suc m) * z ^ m) = h * (\<Sum>i<Suc m. (z + h) ^ (m - i) * z ^ i - z ^ m)
[PROOF STEP]
by (simp add: sum_subtractf)
[PROOF STATE]
proof (state)
this:
h * ((\<Sum>p<Suc m. (z + h) ^ (m - p) * z ^ p) - of_nat (Suc m) * z ^ m) = h * (\<Sum>i<Suc m. (z + h) ^ (m - i) * z ^ i - z ^ m)

goal (2 subgoals):
 1. n = 0 \<Longrightarrow> ((z + h) ^ n - z ^ n) / h - of_nat n * z ^ (n - Suc 0) = h * (\<Sum>p<n - Suc 0. \<Sum>q<n - Suc 0 - p. (z + h) ^ q * z ^ (n - 2 - q))
 2. \<And>nat. n = Suc nat \<Longrightarrow> ((z + h) ^ n - z ^ n) / h - of_nat n * z ^ (n - Suc 0) = h * (\<Sum>p<n - Suc 0. \<Sum>q<n - Suc 0 - p. (z + h) ^ q * z ^ (n - 2 - q))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
h * ((\<Sum>p<Suc m. (z + h) ^ (m - p) * z ^ p) - of_nat (Suc m) * z ^ m) = h * (\<Sum>i<Suc m. (z + h) ^ (m - i) * z ^ i - z ^ m)

goal (2 subgoals):
 1. n = 0 \<Longrightarrow> ((z + h) ^ n - z ^ n) / h - of_nat n * z ^ (n - Suc 0) = h * (\<Sum>p<n - Suc 0. \<Sum>q<n - Suc 0 - p. (z + h) ^ q * z ^ (n - 2 - q))
 2. \<And>nat. n = Suc nat \<Longrightarrow> ((z + h) ^ n - z ^ n) / h - of_nat n * z ^ (n - Suc 0) = h * (\<Sum>p<n - Suc 0. \<Sum>q<n - Suc 0 - p. (z + h) ^ q * z ^ (n - 2 - q))
[PROOF STEP]
have "... = h * ?rhs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. h * (\<Sum>i<Suc m. (z + h) ^ (m - i) * z ^ i - z ^ m) = h * (h * (\<Sum>p<n - Suc 0. \<Sum>q<n - Suc 0 - p. (z + h) ^ q * z ^ (n - 2 - q)))
[PROOF STEP]
by (simp add: lemma_termdiff1 sum_distrib_left Suc *)
[PROOF STATE]
proof (state)
this:
h * (\<Sum>i<Suc m. (z + h) ^ (m - i) * z ^ i - z ^ m) = h * (h * (\<Sum>p<n - Suc 0. \<Sum>q<n - Suc 0 - p. (z + h) ^ q * z ^ (n - 2 - q)))

goal (2 subgoals):
 1. n = 0 \<Longrightarrow> ((z + h) ^ n - z ^ n) / h - of_nat n * z ^ (n - Suc 0) = h * (\<Sum>p<n - Suc 0. \<Sum>q<n - Suc 0 - p. (z + h) ^ q * z ^ (n - 2 - q))
 2. \<And>nat. n = Suc nat \<Longrightarrow> ((z + h) ^ n - z ^ n) / h - of_nat n * z ^ (n - Suc 0) = h * (\<Sum>p<n - Suc 0. \<Sum>q<n - Suc 0 - p. (z + h) ^ q * z ^ (n - 2 - q))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
h * (((z + h) ^ n - z ^ n) / h - of_nat n * z ^ (n - Suc 0)) = h * (h * (\<Sum>p<n - Suc 0. \<Sum>q<n - Suc 0 - p. (z + h) ^ q * z ^ (n - 2 - q)))
[PROOF STEP]
have "h * ?lhs = h * ?rhs"
[PROOF STATE]
proof (prove)
using this:
h * (((z + h) ^ n - z ^ n) / h - of_nat n * z ^ (n - Suc 0)) = h * (h * (\<Sum>p<n - Suc 0. \<Sum>q<n - Suc 0 - p. (z + h) ^ q * z ^ (n - 2 - q)))

goal (1 subgoal):
 1. h * (((z + h) ^ n - z ^ n) / h - of_nat n * z ^ (n - Suc 0)) = h * (h * (\<Sum>p<n - Suc 0. \<Sum>q<n - Suc 0 - p. (z + h) ^ q * z ^ (n - 2 - q)))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
h * (((z + h) ^ n - z ^ n) / h - of_nat n * z ^ (n - Suc 0)) = h * (h * (\<Sum>p<n - Suc 0. \<Sum>q<n - Suc 0 - p. (z + h) ^ q * z ^ (n - 2 - q)))

goal (2 subgoals):
 1. n = 0 \<Longrightarrow> ((z + h) ^ n - z ^ n) / h - of_nat n * z ^ (n - Suc 0) = h * (\<Sum>p<n - Suc 0. \<Sum>q<n - Suc 0 - p. (z + h) ^ q * z ^ (n - 2 - q))
 2. \<And>nat. n = Suc nat \<Longrightarrow> ((z + h) ^ n - z ^ n) / h - of_nat n * z ^ (n - Suc 0) = h * (\<Sum>p<n - Suc 0. \<Sum>q<n - Suc 0 - p. (z + h) ^ q * z ^ (n - 2 - q))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
h * (((z + h) ^ n - z ^ n) / h - of_nat n * z ^ (n - Suc 0)) = h * (h * (\<Sum>p<n - Suc 0. \<Sum>q<n - Suc 0 - p. (z + h) ^ q * z ^ (n - 2 - q)))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
h * (((z + h) ^ n - z ^ n) / h - of_nat n * z ^ (n - Suc 0)) = h * (h * (\<Sum>p<n - Suc 0. \<Sum>q<n - Suc 0 - p. (z + h) ^ q * z ^ (n - 2 - q)))

goal (1 subgoal):
 1. ((z + h) ^ n - z ^ n) / h - of_nat n * z ^ (n - Suc 0) = h * (\<Sum>p<n - Suc 0. \<Sum>q<n - Suc 0 - p. (z + h) ^ q * z ^ (n - 2 - q))
[PROOF STEP]
by (simp add: h)
[PROOF STATE]
proof (state)
this:
((z + h) ^ n - z ^ n) / h - of_nat n * z ^ (n - Suc 0) = h * (\<Sum>p<n - Suc 0. \<Sum>q<n - Suc 0 - p. (z + h) ^ q * z ^ (n - 2 - q))

goal (1 subgoal):
 1. n = 0 \<Longrightarrow> ((z + h) ^ n - z ^ n) / h - of_nat n * z ^ (n - Suc 0) = h * (\<Sum>p<n - Suc 0. \<Sum>q<n - Suc 0 - p. (z + h) ^ q * z ^ (n - 2 - q))
[PROOF STEP]
qed auto


[STATEMENT]
lemma "(\<exists>x. P\<longrightarrow>Q(x)) \<and> (\<exists>x. Q(x)\<longrightarrow>P) \<longrightarrow> \<not>\<not>(\<exists>x. P=Q(x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>x. P \<longrightarrow> Q x) \<and> (\<exists>x. Q x \<longrightarrow> P) \<longrightarrow> \<not> (\<nexists>x. P = Q x)
[PROOF STEP]
by iprover


[STATEMENT]
lemma gbinomial_absorption: "of_nat (Suc k) * (a gchoose Suc k) = a * ((a - 1) gchoose k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. of_nat (Suc k) * (a gchoose Suc k) = a * (a - (1::'a) gchoose k)
[PROOF STEP]
using gbinomial_absorption'[of "Suc k" a]
[PROOF STATE]
proof (prove)
using this:
0 < Suc k \<Longrightarrow> a gchoose Suc k = a / of_nat (Suc k) * (a - (1::'a) gchoose (Suc k - 1))

goal (1 subgoal):
 1. of_nat (Suc k) * (a gchoose Suc k) = a * (a - (1::'a) gchoose k)
[PROOF STEP]
by (simp add: field_simps del: of_nat_Suc)


[STATEMENT]
lemma RPDi_Star: "j \<le> i \<Longrightarrow> RPDi j (MStar r) \<subseteq> {MStar r} \<union> MTimesL (MStar r) (\<Union>j \<le> i. RPDi j r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. j \<le> i \<Longrightarrow> RPDi j (MStar r) \<subseteq> {MStar r} \<union> MTimesL (MStar r) (\<Union>j\<le>i. RPDi j r)
[PROOF STEP]
proof (induct i arbitrary: j r)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>j r. j \<le> 0 \<Longrightarrow> RPDi j (MStar r) \<subseteq> {MStar r} \<union> MTimesL (MStar r) (\<Union>j\<le>0. RPDi j r)
 2. \<And>i j r. \<lbrakk>\<And>j r. j \<le> i \<Longrightarrow> RPDi j (MStar r) \<subseteq> {MStar r} \<union> MTimesL (MStar r) (\<Union>j\<le>i. RPDi j r); j \<le> Suc i\<rbrakk> \<Longrightarrow> RPDi j (MStar r) \<subseteq> {MStar r} \<union> MTimesL (MStar r) (\<Union>j\<le>Suc i. RPDi j r)
[PROOF STEP]
case (Suc i)
[PROOF STATE]
proof (state)
this:
?j \<le> i \<Longrightarrow> RPDi ?j (MStar ?r) \<subseteq> {MStar ?r} \<union> MTimesL (MStar ?r) (\<Union>j\<le>i. RPDi j ?r)
j \<le> Suc i

goal (2 subgoals):
 1. \<And>j r. j \<le> 0 \<Longrightarrow> RPDi j (MStar r) \<subseteq> {MStar r} \<union> MTimesL (MStar r) (\<Union>j\<le>0. RPDi j r)
 2. \<And>i j r. \<lbrakk>\<And>j r. j \<le> i \<Longrightarrow> RPDi j (MStar r) \<subseteq> {MStar r} \<union> MTimesL (MStar r) (\<Union>j\<le>i. RPDi j r); j \<le> Suc i\<rbrakk> \<Longrightarrow> RPDi j (MStar r) \<subseteq> {MStar r} \<union> MTimesL (MStar r) (\<Union>j\<le>Suc i. RPDi j r)
[PROOF STEP]
from Suc(2)
[PROOF STATE]
proof (chain)
picking this:
j \<le> Suc i
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
j \<le> Suc i

goal (1 subgoal):
 1. RPDi j (MStar r) \<subseteq> {MStar r} \<union> MTimesL (MStar r) (\<Union>j\<le>Suc i. RPDi j r)
[PROOF STEP]
by (auto 0 5 simp: MTimesL_def image_iff le_Suc_eq
        dest: bspec[of _ _ "Suc 0"] bspec[of _ _ "Suc _"] set_mp[OF Suc(1)] dest!: set_mp[OF RPDi_Times])
[PROOF STATE]
proof (state)
this:
RPDi j (MStar r) \<subseteq> {MStar r} \<union> MTimesL (MStar r) (\<Union>j\<le>Suc i. RPDi j r)

goal (1 subgoal):
 1. \<And>j r. j \<le> 0 \<Longrightarrow> RPDi j (MStar r) \<subseteq> {MStar r} \<union> MTimesL (MStar r) (\<Union>j\<le>0. RPDi j r)
[PROOF STEP]
qed simp


[STATEMENT]
lemma "(\<exists>y. \<forall>x. F x y = F x x)
      \<longrightarrow>  \<not> (\<forall>x. \<exists>y. \<forall>z. F z y = (\<not>F z x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>y. \<forall>x. F x y = F x x) \<longrightarrow> \<not> (\<forall>x. \<exists>y. \<forall>z. F z y = (\<not> F z x))
[PROOF STEP]
by blast


[STATEMENT]
lemma independent_alt:
  "independent B \<longleftrightarrow>
    (\<forall>X. finite {x. X x \<noteq> 0} \<longrightarrow> {x. X x \<noteq> 0} \<subseteq> B \<longrightarrow> (\<Sum>x|X x \<noteq> 0. X x *s x) = 0 \<longrightarrow> (\<forall>x. X x = 0))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. independent B = (\<forall>X. finite {x. X x \<noteq> (0::'a)} \<longrightarrow> {x. X x \<noteq> (0::'a)} \<subseteq> B \<longrightarrow> (\<Sum>x | X x \<noteq> (0::'a). X x *s x) = (0::'b) \<longrightarrow> (\<forall>x. X x = (0::'a)))
[PROOF STEP]
unfolding dependent_alt
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<nexists>X. finite {x. X x \<noteq> (0::'a)} \<and> {x. X x \<noteq> (0::'a)} \<subseteq> B \<and> (\<Sum>x | X x \<noteq> (0::'a). X x *s x) = (0::'b) \<and> (\<exists>x. X x \<noteq> (0::'a))) = (\<forall>X. finite {x. X x \<noteq> (0::'a)} \<longrightarrow> {x. X x \<noteq> (0::'a)} \<subseteq> B \<longrightarrow> (\<Sum>x | X x \<noteq> (0::'a). X x *s x) = (0::'b) \<longrightarrow> (\<forall>x. X x = (0::'a)))
[PROOF STEP]
by auto


[STATEMENT]
lemma bij_betw_UN:
  assumes "bij_betw f A B"
  shows   "(\<Union>n\<in>A. g (f n)) = (\<Union>n\<in>B. g n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Union>n\<in>A. g (f n)) = \<Union> (g ` B)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
bij_betw f A B

goal (1 subgoal):
 1. (\<Union>n\<in>A. g (f n)) = \<Union> (g ` B)
[PROOF STEP]
by (auto simp: bij_betw_def)


[STATEMENT]
lemma abs_conv_abscissa_diff_leI:
  "abs_conv_abscissa (f :: 'a :: dirichlet_series fds) \<le> d \<Longrightarrow> abs_conv_abscissa g \<le> d \<Longrightarrow>
     abs_conv_abscissa (f - g) \<le> d"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>abs_conv_abscissa f \<le> d; abs_conv_abscissa g \<le> d\<rbrakk> \<Longrightarrow> abs_conv_abscissa (f - g) \<le> d
[PROOF STEP]
using abs_conv_abscissa_diff_le[of f g]
[PROOF STATE]
proof (prove)
using this:
abs_conv_abscissa (f - g) \<le> max (abs_conv_abscissa f) (abs_conv_abscissa g)

goal (1 subgoal):
 1. \<lbrakk>abs_conv_abscissa f \<le> d; abs_conv_abscissa g \<le> d\<rbrakk> \<Longrightarrow> abs_conv_abscissa (f - g) \<le> d
[PROOF STEP]
by (auto simp: le_max_iff_disj)


[STATEMENT]
lemma m_s_anti_mono: "S1 \<le> S2 \<Longrightarrow> m_s S1 X \<ge> m_s S2 X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. S1 \<le> S2 \<Longrightarrow> m\<^sub>s S2 X \<le> m\<^sub>s S1 X
[PROOF STEP]
unfolding m_s_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. S1 \<le> S2 \<Longrightarrow> (\<Sum>x\<in>X. m (fun S2 x)) \<le> (\<Sum>x\<in>X. m (fun S1 x))
[PROOF STEP]
apply (transfer fixing: m)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>S1 S2 X. less_eq_st_rep S1 S2 \<Longrightarrow> (\<Sum>x\<in>X. m (fun_rep S2 x)) \<le> (\<Sum>x\<in>X. m (fun_rep S1 x))
[PROOF STEP]
apply(simp add: less_eq_st_rep_iff eq_st_def m_s_anti_mono_rep)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
theorem Erdos_Wetzel: "C_continuum = \<aleph>1 \<longleftrightarrow> (\<exists>F. Wetzel F \<and> uncountable F)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (C_continuum = \<omega>1) = (\<exists>F. Wetzel F \<and> uncountable F)
[PROOF STEP]
by (metis C_continuum_ge Erdos_Wetzel_CH Erdos_Wetzel_nonCH less_V_def)


[STATEMENT]
lemma subset_imp_less_mset: "A \<subset># B \<Longrightarrow> A < B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<subset># B \<Longrightarrow> A < B
[PROOF STEP]
by (simp add: order.not_eq_order_implies_strict subset_eq_imp_le_multiset)


[STATEMENT]
lemma Ord_pred: "\<lbrakk>Ord(k); k \<noteq> 0\<rbrakk> \<Longrightarrow> succ(\<Squnion>k) = k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Ord k; k \<noteq> 0\<rbrakk> \<Longrightarrow> succ (\<Squnion>k) = k
[PROOF STEP]
by (metis (full_types) HUnion_iff Ord_in_Ord Ord_mem_succ_cases hmem_Sup_Ords hmem_ne succ_iff)


[STATEMENT]
lemma norm_gt_square: "norm x > a \<longleftrightarrow> a < 0 \<or> inner x x > a\<^sup>2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a < norm x) = (a < 0 \<or> a\<^sup>2 < inner x x)
[PROOF STEP]
by (metis norm_le_square not_less)


[STATEMENT]
lemma prime_elem_power_iff:
  "prime_elem (p ^ n) \<longleftrightarrow> prime_elem p \<and> n = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prime_elem (p ^ n) = (prime_elem p \<and> n = 1)
[PROOF STEP]
by (auto dest: prime_elem_powerD)


[STATEMENT]
lemma preal_add_right_less_cancel: "r + t < s + t \<Longrightarrow> r < (s::preal)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. r + t < s + t \<Longrightarrow> r < s
[PROOF STEP]
by (metis linorder_cases order.asym preal_add_less2_mono1)


[STATEMENT]
lemma apply_cltn2_in_S:
  "apply_cltn2 p C \<in> S
  \<longleftrightarrow> proj2_rep p \<bullet> (cltn2_rep C ** M ** transpose (cltn2_rep C) *v proj2_rep p)
  = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (apply_cltn2 p C \<in> S) = (proj2_rep p \<bullet> (cltn2_rep C ** M ** Finite_Cartesian_Product.transpose (cltn2_rep C) *v proj2_rep p) = 0)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (apply_cltn2 p C \<in> S) = (proj2_rep p \<bullet> (cltn2_rep C ** M ** Finite_Cartesian_Product.transpose (cltn2_rep C) *v proj2_rep p) = 0)
[PROOF STEP]
have "proj2_rep p \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. proj2_rep p \<noteq> 0
[PROOF STEP]
by (rule proj2_rep_non_zero)
[PROOF STATE]
proof (state)
this:
proj2_rep p \<noteq> 0

goal (1 subgoal):
 1. (apply_cltn2 p C \<in> S) = (proj2_rep p \<bullet> (cltn2_rep C ** M ** Finite_Cartesian_Product.transpose (cltn2_rep C) *v proj2_rep p) = 0)
[PROOF STEP]
hence "apply_cltn2 (proj2_abs (proj2_rep p)) C \<in> S
    \<longleftrightarrow> proj2_rep p \<bullet> (cltn2_rep C ** M ** transpose (cltn2_rep C) *v proj2_rep p)
    = 0"
[PROOF STATE]
proof (prove)
using this:
proj2_rep p \<noteq> 0

goal (1 subgoal):
 1. (apply_cltn2 (proj2_abs (proj2_rep p)) C \<in> S) = (proj2_rep p \<bullet> (cltn2_rep C ** M ** Finite_Cartesian_Product.transpose (cltn2_rep C) *v proj2_rep p) = 0)
[PROOF STEP]
by (rule apply_cltn2_abs_in_S)
[PROOF STATE]
proof (state)
this:
(apply_cltn2 (proj2_abs (proj2_rep p)) C \<in> S) = (proj2_rep p \<bullet> (cltn2_rep C ** M ** Finite_Cartesian_Product.transpose (cltn2_rep C) *v proj2_rep p) = 0)

goal (1 subgoal):
 1. (apply_cltn2 p C \<in> S) = (proj2_rep p \<bullet> (cltn2_rep C ** M ** Finite_Cartesian_Product.transpose (cltn2_rep C) *v proj2_rep p) = 0)
[PROOF STEP]
thus "apply_cltn2 p C \<in> S
    \<longleftrightarrow> proj2_rep p \<bullet> (cltn2_rep C ** M ** transpose (cltn2_rep C) *v proj2_rep p)
    = 0"
[PROOF STATE]
proof (prove)
using this:
(apply_cltn2 (proj2_abs (proj2_rep p)) C \<in> S) = (proj2_rep p \<bullet> (cltn2_rep C ** M ** Finite_Cartesian_Product.transpose (cltn2_rep C) *v proj2_rep p) = 0)

goal (1 subgoal):
 1. (apply_cltn2 p C \<in> S) = (proj2_rep p \<bullet> (cltn2_rep C ** M ** Finite_Cartesian_Product.transpose (cltn2_rep C) *v proj2_rep p) = 0)
[PROOF STEP]
by (simp add: proj2_abs_rep)
[PROOF STATE]
proof (state)
this:
(apply_cltn2 p C \<in> S) = (proj2_rep p \<bullet> (cltn2_rep C ** M ** Finite_Cartesian_Product.transpose (cltn2_rep C) *v proj2_rep p) = 0)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in ring) degree_add_distinct:
  assumes "subring K R"
  assumes "f \<in> carrier (K[X]) - {\<zero>\<^bsub>K[X]\<^esub>}"
  assumes "g \<in> carrier (K[X]) - {\<zero>\<^bsub>K[X]\<^esub>}"
  assumes "degree f \<noteq> degree g"
  shows "degree (f \<oplus>\<^bsub>K[X]\<^esub> g) = max (degree f) (degree g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree (f \<oplus>\<^bsub>K [X]\<^esub> g) = max (degree f) (degree g)
[PROOF STEP]
unfolding univ_poly_add
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree (poly_add f g) = max (degree f) (degree g)
[PROOF STEP]
using assms(2,3,4)
[PROOF STATE]
proof (prove)
using this:
f \<in> carrier (K [X]) - {\<zero>\<^bsub>K [X]\<^esub>}
g \<in> carrier (K [X]) - {\<zero>\<^bsub>K [X]\<^esub>}
degree f \<noteq> degree g

goal (1 subgoal):
 1. degree (poly_add f g) = max (degree f) (degree g)
[PROOF STEP]
by (subst poly_add_degree_eq[OF assms(1)])
    (auto simp:univ_poly_carrier univ_poly_zero)


[STATEMENT]
lemma is_sorted_list_of_set:
  "finite A \<Longrightarrow> is_sorted_list_of_set A (sorted_list_of_set A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite A \<Longrightarrow> is_sorted_list_of_set A (sorted_list_of_set A)
[PROOF STEP]
by (simp add: is_sorted_list_of_set_alt_def)


[STATEMENT]
lemma rejects_trivial: "\<lbrakk>rejects \<F> S M; thin_set \<F>; init_segment F S; F \<in> \<F>\<rbrakk> \<Longrightarrow> False"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>rejects \<F> S M; thin_set \<F>; init_segment F S; F \<in> \<F>\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
unfolding rejects_def thin_set_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>comparables S M \<inter> \<F> = {}; \<F> \<subseteq> Collect finite \<and> (\<forall>S\<in>\<F>. \<forall>T\<in>\<F>. init_segment S T \<longrightarrow> S = T); init_segment F S; F \<in> \<F>\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
using comparables_iff
[PROOF STATE]
proof (prove)
using this:
(?T \<in> comparables ?S ?M) = (finite ?T \<and> (init_segment ?T ?S \<or> init_segment ?S ?T \<and> ?T \<subseteq> ?S \<union> ?M))

goal (1 subgoal):
 1. \<lbrakk>comparables S M \<inter> \<F> = {}; \<F> \<subseteq> Collect finite \<and> (\<forall>S\<in>\<F>. \<forall>T\<in>\<F>. init_segment S T \<longrightarrow> S = T); init_segment F S; F \<in> \<F>\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
by blast


[STATEMENT]
theorem meet_maximum: "x \<squnion> y = maximum x y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<squnion> y = maximum x y
[PROOF STEP]
by (rule join_equality) (rule is_sup_maximum)


[STATEMENT]
lemma inorder2_leaves: "inorder2(leaves as) = as"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inorder2 (leaves as) = as
[PROOF STEP]
by(induction as) auto


[STATEMENT]
lemma mdeg_child_if_child_max:
  "\<lbrakk>\<forall>(t,e) \<in> fset xs. max_deg t \<le> max_deg t1; fcard xs \<le> max_deg t1; (t1,e1) \<in> fset xs\<rbrakk>
    \<Longrightarrow> max_deg (Node r xs) = max_deg t1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>(t, e)\<in>fset xs. max_deg t \<le> max_deg t1; fcard xs \<le> max_deg t1; (t1, e1) \<in> fset xs\<rbrakk> \<Longrightarrow> max_deg (Node r xs) = max_deg t1
[PROOF STEP]
using mdeg_le_if_fcard_and_child_le[of xs "max_deg t1"] mdeg_ge_child[of t1 e1 xs]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<forall>(t, e)\<in>fset xs. max_deg t \<le> max_deg t1; fcard xs \<le> max_deg t1\<rbrakk> \<Longrightarrow> max_deg (Node ?r xs) \<le> max_deg t1
(t1, e1) \<in> fset xs \<Longrightarrow> max_deg t1 \<le> max_deg (Node ?r xs)

goal (1 subgoal):
 1. \<lbrakk>\<forall>(t, e)\<in>fset xs. max_deg t \<le> max_deg t1; fcard xs \<le> max_deg t1; (t1, e1) \<in> fset xs\<rbrakk> \<Longrightarrow> max_deg (Node r xs) = max_deg t1
[PROOF STEP]
by simp


[STATEMENT]
lemma inf_conj_distrib: "(c\<^sub>0 \<sqinter> c\<^sub>1) \<iinter> d = (c\<^sub>0 \<iinter> d) \<sqinter> (c\<^sub>1 \<iinter> d)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (c\<^sub>0 \<sqinter> c\<^sub>1) \<iinter> d = c\<^sub>0 \<iinter> d \<sqinter> c\<^sub>1 \<iinter> d
variables:
c\<^sub>0, c\<^sub>1, d :: 'a
(\<iinter>) :: 'a \<Rightarrow> 'a \<Rightarrow> 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (c\<^sub>0 \<sqinter> c\<^sub>1) \<iinter> d = c\<^sub>0 \<iinter> d \<sqinter> c\<^sub>1 \<iinter> d
variables:
c\<^sub>0, c\<^sub>1, d :: 'a
(\<iinter>) :: 'a \<Rightarrow> 'a \<Rightarrow> 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
have "(c\<^sub>0 \<sqinter> c\<^sub>1) \<iinter> d = (\<Sqinter> {c\<^sub>0, c\<^sub>1}) \<iinter> d"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (c\<^sub>0 \<sqinter> c\<^sub>1) \<iinter> d = \<Sqinter> {c\<^sub>0, c\<^sub>1} \<iinter> d
variables:
c\<^sub>0, c\<^sub>1, d :: 'a
(\<iinter>) :: 'a \<Rightarrow> 'a \<Rightarrow> 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
((c\<^sub>0::'a::refinement_lattice) \<sqinter> (c\<^sub>1::'a::refinement_lattice)) \<iinter> (d::'a::refinement_lattice) = \<Sqinter> {c\<^sub>0, c\<^sub>1} \<iinter> d

goal (1 subgoal):
 1. (c\<^sub>0 \<sqinter> c\<^sub>1) \<iinter> d = c\<^sub>0 \<iinter> d \<sqinter> c\<^sub>1 \<iinter> d
variables:
c\<^sub>0, c\<^sub>1, d :: 'a
(\<iinter>) :: 'a \<Rightarrow> 'a \<Rightarrow> 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
((c\<^sub>0::'a::refinement_lattice) \<sqinter> (c\<^sub>1::'a::refinement_lattice)) \<iinter> (d::'a::refinement_lattice) = \<Sqinter> {c\<^sub>0, c\<^sub>1} \<iinter> d

goal (1 subgoal):
 1. (c\<^sub>0 \<sqinter> c\<^sub>1) \<iinter> d = c\<^sub>0 \<iinter> d \<sqinter> c\<^sub>1 \<iinter> d
variables:
c\<^sub>0, c\<^sub>1, d :: 'a
(\<iinter>) :: 'a \<Rightarrow> 'a \<Rightarrow> 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
have "... = (\<Sqinter>c \<in> {c\<^sub>0, c\<^sub>1}. c \<iinter> d)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Sqinter> {c\<^sub>0, c\<^sub>1} \<iinter> d = (\<Sqinter>c::'a\<in>{c\<^sub>0, c\<^sub>1}. c \<iinter> d)
variables:
c\<^sub>0, c\<^sub>1, d :: 'a
(\<iinter>) :: 'a \<Rightarrow> 'a \<Rightarrow> 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
by (rule Inf_conj_distrib, simp)
[PROOF STATE]
proof (state)
this:
\<Sqinter> {c\<^sub>0::'a::refinement_lattice, c\<^sub>1::'a::refinement_lattice} \<iinter> (d::'a::refinement_lattice) = (\<Sqinter>c::'a::refinement_lattice\<in>{c\<^sub>0, c\<^sub>1}. c \<iinter> d)

goal (1 subgoal):
 1. (c\<^sub>0 \<sqinter> c\<^sub>1) \<iinter> d = c\<^sub>0 \<iinter> d \<sqinter> c\<^sub>1 \<iinter> d
variables:
c\<^sub>0, c\<^sub>1, d :: 'a
(\<iinter>) :: 'a \<Rightarrow> 'a \<Rightarrow> 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<Sqinter> {c\<^sub>0::'a::refinement_lattice, c\<^sub>1::'a::refinement_lattice} \<iinter> (d::'a::refinement_lattice) = (\<Sqinter>c::'a::refinement_lattice\<in>{c\<^sub>0, c\<^sub>1}. c \<iinter> d)

goal (1 subgoal):
 1. (c\<^sub>0 \<sqinter> c\<^sub>1) \<iinter> d = c\<^sub>0 \<iinter> d \<sqinter> c\<^sub>1 \<iinter> d
variables:
c\<^sub>0, c\<^sub>1, d :: 'a
(\<iinter>) :: 'a \<Rightarrow> 'a \<Rightarrow> 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
have "... = (c\<^sub>0 \<iinter> d) \<sqinter> (c\<^sub>1 \<iinter> d)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sqinter>c::'a\<in>{c\<^sub>0, c\<^sub>1}. c \<iinter> d) = c\<^sub>0 \<iinter> d \<sqinter> c\<^sub>1 \<iinter> d
variables:
c\<^sub>0, c\<^sub>1, d :: 'a
(\<iinter>) :: 'a \<Rightarrow> 'a \<Rightarrow> 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<Sqinter>c::'a::refinement_lattice\<in>{c\<^sub>0::'a::refinement_lattice, c\<^sub>1::'a::refinement_lattice}. c \<iinter> (d::'a::refinement_lattice)) = c\<^sub>0 \<iinter> d \<sqinter> c\<^sub>1 \<iinter> d

goal (1 subgoal):
 1. (c\<^sub>0 \<sqinter> c\<^sub>1) \<iinter> d = c\<^sub>0 \<iinter> d \<sqinter> c\<^sub>1 \<iinter> d
variables:
c\<^sub>0, c\<^sub>1, d :: 'a
(\<iinter>) :: 'a \<Rightarrow> 'a \<Rightarrow> 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
((c\<^sub>0::'a::refinement_lattice) \<sqinter> (c\<^sub>1::'a::refinement_lattice)) \<iinter> (d::'a::refinement_lattice) = c\<^sub>0 \<iinter> d \<sqinter> c\<^sub>1 \<iinter> d
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
((c\<^sub>0::'a::refinement_lattice) \<sqinter> (c\<^sub>1::'a::refinement_lattice)) \<iinter> (d::'a::refinement_lattice) = c\<^sub>0 \<iinter> d \<sqinter> c\<^sub>1 \<iinter> d

goal (1 subgoal):
 1. (c\<^sub>0 \<sqinter> c\<^sub>1) \<iinter> d = c\<^sub>0 \<iinter> d \<sqinter> c\<^sub>1 \<iinter> d
variables:
c\<^sub>0, c\<^sub>1, d :: 'a
(\<iinter>) :: 'a \<Rightarrow> 'a \<Rightarrow> 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
((c\<^sub>0::'a::refinement_lattice) \<sqinter> (c\<^sub>1::'a::refinement_lattice)) \<iinter> (d::'a::refinement_lattice) = c\<^sub>0 \<iinter> d \<sqinter> c\<^sub>1 \<iinter> d

goal:
No subgoals!
variables:
c\<^sub>0, c\<^sub>1, d :: 'a
(\<iinter>) :: 'a \<Rightarrow> 'a \<Rightarrow> 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
qed


[STATEMENT]
lemma fps_exp_minus_ii_sin_cos: "fps_exp (- (\<i> * c)) = fps_cos c - fps_const \<i> * fps_sin c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fps_exp (- (\<i> * c)) = fps_cos c - fps_const \<i> * fps_sin c
[PROOF STEP]
unfolding minus_mult_right fps_exp_ii_sin_cos
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fps_cos (- c) + fps_const \<i> * fps_sin (- c) = fps_cos c - fps_const \<i> * fps_sin c
[PROOF STEP]
by (simp add: fps_sin_even fps_cos_odd)


[STATEMENT]
lemma [simp]: "\<eta>1 \<approx>>\<bullet> \<eta>2 \<Longrightarrow> NTCatDom (\<eta>1 \<bullet>1 \<eta>2) = NTCatDom \<eta>1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<eta>1 \<approx>>\<bullet> \<eta>2 \<Longrightarrow> NTCatDom (\<eta>1 \<bullet>1 \<eta>2) = NTCatDom \<eta>1
[PROOF STEP]
by (auto simp add: NatTransComp'_def NTCatDom_def)


[STATEMENT]
lemma derived_set_of_finite:
   "\<lbrakk>Hausdorff_space X; finite S\<rbrakk> \<Longrightarrow> X derived_set_of S = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Hausdorff_space X; finite S\<rbrakk> \<Longrightarrow> X derived_set_of S = {}
[PROOF STEP]
using Hausdorff_imp_t1_space t1_space_derived_set_of_finite
[PROOF STATE]
proof (prove)
using this:
Hausdorff_space ?X \<Longrightarrow> t1_space ?X
t1_space ?X = (\<forall>S. finite S \<longrightarrow> ?X derived_set_of S = {})

goal (1 subgoal):
 1. \<lbrakk>Hausdorff_space X; finite S\<rbrakk> \<Longrightarrow> X derived_set_of S = {}
[PROOF STEP]
by auto


[STATEMENT]
lemma continuous_closed_vimage: "closed S \<Longrightarrow> (\<And>x. continuous (at x) f) \<Longrightarrow> closed (f -` S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>closed S; \<And>x. isCont f x\<rbrakk> \<Longrightarrow> closed (f -` S)
[PROOF STEP]
by (simp add: closed_vimage continuous_on_eq_continuous_within)


[STATEMENT]
lemma nat_diff_right_cancel_le1: "\<lbrakk> m - k \<le> n - (k::nat); k < m \<rbrakk> \<Longrightarrow> m \<le> n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>m - k \<le> n - k; k < m\<rbrakk> \<Longrightarrow> m \<le> n
[PROOF STEP]
by simp


[STATEMENT]
lemma bl2nat_exp_zero[simp]: "bl2nat (Oc\<up>y) 0 = 2^y - Suc 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bl2nat (Oc \<up> y) 0 = 2 ^ y - Suc 0
[PROOF STEP]
proof(induct y)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. bl2nat (Oc \<up> 0) 0 = 2 ^ 0 - Suc 0
 2. \<And>y. bl2nat (Oc \<up> y) 0 = 2 ^ y - Suc 0 \<Longrightarrow> bl2nat (Oc \<up> Suc y) 0 = 2 ^ Suc y - Suc 0
[PROOF STEP]
case (Suc y)
[PROOF STATE]
proof (state)
this:
bl2nat (Oc \<up> y) 0 = 2 ^ y - Suc 0

goal (2 subgoals):
 1. bl2nat (Oc \<up> 0) 0 = 2 ^ 0 - Suc 0
 2. \<And>y. bl2nat (Oc \<up> y) 0 = 2 ^ y - Suc 0 \<Longrightarrow> bl2nat (Oc \<up> Suc y) 0 = 2 ^ Suc y - Suc 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
bl2nat (Oc \<up> y) 0 = 2 ^ y - Suc 0
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
bl2nat (Oc \<up> y) 0 = 2 ^ y - Suc 0

goal (1 subgoal):
 1. bl2nat (Oc \<up> Suc y) 0 = 2 ^ Suc y - Suc 0
[PROOF STEP]
by(cases "(2::nat)^y", auto)
[PROOF STATE]
proof (state)
this:
bl2nat (Oc \<up> Suc y) 0 = 2 ^ Suc y - Suc 0

goal (1 subgoal):
 1. bl2nat (Oc \<up> 0) 0 = 2 ^ 0 - Suc 0
[PROOF STEP]
qed (auto simp: bl2nat.simps bl2nat_double)


[STATEMENT]
lemma solution_0_snd_iff [simp]: "solution (a :: 'a :: idom, 0) \<longleftrightarrow> a \<in> {1, -1}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. solution (a, 0::'a) = (a \<in> {1::'a, - (1::'a)})
[PROOF STEP]
by (auto simp: solution_def power2_eq_1_iff)


[STATEMENT]
lemma (in monoid) nat_pow_pow:
  "x \<in> carrier G ==> (x [^] n) [^] m = x [^] (n * m::nat)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> carrier G \<Longrightarrow> (x [^] n) [^] m = x [^] (n * m)
[PROOF STEP]
by (induct m) (simp, simp add: nat_pow_mult add.commute)


[STATEMENT]
lemma sum_image_eq:
  assumes "inj_on f A"
  shows "\<Sum> (f ` A) = (\<Sum> i \<in> A. f i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Sum> (f ` A) = sum f A
[PROOF STEP]
using assms sum.reindex_cong
[PROOF STATE]
proof (prove)
using this:
inj_on f A
\<lbrakk>inj_on ?l ?B; ?A = ?l ` ?B; \<And>x. x \<in> ?B \<Longrightarrow> ?g (?l x) = ?h x\<rbrakk> \<Longrightarrow> sum ?g ?A = sum ?h ?B

goal (1 subgoal):
 1. \<Sum> (f ` A) = sum f A
[PROOF STEP]
by fastforce


[STATEMENT]
lemma lub_sum:
  fixes f :: "'b::finite \<Rightarrow> 'a"
  assumes "\<forall>k . f k \<le> x"
    shows "(\<Squnion>\<^sub>k f k) \<le> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. comm_monoid_add.sum (\<squnion>) bot f {k. True} \<le> x
[PROOF STEP]
proof (induct rule: one_sup_induct)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>i. f i \<le> x
 2. \<And>j I. \<lbrakk>j \<notin> I; comm_monoid_add.sum (\<squnion>) bot f I \<le> x\<rbrakk> \<Longrightarrow> f j \<squnion> comm_monoid_add.sum (\<squnion>) bot f I \<le> x
[PROOF STEP]
case one
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. \<And>i. f i \<le> x
 2. \<And>j I. \<lbrakk>j \<notin> I; comm_monoid_add.sum (\<squnion>) bot f I \<le> x\<rbrakk> \<Longrightarrow> f j \<squnion> comm_monoid_add.sum (\<squnion>) bot f I \<le> x
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f i_ \<le> x
[PROOF STEP]
by (simp add: assms)
[PROOF STATE]
proof (state)
this:
f i_ \<le> x

goal (1 subgoal):
 1. \<And>j I. \<lbrakk>j \<notin> I; comm_monoid_add.sum (\<squnion>) bot f I \<le> x\<rbrakk> \<Longrightarrow> f j \<squnion> comm_monoid_add.sum (\<squnion>) bot f I \<le> x
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>j I. \<lbrakk>j \<notin> I; comm_monoid_add.sum (\<squnion>) bot f I \<le> x\<rbrakk> \<Longrightarrow> f j \<squnion> comm_monoid_add.sum (\<squnion>) bot f I \<le> x
[PROOF STEP]
case (sup j I)
[PROOF STATE]
proof (state)
this:
j \<notin> I
comm_monoid_add.sum (\<squnion>) bot f I \<le> x

goal (1 subgoal):
 1. \<And>j I. \<lbrakk>j \<notin> I; comm_monoid_add.sum (\<squnion>) bot f I \<le> x\<rbrakk> \<Longrightarrow> f j \<squnion> comm_monoid_add.sum (\<squnion>) bot f I \<le> x
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
j \<notin> I
comm_monoid_add.sum (\<squnion>) bot f I \<le> x

goal (1 subgoal):
 1. f j \<squnion> comm_monoid_add.sum (\<squnion>) bot f I \<le> x
[PROOF STEP]
using assms le_supI
[PROOF STATE]
proof (prove)
using this:
j \<notin> I
comm_monoid_add.sum (\<squnion>) bot f I \<le> x
\<forall>k. f k \<le> x
\<lbrakk>?a \<le> ?x; ?b \<le> ?x\<rbrakk> \<Longrightarrow> ?a \<squnion> ?b \<le> ?x

goal (1 subgoal):
 1. f j \<squnion> comm_monoid_add.sum (\<squnion>) bot f I \<le> x
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
f j \<squnion> comm_monoid_add.sum (\<squnion>) bot f I \<le> x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma lookup_monom_mult_zero: "lookup (monom_mult c 0 p) t = c * lookup p t"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lookup (monom_mult c (0::'a) p) t = c * lookup p t
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. lookup (monom_mult c (0::'a) p) t = c * lookup p t
[PROOF STEP]
have "lookup (monom_mult c 0 p) t = lookup (monom_mult c 0 p) (0 \<oplus> t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lookup (monom_mult c (0::'a) p) t = lookup (monom_mult c (0::'a) p) ((0::'a) \<oplus> t)
[PROOF STEP]
by (simp add: term_simps)
[PROOF STATE]
proof (state)
this:
lookup (monom_mult c (0::'a) p) t = lookup (monom_mult c (0::'a) p) ((0::'a) \<oplus> t)

goal (1 subgoal):
 1. lookup (monom_mult c (0::'a) p) t = c * lookup p t
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
lookup (monom_mult c (0::'a) p) t = lookup (monom_mult c (0::'a) p) ((0::'a) \<oplus> t)

goal (1 subgoal):
 1. lookup (monom_mult c (0::'a) p) t = c * lookup p t
[PROOF STEP]
have "... = c * lookup p t"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lookup (monom_mult c (0::'a) p) ((0::'a) \<oplus> t) = c * lookup p t
[PROOF STEP]
by (rule lookup_monom_mult_plus)
[PROOF STATE]
proof (state)
this:
lookup (monom_mult c (0::'a) p) ((0::'a) \<oplus> t) = c * lookup p t

goal (1 subgoal):
 1. lookup (monom_mult c (0::'a) p) t = c * lookup p t
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
lookup (monom_mult c (0::'a) p) t = c * lookup p t
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
lookup (monom_mult c (0::'a) p) t = c * lookup p t

goal (1 subgoal):
 1. lookup (monom_mult c (0::'a) p) t = c * lookup p t
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
lookup (monom_mult c (0::'a) p) t = c * lookup p t

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma iUntil_True[simp]: "(P t'. t' \<U> t I. True) = (I \<noteq> {})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (P t'. t' \<U> t I. True) = (I \<noteq> {})
[PROOF STEP]
apply (unfold iTL_defs)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>t\<in>I. True \<and> Ball (I \<down>< t) P) = (I \<noteq> {})
[PROOF STEP]
apply (rule iffI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<exists>t\<in>I. True \<and> Ball (I \<down>< t) P \<Longrightarrow> I \<noteq> {}
 2. I \<noteq> {} \<Longrightarrow> \<exists>t\<in>I. True \<and> Ball (I \<down>< t) P
[PROOF STEP]
apply blast
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. I \<noteq> {} \<Longrightarrow> \<exists>t\<in>I. True \<and> Ball (I \<down>< t) P
[PROOF STEP]
apply (rule_tac x="iMin I" in bexI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. I \<noteq> {} \<Longrightarrow> True \<and> Ball (I \<down>< iMin I) P
 2. I \<noteq> {} \<Longrightarrow> iMin I \<in> I
[PROOF STEP]
apply (simp add: cut_less_Min_empty iMinI_ex2)+
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma nonzero_inverse_inverse_eq: "a \<in> carrier R \<Longrightarrow> a \<noteq> \<zero> \<Longrightarrow> inv (inv a) = a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<in> carrier R; a \<noteq> \<zero>\<rbrakk> \<Longrightarrow> inv (inv a) = a
[PROOF STEP]
by (rule inverse_unique) simp_all


[STATEMENT]
lemma unitary11_unitary11_gen [simp]:
  assumes "unitary11 M"
  shows "unitary11_gen M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. unitary11_gen M
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
unitary11 M

goal (1 subgoal):
 1. unitary11_gen M
[PROOF STEP]
unfolding unitary11_gen_def unitary11_def
[PROOF STATE]
proof (prove)
using this:
congruence M (1, 0, 0, - 1) = (1, 0, 0, - 1)

goal (1 subgoal):
 1. \<exists>k. k \<noteq> 0 \<and> congruence M (1, 0, 0, - 1) = k *\<^sub>s\<^sub>m (1, 0, 0, - 1)
[PROOF STEP]
by (rule_tac x="1" in exI, auto)


[STATEMENT]
lemma poly_power_inv: assumes p: "poly_inv p"
  shows "poly_inv (poly_power p n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly_inv (poly_power p n)
[PROOF STEP]
by (induct n, simp add: one_poly_inv, simp add: poly_mult_inv[OF p])


[STATEMENT]
lemma filterlim_at_infinity:
  fixes f :: "_ \<Rightarrow> 'a::real_normed_vector"
  assumes "0 \<le> c"
  shows "(LIM x F. f x :> at_infinity) \<longleftrightarrow> (\<forall>r>c. eventually (\<lambda>x. r \<le> norm (f x)) F)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. filterlim f at_infinity F = (\<forall>r>c. \<forall>\<^sub>F x in F. r \<le> norm (f x))
[PROOF STEP]
unfolding filterlim_iff eventually_at_infinity
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>P. (\<exists>b. \<forall>x. b \<le> norm x \<longrightarrow> P x) \<longrightarrow> (\<forall>\<^sub>F x in F. P (f x))) = (\<forall>r>c. \<forall>\<^sub>F x in F. r \<le> norm (f x))
[PROOF STEP]
proof safe
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>r. \<lbrakk>\<forall>P. (\<exists>b. \<forall>x. b \<le> norm x \<longrightarrow> P x) \<longrightarrow> (\<forall>\<^sub>F x in F. P (f x)); c < r\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F x in F. r \<le> norm (f x)
 2. \<And>P b. \<lbrakk>\<forall>r>c. \<forall>\<^sub>F x in F. r \<le> norm (f x); \<forall>x. b \<le> norm x \<longrightarrow> P x\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F x in F. P (f x)
[PROOF STEP]
fix P :: "'a \<Rightarrow> bool"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>r. \<lbrakk>\<forall>P. (\<exists>b. \<forall>x. b \<le> norm x \<longrightarrow> P x) \<longrightarrow> (\<forall>\<^sub>F x in F. P (f x)); c < r\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F x in F. r \<le> norm (f x)
 2. \<And>P b. \<lbrakk>\<forall>r>c. \<forall>\<^sub>F x in F. r \<le> norm (f x); \<forall>x. b \<le> norm x \<longrightarrow> P x\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F x in F. P (f x)
[PROOF STEP]
fix b
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>r. \<lbrakk>\<forall>P. (\<exists>b. \<forall>x. b \<le> norm x \<longrightarrow> P x) \<longrightarrow> (\<forall>\<^sub>F x in F. P (f x)); c < r\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F x in F. r \<le> norm (f x)
 2. \<And>P b. \<lbrakk>\<forall>r>c. \<forall>\<^sub>F x in F. r \<le> norm (f x); \<forall>x. b \<le> norm x \<longrightarrow> P x\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F x in F. P (f x)
[PROOF STEP]
assume *: "\<forall>r>c. eventually (\<lambda>x. r \<le> norm (f x)) F"
[PROOF STATE]
proof (state)
this:
\<forall>r>c. \<forall>\<^sub>F x in F. r \<le> norm (f x)

goal (2 subgoals):
 1. \<And>r. \<lbrakk>\<forall>P. (\<exists>b. \<forall>x. b \<le> norm x \<longrightarrow> P x) \<longrightarrow> (\<forall>\<^sub>F x in F. P (f x)); c < r\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F x in F. r \<le> norm (f x)
 2. \<And>P b. \<lbrakk>\<forall>r>c. \<forall>\<^sub>F x in F. r \<le> norm (f x); \<forall>x. b \<le> norm x \<longrightarrow> P x\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F x in F. P (f x)
[PROOF STEP]
assume P: "\<forall>x. b \<le> norm x \<longrightarrow> P x"
[PROOF STATE]
proof (state)
this:
\<forall>x. b \<le> norm x \<longrightarrow> P x

goal (2 subgoals):
 1. \<And>r. \<lbrakk>\<forall>P. (\<exists>b. \<forall>x. b \<le> norm x \<longrightarrow> P x) \<longrightarrow> (\<forall>\<^sub>F x in F. P (f x)); c < r\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F x in F. r \<le> norm (f x)
 2. \<And>P b. \<lbrakk>\<forall>r>c. \<forall>\<^sub>F x in F. r \<le> norm (f x); \<forall>x. b \<le> norm x \<longrightarrow> P x\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F x in F. P (f x)
[PROOF STEP]
have "max b (c + 1) > c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c < max b (c + 1)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
c < max b (c + 1)

goal (2 subgoals):
 1. \<And>r. \<lbrakk>\<forall>P. (\<exists>b. \<forall>x. b \<le> norm x \<longrightarrow> P x) \<longrightarrow> (\<forall>\<^sub>F x in F. P (f x)); c < r\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F x in F. r \<le> norm (f x)
 2. \<And>P b. \<lbrakk>\<forall>r>c. \<forall>\<^sub>F x in F. r \<le> norm (f x); \<forall>x. b \<le> norm x \<longrightarrow> P x\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F x in F. P (f x)
[PROOF STEP]
with *
[PROOF STATE]
proof (chain)
picking this:
\<forall>r>c. \<forall>\<^sub>F x in F. r \<le> norm (f x)
c < max b (c + 1)
[PROOF STEP]
have "eventually (\<lambda>x. max b (c + 1) \<le> norm (f x)) F"
[PROOF STATE]
proof (prove)
using this:
\<forall>r>c. \<forall>\<^sub>F x in F. r \<le> norm (f x)
c < max b (c + 1)

goal (1 subgoal):
 1. \<forall>\<^sub>F x in F. max b (c + 1) \<le> norm (f x)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in F. max b (c + 1) \<le> norm (f x)

goal (2 subgoals):
 1. \<And>r. \<lbrakk>\<forall>P. (\<exists>b. \<forall>x. b \<le> norm x \<longrightarrow> P x) \<longrightarrow> (\<forall>\<^sub>F x in F. P (f x)); c < r\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F x in F. r \<le> norm (f x)
 2. \<And>P b. \<lbrakk>\<forall>r>c. \<forall>\<^sub>F x in F. r \<le> norm (f x); \<forall>x. b \<le> norm x \<longrightarrow> P x\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F x in F. P (f x)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F x in F. max b (c + 1) \<le> norm (f x)
[PROOF STEP]
show "eventually (\<lambda>x. P (f x)) F"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in F. max b (c + 1) \<le> norm (f x)

goal (1 subgoal):
 1. \<forall>\<^sub>F x in F. P (f x)
[PROOF STEP]
proof eventually_elim
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. max b (c + 1) \<le> norm (f x) \<Longrightarrow> P (f x)
[PROOF STEP]
case (elim x)
[PROOF STATE]
proof (state)
this:
max b (c + 1) \<le> norm (f x)

goal (1 subgoal):
 1. \<And>x. max b (c + 1) \<le> norm (f x) \<Longrightarrow> P (f x)
[PROOF STEP]
with P
[PROOF STATE]
proof (chain)
picking this:
\<forall>x. b \<le> norm x \<longrightarrow> P x
max b (c + 1) \<le> norm (f x)
[PROOF STEP]
show "P (f x)"
[PROOF STATE]
proof (prove)
using this:
\<forall>x. b \<le> norm x \<longrightarrow> P x
max b (c + 1) \<le> norm (f x)

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in F. P (f x)

goal (1 subgoal):
 1. \<And>r. \<lbrakk>\<forall>P. (\<exists>b. \<forall>x. b \<le> norm x \<longrightarrow> P x) \<longrightarrow> (\<forall>\<^sub>F x in F. P (f x)); c < r\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F x in F. r \<le> norm (f x)
[PROOF STEP]
qed force


[STATEMENT]
lemma UP_smult_r_distr:
  "[| a \<in> carrier R; p \<in> carrier P; q \<in> carrier P |] ==>
  a \<odot>\<^bsub>P\<^esub> (p \<oplus>\<^bsub>P\<^esub> q) = a \<odot>\<^bsub>P\<^esub> p \<oplus>\<^bsub>P\<^esub> a \<odot>\<^bsub>P\<^esub> q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<in> carrier R; p \<in> carrier P; q \<in> carrier P\<rbrakk> \<Longrightarrow> a \<odot>\<^bsub>P\<^esub> (p \<oplus>\<^bsub>P\<^esub> q) = a \<odot>\<^bsub>P\<^esub> p \<oplus>\<^bsub>P\<^esub> a \<odot>\<^bsub>P\<^esub> q
[PROOF STEP]
by (rule up_eqI) (simp_all add: R.r_distr)


[STATEMENT]
lemma compl_less_compl_iff[simp]: "- x < - y \<longleftrightarrow> y < x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (- x < - y) = (y < x)
[PROOF STEP]
by (auto simp add: less_le)


[STATEMENT]
lemma affine_independent_convex_affine_hull:
  fixes S :: "'a::euclidean_space set"
  assumes "\<not> affine_dependent S" "T \<subseteq> S"
    shows "convex hull T = affine hull T \<inter> convex hull S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. convex hull T = affine hull T \<inter> convex hull S
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. convex hull T = affine hull T \<inter> convex hull S
[PROOF STEP]
have fin: "finite S" "finite T"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite S &&& finite T
[PROOF STEP]
using assms aff_independent_finite finite_subset
[PROOF STATE]
proof (prove)
using this:
\<not> affine_dependent S
T \<subseteq> S
\<not> affine_dependent ?B \<Longrightarrow> finite ?B
\<lbrakk>?A \<subseteq> ?B; finite ?B\<rbrakk> \<Longrightarrow> finite ?A

goal (1 subgoal):
 1. finite S &&& finite T
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
finite S
finite T

goal (1 subgoal):
 1. convex hull T = affine hull T \<inter> convex hull S
[PROOF STEP]
have "convex hull T \<subseteq> affine hull T"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. convex hull T \<subseteq> affine hull T
[PROOF STEP]
using convex_hull_subset_affine_hull
[PROOF STATE]
proof (prove)
using this:
convex hull ?s \<subseteq> affine hull ?s

goal (1 subgoal):
 1. convex hull T \<subseteq> affine hull T
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
convex hull T \<subseteq> affine hull T

goal (1 subgoal):
 1. convex hull T = affine hull T \<inter> convex hull S
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
convex hull T \<subseteq> affine hull T

goal (1 subgoal):
 1. convex hull T = affine hull T \<inter> convex hull S
[PROOF STEP]
have "convex hull T \<subseteq> convex hull S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. convex hull T \<subseteq> convex hull S
[PROOF STEP]
using assms hull_mono
[PROOF STATE]
proof (prove)
using this:
\<not> affine_dependent S
T \<subseteq> S
?s \<subseteq> ?t \<Longrightarrow> ?S hull ?s \<subseteq> ?S hull ?t

goal (1 subgoal):
 1. convex hull T \<subseteq> convex hull S
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
convex hull T \<subseteq> convex hull S

goal (1 subgoal):
 1. convex hull T = affine hull T \<inter> convex hull S
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
convex hull T \<subseteq> convex hull S

goal (1 subgoal):
 1. convex hull T = affine hull T \<inter> convex hull S
[PROOF STEP]
have "affine hull T \<inter> convex hull S \<subseteq> convex hull T"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. affine hull T \<inter> convex hull S \<subseteq> convex hull T
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. affine hull T \<inter> convex hull S \<subseteq> convex hull T
[PROOF STEP]
have 0: "\<And>u. sum u S = 0 \<Longrightarrow> (\<forall>v\<in>S. u v = 0) \<or> (\<Sum>v\<in>S. u v *\<^sub>R v) \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>u. sum u S = 0 \<Longrightarrow> (\<forall>v\<in>S. u v = 0) \<or> (\<Sum>v\<in>S. u v *\<^sub>R v) \<noteq> (0::'a)
[PROOF STEP]
using affine_dependent_explicit_finite assms(1) fin(1)
[PROOF STATE]
proof (prove)
using this:
finite ?S \<Longrightarrow> affine_dependent ?S = (\<exists>u. sum u ?S = 0 \<and> (\<exists>v\<in>?S. u v \<noteq> 0) \<and> (\<Sum>v\<in>?S. u v *\<^sub>R v) = (0::?'a))
\<not> affine_dependent S
finite S

goal (1 subgoal):
 1. \<And>u. sum u S = 0 \<Longrightarrow> (\<forall>v\<in>S. u v = 0) \<or> (\<Sum>v\<in>S. u v *\<^sub>R v) \<noteq> (0::'a)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
sum ?u S = 0 \<Longrightarrow> (\<forall>v\<in>S. ?u v = 0) \<or> (\<Sum>v\<in>S. ?u v *\<^sub>R v) \<noteq> (0::'a)

goal (1 subgoal):
 1. affine hull T \<inter> convex hull S \<subseteq> convex hull T
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. affine hull T \<inter> convex hull S \<subseteq> convex hull T
[PROOF STEP]
proof (clarsimp simp add: affine_hull_finite fin)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>u. \<lbrakk>(\<Sum>v\<in>T. u v *\<^sub>R v) \<in> convex hull S; sum u T = 1\<rbrakk> \<Longrightarrow> (\<Sum>v\<in>T. u v *\<^sub>R v) \<in> convex hull T
[PROOF STEP]
fix u
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>u. \<lbrakk>(\<Sum>v\<in>T. u v *\<^sub>R v) \<in> convex hull S; sum u T = 1\<rbrakk> \<Longrightarrow> (\<Sum>v\<in>T. u v *\<^sub>R v) \<in> convex hull T
[PROOF STEP]
assume S: "(\<Sum>v\<in>T. u v *\<^sub>R v) \<in> convex hull S"
        and T1: "sum u T = 1"
[PROOF STATE]
proof (state)
this:
(\<Sum>v\<in>T. u v *\<^sub>R v) \<in> convex hull S
sum u T = 1

goal (1 subgoal):
 1. \<And>u. \<lbrakk>(\<Sum>v\<in>T. u v *\<^sub>R v) \<in> convex hull S; sum u T = 1\<rbrakk> \<Longrightarrow> (\<Sum>v\<in>T. u v *\<^sub>R v) \<in> convex hull T
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<Sum>v\<in>T. u v *\<^sub>R v) \<in> convex hull S
sum u T = 1
[PROOF STEP]
obtain v where v: "\<forall>x\<in>S. 0 \<le> v x" "sum v S = 1" "(\<Sum>x\<in>S. v x *\<^sub>R x) = (\<Sum>v\<in>T. u v *\<^sub>R v)"
[PROOF STATE]
proof (prove)
using this:
(\<Sum>v\<in>T. u v *\<^sub>R v) \<in> convex hull S
sum u T = 1

goal (1 subgoal):
 1. (\<And>v. \<lbrakk>\<forall>x\<in>S. 0 \<le> v x; sum v S = 1; (\<Sum>x\<in>S. v x *\<^sub>R x) = (\<Sum>v\<in>T. u v *\<^sub>R v)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp add: convex_hull_finite fin)
[PROOF STATE]
proof (state)
this:
\<forall>x\<in>S. 0 \<le> v x
sum v S = 1
(\<Sum>x\<in>S. v x *\<^sub>R x) = (\<Sum>v\<in>T. u v *\<^sub>R v)

goal (1 subgoal):
 1. \<And>u. \<lbrakk>(\<Sum>v\<in>T. u v *\<^sub>R v) \<in> convex hull S; sum u T = 1\<rbrakk> \<Longrightarrow> (\<Sum>v\<in>T. u v *\<^sub>R v) \<in> convex hull T
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
\<forall>x\<in>S. 0 \<le> v x
sum v S = 1
(\<Sum>x\<in>S. v x *\<^sub>R x) = (\<Sum>v\<in>T. u v *\<^sub>R v)

goal (1 subgoal):
 1. \<And>u. \<lbrakk>(\<Sum>v\<in>T. u v *\<^sub>R v) \<in> convex hull S; sum u T = 1\<rbrakk> \<Longrightarrow> (\<Sum>v\<in>T. u v *\<^sub>R v) \<in> convex hull T
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>u. \<lbrakk>(\<Sum>v\<in>T. u v *\<^sub>R v) \<in> convex hull S; sum u T = 1\<rbrakk> \<Longrightarrow> (\<Sum>v\<in>T. u v *\<^sub>R v) \<in> convex hull T
[PROOF STEP]
assume"x \<in> T"
[PROOF STATE]
proof (state)
this:
x \<in> T

goal (1 subgoal):
 1. \<And>u. \<lbrakk>(\<Sum>v\<in>T. u v *\<^sub>R v) \<in> convex hull S; sum u T = 1\<rbrakk> \<Longrightarrow> (\<Sum>v\<in>T. u v *\<^sub>R v) \<in> convex hull T
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<in> T
[PROOF STEP]
have S: "S = (S - T) \<union> T" \<comment> \<open>split into separate cases\<close>
[PROOF STATE]
proof (prove)
using this:
x \<in> T

goal (1 subgoal):
 1. S = S - T \<union> T
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
x \<in> T
\<not> affine_dependent S
T \<subseteq> S

goal (1 subgoal):
 1. S = S - T \<union> T
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
S = S - T \<union> T

goal (1 subgoal):
 1. \<And>u. \<lbrakk>(\<Sum>v\<in>T. u v *\<^sub>R v) \<in> convex hull S; sum u T = 1\<rbrakk> \<Longrightarrow> (\<Sum>v\<in>T. u v *\<^sub>R v) \<in> convex hull T
[PROOF STEP]
have [simp]: "(\<Sum>x\<in>T. v x *\<^sub>R x) + (\<Sum>x\<in>S - T. v x *\<^sub>R x) = (\<Sum>x\<in>T. u x *\<^sub>R x)"
          "sum v T + sum v (S - T) = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>x\<in>T. v x *\<^sub>R x) + (\<Sum>x\<in>S - T. v x *\<^sub>R x) = (\<Sum>x\<in>T. u x *\<^sub>R x) &&& sum v T + sum v (S - T) = 1
[PROOF STEP]
using v fin S
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>S. 0 \<le> v x
sum v S = 1
(\<Sum>x\<in>S. v x *\<^sub>R x) = (\<Sum>v\<in>T. u v *\<^sub>R v)
finite S
finite T
S = S - T \<union> T

goal (1 subgoal):
 1. (\<Sum>x\<in>T. v x *\<^sub>R x) + (\<Sum>x\<in>S - T. v x *\<^sub>R x) = (\<Sum>x\<in>T. u x *\<^sub>R x) &&& sum v T + sum v (S - T) = 1
[PROOF STEP]
by (auto simp: sum.union_disjoint [symmetric] Un_commute)
[PROOF STATE]
proof (state)
this:
(\<Sum>x\<in>T. v x *\<^sub>R x) + (\<Sum>x\<in>S - T. v x *\<^sub>R x) = (\<Sum>x\<in>T. u x *\<^sub>R x)
sum v T + sum v (S - T) = 1

goal (1 subgoal):
 1. \<And>u. \<lbrakk>(\<Sum>v\<in>T. u v *\<^sub>R v) \<in> convex hull S; sum u T = 1\<rbrakk> \<Longrightarrow> (\<Sum>v\<in>T. u v *\<^sub>R v) \<in> convex hull T
[PROOF STEP]
have "(\<Sum>x\<in>S. if x \<in> T then v x - u x else v x) = 0"
             "(\<Sum>x\<in>S. (if x \<in> T then v x - u x else v x) *\<^sub>R x) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>x\<in>S. if x \<in> T then v x - u x else v x) = 0 &&& (\<Sum>x\<in>S. (if x \<in> T then v x - u x else v x) *\<^sub>R x) = (0::'a)
[PROOF STEP]
using v fin T1
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>S. 0 \<le> v x
sum v S = 1
(\<Sum>x\<in>S. v x *\<^sub>R x) = (\<Sum>v\<in>T. u v *\<^sub>R v)
finite S
finite T
sum u T = 1

goal (1 subgoal):
 1. (\<Sum>x\<in>S. if x \<in> T then v x - u x else v x) = 0 &&& (\<Sum>x\<in>S. (if x \<in> T then v x - u x else v x) *\<^sub>R x) = (0::'a)
[PROOF STEP]
by (subst S, subst sum.union_disjoint, auto simp: algebra_simps sum_subtractf)+
[PROOF STATE]
proof (state)
this:
(\<Sum>x\<in>S. if x \<in> T then v x - u x else v x) = 0
(\<Sum>x\<in>S. (if x \<in> T then v x - u x else v x) *\<^sub>R x) = (0::'a)

goal (1 subgoal):
 1. \<And>u. \<lbrakk>(\<Sum>v\<in>T. u v *\<^sub>R v) \<in> convex hull S; sum u T = 1\<rbrakk> \<Longrightarrow> (\<Sum>v\<in>T. u v *\<^sub>R v) \<in> convex hull T
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
?x2 \<in> T \<Longrightarrow> (\<Sum>x\<in>S. if x \<in> T then v x - u x else v x) = 0
?x2 \<in> T \<Longrightarrow> (\<Sum>x\<in>S. (if x \<in> T then v x - u x else v x) *\<^sub>R x) = (0::'a)

goal (1 subgoal):
 1. \<And>u. \<lbrakk>(\<Sum>v\<in>T. u v *\<^sub>R v) \<in> convex hull S; sum u T = 1\<rbrakk> \<Longrightarrow> (\<Sum>v\<in>T. u v *\<^sub>R v) \<in> convex hull T
[PROOF STEP]
note [simp] = this
[PROOF STATE]
proof (state)
this:
?x2 \<in> T \<Longrightarrow> (\<Sum>x\<in>S. if x \<in> T then v x - u x else v x) = 0
?x2 \<in> T \<Longrightarrow> (\<Sum>x\<in>S. (if x \<in> T then v x - u x else v x) *\<^sub>R x) = (0::'a)

goal (1 subgoal):
 1. \<And>u. \<lbrakk>(\<Sum>v\<in>T. u v *\<^sub>R v) \<in> convex hull S; sum u T = 1\<rbrakk> \<Longrightarrow> (\<Sum>v\<in>T. u v *\<^sub>R v) \<in> convex hull T
[PROOF STEP]
have "(\<forall>x\<in>T. 0 \<le> u x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>T. 0 \<le> u x
[PROOF STEP]
using 0 [of "\<lambda>x. if x \<in> T then v x - u x else v x"] \<open>T \<subseteq> S\<close> v(1)
[PROOF STATE]
proof (prove)
using this:
(\<Sum>x\<in>S. if x \<in> T then v x - u x else v x) = 0 \<Longrightarrow> (\<forall>va\<in>S. (if va \<in> T then v va - u va else v va) = 0) \<or> (\<Sum>va\<in>S. (if va \<in> T then v va - u va else v va) *\<^sub>R va) \<noteq> (0::'a)
T \<subseteq> S
\<forall>x\<in>S. 0 \<le> v x

goal (1 subgoal):
 1. \<forall>x\<in>T. 0 \<le> u x
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
\<forall>x\<in>T. 0 \<le> u x

goal (1 subgoal):
 1. \<And>u. \<lbrakk>(\<Sum>v\<in>T. u v *\<^sub>R v) \<in> convex hull S; sum u T = 1\<rbrakk> \<Longrightarrow> (\<Sum>v\<in>T. u v *\<^sub>R v) \<in> convex hull T
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>x\<in>T. 0 \<le> u x
[PROOF STEP]
show "(\<Sum>v\<in>T. u v *\<^sub>R v) \<in> convex hull T"
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>T. 0 \<le> u x

goal (1 subgoal):
 1. (\<Sum>v\<in>T. u v *\<^sub>R v) \<in> convex hull T
[PROOF STEP]
using 0 [of "\<lambda>x. if x \<in> T then v x - u x else v x"] \<open>T \<subseteq> S\<close> T1
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>T. 0 \<le> u x
(\<Sum>x\<in>S. if x \<in> T then v x - u x else v x) = 0 \<Longrightarrow> (\<forall>va\<in>S. (if va \<in> T then v va - u va else v va) = 0) \<or> (\<Sum>va\<in>S. (if va \<in> T then v va - u va else v va) *\<^sub>R va) \<noteq> (0::'a)
T \<subseteq> S
sum u T = 1

goal (1 subgoal):
 1. (\<Sum>v\<in>T. u v *\<^sub>R v) \<in> convex hull T
[PROOF STEP]
by (fastforce simp add: convex_hull_finite fin)
[PROOF STATE]
proof (state)
this:
(\<Sum>v\<in>T. u v *\<^sub>R v) \<in> convex hull T

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
affine hull T \<inter> convex hull S \<subseteq> convex hull T

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
affine hull T \<inter> convex hull S \<subseteq> convex hull T

goal (1 subgoal):
 1. convex hull T = affine hull T \<inter> convex hull S
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
convex hull T \<subseteq> affine hull T
convex hull T \<subseteq> convex hull S
affine hull T \<inter> convex hull S \<subseteq> convex hull T
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
convex hull T \<subseteq> affine hull T
convex hull T \<subseteq> convex hull S
affine hull T \<inter> convex hull S \<subseteq> convex hull T

goal (1 subgoal):
 1. convex hull T = affine hull T \<inter> convex hull S
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
convex hull T = affine hull T \<inter> convex hull S

goal:
No subgoals!
[PROOF STEP]
qed