[STATEMENT]
lemma linear_inverse_blinop_lemma:
  fixes w::"'a::{banach, perfect_space} blinop"
  assumes "norm w < 1"
  shows
    "summable (\<lambda>n. (-1)^n *\<^sub>R w^n)" (is ?C)
    "(\<Sum>n. (-1)^n *\<^sub>R w^n) * (1 + w) = 1" (is ?I1)
    "(1 + w) * (\<Sum>n. (-1)^n *\<^sub>R w^n) = 1" (is ?I2)
    "norm ((\<Sum>n. (-1)^n *\<^sub>R w^n) - 1 + w) \<le> (norm w)\<^sup>2/(1 - norm (w))" (is ?L)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (summable (\<lambda>n. (- 1) ^ n *\<^sub>R w ^ n) &&& (\<Sum>n. (- 1) ^ n *\<^sub>R w ^ n) * (1 + w) = 1) &&& (1 + w) * (\<Sum>n. (- 1) ^ n *\<^sub>R w ^ n) = 1 &&& norm ((\<Sum>n. (- 1) ^ n *\<^sub>R w ^ n) - 1 + w) \<le> (norm w)\<^sup>2 / (1 - norm w)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. summable (\<lambda>n. (- 1) ^ n *\<^sub>R w ^ n)
 2. (\<Sum>n. (- 1) ^ n *\<^sub>R w ^ n) * (1 + w) = 1
 3. (1 + w) * (\<Sum>n. (- 1) ^ n *\<^sub>R w ^ n) = 1
 4. norm ((\<Sum>n. (- 1) ^ n *\<^sub>R w ^ n) - 1 + w) \<le> (norm w)\<^sup>2 / (1 - norm w)
[PROOF STEP]
have "summable (\<lambda>n. norm w ^ n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. summable ((^) (norm w))
[PROOF STEP]
apply (rule summable_geometric)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (norm w) < 1
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
norm w < 1

goal (1 subgoal):
 1. norm (norm w) < 1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
summable ((^) (norm w))

goal (4 subgoals):
 1. summable (\<lambda>n. (- 1) ^ n *\<^sub>R w ^ n)
 2. (\<Sum>n. (- 1) ^ n *\<^sub>R w ^ n) * (1 + w) = 1
 3. (1 + w) * (\<Sum>n. (- 1) ^ n *\<^sub>R w ^ n) = 1
 4. norm ((\<Sum>n. (- 1) ^ n *\<^sub>R w ^ n) - 1 + w) \<le> (norm w)\<^sup>2 / (1 - norm w)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
summable ((^) (norm w))
[PROOF STEP]
have "summable (\<lambda>n. norm (w ^ n))"
[PROOF STATE]
proof (prove)
using this:
summable ((^) (norm w))

goal (1 subgoal):
 1. summable (\<lambda>n. norm (w ^ n))
[PROOF STEP]
by (rule summable_comparison_test'[where N=0]) (auto intro!: norm_power_ineq)
[PROOF STATE]
proof (state)
this:
summable (\<lambda>n. norm (w ^ n))

goal (4 subgoals):
 1. summable (\<lambda>n. (- 1) ^ n *\<^sub>R w ^ n)
 2. (\<Sum>n. (- 1) ^ n *\<^sub>R w ^ n) * (1 + w) = 1
 3. (1 + w) * (\<Sum>n. (- 1) ^ n *\<^sub>R w ^ n) = 1
 4. norm ((\<Sum>n. (- 1) ^ n *\<^sub>R w ^ n) - 1 + w) \<le> (norm w)\<^sup>2 / (1 - norm w)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
summable (\<lambda>n. norm (w ^ n))
[PROOF STEP]
show ?C
[PROOF STATE]
proof (prove)
using this:
summable (\<lambda>n. norm (w ^ n))

goal (1 subgoal):
 1. summable (\<lambda>n. (- 1) ^ n *\<^sub>R w ^ n)
[PROOF STEP]
by (rule summable_comparison_test'[where N=0]) (auto simp: norm_power )
[PROOF STATE]
proof (state)
this:
summable (\<lambda>n. (- 1) ^ n *\<^sub>R w ^ n)

goal (3 subgoals):
 1. (\<Sum>n. (- 1) ^ n *\<^sub>R w ^ n) * (1 + w) = 1
 2. (1 + w) * (\<Sum>n. (- 1) ^ n *\<^sub>R w ^ n) = 1
 3. norm ((\<Sum>n. (- 1) ^ n *\<^sub>R w ^ n) - 1 + w) \<le> (norm w)\<^sup>2 / (1 - norm w)
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
summable (\<lambda>n. (- 1) ^ n *\<^sub>R w ^ n)

goal (3 subgoals):
 1. (\<Sum>n. (- 1) ^ n *\<^sub>R w ^ n) * (1 + w) = 1
 2. (1 + w) * (\<Sum>n. (- 1) ^ n *\<^sub>R w ^ n) = 1
 3. norm ((\<Sum>n. (- 1) ^ n *\<^sub>R w ^ n) - 1 + w) \<le> (norm w)\<^sup>2 / (1 - norm w)
[PROOF STEP]
fix N
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. (\<Sum>n. (- 1) ^ n *\<^sub>R w ^ n) * (1 + w) = 1
 2. (1 + w) * (\<Sum>n. (- 1) ^ n *\<^sub>R w ^ n) = 1
 3. norm ((\<Sum>n. (- 1) ^ n *\<^sub>R w ^ n) - 1 + w) \<le> (norm w)\<^sup>2 / (1 - norm w)
[PROOF STEP]
have 1: "(1 + w) * sum (\<lambda>n. (-1)^n *\<^sub>R w^n) {..<N} = sum (\<lambda>n. (-1)^n *\<^sub>R w^n) {..<N} * (1 + w)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (1 + w) * (\<Sum>n<N. (- 1) ^ n *\<^sub>R w ^ n) = (\<Sum>n<N. (- 1) ^ n *\<^sub>R w ^ n) * (1 + w)
[PROOF STEP]
by (auto simp: algebra_simps sum_distrib_left sum_distrib_right sum.distrib power_commutes)
[PROOF STATE]
proof (state)
this:
(1 + w) * (\<Sum>n<N. (- 1) ^ n *\<^sub>R w ^ n) = (\<Sum>n<N. (- 1) ^ n *\<^sub>R w ^ n) * (1 + w)

goal (3 subgoals):
 1. (\<Sum>n. (- 1) ^ n *\<^sub>R w ^ n) * (1 + w) = 1
 2. (1 + w) * (\<Sum>n. (- 1) ^ n *\<^sub>R w ^ n) = 1
 3. norm ((\<Sum>n. (- 1) ^ n *\<^sub>R w ^ n) - 1 + w) \<le> (norm w)\<^sup>2 / (1 - norm w)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(1 + w) * (\<Sum>n<N. (- 1) ^ n *\<^sub>R w ^ n) = (\<Sum>n<N. (- 1) ^ n *\<^sub>R w ^ n) * (1 + w)

goal (3 subgoals):
 1. (\<Sum>n. (- 1) ^ n *\<^sub>R w ^ n) * (1 + w) = 1
 2. (1 + w) * (\<Sum>n. (- 1) ^ n *\<^sub>R w ^ n) = 1
 3. norm ((\<Sum>n. (- 1) ^ n *\<^sub>R w ^ n) - 1 + w) \<le> (norm w)\<^sup>2 / (1 - norm w)
[PROOF STEP]
have "\<dots> = sum (\<lambda>n. (-1)^n *\<^sub>R w^n - (-1)^Suc n *\<^sub>R w^ Suc n) {..<N}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>n<N. (- 1) ^ n *\<^sub>R w ^ n) * (1 + w) = (\<Sum>n<N. (- 1) ^ n *\<^sub>R w ^ n - (- 1) ^ Suc n *\<^sub>R w ^ Suc n)
[PROOF STEP]
by (auto simp: algebra_simps sum_distrib_left sum_distrib_right sum.distrib power_commutes)
[PROOF STATE]
proof (state)
this:
(\<Sum>n<N. (- 1) ^ n *\<^sub>R w ^ n) * (1 + w) = (\<Sum>n<N. (- 1) ^ n *\<^sub>R w ^ n - (- 1) ^ Suc n *\<^sub>R w ^ Suc n)

goal (3 subgoals):
 1. (\<Sum>n. (- 1) ^ n *\<^sub>R w ^ n) * (1 + w) = 1
 2. (1 + w) * (\<Sum>n. (- 1) ^ n *\<^sub>R w ^ n) = 1
 3. norm ((\<Sum>n. (- 1) ^ n *\<^sub>R w ^ n) - 1 + w) \<le> (norm w)\<^sup>2 / (1 - norm w)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>n<N. (- 1) ^ n *\<^sub>R w ^ n) * (1 + w) = (\<Sum>n<N. (- 1) ^ n *\<^sub>R w ^ n - (- 1) ^ Suc n *\<^sub>R w ^ Suc n)

goal (3 subgoals):
 1. (\<Sum>n. (- 1) ^ n *\<^sub>R w ^ n) * (1 + w) = 1
 2. (1 + w) * (\<Sum>n. (- 1) ^ n *\<^sub>R w ^ n) = 1
 3. norm ((\<Sum>n. (- 1) ^ n *\<^sub>R w ^ n) - 1 + w) \<le> (norm w)\<^sup>2 / (1 - norm w)
[PROOF STEP]
have "\<dots> = 1 - (-1)^N *\<^sub>R w^N"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>n<N. (- 1) ^ n *\<^sub>R w ^ n - (- 1) ^ Suc n *\<^sub>R w ^ Suc n) = 1 - (- 1) ^ N *\<^sub>R w ^ N
[PROOF STEP]
by (subst sum_lessThan_telescope') (auto simp: algebra_simps)
[PROOF STATE]
proof (state)
this:
(\<Sum>n<N. (- 1) ^ n *\<^sub>R w ^ n - (- 1) ^ Suc n *\<^sub>R w ^ Suc n) = 1 - (- 1) ^ N *\<^sub>R w ^ N

goal (3 subgoals):
 1. (\<Sum>n. (- 1) ^ n *\<^sub>R w ^ n) * (1 + w) = 1
 2. (1 + w) * (\<Sum>n. (- 1) ^ n *\<^sub>R w ^ n) = 1
 3. norm ((\<Sum>n. (- 1) ^ n *\<^sub>R w ^ n) - 1 + w) \<le> (norm w)\<^sup>2 / (1 - norm w)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(1 + w) * (\<Sum>n<N. (- 1) ^ n *\<^sub>R w ^ n) = 1 - (- 1) ^ N *\<^sub>R w ^ N
[PROOF STEP]
have "(1 + w) * (\<Sum>n<N. (- 1) ^ n *\<^sub>R w ^ n) = 1 - (- 1) ^ N *\<^sub>R w ^ N"
[PROOF STATE]
proof (prove)
using this:
(1 + w) * (\<Sum>n<N. (- 1) ^ n *\<^sub>R w ^ n) = 1 - (- 1) ^ N *\<^sub>R w ^ N

goal (1 subgoal):
 1. (1 + w) * (\<Sum>n<N. (- 1) ^ n *\<^sub>R w ^ n) = 1 - (- 1) ^ N *\<^sub>R w ^ N
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(1 + w) * (\<Sum>n<N. (- 1) ^ n *\<^sub>R w ^ n) = 1 - (- 1) ^ N *\<^sub>R w ^ N

goal (3 subgoals):
 1. (\<Sum>n. (- 1) ^ n *\<^sub>R w ^ n) * (1 + w) = 1
 2. (1 + w) * (\<Sum>n. (- 1) ^ n *\<^sub>R w ^ n) = 1
 3. norm ((\<Sum>n. (- 1) ^ n *\<^sub>R w ^ n) - 1 + w) \<le> (norm w)\<^sup>2 / (1 - norm w)
[PROOF STEP]
note 1 this
[PROOF STATE]
proof (state)
this:
(1 + w) * (\<Sum>n<N. (- 1) ^ n *\<^sub>R w ^ n) = (\<Sum>n<N. (- 1) ^ n *\<^sub>R w ^ n) * (1 + w)
(1 + w) * (\<Sum>n<N. (- 1) ^ n *\<^sub>R w ^ n) = 1 - (- 1) ^ N *\<^sub>R w ^ N

goal (3 subgoals):
 1. (\<Sum>n. (- 1) ^ n *\<^sub>R w ^ n) * (1 + w) = 1
 2. (1 + w) * (\<Sum>n. (- 1) ^ n *\<^sub>R w ^ n) = 1
 3. norm ((\<Sum>n. (- 1) ^ n *\<^sub>R w ^ n) - 1 + w) \<le> (norm w)\<^sup>2 / (1 - norm w)
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
(1 + w) * (\<Sum>n<?N2. (- 1) ^ n *\<^sub>R w ^ n) = (\<Sum>n<?N2. (- 1) ^ n *\<^sub>R w ^ n) * (1 + w)
(1 + w) * (\<Sum>n<?N2. (- 1) ^ n *\<^sub>R w ^ n) = 1 - (- 1) ^ ?N2 *\<^sub>R w ^ ?N2

goal (3 subgoals):
 1. (\<Sum>n. (- 1) ^ n *\<^sub>R w ^ n) * (1 + w) = 1
 2. (1 + w) * (\<Sum>n. (- 1) ^ n *\<^sub>R w ^ n) = 1
 3. norm ((\<Sum>n. (- 1) ^ n *\<^sub>R w ^ n) - 1 + w) \<le> (norm w)\<^sup>2 / (1 - norm w)
[PROOF STEP]
note nu = this
[PROOF STATE]
proof (state)
this:
(1 + w) * (\<Sum>n<?N2. (- 1) ^ n *\<^sub>R w ^ n) = (\<Sum>n<?N2. (- 1) ^ n *\<^sub>R w ^ n) * (1 + w)
(1 + w) * (\<Sum>n<?N2. (- 1) ^ n *\<^sub>R w ^ n) = 1 - (- 1) ^ ?N2 *\<^sub>R w ^ ?N2

goal (3 subgoals):
 1. (\<Sum>n. (- 1) ^ n *\<^sub>R w ^ n) * (1 + w) = 1
 2. (1 + w) * (\<Sum>n. (- 1) ^ n *\<^sub>R w ^ n) = 1
 3. norm ((\<Sum>n. (- 1) ^ n *\<^sub>R w ^ n) - 1 + w) \<le> (norm w)\<^sup>2 / (1 - norm w)
[PROOF STEP]
show "?I1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>n. (- 1) ^ n *\<^sub>R w ^ n) * (1 + w) = 1
[PROOF STEP]
apply (subst suminf_mult2, fact)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>n. (- 1) ^ n *\<^sub>R w ^ n * (1 + w)) = 1
[PROOF STEP]
apply (subst suminf_eq_lim)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lim (\<lambda>n. \<Sum>i<n. (- 1) ^ i *\<^sub>R w ^ i * (1 + w)) = 1
[PROOF STEP]
apply (subst sum_distrib_right[symmetric])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lim (\<lambda>n. (\<Sum>i<n. (- 1) ^ i *\<^sub>R w ^ i) * (1 + w)) = 1
[PROOF STEP]
apply (rule limI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. (\<Sum>i<n. (- 1) ^ i *\<^sub>R w ^ i) * (1 + w)) \<longlonglongrightarrow> 1
[PROOF STEP]
apply (subst nu(1)[symmetric])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. (1 + w) * (\<Sum>n<n. (- 1) ^ n *\<^sub>R w ^ n)) \<longlonglongrightarrow> 1
[PROOF STEP]
apply (subst nu(2))
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. 1 - (- 1) ^ n *\<^sub>R w ^ n) \<longlonglongrightarrow> 1
[PROOF STEP]
apply (rule tendsto_eq_intros)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. (\<lambda>x. 1) \<longlonglongrightarrow> ?a4
 2. (\<lambda>x. (- 1) ^ x *\<^sub>R w ^ x) \<longlonglongrightarrow> ?b4
 3. ?a4 - ?b4 = 1
[PROOF STEP]
apply (rule tendsto_intros)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. (\<lambda>x. (- 1) ^ x *\<^sub>R w ^ x) \<longlonglongrightarrow> ?b4
 2. 1 - ?b4 = 1
[PROOF STEP]
apply (rule tendsto_norm_zero_cancel)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. (\<lambda>x. norm ((- 1) ^ x *\<^sub>R w ^ x)) \<longlonglongrightarrow> 0
 2. 1 - 0 = 1
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. norm (w ^ x)) \<longlonglongrightarrow> 0
[PROOF STEP]
apply (rule Lim_transform_bound[where g="\<lambda>i. norm w ^ i"])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<forall>\<^sub>F n in sequentially. norm (norm (w ^ n)) \<le> norm (norm w ^ n)
 2. (^) (norm w) \<longlonglongrightarrow> 0
[PROOF STEP]
apply (rule eventuallyI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x. norm (norm (w ^ x)) \<le> norm (norm w ^ x)
 2. (^) (norm w) \<longlonglongrightarrow> 0
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x. norm (w ^ x) \<le> norm w ^ x
 2. (^) (norm w) \<longlonglongrightarrow> 0
[PROOF STEP]
apply (rule norm_power_ineq)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (^) (norm w) \<longlonglongrightarrow> 0
[PROOF STEP]
apply (auto intro!: LIMSEQ_power_zero assms)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
(\<Sum>n. (- 1) ^ n *\<^sub>R w ^ n) * (1 + w) = 1

goal (2 subgoals):
 1. (1 + w) * (\<Sum>n. (- 1) ^ n *\<^sub>R w ^ n) = 1
 2. norm ((\<Sum>n. (- 1) ^ n *\<^sub>R w ^ n) - 1 + w) \<le> (norm w)\<^sup>2 / (1 - norm w)
[PROOF STEP]
show "?I2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (1 + w) * (\<Sum>n. (- 1) ^ n *\<^sub>R w ^ n) = 1
[PROOF STEP]
apply (subst suminf_mult[symmetric], fact)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>n. (1 + w) * (- 1) ^ n *\<^sub>R w ^ n) = 1
[PROOF STEP]
apply (subst suminf_eq_lim)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lim (\<lambda>n. \<Sum>i<n. (1 + w) * (- 1) ^ i *\<^sub>R w ^ i) = 1
[PROOF STEP]
apply (subst sum_distrib_left[symmetric])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lim (\<lambda>n. (1 + w) * (\<Sum>i<n. (- 1) ^ i *\<^sub>R w ^ i)) = 1
[PROOF STEP]
apply (rule limI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. (1 + w) * (\<Sum>i<n. (- 1) ^ i *\<^sub>R w ^ i)) \<longlonglongrightarrow> 1
[PROOF STEP]
apply (subst nu(2))
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. 1 - (- 1) ^ n *\<^sub>R w ^ n) \<longlonglongrightarrow> 1
[PROOF STEP]
apply (rule tendsto_eq_intros)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. (\<lambda>x. 1) \<longlonglongrightarrow> ?a4
 2. (\<lambda>x. (- 1) ^ x *\<^sub>R w ^ x) \<longlonglongrightarrow> ?b4
 3. ?a4 - ?b4 = 1
[PROOF STEP]
apply (rule tendsto_intros)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. (\<lambda>x. (- 1) ^ x *\<^sub>R w ^ x) \<longlonglongrightarrow> ?b4
 2. 1 - ?b4 = 1
[PROOF STEP]
apply (rule tendsto_norm_zero_cancel)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. (\<lambda>x. norm ((- 1) ^ x *\<^sub>R w ^ x)) \<longlonglongrightarrow> 0
 2. 1 - 0 = 1
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. norm (w ^ x)) \<longlonglongrightarrow> 0
[PROOF STEP]
apply (rule Lim_transform_bound[where g="\<lambda>i. norm w ^ i"])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<forall>\<^sub>F n in sequentially. norm (norm (w ^ n)) \<le> norm (norm w ^ n)
 2. (^) (norm w) \<longlonglongrightarrow> 0
[PROOF STEP]
apply (rule eventuallyI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x. norm (norm (w ^ x)) \<le> norm (norm w ^ x)
 2. (^) (norm w) \<longlonglongrightarrow> 0
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x. norm (w ^ x) \<le> norm w ^ x
 2. (^) (norm w) \<longlonglongrightarrow> 0
[PROOF STEP]
apply (rule norm_power_ineq)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (^) (norm w) \<longlonglongrightarrow> 0
[PROOF STEP]
apply (auto intro!: LIMSEQ_power_zero assms)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
(1 + w) * (\<Sum>n. (- 1) ^ n *\<^sub>R w ^ n) = 1

goal (1 subgoal):
 1. norm ((\<Sum>n. (- 1) ^ n *\<^sub>R w ^ n) - 1 + w) \<le> (norm w)\<^sup>2 / (1 - norm w)
[PROOF STEP]
have *: "(\<Sum>n. (- 1) ^ n *\<^sub>R w ^ n) - 1 + w = (w\<^sup>2 * (\<Sum>n. (- 1) ^ n *\<^sub>R w ^ n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>n. (- 1) ^ n *\<^sub>R w ^ n) - 1 + w = w\<^sup>2 * (\<Sum>n. (- 1) ^ n *\<^sub>R w ^ n)
[PROOF STEP]
apply (subst suminf_split_initial_segment[where k=2], fact)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>n. (- 1) ^ (n + 2) *\<^sub>R w ^ (n + 2)) + (\<Sum>i<2. (- 1) ^ i *\<^sub>R w ^ i) - 1 + w = w\<^sup>2 * (\<Sum>n. (- 1) ^ n *\<^sub>R w ^ n)
[PROOF STEP]
apply (subst suminf_mult[symmetric], fact)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>n. (- 1) ^ (n + 2) *\<^sub>R w ^ (n + 2)) + (\<Sum>i<2. (- 1) ^ i *\<^sub>R w ^ i) - 1 + w = (\<Sum>n. w\<^sup>2 * (- 1) ^ n *\<^sub>R w ^ n)
[PROOF STEP]
by (auto simp: power2_eq_square algebra_simps eval_nat_numeral)
[PROOF STATE]
proof (state)
this:
(\<Sum>n. (- 1) ^ n *\<^sub>R w ^ n) - 1 + w = w\<^sup>2 * (\<Sum>n. (- 1) ^ n *\<^sub>R w ^ n)

goal (1 subgoal):
 1. norm ((\<Sum>n. (- 1) ^ n *\<^sub>R w ^ n) - 1 + w) \<le> (norm w)\<^sup>2 / (1 - norm w)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>n. (- 1) ^ n *\<^sub>R w ^ n) - 1 + w = w\<^sup>2 * (\<Sum>n. (- 1) ^ n *\<^sub>R w ^ n)

goal (1 subgoal):
 1. norm ((\<Sum>n. (- 1) ^ n *\<^sub>R w ^ n) - 1 + w) \<le> (norm w)\<^sup>2 / (1 - norm w)
[PROOF STEP]
have "norm \<dots> \<le> (norm w)\<^sup>2 / (1 - norm w)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (w\<^sup>2 * (\<Sum>n. (- 1) ^ n *\<^sub>R w ^ n)) \<le> (norm w)\<^sup>2 / (1 - norm w)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. norm (w\<^sup>2 * (\<Sum>n. (- 1) ^ n *\<^sub>R w ^ n)) \<le> (norm w)\<^sup>2 / (1 - norm w)
[PROOF STEP]
have \<section>: "norm (\<Sum>n. (- 1) ^ n *\<^sub>R w ^ n) \<le> 1 / (1 - norm w)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (\<Sum>n. (- 1) ^ n *\<^sub>R w ^ n) \<le> 1 / (1 - norm w)
[PROOF STEP]
apply (rule order_trans[OF summable_norm])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. summable (\<lambda>n. norm ((- 1) ^ n *\<^sub>R w ^ n))
 2. (\<Sum>n. norm ((- 1) ^ n *\<^sub>R w ^ n)) \<le> 1 / (1 - norm w)
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. summable (\<lambda>n. norm (w ^ n))
 2. (\<Sum>n. norm (w ^ n)) \<le> 1 / (1 - norm w)
[PROOF STEP]
apply fact
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>n. norm (w ^ n)) \<le> 1 / (1 - norm w)
[PROOF STEP]
apply (rule order_trans[OF suminf_le])
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<And>n. norm (w ^ n) \<le> ?g6 n
 2. summable (\<lambda>n. norm (w ^ n))
 3. summable ?g6
 4. suminf ?g6 \<le> 1 / (1 - norm w)
[PROOF STEP]
apply (rule norm_power_ineq)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. summable (\<lambda>n. norm (w ^ n))
 2. summable ((^) (norm w))
 3. (\<Sum>n. norm w ^ n) \<le> 1 / (1 - norm w)
[PROOF STEP]
apply fact
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. summable ((^) (norm w))
 2. (\<Sum>n. norm w ^ n) \<le> 1 / (1 - norm w)
[PROOF STEP]
apply fact
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>n. norm w ^ n) \<le> 1 / (1 - norm w)
[PROOF STEP]
by (auto simp: suminf_geometric assms)
[PROOF STATE]
proof (state)
this:
norm (\<Sum>n. (- 1) ^ n *\<^sub>R w ^ n) \<le> 1 / (1 - norm w)

goal (1 subgoal):
 1. norm (w\<^sup>2 * (\<Sum>n. (- 1) ^ n *\<^sub>R w ^ n)) \<le> (norm w)\<^sup>2 / (1 - norm w)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (w\<^sup>2 * (\<Sum>n. (- 1) ^ n *\<^sub>R w ^ n)) \<le> (norm w)\<^sup>2 / (1 - norm w)
[PROOF STEP]
apply (rule order_trans[OF norm_mult_ineq])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (w\<^sup>2) * norm (\<Sum>n. (- 1) ^ n *\<^sub>R w ^ n) \<le> (norm w)\<^sup>2 / (1 - norm w)
[PROOF STEP]
apply (subst divide_inverse)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (w\<^sup>2) * norm (\<Sum>n. (- 1) ^ n *\<^sub>R w ^ n) \<le> (norm w)\<^sup>2 * inverse (1 - norm w)
[PROOF STEP]
apply (rule mult_mono)
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. norm (w\<^sup>2) \<le> (norm w)\<^sup>2
 2. norm (\<Sum>n. (- 1) ^ n *\<^sub>R w ^ n) \<le> inverse (1 - norm w)
 3. 0 \<le> (norm w)\<^sup>2
 4. 0 \<le> norm (\<Sum>n. (- 1) ^ n *\<^sub>R w ^ n)
[PROOF STEP]
apply (auto simp: norm_power_ineq inverse_eq_divide assms \<section>)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
norm (w\<^sup>2 * (\<Sum>n. (- 1) ^ n *\<^sub>R w ^ n)) \<le> (norm w)\<^sup>2 / (1 - norm w)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
norm (w\<^sup>2 * (\<Sum>n. (- 1) ^ n *\<^sub>R w ^ n)) \<le> (norm w)\<^sup>2 / (1 - norm w)

goal (1 subgoal):
 1. norm ((\<Sum>n. (- 1) ^ n *\<^sub>R w ^ n) - 1 + w) \<le> (norm w)\<^sup>2 / (1 - norm w)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
norm ((\<Sum>n. (- 1) ^ n *\<^sub>R w ^ n) - 1 + w) \<le> (norm w)\<^sup>2 / (1 - norm w)
[PROOF STEP]
show ?L
[PROOF STATE]
proof (prove)
using this:
norm ((\<Sum>n. (- 1) ^ n *\<^sub>R w ^ n) - 1 + w) \<le> (norm w)\<^sup>2 / (1 - norm w)

goal (1 subgoal):
 1. norm ((\<Sum>n. (- 1) ^ n *\<^sub>R w ^ n) - 1 + w) \<le> (norm w)\<^sup>2 / (1 - norm w)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
norm ((\<Sum>n. (- 1) ^ n *\<^sub>R w ^ n) - 1 + w) \<le> (norm w)\<^sup>2 / (1 - norm w)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma cat_FUNCT_is_iso_arrI'[cat_FUNCT_cs_intros]:
  assumes "\<NN> : \<FF> \<mapsto>\<^sub>C\<^sub>F\<^sub>.\<^sub>i\<^sub>s\<^sub>o \<GG> : \<AA> \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> \<BB>"
    and "\<NN>' = ntcf_arrow \<NN>"
    and "\<FF>' = cf_map \<FF>"
    and "\<GG>' = cf_map \<GG>"
  shows "\<NN>' : \<FF>' \<mapsto>\<^sub>i\<^sub>s\<^sub>o\<^bsub>cat_FUNCT \<alpha> \<AA> \<BB>\<^esub> cf_map \<GG>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<NN>' : \<FF>' \<mapsto>\<^sub>i\<^sub>s\<^sub>o\<^bsub>cat_FUNCT \<alpha> \<AA> \<BB>\<^esub> cf_map \<GG>
[PROOF STEP]
using assms(1)
[PROOF STATE]
proof (prove)
using this:
\<NN> : \<FF> \<mapsto>\<^sub>C\<^sub>F\<^sub>.\<^sub>i\<^sub>s\<^sub>o \<GG> : \<AA> \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> \<BB>

goal (1 subgoal):
 1. \<NN>' : \<FF>' \<mapsto>\<^sub>i\<^sub>s\<^sub>o\<^bsub>cat_FUNCT \<alpha> \<AA> \<BB>\<^esub> cf_map \<GG>
[PROOF STEP]
unfolding assms(2-4)
[PROOF STATE]
proof (prove)
using this:
\<NN> : \<FF> \<mapsto>\<^sub>C\<^sub>F\<^sub>.\<^sub>i\<^sub>s\<^sub>o \<GG> : \<AA> \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> \<BB>

goal (1 subgoal):
 1. ntcf_arrow \<NN> : cf_map \<FF> \<mapsto>\<^sub>i\<^sub>s\<^sub>o\<^bsub>cat_FUNCT \<alpha> \<AA> \<BB>\<^esub> cf_map \<GG>
[PROOF STEP]
by (rule cat_FUNCT_is_iso_arrI)


[STATEMENT]
lemma read_tmps_mono: "\<And>ys. set xs \<subseteq> set ys \<Longrightarrow> read_tmps xs \<subseteq> read_tmps ys"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>ys. set xs \<subseteq> set ys \<Longrightarrow> read_tmps xs \<subseteq> read_tmps ys
[PROOF STEP]
by (fastforce simp add: in_read_tmps_conv)


[STATEMENT]
lemma set_fold_insert: "set (List.fold List.insert xs1 xs2) = set xs1 \<union> set xs2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (List.fold List.insert xs1 xs2) = set xs1 \<union> set xs2
[PROOF STEP]
by(induct xs1 arbitrary: xs2) simp_all


[STATEMENT]
lemma pref_prolong:  "w \<le>p z \<cdot> r \<Longrightarrow> r \<le>p s \<Longrightarrow> w \<le>p z \<cdot> s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>w \<le>p z \<cdot> r; r \<le>p s\<rbrakk> \<Longrightarrow> w \<le>p z \<cdot> s
[PROOF STEP]
using pref_trans[OF _ pref_cancel']
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?a \<le>p ?z1 \<cdot> ?u1; ?u1 \<le>p ?v1\<rbrakk> \<Longrightarrow> ?a \<le>p ?z1 \<cdot> ?v1

goal (1 subgoal):
 1. \<lbrakk>w \<le>p z \<cdot> r; r \<le>p s\<rbrakk> \<Longrightarrow> w \<le>p z \<cdot> s
[PROOF STEP]
.


[STATEMENT]
lemma set_update_with:
  "set (update_with v k f al) =
  (set al - {k} \<times> UNIV \<union> {(k, f (case DAList.lookup al k of None \<Rightarrow> v | Some v \<Rightarrow> v))})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. AssocList.set (update_with v k f al) = AssocList.set al - {k} \<times> UNIV \<union> {(k, f (case DAList.lookup al k of None \<Rightarrow> v | Some v \<Rightarrow> v))}
[PROOF STEP]
by transfer(simp add: set_update_with_aux)


[STATEMENT]
lemma cf_hom_ArrVal_vdomain[cat_cs_simps]:
  assumes "g : a \<mapsto>\<^bsub>op_cat \<CC>\<^esub> b" and "f : a' \<mapsto>\<^bsub>\<CC>\<^esub> b'"
  shows "\<D>\<^sub>\<circ> (cf_hom \<CC> [g, f]\<^sub>\<circ>\<lparr>ArrVal\<rparr>) = Hom \<CC> a a'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<D>\<^sub>\<circ> (cf_hom \<CC> [g, f]\<^sub>\<circ>\<lparr>ArrVal\<rparr>) = Hom \<CC> a a'
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
g : a \<mapsto>\<^bsub>op_cat \<CC>\<^esub> b
f : a' \<mapsto>\<^bsub>\<CC>\<^esub> b'

goal (1 subgoal):
 1. \<D>\<^sub>\<circ> (cf_hom \<CC> [g, f]\<^sub>\<circ>\<lparr>ArrVal\<rparr>) = Hom \<CC> a a'
[PROOF STEP]
unfolding cf_hom_components
[PROOF STATE]
proof (prove)
using this:
g : a \<mapsto>\<^bsub>op_cat \<CC>\<^esub> b
f : a' \<mapsto>\<^bsub>\<CC>\<^esub> b'

goal (1 subgoal):
 1. \<D>\<^sub>\<circ> (\<lambda>q\<in>\<^sub>\<circ>Hom \<CC> (\<CC>\<lparr>Cod\<rparr>\<lparr>[g, f]\<^sub>\<circ>\<lparr>[]\<^sub>\<circ>\<rparr>\<rparr>) (\<CC>\<lparr>Dom\<rparr>\<lparr>[g, f]\<^sub>\<circ>\<lparr>1\<^sub>\<nat>\<rparr>\<rparr>). [g, f]\<^sub>\<circ>\<lparr>1\<^sub>\<nat>\<rparr> \<circ>\<^sub>A\<^bsub>\<CC>\<^esub> q \<circ>\<^sub>A\<^bsub>\<CC>\<^esub> [g, f]\<^sub>\<circ>\<lparr>[]\<^sub>\<circ>\<rparr>) = Hom \<CC> a a'
[PROOF STEP]
by (simp_all add: nat_omega_simps cat_op_simps cat_cs_simps)


[STATEMENT]
lemma size_Diff_subset_Int: "size (M - M') = size M - size (M \<inter># M')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. size (M - M') = size M - size (M \<inter># M')
[PROOF STEP]
by (metis diff_intersect_left_idem size_Diff_submset subset_mset.inf_le1)


[STATEMENT]
lemma mset_union_subset_s: "{#a#}+B \<subseteq># C \<Longrightarrow> a \<in># C \<and> B \<subseteq># C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {#a#} + B \<subseteq># C \<Longrightarrow> a \<in># C \<and> B \<subseteq># C
[PROOF STEP]
by (drule mset_union_subset) simp


[STATEMENT]
lemma pell_mul_eq_trivial_nat_iff:
  "pell_mul z1 z2 = (Suc 0, 0) \<longleftrightarrow> z1 = (Suc 0, 0) \<and> z2 = (Suc 0, 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (pell_mul z1 z2 = (Suc 0, 0)) = (z1 = (Suc 0, 0) \<and> z2 = (Suc 0, 0))
[PROOF STEP]
using D_gt_1
[PROOF STATE]
proof (prove)
using this:
1 < D

goal (1 subgoal):
 1. (pell_mul z1 z2 = (Suc 0, 0)) = (z1 = (Suc 0, 0) \<and> z2 = (Suc 0, 0))
[PROOF STEP]
by (cases z1; cases z2) (auto simp: pell_mul_def)


[STATEMENT]
lemma "primes !! 0 = 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. primes !! 0 = 2
[PROOF STEP]
unfolding primes.simps
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sieve\<cdot>[2..] !! 0 = 2
[PROOF STEP]
apply (simp only: enumFrom_intsFrom_conv)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sieve\<cdot>(intsFrom\<cdot>2) !! 0 = 2
[PROOF STEP]
apply (subst intsFrom.simps)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sieve\<cdot>(seq\<cdot>2\<cdot>(2 : intsFrom\<cdot>(2 + 1))) !! 0 = 2
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma lm013:
  assumes "a \<in> allAllocations N G" "finite G"
  shows "finite (Range a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (Range a)
[PROOF STEP]
using assms elementOfPartitionOfFiniteSetIsFinite
[PROOF STATE]
proof (prove)
using this:
a \<in> allAllocations N G
finite G
\<lbrakk>finite ?X; ?XX \<in> all_partitions ?X\<rbrakk> \<Longrightarrow> finite ?XX

goal (1 subgoal):
 1. finite (Range a)
[PROOF STEP]
by (metis allocationReverseInjective)


[STATEMENT]
lemma mult_poly_raw_simp[simp]:
  \<open>mult_poly_raw [] q = []\<close>
  \<open>mult_poly_raw (x # p) q = mult_poly_raw p q @ map (mult_monomials x) q\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. PAC_Polynomials_Operations.mult_poly_raw [] q = [] &&& PAC_Polynomials_Operations.mult_poly_raw (x # p) q = PAC_Polynomials_Operations.mult_poly_raw p q @ map (mult_monomials x) q
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. PAC_Polynomials_Operations.mult_poly_raw [] q = []
[PROOF STEP]
by (auto simp: mult_poly_raw_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. PAC_Polynomials_Operations.mult_poly_raw (x # p) q = PAC_Polynomials_Operations.mult_poly_raw p q @ map (mult_monomials x) q
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. PAC_Polynomials_Operations.mult_poly_raw (x # p) q = PAC_Polynomials_Operations.mult_poly_raw p q @ map (mult_monomials x) q
[PROOF STEP]
by (induction p) (auto simp: mult_poly_raw_def foldl_append_empty)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
theorem (in pseudo_ordered_set) well_complete_infl_imp_ex_fp:
  assumes comp: "well_complete A (\<sqsubseteq>)"
    and f: "f ` A \<subseteq> A" and infl: "\<forall>x \<in> A. \<forall>y \<in> A. x \<sqsubseteq> y \<longrightarrow> x \<sqsubseteq> f y"
  shows "\<exists>p \<in> A. f p = p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>p\<in>A. f p = p
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>p\<in>A. f p = p
[PROOF STEP]
note as = antisymmetric_axioms
[PROOF STATE]
proof (state)
this:
antisymmetric A (\<sqsubseteq>)

goal (1 subgoal):
 1. \<exists>p\<in>A. f p = p
[PROOF STEP]
interpret fixed_point_proof
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fixed_point_proof A f
[PROOF STEP]
using f
[PROOF STATE]
proof (prove)
using this:
f ` A \<subseteq> A

goal (1 subgoal):
 1. fixed_point_proof A f
[PROOF STEP]
by unfold_locales
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>p\<in>A. f p = p
[PROOF STEP]
have dinfl: "\<forall>X x y. derivation X \<longrightarrow> x \<in> X \<longrightarrow> y \<in> X \<longrightarrow> x \<sqsubseteq> y \<longrightarrow> x \<sqsubseteq> f y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>X x y. derivation X \<longrightarrow> x \<in> X \<longrightarrow> y \<in> X \<longrightarrow> x \<sqsubseteq> y \<longrightarrow> x \<sqsubseteq> f y
[PROOF STEP]
using infl
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>A. \<forall>y\<in>A. x \<sqsubseteq> y \<longrightarrow> x \<sqsubseteq> f y

goal (1 subgoal):
 1. \<forall>X x y. derivation X \<longrightarrow> x \<in> X \<longrightarrow> y \<in> X \<longrightarrow> x \<sqsubseteq> y \<longrightarrow> x \<sqsubseteq> f y
[PROOF STEP]
by (auto dest!:derivation_A)
[PROOF STATE]
proof (state)
this:
\<forall>X x y. derivation X \<longrightarrow> x \<in> X \<longrightarrow> y \<in> X \<longrightarrow> x \<sqsubseteq> y \<longrightarrow> x \<sqsubseteq> f y

goal (1 subgoal):
 1. \<exists>p\<in>A. f p = p
[PROOF STEP]
have drefl: "\<forall>X x. derivation X \<longrightarrow> x \<in> X \<longrightarrow> f x \<sqsubseteq> f x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>X x. derivation X \<longrightarrow> x \<in> X \<longrightarrow> f x \<sqsubseteq> f x
[PROOF STEP]
using f
[PROOF STATE]
proof (prove)
using this:
f ` A \<subseteq> A

goal (1 subgoal):
 1. \<forall>X x. derivation X \<longrightarrow> x \<in> X \<longrightarrow> f x \<sqsubseteq> f x
[PROOF STEP]
by (auto dest!: derivation_A)
[PROOF STATE]
proof (state)
this:
\<forall>X x. derivation X \<longrightarrow> x \<in> X \<longrightarrow> f x \<sqsubseteq> f x

goal (1 subgoal):
 1. \<exists>p\<in>A. f p = p
[PROOF STEP]
have "\<exists>p. extreme_bound A (\<sqsubseteq>) {x. derivable x} p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Ex (extreme_bound A (\<sqsubseteq>) (Collect derivable))
[PROOF STEP]
apply (rule completeD[OF comp])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. Collect derivable \<subseteq> A
 2. Collect derivable \<in> {X. well_related_set X (\<sqsubseteq>)}
[PROOF STEP]
using derivable_well_related[OF as dinfl drefl] derivable_A
[PROOF STATE]
proof (prove)
using this:
well_related_set (Collect derivable) (\<sqsubseteq>)
derivable ?x \<Longrightarrow> ?x \<in> A

goal (2 subgoals):
 1. Collect derivable \<subseteq> A
 2. Collect derivable \<in> {X. well_related_set X (\<sqsubseteq>)}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Ex (extreme_bound A (\<sqsubseteq>) (Collect derivable))

goal (1 subgoal):
 1. \<exists>p\<in>A. f p = p
[PROOF STEP]
with sup_derivable_fp[OF as dinfl drefl]
[PROOF STATE]
proof (chain)
picking this:
extreme_bound A (\<sqsubseteq>) (Collect derivable) ?p \<Longrightarrow> f ?p = ?p
Ex (extreme_bound A (\<sqsubseteq>) (Collect derivable))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
extreme_bound A (\<sqsubseteq>) (Collect derivable) ?p \<Longrightarrow> f ?p = ?p
Ex (extreme_bound A (\<sqsubseteq>) (Collect derivable))

goal (1 subgoal):
 1. \<exists>p\<in>A. f p = p
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>p\<in>A. f p = p

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma mat_cnj_cnj [simp]:
  shows "mat_cnj (mat_cnj A) = A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat_cnj (mat_cnj A) = A
[PROOF STEP]
unfolding mat_cnj_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat_map cnj (mat_map cnj A) = A
[PROOF STEP]
by (cases A) auto


[STATEMENT]
lemma prime_factorization_lcm:
  assumes [simp]: "a \<noteq> 0" "b \<noteq> 0"
  shows   "prime_factorization (lcm a b) = prime_factorization a \<union># prime_factorization b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prime_factorization (lcm a b) = prime_factorization a \<union># prime_factorization b
[PROOF STEP]
by (simp add: lcm_eq_lcm_factorial prime_factorization_lcm_factorial)


[STATEMENT]
lemma worklists_vacant_to_trans:
  "worklists_vacant_to c t \<Longrightarrow> t' \<le> t \<Longrightarrow> worklists_vacant_to c t'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>worklists_vacant_to c t; t' \<le> t\<rbrakk> \<Longrightarrow> worklists_vacant_to c t'
[PROOF STEP]
unfolding worklists_vacant_to_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>loc1 loc2 s t'. s \<in>\<^sub>A path_summary loc1 loc2 \<and> t' \<in>#\<^sub>z c_work c loc1 \<longrightarrow> \<not> results_in t' s \<le> t; t' \<le> t\<rbrakk> \<Longrightarrow> \<forall>loc1 loc2 s t'a. s \<in>\<^sub>A path_summary loc1 loc2 \<and> t'a \<in>#\<^sub>z c_work c loc1 \<longrightarrow> \<not> results_in t'a s \<le> t'
[PROOF STEP]
using order.trans
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?a \<le> ?b; ?b \<le> ?c\<rbrakk> \<Longrightarrow> ?a \<le> ?c

goal (1 subgoal):
 1. \<lbrakk>\<forall>loc1 loc2 s t'. s \<in>\<^sub>A path_summary loc1 loc2 \<and> t' \<in>#\<^sub>z c_work c loc1 \<longrightarrow> \<not> results_in t' s \<le> t; t' \<le> t\<rbrakk> \<Longrightarrow> \<forall>loc1 loc2 s t'a. s \<in>\<^sub>A path_summary loc1 loc2 \<and> t'a \<in>#\<^sub>z c_work c loc1 \<longrightarrow> \<not> results_in t'a s \<le> t'
[PROOF STEP]
by blast


[STATEMENT]
lemma image_domain_partition_eq:
  assumes "f \<in> A \<rightarrow>\<^sub>E B"
  assumes "p\<^sub>A permutes A"
  shows "(\<lambda>X. p\<^sub>A ` X) ` ((\<lambda>b. {x \<in> A. f x = b}) ` B) = (\<lambda>b. {x \<in> A. f (inv p\<^sub>A x) = b}) ` B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (`) p\<^sub>A ` (\<lambda>b. {x \<in> A. f x = b}) ` B = (\<lambda>b. {x \<in> A. f (inv p\<^sub>A x) = b}) ` B
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (`) p\<^sub>A ` (\<lambda>b. {x \<in> A. f x = b}) ` B \<subseteq> (\<lambda>b. {x \<in> A. f (inv p\<^sub>A x) = b}) ` B
 2. (\<lambda>b. {x \<in> A. f (inv p\<^sub>A x) = b}) ` B \<subseteq> (`) p\<^sub>A ` (\<lambda>b. {x \<in> A. f x = b}) ` B
[PROOF STEP]
from \<open>f \<in> A \<rightarrow>\<^sub>E B\<close>
[PROOF STATE]
proof (chain)
picking this:
f \<in> A \<rightarrow>\<^sub>E B
[PROOF STEP]
have "f \<in> A \<rightarrow> B"
[PROOF STATE]
proof (prove)
using this:
f \<in> A \<rightarrow>\<^sub>E B

goal (1 subgoal):
 1. f \<in> A \<rightarrow> B
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
f \<in> A \<rightarrow> B

goal (2 subgoals):
 1. (`) p\<^sub>A ` (\<lambda>b. {x \<in> A. f x = b}) ` B \<subseteq> (\<lambda>b. {x \<in> A. f (inv p\<^sub>A x) = b}) ` B
 2. (\<lambda>b. {x \<in> A. f (inv p\<^sub>A x) = b}) ` B \<subseteq> (`) p\<^sub>A ` (\<lambda>b. {x \<in> A. f x = b}) ` B
[PROOF STEP]
note eq = permutes_domain_partition_eq[OF \<open>f \<in> A \<rightarrow> B\<close> \<open>p\<^sub>A permutes A\<close>]
[PROOF STATE]
proof (state)
this:
?b \<in> B \<Longrightarrow> p\<^sub>A ` {x \<in> A. f x = ?b} = {x \<in> A. f (inv p\<^sub>A x) = ?b}

goal (2 subgoals):
 1. (`) p\<^sub>A ` (\<lambda>b. {x \<in> A. f x = b}) ` B \<subseteq> (\<lambda>b. {x \<in> A. f (inv p\<^sub>A x) = b}) ` B
 2. (\<lambda>b. {x \<in> A. f (inv p\<^sub>A x) = b}) ` B \<subseteq> (`) p\<^sub>A ` (\<lambda>b. {x \<in> A. f x = b}) ` B
[PROOF STEP]
show "(\<lambda>X. p\<^sub>A ` X) ` (\<lambda>b. {x \<in> A. f x = b}) ` B \<subseteq> (\<lambda>b. {x \<in> A. f (inv p\<^sub>A x) = b}) ` B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (`) p\<^sub>A ` (\<lambda>b. {x \<in> A. f x = b}) ` B \<subseteq> (\<lambda>b. {x \<in> A. f (inv p\<^sub>A x) = b}) ` B
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> (`) p\<^sub>A ` (\<lambda>b. {x \<in> A. f x = b}) ` B \<Longrightarrow> x \<in> (\<lambda>b. {x \<in> A. f (inv p\<^sub>A x) = b}) ` B
[PROOF STEP]
fix X
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> (`) p\<^sub>A ` (\<lambda>b. {x \<in> A. f x = b}) ` B \<Longrightarrow> x \<in> (\<lambda>b. {x \<in> A. f (inv p\<^sub>A x) = b}) ` B
[PROOF STEP]
assume "X \<in> (\<lambda>X. p\<^sub>A ` X) ` (\<lambda>b. {x \<in> A. f x = b}) ` B"
[PROOF STATE]
proof (state)
this:
X \<in> (`) p\<^sub>A ` (\<lambda>b. {x \<in> A. f x = b}) ` B

goal (1 subgoal):
 1. \<And>x. x \<in> (`) p\<^sub>A ` (\<lambda>b. {x \<in> A. f x = b}) ` B \<Longrightarrow> x \<in> (\<lambda>b. {x \<in> A. f (inv p\<^sub>A x) = b}) ` B
[PROOF STEP]
from this
[PROOF STATE]
proof (chain)
picking this:
X \<in> (`) p\<^sub>A ` (\<lambda>b. {x \<in> A. f x = b}) ` B
[PROOF STEP]
obtain b where "b \<in> B" and X_eq: "X = p\<^sub>A ` {x \<in> A. f x = b}"
[PROOF STATE]
proof (prove)
using this:
X \<in> (`) p\<^sub>A ` (\<lambda>b. {x \<in> A. f x = b}) ` B

goal (1 subgoal):
 1. (\<And>b. \<lbrakk>b \<in> B; X = p\<^sub>A ` {x \<in> A. f x = b}\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
b \<in> B
X = p\<^sub>A ` {x \<in> A. f x = b}

goal (1 subgoal):
 1. \<And>x. x \<in> (`) p\<^sub>A ` (\<lambda>b. {x \<in> A. f x = b}) ` B \<Longrightarrow> x \<in> (\<lambda>b. {x \<in> A. f (inv p\<^sub>A x) = b}) ` B
[PROOF STEP]
from this eq
[PROOF STATE]
proof (chain)
picking this:
b \<in> B
X = p\<^sub>A ` {x \<in> A. f x = b}
?b \<in> B \<Longrightarrow> p\<^sub>A ` {x \<in> A. f x = ?b} = {x \<in> A. f (inv p\<^sub>A x) = ?b}
[PROOF STEP]
have "X = {x \<in> A. f (inv p\<^sub>A x) = b}"
[PROOF STATE]
proof (prove)
using this:
b \<in> B
X = p\<^sub>A ` {x \<in> A. f x = b}
?b \<in> B \<Longrightarrow> p\<^sub>A ` {x \<in> A. f x = ?b} = {x \<in> A. f (inv p\<^sub>A x) = ?b}

goal (1 subgoal):
 1. X = {x \<in> A. f (inv p\<^sub>A x) = b}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
X = {x \<in> A. f (inv p\<^sub>A x) = b}

goal (1 subgoal):
 1. \<And>x. x \<in> (`) p\<^sub>A ` (\<lambda>b. {x \<in> A. f x = b}) ` B \<Longrightarrow> x \<in> (\<lambda>b. {x \<in> A. f (inv p\<^sub>A x) = b}) ` B
[PROOF STEP]
from this \<open>b \<in> B\<close>
[PROOF STATE]
proof (chain)
picking this:
X = {x \<in> A. f (inv p\<^sub>A x) = b}
b \<in> B
[PROOF STEP]
show "X \<in> (\<lambda>b. {x \<in> A. f (inv p\<^sub>A x) = b}) ` B"
[PROOF STATE]
proof (prove)
using this:
X = {x \<in> A. f (inv p\<^sub>A x) = b}
b \<in> B

goal (1 subgoal):
 1. X \<in> (\<lambda>b. {x \<in> A. f (inv p\<^sub>A x) = b}) ` B
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
X \<in> (\<lambda>b. {x \<in> A. f (inv p\<^sub>A x) = b}) ` B

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(`) p\<^sub>A ` (\<lambda>b. {x \<in> A. f x = b}) ` B \<subseteq> (\<lambda>b. {x \<in> A. f (inv p\<^sub>A x) = b}) ` B

goal (1 subgoal):
 1. (\<lambda>b. {x \<in> A. f (inv p\<^sub>A x) = b}) ` B \<subseteq> (`) p\<^sub>A ` (\<lambda>b. {x \<in> A. f x = b}) ` B
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<lambda>b. {x \<in> A. f (inv p\<^sub>A x) = b}) ` B \<subseteq> (`) p\<^sub>A ` (\<lambda>b. {x \<in> A. f x = b}) ` B
[PROOF STEP]
from \<open>f \<in> A \<rightarrow>\<^sub>E B\<close>
[PROOF STATE]
proof (chain)
picking this:
f \<in> A \<rightarrow>\<^sub>E B
[PROOF STEP]
have "f \<in> A \<rightarrow> B"
[PROOF STATE]
proof (prove)
using this:
f \<in> A \<rightarrow>\<^sub>E B

goal (1 subgoal):
 1. f \<in> A \<rightarrow> B
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
f \<in> A \<rightarrow> B

goal (1 subgoal):
 1. (\<lambda>b. {x \<in> A. f (inv p\<^sub>A x) = b}) ` B \<subseteq> (`) p\<^sub>A ` (\<lambda>b. {x \<in> A. f x = b}) ` B
[PROOF STEP]
note eq = permutes_domain_partition_eq[OF \<open>f \<in> A \<rightarrow> B\<close> \<open>p\<^sub>A permutes A\<close>, symmetric]
[PROOF STATE]
proof (state)
this:
?b \<in> B \<Longrightarrow> {x \<in> A. f (inv p\<^sub>A x) = ?b} = p\<^sub>A ` {x \<in> A. f x = ?b}

goal (1 subgoal):
 1. (\<lambda>b. {x \<in> A. f (inv p\<^sub>A x) = b}) ` B \<subseteq> (`) p\<^sub>A ` (\<lambda>b. {x \<in> A. f x = b}) ` B
[PROOF STEP]
show "(\<lambda>b. {x \<in> A. f (inv p\<^sub>A x) = b}) ` B \<subseteq> (\<lambda>X. p\<^sub>A ` X) ` (\<lambda>b. {x \<in> A. f x = b}) ` B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>b. {x \<in> A. f (inv p\<^sub>A x) = b}) ` B \<subseteq> (`) p\<^sub>A ` (\<lambda>b. {x \<in> A. f x = b}) ` B
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> (\<lambda>b. {x \<in> A. f (inv p\<^sub>A x) = b}) ` B \<Longrightarrow> x \<in> (`) p\<^sub>A ` (\<lambda>b. {x \<in> A. f x = b}) ` B
[PROOF STEP]
fix X
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> (\<lambda>b. {x \<in> A. f (inv p\<^sub>A x) = b}) ` B \<Longrightarrow> x \<in> (`) p\<^sub>A ` (\<lambda>b. {x \<in> A. f x = b}) ` B
[PROOF STEP]
assume "X \<in> (\<lambda>b. {x \<in> A. f (inv p\<^sub>A x) = b}) ` B"
[PROOF STATE]
proof (state)
this:
X \<in> (\<lambda>b. {x \<in> A. f (inv p\<^sub>A x) = b}) ` B

goal (1 subgoal):
 1. \<And>x. x \<in> (\<lambda>b. {x \<in> A. f (inv p\<^sub>A x) = b}) ` B \<Longrightarrow> x \<in> (`) p\<^sub>A ` (\<lambda>b. {x \<in> A. f x = b}) ` B
[PROOF STEP]
from this
[PROOF STATE]
proof (chain)
picking this:
X \<in> (\<lambda>b. {x \<in> A. f (inv p\<^sub>A x) = b}) ` B
[PROOF STEP]
obtain b where "b \<in> B" and X_eq: "X = {x \<in> A. f (inv p\<^sub>A x) = b}"
[PROOF STATE]
proof (prove)
using this:
X \<in> (\<lambda>b. {x \<in> A. f (inv p\<^sub>A x) = b}) ` B

goal (1 subgoal):
 1. (\<And>b. \<lbrakk>b \<in> B; X = {x \<in> A. f (inv p\<^sub>A x) = b}\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
b \<in> B
X = {x \<in> A. f (inv p\<^sub>A x) = b}

goal (1 subgoal):
 1. \<And>x. x \<in> (\<lambda>b. {x \<in> A. f (inv p\<^sub>A x) = b}) ` B \<Longrightarrow> x \<in> (`) p\<^sub>A ` (\<lambda>b. {x \<in> A. f x = b}) ` B
[PROOF STEP]
from this eq
[PROOF STATE]
proof (chain)
picking this:
b \<in> B
X = {x \<in> A. f (inv p\<^sub>A x) = b}
?b \<in> B \<Longrightarrow> {x \<in> A. f (inv p\<^sub>A x) = ?b} = p\<^sub>A ` {x \<in> A. f x = ?b}
[PROOF STEP]
have "X = p\<^sub>A ` {x \<in> A. f x = b}"
[PROOF STATE]
proof (prove)
using this:
b \<in> B
X = {x \<in> A. f (inv p\<^sub>A x) = b}
?b \<in> B \<Longrightarrow> {x \<in> A. f (inv p\<^sub>A x) = ?b} = p\<^sub>A ` {x \<in> A. f x = ?b}

goal (1 subgoal):
 1. X = p\<^sub>A ` {x \<in> A. f x = b}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
X = p\<^sub>A ` {x \<in> A. f x = b}

goal (1 subgoal):
 1. \<And>x. x \<in> (\<lambda>b. {x \<in> A. f (inv p\<^sub>A x) = b}) ` B \<Longrightarrow> x \<in> (`) p\<^sub>A ` (\<lambda>b. {x \<in> A. f x = b}) ` B
[PROOF STEP]
from this \<open>b \<in> B\<close>
[PROOF STATE]
proof (chain)
picking this:
X = p\<^sub>A ` {x \<in> A. f x = b}
b \<in> B
[PROOF STEP]
show "X \<in> (\<lambda>X. p\<^sub>A ` X) ` (\<lambda>b. {x \<in> A. f x = b}) ` B"
[PROOF STATE]
proof (prove)
using this:
X = p\<^sub>A ` {x \<in> A. f x = b}
b \<in> B

goal (1 subgoal):
 1. X \<in> (`) p\<^sub>A ` (\<lambda>b. {x \<in> A. f x = b}) ` B
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
X \<in> (`) p\<^sub>A ` (\<lambda>b. {x \<in> A. f x = b}) ` B

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<lambda>b. {x \<in> A. f (inv p\<^sub>A x) = b}) ` B \<subseteq> (`) p\<^sub>A ` (\<lambda>b. {x \<in> A. f x = b}) ` B

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma fps_shift_code [code]: "fps_shift n (fps_of_ratfps x) = fps_of_ratfps (ratfps_shift n x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fps_shift n (fps_of_ratfps x) = fps_of_ratfps (ratfps_shift n x)
[PROOF STEP]
by simp


[STATEMENT]
lemma mod_ring_normalize[transfer_rule]: "(mod_ring_rel ===> mod_ring_rel) ((\<lambda> x. if x = 0 then 0 else 1)) normalize"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (mod_ring_rel ===> mod_ring_rel) (\<lambda>x. if x = 0 then 0 else 1) normalize
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (mod_ring_rel ===> mod_ring_rel) (\<lambda>x. if x = 0 then 0 else 1) normalize
[PROOF STEP]
{
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (mod_ring_rel ===> mod_ring_rel) (\<lambda>x. if x = 0 then 0 else 1) normalize
[PROOF STEP]
fix x :: "'a mod_ring"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (mod_ring_rel ===> mod_ring_rel) (\<lambda>x. if x = 0 then 0 else 1) normalize
[PROOF STEP]
have "(if to_int_mod_ring x = 0 then 0 else 1) = to_int_mod_ring (normalize x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if to_int_mod_ring x = 0 then 0 else 1) = to_int_mod_ring (normalize x)
[PROOF STEP]
unfolding normalize_mod_ring_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if to_int_mod_ring x = 0 then 0 else 1) = to_int_mod_ring (if x = 0 then 0 else 1)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(if to_int_mod_ring x = 0 then 0 else 1) = to_int_mod_ring (normalize x)

goal (1 subgoal):
 1. (mod_ring_rel ===> mod_ring_rel) (\<lambda>x. if x = 0 then 0 else 1) normalize
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
(if to_int_mod_ring ?x2 = 0 then 0 else 1) = to_int_mod_ring (normalize ?x2)

goal (1 subgoal):
 1. (mod_ring_rel ===> mod_ring_rel) (\<lambda>x. if x = 0 then 0 else 1) normalize
[PROOF STEP]
note * = this
[PROOF STATE]
proof (state)
this:
(if to_int_mod_ring ?x2 = 0 then 0 else 1) = to_int_mod_ring (normalize ?x2)

goal (1 subgoal):
 1. (mod_ring_rel ===> mod_ring_rel) (\<lambda>x. if x = 0 then 0 else 1) normalize
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (mod_ring_rel ===> mod_ring_rel) (\<lambda>x. if x = 0 then 0 else 1) normalize
[PROOF STEP]
by (intro rel_funI, auto simp: mod_ring_rel_def *[symmetric])
[PROOF STATE]
proof (state)
this:
(mod_ring_rel ===> mod_ring_rel) (\<lambda>x. if x = 0 then 0 else 1) normalize

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ldistinct_ltake: "ldistinct xs \<Longrightarrow> ldistinct (ltake n xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ldistinct xs \<Longrightarrow> ldistinct (ltake n xs)
[PROOF STEP]
by (metis ldistinct_lprefix ltake_is_lprefix)


[STATEMENT]
lemma tendsto_Complex [tendsto_intros]:
  "(f \<longlongrightarrow> a) F \<Longrightarrow> (g \<longlongrightarrow> b) F \<Longrightarrow> ((\<lambda>x. Complex (f x) (g x)) \<longlongrightarrow> Complex a b) F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(f \<longlongrightarrow> a) F; (g \<longlongrightarrow> b) F\<rbrakk> \<Longrightarrow> ((\<lambda>x. Complex (f x) (g x)) \<longlongrightarrow> Complex a b) F
[PROOF STEP]
unfolding Complex_eq
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(f \<longlongrightarrow> a) F; (g \<longlongrightarrow> b) F\<rbrakk> \<Longrightarrow> ((\<lambda>x. complex_of_real (f x) + \<i> * complex_of_real (g x)) \<longlongrightarrow> complex_of_real a + \<i> * complex_of_real b) F
[PROOF STEP]
by (auto intro!: tendsto_intros)


[STATEMENT]
lemma BI_BC_rel: "(\<B>\<^sub>I \<phi>) = \<B>\<^sub>C(\<phi>\<^sup>d)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<B>\<^sub>I \<phi> = \<B>\<^sub>C \<phi>\<^sup>d
[PROOF STEP]
by (simp add: Br_cl_def Br_int_def dual_def conn)


[STATEMENT]
lemma Always_eq_invariant_reachable:
     "Always A = {F. F \<in> invariant (reachable F \<inter> A)}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Always A = {F. F \<in> invariant (reachable F \<inter> A)}
[PROOF STEP]
apply (simp add: Always_def invariant_def Stable_def Constrains_eq_constrains
                 stable_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {F. Init F \<subseteq> A} \<inter> {F. F \<in> reachable F \<inter> A co reachable F \<inter> A} = {F. Init F \<subseteq> reachable F \<and> Init F \<subseteq> A \<and> F \<in> reachable F \<inter> A co reachable F \<inter> A}
[PROOF STEP]
apply (blast intro: reachable.intros)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma rbt_less_param[param]: "(ord.rbt_less,ord.rbt_less) \<in>
  (Rk\<rightarrow>Rk\<rightarrow>Id) \<rightarrow> Rk \<rightarrow> \<langle>Rk,Rv\<rangle>rbt_rel \<rightarrow> Id"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (ord.rbt_less, ord.rbt_less) \<in> (Rk \<rightarrow> Rk \<rightarrow> bool_rel) \<rightarrow> Rk \<rightarrow> \<langle>Rk, Rv\<rangle>rbt_rel \<rightarrow> bool_rel
[PROOF STEP]
unfolding ord.rbt_less_prop[abs_def]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>less k t. \<forall>x\<in>set (RBT_Impl.keys t). less x k, \<lambda>less k t. \<forall>x\<in>set (RBT_Impl.keys t). less x k) \<in> (Rk \<rightarrow> Rk \<rightarrow> bool_rel) \<rightarrow> Rk \<rightarrow> \<langle>Rk, Rv\<rangle>rbt_rel \<rightarrow> bool_rel
[PROOF STEP]
apply (parametricity add: param_list_ball)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a a' aa a'a ab a'b. \<lbrakk>(a, a') \<in> Rk \<rightarrow> Rk \<rightarrow> bool_rel; (aa, a'a) \<in> Rk; (ab, a'b) \<in> \<langle>Rk, Rv\<rangle>rbt_rel\<rbrakk> \<Longrightarrow> (RBT_Impl.keys ab, RBT_Impl.keys a'b) \<in> \<langle>Rk\<rangle>list_rel
[PROOF STEP]
unfolding RBT_Impl.keys_def RBT_Impl.entries_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a a' aa a'a ab a'b. \<lbrakk>(a, a') \<in> Rk \<rightarrow> Rk \<rightarrow> bool_rel; (aa, a'a) \<in> Rk; (ab, a'b) \<in> \<langle>Rk, Rv\<rangle>rbt_rel\<rbrakk> \<Longrightarrow> (map fst (rec_rbt [] (\<lambda>_ l k v r la ra. la @ (k, v) # ra) ab), map fst (rec_rbt [] (\<lambda>_ l k v r la ra. la @ (k, v) # ra) a'b)) \<in> \<langle>Rk\<rangle>list_rel
[PROOF STEP]
apply (parametricity)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma hcomplex_hcnj_hcnj [simp]: "\<And>z. hcnj (hcnj z) = z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>z. hcnj (hcnj z) = z
[PROOF STEP]
by transfer (rule complex_cnj_cnj)


[STATEMENT]
lemma sin_differentiable_at: "(\<lambda>x. sin (f x::real)) differentiable at x within X"
  if "f differentiable at x within X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. sin (f x)) differentiable at x within X
[PROOF STEP]
using differentiable_def has_derivative_sin that
[PROOF STATE]
proof (prove)
using this:
(?f differentiable ?F) = (\<exists>D. (?f has_derivative D) ?F)
(?g has_derivative ?g') (at ?x within ?s) \<Longrightarrow> ((\<lambda>x. sin (?g x)) has_derivative (\<lambda>x. ?g' x * cos (?g ?x))) (at ?x within ?s)
f differentiable at x within X

goal (1 subgoal):
 1. (\<lambda>x. sin (f x)) differentiable at x within X
[PROOF STEP]
by blast


[STATEMENT]
lemma eSuc_SUP: "A \<noteq> {} \<Longrightarrow> eSuc (\<Squnion> (f ` A)) = (\<Squnion>x\<in>A. eSuc (f x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<noteq> {} \<Longrightarrow> eSuc (\<Squnion> (f ` A)) = (\<Squnion>x\<in>A. eSuc (f x))
[PROOF STEP]
by (subst eSuc_Sup) (simp_all add: image_comp)


[STATEMENT]
lemma "[Suc 0, 0] = [Suc 0, 0]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [Suc 0, 0] = [Suc 0, 0]
[PROOF STEP]
by normalization


[STATEMENT]
lemma (in group_action) id_eq_one: "(\<lambda>x \<in> E. x) = \<phi> \<one>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x\<in>E. x) = \<phi> \<one>
[PROOF STEP]
by (metis BijGroup_def group_hom group_hom.hom_one select_convs(2))


[STATEMENT]
lemma simplicial_simplex:
  "simplicial_simplex p S f \<longleftrightarrow> f ` (standard_simplex p) \<subseteq> S \<and> (\<exists>l. f = oriented_simplex p l)"
  (is "?lhs = ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. simplicial_simplex p S f = (f ` standard_simplex p \<subseteq> S \<and> (\<exists>l. f = oriented_simplex p l))
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. simplicial_simplex p S f \<Longrightarrow> f ` standard_simplex p \<subseteq> S \<and> (\<exists>l. f = oriented_simplex p l)
 2. f ` standard_simplex p \<subseteq> S \<and> (\<exists>l. f = oriented_simplex p l) \<Longrightarrow> simplicial_simplex p S f
[PROOF STEP]
assume R: ?rhs
[PROOF STATE]
proof (state)
this:
f ` standard_simplex p \<subseteq> S \<and> (\<exists>l. f = oriented_simplex p l)

goal (2 subgoals):
 1. simplicial_simplex p S f \<Longrightarrow> f ` standard_simplex p \<subseteq> S \<and> (\<exists>l. f = oriented_simplex p l)
 2. f ` standard_simplex p \<subseteq> S \<and> (\<exists>l. f = oriented_simplex p l) \<Longrightarrow> simplicial_simplex p S f
[PROOF STEP]
have "continuous_map (subtopology (powertop_real UNIV) (standard_simplex p))
                (powertop_real UNIV) (\<lambda>x i. \<Sum>j\<le>p. l j i * x j)" for l :: " nat \<Rightarrow> 'a \<Rightarrow> real"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_map (subtopology (powertop_real UNIV) (standard_simplex p)) (powertop_real UNIV) (\<lambda>x i. \<Sum>j\<le>p. l j i * x j)
[PROOF STEP]
unfolding continuous_map_componentwise
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x i. \<Sum>j\<le>p. l j i * x j) ` topspace (subtopology (powertop_real UNIV) (standard_simplex p)) \<subseteq> extensional UNIV \<and> (\<forall>k\<in>UNIV. continuous_map (subtopology (powertop_real UNIV) (standard_simplex p)) euclideanreal (\<lambda>x. \<Sum>j\<le>p. l j k * x j))
[PROOF STEP]
by (force intro: continuous_intros continuous_map_from_subtopology continuous_map_product_projection)
[PROOF STATE]
proof (state)
this:
continuous_map (subtopology (powertop_real UNIV) (standard_simplex p)) (powertop_real UNIV) (\<lambda>x i. \<Sum>j\<le>p. ?l j i * x j)

goal (2 subgoals):
 1. simplicial_simplex p S f \<Longrightarrow> f ` standard_simplex p \<subseteq> S \<and> (\<exists>l. f = oriented_simplex p l)
 2. f ` standard_simplex p \<subseteq> S \<and> (\<exists>l. f = oriented_simplex p l) \<Longrightarrow> simplicial_simplex p S f
[PROOF STEP]
with R
[PROOF STATE]
proof (chain)
picking this:
f ` standard_simplex p \<subseteq> S \<and> (\<exists>l. f = oriented_simplex p l)
continuous_map (subtopology (powertop_real UNIV) (standard_simplex p)) (powertop_real UNIV) (\<lambda>x i. \<Sum>j\<le>p. ?l j i * x j)
[PROOF STEP]
show ?lhs
[PROOF STATE]
proof (prove)
using this:
f ` standard_simplex p \<subseteq> S \<and> (\<exists>l. f = oriented_simplex p l)
continuous_map (subtopology (powertop_real UNIV) (standard_simplex p)) (powertop_real UNIV) (\<lambda>x i. \<Sum>j\<le>p. ?l j i * x j)

goal (1 subgoal):
 1. simplicial_simplex p S f
[PROOF STEP]
unfolding simplicial_simplex_def singular_simplex_subtopology
[PROOF STATE]
proof (prove)
using this:
f ` standard_simplex p \<subseteq> S \<and> (\<exists>l. f = oriented_simplex p l)
continuous_map (subtopology (powertop_real UNIV) (standard_simplex p)) (powertop_real UNIV) (\<lambda>x i. \<Sum>j\<le>p. ?l j i * x j)

goal (1 subgoal):
 1. (singular_simplex p (powertop_real UNIV) f \<and> f ` standard_simplex p \<subseteq> S) \<and> (\<exists>l. f = oriented_simplex p l)
[PROOF STEP]
by (auto simp add: singular_simplex_def oriented_simplex_def)
[PROOF STATE]
proof (state)
this:
simplicial_simplex p S f

goal (1 subgoal):
 1. simplicial_simplex p S f \<Longrightarrow> f ` standard_simplex p \<subseteq> S \<and> (\<exists>l. f = oriented_simplex p l)
[PROOF STEP]
qed (simp add: simplicial_simplex_def singular_simplex_subtopology)


[STATEMENT]
lemma pref_same_len: "u \<le>p v \<Longrightarrow> \<^bold>|u\<^bold>| = \<^bold>|v\<^bold>| \<Longrightarrow> u = v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>u \<le>p v; \<^bold>|u\<^bold>| = \<^bold>|v\<^bold>|\<rbrakk> \<Longrightarrow> u = v
[PROOF STEP]
by (fastforce simp add: prefix_def)


[STATEMENT]
lemma cindex_poly_ubd_0:
  assumes "p=0 \<or> q=0"
  shows "cindex_poly_ubd q p = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cindex_poly_ubd q p = 0
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. cindex_poly_ubd q p = 0
[PROOF STEP]
have "\<forall>\<^sub>F r in at_top. cindexE (-r) r (\<lambda>x. poly q x/poly p x) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F r in at_top. cindexE (- r) r (\<lambda>x. poly q x / poly p x) = 0
[PROOF STEP]
apply (rule eventuallyI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. cindexE (- x) x (\<lambda>x. poly q x / poly p x) = 0
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
p = 0 \<or> q = 0

goal (1 subgoal):
 1. \<And>x. cindexE (- x) x (\<lambda>x. poly q x / poly p x) = 0
[PROOF STEP]
by (auto intro:cindexE_constI)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F r in at_top. cindexE (- r) r (\<lambda>x. poly q x / poly p x) = 0

goal (1 subgoal):
 1. cindex_poly_ubd q p = 0
[PROOF STEP]
from eventually_conj[OF this cindex_poly_ubd_eventually[of q p]]
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F x in at_top. cindexE (- x) x (\<lambda>x. poly q x / poly p x) = 0 \<and> cindexE (- x) x (\<lambda>x. poly q x / poly p x) = real_of_int (cindex_poly_ubd q p)
[PROOF STEP]
have "\<forall>\<^sub>F r::real in at_top.  (cindex_poly_ubd q p) = (0::int)"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in at_top. cindexE (- x) x (\<lambda>x. poly q x / poly p x) = 0 \<and> cindexE (- x) x (\<lambda>x. poly q x / poly p x) = real_of_int (cindex_poly_ubd q p)

goal (1 subgoal):
 1. \<forall>\<^sub>F r in at_top. cindex_poly_ubd q p = 0
[PROOF STEP]
apply (elim eventually_mono)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. cindexE (- x) x (\<lambda>x. poly q x / poly p x) = 0 \<and> cindexE (- x) x (\<lambda>x. poly q x / poly p x) = real_of_int (cindex_poly_ubd q p) \<Longrightarrow> cindex_poly_ubd q p = 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F r in at_top. cindex_poly_ubd q p = 0

goal (1 subgoal):
 1. cindex_poly_ubd q p = 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F r in at_top. cindex_poly_ubd q p = 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F r in at_top. cindex_poly_ubd q p = 0

goal (1 subgoal):
 1. cindex_poly_ubd q p = 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
cindex_poly_ubd q p = 0

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma r_ifless [simp]: "eval r_ifless [a, b, v\<^sub>0, v\<^sub>1] \<down>= (if a < b then v\<^sub>0 else v\<^sub>1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eval r_ifless [a, b, v\<^sub>0, v\<^sub>1] \<down>= (if a < b then v\<^sub>0 else v\<^sub>1)
[PROOF STEP]
unfolding r_ifless_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eval (Cn 4 r_ifle [recf.Id 4 1, recf.Id 4 0, recf.Id 4 3, recf.Id 4 2]) [a, b, v\<^sub>0, v\<^sub>1] \<down>= (if a < b then v\<^sub>0 else v\<^sub>1)
[PROOF STEP]
by simp


[STATEMENT]
lemma eval_monom_uminus: "eval_monom (-c, es) basis x = -eval_monom (c, es) basis x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eval_monom (- c, es) basis x = - eval_monom (c, es) basis x
[PROOF STEP]
by (simp add: eval_monom_def)


[STATEMENT]
lemma of_char_of [simp]:
  \<open>of_char (char_of a) = a mod 256\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. of_char (char_of a) = a mod (256::'a)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. of_char (char_of a) = a mod (256::'a)
[PROOF STEP]
have \<open>[0..<8] = [0, Suc 0, 2, 3, 4, 5, 6, 7 :: nat]\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [0..<8] = [0, Suc 0, 2, 3, 4, 5, 6, 7]
[PROOF STEP]
by (simp add: upt_eq_Cons_conv)
[PROOF STATE]
proof (state)
this:
[0..<8] = [0, Suc 0, 2, 3, 4, 5, 6, 7]

goal (1 subgoal):
 1. of_char (char_of a) = a mod (256::'a)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
[0..<8] = [0, Suc 0, 2, 3, 4, 5, 6, 7]
[PROOF STEP]
have \<open>[bit a 0, bit a 1, bit a 2, bit a 3, bit a 4, bit a 5, bit a 6, bit a 7] = map (bit a) [0..<8]\<close>
[PROOF STATE]
proof (prove)
using this:
[0..<8] = [0, Suc 0, 2, 3, 4, 5, 6, 7]

goal (1 subgoal):
 1. [bit a 0, bit a 1, bit a 2, bit a 3, bit a 4, bit a 5, bit a 6, bit a 7] = map (bit a) [0..<8]
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
[bit a 0, bit a 1, bit a 2, bit a 3, bit a 4, bit a 5, bit a 6, bit a 7] = map (bit a) [0..<8]

goal (1 subgoal):
 1. of_char (char_of a) = a mod (256::'a)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
[bit a 0, bit a 1, bit a 2, bit a 3, bit a 4, bit a 5, bit a 6, bit a 7] = map (bit a) [0..<8]
[PROOF STEP]
have \<open>of_char (char_of a) = take_bit 8 a\<close>
[PROOF STATE]
proof (prove)
using this:
[bit a 0, bit a 1, bit a 2, bit a 3, bit a 4, bit a 5, bit a 6, bit a 7] = map (bit a) [0..<8]

goal (1 subgoal):
 1. of_char (char_of a) = take_bit 8 a
[PROOF STEP]
by (simp only: char_of_def of_char_def char.sel horner_sum_bit_eq_take_bit)
[PROOF STATE]
proof (state)
this:
of_char (char_of a) = take_bit 8 a

goal (1 subgoal):
 1. of_char (char_of a) = a mod (256::'a)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
of_char (char_of a) = take_bit 8 a
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
of_char (char_of a) = take_bit 8 a

goal (1 subgoal):
 1. of_char (char_of a) = a mod (256::'a)
[PROOF STEP]
by (simp add: take_bit_eq_mod)
[PROOF STATE]
proof (state)
this:
of_char (char_of a) = a mod (256::'a)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma connected_with_inside:
    fixes S :: "'a :: real_normed_vector set"
    assumes S: "closed S" and cons: "connected S"
      shows "connected(S \<union> inside S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. connected (S \<union> inside S)
[PROOF STEP]
proof (cases "S \<union> inside S = UNIV")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. S \<union> inside S = UNIV \<Longrightarrow> connected (S \<union> inside S)
 2. S \<union> inside S \<noteq> UNIV \<Longrightarrow> connected (S \<union> inside S)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
S \<union> inside S = UNIV

goal (2 subgoals):
 1. S \<union> inside S = UNIV \<Longrightarrow> connected (S \<union> inside S)
 2. S \<union> inside S \<noteq> UNIV \<Longrightarrow> connected (S \<union> inside S)
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
closed S
connected S
S \<union> inside S = UNIV
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
closed S
connected S
S \<union> inside S = UNIV

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

goal (1 subgoal):
 1. S \<union> inside S \<noteq> UNIV \<Longrightarrow> connected (S \<union> inside S)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. S \<union> inside S \<noteq> UNIV \<Longrightarrow> connected (S \<union> inside S)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
S \<union> inside S \<noteq> UNIV

goal (1 subgoal):
 1. S \<union> inside S \<noteq> UNIV \<Longrightarrow> connected (S \<union> inside S)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
S \<union> inside S \<noteq> UNIV
[PROOF STEP]
obtain b where b: "b \<notin> S" "b \<notin> inside S"
[PROOF STATE]
proof (prove)
using this:
S \<union> inside S \<noteq> UNIV

goal (1 subgoal):
 1. (\<And>b. \<lbrakk>b \<notin> S; b \<notin> inside S\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
b \<notin> S
b \<notin> inside S

goal (1 subgoal):
 1. S \<union> inside S \<noteq> UNIV \<Longrightarrow> connected (S \<union> inside S)
[PROOF STEP]
have *: "\<exists>y T. y \<in> S \<and> connected T \<and> a \<in> T \<and> y \<in> T \<and> T \<subseteq> (S \<union> inside S)"
    if "a \<in> S \<union> inside S" for a
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>y T. y \<in> S \<and> connected T \<and> a \<in> T \<and> y \<in> T \<and> T \<subseteq> S \<union> inside S
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
a \<in> S \<union> inside S

goal (1 subgoal):
 1. \<exists>y T. y \<in> S \<and> connected T \<and> a \<in> T \<and> y \<in> T \<and> T \<subseteq> S \<union> inside S
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. a \<in> S \<Longrightarrow> \<exists>y T. y \<in> S \<and> connected T \<and> a \<in> T \<and> y \<in> T \<and> T \<subseteq> S \<union> inside S
 2. a \<in> inside S \<Longrightarrow> \<exists>y T. y \<in> S \<and> connected T \<and> a \<in> T \<and> y \<in> T \<and> T \<subseteq> S \<union> inside S
[PROOF STEP]
assume "a \<in> S"
[PROOF STATE]
proof (state)
this:
a \<in> S

goal (2 subgoals):
 1. a \<in> S \<Longrightarrow> \<exists>y T. y \<in> S \<and> connected T \<and> a \<in> T \<and> y \<in> T \<and> T \<subseteq> S \<union> inside S
 2. a \<in> inside S \<Longrightarrow> \<exists>y T. y \<in> S \<and> connected T \<and> a \<in> T \<and> y \<in> T \<and> T \<subseteq> S \<union> inside S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a \<in> S
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
a \<in> S

goal (1 subgoal):
 1. \<exists>y T. y \<in> S \<and> connected T \<and> a \<in> T \<and> y \<in> T \<and> T \<subseteq> S \<union> inside S
[PROOF STEP]
by (rule_tac x=a in exI, rule_tac x="{a}" in exI, simp)
[PROOF STATE]
proof (state)
this:
\<exists>y T. y \<in> S \<and> connected T \<and> a \<in> T \<and> y \<in> T \<and> T \<subseteq> S \<union> inside S

goal (1 subgoal):
 1. a \<in> inside S \<Longrightarrow> \<exists>y T. y \<in> S \<and> connected T \<and> a \<in> T \<and> y \<in> T \<and> T \<subseteq> S \<union> inside S
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. a \<in> inside S \<Longrightarrow> \<exists>y T. y \<in> S \<and> connected T \<and> a \<in> T \<and> y \<in> T \<and> T \<subseteq> S \<union> inside S
[PROOF STEP]
assume a: "a \<in> inside S"
[PROOF STATE]
proof (state)
this:
a \<in> inside S

goal (1 subgoal):
 1. a \<in> inside S \<Longrightarrow> \<exists>y T. y \<in> S \<and> connected T \<and> a \<in> T \<and> y \<in> T \<and> T \<subseteq> S \<union> inside S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a \<in> inside S
[PROOF STEP]
have ain: "a \<in> closure (inside S)"
[PROOF STATE]
proof (prove)
using this:
a \<in> inside S

goal (1 subgoal):
 1. a \<in> closure (inside S)
[PROOF STEP]
by (simp add: closure_def)
[PROOF STATE]
proof (state)
this:
a \<in> closure (inside S)

goal (1 subgoal):
 1. a \<in> inside S \<Longrightarrow> \<exists>y T. y \<in> S \<and> connected T \<and> a \<in> T \<and> y \<in> T \<and> T \<subseteq> S \<union> inside S
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>y T. y \<in> S \<and> connected T \<and> a \<in> T \<and> y \<in> T \<and> T \<subseteq> S \<union> inside S
[PROOF STEP]
apply (rule exists_path_subpath_to_frontier [OF path_linepath [of a b], of "inside S"])
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. pathstart (linepath a b) \<in> closure (inside S)
 2. pathfinish (linepath a b) \<notin> inside S
 3. \<And>h. \<lbrakk>path h; pathstart h = pathstart (linepath a b); path_image h \<subseteq> path_image (linepath a b); path_image h - {pathfinish h} \<subseteq> interior (inside S); pathfinish h \<in> frontier (inside S)\<rbrakk> \<Longrightarrow> \<exists>y T. y \<in> S \<and> connected T \<and> a \<in> T \<and> y \<in> T \<and> T \<subseteq> S \<union> inside S
[PROOF STEP]
apply (simp_all add: ain b)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>h. \<lbrakk>path h; pathstart h = a; path_image h \<subseteq> closed_segment a b; path_image h - {pathfinish h} \<subseteq> interior (inside S); pathfinish h \<in> frontier (inside S)\<rbrakk> \<Longrightarrow> \<exists>y. y \<in> S \<and> (\<exists>T. connected T \<and> a \<in> T \<and> y \<in> T \<and> T \<subseteq> S \<union> inside S)
[PROOF STEP]
subgoal for h
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>path h; pathstart h = a; path_image h \<subseteq> closed_segment a b; path_image h - {pathfinish h} \<subseteq> interior (inside S); pathfinish h \<in> frontier (inside S)\<rbrakk> \<Longrightarrow> \<exists>y. y \<in> S \<and> (\<exists>T. connected T \<and> a \<in> T \<and> y \<in> T \<and> T \<subseteq> S \<union> inside S)
[PROOF STEP]
apply (rule_tac x="pathfinish h" in exI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>path h; pathstart h = a; path_image h \<subseteq> closed_segment a b; path_image h - {pathfinish h} \<subseteq> interior (inside S); pathfinish h \<in> frontier (inside S)\<rbrakk> \<Longrightarrow> pathfinish h \<in> S \<and> (\<exists>T. connected T \<and> a \<in> T \<and> pathfinish h \<in> T \<and> T \<subseteq> S \<union> inside S)
[PROOF STEP]
apply (simp add: subsetD [OF frontier_inside_subset[OF S]])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>path h; pathstart h = a; path_image h \<subseteq> closed_segment a b; path_image h - {pathfinish h} \<subseteq> interior (inside S); pathfinish h \<in> frontier (inside S)\<rbrakk> \<Longrightarrow> \<exists>T. connected T \<and> a \<in> T \<and> pathfinish h \<in> T \<and> T \<subseteq> S \<union> inside S
[PROOF STEP]
apply (rule_tac x="path_image h" in exI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>path h; pathstart h = a; path_image h \<subseteq> closed_segment a b; path_image h - {pathfinish h} \<subseteq> interior (inside S); pathfinish h \<in> frontier (inside S)\<rbrakk> \<Longrightarrow> connected (path_image h) \<and> a \<in> path_image h \<and> pathfinish h \<in> path_image h \<and> path_image h \<subseteq> S \<union> inside S
[PROOF STEP]
apply (simp add: pathfinish_in_path_image connected_path_image, auto)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>path h; path_image h \<subseteq> closed_segment (pathstart h) b; path_image h - {pathfinish h} \<subseteq> interior (inside S); pathfinish h \<in> frontier (inside S); a = pathstart h; x \<in> path_image h; x \<notin> inside S\<rbrakk> \<Longrightarrow> x \<in> S
[PROOF STEP]
by (metis Diff_single_insert S frontier_inside_subset insert_iff interior_subset subsetD)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
\<exists>y T. y \<in> S \<and> connected T \<and> a \<in> T \<and> y \<in> T \<and> T \<subseteq> S \<union> inside S

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
?a \<in> S \<union> inside S \<Longrightarrow> \<exists>y T. y \<in> S \<and> connected T \<and> ?a \<in> T \<and> y \<in> T \<and> T \<subseteq> S \<union> inside S

goal (1 subgoal):
 1. S \<union> inside S \<noteq> UNIV \<Longrightarrow> connected (S \<union> inside S)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. connected (S \<union> inside S)
[PROOF STEP]
apply (simp add: connected_iff_connected_component)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>S \<union> inside S. \<forall>y\<in>S \<union> inside S. connected_component (S \<union> inside S) x y
[PROOF STEP]
apply (clarsimp simp add: connected_component_def dest!: *)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x y ya yb T Ta. \<lbrakk>ya \<in> S; yb \<in> S; connected T; connected Ta; x \<in> T; y \<in> Ta; ya \<in> T; T \<subseteq> S \<union> inside S; yb \<in> Ta; Ta \<subseteq> S \<union> inside S\<rbrakk> \<Longrightarrow> \<exists>T. connected T \<and> T \<subseteq> S \<union> inside S \<and> x \<in> T \<and> y \<in> T
[PROOF STEP]
subgoal for x y u u' T t'
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>u \<in> S; u' \<in> S; connected T; connected t'; x \<in> T; y \<in> t'; u \<in> T; T \<subseteq> S \<union> inside S; u' \<in> t'; t' \<subseteq> S \<union> inside S\<rbrakk> \<Longrightarrow> \<exists>T. connected T \<and> T \<subseteq> S \<union> inside S \<and> x \<in> T \<and> y \<in> T
[PROOF STEP]
by (rule_tac x="(S \<union> T \<union> t')" in exI) (auto intro!: connected_Un cons)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
connected (S \<union> inside S)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma psi_residues_compare_2:
  "psi_odd_2 n \<le> psi_even_2 n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum mangoldt_odd {2..n} \<le> sum mangoldt_even {2..n}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. sum mangoldt_odd {2..n} \<le> sum mangoldt_even {2..n}
[PROOF STEP]
have "psi_odd_2 n = (\<Sum>d\<in>{d. d \<in> {2..n} \<and> primepow_odd d}. mangoldt_odd d)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum mangoldt_odd {2..n} = (\<Sum>d | d \<in> {2..n} \<and> primepow_odd d. mangoldt_odd d)
[PROOF STEP]
unfolding mangoldt_odd_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>d = 2..n. if primepow_odd d then ln (real (aprimedivisor d)) else 0) = (\<Sum>d | d \<in> {2..n} \<and> primepow_odd d. if primepow_odd d then ln (real (aprimedivisor d)) else 0)
[PROOF STEP]
by (rule sum.mono_neutral_right) auto
[PROOF STATE]
proof (state)
this:
sum mangoldt_odd {2..n} = (\<Sum>d | d \<in> {2..n} \<and> primepow_odd d. mangoldt_odd d)

goal (1 subgoal):
 1. sum mangoldt_odd {2..n} \<le> sum mangoldt_even {2..n}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
sum mangoldt_odd {2..n} = (\<Sum>d | d \<in> {2..n} \<and> primepow_odd d. mangoldt_odd d)

goal (1 subgoal):
 1. sum mangoldt_odd {2..n} \<le> sum mangoldt_even {2..n}
[PROOF STEP]
have "\<dots> = (\<Sum>d\<in>{d. d \<in> {2..n} \<and> primepow_odd d}. ln (real (aprimedivisor d)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>d | d \<in> {2..n} \<and> primepow_odd d. mangoldt_odd d) = (\<Sum>d | d \<in> {2..n} \<and> primepow_odd d. ln (real (aprimedivisor d)))
[PROOF STEP]
by (intro sum.cong refl) (simp add: mangoldt_odd_def)
[PROOF STATE]
proof (state)
this:
(\<Sum>d | d \<in> {2..n} \<and> primepow_odd d. mangoldt_odd d) = (\<Sum>d | d \<in> {2..n} \<and> primepow_odd d. ln (real (aprimedivisor d)))

goal (1 subgoal):
 1. sum mangoldt_odd {2..n} \<le> sum mangoldt_even {2..n}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>d | d \<in> {2..n} \<and> primepow_odd d. mangoldt_odd d) = (\<Sum>d | d \<in> {2..n} \<and> primepow_odd d. ln (real (aprimedivisor d)))

goal (1 subgoal):
 1. sum mangoldt_odd {2..n} \<le> sum mangoldt_even {2..n}
[PROOF STEP]
have "\<dots> \<le> (\<Sum>d\<in>{d. d \<in> {2..n} \<and> primepow_even d}. ln (real (aprimedivisor d)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>d | d \<in> {2..n} \<and> primepow_odd d. ln (real (aprimedivisor d))) \<le> (\<Sum>d | d \<in> {2..n} \<and> primepow_even d. ln (real (aprimedivisor d)))
[PROOF STEP]
proof (rule sum_le_included [where i = "\<lambda>y. y * aprimedivisor y"]; clarify?)
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. finite {d \<in> {2..n}. primepow_odd d}
 2. finite {d \<in> {2..n}. primepow_even d}
 3. \<And>y. \<lbrakk>y \<in> {2..n}; primepow_even y\<rbrakk> \<Longrightarrow> 0 \<le> ln (real (aprimedivisor y))
 4. \<And>x. \<lbrakk>x \<in> {2..n}; primepow_odd x\<rbrakk> \<Longrightarrow> \<exists>y\<in>{d \<in> {2..n}. primepow_even d}. y * aprimedivisor y = x \<and> ln (real (aprimedivisor x)) \<le> ln (real (aprimedivisor y))
[PROOF STEP]
fix d :: nat
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. finite {d \<in> {2..n}. primepow_odd d}
 2. finite {d \<in> {2..n}. primepow_even d}
 3. \<And>y. \<lbrakk>y \<in> {2..n}; primepow_even y\<rbrakk> \<Longrightarrow> 0 \<le> ln (real (aprimedivisor y))
 4. \<And>x. \<lbrakk>x \<in> {2..n}; primepow_odd x\<rbrakk> \<Longrightarrow> \<exists>y\<in>{d \<in> {2..n}. primepow_even d}. y * aprimedivisor y = x \<and> ln (real (aprimedivisor x)) \<le> ln (real (aprimedivisor y))
[PROOF STEP]
assume "d \<in> {2..n}" "primepow_odd d"
[PROOF STATE]
proof (state)
this:
d \<in> {2..n}
primepow_odd d

goal (4 subgoals):
 1. finite {d \<in> {2..n}. primepow_odd d}
 2. finite {d \<in> {2..n}. primepow_even d}
 3. \<And>y. \<lbrakk>y \<in> {2..n}; primepow_even y\<rbrakk> \<Longrightarrow> 0 \<le> ln (real (aprimedivisor y))
 4. \<And>x. \<lbrakk>x \<in> {2..n}; primepow_odd x\<rbrakk> \<Longrightarrow> \<exists>y\<in>{d \<in> {2..n}. primepow_even d}. y * aprimedivisor y = x \<and> ln (real (aprimedivisor x)) \<le> ln (real (aprimedivisor y))
[PROOF STEP]
note d = this
[PROOF STATE]
proof (state)
this:
d \<in> {2..n}
primepow_odd d

goal (4 subgoals):
 1. finite {d \<in> {2..n}. primepow_odd d}
 2. finite {d \<in> {2..n}. primepow_even d}
 3. \<And>y. \<lbrakk>y \<in> {2..n}; primepow_even y\<rbrakk> \<Longrightarrow> 0 \<le> ln (real (aprimedivisor y))
 4. \<And>x. \<lbrakk>x \<in> {2..n}; primepow_odd x\<rbrakk> \<Longrightarrow> \<exists>y\<in>{d \<in> {2..n}. primepow_even d}. y * aprimedivisor y = x \<and> ln (real (aprimedivisor x)) \<le> ln (real (aprimedivisor y))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
d \<in> {2..n}
primepow_odd d
[PROOF STEP]
obtain p k where d': "k \<ge> 1" "prime p" "d = p ^ (2*k+1)"
[PROOF STATE]
proof (prove)
using this:
d \<in> {2..n}
primepow_odd d

goal (1 subgoal):
 1. (\<And>k p. \<lbrakk>1 \<le> k; prime p; d = p ^ (2 * k + 1)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp: primepow_odd_def)
[PROOF STATE]
proof (state)
this:
1 \<le> k
prime p
d = p ^ (2 * k + 1)

goal (4 subgoals):
 1. finite {d \<in> {2..n}. primepow_odd d}
 2. finite {d \<in> {2..n}. primepow_even d}
 3. \<And>y. \<lbrakk>y \<in> {2..n}; primepow_even y\<rbrakk> \<Longrightarrow> 0 \<le> ln (real (aprimedivisor y))
 4. \<And>x. \<lbrakk>x \<in> {2..n}; primepow_odd x\<rbrakk> \<Longrightarrow> \<exists>y\<in>{d \<in> {2..n}. primepow_even d}. y * aprimedivisor y = x \<and> ln (real (aprimedivisor x)) \<le> ln (real (aprimedivisor y))
[PROOF STEP]
from d'
[PROOF STATE]
proof (chain)
picking this:
1 \<le> k
prime p
d = p ^ (2 * k + 1)
[PROOF STEP]
have "p ^ (2 * k) \<le> p ^ (2 * k + 1)"
[PROOF STATE]
proof (prove)
using this:
1 \<le> k
prime p
d = p ^ (2 * k + 1)

goal (1 subgoal):
 1. p ^ (2 * k) \<le> p ^ (2 * k + 1)
[PROOF STEP]
by (subst power_increasing_iff) (auto simp: prime_gt_Suc_0_nat)
[PROOF STATE]
proof (state)
this:
p ^ (2 * k) \<le> p ^ (2 * k + 1)

goal (4 subgoals):
 1. finite {d \<in> {2..n}. primepow_odd d}
 2. finite {d \<in> {2..n}. primepow_even d}
 3. \<And>y. \<lbrakk>y \<in> {2..n}; primepow_even y\<rbrakk> \<Longrightarrow> 0 \<le> ln (real (aprimedivisor y))
 4. \<And>x. \<lbrakk>x \<in> {2..n}; primepow_odd x\<rbrakk> \<Longrightarrow> \<exists>y\<in>{d \<in> {2..n}. primepow_even d}. y * aprimedivisor y = x \<and> ln (real (aprimedivisor x)) \<le> ln (real (aprimedivisor y))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
p ^ (2 * k) \<le> p ^ (2 * k + 1)

goal (4 subgoals):
 1. finite {d \<in> {2..n}. primepow_odd d}
 2. finite {d \<in> {2..n}. primepow_even d}
 3. \<And>y. \<lbrakk>y \<in> {2..n}; primepow_even y\<rbrakk> \<Longrightarrow> 0 \<le> ln (real (aprimedivisor y))
 4. \<And>x. \<lbrakk>x \<in> {2..n}; primepow_odd x\<rbrakk> \<Longrightarrow> \<exists>y\<in>{d \<in> {2..n}. primepow_even d}. y * aprimedivisor y = x \<and> ln (real (aprimedivisor x)) \<le> ln (real (aprimedivisor y))
[PROOF STEP]
from d d'
[PROOF STATE]
proof (chain)
picking this:
d \<in> {2..n}
primepow_odd d
1 \<le> k
prime p
d = p ^ (2 * k + 1)
[PROOF STEP]
have "\<dots> \<le> n"
[PROOF STATE]
proof (prove)
using this:
d \<in> {2..n}
primepow_odd d
1 \<le> k
prime p
d = p ^ (2 * k + 1)

goal (1 subgoal):
 1. p ^ (2 * k + 1) \<le> n
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
p ^ (2 * k + 1) \<le> n

goal (4 subgoals):
 1. finite {d \<in> {2..n}. primepow_odd d}
 2. finite {d \<in> {2..n}. primepow_even d}
 3. \<And>y. \<lbrakk>y \<in> {2..n}; primepow_even y\<rbrakk> \<Longrightarrow> 0 \<le> ln (real (aprimedivisor y))
 4. \<And>x. \<lbrakk>x \<in> {2..n}; primepow_odd x\<rbrakk> \<Longrightarrow> \<exists>y\<in>{d \<in> {2..n}. primepow_even d}. y * aprimedivisor y = x \<and> ln (real (aprimedivisor x)) \<le> ln (real (aprimedivisor y))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
p ^ (2 * k) \<le> n
[PROOF STEP]
have "p ^ (2 * k) \<le> n"
[PROOF STATE]
proof (prove)
using this:
p ^ (2 * k) \<le> n

goal (1 subgoal):
 1. p ^ (2 * k) \<le> n
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
p ^ (2 * k) \<le> n

goal (4 subgoals):
 1. finite {d \<in> {2..n}. primepow_odd d}
 2. finite {d \<in> {2..n}. primepow_even d}
 3. \<And>y. \<lbrakk>y \<in> {2..n}; primepow_even y\<rbrakk> \<Longrightarrow> 0 \<le> ln (real (aprimedivisor y))
 4. \<And>x. \<lbrakk>x \<in> {2..n}; primepow_odd x\<rbrakk> \<Longrightarrow> \<exists>y\<in>{d \<in> {2..n}. primepow_even d}. y * aprimedivisor y = x \<and> ln (real (aprimedivisor x)) \<le> ln (real (aprimedivisor y))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
p ^ (2 * k) \<le> n

goal (4 subgoals):
 1. finite {d \<in> {2..n}. primepow_odd d}
 2. finite {d \<in> {2..n}. primepow_even d}
 3. \<And>y. \<lbrakk>y \<in> {2..n}; primepow_even y\<rbrakk> \<Longrightarrow> 0 \<le> ln (real (aprimedivisor y))
 4. \<And>x. \<lbrakk>x \<in> {2..n}; primepow_odd x\<rbrakk> \<Longrightarrow> \<exists>y\<in>{d \<in> {2..n}. primepow_even d}. y * aprimedivisor y = x \<and> ln (real (aprimedivisor x)) \<le> ln (real (aprimedivisor y))
[PROOF STEP]
from d'
[PROOF STATE]
proof (chain)
picking this:
1 \<le> k
prime p
d = p ^ (2 * k + 1)
[PROOF STEP]
have "p ^ (2 * k) > 1"
[PROOF STATE]
proof (prove)
using this:
1 \<le> k
prime p
d = p ^ (2 * k + 1)

goal (1 subgoal):
 1. 1 < p ^ (2 * k)
[PROOF STEP]
by (intro one_less_power) (simp_all add: prime_gt_Suc_0_nat)
[PROOF STATE]
proof (state)
this:
1 < p ^ (2 * k)

goal (4 subgoals):
 1. finite {d \<in> {2..n}. primepow_odd d}
 2. finite {d \<in> {2..n}. primepow_even d}
 3. \<And>y. \<lbrakk>y \<in> {2..n}; primepow_even y\<rbrakk> \<Longrightarrow> 0 \<le> ln (real (aprimedivisor y))
 4. \<And>x. \<lbrakk>x \<in> {2..n}; primepow_odd x\<rbrakk> \<Longrightarrow> \<exists>y\<in>{d \<in> {2..n}. primepow_even d}. y * aprimedivisor y = x \<and> ln (real (aprimedivisor x)) \<le> ln (real (aprimedivisor y))
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
p ^ (2 * k) \<le> n
1 < p ^ (2 * k)
[PROOF STEP]
have "p ^ (2 * k) \<in> {2..n}"
[PROOF STATE]
proof (prove)
using this:
p ^ (2 * k) \<le> n
1 < p ^ (2 * k)

goal (1 subgoal):
 1. p ^ (2 * k) \<in> {2..n}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
p ^ (2 * k) \<in> {2..n}

goal (4 subgoals):
 1. finite {d \<in> {2..n}. primepow_odd d}
 2. finite {d \<in> {2..n}. primepow_even d}
 3. \<And>y. \<lbrakk>y \<in> {2..n}; primepow_even y\<rbrakk> \<Longrightarrow> 0 \<le> ln (real (aprimedivisor y))
 4. \<And>x. \<lbrakk>x \<in> {2..n}; primepow_odd x\<rbrakk> \<Longrightarrow> \<exists>y\<in>{d \<in> {2..n}. primepow_even d}. y * aprimedivisor y = x \<and> ln (real (aprimedivisor x)) \<le> ln (real (aprimedivisor y))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
p ^ (2 * k) \<in> {2..n}

goal (4 subgoals):
 1. finite {d \<in> {2..n}. primepow_odd d}
 2. finite {d \<in> {2..n}. primepow_even d}
 3. \<And>y. \<lbrakk>y \<in> {2..n}; primepow_even y\<rbrakk> \<Longrightarrow> 0 \<le> ln (real (aprimedivisor y))
 4. \<And>x. \<lbrakk>x \<in> {2..n}; primepow_odd x\<rbrakk> \<Longrightarrow> \<exists>y\<in>{d \<in> {2..n}. primepow_even d}. y * aprimedivisor y = x \<and> ln (real (aprimedivisor x)) \<le> ln (real (aprimedivisor y))
[PROOF STEP]
from d'
[PROOF STATE]
proof (chain)
picking this:
1 \<le> k
prime p
d = p ^ (2 * k + 1)
[PROOF STEP]
have "primepow_even (p ^ (2 * k))"
[PROOF STATE]
proof (prove)
using this:
1 \<le> k
prime p
d = p ^ (2 * k + 1)

goal (1 subgoal):
 1. primepow_even (p ^ (2 * k))
[PROOF STEP]
by (auto simp: primepow_even_def)
[PROOF STATE]
proof (state)
this:
primepow_even (p ^ (2 * k))

goal (4 subgoals):
 1. finite {d \<in> {2..n}. primepow_odd d}
 2. finite {d \<in> {2..n}. primepow_even d}
 3. \<And>y. \<lbrakk>y \<in> {2..n}; primepow_even y\<rbrakk> \<Longrightarrow> 0 \<le> ln (real (aprimedivisor y))
 4. \<And>x. \<lbrakk>x \<in> {2..n}; primepow_odd x\<rbrakk> \<Longrightarrow> \<exists>y\<in>{d \<in> {2..n}. primepow_even d}. y * aprimedivisor y = x \<and> ln (real (aprimedivisor x)) \<le> ln (real (aprimedivisor y))
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
p ^ (2 * k) \<in> {2..n}
primepow_even (p ^ (2 * k))
[PROOF STEP]
show "\<exists>y\<in>{d \<in> {2..n}. primepow_even d}. y * aprimedivisor y = d \<and>
                       ln (real (aprimedivisor d)) \<le> ln (real (aprimedivisor y))"
[PROOF STATE]
proof (prove)
using this:
p ^ (2 * k) \<in> {2..n}
primepow_even (p ^ (2 * k))

goal (1 subgoal):
 1. \<exists>y\<in>{d \<in> {2..n}. primepow_even d}. y * aprimedivisor y = d \<and> ln (real (aprimedivisor d)) \<le> ln (real (aprimedivisor y))
[PROOF STEP]
using d'
[PROOF STATE]
proof (prove)
using this:
p ^ (2 * k) \<in> {2..n}
primepow_even (p ^ (2 * k))
1 \<le> k
prime p
d = p ^ (2 * k + 1)

goal (1 subgoal):
 1. \<exists>y\<in>{d \<in> {2..n}. primepow_even d}. y * aprimedivisor y = d \<and> ln (real (aprimedivisor d)) \<le> ln (real (aprimedivisor y))
[PROOF STEP]
by (intro bexI[of _ "p ^ (2 * k)"])
         (auto simp: aprimedivisor_prime_power aprimedivisor_primepow)
[PROOF STATE]
proof (state)
this:
\<exists>y\<in>{d \<in> {2..n}. primepow_even d}. y * aprimedivisor y = d \<and> ln (real (aprimedivisor d)) \<le> ln (real (aprimedivisor y))

goal (3 subgoals):
 1. finite {d \<in> {2..n}. primepow_odd d}
 2. finite {d \<in> {2..n}. primepow_even d}
 3. \<And>y. \<lbrakk>y \<in> {2..n}; primepow_even y\<rbrakk> \<Longrightarrow> 0 \<le> ln (real (aprimedivisor y))
[PROOF STEP]
qed (simp_all add: of_nat_ge_1_iff Suc_le_eq)
[PROOF STATE]
proof (state)
this:
(\<Sum>d | d \<in> {2..n} \<and> primepow_odd d. ln (real (aprimedivisor d))) \<le> (\<Sum>d | d \<in> {2..n} \<and> primepow_even d. ln (real (aprimedivisor d)))

goal (1 subgoal):
 1. sum mangoldt_odd {2..n} \<le> sum mangoldt_even {2..n}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>d | d \<in> {2..n} \<and> primepow_odd d. ln (real (aprimedivisor d))) \<le> (\<Sum>d | d \<in> {2..n} \<and> primepow_even d. ln (real (aprimedivisor d)))

goal (1 subgoal):
 1. sum mangoldt_odd {2..n} \<le> sum mangoldt_even {2..n}
[PROOF STEP]
have "\<dots> = (\<Sum>d\<in>{d. d \<in> {2..n} \<and> primepow_even d}. mangoldt_even d)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>d | d \<in> {2..n} \<and> primepow_even d. ln (real (aprimedivisor d))) = (\<Sum>d | d \<in> {2..n} \<and> primepow_even d. mangoldt_even d)
[PROOF STEP]
by (intro sum.cong refl) (simp add: mangoldt_even_def)
[PROOF STATE]
proof (state)
this:
(\<Sum>d | d \<in> {2..n} \<and> primepow_even d. ln (real (aprimedivisor d))) = (\<Sum>d | d \<in> {2..n} \<and> primepow_even d. mangoldt_even d)

goal (1 subgoal):
 1. sum mangoldt_odd {2..n} \<le> sum mangoldt_even {2..n}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>d | d \<in> {2..n} \<and> primepow_even d. ln (real (aprimedivisor d))) = (\<Sum>d | d \<in> {2..n} \<and> primepow_even d. mangoldt_even d)

goal (1 subgoal):
 1. sum mangoldt_odd {2..n} \<le> sum mangoldt_even {2..n}
[PROOF STEP]
have "\<dots> = psi_even_2 n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>d | d \<in> {2..n} \<and> primepow_even d. mangoldt_even d) = sum mangoldt_even {2..n}
[PROOF STEP]
unfolding mangoldt_even_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>d | d \<in> {2..n} \<and> primepow_even d. if primepow_even d then ln (real (aprimedivisor d)) else 0) = (\<Sum>d = 2..n. if primepow_even d then ln (real (aprimedivisor d)) else 0)
[PROOF STEP]
by (rule sum.mono_neutral_left) auto
[PROOF STATE]
proof (state)
this:
(\<Sum>d | d \<in> {2..n} \<and> primepow_even d. mangoldt_even d) = sum mangoldt_even {2..n}

goal (1 subgoal):
 1. sum mangoldt_odd {2..n} \<le> sum mangoldt_even {2..n}
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
sum mangoldt_odd {2..n} \<le> sum mangoldt_even {2..n}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
sum mangoldt_odd {2..n} \<le> sum mangoldt_even {2..n}

goal (1 subgoal):
 1. sum mangoldt_odd {2..n} \<le> sum mangoldt_even {2..n}
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
sum mangoldt_odd {2..n} \<le> sum mangoldt_even {2..n}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma minimal:
  assumes "x \<in> A" and "P x"
  shows "\<exists>y \<in> A. size y \<le> size x \<and> P y \<and> (\<forall>z \<in> A. size z < size y \<longrightarrow> \<not> P z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>y\<in>A. size y \<le> size x \<and> P y \<and> (\<forall>z\<in>A. size z < size y \<longrightarrow> \<not> P z)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
x \<in> A
P x

goal (1 subgoal):
 1. \<exists>y\<in>A. size y \<le> size x \<and> P y \<and> (\<forall>z\<in>A. size z < size y \<longrightarrow> \<not> P z)
[PROOF STEP]
proof (induction x taking: size rule: measure_induct)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>\<forall>y. size y < size x \<longrightarrow> y \<in> A \<longrightarrow> P y \<longrightarrow> (\<exists>ya\<in>A. size ya \<le> size y \<and> P ya \<and> (\<forall>z\<in>A. size z < size ya \<longrightarrow> \<not> P z)); x \<in> A; P x\<rbrakk> \<Longrightarrow> \<exists>y\<in>A. size y \<le> size x \<and> P y \<and> (\<forall>z\<in>A. size z < size y \<longrightarrow> \<not> P z)
[PROOF STEP]
case (1 x)
[PROOF STATE]
proof (state)
this:
\<forall>y. size y < size x \<longrightarrow> y \<in> A \<longrightarrow> P y \<longrightarrow> (\<exists>ya\<in>A. size ya \<le> size y \<and> P ya \<and> (\<forall>z\<in>A. size z < size ya \<longrightarrow> \<not> P z))
x \<in> A
P x

goal (1 subgoal):
 1. \<And>x. \<lbrakk>\<forall>y. size y < size x \<longrightarrow> y \<in> A \<longrightarrow> P y \<longrightarrow> (\<exists>ya\<in>A. size ya \<le> size y \<and> P ya \<and> (\<forall>z\<in>A. size z < size ya \<longrightarrow> \<not> P z)); x \<in> A; P x\<rbrakk> \<Longrightarrow> \<exists>y\<in>A. size y \<le> size x \<and> P y \<and> (\<forall>z\<in>A. size z < size y \<longrightarrow> \<not> P z)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>y. size y < size x \<longrightarrow> y \<in> A \<longrightarrow> P y \<longrightarrow> (\<exists>ya\<in>A. size ya \<le> size y \<and> P ya \<and> (\<forall>z\<in>A. size z < size ya \<longrightarrow> \<not> P z))
x \<in> A
P x
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
\<forall>y. size y < size x \<longrightarrow> y \<in> A \<longrightarrow> P y \<longrightarrow> (\<exists>ya\<in>A. size ya \<le> size y \<and> P ya \<and> (\<forall>z\<in>A. size z < size ya \<longrightarrow> \<not> P z))
x \<in> A
P x

goal (1 subgoal):
 1. \<exists>y\<in>A. size y \<le> size x \<and> P y \<and> (\<forall>z\<in>A. size z < size y \<longrightarrow> \<not> P z)
[PROOF STEP]
proof (cases "\<forall>y \<in> A. size y < size x \<longrightarrow> \<not> P y")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>\<forall>y. size y < size x \<longrightarrow> y \<in> A \<longrightarrow> P y \<longrightarrow> (\<exists>ya\<in>A. size ya \<le> size y \<and> P ya \<and> (\<forall>z\<in>A. size z < size ya \<longrightarrow> \<not> P z)); x \<in> A; P x; \<forall>y\<in>A. size y < size x \<longrightarrow> \<not> P y\<rbrakk> \<Longrightarrow> \<exists>y\<in>A. size y \<le> size x \<and> P y \<and> (\<forall>z\<in>A. size z < size y \<longrightarrow> \<not> P z)
 2. \<lbrakk>\<forall>y. size y < size x \<longrightarrow> y \<in> A \<longrightarrow> P y \<longrightarrow> (\<exists>ya\<in>A. size ya \<le> size y \<and> P ya \<and> (\<forall>z\<in>A. size z < size ya \<longrightarrow> \<not> P z)); x \<in> A; P x; \<not> (\<forall>y\<in>A. size y < size x \<longrightarrow> \<not> P y)\<rbrakk> \<Longrightarrow> \<exists>y\<in>A. size y \<le> size x \<and> P y \<and> (\<forall>z\<in>A. size z < size y \<longrightarrow> \<not> P z)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
\<forall>y\<in>A. size y < size x \<longrightarrow> \<not> P y

goal (2 subgoals):
 1. \<lbrakk>\<forall>y. size y < size x \<longrightarrow> y \<in> A \<longrightarrow> P y \<longrightarrow> (\<exists>ya\<in>A. size ya \<le> size y \<and> P ya \<and> (\<forall>z\<in>A. size z < size ya \<longrightarrow> \<not> P z)); x \<in> A; P x; \<forall>y\<in>A. size y < size x \<longrightarrow> \<not> P y\<rbrakk> \<Longrightarrow> \<exists>y\<in>A. size y \<le> size x \<and> P y \<and> (\<forall>z\<in>A. size z < size y \<longrightarrow> \<not> P z)
 2. \<lbrakk>\<forall>y. size y < size x \<longrightarrow> y \<in> A \<longrightarrow> P y \<longrightarrow> (\<exists>ya\<in>A. size ya \<le> size y \<and> P ya \<and> (\<forall>z\<in>A. size z < size ya \<longrightarrow> \<not> P z)); x \<in> A; P x; \<not> (\<forall>y\<in>A. size y < size x \<longrightarrow> \<not> P y)\<rbrakk> \<Longrightarrow> \<exists>y\<in>A. size y \<le> size x \<and> P y \<and> (\<forall>z\<in>A. size z < size y \<longrightarrow> \<not> P z)
[PROOF STEP]
with 1
[PROOF STATE]
proof (chain)
picking this:
\<forall>y. size y < size x \<longrightarrow> y \<in> A \<longrightarrow> P y \<longrightarrow> (\<exists>ya\<in>A. size ya \<le> size y \<and> P ya \<and> (\<forall>z\<in>A. size z < size ya \<longrightarrow> \<not> P z))
x \<in> A
P x
\<forall>y\<in>A. size y < size x \<longrightarrow> \<not> P y
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<forall>y. size y < size x \<longrightarrow> y \<in> A \<longrightarrow> P y \<longrightarrow> (\<exists>ya\<in>A. size ya \<le> size y \<and> P ya \<and> (\<forall>z\<in>A. size z < size ya \<longrightarrow> \<not> P z))
x \<in> A
P x
\<forall>y\<in>A. size y < size x \<longrightarrow> \<not> P y

goal (1 subgoal):
 1. \<exists>y\<in>A. size y \<le> size x \<and> P y \<and> (\<forall>z\<in>A. size z < size y \<longrightarrow> \<not> P z)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>y\<in>A. size y \<le> size x \<and> P y \<and> (\<forall>z\<in>A. size z < size y \<longrightarrow> \<not> P z)

goal (1 subgoal):
 1. \<lbrakk>\<forall>y. size y < size x \<longrightarrow> y \<in> A \<longrightarrow> P y \<longrightarrow> (\<exists>ya\<in>A. size ya \<le> size y \<and> P ya \<and> (\<forall>z\<in>A. size z < size ya \<longrightarrow> \<not> P z)); x \<in> A; P x; \<not> (\<forall>y\<in>A. size y < size x \<longrightarrow> \<not> P y)\<rbrakk> \<Longrightarrow> \<exists>y\<in>A. size y \<le> size x \<and> P y \<and> (\<forall>z\<in>A. size z < size y \<longrightarrow> \<not> P z)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>\<forall>y. size y < size x \<longrightarrow> y \<in> A \<longrightarrow> P y \<longrightarrow> (\<exists>ya\<in>A. size ya \<le> size y \<and> P ya \<and> (\<forall>z\<in>A. size z < size ya \<longrightarrow> \<not> P z)); x \<in> A; P x; \<not> (\<forall>y\<in>A. size y < size x \<longrightarrow> \<not> P y)\<rbrakk> \<Longrightarrow> \<exists>y\<in>A. size y \<le> size x \<and> P y \<and> (\<forall>z\<in>A. size z < size y \<longrightarrow> \<not> P z)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> (\<forall>y\<in>A. size y < size x \<longrightarrow> \<not> P y)

goal (1 subgoal):
 1. \<lbrakk>\<forall>y. size y < size x \<longrightarrow> y \<in> A \<longrightarrow> P y \<longrightarrow> (\<exists>ya\<in>A. size ya \<le> size y \<and> P ya \<and> (\<forall>z\<in>A. size z < size ya \<longrightarrow> \<not> P z)); x \<in> A; P x; \<not> (\<forall>y\<in>A. size y < size x \<longrightarrow> \<not> P y)\<rbrakk> \<Longrightarrow> \<exists>y\<in>A. size y \<le> size x \<and> P y \<and> (\<forall>z\<in>A. size z < size y \<longrightarrow> \<not> P z)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> (\<forall>y\<in>A. size y < size x \<longrightarrow> \<not> P y)
[PROOF STEP]
obtain y where "y \<in> A" and "size y < size x" and "P y"
[PROOF STATE]
proof (prove)
using this:
\<not> (\<forall>y\<in>A. size y < size x \<longrightarrow> \<not> P y)

goal (1 subgoal):
 1. (\<And>y. \<lbrakk>y \<in> A; size y < size x; P y\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
y \<in> A
size y < size x
P y

goal (1 subgoal):
 1. \<lbrakk>\<forall>y. size y < size x \<longrightarrow> y \<in> A \<longrightarrow> P y \<longrightarrow> (\<exists>ya\<in>A. size ya \<le> size y \<and> P ya \<and> (\<forall>z\<in>A. size z < size ya \<longrightarrow> \<not> P z)); x \<in> A; P x; \<not> (\<forall>y\<in>A. size y < size x \<longrightarrow> \<not> P y)\<rbrakk> \<Longrightarrow> \<exists>y\<in>A. size y \<le> size x \<and> P y \<and> (\<forall>z\<in>A. size z < size y \<longrightarrow> \<not> P z)
[PROOF STEP]
with "1.IH"
[PROOF STATE]
proof (chain)
picking this:
\<forall>y. size y < size x \<longrightarrow> y \<in> A \<longrightarrow> P y \<longrightarrow> (\<exists>ya\<in>A. size ya \<le> size y \<and> P ya \<and> (\<forall>z\<in>A. size z < size ya \<longrightarrow> \<not> P z))
y \<in> A
size y < size x
P y
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<forall>y. size y < size x \<longrightarrow> y \<in> A \<longrightarrow> P y \<longrightarrow> (\<exists>ya\<in>A. size ya \<le> size y \<and> P ya \<and> (\<forall>z\<in>A. size z < size ya \<longrightarrow> \<not> P z))
y \<in> A
size y < size x
P y

goal (1 subgoal):
 1. \<exists>y\<in>A. size y \<le> size x \<and> P y \<and> (\<forall>z\<in>A. size z < size y \<longrightarrow> \<not> P z)
[PROOF STEP]
by (fastforce elim!: order_trans)
[PROOF STATE]
proof (state)
this:
\<exists>y\<in>A. size y \<le> size x \<and> P y \<and> (\<forall>z\<in>A. size z < size y \<longrightarrow> \<not> P z)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<exists>y\<in>A. size y \<le> size x \<and> P y \<and> (\<forall>z\<in>A. size z < size y \<longrightarrow> \<not> P z)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma less_eq_bot_Bot_is_Bot: "x \<le> Bot \<Longrightarrow> x = Bot"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<le> Bot \<Longrightarrow> x = Bot
[PROOF STEP]
by (cases x) (simp_all add: less_eq_bot_def)


[STATEMENT]
lemma upper_triangularI[intro] :
  "(\<And>i j. j < i \<Longrightarrow> i < dim_row A \<Longrightarrow> A $$ (i,j) = 0) \<Longrightarrow> upper_triangular A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>i j. \<lbrakk>j < i; i < dim_row A\<rbrakk> \<Longrightarrow> A $$ (i, j) = (0::'a)) \<Longrightarrow> upper_triangular A
[PROOF STEP]
unfolding upper_triangular_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>i j. \<lbrakk>j < i; i < dim_row A\<rbrakk> \<Longrightarrow> A $$ (i, j) = (0::'a)) \<Longrightarrow> \<forall>i<dim_row A. \<forall>j<i. A $$ (i, j) = (0::'a)
[PROOF STEP]
by auto