[STATEMENT]
theorem summable_Leibniz:
  fixes a :: "nat \<Rightarrow> real"
  assumes a_zero: "a \<longlonglongrightarrow> 0"
    and "monoseq a"
  shows "summable (\<lambda> n. (-1)^n * a n)" (is "?summable")
    and "0 < a 0 \<longrightarrow>
      (\<forall>n. (\<Sum>i. (- 1)^i*a i) \<in> { \<Sum>i<2*n. (- 1)^i * a i .. \<Sum>i<2*n+1. (- 1)^i * a i})" (is "?pos")
    and "a 0 < 0 \<longrightarrow>
      (\<forall>n. (\<Sum>i. (- 1)^i*a i) \<in> { \<Sum>i<2*n+1. (- 1)^i * a i .. \<Sum>i<2*n. (- 1)^i * a i})" (is "?neg")
    and "(\<lambda>n. \<Sum>i<2*n. (- 1)^i*a i) \<longlonglongrightarrow> (\<Sum>i. (- 1)^i*a i)" (is "?f")
    and "(\<lambda>n. \<Sum>i<2*n+1. (- 1)^i*a i) \<longlonglongrightarrow> (\<Sum>i. (- 1)^i*a i)" (is "?g")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (summable (\<lambda>n. (- 1) ^ n * a n) &&& 0 < a 0 \<longrightarrow> (\<forall>n. (\<Sum>i. (- 1) ^ i * a i) \<in> {\<Sum>i<2 * n. (- 1) ^ i * a i..\<Sum>i<2 * n + 1. (- 1) ^ i * a i})) &&& a 0 < 0 \<longrightarrow> (\<forall>n. (\<Sum>i. (- 1) ^ i * a i) \<in> {\<Sum>i<2 * n + 1. (- 1) ^ i * a i..\<Sum>i<2 * n. (- 1) ^ i * a i}) &&& (\<lambda>n. \<Sum>i<2 * n. (- 1) ^ i * a i) \<longlonglongrightarrow> (\<Sum>i. (- 1) ^ i * a i) &&& (\<lambda>n. \<Sum>i<2 * n + 1. (- 1) ^ i * a i) \<longlonglongrightarrow> (\<Sum>i. (- 1) ^ i * a i)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (5 subgoals):
 1. summable (\<lambda>n. (- 1) ^ n * a n)
 2. 0 < a 0 \<longrightarrow> (\<forall>n. (\<Sum>i. (- 1) ^ i * a i) \<in> {\<Sum>i<2 * n. (- 1) ^ i * a i..\<Sum>i<2 * n + 1. (- 1) ^ i * a i})
 3. a 0 < 0 \<longrightarrow> (\<forall>n. (\<Sum>i. (- 1) ^ i * a i) \<in> {\<Sum>i<2 * n + 1. (- 1) ^ i * a i..\<Sum>i<2 * n. (- 1) ^ i * a i})
 4. (\<lambda>n. \<Sum>i<2 * n. (- 1) ^ i * a i) \<longlonglongrightarrow> (\<Sum>i. (- 1) ^ i * a i)
 5. (\<lambda>n. \<Sum>i<2 * n + 1. (- 1) ^ i * a i) \<longlonglongrightarrow> (\<Sum>i. (- 1) ^ i * a i)
[PROOF STEP]
have "?summable \<and> ?pos \<and> ?neg \<and> ?f \<and> ?g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. summable (\<lambda>n. (- 1) ^ n * a n) \<and> (0 < a 0 \<longrightarrow> (\<forall>n. (\<Sum>i. (- 1) ^ i * a i) \<in> {\<Sum>i<2 * n. (- 1) ^ i * a i..\<Sum>i<2 * n + 1. (- 1) ^ i * a i})) \<and> (a 0 < 0 \<longrightarrow> (\<forall>n. (\<Sum>i. (- 1) ^ i * a i) \<in> {\<Sum>i<2 * n + 1. (- 1) ^ i * a i..\<Sum>i<2 * n. (- 1) ^ i * a i})) \<and> (\<lambda>n. \<Sum>i<2 * n. (- 1) ^ i * a i) \<longlonglongrightarrow> (\<Sum>i. (- 1) ^ i * a i) \<and> (\<lambda>n. \<Sum>i<2 * n + 1. (- 1) ^ i * a i) \<longlonglongrightarrow> (\<Sum>i. (- 1) ^ i * a i)
[PROOF STEP]
proof (cases "(\<forall>n. 0 \<le> a n) \<and> (\<forall>m. \<forall>n\<ge>m. a n \<le> a m)")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (\<forall>n. 0 \<le> a n) \<and> (\<forall>m n. m \<le> n \<longrightarrow> a n \<le> a m) \<Longrightarrow> summable (\<lambda>n. (- 1) ^ n * a n) \<and> (0 < a 0 \<longrightarrow> (\<forall>n. (\<Sum>i. (- 1) ^ i * a i) \<in> {\<Sum>i<2 * n. (- 1) ^ i * a i..\<Sum>i<2 * n + 1. (- 1) ^ i * a i})) \<and> (a 0 < 0 \<longrightarrow> (\<forall>n. (\<Sum>i. (- 1) ^ i * a i) \<in> {\<Sum>i<2 * n + 1. (- 1) ^ i * a i..\<Sum>i<2 * n. (- 1) ^ i * a i})) \<and> (\<lambda>n. \<Sum>i<2 * n. (- 1) ^ i * a i) \<longlonglongrightarrow> (\<Sum>i. (- 1) ^ i * a i) \<and> (\<lambda>n. \<Sum>i<2 * n + 1. (- 1) ^ i * a i) \<longlonglongrightarrow> (\<Sum>i. (- 1) ^ i * a i)
 2. \<not> ((\<forall>n. 0 \<le> a n) \<and> (\<forall>m n. m \<le> n \<longrightarrow> a n \<le> a m)) \<Longrightarrow> summable (\<lambda>n. (- 1) ^ n * a n) \<and> (0 < a 0 \<longrightarrow> (\<forall>n. (\<Sum>i. (- 1) ^ i * a i) \<in> {\<Sum>i<2 * n. (- 1) ^ i * a i..\<Sum>i<2 * n + 1. (- 1) ^ i * a i})) \<and> (a 0 < 0 \<longrightarrow> (\<forall>n. (\<Sum>i. (- 1) ^ i * a i) \<in> {\<Sum>i<2 * n + 1. (- 1) ^ i * a i..\<Sum>i<2 * n. (- 1) ^ i * a i})) \<and> (\<lambda>n. \<Sum>i<2 * n. (- 1) ^ i * a i) \<longlonglongrightarrow> (\<Sum>i. (- 1) ^ i * a i) \<and> (\<lambda>n. \<Sum>i<2 * n + 1. (- 1) ^ i * a i) \<longlonglongrightarrow> (\<Sum>i. (- 1) ^ i * a i)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
(\<forall>n. 0 \<le> a n) \<and> (\<forall>m n. m \<le> n \<longrightarrow> a n \<le> a m)

goal (2 subgoals):
 1. (\<forall>n. 0 \<le> a n) \<and> (\<forall>m n. m \<le> n \<longrightarrow> a n \<le> a m) \<Longrightarrow> summable (\<lambda>n. (- 1) ^ n * a n) \<and> (0 < a 0 \<longrightarrow> (\<forall>n. (\<Sum>i. (- 1) ^ i * a i) \<in> {\<Sum>i<2 * n. (- 1) ^ i * a i..\<Sum>i<2 * n + 1. (- 1) ^ i * a i})) \<and> (a 0 < 0 \<longrightarrow> (\<forall>n. (\<Sum>i. (- 1) ^ i * a i) \<in> {\<Sum>i<2 * n + 1. (- 1) ^ i * a i..\<Sum>i<2 * n. (- 1) ^ i * a i})) \<and> (\<lambda>n. \<Sum>i<2 * n. (- 1) ^ i * a i) \<longlonglongrightarrow> (\<Sum>i. (- 1) ^ i * a i) \<and> (\<lambda>n. \<Sum>i<2 * n + 1. (- 1) ^ i * a i) \<longlonglongrightarrow> (\<Sum>i. (- 1) ^ i * a i)
 2. \<not> ((\<forall>n. 0 \<le> a n) \<and> (\<forall>m n. m \<le> n \<longrightarrow> a n \<le> a m)) \<Longrightarrow> summable (\<lambda>n. (- 1) ^ n * a n) \<and> (0 < a 0 \<longrightarrow> (\<forall>n. (\<Sum>i. (- 1) ^ i * a i) \<in> {\<Sum>i<2 * n. (- 1) ^ i * a i..\<Sum>i<2 * n + 1. (- 1) ^ i * a i})) \<and> (a 0 < 0 \<longrightarrow> (\<forall>n. (\<Sum>i. (- 1) ^ i * a i) \<in> {\<Sum>i<2 * n + 1. (- 1) ^ i * a i..\<Sum>i<2 * n. (- 1) ^ i * a i})) \<and> (\<lambda>n. \<Sum>i<2 * n. (- 1) ^ i * a i) \<longlonglongrightarrow> (\<Sum>i. (- 1) ^ i * a i) \<and> (\<lambda>n. \<Sum>i<2 * n + 1. (- 1) ^ i * a i) \<longlonglongrightarrow> (\<Sum>i. (- 1) ^ i * a i)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<forall>n. 0 \<le> a n) \<and> (\<forall>m n. m \<le> n \<longrightarrow> a n \<le> a m)
[PROOF STEP]
have ord: "\<And>n m. m \<le> n \<Longrightarrow> a n \<le> a m"
      and ge0: "\<And>n. 0 \<le> a n"
[PROOF STATE]
proof (prove)
using this:
(\<forall>n. 0 \<le> a n) \<and> (\<forall>m n. m \<le> n \<longrightarrow> a n \<le> a m)

goal (1 subgoal):
 1. (\<And>n m. m \<le> n \<Longrightarrow> a n \<le> a m) &&& (\<And>n. 0 \<le> a n)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
?m \<le> ?n \<Longrightarrow> a ?n \<le> a ?m
0 \<le> a ?n

goal (2 subgoals):
 1. (\<forall>n. 0 \<le> a n) \<and> (\<forall>m n. m \<le> n \<longrightarrow> a n \<le> a m) \<Longrightarrow> summable (\<lambda>n. (- 1) ^ n * a n) \<and> (0 < a 0 \<longrightarrow> (\<forall>n. (\<Sum>i. (- 1) ^ i * a i) \<in> {\<Sum>i<2 * n. (- 1) ^ i * a i..\<Sum>i<2 * n + 1. (- 1) ^ i * a i})) \<and> (a 0 < 0 \<longrightarrow> (\<forall>n. (\<Sum>i. (- 1) ^ i * a i) \<in> {\<Sum>i<2 * n + 1. (- 1) ^ i * a i..\<Sum>i<2 * n. (- 1) ^ i * a i})) \<and> (\<lambda>n. \<Sum>i<2 * n. (- 1) ^ i * a i) \<longlonglongrightarrow> (\<Sum>i. (- 1) ^ i * a i) \<and> (\<lambda>n. \<Sum>i<2 * n + 1. (- 1) ^ i * a i) \<longlonglongrightarrow> (\<Sum>i. (- 1) ^ i * a i)
 2. \<not> ((\<forall>n. 0 \<le> a n) \<and> (\<forall>m n. m \<le> n \<longrightarrow> a n \<le> a m)) \<Longrightarrow> summable (\<lambda>n. (- 1) ^ n * a n) \<and> (0 < a 0 \<longrightarrow> (\<forall>n. (\<Sum>i. (- 1) ^ i * a i) \<in> {\<Sum>i<2 * n. (- 1) ^ i * a i..\<Sum>i<2 * n + 1. (- 1) ^ i * a i})) \<and> (a 0 < 0 \<longrightarrow> (\<forall>n. (\<Sum>i. (- 1) ^ i * a i) \<in> {\<Sum>i<2 * n + 1. (- 1) ^ i * a i..\<Sum>i<2 * n. (- 1) ^ i * a i})) \<and> (\<lambda>n. \<Sum>i<2 * n. (- 1) ^ i * a i) \<longlonglongrightarrow> (\<Sum>i. (- 1) ^ i * a i) \<and> (\<lambda>n. \<Sum>i<2 * n + 1. (- 1) ^ i * a i) \<longlonglongrightarrow> (\<Sum>i. (- 1) ^ i * a i)
[PROOF STEP]
have mono: "a (Suc n) \<le> a n" for n
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a (Suc n) \<le> a n
[PROOF STEP]
using ord[where n="Suc n" and m=n]
[PROOF STATE]
proof (prove)
using this:
n \<le> Suc n \<Longrightarrow> a (Suc n) \<le> a n

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

goal (2 subgoals):
 1. (\<forall>n. 0 \<le> a n) \<and> (\<forall>m n. m \<le> n \<longrightarrow> a n \<le> a m) \<Longrightarrow> summable (\<lambda>n. (- 1) ^ n * a n) \<and> (0 < a 0 \<longrightarrow> (\<forall>n. (\<Sum>i. (- 1) ^ i * a i) \<in> {\<Sum>i<2 * n. (- 1) ^ i * a i..\<Sum>i<2 * n + 1. (- 1) ^ i * a i})) \<and> (a 0 < 0 \<longrightarrow> (\<forall>n. (\<Sum>i. (- 1) ^ i * a i) \<in> {\<Sum>i<2 * n + 1. (- 1) ^ i * a i..\<Sum>i<2 * n. (- 1) ^ i * a i})) \<and> (\<lambda>n. \<Sum>i<2 * n. (- 1) ^ i * a i) \<longlonglongrightarrow> (\<Sum>i. (- 1) ^ i * a i) \<and> (\<lambda>n. \<Sum>i<2 * n + 1. (- 1) ^ i * a i) \<longlonglongrightarrow> (\<Sum>i. (- 1) ^ i * a i)
 2. \<not> ((\<forall>n. 0 \<le> a n) \<and> (\<forall>m n. m \<le> n \<longrightarrow> a n \<le> a m)) \<Longrightarrow> summable (\<lambda>n. (- 1) ^ n * a n) \<and> (0 < a 0 \<longrightarrow> (\<forall>n. (\<Sum>i. (- 1) ^ i * a i) \<in> {\<Sum>i<2 * n. (- 1) ^ i * a i..\<Sum>i<2 * n + 1. (- 1) ^ i * a i})) \<and> (a 0 < 0 \<longrightarrow> (\<forall>n. (\<Sum>i. (- 1) ^ i * a i) \<in> {\<Sum>i<2 * n + 1. (- 1) ^ i * a i..\<Sum>i<2 * n. (- 1) ^ i * a i})) \<and> (\<lambda>n. \<Sum>i<2 * n. (- 1) ^ i * a i) \<longlonglongrightarrow> (\<Sum>i. (- 1) ^ i * a i) \<and> (\<lambda>n. \<Sum>i<2 * n + 1. (- 1) ^ i * a i) \<longlonglongrightarrow> (\<Sum>i. (- 1) ^ i * a i)
[PROOF STEP]
note leibniz = summable_Leibniz'[OF \<open>a \<longlonglongrightarrow> 0\<close> ge0]
[PROOF STATE]
proof (state)
this:
(\<And>n. a (Suc n) \<le> a n) \<Longrightarrow> summable (\<lambda>n. (- 1) ^ n * a n)
(\<And>n. a (Suc n) \<le> a n) \<Longrightarrow> (\<Sum>i<2 * ?n. (- 1) ^ i * a i) \<le> (\<Sum>i. (- 1) ^ i * a i)
(\<And>n. a (Suc n) \<le> a n) \<Longrightarrow> (\<lambda>n. \<Sum>i<2 * n. (- 1) ^ i * a i) \<longlonglongrightarrow> (\<Sum>i. (- 1) ^ i * a i)
(\<And>n. a (Suc n) \<le> a n) \<Longrightarrow> (\<Sum>i. (- 1) ^ i * a i) \<le> (\<Sum>i<2 * ?n + 1. (- 1) ^ i * a i)
(\<And>n. a (Suc n) \<le> a n) \<Longrightarrow> (\<lambda>n. \<Sum>i<2 * n + 1. (- 1) ^ i * a i) \<longlonglongrightarrow> (\<Sum>i. (- 1) ^ i * a i)

goal (2 subgoals):
 1. (\<forall>n. 0 \<le> a n) \<and> (\<forall>m n. m \<le> n \<longrightarrow> a n \<le> a m) \<Longrightarrow> summable (\<lambda>n. (- 1) ^ n * a n) \<and> (0 < a 0 \<longrightarrow> (\<forall>n. (\<Sum>i. (- 1) ^ i * a i) \<in> {\<Sum>i<2 * n. (- 1) ^ i * a i..\<Sum>i<2 * n + 1. (- 1) ^ i * a i})) \<and> (a 0 < 0 \<longrightarrow> (\<forall>n. (\<Sum>i. (- 1) ^ i * a i) \<in> {\<Sum>i<2 * n + 1. (- 1) ^ i * a i..\<Sum>i<2 * n. (- 1) ^ i * a i})) \<and> (\<lambda>n. \<Sum>i<2 * n. (- 1) ^ i * a i) \<longlonglongrightarrow> (\<Sum>i. (- 1) ^ i * a i) \<and> (\<lambda>n. \<Sum>i<2 * n + 1. (- 1) ^ i * a i) \<longlonglongrightarrow> (\<Sum>i. (- 1) ^ i * a i)
 2. \<not> ((\<forall>n. 0 \<le> a n) \<and> (\<forall>m n. m \<le> n \<longrightarrow> a n \<le> a m)) \<Longrightarrow> summable (\<lambda>n. (- 1) ^ n * a n) \<and> (0 < a 0 \<longrightarrow> (\<forall>n. (\<Sum>i. (- 1) ^ i * a i) \<in> {\<Sum>i<2 * n. (- 1) ^ i * a i..\<Sum>i<2 * n + 1. (- 1) ^ i * a i})) \<and> (a 0 < 0 \<longrightarrow> (\<forall>n. (\<Sum>i. (- 1) ^ i * a i) \<in> {\<Sum>i<2 * n + 1. (- 1) ^ i * a i..\<Sum>i<2 * n. (- 1) ^ i * a i})) \<and> (\<lambda>n. \<Sum>i<2 * n. (- 1) ^ i * a i) \<longlonglongrightarrow> (\<Sum>i. (- 1) ^ i * a i) \<and> (\<lambda>n. \<Sum>i<2 * n + 1. (- 1) ^ i * a i) \<longlonglongrightarrow> (\<Sum>i. (- 1) ^ i * a i)
[PROOF STEP]
from leibniz[OF mono]
[PROOF STATE]
proof (chain)
picking this:
summable (\<lambda>n. (- 1) ^ n * a n)
(\<Sum>i<2 * ?n. (- 1) ^ i * a i) \<le> (\<Sum>i. (- 1) ^ i * a i)
(\<lambda>n. \<Sum>i<2 * n. (- 1) ^ i * a i) \<longlonglongrightarrow> (\<Sum>i. (- 1) ^ i * a i)
(\<Sum>i. (- 1) ^ i * a i) \<le> (\<Sum>i<2 * ?n + 1. (- 1) ^ i * a i)
(\<lambda>n. \<Sum>i<2 * n + 1. (- 1) ^ i * a i) \<longlonglongrightarrow> (\<Sum>i. (- 1) ^ i * a i)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
summable (\<lambda>n. (- 1) ^ n * a n)
(\<Sum>i<2 * ?n. (- 1) ^ i * a i) \<le> (\<Sum>i. (- 1) ^ i * a i)
(\<lambda>n. \<Sum>i<2 * n. (- 1) ^ i * a i) \<longlonglongrightarrow> (\<Sum>i. (- 1) ^ i * a i)
(\<Sum>i. (- 1) ^ i * a i) \<le> (\<Sum>i<2 * ?n + 1. (- 1) ^ i * a i)
(\<lambda>n. \<Sum>i<2 * n + 1. (- 1) ^ i * a i) \<longlonglongrightarrow> (\<Sum>i. (- 1) ^ i * a i)

goal (1 subgoal):
 1. summable (\<lambda>n. (- 1) ^ n * a n) \<and> (0 < a 0 \<longrightarrow> (\<forall>n. (\<Sum>i. (- 1) ^ i * a i) \<in> {\<Sum>i<2 * n. (- 1) ^ i * a i..\<Sum>i<2 * n + 1. (- 1) ^ i * a i})) \<and> (a 0 < 0 \<longrightarrow> (\<forall>n. (\<Sum>i. (- 1) ^ i * a i) \<in> {\<Sum>i<2 * n + 1. (- 1) ^ i * a i..\<Sum>i<2 * n. (- 1) ^ i * a i})) \<and> (\<lambda>n. \<Sum>i<2 * n. (- 1) ^ i * a i) \<longlonglongrightarrow> (\<Sum>i. (- 1) ^ i * a i) \<and> (\<lambda>n. \<Sum>i<2 * n + 1. (- 1) ^ i * a i) \<longlonglongrightarrow> (\<Sum>i. (- 1) ^ i * a i)
[PROOF STEP]
using \<open>0 \<le> a 0\<close>
[PROOF STATE]
proof (prove)
using this:
summable (\<lambda>n. (- 1) ^ n * a n)
(\<Sum>i<2 * ?n. (- 1) ^ i * a i) \<le> (\<Sum>i. (- 1) ^ i * a i)
(\<lambda>n. \<Sum>i<2 * n. (- 1) ^ i * a i) \<longlonglongrightarrow> (\<Sum>i. (- 1) ^ i * a i)
(\<Sum>i. (- 1) ^ i * a i) \<le> (\<Sum>i<2 * ?n + 1. (- 1) ^ i * a i)
(\<lambda>n. \<Sum>i<2 * n + 1. (- 1) ^ i * a i) \<longlonglongrightarrow> (\<Sum>i. (- 1) ^ i * a i)
0 \<le> a 0

goal (1 subgoal):
 1. summable (\<lambda>n. (- 1) ^ n * a n) \<and> (0 < a 0 \<longrightarrow> (\<forall>n. (\<Sum>i. (- 1) ^ i * a i) \<in> {\<Sum>i<2 * n. (- 1) ^ i * a i..\<Sum>i<2 * n + 1. (- 1) ^ i * a i})) \<and> (a 0 < 0 \<longrightarrow> (\<forall>n. (\<Sum>i. (- 1) ^ i * a i) \<in> {\<Sum>i<2 * n + 1. (- 1) ^ i * a i..\<Sum>i<2 * n. (- 1) ^ i * a i})) \<and> (\<lambda>n. \<Sum>i<2 * n. (- 1) ^ i * a i) \<longlonglongrightarrow> (\<Sum>i. (- 1) ^ i * a i) \<and> (\<lambda>n. \<Sum>i<2 * n + 1. (- 1) ^ i * a i) \<longlonglongrightarrow> (\<Sum>i. (- 1) ^ i * a i)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
summable (\<lambda>n. (- 1) ^ n * a n) \<and> (0 < a 0 \<longrightarrow> (\<forall>n. (\<Sum>i. (- 1) ^ i * a i) \<in> {\<Sum>i<2 * n. (- 1) ^ i * a i..\<Sum>i<2 * n + 1. (- 1) ^ i * a i})) \<and> (a 0 < 0 \<longrightarrow> (\<forall>n. (\<Sum>i. (- 1) ^ i * a i) \<in> {\<Sum>i<2 * n + 1. (- 1) ^ i * a i..\<Sum>i<2 * n. (- 1) ^ i * a i})) \<and> (\<lambda>n. \<Sum>i<2 * n. (- 1) ^ i * a i) \<longlonglongrightarrow> (\<Sum>i. (- 1) ^ i * a i) \<and> (\<lambda>n. \<Sum>i<2 * n + 1. (- 1) ^ i * a i) \<longlonglongrightarrow> (\<Sum>i. (- 1) ^ i * a i)

goal (1 subgoal):
 1. \<not> ((\<forall>n. 0 \<le> a n) \<and> (\<forall>m n. m \<le> n \<longrightarrow> a n \<le> a m)) \<Longrightarrow> summable (\<lambda>n. (- 1) ^ n * a n) \<and> (0 < a 0 \<longrightarrow> (\<forall>n. (\<Sum>i. (- 1) ^ i * a i) \<in> {\<Sum>i<2 * n. (- 1) ^ i * a i..\<Sum>i<2 * n + 1. (- 1) ^ i * a i})) \<and> (a 0 < 0 \<longrightarrow> (\<forall>n. (\<Sum>i. (- 1) ^ i * a i) \<in> {\<Sum>i<2 * n + 1. (- 1) ^ i * a i..\<Sum>i<2 * n. (- 1) ^ i * a i})) \<and> (\<lambda>n. \<Sum>i<2 * n. (- 1) ^ i * a i) \<longlonglongrightarrow> (\<Sum>i. (- 1) ^ i * a i) \<and> (\<lambda>n. \<Sum>i<2 * n + 1. (- 1) ^ i * a i) \<longlonglongrightarrow> (\<Sum>i. (- 1) ^ i * a i)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> ((\<forall>n. 0 \<le> a n) \<and> (\<forall>m n. m \<le> n \<longrightarrow> a n \<le> a m)) \<Longrightarrow> summable (\<lambda>n. (- 1) ^ n * a n) \<and> (0 < a 0 \<longrightarrow> (\<forall>n. (\<Sum>i. (- 1) ^ i * a i) \<in> {\<Sum>i<2 * n. (- 1) ^ i * a i..\<Sum>i<2 * n + 1. (- 1) ^ i * a i})) \<and> (a 0 < 0 \<longrightarrow> (\<forall>n. (\<Sum>i. (- 1) ^ i * a i) \<in> {\<Sum>i<2 * n + 1. (- 1) ^ i * a i..\<Sum>i<2 * n. (- 1) ^ i * a i})) \<and> (\<lambda>n. \<Sum>i<2 * n. (- 1) ^ i * a i) \<longlonglongrightarrow> (\<Sum>i. (- 1) ^ i * a i) \<and> (\<lambda>n. \<Sum>i<2 * n + 1. (- 1) ^ i * a i) \<longlonglongrightarrow> (\<Sum>i. (- 1) ^ i * a i)
[PROOF STEP]
let ?a = "\<lambda>n. - a n"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> ((\<forall>n. 0 \<le> a n) \<and> (\<forall>m n. m \<le> n \<longrightarrow> a n \<le> a m)) \<Longrightarrow> summable (\<lambda>n. (- 1) ^ n * a n) \<and> (0 < a 0 \<longrightarrow> (\<forall>n. (\<Sum>i. (- 1) ^ i * a i) \<in> {\<Sum>i<2 * n. (- 1) ^ i * a i..\<Sum>i<2 * n + 1. (- 1) ^ i * a i})) \<and> (a 0 < 0 \<longrightarrow> (\<forall>n. (\<Sum>i. (- 1) ^ i * a i) \<in> {\<Sum>i<2 * n + 1. (- 1) ^ i * a i..\<Sum>i<2 * n. (- 1) ^ i * a i})) \<and> (\<lambda>n. \<Sum>i<2 * n. (- 1) ^ i * a i) \<longlonglongrightarrow> (\<Sum>i. (- 1) ^ i * a i) \<and> (\<lambda>n. \<Sum>i<2 * n + 1. (- 1) ^ i * a i) \<longlonglongrightarrow> (\<Sum>i. (- 1) ^ i * a i)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> ((\<forall>n. 0 \<le> a n) \<and> (\<forall>m n. m \<le> n \<longrightarrow> a n \<le> a m))

goal (1 subgoal):
 1. \<not> ((\<forall>n. 0 \<le> a n) \<and> (\<forall>m n. m \<le> n \<longrightarrow> a n \<le> a m)) \<Longrightarrow> summable (\<lambda>n. (- 1) ^ n * a n) \<and> (0 < a 0 \<longrightarrow> (\<forall>n. (\<Sum>i. (- 1) ^ i * a i) \<in> {\<Sum>i<2 * n. (- 1) ^ i * a i..\<Sum>i<2 * n + 1. (- 1) ^ i * a i})) \<and> (a 0 < 0 \<longrightarrow> (\<forall>n. (\<Sum>i. (- 1) ^ i * a i) \<in> {\<Sum>i<2 * n + 1. (- 1) ^ i * a i..\<Sum>i<2 * n. (- 1) ^ i * a i})) \<and> (\<lambda>n. \<Sum>i<2 * n. (- 1) ^ i * a i) \<longlonglongrightarrow> (\<Sum>i. (- 1) ^ i * a i) \<and> (\<lambda>n. \<Sum>i<2 * n + 1. (- 1) ^ i * a i) \<longlonglongrightarrow> (\<Sum>i. (- 1) ^ i * a i)
[PROOF STEP]
with monoseq_le[OF \<open>monoseq a\<close> \<open>a \<longlonglongrightarrow> 0\<close>]
[PROOF STATE]
proof (chain)
picking this:
(\<forall>n. a n \<le> 0) \<and> (\<forall>m n. m \<le> n \<longrightarrow> a m \<le> a n) \<or> (\<forall>n. 0 \<le> a n) \<and> (\<forall>m n. m \<le> n \<longrightarrow> a n \<le> a m)
\<not> ((\<forall>n. 0 \<le> a n) \<and> (\<forall>m n. m \<le> n \<longrightarrow> a n \<le> a m))
[PROOF STEP]
have "(\<forall> n. a n \<le> 0) \<and> (\<forall>m. \<forall>n\<ge>m. a m \<le> a n)"
[PROOF STATE]
proof (prove)
using this:
(\<forall>n. a n \<le> 0) \<and> (\<forall>m n. m \<le> n \<longrightarrow> a m \<le> a n) \<or> (\<forall>n. 0 \<le> a n) \<and> (\<forall>m n. m \<le> n \<longrightarrow> a n \<le> a m)
\<not> ((\<forall>n. 0 \<le> a n) \<and> (\<forall>m n. m \<le> n \<longrightarrow> a n \<le> a m))

goal (1 subgoal):
 1. (\<forall>n. a n \<le> 0) \<and> (\<forall>m n. m \<le> n \<longrightarrow> a m \<le> a n)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<forall>n. a n \<le> 0) \<and> (\<forall>m n. m \<le> n \<longrightarrow> a m \<le> a n)

goal (1 subgoal):
 1. \<not> ((\<forall>n. 0 \<le> a n) \<and> (\<forall>m n. m \<le> n \<longrightarrow> a n \<le> a m)) \<Longrightarrow> summable (\<lambda>n. (- 1) ^ n * a n) \<and> (0 < a 0 \<longrightarrow> (\<forall>n. (\<Sum>i. (- 1) ^ i * a i) \<in> {\<Sum>i<2 * n. (- 1) ^ i * a i..\<Sum>i<2 * n + 1. (- 1) ^ i * a i})) \<and> (a 0 < 0 \<longrightarrow> (\<forall>n. (\<Sum>i. (- 1) ^ i * a i) \<in> {\<Sum>i<2 * n + 1. (- 1) ^ i * a i..\<Sum>i<2 * n. (- 1) ^ i * a i})) \<and> (\<lambda>n. \<Sum>i<2 * n. (- 1) ^ i * a i) \<longlonglongrightarrow> (\<Sum>i. (- 1) ^ i * a i) \<and> (\<lambda>n. \<Sum>i<2 * n + 1. (- 1) ^ i * a i) \<longlonglongrightarrow> (\<Sum>i. (- 1) ^ i * a i)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<forall>n. a n \<le> 0) \<and> (\<forall>m n. m \<le> n \<longrightarrow> a m \<le> a n)
[PROOF STEP]
have ord: "\<And>n m. m \<le> n \<Longrightarrow> ?a n \<le> ?a m" and ge0: "\<And> n. 0 \<le> ?a n"
[PROOF STATE]
proof (prove)
using this:
(\<forall>n. a n \<le> 0) \<and> (\<forall>m n. m \<le> n \<longrightarrow> a m \<le> a n)

goal (1 subgoal):
 1. (\<And>n m. m \<le> n \<Longrightarrow> - a n \<le> - a m) &&& (\<And>n. 0 \<le> - a n)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
?m \<le> ?n \<Longrightarrow> - a ?n \<le> - a ?m
0 \<le> - a ?n

goal (1 subgoal):
 1. \<not> ((\<forall>n. 0 \<le> a n) \<and> (\<forall>m n. m \<le> n \<longrightarrow> a n \<le> a m)) \<Longrightarrow> summable (\<lambda>n. (- 1) ^ n * a n) \<and> (0 < a 0 \<longrightarrow> (\<forall>n. (\<Sum>i. (- 1) ^ i * a i) \<in> {\<Sum>i<2 * n. (- 1) ^ i * a i..\<Sum>i<2 * n + 1. (- 1) ^ i * a i})) \<and> (a 0 < 0 \<longrightarrow> (\<forall>n. (\<Sum>i. (- 1) ^ i * a i) \<in> {\<Sum>i<2 * n + 1. (- 1) ^ i * a i..\<Sum>i<2 * n. (- 1) ^ i * a i})) \<and> (\<lambda>n. \<Sum>i<2 * n. (- 1) ^ i * a i) \<longlonglongrightarrow> (\<Sum>i. (- 1) ^ i * a i) \<and> (\<lambda>n. \<Sum>i<2 * n + 1. (- 1) ^ i * a i) \<longlonglongrightarrow> (\<Sum>i. (- 1) ^ i * a i)
[PROOF STEP]
have monotone: "?a (Suc n) \<le> ?a n" for n
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - a (Suc n) \<le> - a n
[PROOF STEP]
using ord[where n="Suc n" and m=n]
[PROOF STATE]
proof (prove)
using this:
n \<le> Suc n \<Longrightarrow> - a (Suc n) \<le> - a n

goal (1 subgoal):
 1. - a (Suc n) \<le> - a n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
- a (Suc ?n) \<le> - a ?n

goal (1 subgoal):
 1. \<not> ((\<forall>n. 0 \<le> a n) \<and> (\<forall>m n. m \<le> n \<longrightarrow> a n \<le> a m)) \<Longrightarrow> summable (\<lambda>n. (- 1) ^ n * a n) \<and> (0 < a 0 \<longrightarrow> (\<forall>n. (\<Sum>i. (- 1) ^ i * a i) \<in> {\<Sum>i<2 * n. (- 1) ^ i * a i..\<Sum>i<2 * n + 1. (- 1) ^ i * a i})) \<and> (a 0 < 0 \<longrightarrow> (\<forall>n. (\<Sum>i. (- 1) ^ i * a i) \<in> {\<Sum>i<2 * n + 1. (- 1) ^ i * a i..\<Sum>i<2 * n. (- 1) ^ i * a i})) \<and> (\<lambda>n. \<Sum>i<2 * n. (- 1) ^ i * a i) \<longlonglongrightarrow> (\<Sum>i. (- 1) ^ i * a i) \<and> (\<lambda>n. \<Sum>i<2 * n + 1. (- 1) ^ i * a i) \<longlonglongrightarrow> (\<Sum>i. (- 1) ^ i * a i)
[PROOF STEP]
note leibniz =
      summable_Leibniz'[OF _ ge0, of "\<lambda>x. x",
        OF tendsto_minus[OF \<open>a \<longlonglongrightarrow> 0\<close>, unfolded minus_zero] monotone]
[PROOF STATE]
proof (state)
this:
summable (\<lambda>n. (- 1) ^ n * - a n)
(\<Sum>i<2 * ?n. (- 1) ^ i * - a i) \<le> (\<Sum>i. (- 1) ^ i * - a i)
(\<lambda>n. \<Sum>i<2 * n. (- 1) ^ i * - a i) \<longlonglongrightarrow> (\<Sum>i. (- 1) ^ i * - a i)
(\<Sum>i. (- 1) ^ i * - a i) \<le> (\<Sum>i<2 * ?n + 1. (- 1) ^ i * - a i)
(\<lambda>n. \<Sum>i<2 * n + 1. (- 1) ^ i * - a i) \<longlonglongrightarrow> (\<Sum>i. (- 1) ^ i * - a i)

goal (1 subgoal):
 1. \<not> ((\<forall>n. 0 \<le> a n) \<and> (\<forall>m n. m \<le> n \<longrightarrow> a n \<le> a m)) \<Longrightarrow> summable (\<lambda>n. (- 1) ^ n * a n) \<and> (0 < a 0 \<longrightarrow> (\<forall>n. (\<Sum>i. (- 1) ^ i * a i) \<in> {\<Sum>i<2 * n. (- 1) ^ i * a i..\<Sum>i<2 * n + 1. (- 1) ^ i * a i})) \<and> (a 0 < 0 \<longrightarrow> (\<forall>n. (\<Sum>i. (- 1) ^ i * a i) \<in> {\<Sum>i<2 * n + 1. (- 1) ^ i * a i..\<Sum>i<2 * n. (- 1) ^ i * a i})) \<and> (\<lambda>n. \<Sum>i<2 * n. (- 1) ^ i * a i) \<longlonglongrightarrow> (\<Sum>i. (- 1) ^ i * a i) \<and> (\<lambda>n. \<Sum>i<2 * n + 1. (- 1) ^ i * a i) \<longlonglongrightarrow> (\<Sum>i. (- 1) ^ i * a i)
[PROOF STEP]
have "summable (\<lambda> n. (-1)^n * ?a n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. summable (\<lambda>n. (- 1) ^ n * - a n)
[PROOF STEP]
using leibniz(1)
[PROOF STATE]
proof (prove)
using this:
summable (\<lambda>n. (- 1) ^ n * - a n)

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

goal (1 subgoal):
 1. \<not> ((\<forall>n. 0 \<le> a n) \<and> (\<forall>m n. m \<le> n \<longrightarrow> a n \<le> a m)) \<Longrightarrow> summable (\<lambda>n. (- 1) ^ n * a n) \<and> (0 < a 0 \<longrightarrow> (\<forall>n. (\<Sum>i. (- 1) ^ i * a i) \<in> {\<Sum>i<2 * n. (- 1) ^ i * a i..\<Sum>i<2 * n + 1. (- 1) ^ i * a i})) \<and> (a 0 < 0 \<longrightarrow> (\<forall>n. (\<Sum>i. (- 1) ^ i * a i) \<in> {\<Sum>i<2 * n + 1. (- 1) ^ i * a i..\<Sum>i<2 * n. (- 1) ^ i * a i})) \<and> (\<lambda>n. \<Sum>i<2 * n. (- 1) ^ i * a i) \<longlonglongrightarrow> (\<Sum>i. (- 1) ^ i * a i) \<and> (\<lambda>n. \<Sum>i<2 * n + 1. (- 1) ^ i * a i) \<longlonglongrightarrow> (\<Sum>i. (- 1) ^ i * a i)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
summable (\<lambda>n. (- 1) ^ n * - a n)
[PROOF STEP]
obtain l where "(\<lambda> n. (-1)^n * ?a n) sums l"
[PROOF STATE]
proof (prove)
using this:
summable (\<lambda>n. (- 1) ^ n * - a n)

goal (1 subgoal):
 1. (\<And>l. (\<lambda>n. (- 1) ^ n * - a n) sums l \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding summable_def
[PROOF STATE]
proof (prove)
using this:
Ex ((sums) (\<lambda>n. (- 1) ^ n * - a n))

goal (1 subgoal):
 1. (\<And>l. (\<lambda>n. (- 1) ^ n * - a n) sums l \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<lambda>n. (- 1) ^ n * - a n) sums l

goal (1 subgoal):
 1. \<not> ((\<forall>n. 0 \<le> a n) \<and> (\<forall>m n. m \<le> n \<longrightarrow> a n \<le> a m)) \<Longrightarrow> summable (\<lambda>n. (- 1) ^ n * a n) \<and> (0 < a 0 \<longrightarrow> (\<forall>n. (\<Sum>i. (- 1) ^ i * a i) \<in> {\<Sum>i<2 * n. (- 1) ^ i * a i..\<Sum>i<2 * n + 1. (- 1) ^ i * a i})) \<and> (a 0 < 0 \<longrightarrow> (\<forall>n. (\<Sum>i. (- 1) ^ i * a i) \<in> {\<Sum>i<2 * n + 1. (- 1) ^ i * a i..\<Sum>i<2 * n. (- 1) ^ i * a i})) \<and> (\<lambda>n. \<Sum>i<2 * n. (- 1) ^ i * a i) \<longlonglongrightarrow> (\<Sum>i. (- 1) ^ i * a i) \<and> (\<lambda>n. \<Sum>i<2 * n + 1. (- 1) ^ i * a i) \<longlonglongrightarrow> (\<Sum>i. (- 1) ^ i * a i)
[PROOF STEP]
from this[THEN sums_minus]
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>n. - ((- 1) ^ n * - a n)) sums - l
[PROOF STEP]
have "(\<lambda> n. (-1)^n * a n) sums -l"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. - ((- 1) ^ n * - a n)) sums - l

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

goal (1 subgoal):
 1. \<not> ((\<forall>n. 0 \<le> a n) \<and> (\<forall>m n. m \<le> n \<longrightarrow> a n \<le> a m)) \<Longrightarrow> summable (\<lambda>n. (- 1) ^ n * a n) \<and> (0 < a 0 \<longrightarrow> (\<forall>n. (\<Sum>i. (- 1) ^ i * a i) \<in> {\<Sum>i<2 * n. (- 1) ^ i * a i..\<Sum>i<2 * n + 1. (- 1) ^ i * a i})) \<and> (a 0 < 0 \<longrightarrow> (\<forall>n. (\<Sum>i. (- 1) ^ i * a i) \<in> {\<Sum>i<2 * n + 1. (- 1) ^ i * a i..\<Sum>i<2 * n. (- 1) ^ i * a i})) \<and> (\<lambda>n. \<Sum>i<2 * n. (- 1) ^ i * a i) \<longlonglongrightarrow> (\<Sum>i. (- 1) ^ i * a i) \<and> (\<lambda>n. \<Sum>i<2 * n + 1. (- 1) ^ i * a i) \<longlonglongrightarrow> (\<Sum>i. (- 1) ^ i * a i)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>n. (- 1) ^ n * a n) sums - l
[PROOF STEP]
have ?summable
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. (- 1) ^ n * a n) sums - l

goal (1 subgoal):
 1. summable (\<lambda>n. (- 1) ^ n * a n)
[PROOF STEP]
by (auto simp: summable_def)
[PROOF STATE]
proof (state)
this:
summable (\<lambda>n. (- 1) ^ n * a n)

goal (1 subgoal):
 1. \<not> ((\<forall>n. 0 \<le> a n) \<and> (\<forall>m n. m \<le> n \<longrightarrow> a n \<le> a m)) \<Longrightarrow> summable (\<lambda>n. (- 1) ^ n * a n) \<and> (0 < a 0 \<longrightarrow> (\<forall>n. (\<Sum>i. (- 1) ^ i * a i) \<in> {\<Sum>i<2 * n. (- 1) ^ i * a i..\<Sum>i<2 * n + 1. (- 1) ^ i * a i})) \<and> (a 0 < 0 \<longrightarrow> (\<forall>n. (\<Sum>i. (- 1) ^ i * a i) \<in> {\<Sum>i<2 * n + 1. (- 1) ^ i * a i..\<Sum>i<2 * n. (- 1) ^ i * a i})) \<and> (\<lambda>n. \<Sum>i<2 * n. (- 1) ^ i * a i) \<longlonglongrightarrow> (\<Sum>i. (- 1) ^ i * a i) \<and> (\<lambda>n. \<Sum>i<2 * n + 1. (- 1) ^ i * a i) \<longlonglongrightarrow> (\<Sum>i. (- 1) ^ i * a i)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
summable (\<lambda>n. (- 1) ^ n * a n)

goal (1 subgoal):
 1. \<not> ((\<forall>n. 0 \<le> a n) \<and> (\<forall>m n. m \<le> n \<longrightarrow> a n \<le> a m)) \<Longrightarrow> summable (\<lambda>n. (- 1) ^ n * a n) \<and> (0 < a 0 \<longrightarrow> (\<forall>n. (\<Sum>i. (- 1) ^ i * a i) \<in> {\<Sum>i<2 * n. (- 1) ^ i * a i..\<Sum>i<2 * n + 1. (- 1) ^ i * a i})) \<and> (a 0 < 0 \<longrightarrow> (\<forall>n. (\<Sum>i. (- 1) ^ i * a i) \<in> {\<Sum>i<2 * n + 1. (- 1) ^ i * a i..\<Sum>i<2 * n. (- 1) ^ i * a i})) \<and> (\<lambda>n. \<Sum>i<2 * n. (- 1) ^ i * a i) \<longlonglongrightarrow> (\<Sum>i. (- 1) ^ i * a i) \<and> (\<lambda>n. \<Sum>i<2 * n + 1. (- 1) ^ i * a i) \<longlonglongrightarrow> (\<Sum>i. (- 1) ^ i * a i)
[PROOF STEP]
have "\<bar>- a - - b\<bar> = \<bar>a - b\<bar>" for a b :: real
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>- a - - b\<bar> = \<bar>a - b\<bar>
[PROOF STEP]
unfolding minus_diff_minus
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>- (a - b)\<bar> = \<bar>a - b\<bar>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<bar>- ?a - - ?b\<bar> = \<bar>?a - ?b\<bar>

goal (1 subgoal):
 1. \<not> ((\<forall>n. 0 \<le> a n) \<and> (\<forall>m n. m \<le> n \<longrightarrow> a n \<le> a m)) \<Longrightarrow> summable (\<lambda>n. (- 1) ^ n * a n) \<and> (0 < a 0 \<longrightarrow> (\<forall>n. (\<Sum>i. (- 1) ^ i * a i) \<in> {\<Sum>i<2 * n. (- 1) ^ i * a i..\<Sum>i<2 * n + 1. (- 1) ^ i * a i})) \<and> (a 0 < 0 \<longrightarrow> (\<forall>n. (\<Sum>i. (- 1) ^ i * a i) \<in> {\<Sum>i<2 * n + 1. (- 1) ^ i * a i..\<Sum>i<2 * n. (- 1) ^ i * a i})) \<and> (\<lambda>n. \<Sum>i<2 * n. (- 1) ^ i * a i) \<longlonglongrightarrow> (\<Sum>i. (- 1) ^ i * a i) \<and> (\<lambda>n. \<Sum>i<2 * n + 1. (- 1) ^ i * a i) \<longlonglongrightarrow> (\<Sum>i. (- 1) ^ i * a i)
[PROOF STEP]
from suminf_minus[OF leibniz(1), unfolded mult_minus_right minus_minus]
[PROOF STATE]
proof (chain)
picking this:
(\<Sum>n. (- 1) ^ n * a n) = - (\<Sum>n. - ((- 1) ^ n * a n))
[PROOF STEP]
have move_minus: "(\<Sum>n. - ((- 1) ^ n * a n)) = - (\<Sum>n. (- 1) ^ n * a n)"
[PROOF STATE]
proof (prove)
using this:
(\<Sum>n. (- 1) ^ n * a n) = - (\<Sum>n. - ((- 1) ^ n * a n))

goal (1 subgoal):
 1. (\<Sum>n. - ((- 1) ^ n * a n)) = - (\<Sum>n. (- 1) ^ n * a n)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<Sum>n. - ((- 1) ^ n * a n)) = - (\<Sum>n. (- 1) ^ n * a n)

goal (1 subgoal):
 1. \<not> ((\<forall>n. 0 \<le> a n) \<and> (\<forall>m n. m \<le> n \<longrightarrow> a n \<le> a m)) \<Longrightarrow> summable (\<lambda>n. (- 1) ^ n * a n) \<and> (0 < a 0 \<longrightarrow> (\<forall>n. (\<Sum>i. (- 1) ^ i * a i) \<in> {\<Sum>i<2 * n. (- 1) ^ i * a i..\<Sum>i<2 * n + 1. (- 1) ^ i * a i})) \<and> (a 0 < 0 \<longrightarrow> (\<forall>n. (\<Sum>i. (- 1) ^ i * a i) \<in> {\<Sum>i<2 * n + 1. (- 1) ^ i * a i..\<Sum>i<2 * n. (- 1) ^ i * a i})) \<and> (\<lambda>n. \<Sum>i<2 * n. (- 1) ^ i * a i) \<longlonglongrightarrow> (\<Sum>i. (- 1) ^ i * a i) \<and> (\<lambda>n. \<Sum>i<2 * n + 1. (- 1) ^ i * a i) \<longlonglongrightarrow> (\<Sum>i. (- 1) ^ i * a i)
[PROOF STEP]
have ?pos
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < a 0 \<longrightarrow> (\<forall>n. (\<Sum>i. (- 1) ^ i * a i) \<in> {\<Sum>i<2 * n. (- 1) ^ i * a i..\<Sum>i<2 * n + 1. (- 1) ^ i * a i})
[PROOF STEP]
using \<open>0 \<le> ?a 0\<close>
[PROOF STATE]
proof (prove)
using this:
0 \<le> - a 0

goal (1 subgoal):
 1. 0 < a 0 \<longrightarrow> (\<forall>n. (\<Sum>i. (- 1) ^ i * a i) \<in> {\<Sum>i<2 * n. (- 1) ^ i * a i..\<Sum>i<2 * n + 1. (- 1) ^ i * a i})
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 < a 0 \<longrightarrow> (\<forall>n. (\<Sum>i. (- 1) ^ i * a i) \<in> {\<Sum>i<2 * n. (- 1) ^ i * a i..\<Sum>i<2 * n + 1. (- 1) ^ i * a i})

goal (1 subgoal):
 1. \<not> ((\<forall>n. 0 \<le> a n) \<and> (\<forall>m n. m \<le> n \<longrightarrow> a n \<le> a m)) \<Longrightarrow> summable (\<lambda>n. (- 1) ^ n * a n) \<and> (0 < a 0 \<longrightarrow> (\<forall>n. (\<Sum>i. (- 1) ^ i * a i) \<in> {\<Sum>i<2 * n. (- 1) ^ i * a i..\<Sum>i<2 * n + 1. (- 1) ^ i * a i})) \<and> (a 0 < 0 \<longrightarrow> (\<forall>n. (\<Sum>i. (- 1) ^ i * a i) \<in> {\<Sum>i<2 * n + 1. (- 1) ^ i * a i..\<Sum>i<2 * n. (- 1) ^ i * a i})) \<and> (\<lambda>n. \<Sum>i<2 * n. (- 1) ^ i * a i) \<longlonglongrightarrow> (\<Sum>i. (- 1) ^ i * a i) \<and> (\<lambda>n. \<Sum>i<2 * n + 1. (- 1) ^ i * a i) \<longlonglongrightarrow> (\<Sum>i. (- 1) ^ i * a i)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
0 < a 0 \<longrightarrow> (\<forall>n. (\<Sum>i. (- 1) ^ i * a i) \<in> {\<Sum>i<2 * n. (- 1) ^ i * a i..\<Sum>i<2 * n + 1. (- 1) ^ i * a i})

goal (1 subgoal):
 1. \<not> ((\<forall>n. 0 \<le> a n) \<and> (\<forall>m n. m \<le> n \<longrightarrow> a n \<le> a m)) \<Longrightarrow> summable (\<lambda>n. (- 1) ^ n * a n) \<and> (0 < a 0 \<longrightarrow> (\<forall>n. (\<Sum>i. (- 1) ^ i * a i) \<in> {\<Sum>i<2 * n. (- 1) ^ i * a i..\<Sum>i<2 * n + 1. (- 1) ^ i * a i})) \<and> (a 0 < 0 \<longrightarrow> (\<forall>n. (\<Sum>i. (- 1) ^ i * a i) \<in> {\<Sum>i<2 * n + 1. (- 1) ^ i * a i..\<Sum>i<2 * n. (- 1) ^ i * a i})) \<and> (\<lambda>n. \<Sum>i<2 * n. (- 1) ^ i * a i) \<longlonglongrightarrow> (\<Sum>i. (- 1) ^ i * a i) \<and> (\<lambda>n. \<Sum>i<2 * n + 1. (- 1) ^ i * a i) \<longlonglongrightarrow> (\<Sum>i. (- 1) ^ i * a i)
[PROOF STEP]
have ?neg
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a 0 < 0 \<longrightarrow> (\<forall>n. (\<Sum>i. (- 1) ^ i * a i) \<in> {\<Sum>i<2 * n + 1. (- 1) ^ i * a i..\<Sum>i<2 * n. (- 1) ^ i * a i})
[PROOF STEP]
using leibniz(2,4)
[PROOF STATE]
proof (prove)
using this:
(\<Sum>i<2 * ?n. (- 1) ^ i * - a i) \<le> (\<Sum>i. (- 1) ^ i * - a i)
(\<Sum>i. (- 1) ^ i * - a i) \<le> (\<Sum>i<2 * ?n + 1. (- 1) ^ i * - a i)

goal (1 subgoal):
 1. a 0 < 0 \<longrightarrow> (\<forall>n. (\<Sum>i. (- 1) ^ i * a i) \<in> {\<Sum>i<2 * n + 1. (- 1) ^ i * a i..\<Sum>i<2 * n. (- 1) ^ i * a i})
[PROOF STEP]
unfolding mult_minus_right sum_negf move_minus neg_le_iff_le
[PROOF STATE]
proof (prove)
using this:
(\<Sum>i. (- 1) ^ i * a i) \<le> (\<Sum>i<2 * ?n. (- 1) ^ i * a i)
(\<Sum>i<2 * ?n + 1. (- 1) ^ i * a i) \<le> (\<Sum>i. (- 1) ^ i * a i)

goal (1 subgoal):
 1. a 0 < 0 \<longrightarrow> (\<forall>n. (\<Sum>i. (- 1) ^ i * a i) \<in> {\<Sum>i<2 * n + 1. (- 1) ^ i * a i..\<Sum>i<2 * n. (- 1) ^ i * a i})
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
a 0 < 0 \<longrightarrow> (\<forall>n. (\<Sum>i. (- 1) ^ i * a i) \<in> {\<Sum>i<2 * n + 1. (- 1) ^ i * a i..\<Sum>i<2 * n. (- 1) ^ i * a i})

goal (1 subgoal):
 1. \<not> ((\<forall>n. 0 \<le> a n) \<and> (\<forall>m n. m \<le> n \<longrightarrow> a n \<le> a m)) \<Longrightarrow> summable (\<lambda>n. (- 1) ^ n * a n) \<and> (0 < a 0 \<longrightarrow> (\<forall>n. (\<Sum>i. (- 1) ^ i * a i) \<in> {\<Sum>i<2 * n. (- 1) ^ i * a i..\<Sum>i<2 * n + 1. (- 1) ^ i * a i})) \<and> (a 0 < 0 \<longrightarrow> (\<forall>n. (\<Sum>i. (- 1) ^ i * a i) \<in> {\<Sum>i<2 * n + 1. (- 1) ^ i * a i..\<Sum>i<2 * n. (- 1) ^ i * a i})) \<and> (\<lambda>n. \<Sum>i<2 * n. (- 1) ^ i * a i) \<longlonglongrightarrow> (\<Sum>i. (- 1) ^ i * a i) \<and> (\<lambda>n. \<Sum>i<2 * n + 1. (- 1) ^ i * a i) \<longlonglongrightarrow> (\<Sum>i. (- 1) ^ i * a i)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
a 0 < 0 \<longrightarrow> (\<forall>n. (\<Sum>i. (- 1) ^ i * a i) \<in> {\<Sum>i<2 * n + 1. (- 1) ^ i * a i..\<Sum>i<2 * n. (- 1) ^ i * a i})

goal (1 subgoal):
 1. \<not> ((\<forall>n. 0 \<le> a n) \<and> (\<forall>m n. m \<le> n \<longrightarrow> a n \<le> a m)) \<Longrightarrow> summable (\<lambda>n. (- 1) ^ n * a n) \<and> (0 < a 0 \<longrightarrow> (\<forall>n. (\<Sum>i. (- 1) ^ i * a i) \<in> {\<Sum>i<2 * n. (- 1) ^ i * a i..\<Sum>i<2 * n + 1. (- 1) ^ i * a i})) \<and> (a 0 < 0 \<longrightarrow> (\<forall>n. (\<Sum>i. (- 1) ^ i * a i) \<in> {\<Sum>i<2 * n + 1. (- 1) ^ i * a i..\<Sum>i<2 * n. (- 1) ^ i * a i})) \<and> (\<lambda>n. \<Sum>i<2 * n. (- 1) ^ i * a i) \<longlonglongrightarrow> (\<Sum>i. (- 1) ^ i * a i) \<and> (\<lambda>n. \<Sum>i<2 * n + 1. (- 1) ^ i * a i) \<longlonglongrightarrow> (\<Sum>i. (- 1) ^ i * a i)
[PROOF STEP]
have ?f and ?g
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. \<Sum>i<2 * n. (- 1) ^ i * a i) \<longlonglongrightarrow> (\<Sum>i. (- 1) ^ i * a i) &&& (\<lambda>n. \<Sum>i<2 * n + 1. (- 1) ^ i * a i) \<longlonglongrightarrow> (\<Sum>i. (- 1) ^ i * a i)
[PROOF STEP]
using leibniz(3,5)[unfolded mult_minus_right sum_negf move_minus, THEN tendsto_minus_cancel]
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. \<Sum>i<2 * n. (- 1) ^ i * a i) \<longlonglongrightarrow> (\<Sum>i. (- 1) ^ i * a i)
(\<lambda>n. \<Sum>i<2 * n + 1. (- 1) ^ i * a i) \<longlonglongrightarrow> (\<Sum>i. (- 1) ^ i * a i)

goal (1 subgoal):
 1. (\<lambda>n. \<Sum>i<2 * n. (- 1) ^ i * a i) \<longlonglongrightarrow> (\<Sum>i. (- 1) ^ i * a i) &&& (\<lambda>n. \<Sum>i<2 * n + 1. (- 1) ^ i * a i) \<longlonglongrightarrow> (\<Sum>i. (- 1) ^ i * a i)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<lambda>n. \<Sum>i<2 * n. (- 1) ^ i * a i) \<longlonglongrightarrow> (\<Sum>i. (- 1) ^ i * a i)
(\<lambda>n. \<Sum>i<2 * n + 1. (- 1) ^ i * a i) \<longlonglongrightarrow> (\<Sum>i. (- 1) ^ i * a i)

goal (1 subgoal):
 1. \<not> ((\<forall>n. 0 \<le> a n) \<and> (\<forall>m n. m \<le> n \<longrightarrow> a n \<le> a m)) \<Longrightarrow> summable (\<lambda>n. (- 1) ^ n * a n) \<and> (0 < a 0 \<longrightarrow> (\<forall>n. (\<Sum>i. (- 1) ^ i * a i) \<in> {\<Sum>i<2 * n. (- 1) ^ i * a i..\<Sum>i<2 * n + 1. (- 1) ^ i * a i})) \<and> (a 0 < 0 \<longrightarrow> (\<forall>n. (\<Sum>i. (- 1) ^ i * a i) \<in> {\<Sum>i<2 * n + 1. (- 1) ^ i * a i..\<Sum>i<2 * n. (- 1) ^ i * a i})) \<and> (\<lambda>n. \<Sum>i<2 * n. (- 1) ^ i * a i) \<longlonglongrightarrow> (\<Sum>i. (- 1) ^ i * a i) \<and> (\<lambda>n. \<Sum>i<2 * n + 1. (- 1) ^ i * a i) \<longlonglongrightarrow> (\<Sum>i. (- 1) ^ i * a i)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
summable (\<lambda>n. (- 1) ^ n * a n)
0 < a 0 \<longrightarrow> (\<forall>n. (\<Sum>i. (- 1) ^ i * a i) \<in> {\<Sum>i<2 * n. (- 1) ^ i * a i..\<Sum>i<2 * n + 1. (- 1) ^ i * a i})
a 0 < 0 \<longrightarrow> (\<forall>n. (\<Sum>i. (- 1) ^ i * a i) \<in> {\<Sum>i<2 * n + 1. (- 1) ^ i * a i..\<Sum>i<2 * n. (- 1) ^ i * a i})
(\<lambda>n. \<Sum>i<2 * n. (- 1) ^ i * a i) \<longlonglongrightarrow> (\<Sum>i. (- 1) ^ i * a i)
(\<lambda>n. \<Sum>i<2 * n + 1. (- 1) ^ i * a i) \<longlonglongrightarrow> (\<Sum>i. (- 1) ^ i * a i)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
summable (\<lambda>n. (- 1) ^ n * a n)
0 < a 0 \<longrightarrow> (\<forall>n. (\<Sum>i. (- 1) ^ i * a i) \<in> {\<Sum>i<2 * n. (- 1) ^ i * a i..\<Sum>i<2 * n + 1. (- 1) ^ i * a i})
a 0 < 0 \<longrightarrow> (\<forall>n. (\<Sum>i. (- 1) ^ i * a i) \<in> {\<Sum>i<2 * n + 1. (- 1) ^ i * a i..\<Sum>i<2 * n. (- 1) ^ i * a i})
(\<lambda>n. \<Sum>i<2 * n. (- 1) ^ i * a i) \<longlonglongrightarrow> (\<Sum>i. (- 1) ^ i * a i)
(\<lambda>n. \<Sum>i<2 * n + 1. (- 1) ^ i * a i) \<longlonglongrightarrow> (\<Sum>i. (- 1) ^ i * a i)

goal (1 subgoal):
 1. summable (\<lambda>n. (- 1) ^ n * a n) \<and> (0 < a 0 \<longrightarrow> (\<forall>n. (\<Sum>i. (- 1) ^ i * a i) \<in> {\<Sum>i<2 * n. (- 1) ^ i * a i..\<Sum>i<2 * n + 1. (- 1) ^ i * a i})) \<and> (a 0 < 0 \<longrightarrow> (\<forall>n. (\<Sum>i. (- 1) ^ i * a i) \<in> {\<Sum>i<2 * n + 1. (- 1) ^ i * a i..\<Sum>i<2 * n. (- 1) ^ i * a i})) \<and> (\<lambda>n. \<Sum>i<2 * n. (- 1) ^ i * a i) \<longlonglongrightarrow> (\<Sum>i. (- 1) ^ i * a i) \<and> (\<lambda>n. \<Sum>i<2 * n + 1. (- 1) ^ i * a i) \<longlonglongrightarrow> (\<Sum>i. (- 1) ^ i * a i)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
summable (\<lambda>n. (- 1) ^ n * a n) \<and> (0 < a 0 \<longrightarrow> (\<forall>n. (\<Sum>i. (- 1) ^ i * a i) \<in> {\<Sum>i<2 * n. (- 1) ^ i * a i..\<Sum>i<2 * n + 1. (- 1) ^ i * a i})) \<and> (a 0 < 0 \<longrightarrow> (\<forall>n. (\<Sum>i. (- 1) ^ i * a i) \<in> {\<Sum>i<2 * n + 1. (- 1) ^ i * a i..\<Sum>i<2 * n. (- 1) ^ i * a i})) \<and> (\<lambda>n. \<Sum>i<2 * n. (- 1) ^ i * a i) \<longlonglongrightarrow> (\<Sum>i. (- 1) ^ i * a i) \<and> (\<lambda>n. \<Sum>i<2 * n + 1. (- 1) ^ i * a i) \<longlonglongrightarrow> (\<Sum>i. (- 1) ^ i * a i)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
summable (\<lambda>n. (- 1) ^ n * a n) \<and> (0 < a 0 \<longrightarrow> (\<forall>n. (\<Sum>i. (- 1) ^ i * a i) \<in> {\<Sum>i<2 * n. (- 1) ^ i * a i..\<Sum>i<2 * n + 1. (- 1) ^ i * a i})) \<and> (a 0 < 0 \<longrightarrow> (\<forall>n. (\<Sum>i. (- 1) ^ i * a i) \<in> {\<Sum>i<2 * n + 1. (- 1) ^ i * a i..\<Sum>i<2 * n. (- 1) ^ i * a i})) \<and> (\<lambda>n. \<Sum>i<2 * n. (- 1) ^ i * a i) \<longlonglongrightarrow> (\<Sum>i. (- 1) ^ i * a i) \<and> (\<lambda>n. \<Sum>i<2 * n + 1. (- 1) ^ i * a i) \<longlonglongrightarrow> (\<Sum>i. (- 1) ^ i * a i)

goal (5 subgoals):
 1. summable (\<lambda>n. (- 1) ^ n * a n)
 2. 0 < a 0 \<longrightarrow> (\<forall>n. (\<Sum>i. (- 1) ^ i * a i) \<in> {\<Sum>i<2 * n. (- 1) ^ i * a i..\<Sum>i<2 * n + 1. (- 1) ^ i * a i})
 3. a 0 < 0 \<longrightarrow> (\<forall>n. (\<Sum>i. (- 1) ^ i * a i) \<in> {\<Sum>i<2 * n + 1. (- 1) ^ i * a i..\<Sum>i<2 * n. (- 1) ^ i * a i})
 4. (\<lambda>n. \<Sum>i<2 * n. (- 1) ^ i * a i) \<longlonglongrightarrow> (\<Sum>i. (- 1) ^ i * a i)
 5. (\<lambda>n. \<Sum>i<2 * n + 1. (- 1) ^ i * a i) \<longlonglongrightarrow> (\<Sum>i. (- 1) ^ i * a i)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
summable (\<lambda>n. (- 1) ^ n * a n) \<and> (0 < a 0 \<longrightarrow> (\<forall>n. (\<Sum>i. (- 1) ^ i * a i) \<in> {\<Sum>i<2 * n. (- 1) ^ i * a i..\<Sum>i<2 * n + 1. (- 1) ^ i * a i})) \<and> (a 0 < 0 \<longrightarrow> (\<forall>n. (\<Sum>i. (- 1) ^ i * a i) \<in> {\<Sum>i<2 * n + 1. (- 1) ^ i * a i..\<Sum>i<2 * n. (- 1) ^ i * a i})) \<and> (\<lambda>n. \<Sum>i<2 * n. (- 1) ^ i * a i) \<longlonglongrightarrow> (\<Sum>i. (- 1) ^ i * a i) \<and> (\<lambda>n. \<Sum>i<2 * n + 1. (- 1) ^ i * a i) \<longlonglongrightarrow> (\<Sum>i. (- 1) ^ i * a i)
[PROOF STEP]
show ?summable and ?pos and ?neg and ?f and ?g
[PROOF STATE]
proof (prove)
using this:
summable (\<lambda>n. (- 1) ^ n * a n) \<and> (0 < a 0 \<longrightarrow> (\<forall>n. (\<Sum>i. (- 1) ^ i * a i) \<in> {\<Sum>i<2 * n. (- 1) ^ i * a i..\<Sum>i<2 * n + 1. (- 1) ^ i * a i})) \<and> (a 0 < 0 \<longrightarrow> (\<forall>n. (\<Sum>i. (- 1) ^ i * a i) \<in> {\<Sum>i<2 * n + 1. (- 1) ^ i * a i..\<Sum>i<2 * n. (- 1) ^ i * a i})) \<and> (\<lambda>n. \<Sum>i<2 * n. (- 1) ^ i * a i) \<longlonglongrightarrow> (\<Sum>i. (- 1) ^ i * a i) \<and> (\<lambda>n. \<Sum>i<2 * n + 1. (- 1) ^ i * a i) \<longlonglongrightarrow> (\<Sum>i. (- 1) ^ i * a i)

goal (1 subgoal):
 1. (summable (\<lambda>n. (- 1) ^ n * a n) &&& 0 < a 0 \<longrightarrow> (\<forall>n. (\<Sum>i. (- 1) ^ i * a i) \<in> {\<Sum>i<2 * n. (- 1) ^ i * a i..\<Sum>i<2 * n + 1. (- 1) ^ i * a i})) &&& a 0 < 0 \<longrightarrow> (\<forall>n. (\<Sum>i. (- 1) ^ i * a i) \<in> {\<Sum>i<2 * n + 1. (- 1) ^ i * a i..\<Sum>i<2 * n. (- 1) ^ i * a i}) &&& (\<lambda>n. \<Sum>i<2 * n. (- 1) ^ i * a i) \<longlonglongrightarrow> (\<Sum>i. (- 1) ^ i * a i) &&& (\<lambda>n. \<Sum>i<2 * n + 1. (- 1) ^ i * a i) \<longlonglongrightarrow> (\<Sum>i. (- 1) ^ i * a i)
[PROOF STEP]
by safe
[PROOF STATE]
proof (state)
this:
summable (\<lambda>n. (- 1) ^ n * a n)
0 < a 0 \<longrightarrow> (\<forall>n. (\<Sum>i. (- 1) ^ i * a i) \<in> {\<Sum>i<2 * n. (- 1) ^ i * a i..\<Sum>i<2 * n + 1. (- 1) ^ i * a i})
a 0 < 0 \<longrightarrow> (\<forall>n. (\<Sum>i. (- 1) ^ i * a i) \<in> {\<Sum>i<2 * n + 1. (- 1) ^ i * a i..\<Sum>i<2 * n. (- 1) ^ i * a i})
(\<lambda>n. \<Sum>i<2 * n. (- 1) ^ i * a i) \<longlonglongrightarrow> (\<Sum>i. (- 1) ^ i * a i)
(\<lambda>n. \<Sum>i<2 * n + 1. (- 1) ^ i * a i) \<longlonglongrightarrow> (\<Sum>i. (- 1) ^ i * a i)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma plus_nth_eucl: "(x + y) $\<^sub>e i = x $\<^sub>e i + y $\<^sub>e i"
  and minus_nth_eucl: "(x - y) $\<^sub>e i = x $\<^sub>e i - y $\<^sub>e i"
  and uminus_nth_eucl: "(-x) $\<^sub>e i = - x $\<^sub>e i"
  and scaleR_nth_eucl: "(c *\<^sub>R x) $\<^sub>e i = c *\<^sub>R (x $\<^sub>e i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((x + y) $\<^sub>e i = x $\<^sub>e i + y $\<^sub>e i &&& (x - y) $\<^sub>e i = x $\<^sub>e i - y $\<^sub>e i) &&& (- x) $\<^sub>e i = - x $\<^sub>e i &&& (c *\<^sub>R x) $\<^sub>e i = c *\<^sub>R x $\<^sub>e i
[PROOF STEP]
by (auto simp: nth_eucl_def algebra_simps)


[STATEMENT]
lemma eSuc_eq_infinity_iff: "eSuc n = \<infinity> \<longleftrightarrow> n = \<infinity>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (eSuc n = \<infinity>) = (n = \<infinity>)
[PROOF STEP]
by(cases n)(simp_all add: zero_enat_def eSuc_enat)


[STATEMENT]
lemma mult_greatest_omega:
  "(x * 1\<^sup>\<omega>)\<^sup>\<omega> \<le> x * 1\<^sup>\<omega>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x * (1::'a)\<^sup>\<omega>)\<^sup>\<omega> \<le> x * (1::'a)\<^sup>\<omega>
[PROOF STEP]
by (metis mult_right_isotone omega_slide omega_sub_vector)


[STATEMENT]
lemma semiring_1_cancel_ow:
  "class.semiring_1_cancel = semiring_1_cancel_ow UNIV"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. class.semiring_1_cancel = semiring_1_cancel_ow UNIV
[PROOF STEP]
unfolding
    class.semiring_1_cancel_def semiring_1_cancel_ow_def
    cancel_comm_monoid_add_ow monoid_mult_ow semiring_ow zero_neq_one_ow
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>plus minus zero one times. (cancel_comm_monoid_add_ow UNIV plus minus zero \<and> monoid_mult_ow UNIV one times) \<and> semiring_ow UNIV plus times \<and> zero_neq_one_ow UNIV one zero) = (\<lambda>plus minus zero one times. (semiring_ow UNIV plus times \<and> cancel_comm_monoid_add_ow UNIV plus minus zero) \<and> zero_neq_one_ow UNIV one zero \<and> monoid_mult_ow UNIV one times)
[PROOF STEP]
by (force simp: conj_commute)


[STATEMENT]
lemma real_add_less_0_iff: "x + y < 0 \<longleftrightarrow> y < - x"
  for x y :: real
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x + y < 0) = (y < - x)
[PROOF STEP]
by auto


[STATEMENT]
lemma module_vec_simps:
  "add (module_vec ty n) = (+)"
  "zero (module_vec ty n) = 0\<^sub>v n"
  "carrier (module_vec ty n) = carrier_vec n"
  "smult (module_vec ty n) = (\<cdot>\<^sub>v)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<oplus>\<^bsub>module_vec ty n\<^esub>) = (+) &&& \<zero>\<^bsub>module_vec ty n\<^esub> = 0\<^sub>v n) &&& carrier (module_vec ty n) = carrier_vec n &&& (\<odot>\<^bsub>module_vec ty n\<^esub>) = (\<cdot>\<^sub>v)
[PROOF STEP]
unfolding module_vec_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<oplus>\<^bsub>\<lparr>carrier = carrier_vec n, monoid.mult = undefined, one = undefined, zero = 0\<^sub>v n, add = (+), smult = (\<cdot>\<^sub>v)\<rparr>\<^esub>) = (+) &&& \<zero>\<^bsub>\<lparr>carrier = carrier_vec n, monoid.mult = undefined, one = undefined, zero = 0\<^sub>v n, add = (+), smult = (\<cdot>\<^sub>v)\<rparr>\<^esub> = 0\<^sub>v n) &&& carrier \<lparr>carrier = carrier_vec n, monoid.mult = undefined, one = undefined, zero = 0\<^sub>v n, add = (+), smult = (\<cdot>\<^sub>v)\<rparr> = carrier_vec n &&& (\<odot>\<^bsub>\<lparr>carrier = carrier_vec n, monoid.mult = undefined, one = undefined, zero = 0\<^sub>v n, add = (+), smult = (\<cdot>\<^sub>v)\<rparr>\<^esub>) = (\<cdot>\<^sub>v)
[PROOF STEP]
by auto


[STATEMENT]
lemma "(-10::int) div 3 = -4"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - 10 div 3 = - 4
[PROOF STEP]
by simp


[STATEMENT]
lemma n_eq_Suc_sub1_conv[simp]: "n = Suc (n - Suc 0) \<longleftrightarrow> n\<noteq>0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (n = Suc (n - Suc 0)) = (n \<noteq> 0)
[PROOF STEP]
by auto


[STATEMENT]
lemma eval_eval_exec_max:
 "\<lbrakk>s1 -e1\<succ>v1-n1\<rightarrow> t1; s2 -e2\<succ>v2-n2\<rightarrow> t2; s3 -c-n3\<rightarrow> t3\<rbrakk> \<Longrightarrow>
   s1 -e1\<succ>v1-max (max n1 n2) n3\<rightarrow> t1 \<and>
   s2 -e2\<succ>v2-max (max n1 n2) n3\<rightarrow> t2 \<and>
   s3 -c    -max (max n1 n2) n3\<rightarrow> t3"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>s1 -e1\<succ>v1-n1\<rightarrow> t1; s2 -e2\<succ>v2-n2\<rightarrow> t2; s3 -c-n3\<rightarrow> t3\<rbrakk> \<Longrightarrow> s1 -e1\<succ>v1-max (max n1 n2) n3\<rightarrow> t1 \<and> s2 -e2\<succ>v2-max (max n1 n2) n3\<rightarrow> t2 \<and> s3 -c-max (max n1 n2) n3\<rightarrow> t3
[PROOF STEP]
apply (drule (1) eval_eval_max, erule thin_rl)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>s3 -c-n3\<rightarrow> t3; s1 -e1\<succ>v1-max n1 n2\<rightarrow> t1 \<and> s2 -e2\<succ>v2-max n1 n2\<rightarrow> t2\<rbrakk> \<Longrightarrow> s1 -e1\<succ>v1-max (max n1 n2) n3\<rightarrow> t1 \<and> s2 -e2\<succ>v2-max (max n1 n2) n3\<rightarrow> t2 \<and> s3 -c-max (max n1 n2) n3\<rightarrow> t3
[PROOF STEP]
by (fast intro: exec_mono eval_mono max.cobounded1 max.cobounded2)


[STATEMENT]
lemma valuate_sum: "((\<Sum>x\<in>A. f x) \<lbrace> v \<rbrace>) = (\<Sum>x\<in>A. ((f x) \<lbrace> v \<rbrace>))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum f A \<lbrace> v \<rbrace> = (\<Sum>x\<in>A. f x \<lbrace> v \<rbrace>)
[PROOF STEP]
by (induct A rule: infinite_finite_induct, auto simp: valuate_zero valuate_add)


[STATEMENT]
lemma dim_eliminate_entries_gen[simp]: "dim_row (eliminate_entries_gen v B i as) = dim_row B"
  "dim_col (eliminate_entries_gen v B i as) = dim_col B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_row (local.eliminate_entries_gen v B i as) = dim_row B &&& dim_col (local.eliminate_entries_gen v B i as) = dim_col B
[PROOF STEP]
unfolding eliminate_entries_gen_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_row (mat (dim_row B) (dim_col B) (\<lambda>(ia, j). if ia \<noteq> i then minus (B $$ (ia, j)) (times (v ia) (B $$ (i, j))) else B $$ (ia, j))) = dim_row B &&& dim_col (mat (dim_row B) (dim_col B) (\<lambda>(ia, j). if ia \<noteq> i then minus (B $$ (ia, j)) (times (v ia) (B $$ (i, j))) else B $$ (ia, j))) = dim_col B
[PROOF STEP]
by auto


[STATEMENT]
lemma icard_UNIV_nat: "icard (UNIV::nat set) = \<infinity>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. icard UNIV = \<infinity>
[PROOF STEP]
by (simp add: icard_def)


[STATEMENT]
lemma set_vebt_maxt''[vebt_simps]:
  "invar_vebt t n \<Longrightarrow> vebt_maxt t = (if set_vebt t = {} then None else Some (Max (set_vebt t)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. invar_vebt t n \<Longrightarrow> vebt_maxt t = (if set_vebt t = {} then None else Some (Max (set_vebt t)))
[PROOF STEP]
by (metis Max_ge Max_in VEBT_internal.set_vebt_finite VEBT_internal.set_vebt_set_vebt'_valid empty_iff option.exhaust set_vebt_maxt')


[STATEMENT]
lemma (in PolynRg) P_mod_pre:"\<lbrakk>ideal S I; pol_coeff S ((Suc n), f);
       P_mod R S X I (polyn_expr R X (Suc n) (Suc n, f))\<rbrakk> \<Longrightarrow>
       P_mod R S X I (polyn_expr R X n (n, f))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>ideal S I; pol_coeff S (Suc n, f); P_mod R S X I (polyn_expr R X (Suc n) (Suc n, f))\<rbrakk> \<Longrightarrow> P_mod R S X I (polyn_expr R X n (n, f))
[PROOF STEP]
apply (frule pol_coeff_pre[of n f],
       frule polyn_mem[of "(n, f)" n],simp,
       frule polyn_mem[of "(Suc n, f)" "Suc n"], simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>ideal S I; pol_coeff S (Suc n, f); P_mod R S X I (polyn_expr R X (Suc n) (Suc n, f)); pol_coeff S (n, f); polyn_expr R X n (n, f) \<in> carrier R; polyn_expr R X (Suc n) (Suc n, f) \<in> carrier R\<rbrakk> \<Longrightarrow> P_mod R S X I (polyn_expr R X n (n, f))
[PROOF STEP]
apply (case_tac "polyn_expr R X n (n, f) = \<zero>\<^bsub>R\<^esub>", simp add:P_mod_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>ideal S I; pol_coeff S (Suc n, f); P_mod R S X I (polyn_expr R X (Suc n) (Suc n, f)); pol_coeff S (n, f); polyn_expr R X n (n, f) \<in> carrier R; polyn_expr R X (Suc n) (Suc n, f) \<in> carrier R; polyn_expr R X n (n, f) \<noteq> \<zero>\<rbrakk> \<Longrightarrow> P_mod R S X I (polyn_expr R X n (n, f))
[PROOF STEP]
apply (subst P_mod_mod[THEN sym, of I
                  "polyn_expr R X n (n, f)" "(n, f)"], assumption+, simp,
       frule P_mod_mod[THEN sym, of I "polyn_expr R X (Suc n) (Suc n, f)"
               "(Suc n, f)"], assumption+, simp, simp)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma has_integral_real:
  "(f has_integral y) {a..b::real} \<longleftrightarrow>
    (\<forall>e>0. \<exists>\<gamma>. gauge \<gamma> \<and>
      (\<forall>\<D>. \<D> tagged_division_of {a..b} \<and> \<gamma> fine \<D> \<longrightarrow>
        norm (sum (\<lambda>(x,k). content(k) *\<^sub>R f x) \<D> - y) < e))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f has_integral y) {a..b} = (\<forall>e>0. \<exists>\<gamma>. gauge \<gamma> \<and> (\<forall>\<D>. \<D> tagged_division_of {a..b} \<and> \<gamma> fine \<D> \<longrightarrow> norm ((\<Sum>(x, k)\<in>\<D>. content k *\<^sub>R f x) - y) < e))
[PROOF STEP]
unfolding box_real[symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f has_integral y) (cbox a b) = (\<forall>e>0. \<exists>\<gamma>. gauge \<gamma> \<and> (\<forall>\<D>. \<D> tagged_division_of cbox a b \<and> \<gamma> fine \<D> \<longrightarrow> norm ((\<Sum>(x, k)\<in>\<D>. content k *\<^sub>R f x) - y) < e))
[PROOF STEP]
by (rule has_integral)


[STATEMENT]
lemma Fin_uminus_le_iff: "Fin(-y) \<le> -x \<longleftrightarrow> x \<le> ((Fin y)::'a::ordered_ab_group_add extended)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (Fin (- y) \<le> - x) = (x \<le> Fin y)
[PROOF STEP]
by(cases x) auto


[STATEMENT]
lemma intuitionistic_forall:
  "(\<And>x. intuitionistic (P x)) \<Longrightarrow> intuitionistic (ALLS x. P x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>x. intuitionistic (P x)) \<Longrightarrow> intuitionistic (\<lambda>s. \<forall>x. P x s)
[PROOF STEP]
by (force intro: intuitionisticI dest: intuitionisticD)


[STATEMENT]
lemma real_seq_to_hypreal_Infinitesimal:
  "\<forall>n. norm (X n - x) < inverse (real (Suc n)) \<Longrightarrow> star_n X - star_of x \<in> Infinitesimal"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>n. norm (X n - x) < inverse (real (Suc n)) \<Longrightarrow> star_n X - star_of x \<in> Infinitesimal
[PROOF STEP]
unfolding star_n_diff star_of_def Infinitesimal_FreeUltrafilterNat_iff star_n_inverse
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>n. norm (X n - x) < inverse (real (Suc n)) \<Longrightarrow> \<forall>u>0. \<forall>\<^sub>F n in \<U>. norm (X n - x) < u
[PROOF STEP]
by (auto dest!: FreeUltrafilterNat_inverse_real_of_posnat
      intro: order_less_trans elim!: eventually_mono)


[STATEMENT]
lemma (in module) submoduleE :
  assumes "submodule H R M"
  shows "H \<subseteq> carrier M"
    and "H \<noteq> {}"
    and "\<And>a. a \<in> H \<Longrightarrow> \<ominus>\<^bsub>M\<^esub> a \<in> H"
    and "\<And>a b. \<lbrakk>a \<in> carrier R; b \<in> H\<rbrakk> \<Longrightarrow> a \<odot>\<^bsub>M\<^esub> b \<in> H"
    and "\<And> a b. \<lbrakk>a \<in> H ; b \<in> H\<rbrakk> \<Longrightarrow> a \<oplus>\<^bsub>M\<^esub> b \<in> H"
    and "\<And> x. x \<in> H \<Longrightarrow> (a_inv M x) \<in> H"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (H \<subseteq> carrier M &&& H \<noteq> {} &&& (\<And>a. a \<in> H \<Longrightarrow> \<ominus>\<^bsub>M\<^esub> a \<in> H)) &&& (\<And>a b. \<lbrakk>a \<in> carrier R; b \<in> H\<rbrakk> \<Longrightarrow> a \<odot>\<^bsub>M\<^esub> b \<in> H) &&& (\<And>a b. \<lbrakk>a \<in> H; b \<in> H\<rbrakk> \<Longrightarrow> a \<oplus>\<^bsub>M\<^esub> b \<in> H) &&& (\<And>x. x \<in> H \<Longrightarrow> \<ominus>\<^bsub>M\<^esub> x \<in> H)
[PROOF STEP]
using group.subgroupE[of "add_monoid M" H, OF _ submodule.axioms(1)[OF assms]] a_comm_group
        submodule.smult_closed[OF assms]
[PROOF STATE]
proof (prove)
using this:
Group.group (add_monoid M) \<Longrightarrow> H \<subseteq> carrier (add_monoid M)
Group.group (add_monoid M) \<Longrightarrow> H \<noteq> {}
\<lbrakk>Group.group (add_monoid M); ?a \<in> H\<rbrakk> \<Longrightarrow> inv\<^bsub>add_monoid M\<^esub> ?a \<in> H
\<lbrakk>Group.group (add_monoid M); ?a \<in> H; ?b \<in> H\<rbrakk> \<Longrightarrow> ?a \<otimes>\<^bsub>add_monoid M\<^esub> ?b \<in> H
comm_group (add_monoid M)
\<lbrakk>?a \<in> carrier R; ?x \<in> H\<rbrakk> \<Longrightarrow> ?a \<odot>\<^bsub>M\<^esub> ?x \<in> H

goal (1 subgoal):
 1. (H \<subseteq> carrier M &&& H \<noteq> {} &&& (\<And>a. a \<in> H \<Longrightarrow> \<ominus>\<^bsub>M\<^esub> a \<in> H)) &&& (\<And>a b. \<lbrakk>a \<in> carrier R; b \<in> H\<rbrakk> \<Longrightarrow> a \<odot>\<^bsub>M\<^esub> b \<in> H) &&& (\<And>a b. \<lbrakk>a \<in> H; b \<in> H\<rbrakk> \<Longrightarrow> a \<oplus>\<^bsub>M\<^esub> b \<in> H) &&& (\<And>x. x \<in> H \<Longrightarrow> \<ominus>\<^bsub>M\<^esub> x \<in> H)
[PROOF STEP]
unfolding comm_group_def a_inv_def
[PROOF STATE]
proof (prove)
using this:
Group.group (add_monoid M) \<Longrightarrow> H \<subseteq> carrier (add_monoid M)
Group.group (add_monoid M) \<Longrightarrow> H \<noteq> {}
\<lbrakk>Group.group (add_monoid M); ?a \<in> H\<rbrakk> \<Longrightarrow> inv\<^bsub>add_monoid M\<^esub> ?a \<in> H
\<lbrakk>Group.group (add_monoid M); ?a \<in> H; ?b \<in> H\<rbrakk> \<Longrightarrow> ?a \<otimes>\<^bsub>add_monoid M\<^esub> ?b \<in> H
Group.comm_monoid (add_monoid M) \<and> Group.group (add_monoid M)
\<lbrakk>?a \<in> carrier R; ?x \<in> H\<rbrakk> \<Longrightarrow> ?a \<odot>\<^bsub>M\<^esub> ?x \<in> H

goal (1 subgoal):
 1. (H \<subseteq> carrier M &&& H \<noteq> {} &&& (\<And>a. a \<in> H \<Longrightarrow> inv\<^bsub>add_monoid M\<^esub> a \<in> H)) &&& (\<And>a b. \<lbrakk>a \<in> carrier R; b \<in> H\<rbrakk> \<Longrightarrow> a \<odot>\<^bsub>M\<^esub> b \<in> H) &&& (\<And>a b. \<lbrakk>a \<in> H; b \<in> H\<rbrakk> \<Longrightarrow> a \<oplus>\<^bsub>M\<^esub> b \<in> H) &&& (\<And>x. x \<in> H \<Longrightarrow> inv\<^bsub>add_monoid M\<^esub> x \<in> H)
[PROOF STEP]
by auto


[STATEMENT]
lemma int_eq_sint:
  "x < 2 ^ (LENGTH('a) - 1) \<Longrightarrow> sint (of_nat x :: 'a :: len word) = int x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x < 2 ^ (LENGTH('a) - 1) \<Longrightarrow> sint (word_of_nat x) = int x
[PROOF STEP]
apply transfer
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. x < 2 ^ (LENGTH('a) - 1) \<Longrightarrow> signed_take_bit (LENGTH('a) - Suc 0) (int x) = int x
[PROOF STEP]
apply (rule signed_take_bit_int_eq_self)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x. x < 2 ^ (LENGTH('a) - 1) \<Longrightarrow> - (2 ^ (LENGTH('a) - Suc 0)) \<le> int x
 2. \<And>x. x < 2 ^ (LENGTH('a) - 1) \<Longrightarrow> int x < 2 ^ (LENGTH('a) - Suc 0)
[PROOF STEP]
apply simp_all
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. x < 2 ^ (LENGTH('a) - Suc 0) \<Longrightarrow> - (2 ^ (LENGTH('a) - Suc 0)) \<le> int x
[PROOF STEP]
apply (metis negative_zle numeral_power_eq_of_nat_cancel_iff)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma blaschke_inv_a_inf [simp]:
  assumes "cmod a \<noteq> 1"
  shows "moebius_pt (blaschke a) (inversion (of_complex a)) = \<infinity>\<^sub>h"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. moebius_pt (blaschke a) (inversion (of_complex a)) = \<infinity>\<^sub>h
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
cmod a \<noteq> 1

goal (1 subgoal):
 1. moebius_pt (blaschke a) (inversion (of_complex a)) = \<infinity>\<^sub>h
[PROOF STEP]
unfolding inversion_def
[PROOF STATE]
proof (prove)
using this:
cmod a \<noteq> 1

goal (1 subgoal):
 1. moebius_pt (blaschke a) ((conjugate \<circ> reciprocal) (of_complex a)) = \<infinity>\<^sub>h
[PROOF STEP]
by (transfer, transfer) (simp add: vec_cnj_def, rule_tac x="1/(1 - a*cnj a)" in exI, simp)


[STATEMENT]
lemma inext_le_mono_fin_rev: "
  \<lbrakk> inext a I \<le> inext b I; a \<in> I; b \<in> I; finite I; inext a I \<noteq> Max I\<rbrakk> \<Longrightarrow> a \<le> b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>inext a I \<le> inext b I; a \<in> I; b \<in> I; finite I; inext a I \<noteq> Max I\<rbrakk> \<Longrightarrow> a \<le> b
[PROOF STEP]
by (metis inext_in_iff inext_le_mono_rev inext_mono2_infin_fin)


[STATEMENT]
lemma monoAux: "A \<subseteq> B \<Longrightarrow> P \<leadsto>\<^sup>^<A> Q \<longrightarrow> P \<leadsto>\<^sup>^<B> Q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<subseteq> B \<Longrightarrow> P \<leadsto>\<^sup>^<A> Q \<longrightarrow> P \<leadsto>\<^sup>^<B> Q
[PROOF STEP]
by(auto intro: Weak_Late_Sim.monotonic)


[STATEMENT]
lemma "g_orbital f G U S t\<^sub>0 s = {X t |t X. X t \<in> \<gamma> X G (U s) \<and> X \<in> Sols f U S t\<^sub>0 s}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. g_orbital f G U S t\<^sub>0 s = {X t |t X. X t \<in> \<gamma> X G (U s) \<and> X \<in> Sols f U S t\<^sub>0 s}
[PROOF STEP]
unfolding g_orbital_eq g_orbit_eq
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {X t |t X. t \<in> U s \<and> \<P> X (down (U s) t) \<subseteq> Collect G \<and> X \<in> Sols f U S t\<^sub>0 s} = {X t |t X. X t \<in> {X t |t. t \<in> U s \<and> (\<forall>\<tau>\<in>down (U s) t. G (X \<tau>))} \<and> X \<in> Sols f U S t\<^sub>0 s}
[PROOF STEP]
by auto


[STATEMENT]
lemma divide_strict_left_mono:
  "b < a \<Longrightarrow> 0 < c \<Longrightarrow> 0 < a*b \<Longrightarrow> c / a < c / b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>b < a; (0::'a) < c; (0::'a) < a * b\<rbrakk> \<Longrightarrow> c / a < c / b
[PROOF STEP]
by (metis local.divide_neg_pos local.dual_order.strict_iff_order local.frac_less_eq local.less_iff_diff_less_0 local.mult_not_zero local.mult_strict_left_mono)


[STATEMENT]
lemma assert_pred_mono [simp]: "p \<le> q \<Longrightarrow> {.p.} \<le> {.q.}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p \<sqsubseteq> q \<Longrightarrow> {. p .} \<sqsubseteq> {. q .}
[PROOF STEP]
apply (simp add: le_fun_def assert_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p \<sqsubseteq> q \<Longrightarrow> \<forall>x. p \<sqinter> x \<sqsubseteq> q
[PROOF STEP]
apply safe
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. p \<sqsubseteq> q \<Longrightarrow> p \<sqinter> x \<sqsubseteq> q
[PROOF STEP]
apply (rule_tac y = p in order_trans)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x. p \<sqsubseteq> q \<Longrightarrow> p \<sqinter> x \<sqsubseteq> p
 2. \<And>x. p \<sqsubseteq> q \<Longrightarrow> p \<sqsubseteq> q
[PROOF STEP]
by simp_all


[STATEMENT]
lemma extend_map_to_freeword_hom2:
  fixes   f :: "'a \<Rightarrow> 'b::group_add"
  defines "h::'a signed \<Rightarrow> 'b \<equiv> \<lambda>(s,b). if b then f s else - (f s)"
  defines "g::'a freeword \<Rightarrow> 'b \<equiv> \<lambda>x. sum_list (map h (freeword x))"
  shows   "UGroupHom g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. UGroupHom g
[PROOF STEP]
using   assms
[PROOF STATE]
proof (prove)
using this:
h \<equiv> \<lambda>(s, b). if b then f s else - f s
g \<equiv> \<lambda>x. sum_list (map h (freeword x))

goal (1 subgoal):
 1. UGroupHom g
[PROOF STEP]
by      (
            auto intro: UGroupHomI
            simp add: plus_freeword.rep_eq extend_map_to_freeword_hom'
          )


[STATEMENT]
lemma master1_automation:
  assumes "g \<in> O(MASTER_BOUND'' p')" "1 < (\<Sum>i<k. as ! i * bs ! i powr p')"
          "eventually (\<lambda>x. f x > 0) at_top"
  shows   "f \<in> \<Theta>(MASTER_BOUND p 0 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<in> \<Theta>(MASTER_BOUND p 0 0)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. f \<in> \<Theta>(MASTER_BOUND p 0 0)
[PROOF STEP]
have A: "MASTER_BOUND p 0 0 \<in> \<Theta>(\<lambda>x::nat. x powr p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. MASTER_BOUND p 0 0 \<in> \<Theta>(\<lambda>x. real x powr p)
[PROOF STEP]
unfolding MASTER_BOUND_def[abs_def]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. real x powr p * ln (real x) powr 0 * ln (ln (real x)) powr 0) \<in> \<Theta>(\<lambda>x. real x powr p)
[PROOF STEP]
by (intro landau_real_nat_transfer bigthetaI_cong
      eventually_mono[OF eventually_ge_at_top[of "3::real"]]) (auto dest!: ln_1_imp_less_3)
[PROOF STATE]
proof (state)
this:
MASTER_BOUND p 0 0 \<in> \<Theta>(\<lambda>x. real x powr p)

goal (1 subgoal):
 1. f \<in> \<Theta>(MASTER_BOUND p 0 0)
[PROOF STEP]
have B: "O(MASTER_BOUND'' p') = O(\<lambda>x::nat. real x powr p')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. O(MASTER_BOUND'' p') = O(\<lambda>x. real x powr p')
[PROOF STEP]
using eventually_ge_at_top[of "2::nat"]
[PROOF STATE]
proof (prove)
using this:
eventually ((\<le>) 2) sequentially

goal (1 subgoal):
 1. O(MASTER_BOUND'' p') = O(\<lambda>x. real x powr p')
[PROOF STEP]
by (intro landau_o.big.cong) (auto elim!: eventually_mono simp: MASTER_BOUND''_def)
[PROOF STATE]
proof (state)
this:
O(MASTER_BOUND'' p') = O(\<lambda>x. real x powr p')

goal (1 subgoal):
 1. f \<in> \<Theta>(MASTER_BOUND p 0 0)
[PROOF STEP]
from landau_theta.cong_bigtheta[OF A] B assms(1) master1[OF _ assms(2-)]
[PROOF STATE]
proof (chain)
picking this:
\<Theta>(MASTER_BOUND p 0 0) = \<Theta>(\<lambda>x. real x powr p)
O(MASTER_BOUND'' p') = O(\<lambda>x. real x powr p')
g \<in> O(MASTER_BOUND'' p')
g \<in> O(\<lambda>x. real x powr p') \<Longrightarrow> f \<in> \<Theta>(\<lambda>x. real x powr p)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<Theta>(MASTER_BOUND p 0 0) = \<Theta>(\<lambda>x. real x powr p)
O(MASTER_BOUND'' p') = O(\<lambda>x. real x powr p')
g \<in> O(MASTER_BOUND'' p')
g \<in> O(\<lambda>x. real x powr p') \<Longrightarrow> f \<in> \<Theta>(\<lambda>x. real x powr p)

goal (1 subgoal):
 1. f \<in> \<Theta>(MASTER_BOUND p 0 0)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
f \<in> \<Theta>(MASTER_BOUND p 0 0)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma completely_multiplicative_fds_deriv:
  assumes "completely_multiplicative_function f"
  shows   "fds_deriv (fds f) = -fds (\<lambda>n. f n * mangoldt n) * fds f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fds_deriv (fds f) = - fds (\<lambda>n. f n * mangoldt n) * fds f
[PROOF STEP]
proof (rule fds_eqI, goal_cases)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. 0 < n \<Longrightarrow> fds_nth (fds_deriv (fds f)) n = fds_nth (- fds (\<lambda>n. f n * mangoldt n) * fds f) n
[PROOF STEP]
case (1 n)
[PROOF STATE]
proof (state)
this:
0 < n

goal (1 subgoal):
 1. \<And>n. 0 < n \<Longrightarrow> fds_nth (fds_deriv (fds f)) n = fds_nth (- fds (\<lambda>n. f n * mangoldt n) * fds f) n
[PROOF STEP]
interpret completely_multiplicative_function f
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. completely_multiplicative_function f
[PROOF STEP]
by fact
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. 0 < n \<Longrightarrow> fds_nth (fds_deriv (fds f)) n = fds_nth (- fds (\<lambda>n. f n * mangoldt n) * fds f) n
[PROOF STEP]
have "fds_nth (-fds (\<lambda>n. f n * mangoldt n) * fds f) n =
          -(\<Sum>(r, d) | r * d = n. f r * mangoldt r * f d)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fds_nth (- fds (\<lambda>n. f n * mangoldt n) * fds f) n = - (\<Sum>(r, d)\<in>{(r, d). r * d = n}. f r * mangoldt r * f d)
[PROOF STEP]
by (simp add: fds_nth_mult fds_nth_deriv dirichlet_prod_altdef2)
[PROOF STATE]
proof (state)
this:
fds_nth (- fds (\<lambda>n. f n * mangoldt n) * fds f) n = - (\<Sum>(r, d)\<in>{(r, d). r * d = n}. f r * mangoldt r * f d)

goal (1 subgoal):
 1. \<And>n. 0 < n \<Longrightarrow> fds_nth (fds_deriv (fds f)) n = fds_nth (- fds (\<lambda>n. f n * mangoldt n) * fds f) n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
fds_nth (- fds (\<lambda>n. f n * mangoldt n) * fds f) n = - (\<Sum>(r, d)\<in>{(r, d). r * d = n}. f r * mangoldt r * f d)

goal (1 subgoal):
 1. \<And>n. 0 < n \<Longrightarrow> fds_nth (fds_deriv (fds f)) n = fds_nth (- fds (\<lambda>n. f n * mangoldt n) * fds f) n
[PROOF STEP]
have "(\<Sum>(r, d) | r * d = n. f r * mangoldt r * f d) =
               (\<Sum>(r, d) | r * d = n. mangoldt r * f n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>(r, d)\<in>{(r, d). r * d = n}. f r * mangoldt r * f d) = (\<Sum>(r, d)\<in>{(r, d). r * d = n}. mangoldt r * f n)
[PROOF STEP]
using 1
[PROOF STATE]
proof (prove)
using this:
0 < n

goal (1 subgoal):
 1. (\<Sum>(r, d)\<in>{(r, d). r * d = n}. f r * mangoldt r * f d) = (\<Sum>(r, d)\<in>{(r, d). r * d = n}. mangoldt r * f n)
[PROOF STEP]
by (intro sum.mono_neutral_cong_right refl)
               (auto simp: mangoldt_def mult mult_ac intro!: finite_divisors_nat' split: if_splits)
[PROOF STATE]
proof (state)
this:
(\<Sum>(r, d)\<in>{(r, d). r * d = n}. f r * mangoldt r * f d) = (\<Sum>(r, d)\<in>{(r, d). r * d = n}. mangoldt r * f n)

goal (1 subgoal):
 1. \<And>n. 0 < n \<Longrightarrow> fds_nth (fds_deriv (fds f)) n = fds_nth (- fds (\<lambda>n. f n * mangoldt n) * fds f) n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>(r, d)\<in>{(r, d). r * d = n}. f r * mangoldt r * f d) = (\<Sum>(r, d)\<in>{(r, d). r * d = n}. mangoldt r * f n)

goal (1 subgoal):
 1. \<And>n. 0 < n \<Longrightarrow> fds_nth (fds_deriv (fds f)) n = fds_nth (- fds (\<lambda>n. f n * mangoldt n) * fds f) n
[PROOF STEP]
have "\<dots> = (\<Sum>r | r dvd n. mangoldt r * f n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>(r, d)\<in>{(r, d). r * d = n}. mangoldt r * f n) = (\<Sum>r | r dvd n. mangoldt r * f n)
[PROOF STEP]
using 1
[PROOF STATE]
proof (prove)
using this:
0 < n

goal (1 subgoal):
 1. (\<Sum>(r, d)\<in>{(r, d). r * d = n}. mangoldt r * f n) = (\<Sum>r | r dvd n. mangoldt r * f n)
[PROOF STEP]
by (intro sum.reindex_bij_witness[of _ "\<lambda>r. (r, n div r)" fst]) auto
[PROOF STATE]
proof (state)
this:
(\<Sum>(r, d)\<in>{(r, d). r * d = n}. mangoldt r * f n) = (\<Sum>r | r dvd n. mangoldt r * f n)

goal (1 subgoal):
 1. \<And>n. 0 < n \<Longrightarrow> fds_nth (fds_deriv (fds f)) n = fds_nth (- fds (\<lambda>n. f n * mangoldt n) * fds f) n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>(r, d)\<in>{(r, d). r * d = n}. mangoldt r * f n) = (\<Sum>r | r dvd n. mangoldt r * f n)

goal (1 subgoal):
 1. \<And>n. 0 < n \<Longrightarrow> fds_nth (fds_deriv (fds f)) n = fds_nth (- fds (\<lambda>n. f n * mangoldt n) * fds f) n
[PROOF STEP]
have "\<dots> = (\<Sum>r | r dvd n. mangoldt r) * f n" (is "_ = ?S * _")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>r | r dvd n. mangoldt r * f n) = (\<Sum>r | r dvd n. mangoldt r) * f n
[PROOF STEP]
by (subst sum_distrib_right [symmetric]) simp
[PROOF STATE]
proof (state)
this:
(\<Sum>r | r dvd n. mangoldt r * f n) = (\<Sum>r | r dvd n. mangoldt r) * f n

goal (1 subgoal):
 1. \<And>n. 0 < n \<Longrightarrow> fds_nth (fds_deriv (fds f)) n = fds_nth (- fds (\<lambda>n. f n * mangoldt n) * fds f) n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>r | r dvd n. mangoldt r * f n) = (\<Sum>r | r dvd n. mangoldt r) * f n

goal (1 subgoal):
 1. \<And>n. 0 < n \<Longrightarrow> fds_nth (fds_deriv (fds f)) n = fds_nth (- fds (\<lambda>n. f n * mangoldt n) * fds f) n
[PROOF STEP]
have "(\<Sum>r | r dvd n. mangoldt r) = of_real (ln (real n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>r | r dvd n. mangoldt r) = of_real (ln (real n))
[PROOF STEP]
using 1
[PROOF STATE]
proof (prove)
using this:
0 < n

goal (1 subgoal):
 1. (\<Sum>r | r dvd n. mangoldt r) = of_real (ln (real n))
[PROOF STEP]
by (intro mangoldt_sum) simp
[PROOF STATE]
proof (state)
this:
(\<Sum>r | r dvd n. mangoldt r) = of_real (ln (real n))

goal (1 subgoal):
 1. \<And>n. 0 < n \<Longrightarrow> fds_nth (fds_deriv (fds f)) n = fds_nth (- fds (\<lambda>n. f n * mangoldt n) * fds f) n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>r | r dvd n. mangoldt r) = of_real (ln (real n))

goal (1 subgoal):
 1. \<And>n. 0 < n \<Longrightarrow> fds_nth (fds_deriv (fds f)) n = fds_nth (- fds (\<lambda>n. f n * mangoldt n) * fds f) n
[PROOF STEP]
have "- (of_real (ln (real n)) * f n) = fds_nth (fds_deriv (fds f)) n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - (of_real (ln (real n)) * f n) = fds_nth (fds_deriv (fds f)) n
[PROOF STEP]
using 1
[PROOF STATE]
proof (prove)
using this:
0 < n

goal (1 subgoal):
 1. - (of_real (ln (real n)) * f n) = fds_nth (fds_deriv (fds f)) n
[PROOF STEP]
by (simp add: fds_nth_deriv scaleR_conv_of_real)
[PROOF STATE]
proof (state)
this:
- (of_real (ln (real n)) * f n) = fds_nth (fds_deriv (fds f)) n

goal (1 subgoal):
 1. \<And>n. 0 < n \<Longrightarrow> fds_nth (fds_deriv (fds f)) n = fds_nth (- fds (\<lambda>n. f n * mangoldt n) * fds f) n
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
fds_nth (- fds (\<lambda>n. f n * mangoldt n) * fds f) n = fds_nth (fds_deriv (fds f)) n
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
fds_nth (- fds (\<lambda>n. f n * mangoldt n) * fds f) n = fds_nth (fds_deriv (fds f)) n

goal (1 subgoal):
 1. fds_nth (fds_deriv (fds f)) n = fds_nth (- fds (\<lambda>n. f n * mangoldt n) * fds f) n
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
fds_nth (fds_deriv (fds f)) n = fds_nth (- fds (\<lambda>n. f n * mangoldt n) * fds f) n

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma halfspace_gt_in_halfspace:
  assumes i: "i \<in> A"
  shows "{x::'a. a < x \<bullet> i} \<in>
    sigma_sets UNIV ((\<lambda> (a, i). {x::'a::euclidean_space. x \<bullet> i < a}) ` (UNIV \<times> A))"
  (is "?set \<in> ?SIGMA")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {x. a < x \<bullet> i} \<in> sigma_sets UNIV ((\<lambda>(a, i). {x. x \<bullet> i < a}) ` (UNIV \<times> A))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. {x. a < x \<bullet> i} \<in> sigma_sets UNIV ((\<lambda>(a, i). {x. x \<bullet> i < a}) ` (UNIV \<times> A))
[PROOF STEP]
interpret sigma_algebra UNIV ?SIGMA
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sigma_algebra UNIV (sigma_sets UNIV ((\<lambda>(a, i). {x. x \<bullet> i < a}) ` (UNIV \<times> A)))
[PROOF STEP]
by (intro sigma_algebra_sigma_sets) simp_all
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. {x. a < x \<bullet> i} \<in> sigma_sets UNIV ((\<lambda>(a, i). {x. x \<bullet> i < a}) ` (UNIV \<times> A))
[PROOF STEP]
have *: "?set = (\<Union>n. UNIV - {x::'a. x \<bullet> i < a + 1 / real (Suc n)})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {x. a < x \<bullet> i} = (\<Union>n. UNIV - {x. x \<bullet> i < a + 1 / real (Suc n)})
[PROOF STEP]
proof (safe, simp_all add: not_less del: of_nat_Suc)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x. a < x \<bullet> i \<Longrightarrow> \<exists>xa. a + 1 / real (Suc xa) \<le> x \<bullet> i
 2. \<And>x n. a + 1 / real (Suc n) \<le> x \<bullet> i \<Longrightarrow> a < x \<bullet> i
[PROOF STEP]
fix x :: 'a
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x. a < x \<bullet> i \<Longrightarrow> \<exists>xa. a + 1 / real (Suc xa) \<le> x \<bullet> i
 2. \<And>x n. a + 1 / real (Suc n) \<le> x \<bullet> i \<Longrightarrow> a < x \<bullet> i
[PROOF STEP]
assume "a < x \<bullet> i"
[PROOF STATE]
proof (state)
this:
a < x \<bullet> i

goal (2 subgoals):
 1. \<And>x. a < x \<bullet> i \<Longrightarrow> \<exists>xa. a + 1 / real (Suc xa) \<le> x \<bullet> i
 2. \<And>x n. a + 1 / real (Suc n) \<le> x \<bullet> i \<Longrightarrow> a < x \<bullet> i
[PROOF STEP]
with reals_Archimedean[of "x \<bullet> i - a"]
[PROOF STATE]
proof (chain)
picking this:
0 < x \<bullet> i - a \<Longrightarrow> \<exists>n. inverse (real (Suc n)) < x \<bullet> i - a
a < x \<bullet> i
[PROOF STEP]
obtain n where "a + 1 / real (Suc n) < x \<bullet> i"
[PROOF STATE]
proof (prove)
using this:
0 < x \<bullet> i - a \<Longrightarrow> \<exists>n. inverse (real (Suc n)) < x \<bullet> i - a
a < x \<bullet> i

goal (1 subgoal):
 1. (\<And>n. a + 1 / real (Suc n) < x \<bullet> i \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp: field_simps)
[PROOF STATE]
proof (state)
this:
a + 1 / real (Suc n) < x \<bullet> i

goal (2 subgoals):
 1. \<And>x. a < x \<bullet> i \<Longrightarrow> \<exists>xa. a + 1 / real (Suc xa) \<le> x \<bullet> i
 2. \<And>x n. a + 1 / real (Suc n) \<le> x \<bullet> i \<Longrightarrow> a < x \<bullet> i
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a + 1 / real (Suc n) < x \<bullet> i
[PROOF STEP]
show "\<exists>n. a + 1 / real (Suc n) \<le> x \<bullet> i"
[PROOF STATE]
proof (prove)
using this:
a + 1 / real (Suc n) < x \<bullet> i

goal (1 subgoal):
 1. \<exists>n. a + 1 / real (Suc n) \<le> x \<bullet> i
[PROOF STEP]
by (blast intro: less_imp_le)
[PROOF STATE]
proof (state)
this:
\<exists>n. a + 1 / real (Suc n) \<le> x \<bullet> i

goal (1 subgoal):
 1. \<And>x n. a + 1 / real (Suc n) \<le> x \<bullet> i \<Longrightarrow> a < x \<bullet> i
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x n. a + 1 / real (Suc n) \<le> x \<bullet> i \<Longrightarrow> a < x \<bullet> i
[PROOF STEP]
fix x n
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x n. a + 1 / real (Suc n) \<le> x \<bullet> i \<Longrightarrow> a < x \<bullet> i
[PROOF STEP]
have "a < a + 1 / real (Suc n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a < a + 1 / real (Suc n)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
a < a + 1 / real (Suc n)

goal (1 subgoal):
 1. \<And>x n. a + 1 / real (Suc n) \<le> x \<bullet> i \<Longrightarrow> a < x \<bullet> i
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
a < a + 1 / real (Suc n)

goal (1 subgoal):
 1. \<And>x n. a + 1 / real (Suc n) \<le> x \<bullet> i \<Longrightarrow> a < x \<bullet> i
[PROOF STEP]
assume "\<dots> \<le> x"
[PROOF STATE]
proof (state)
this:
a + 1 / real (Suc n) \<le> x

goal (1 subgoal):
 1. \<And>x n. a + 1 / real (Suc n) \<le> x \<bullet> i \<Longrightarrow> a < x \<bullet> i
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
a < x
[PROOF STEP]
show "a < x"
[PROOF STATE]
proof (prove)
using this:
a < x

goal (1 subgoal):
 1. a < x
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
a < x

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
{x. a < x \<bullet> i} = (\<Union>n. UNIV - {x. x \<bullet> i < a + 1 / real (Suc n)})

goal (1 subgoal):
 1. {x. a < x \<bullet> i} \<in> sigma_sets UNIV ((\<lambda>(a, i). {x. x \<bullet> i < a}) ` (UNIV \<times> A))
[PROOF STEP]
show "?set \<in> ?SIGMA"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {x. a < x \<bullet> i} \<in> sigma_sets UNIV ((\<lambda>(a, i). {x. x \<bullet> i < a}) ` (UNIV \<times> A))
[PROOF STEP]
unfolding *
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Union>n. UNIV - {x. x \<bullet> i < a + 1 / real (Suc n)}) \<in> sigma_sets UNIV ((\<lambda>(a, i). {x. x \<bullet> i < a}) ` (UNIV \<times> A))
[PROOF STEP]
by (auto intro!: Diff sigma_sets_Inter i)
[PROOF STATE]
proof (state)
this:
{x. a < x \<bullet> i} \<in> sigma_sets UNIV ((\<lambda>(a, i). {x. x \<bullet> i < a}) ` (UNIV \<times> A))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma islimpt_in_closure: "(x islimpt S) = (x\<in>closure(S-{x}))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x islimpt S = (x \<in> closure (S - {x}))
[PROOF STEP]
unfolding closure_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x islimpt S = (x \<in> S - {x} \<union> {xa. xa islimpt S - {x}})
[PROOF STEP]
using islimpt_punctured
[PROOF STATE]
proof (prove)
using this:
?x islimpt ?S = ?x islimpt ?S - {?x}

goal (1 subgoal):
 1. x islimpt S = (x \<in> S - {x} \<union> {xa. xa islimpt S - {x}})
[PROOF STEP]
by blast


[STATEMENT]
lemma natLeq_well_order_on: "well_order_on UNIV natLeq"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. well_order natLeq
[PROOF STEP]
using natLeq_Well_order Field_natLeq
[PROOF STATE]
proof (prove)
using this:
Well_order natLeq
Field natLeq = UNIV

goal (1 subgoal):
 1. well_order natLeq
[PROOF STEP]
by auto


[STATEMENT]
lemma (in topological_space) ind_is_open_iff_open:
  shows "ind_topology.ind_is_open S is_open S U \<longleftrightarrow> is_open U \<and> U \<subseteq> S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ind_topology.ind_is_open S is_open S U = (is_open U \<and> U \<subseteq> S)
[PROOF STEP]
by (metis ind_topology.ind_is_open_def ind_topology_is_open_self inf.absorb_iff2)


[STATEMENT]
lemma div_Tr3_2:"\<lbrakk>(0::nat) < r; 0 < s; l mod s < s - 1\<rbrakk> \<Longrightarrow>
                                       l div s = Suc l div s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < r; 0 < s; l mod s < s - 1\<rbrakk> \<Longrightarrow> l div s = Suc l div s
[PROOF STEP]
apply (frule Suc_mono [of "l mod s" "s - 1"])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < r; 0 < s; l mod s < s - 1; Suc (l mod s) < Suc (s - 1)\<rbrakk> \<Longrightarrow> l div s = Suc l div s
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < r; l mod s < s - Suc 0; Suc (l mod s) < s\<rbrakk> \<Longrightarrow> l div s = Suc l div s
[PROOF STEP]
apply (cut_tac div_mult_mod_eq [of "l" "s"])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < r; l mod s < s - Suc 0; Suc (l mod s) < s; l div s * s + l mod s = l\<rbrakk> \<Longrightarrow> l div s = Suc l div s
[PROOF STEP]
apply (cut_tac add_Suc_right [THEN sym, of "l div s * s" "l mod s"])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < r; l mod s < s - Suc 0; Suc (l mod s) < s; l div s * s + l mod s = l; Suc (l div s * s + l mod s) = l div s * s + Suc (l mod s)\<rbrakk> \<Longrightarrow> l div s = Suc l div s
[PROOF STEP]
apply (cut_tac zero_less_Suc[of "l mod s"],
       frule less_trans[of "0" "Suc (l mod s)" "s"], assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < r; l mod s < s - Suc 0; Suc (l mod s) < s; l div s * s + l mod s = l; Suc (l div s * s + l mod s) = l div s * s + Suc (l mod s); 0 < Suc (l mod s); 0 < s\<rbrakk> \<Longrightarrow> l div s = Suc l div s
[PROOF STEP]
apply (frule rfn_tool13_1 [of "s" "Suc (l div s * s + l mod s)" "l div s * s + Suc (l mod s)"], assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < r; l mod s < s - Suc 0; Suc (l mod s) < s; l div s * s + l mod s = l; Suc (l div s * s + l mod s) = l div s * s + Suc (l mod s); 0 < Suc (l mod s); 0 < s; Suc (l div s * s + l mod s) div s = (l div s * s + Suc (l mod s)) div s\<rbrakk> \<Longrightarrow> l div s = Suc l div s
[PROOF STEP]
apply (subgoal_tac "s \<noteq> 0")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>0 < r; l mod s < s - Suc 0; Suc (l mod s) < s; l div s * s + l mod s = l; Suc (l div s * s + l mod s) = l div s * s + Suc (l mod s); 0 < Suc (l mod s); 0 < s; Suc (l div s * s + l mod s) div s = (l div s * s + Suc (l mod s)) div s; s \<noteq> 0\<rbrakk> \<Longrightarrow> l div s = Suc l div s
 2. \<lbrakk>0 < r; l mod s < s - Suc 0; Suc (l mod s) < s; l div s * s + l mod s = l; Suc (l div s * s + l mod s) = l div s * s + Suc (l mod s); 0 < Suc (l mod s); 0 < s; Suc (l div s * s + l mod s) div s = (l div s * s + Suc (l mod s)) div s\<rbrakk> \<Longrightarrow> s \<noteq> 0
[PROOF STEP]
apply (frule div_mult_self1 [of "s" "Suc (l mod s)" "l div s"])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>0 < r; l mod s < s - Suc 0; Suc (l mod s) < s; l div s * s + l mod s = l; Suc (l div s * s + l mod s) = l div s * s + Suc (l mod s); 0 < Suc (l mod s); 0 < s; Suc (l div s * s + l mod s) div s = (l div s * s + Suc (l mod s)) div s; s \<noteq> 0; (Suc (l mod s) + l div s * s) div s = l div s + Suc (l mod s) div s\<rbrakk> \<Longrightarrow> l div s = Suc l div s
 2. \<lbrakk>0 < r; l mod s < s - Suc 0; Suc (l mod s) < s; l div s * s + l mod s = l; Suc (l div s * s + l mod s) = l div s * s + Suc (l mod s); 0 < Suc (l mod s); 0 < s; Suc (l div s * s + l mod s) div s = (l div s * s + Suc (l mod s)) div s\<rbrakk> \<Longrightarrow> s \<noteq> 0
[PROOF STEP]
apply simp_all
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma eventually_less_ceiling:
  fixes f :: "'a \<Rightarrow> 'b::{order_topology,floor_ceiling}"
  assumes f: "(f \<longlongrightarrow> l) F"
    and l: "l \<notin> \<int>"
  shows "\<forall>\<^sub>F x in F. f x < of_int (ceiling l)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F x in F. f x < of_int \<lceil>l\<rceil>
[PROOF STEP]
by (intro order_tendstoD[OF f]) (metis Ints_of_int l le_of_int_ceiling less_le)


[STATEMENT]
lemma dot_rowvector_columnvector: "columnvector (A *v v) = A ** columnvector v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. columnvector (A *v v) = A ** columnvector v
[PROOF STEP]
by (vector columnvector_def matrix_matrix_mult_def matrix_vector_mult_def)


[STATEMENT]
lemma map_proj_transE[simp]:
assumes wt: "list_all wt Tl"
shows "map (Ik.int (transE \<xi>)) Tl =
       map2 proj (map tpOf Tl) (map (I.int \<xi>) Tl)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map (Ik.int (transE \<xi>)) Tl = map2 proj (map tpOf Tl) (map (I.int \<xi>) Tl)
[PROOF STEP]
apply(rule nth_equalityI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. length (map (Ik.int (transE \<xi>)) Tl) = length (map2 proj (map tpOf Tl) (map (I.int \<xi>) Tl))
 2. \<And>i. i < length (map (Ik.int (transE \<xi>)) Tl) \<Longrightarrow> map (Ik.int (transE \<xi>)) Tl ! i = map2 proj (map tpOf Tl) (map (I.int \<xi>) Tl) ! i
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
list_all wt Tl

goal (2 subgoals):
 1. length (map (Ik.int (transE \<xi>)) Tl) = length (map2 proj (map tpOf Tl) (map (I.int \<xi>) Tl))
 2. \<And>i. i < length (map (Ik.int (transE \<xi>)) Tl) \<Longrightarrow> map (Ik.int (transE \<xi>)) Tl ! i = map2 proj (map tpOf Tl) (map (I.int \<xi>) Tl) ! i
[PROOF STEP]
using int_transE_proj
[PROOF STATE]
proof (prove)
using this:
list_all wt Tl
wt ?T \<Longrightarrow> Ik.int (transE ?\<xi>) ?T = proj (tpOf ?T) (I.int ?\<xi> ?T)

goal (2 subgoals):
 1. length (map (Ik.int (transE \<xi>)) Tl) = length (map2 proj (map tpOf Tl) (map (I.int \<xi>) Tl))
 2. \<And>i. i < length (map (Ik.int (transE \<xi>)) Tl) \<Longrightarrow> map (Ik.int (transE \<xi>)) Tl ! i = map2 proj (map tpOf Tl) (map (I.int \<xi>) Tl) ! i
[PROOF STEP]
unfolding list_all_length
[PROOF STATE]
proof (prove)
using this:
\<forall>n<length Tl. wt (Tl ! n)
wt ?T \<Longrightarrow> Ik.int (transE ?\<xi>) ?T = proj (tpOf ?T) (I.int ?\<xi> ?T)

goal (2 subgoals):
 1. length (map (Ik.int (transE \<xi>)) Tl) = length (map2 proj (map tpOf Tl) (map (I.int \<xi>) Tl))
 2. \<And>i. i < length (map (Ik.int (transE \<xi>)) Tl) \<Longrightarrow> map (Ik.int (transE \<xi>)) Tl ! i = map2 proj (map tpOf Tl) (map (I.int \<xi>) Tl) ! i
[PROOF STEP]
by auto


[STATEMENT]
lemma completeness_0:  "{} |= p ==> {} |- p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {} |= p \<Longrightarrow> {} |- p
[PROOF STEP]
by (metis Diff_cancel completeness_0_lemma)


[STATEMENT]
lemma deg_qr_n:
  "deg_qr TYPE('a) = n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. int (deg_qr TYPE('a)) = n
[PROOF STEP]
unfolding deg_qr_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. int (degree (qr_poly' TYPE('a))) = n
[PROOF STEP]
using qr_poly'_eq n_gt_1
[PROOF STATE]
proof (prove)
using this:
qr_poly' TYPE('a) = Polynomial.monom 1 (nat n) + 1
1 < n

goal (1 subgoal):
 1. int (degree (qr_poly' TYPE('a))) = n
[PROOF STEP]
by (simp add: degree_add_eq_left degree_monom_eq)


[STATEMENT]
lemma inv_last_1:
  assumes "\<forall>s \<in> (S - S'). distance C s \<le> 2*r"
    and "S' = {}"
  shows "radius C \<le> 2*r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. radius C \<le> 2 * r
[PROOF STEP]
by (metis Diff_empty assms image_iff radius_contained)


[STATEMENT]
lemma is_ord_r_bal:
 "is_ord (MKT\<^sub>0 x l r) \<Longrightarrow> height r = height l + 2 \<Longrightarrow>
  is_ord (r_bal\<^sub>0 x l r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>is_ord (MKT\<^sub>0 x l r); height r = height l + 2\<rbrakk> \<Longrightarrow> is_ord (r_bal\<^sub>0 x l r)
[PROOF STEP]
by (cases r) (auto split:tree\<^sub>0.splits intro: order_less_trans)


[STATEMENT]
lemma powr_nat_conv_powr: "x > 0 \<Longrightarrow> powr_nat x y = x powr y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < x \<Longrightarrow> powr_nat x y = x powr y
[PROOF STEP]
by (simp_all add: powr_nat_def)


[STATEMENT]
lemma SA_add_closed_id:
  assumes "is_semialg_function n f"
  assumes "is_semialg_function n g"
  shows "restrict f (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) \<oplus>\<^bsub>SA n\<^esub> restrict g (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) = f \<oplus>\<^bsub>SA n\<^esub> g "
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. restrict f (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) \<oplus>\<^bsub>SA n\<^esub> restrict g (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) = f \<oplus>\<^bsub>SA n\<^esub> g
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. (restrict f (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) \<oplus>\<^bsub>SA n\<^esub> restrict g (carrier (Q\<^sub>p\<^bsup>n\<^esup>))) x = (f \<oplus>\<^bsub>SA n\<^esub> g) x
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. (restrict f (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) \<oplus>\<^bsub>SA n\<^esub> restrict g (carrier (Q\<^sub>p\<^bsup>n\<^esup>))) x = (f \<oplus>\<^bsub>SA n\<^esub> g) x
[PROOF STEP]
show "(restrict f (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) \<oplus>\<^bsub>SA n\<^esub> restrict g (carrier (Q\<^sub>p\<^bsup>n\<^esup>))) x = (f \<oplus>\<^bsub>SA n\<^esub> g) x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (restrict f (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) \<oplus>\<^bsub>SA n\<^esub> restrict g (carrier (Q\<^sub>p\<^bsup>n\<^esup>))) x = (f \<oplus>\<^bsub>SA n\<^esub> g) x
[PROOF STEP]
apply(cases "x \<in> carrier (Q\<^sub>p\<^bsup>n\<^esup>)")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. x \<in> carrier (Q\<^sub>p\<^bsup>n\<^esup>) \<Longrightarrow> (restrict f (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) \<oplus>\<^bsub>SA n\<^esub> restrict g (carrier (Q\<^sub>p\<^bsup>n\<^esup>))) x = (f \<oplus>\<^bsub>SA n\<^esub> g) x
 2. x \<notin> carrier (Q\<^sub>p\<^bsup>n\<^esup>) \<Longrightarrow> (restrict f (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) \<oplus>\<^bsub>SA n\<^esub> restrict g (carrier (Q\<^sub>p\<^bsup>n\<^esup>))) x = (f \<oplus>\<^bsub>SA n\<^esub> g) x
[PROOF STEP]
using assms restrict_apply
[PROOF STATE]
proof (prove)
using this:
is_semialg_function n f
is_semialg_function n g
restrict ?f ?A ?x = (if ?x \<in> ?A then ?f ?x else undefined)

goal (2 subgoals):
 1. x \<in> carrier (Q\<^sub>p\<^bsup>n\<^esup>) \<Longrightarrow> (restrict f (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) \<oplus>\<^bsub>SA n\<^esub> restrict g (carrier (Q\<^sub>p\<^bsup>n\<^esup>))) x = (f \<oplus>\<^bsub>SA n\<^esub> g) x
 2. x \<notin> carrier (Q\<^sub>p\<^bsup>n\<^esup>) \<Longrightarrow> (restrict f (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) \<oplus>\<^bsub>SA n\<^esub> restrict g (carrier (Q\<^sub>p\<^bsup>n\<^esup>))) x = (f \<oplus>\<^bsub>SA n\<^esub> g) x
[PROOF STEP]
apply (metis SA_add)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<notin> carrier (Q\<^sub>p\<^bsup>n\<^esup>) \<Longrightarrow> (restrict f (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) \<oplus>\<^bsub>SA n\<^esub> restrict g (carrier (Q\<^sub>p\<^bsup>n\<^esup>))) x = (f \<oplus>\<^bsub>SA n\<^esub> g) x
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
is_semialg_function n f
is_semialg_function n g

goal (1 subgoal):
 1. x \<notin> carrier (Q\<^sub>p\<^bsup>n\<^esup>) \<Longrightarrow> (restrict f (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) \<oplus>\<^bsub>SA n\<^esub> restrict g (carrier (Q\<^sub>p\<^bsup>n\<^esup>))) x = (f \<oplus>\<^bsub>SA n\<^esub> g) x
[PROOF STEP]
by (metis SA_add')
[PROOF STATE]
proof (state)
this:
(restrict f (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) \<oplus>\<^bsub>SA n\<^esub> restrict g (carrier (Q\<^sub>p\<^bsup>n\<^esup>))) x = (f \<oplus>\<^bsub>SA n\<^esub> g) x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma count_mset_replicate_aux1:
  "\<lbrakk>\<not> x < n; mset ys = mset (replicate n True) + mset (replicate (x - n) False)\<rbrakk>
    \<Longrightarrow> count (mset ys) True = n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<not> x < n; mset ys = mset (replicate n True) + mset (replicate (x - n) False)\<rbrakk> \<Longrightarrow> count (mset ys) True = n
[PROOF STEP]
by (auto simp: count_list_count_mset count_mset)


[STATEMENT]
lemma F_D_part : "F P = {(s, x). s \<in> D P} \<union> {(s, x). s \<notin> D P \<and> (s, x) \<in> F P}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. F P = {(s, x). s \<in> D P} \<union> {(s, x). s \<notin> D P \<and> (s, x) \<in> F P}
[PROOF STEP]
by(auto intro:is_processT8_Pair)


[STATEMENT]
lemma is_aligned_and_not_zero:
  "\<lbrakk> is_aligned n k; n \<noteq> 0 \<rbrakk> \<Longrightarrow> 2 ^ k \<le> n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>is_aligned n k; n \<noteq> 0\<rbrakk> \<Longrightarrow> 2 ^ k \<le> n
[PROOF STEP]
using is_aligned_less_sz leI
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>is_aligned ?a ?sz; ?a \<noteq> 0\<rbrakk> \<Longrightarrow> \<not> ?a < 2 ^ ?sz
\<not> ?x < ?y \<Longrightarrow> ?y \<le> ?x

goal (1 subgoal):
 1. \<lbrakk>is_aligned n k; n \<noteq> 0\<rbrakk> \<Longrightarrow> 2 ^ k \<le> n
[PROOF STEP]
by blast


[STATEMENT]
lemma array_get_set_iff: "i<array_length a \<Longrightarrow>
    array_get (array_set a i x) j = (if i=j then x else array_get a j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i < array_length a \<Longrightarrow> array_get (array_set a i x) j = (if i = j then x else array_get a j)
[PROOF STEP]
by (auto simp: array_get_array_set_other)


[STATEMENT]
lemma Qp_funs_mult:
  assumes "x \<in> carrier (Q\<^sub>p\<^bsup>n\<^esup>)"
  assumes "f \<in> (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) \<rightarrow> carrier Q\<^sub>p"
  assumes "g \<in> (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) \<rightarrow> carrier Q\<^sub>p"
  shows "(f \<otimes>\<^bsub>Fun\<^bsub>n\<^esub> Q\<^sub>p\<^esub> g) x = f x \<otimes> g x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f \<otimes>\<^bsub>function_ring (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) Q\<^sub>p\<^esub> g) x = f x \<otimes> g x
[PROOF STEP]
using assms function_ring_def[of "carrier (Q\<^sub>p\<^bsup>n\<^esup>)" "Q\<^sub>p"]
[PROOF STATE]
proof (prove)
using this:
x \<in> carrier (Q\<^sub>p\<^bsup>n\<^esup>)
f \<in> carrier (Q\<^sub>p\<^bsup>n\<^esup>) \<rightarrow> carrier Q\<^sub>p
g \<in> carrier (Q\<^sub>p\<^bsup>n\<^esup>) \<rightarrow> carrier Q\<^sub>p
function_ring (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) Q\<^sub>p = \<lparr>carrier = carrier (Q\<^sub>p\<^bsup>n\<^esup>) \<rightarrow>\<^sub>E carrier Q\<^sub>p, monoid.mult = function_mult (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) Q\<^sub>p, one = function_one (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) Q\<^sub>p, zero = function_zero (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) Q\<^sub>p, add = function_add (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) Q\<^sub>p, smult = function_scalar_mult (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) Q\<^sub>p\<rparr>

goal (1 subgoal):
 1. (f \<otimes>\<^bsub>function_ring (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) Q\<^sub>p\<^esub> g) x = f x \<otimes> g x
[PROOF STEP]
unfolding function_mult_def
[PROOF STATE]
proof (prove)
using this:
x \<in> carrier (Q\<^sub>p\<^bsup>n\<^esup>)
f \<in> carrier (Q\<^sub>p\<^bsup>n\<^esup>) \<rightarrow> carrier Q\<^sub>p
g \<in> carrier (Q\<^sub>p\<^bsup>n\<^esup>) \<rightarrow> carrier Q\<^sub>p
function_ring (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) Q\<^sub>p = \<lparr>carrier = carrier (Q\<^sub>p\<^bsup>n\<^esup>) \<rightarrow>\<^sub>E carrier Q\<^sub>p, monoid.mult = \<lambda>f g. \<lambda>x\<in>carrier (Q\<^sub>p\<^bsup>n\<^esup>). f x \<otimes> g x, one = function_one (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) Q\<^sub>p, zero = function_zero (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) Q\<^sub>p, add = function_add (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) Q\<^sub>p, smult = function_scalar_mult (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) Q\<^sub>p\<rparr>

goal (1 subgoal):
 1. (f \<otimes>\<^bsub>function_ring (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) Q\<^sub>p\<^esub> g) x = f x \<otimes> g x
[PROOF STEP]
by (metis (no_types, lifting) monoid.select_convs(1) restrict_apply')


[STATEMENT]
lemma (in Group) trivial_FinGroupRep :
  fixes   smult     :: "('f::field, 'g) aezfun \<Rightarrow> 'v::ab_group_add \<Rightarrow> 'v"
  assumes good_char  : "of_nat (card G) \<noteq> (0::'f)"
  and     smult_zero : "\<forall>a\<in>group_ring. smult a (0::'v) = 0"
  shows   "FinGroupRepresentation G smult (0::'v set)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. FinGroupRepresentation G smult 0
[PROOF STEP]
proof (rule FinGroupRepresentation.intro)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. FGModule G smult 0
 2. FinGroupRepresentation_axioms G smult 0
[PROOF STEP]
from smult_zero
[PROOF STATE]
proof (chain)
picking this:
\<forall>a\<in>group_ring. smult a (0::'v) = (0::'v)
[PROOF STEP]
show "FGModule G smult (0::'v set)"
[PROOF STATE]
proof (prove)
using this:
\<forall>a\<in>group_ring. smult a (0::'v) = (0::'v)

goal (1 subgoal):
 1. FGModule G smult 0
[PROOF STEP]
using trivial_FGModule
[PROOF STATE]
proof (prove)
using this:
\<forall>a\<in>group_ring. smult a (0::'v) = (0::'v)
\<forall>a\<in>group_ring. ?smult a (0::?'v) = (0::?'v) \<Longrightarrow> FGModule G ?smult 0

goal (1 subgoal):
 1. FGModule G smult 0
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
FGModule G smult 0

goal (1 subgoal):
 1. FinGroupRepresentation_axioms G smult 0
[PROOF STEP]
have "fscalar_mult.findim (aezfun_scalar_mult.fsmult smult) 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>ms. set ms \<subseteq> 0 \<and> R_scalar_mult.RSpan UNIV (aezfun_scalar_mult.fsmult smult) ms = 0
[PROOF STEP]
by auto (metis R_scalar_mult.RSpan.simps(1) aezfun_scalar_mult.R_scalar_mult empty_set empty_subsetI set_zero)
[PROOF STATE]
proof (state)
this:
\<exists>ms. set ms \<subseteq> 0 \<and> R_scalar_mult.RSpan UNIV (aezfun_scalar_mult.fsmult smult) ms = 0

goal (1 subgoal):
 1. FinGroupRepresentation_axioms G smult 0
[PROOF STEP]
with good_char
[PROOF STATE]
proof (chain)
picking this:
of_nat (card G) \<noteq> (0::'f)
\<exists>ms. set ms \<subseteq> 0 \<and> R_scalar_mult.RSpan UNIV (aezfun_scalar_mult.fsmult smult) ms = 0
[PROOF STEP]
show "FinGroupRepresentation_axioms G smult 0"
[PROOF STATE]
proof (prove)
using this:
of_nat (card G) \<noteq> (0::'f)
\<exists>ms. set ms \<subseteq> 0 \<and> R_scalar_mult.RSpan UNIV (aezfun_scalar_mult.fsmult smult) ms = 0

goal (1 subgoal):
 1. FinGroupRepresentation_axioms G smult 0
[PROOF STEP]
by unfold_locales
[PROOF STATE]
proof (state)
this:
FinGroupRepresentation_axioms G smult 0

goal:
No subgoals!
[PROOF STEP]
qed