[STATEMENT]
theorem density_one_imp_cesaro:
  assumes "\<And>n. u n \<ge> (0::real)" "\<And>n. u n \<le> C"
          "lower_asymptotic_density A = 1"
          "(\<lambda>n. u n * indicator A n) \<longlonglongrightarrow> 0"
  shows "(\<lambda>n. (\<Sum>i<n. u i)/n) \<longlonglongrightarrow> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. sum u {..<n} / real n) \<longlonglongrightarrow> 0
[PROOF STEP]
proof (rule order_tendstoI)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>a. a < 0 \<Longrightarrow> \<forall>\<^sub>F x in sequentially. a < sum u {..<x} / real x
 2. \<And>a. 0 < a \<Longrightarrow> \<forall>\<^sub>F x in sequentially. sum u {..<x} / real x < a
[PROOF STEP]
fix e::real
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>a. a < 0 \<Longrightarrow> \<forall>\<^sub>F x in sequentially. a < sum u {..<x} / real x
 2. \<And>a. 0 < a \<Longrightarrow> \<forall>\<^sub>F x in sequentially. sum u {..<x} / real x < a
[PROOF STEP]
assume "e < 0"
[PROOF STATE]
proof (state)
this:
e < 0

goal (2 subgoals):
 1. \<And>a. a < 0 \<Longrightarrow> \<forall>\<^sub>F x in sequentially. a < sum u {..<x} / real x
 2. \<And>a. 0 < a \<Longrightarrow> \<forall>\<^sub>F x in sequentially. sum u {..<x} / real x < a
[PROOF STEP]
have "(\<Sum>i<n. u i)/n \<ge> 0" for n
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> sum u {..<n} / real n
[PROOF STEP]
using assms(1)
[PROOF STATE]
proof (prove)
using this:
0 \<le> u ?n

goal (1 subgoal):
 1. 0 \<le> sum u {..<n} / real n
[PROOF STEP]
by (simp add: sum_nonneg divide_simps)
[PROOF STATE]
proof (state)
this:
0 \<le> sum u {..<?n} / real ?n

goal (2 subgoals):
 1. \<And>a. a < 0 \<Longrightarrow> \<forall>\<^sub>F x in sequentially. a < sum u {..<x} / real x
 2. \<And>a. 0 < a \<Longrightarrow> \<forall>\<^sub>F x in sequentially. sum u {..<x} / real x < a
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 \<le> sum u {..<?n} / real ?n
[PROOF STEP]
have "(\<Sum>i<n. u i)/n > e" for n
[PROOF STATE]
proof (prove)
using this:
0 \<le> sum u {..<?n} / real ?n

goal (1 subgoal):
 1. e < sum u {..<n} / real n
[PROOF STEP]
using \<open>e < 0\<close> less_le_trans
[PROOF STATE]
proof (prove)
using this:
0 \<le> sum u {..<?n} / real ?n
e < 0
\<lbrakk>?x < ?y; ?y \<le> ?z\<rbrakk> \<Longrightarrow> ?x < ?z

goal (1 subgoal):
 1. e < sum u {..<n} / real n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
e < sum u {..<?n} / real ?n

goal (2 subgoals):
 1. \<And>a. a < 0 \<Longrightarrow> \<forall>\<^sub>F x in sequentially. a < sum u {..<x} / real x
 2. \<And>a. 0 < a \<Longrightarrow> \<forall>\<^sub>F x in sequentially. sum u {..<x} / real x < a
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
e < sum u {..<?n} / real ?n
[PROOF STEP]
show "eventually (\<lambda>n. (\<Sum>i<n. u i)/n > e) sequentially"
[PROOF STATE]
proof (prove)
using this:
e < sum u {..<?n} / real ?n

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. e < sum u {..<n} / real n
[PROOF STEP]
unfolding eventually_sequentially
[PROOF STATE]
proof (prove)
using this:
e < sum u {..<?n} / real ?n

goal (1 subgoal):
 1. \<exists>N. \<forall>n\<ge>N. e < sum u {..<n} / real n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in sequentially. e < sum u {..<n} / real n

goal (1 subgoal):
 1. \<And>a. 0 < a \<Longrightarrow> \<forall>\<^sub>F x in sequentially. sum u {..<x} / real x < a
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a. 0 < a \<Longrightarrow> \<forall>\<^sub>F x in sequentially. sum u {..<x} / real x < a
[PROOF STEP]
fix e::real
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a. 0 < a \<Longrightarrow> \<forall>\<^sub>F x in sequentially. sum u {..<x} / real x < a
[PROOF STEP]
assume "e > 0"
[PROOF STATE]
proof (state)
this:
0 < e

goal (1 subgoal):
 1. \<And>a. 0 < a \<Longrightarrow> \<forall>\<^sub>F x in sequentially. sum u {..<x} / real x < a
[PROOF STEP]
have "C \<ge> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> C
[PROOF STEP]
using \<open>u 0 \<ge> 0\<close> \<open>u 0 \<le> C\<close>
[PROOF STATE]
proof (prove)
using this:
0 \<le> u 0
u 0 \<le> C

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

goal (1 subgoal):
 1. \<And>a. 0 < a \<Longrightarrow> \<forall>\<^sub>F x in sequentially. sum u {..<x} / real x < a
[PROOF STEP]
have "eventually (\<lambda>n. u n * indicator A n < e/4) sequentially"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. u n * indicat_real A n < e / 4
[PROOF STEP]
using order_tendstoD(2)[OF assms(4), of "e/4"] \<open>e>0\<close>
[PROOF STATE]
proof (prove)
using this:
0 < e / 4 \<Longrightarrow> \<forall>\<^sub>F x in sequentially. u x * indicat_real A x < e / 4
0 < e

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. u n * indicat_real A n < e / 4
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in sequentially. u n * indicat_real A n < e / 4

goal (1 subgoal):
 1. \<And>a. 0 < a \<Longrightarrow> \<forall>\<^sub>F x in sequentially. sum u {..<x} / real x < a
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F n in sequentially. u n * indicat_real A n < e / 4
[PROOF STEP]
obtain N where N: "\<And>k. k \<ge> N \<Longrightarrow> u k * indicator A k < e/4"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F n in sequentially. u n * indicat_real A n < e / 4

goal (1 subgoal):
 1. (\<And>N. (\<And>k. N \<le> k \<Longrightarrow> u k * indicat_real A k < e / 4) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding eventually_sequentially
[PROOF STATE]
proof (prove)
using this:
\<exists>N. \<forall>n\<ge>N. u n * indicat_real A n < e / 4

goal (1 subgoal):
 1. (\<And>N. (\<And>k. N \<le> k \<Longrightarrow> u k * indicat_real A k < e / 4) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
N \<le> ?k \<Longrightarrow> u ?k * indicat_real A ?k < e / 4

goal (1 subgoal):
 1. \<And>a. 0 < a \<Longrightarrow> \<forall>\<^sub>F x in sequentially. sum u {..<x} / real x < a
[PROOF STEP]
define B where "B = UNIV - A"
[PROOF STATE]
proof (state)
this:
B = UNIV - A

goal (1 subgoal):
 1. \<And>a. 0 < a \<Longrightarrow> \<forall>\<^sub>F x in sequentially. sum u {..<x} / real x < a
[PROOF STEP]
have *: "upper_asymptotic_density B = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. upper_asymptotic_density B = 0
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
0 \<le> u ?n
u ?n \<le> C
lower_asymptotic_density A = 1
(\<lambda>n. u n * indicat_real A n) \<longlonglongrightarrow> 0

goal (1 subgoal):
 1. upper_asymptotic_density B = 0
[PROOF STEP]
unfolding B_def lower_upper_asymptotic_density_complement
[PROOF STATE]
proof (prove)
using this:
0 \<le> u ?n
u ?n \<le> C
1 - upper_asymptotic_density (UNIV - A) = 1
(\<lambda>n. u n * indicat_real A n) \<longlonglongrightarrow> 0

goal (1 subgoal):
 1. upper_asymptotic_density (UNIV - A) = 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
upper_asymptotic_density B = 0

goal (1 subgoal):
 1. \<And>a. 0 < a \<Longrightarrow> \<forall>\<^sub>F x in sequentially. sum u {..<x} / real x < a
[PROOF STEP]
have "eventually (\<lambda>n. card(B \<inter> {..<n}) < (e/(4 * (C+1))) * n) sequentially"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. real (card (B \<inter> {..<n})) < e / (4 * (C + 1)) * real n
[PROOF STEP]
apply (rule upper_asymptotic_densityD)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. upper_asymptotic_density B < e / (4 * (C + 1))
[PROOF STEP]
using \<open>e > 0\<close> \<open>C \<ge> 0\<close> *
[PROOF STATE]
proof (prove)
using this:
0 < e
0 \<le> C
upper_asymptotic_density B = 0

goal (1 subgoal):
 1. upper_asymptotic_density B < e / (4 * (C + 1))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in sequentially. real (card (B \<inter> {..<n})) < e / (4 * (C + 1)) * real n

goal (1 subgoal):
 1. \<And>a. 0 < a \<Longrightarrow> \<forall>\<^sub>F x in sequentially. sum u {..<x} / real x < a
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F n in sequentially. real (card (B \<inter> {..<n})) < e / (4 * (C + 1)) * real n
[PROOF STEP]
obtain M where M: "\<And>n. n \<ge> M \<Longrightarrow> card(B \<inter> {..<n}) < (e/(4 * (C+1))) * n"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F n in sequentially. real (card (B \<inter> {..<n})) < e / (4 * (C + 1)) * real n

goal (1 subgoal):
 1. (\<And>M. (\<And>n. M \<le> n \<Longrightarrow> real (card (B \<inter> {..<n})) < e / (4 * (C + 1)) * real n) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding eventually_sequentially
[PROOF STATE]
proof (prove)
using this:
\<exists>N. \<forall>n\<ge>N. real (card (B \<inter> {..<n})) < e / (4 * (C + 1)) * real n

goal (1 subgoal):
 1. (\<And>M. (\<And>n. M \<le> n \<Longrightarrow> real (card (B \<inter> {..<n})) < e / (4 * (C + 1)) * real n) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
M \<le> ?n \<Longrightarrow> real (card (B \<inter> {..<?n})) < e / (4 * (C + 1)) * real ?n

goal (1 subgoal):
 1. \<And>a. 0 < a \<Longrightarrow> \<forall>\<^sub>F x in sequentially. sum u {..<x} / real x < a
[PROOF STEP]
obtain P::nat where P: "P \<ge> 4 * N * C/e"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>P. real (4 * N) * C / e \<le> real P \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using real_arch_simple
[PROOF STATE]
proof (prove)
using this:
\<exists>n. ?x \<le> of_nat n

goal (1 subgoal):
 1. (\<And>P. real (4 * N) * C / e \<le> real P \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
real (4 * N) * C / e \<le> real P

goal (1 subgoal):
 1. \<And>a. 0 < a \<Longrightarrow> \<forall>\<^sub>F x in sequentially. sum u {..<x} / real x < a
[PROOF STEP]
define Q where "Q = N + M + 1 + P"
[PROOF STATE]
proof (state)
this:
Q = N + M + 1 + P

goal (1 subgoal):
 1. \<And>a. 0 < a \<Longrightarrow> \<forall>\<^sub>F x in sequentially. sum u {..<x} / real x < a
[PROOF STEP]
have "(\<Sum>i<n. u i)/n < e" if "n \<ge> Q" for n
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum u {..<n} / real n < e
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. sum u {..<n} / real n < e
[PROOF STEP]
have n: "n \<ge> N" "n \<ge> M" "n \<ge> P" "n \<ge> 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (N \<le> n &&& M \<le> n) &&& P \<le> n &&& 1 \<le> n
[PROOF STEP]
using \<open>n \<ge> Q\<close>
[PROOF STATE]
proof (prove)
using this:
Q \<le> n

goal (1 subgoal):
 1. (N \<le> n &&& M \<le> n) &&& P \<le> n &&& 1 \<le> n
[PROOF STEP]
unfolding Q_def
[PROOF STATE]
proof (prove)
using this:
N + M + 1 + P \<le> n

goal (1 subgoal):
 1. (N \<le> n &&& M \<le> n) &&& P \<le> n &&& 1 \<le> n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
N \<le> n
M \<le> n
P \<le> n
1 \<le> n

goal (1 subgoal):
 1. sum u {..<n} / real n < e
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
N \<le> n
M \<le> n
P \<le> n
1 \<le> n
[PROOF STEP]
have n2: "n \<ge> 4 * N * C/e"
[PROOF STATE]
proof (prove)
using this:
N \<le> n
M \<le> n
P \<le> n
1 \<le> n

goal (1 subgoal):
 1. real (4 * N) * C / e \<le> real n
[PROOF STEP]
using P
[PROOF STATE]
proof (prove)
using this:
N \<le> n
M \<le> n
P \<le> n
1 \<le> n
real (4 * N) * C / e \<le> real P

goal (1 subgoal):
 1. real (4 * N) * C / e \<le> real n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
real (4 * N) * C / e \<le> real n

goal (1 subgoal):
 1. sum u {..<n} / real n < e
[PROOF STEP]
have "(\<Sum>i<n. u i) \<le> (\<Sum>i\<in>{..<N} \<union> ({N..<n} \<inter> A) \<union> ({N..<n} - A). u i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum u {..<n} \<le> sum u ({..<N} \<union> {N..<n} \<inter> A \<union> ({N..<n} - A))
[PROOF STEP]
by (rule sum_mono2, auto simp add: assms)
[PROOF STATE]
proof (state)
this:
sum u {..<n} \<le> sum u ({..<N} \<union> {N..<n} \<inter> A \<union> ({N..<n} - A))

goal (1 subgoal):
 1. sum u {..<n} / real n < e
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
sum u {..<n} \<le> sum u ({..<N} \<union> {N..<n} \<inter> A \<union> ({N..<n} - A))

goal (1 subgoal):
 1. sum u {..<n} / real n < e
[PROOF STEP]
have "... = (\<Sum>i\<in>{..<N}. u i) + (\<Sum>i\<in>{N..<n} \<inter> A. u i) + (\<Sum>i\<in>{N..<n} - A. u i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum u ({..<N} \<union> {N..<n} \<inter> A \<union> ({N..<n} - A)) = sum u {..<N} + sum u ({N..<n} \<inter> A) + sum u ({N..<n} - A)
[PROOF STEP]
by (subst sum.union_disjoint, auto)+
[PROOF STATE]
proof (state)
this:
sum u ({..<N} \<union> {N..<n} \<inter> A \<union> ({N..<n} - A)) = sum u {..<N} + sum u ({N..<n} \<inter> A) + sum u ({N..<n} - A)

goal (1 subgoal):
 1. sum u {..<n} / real n < e
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
sum u ({..<N} \<union> {N..<n} \<inter> A \<union> ({N..<n} - A)) = sum u {..<N} + sum u ({N..<n} \<inter> A) + sum u ({N..<n} - A)

goal (1 subgoal):
 1. sum u {..<n} / real n < e
[PROOF STEP]
have "... = (\<Sum>i\<in>{..<N}. u i) + (\<Sum>i\<in>{N..<n} \<inter> A. u i * indicator A i) + (\<Sum>i\<in>{N..<n} - A. u i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum u {..<N} + sum u ({N..<n} \<inter> A) + sum u ({N..<n} - A) = sum u {..<N} + (\<Sum>i\<in>{N..<n} \<inter> A. u i * indicat_real A i) + sum u ({N..<n} - A)
[PROOF STEP]
unfolding indicator_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum u {..<N} + sum u ({N..<n} \<inter> A) + sum u ({N..<n} - A) = sum u {..<N} + (\<Sum>i\<in>{N..<n} \<inter> A. u i * of_bool (i \<in> A)) + sum u ({N..<n} - A)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
sum u {..<N} + sum u ({N..<n} \<inter> A) + sum u ({N..<n} - A) = sum u {..<N} + (\<Sum>i\<in>{N..<n} \<inter> A. u i * indicat_real A i) + sum u ({N..<n} - A)

goal (1 subgoal):
 1. sum u {..<n} / real n < e
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
sum u {..<N} + sum u ({N..<n} \<inter> A) + sum u ({N..<n} - A) = sum u {..<N} + (\<Sum>i\<in>{N..<n} \<inter> A. u i * indicat_real A i) + sum u ({N..<n} - A)

goal (1 subgoal):
 1. sum u {..<n} / real n < e
[PROOF STEP]
have "... \<le> (\<Sum>i\<in>{..<N}. u i) + (\<Sum>i\<in>{N..<n}. u i * indicator A i) + (\<Sum>i\<in> B \<inter> {..<n}. u i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum u {..<N} + (\<Sum>i\<in>{N..<n} \<inter> A. u i * indicat_real A i) + sum u ({N..<n} - A) \<le> sum u {..<N} + (\<Sum>i = N..<n. u i * indicat_real A i) + sum u (B \<inter> {..<n})
[PROOF STEP]
apply (intro add_mono sum_mono2)
[PROOF STATE]
proof (prove)
goal (9 subgoals):
 1. finite {..<N}
 2. {..<N} \<subseteq> {..<N}
 3. \<And>b. b \<in> {..<N} - {..<N} \<Longrightarrow> 0 \<le> u b
 4. finite {N..<n}
 5. {N..<n} \<inter> A \<subseteq> {N..<n}
 6. \<And>b. b \<in> {N..<n} - {N..<n} \<inter> A \<Longrightarrow> 0 \<le> u b * indicat_real A b
 7. finite (B \<inter> {..<n})
 8. {N..<n} - A \<subseteq> B \<inter> {..<n}
 9. \<And>b. b \<in> B \<inter> {..<n} - ({N..<n} - A) \<Longrightarrow> 0 \<le> u b
[PROOF STEP]
unfolding B_def
[PROOF STATE]
proof (prove)
goal (9 subgoals):
 1. finite {..<N}
 2. {..<N} \<subseteq> {..<N}
 3. \<And>b. b \<in> {..<N} - {..<N} \<Longrightarrow> 0 \<le> u b
 4. finite {N..<n}
 5. {N..<n} \<inter> A \<subseteq> {N..<n}
 6. \<And>b. b \<in> {N..<n} - {N..<n} \<inter> A \<Longrightarrow> 0 \<le> u b * indicat_real A b
 7. finite ((UNIV - A) \<inter> {..<n})
 8. {N..<n} - A \<subseteq> (UNIV - A) \<inter> {..<n}
 9. \<And>b. b \<in> (UNIV - A) \<inter> {..<n} - ({N..<n} - A) \<Longrightarrow> 0 \<le> u b
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
0 \<le> u ?n
u ?n \<le> C
lower_asymptotic_density A = 1
(\<lambda>n. u n * indicat_real A n) \<longlonglongrightarrow> 0

goal (9 subgoals):
 1. finite {..<N}
 2. {..<N} \<subseteq> {..<N}
 3. \<And>b. b \<in> {..<N} - {..<N} \<Longrightarrow> 0 \<le> u b
 4. finite {N..<n}
 5. {N..<n} \<inter> A \<subseteq> {N..<n}
 6. \<And>b. b \<in> {N..<n} - {N..<n} \<inter> A \<Longrightarrow> 0 \<le> u b * indicat_real A b
 7. finite ((UNIV - A) \<inter> {..<n})
 8. {N..<n} - A \<subseteq> (UNIV - A) \<inter> {..<n}
 9. \<And>b. b \<in> (UNIV - A) \<inter> {..<n} - ({N..<n} - A) \<Longrightarrow> 0 \<le> u b
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
sum u {..<N} + (\<Sum>i\<in>{N..<n} \<inter> A. u i * indicat_real A i) + sum u ({N..<n} - A) \<le> sum u {..<N} + (\<Sum>i = N..<n. u i * indicat_real A i) + sum u (B \<inter> {..<n})

goal (1 subgoal):
 1. sum u {..<n} / real n < e
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
sum u {..<N} + (\<Sum>i\<in>{N..<n} \<inter> A. u i * indicat_real A i) + sum u ({N..<n} - A) \<le> sum u {..<N} + (\<Sum>i = N..<n. u i * indicat_real A i) + sum u (B \<inter> {..<n})

goal (1 subgoal):
 1. sum u {..<n} / real n < e
[PROOF STEP]
have "... \<le> (\<Sum>i\<in>{..<N}. C) + (\<Sum>i\<in>{N..<n}. e/4) + (\<Sum>i\<in>B \<inter> {..<n}. C)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum u {..<N} + (\<Sum>i = N..<n. u i * indicat_real A i) + sum u (B \<inter> {..<n}) \<le> (\<Sum>i<N. C) + (\<Sum>i = N..<n. e / 4) + (\<Sum>i\<in>B \<inter> {..<n}. C)
[PROOF STEP]
apply (intro add_mono sum_mono)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>i. i \<in> {..<N} \<Longrightarrow> u i \<le> C
 2. \<And>i. i \<in> {N..<n} \<Longrightarrow> u i * indicat_real A i \<le> e / 4
 3. \<And>i. i \<in> B \<inter> {..<n} \<Longrightarrow> u i \<le> C
[PROOF STEP]
using assms less_imp_le[OF N]
[PROOF STATE]
proof (prove)
using this:
0 \<le> u ?n
u ?n \<le> C
lower_asymptotic_density A = 1
(\<lambda>n. u n * indicat_real A n) \<longlonglongrightarrow> 0
N \<le> ?k1 \<Longrightarrow> u ?k1 * indicat_real A ?k1 \<le> e / 4

goal (3 subgoals):
 1. \<And>i. i \<in> {..<N} \<Longrightarrow> u i \<le> C
 2. \<And>i. i \<in> {N..<n} \<Longrightarrow> u i * indicat_real A i \<le> e / 4
 3. \<And>i. i \<in> B \<inter> {..<n} \<Longrightarrow> u i \<le> C
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
sum u {..<N} + (\<Sum>i = N..<n. u i * indicat_real A i) + sum u (B \<inter> {..<n}) \<le> (\<Sum>i<N. C) + (\<Sum>i = N..<n. e / 4) + (\<Sum>i\<in>B \<inter> {..<n}. C)

goal (1 subgoal):
 1. sum u {..<n} / real n < e
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
sum u {..<N} + (\<Sum>i = N..<n. u i * indicat_real A i) + sum u (B \<inter> {..<n}) \<le> (\<Sum>i<N. C) + (\<Sum>i = N..<n. e / 4) + (\<Sum>i\<in>B \<inter> {..<n}. C)

goal (1 subgoal):
 1. sum u {..<n} / real n < e
[PROOF STEP]
have "... = N * C + (n-N) * e/4 + card(B \<inter> {..<n}) * C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i<N. C) + (\<Sum>i = N..<n. e / 4) + (\<Sum>i\<in>B \<inter> {..<n}. C) = real N * C + real (n - N) * e / 4 + real (card (B \<inter> {..<n})) * C
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<Sum>i<N. C) + (\<Sum>i = N..<n. e / 4) + (\<Sum>i\<in>B \<inter> {..<n}. C) = real N * C + real (n - N) * e / 4 + real (card (B \<inter> {..<n})) * C

goal (1 subgoal):
 1. sum u {..<n} / real n < e
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>i<N. C) + (\<Sum>i = N..<n. e / 4) + (\<Sum>i\<in>B \<inter> {..<n}. C) = real N * C + real (n - N) * e / 4 + real (card (B \<inter> {..<n})) * C

goal (1 subgoal):
 1. sum u {..<n} / real n < e
[PROOF STEP]
have "... \<le> n * e/4 + n * e/4 + (e/(4 * (C+1))) * n * C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real N * C + real (n - N) * e / 4 + real (card (B \<inter> {..<n})) * C \<le> real n * e / 4 + real n * e / 4 + e / (4 * (C + 1)) * real n * C
[PROOF STEP]
apply (intro add_mono)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. real N * C \<le> real n * e / 4
 2. real (n - N) * e / 4 \<le> real n * e / 4
 3. real (card (B \<inter> {..<n})) * C \<le> e / (4 * (C + 1)) * real n * C
[PROOF STEP]
using n2 \<open>e > 0\<close> mult_right_mono[OF less_imp_le[OF M[OF \<open>n \<ge> M\<close>]] \<open>C \<ge> 0\<close>]
[PROOF STATE]
proof (prove)
using this:
real (4 * N) * C / e \<le> real n
0 < e
real (card (B \<inter> {..<n})) * C \<le> e / (4 * (C + 1)) * real n * C

goal (3 subgoals):
 1. real N * C \<le> real n * e / 4
 2. real (n - N) * e / 4 \<le> real n * e / 4
 3. real (card (B \<inter> {..<n})) * C \<le> e / (4 * (C + 1)) * real n * C
[PROOF STEP]
by (auto simp add: divide_simps)
[PROOF STATE]
proof (state)
this:
real N * C + real (n - N) * e / 4 + real (card (B \<inter> {..<n})) * C \<le> real n * e / 4 + real n * e / 4 + e / (4 * (C + 1)) * real n * C

goal (1 subgoal):
 1. sum u {..<n} / real n < e
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
real N * C + real (n - N) * e / 4 + real (card (B \<inter> {..<n})) * C \<le> real n * e / 4 + real n * e / 4 + e / (4 * (C + 1)) * real n * C

goal (1 subgoal):
 1. sum u {..<n} / real n < e
[PROOF STEP]
have "... \<le> n * e * 3/4"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real n * e / 4 + real n * e / 4 + e / (4 * (C + 1)) * real n * C \<le> real n * e * 3 / 4
[PROOF STEP]
using \<open>C \<ge> 0\<close> \<open>e > 0\<close>
[PROOF STATE]
proof (prove)
using this:
0 \<le> C
0 < e

goal (1 subgoal):
 1. real n * e / 4 + real n * e / 4 + e / (4 * (C + 1)) * real n * C \<le> real n * e * 3 / 4
[PROOF STEP]
by (simp add: divide_simps algebra_simps)
[PROOF STATE]
proof (state)
this:
real n * e / 4 + real n * e / 4 + e / (4 * (C + 1)) * real n * C \<le> real n * e * 3 / 4

goal (1 subgoal):
 1. sum u {..<n} / real n < e
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
real n * e / 4 + real n * e / 4 + e / (4 * (C + 1)) * real n * C \<le> real n * e * 3 / 4

goal (1 subgoal):
 1. sum u {..<n} / real n < e
[PROOF STEP]
have "... < n * e"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real n * e * 3 / 4 < real n * e
[PROOF STEP]
using \<open>n \<ge> 1\<close> \<open>e > 0\<close>
[PROOF STATE]
proof (prove)
using this:
1 \<le> n
0 < e

goal (1 subgoal):
 1. real n * e * 3 / 4 < real n * e
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
real n * e * 3 / 4 < real n * e

goal (1 subgoal):
 1. sum u {..<n} / real n < e
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
sum u {..<n} < real n * e
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
sum u {..<n} < real n * e

goal (1 subgoal):
 1. sum u {..<n} / real n < e
[PROOF STEP]
using \<open>n \<ge> 1\<close>
[PROOF STATE]
proof (prove)
using this:
sum u {..<n} < real n * e
1 \<le> n

goal (1 subgoal):
 1. sum u {..<n} / real n < e
[PROOF STEP]
by (simp add: divide_simps algebra_simps)
[PROOF STATE]
proof (state)
this:
sum u {..<n} / real n < e

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
Q \<le> ?n \<Longrightarrow> sum u {..<?n} / real ?n < e

goal (1 subgoal):
 1. \<And>a. 0 < a \<Longrightarrow> \<forall>\<^sub>F x in sequentially. sum u {..<x} / real x < a
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
Q \<le> ?n \<Longrightarrow> sum u {..<?n} / real ?n < e
[PROOF STEP]
show "eventually (\<lambda>n. (\<Sum>i<n. u i)/n < e) sequentially"
[PROOF STATE]
proof (prove)
using this:
Q \<le> ?n \<Longrightarrow> sum u {..<?n} / real ?n < e

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. sum u {..<n} / real n < e
[PROOF STEP]
unfolding eventually_sequentially
[PROOF STATE]
proof (prove)
using this:
Q \<le> ?n \<Longrightarrow> sum u {..<?n} / real ?n < e

goal (1 subgoal):
 1. \<exists>N. \<forall>n\<ge>N. sum u {..<n} / real n < e
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in sequentially. sum u {..<n} / real n < e

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma has_real_derivative_imp_continuous_on:
  assumes "\<And>x. x \<in> A \<Longrightarrow> (f has_real_derivative f' x) (at x)"
  shows "continuous_on A f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on A f
[PROOF STEP]
apply (intro differentiable_imp_continuous_on, unfold differentiable_on_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>A. f differentiable at x within A
[PROOF STEP]
using assms differentiable_at_withinI real_differentiable_def
[PROOF STATE]
proof (prove)
using this:
?x \<in> A \<Longrightarrow> (f has_real_derivative f' ?x) (at ?x)
?f differentiable at ?x \<Longrightarrow> ?f differentiable at ?x within ?s
(?f differentiable at ?x within ?s) = (\<exists>D. (?f has_real_derivative D) (at ?x within ?s))

goal (1 subgoal):
 1. \<forall>x\<in>A. f differentiable at x within A
[PROOF STEP]
by blast


[STATEMENT]
lemma Con_append:
    assumes "T \<noteq> []" and "U \<noteq> []" and "V \<noteq> []"
    shows "T @ U \<^sup>*\<frown>\<^sup>* V \<longleftrightarrow> T \<^sup>*\<frown>\<^sup>* V \<and> U \<^sup>*\<frown>\<^sup>* V \<^sup>*\\\<^sup>* T"
    and "T \<^sup>*\<frown>\<^sup>* U @ V \<longleftrightarrow> T \<^sup>*\<frown>\<^sup>* U \<and> T \<^sup>*\\\<^sup>* U \<^sup>*\<frown>\<^sup>* V"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((T @ U) \<^sup>*\\<^sup>* V \<noteq> []) = (T \<^sup>*\\<^sup>* V \<noteq> [] \<and> U \<^sup>*\\<^sup>* (V \<^sup>*\\<^sup>* T) \<noteq> []) &&& (T \<^sup>*\\<^sup>* (U @ V) \<noteq> []) = (T \<^sup>*\\<^sup>* U \<noteq> [] \<and> (T \<^sup>*\\<^sup>* U) \<^sup>*\\<^sup>* V \<noteq> [])
[PROOF STEP]
using assms Resid_append_ind
[PROOF STATE]
proof (prove)
using this:
T \<noteq> []
U \<noteq> []
V \<noteq> []
\<lbrakk>?T \<noteq> []; ?U \<noteq> []; ?V \<noteq> []\<rbrakk> \<Longrightarrow> ((?V @ ?T) \<^sup>*\\<^sup>* ?U \<noteq> []) = (?V \<^sup>*\\<^sup>* ?U \<noteq> [] \<and> ?T \<^sup>*\\<^sup>* (?U \<^sup>*\\<^sup>* ?V) \<noteq> []) \<and> (?T \<^sup>*\\<^sup>* (?V @ ?U) \<noteq> []) = (?T \<^sup>*\\<^sup>* ?V \<noteq> [] \<and> (?T \<^sup>*\\<^sup>* ?V) \<^sup>*\\<^sup>* ?U \<noteq> []) \<and> ((?V @ ?T) \<^sup>*\\<^sup>* ?U \<noteq> [] \<longrightarrow> (?V @ ?T) \<^sup>*\\<^sup>* ?U = ?V \<^sup>*\\<^sup>* ?U @ ?T \<^sup>*\\<^sup>* (?U \<^sup>*\\<^sup>* ?V)) \<and> (?T \<^sup>*\\<^sup>* (?V @ ?U) \<noteq> [] \<longrightarrow> ?T \<^sup>*\\<^sup>* (?V @ ?U) = (?T \<^sup>*\\<^sup>* ?V) \<^sup>*\\<^sup>* ?U)

goal (1 subgoal):
 1. ((T @ U) \<^sup>*\\<^sup>* V \<noteq> []) = (T \<^sup>*\\<^sup>* V \<noteq> [] \<and> U \<^sup>*\\<^sup>* (V \<^sup>*\\<^sup>* T) \<noteq> []) &&& (T \<^sup>*\\<^sup>* (U @ V) \<noteq> []) = (T \<^sup>*\\<^sup>* U \<noteq> [] \<and> (T \<^sup>*\\<^sup>* U) \<^sup>*\\<^sup>* V \<noteq> [])
[PROOF STEP]
by blast+


[STATEMENT]
lemma eq_on_xfer_pointwise: "\<lbrakk>a=a' on r'; r\<subseteq>r'\<rbrakk> \<Longrightarrow> (\<forall>i\<in>r. P (a i)) \<longleftrightarrow> (\<forall>i\<in>r. P (a' i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a = a' on r'; r \<subseteq> r'\<rbrakk> \<Longrightarrow> (\<forall>i\<in>r. P (a i)) = (\<forall>i\<in>r. P (a' i))
[PROOF STEP]
by (auto simp: eq_on_def subset_iff)


[STATEMENT]
lemma independent_substdbasis: "d \<subseteq> Basis \<Longrightarrow> independent d"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d \<subseteq> Basis \<Longrightarrow> independent d
[PROOF STEP]
by (rule independent_mono[OF independent_Basis])


[STATEMENT]
lemma mbhd_insert_correct: "set (mbhd_insert x l) = insert x (set l)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (mbhd_insert x l) = insert x (set l)
[PROOF STEP]
unfolding mbhd_insert_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (if l = [] then [x] else if x = hd l then l else x # l) = insert x (set l)
[PROOF STEP]
by auto


[STATEMENT]
lemma lift_is_subst_ml: "lift k v = subst_ml (\<lambda>n. if n<k then n else n+1) v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lift k v = subst_ml (\<lambda>n. if n < k then n else n + 1) v
[PROOF STEP]
by(induct k v rule:lift_ml.induct)(simp_all add:list_eq_iff_nth_eq)


[STATEMENT]
lemma splay_map_of_inorder:
  "splay x t = Node l a r \<Longrightarrow> sorted1(inorder t) \<Longrightarrow>
   map_of (inorder t) x = (if x = fst a then Some(snd a) else None)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Splay_Map.splay x t = \<langle>l, a, r\<rangle>; sorted1 (inorder t)\<rbrakk> \<Longrightarrow> AList_Upd_Del.map_of (inorder t) x = (if x = fst a then Some (snd a) else None)
[PROOF STEP]
by(induction x t arbitrary: l a r rule: splay.induct)
  (auto simp: map_of_simps splay_Leaf_iff split: tree.splits)


[STATEMENT]
lemma iterates_mono:
  assumes f: "f \<in> ccpo.iterates (fun_lub Sup) (fun_ord (\<le>)) F"
  and mono: "\<And>f. monotone (\<sqsubseteq>) (\<le>) f \<Longrightarrow> monotone (\<sqsubseteq>) (\<le>) (F f)"
  shows "monotone (\<sqsubseteq>) (\<le>) f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. monotone (\<sqsubseteq>) (\<le>) f
[PROOF STEP]
using f
[PROOF STATE]
proof (prove)
using this:
f \<in> ccpo.iterates (fun_lub Sup) (fun_ord (\<le>)) F

goal (1 subgoal):
 1. monotone (\<sqsubseteq>) (\<le>) f
[PROOF STEP]
by(induction rule: ccpo.iterates.induct[OF ccpo_fun, consumes 1, case_names step Sup])(blast intro: mono mono_lub)+


[STATEMENT]
lemma signed_drop_bit_word_numeral [simp]:
  \<open>signed_drop_bit (numeral n) (numeral k) =
    (word_of_int (drop_bit (numeral n) (signed_take_bit (LENGTH('a) - 1) (numeral k))) :: 'a::len word)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. signed_drop_bit (numeral n) (numeral k) = word_of_int (drop_bit (numeral n) (signed_take_bit (LENGTH('a) - 1) (numeral k)))
[PROOF STEP]
by transfer simp


[STATEMENT]
lemma esssup_zero_space:
  "emeasure M (space M) = 0 \<Longrightarrow> f \<in> borel_measurable M \<Longrightarrow> esssup M f = (- \<infinity>::ereal)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>emeasure M (space M) = 0; f \<in> borel_measurable M\<rbrakk> \<Longrightarrow> esssup M f = - \<infinity>
[PROOF STEP]
by (simp add: esssup_def ae_filter_eq_bot_iff[symmetric] bot_ereal_def)


[STATEMENT]
lemma disj_matrices_commute: "disj_matrices A B = disj_matrices B A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. disj_matrices A B = disj_matrices B A
[PROOF STEP]
by (auto simp add: disj_matrices_def)


[STATEMENT]
lemma precedes_in_tail:
  assumes "x \<noteq> z"
  shows "x \<preceq> y in (z # zs) \<longleftrightarrow> x \<preceq> y in zs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<preceq> y in (z # zs)) = (x \<preceq> y in zs)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
x \<noteq> z

goal (1 subgoal):
 1. (x \<preceq> y in (z # zs)) = (x \<preceq> y in zs)
[PROOF STEP]
unfolding precedes_def
[PROOF STATE]
proof (prove)
using this:
x \<noteq> z

goal (1 subgoal):
 1. (\<exists>l r. z # zs = l @ x # r \<and> y \<in> set (x # r)) = (\<exists>l r. zs = l @ x # r \<and> y \<in> set (x # r))
[PROOF STEP]
by (auto simp: Cons_eq_append_conv)


[STATEMENT]
lemma in_sstart[simp]: "s \<in> sstart S (x # xs) \<longleftrightarrow> shd s = x \<and> stl s \<in> sstart S xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (s \<in> sstart S (x # xs)) = (shd s = x \<and> stl s \<in> sstart S xs)
[PROOF STEP]
by (cases s) (auto simp: sstart.simps(2))


[STATEMENT]
lemma nat_0_1_induct [case_names 0 1 step]:
  assumes "P 0" "P 1" "\<And>n. n \<ge> 1 \<Longrightarrow> P n \<Longrightarrow> P (Suc n)"
  shows   "P n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P n
[PROOF STEP]
proof (induction n rule: less_induct)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. (\<And>y. y < x \<Longrightarrow> P y) \<Longrightarrow> P x
[PROOF STEP]
case (less n)
[PROOF STATE]
proof (state)
this:
?y < n \<Longrightarrow> P ?y

goal (1 subgoal):
 1. \<And>x. (\<And>y. y < x \<Longrightarrow> P y) \<Longrightarrow> P x
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P n
[PROOF STEP]
using assms(3)[OF _ less.IH[of "n - 1"]]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>1 \<le> n - 1; n - 1 < n\<rbrakk> \<Longrightarrow> P (Suc (n - 1))

goal (1 subgoal):
 1. P n
[PROOF STEP]
by (cases "n \<le> 1")
      (insert assms(1-2),auto simp: eval_nat_numeral le_Suc_eq)
[PROOF STATE]
proof (state)
this:
P n

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma sin_x_ge_neg_x:
  fixes x :: real
  assumes x: "x \<ge> 0"
  shows "sin x \<ge> - x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - x \<le> sin x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. - x \<le> sin x
[PROOF STEP]
let ?f = "\<lambda>x. x + sin x"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. - x \<le> sin x
[PROOF STEP]
have \<section>: "\<And>u. \<lbrakk>0 \<le> u; u \<le> x\<rbrakk> \<Longrightarrow> \<exists>y. (?f has_real_derivative 1 + cos u) (at u)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>u. \<lbrakk>0 \<le> u; u \<le> x\<rbrakk> \<Longrightarrow> \<exists>y. ((\<lambda>x. x + sin x) has_real_derivative 1 + cos u) (at u)
[PROOF STEP]
by (auto intro!: derivative_eq_intros simp: field_simps)
[PROOF STATE]
proof (state)
this:
\<lbrakk>0 \<le> ?u1; ?u1 \<le> x\<rbrakk> \<Longrightarrow> \<exists>y. ((\<lambda>x. x + sin x) has_real_derivative 1 + cos ?u1) (at ?u1)

goal (1 subgoal):
 1. - x \<le> sin x
[PROOF STEP]
have "?f x \<ge> ?f 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 + sin 0 \<le> x + sin x
[PROOF STEP]
by (rule DERIV_nonneg_imp_nondecreasing [OF assms]) (use \<section> real_0_le_add_iff in force)
[PROOF STATE]
proof (state)
this:
0 + sin 0 \<le> x + sin x

goal (1 subgoal):
 1. - x \<le> sin x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 + sin 0 \<le> x + sin x
[PROOF STEP]
show "sin x \<ge> -x"
[PROOF STATE]
proof (prove)
using this:
0 + sin 0 \<le> x + sin x

goal (1 subgoal):
 1. - x \<le> sin x
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
- x \<le> sin x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma lconjseq_snoc: "lconjseq (xs@[x]) = lconjseq xs @ [lconjby (sum_list xs) x]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lconjseq (xs @ [x]) = lconjseq xs @ [lconjby (sum_list xs) x]
[PROOF STEP]
by (induct xs) (auto simp add: lconjby_add)


[STATEMENT]
lemma rbl_word_and: "rev (to_bl (x AND y)) = map2 (\<and>) (rev (to_bl x)) (rev (to_bl y))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rev (to_bl (x AND y)) = map2 (\<and>) (rev (to_bl x)) (rev (to_bl y))
[PROOF STEP]
by (simp add: zip_rev bl_word_and rev_map)


[STATEMENT]
lemma mult_if_then:"((v = (if P then 1 else 0))
                    \<and> (w = (if Q then 1 else 0)))
                       \<Longrightarrow> (rat_poly_times v w = (if (P\<and>Q) then 1 else 0))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. v = (if P then 1 else 0) \<and> w = (if Q then 1 else 0) \<Longrightarrow> rat_poly_times v w = (if P \<and> Q then 1 else 0)
[PROOF STEP]
by auto


[STATEMENT]
lemma map_cond_spmf_fst: "map_spmf f (cond_spmf_fst p x) = cond_spmf_fst (map_spmf (apsnd f) p) x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map_spmf f (cond_spmf_fst p x) = cond_spmf_fst (map_spmf (apsnd f) p) x
[PROOF STEP]
by(auto simp add: cond_spmf_fst_def spmf.map_comp intro!: map_spmf_cong arg_cong2[where f="cond_spmf"])


[STATEMENT]
lemma swap_swaps:
  "arr' = swap arr x y \<Longrightarrow> arr' y = arr x \<and> arr' x = arr y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. arr' = swap arr x y \<Longrightarrow> arr' y = arr x \<and> arr' x = arr y
[PROOF STEP]
unfolding swap_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. arr' = arr(x := arr y, y := arr x) \<Longrightarrow> arr' y = arr x \<and> arr' x = arr y
[PROOF STEP]
by simp


[STATEMENT]
lemma irreducible_primitive_part:
  assumes "irreducible p" and "degree p > 0"
  shows "primitive_part p = p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. primitive_part p = p
[PROOF STEP]
using irreducible_content[OF assms(1), unfolded primitive_iff_content_eq_1] assms(2)
[PROOF STATE]
proof (prove)
using this:
degree p = 0 \<or> content p = (1::'a)
0 < degree p

goal (1 subgoal):
 1. primitive_part p = p
[PROOF STEP]
by (auto simp: primitive_part_def abs_poly_def)


[STATEMENT]
lemma n_bool_lists_True_count: "xs \<in> set (n_bool_lists n x) \<Longrightarrow> count_list xs True = n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. xs \<in> set (n_bool_lists n x) \<Longrightarrow> count_list xs True = n
[PROOF STEP]
by (induct x arbitrary: xs n) (auto split: if_splits simp: count_list_replicate)


[STATEMENT]
lemma quorum_union:"quorum Q \<Longrightarrow> quorum Q' \<Longrightarrow> quorum (Q \<union> Q')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>quorum Q; quorum Q'\<rbrakk> \<Longrightarrow> quorum (Q \<union> Q')
[PROOF STEP]
unfolding quorum_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>p\<in>Q \<inter> W. \<exists>Sl\<in>slices p. Sl \<subseteq> Q; \<forall>p\<in>Q' \<inter> W. \<exists>Sl\<in>slices p. Sl \<subseteq> Q'\<rbrakk> \<Longrightarrow> \<forall>p\<in>(Q \<union> Q') \<inter> W. \<exists>Sl\<in>slices p. Sl \<subseteq> Q \<union> Q'
[PROOF STEP]
by (metis IntE Int_iff UnE inf_sup_aci(1) sup.coboundedI1 sup.coboundedI2)


[STATEMENT]
lemma orthogonal_rvsum:
    "\<lbrakk>finite s; \<And>y. y \<in> s \<Longrightarrow> orthogonal x (f y)\<rbrakk> \<Longrightarrow> orthogonal x (sum f s)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite s; \<And>y. y \<in> s \<Longrightarrow> orthogonal x (f y)\<rbrakk> \<Longrightarrow> orthogonal x (sum f s)
[PROOF STEP]
by (induction s rule: finite_induct) (auto simp: orthogonal_clauses)


[STATEMENT]
lemma after_summary_Sum_fun: "finite MM \<Longrightarrow> after_summary (\<Sum>M\<in>MM. f M) A = (\<Sum>M\<in>MM. after_summary (f M) A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite MM \<Longrightarrow> after_summary (sum f MM) A = (\<Sum>M\<in>MM. after_summary (f M) A)
[PROOF STEP]
by (induct MM rule: finite_induct) (auto simp: after_summary_union)


[STATEMENT]
lemma gcd_mult_unit2: "is_unit a \<Longrightarrow> gcd b (c * a) = gcd b c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_unit a \<Longrightarrow> gcd b (c * a) = gcd b c
[PROOF STEP]
using gcd.commute gcd_mult_unit1
[PROOF STATE]
proof (prove)
using this:
gcd ?a ?b = gcd ?b ?a
is_unit ?a \<Longrightarrow> gcd (?b * ?a) ?c = gcd ?b ?c

goal (1 subgoal):
 1. is_unit a \<Longrightarrow> gcd b (c * a) = gcd b c
[PROOF STEP]
by auto


[STATEMENT]
lemma quat_norm_imaginary: "Re x = 0 \<Longrightarrow> x\<^sup>2 = - (quat_of_real (norm x))\<^sup>2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. quat.Re x = 0 \<Longrightarrow> x\<^sup>2 = - (quat_of_real (norm x))\<^sup>2
[PROOF STEP]
unfolding quat_norm_pow_2
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. quat.Re x = 0 \<Longrightarrow> x\<^sup>2 = - (x * Quaternions.cnj x)
[PROOF STEP]
by (cases x) (auto simp: power2_eq_square cnj.ctr times_quat.ctr uminus_quat.ctr)


[STATEMENT]
lemma image_mset_single: "image_mset f {#x#} = {#f x#}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. image_mset f {#x#} = {#f x#}
[PROOF STEP]
by (simp add: comp_fun_commute.fold_mset_add_mset comp_fun_commute_mset_image image_mset_def)


[STATEMENT]
lemma filterlim_of_int_at_top:
  "filterlim f F at_top \<Longrightarrow> filterlim (\<lambda>x. f (of_int x :: real)) F at_top"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. filterlim f F at_top \<Longrightarrow> LIM x at_top. f (real_of_int x) :> F
[PROOF STEP]
by (erule filterlim_compose[OF _ filterlim_real_of_int_at_top])


[STATEMENT]
lemma iMOD_induct: "
  \<lbrakk> P r; \<And>k. \<lbrakk> k \<in> [r, mod m]; P k \<rbrakk> \<Longrightarrow> P (k + m); a \<in> [r, mod m] \<rbrakk> \<Longrightarrow> P a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>P r; \<And>k. \<lbrakk>k \<in> [ r, mod m ]; P k\<rbrakk> \<Longrightarrow> P (k + m); a \<in> [ r, mod m ]\<rbrakk> \<Longrightarrow> P a
[PROOF STEP]
apply (rule inext_induct[of _ "[r, mod m]"])
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<lbrakk>P r; \<And>k. \<lbrakk>k \<in> [ r, mod m ]; P k\<rbrakk> \<Longrightarrow> P (k + m); a \<in> [ r, mod m ]\<rbrakk> \<Longrightarrow> P (iMin [ r, mod m ])
 2. \<And>n. \<lbrakk>P r; \<And>k. \<lbrakk>k \<in> [ r, mod m ]; P k\<rbrakk> \<Longrightarrow> P (k + m); a \<in> [ r, mod m ]; n \<in> [ r, mod m ]; P n\<rbrakk> \<Longrightarrow> P (inext n [ r, mod m ])
 3. \<lbrakk>P r; \<And>k. \<lbrakk>k \<in> [ r, mod m ]; P k\<rbrakk> \<Longrightarrow> P (k + m); a \<in> [ r, mod m ]\<rbrakk> \<Longrightarrow> a \<in> [ r, mod m ]
[PROOF STEP]
apply (simp add: iT_Min iT_inext_if)+
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma bigo_bounded: "\<forall>x. 0 \<le> f x \<Longrightarrow> \<forall>x. f x \<le> g x \<Longrightarrow> f \<in> O(g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>x. (0::'b) \<le> f x; \<forall>x. f x \<le> g x\<rbrakk> \<Longrightarrow> f \<in> O(g)
[PROOF STEP]
apply (erule bigo_bounded_alt [of f 1 g])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x. f x \<le> g x \<Longrightarrow> \<forall>x. f x \<le> (1::'b) * g x
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma finite_carrier_rpr_iff_u:
  assumes "finite carrier"
    and "(relation::'a relation) \<subseteq> carrier \<times> carrier"
  shows "rational_preference carrier relation \<longleftrightarrow> (\<exists>u. ordinal_utility carrier relation u)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rational_preference carrier relation = (\<exists>u. ordinal_utility carrier relation u)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. rational_preference carrier relation \<Longrightarrow> \<exists>u. ordinal_utility carrier relation u
 2. \<exists>u. ordinal_utility carrier relation u \<Longrightarrow> rational_preference carrier relation
[PROOF STEP]
assume "rational_preference carrier relation"
[PROOF STATE]
proof (state)
this:
rational_preference carrier relation

goal (2 subgoals):
 1. rational_preference carrier relation \<Longrightarrow> \<exists>u. ordinal_utility carrier relation u
 2. \<exists>u. ordinal_utility carrier relation u \<Longrightarrow> rational_preference carrier relation
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
rational_preference carrier relation
[PROOF STEP]
show "\<exists>u. ordinal_utility carrier relation u"
[PROOF STATE]
proof (prove)
using this:
rational_preference carrier relation

goal (1 subgoal):
 1. \<exists>u. ordinal_utility carrier relation u
[PROOF STEP]
by (simp add: assms(1) fnt_carrier_exists_util_fun)
[PROOF STATE]
proof (state)
this:
\<exists>u. ordinal_utility carrier relation u

goal (1 subgoal):
 1. \<exists>u. ordinal_utility carrier relation u \<Longrightarrow> rational_preference carrier relation
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>u. ordinal_utility carrier relation u \<Longrightarrow> rational_preference carrier relation
[PROOF STEP]
assume "\<exists>u. ordinal_utility carrier relation u"
[PROOF STATE]
proof (state)
this:
\<exists>u. ordinal_utility carrier relation u

goal (1 subgoal):
 1. \<exists>u. ordinal_utility carrier relation u \<Longrightarrow> rational_preference carrier relation
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>u. ordinal_utility carrier relation u
[PROOF STEP]
show "rational_preference carrier relation"
[PROOF STATE]
proof (prove)
using this:
\<exists>u. ordinal_utility carrier relation u

goal (1 subgoal):
 1. rational_preference carrier relation
[PROOF STEP]
by (metis (full_types) order_on_defs(1) ordinal_utility.util_imp_refl
        ordinal_utility.util_imp_total ordinal_utility.util_imp_trans ordinal_utility_def
        preference.intro rational_preference_axioms_def rational_preference_def)
[PROOF STATE]
proof (state)
this:
rational_preference carrier relation

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in field) subgroup_mult_of :
  assumes "subfield K R"
  shows "subgroup (K - {\<zero>}) (mult_of R)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subgroup (K - {\<zero>}) (mult_of R)
[PROOF STEP]
proof (intro group.group_incl_imp_subgroup[OF field_mult_group])
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. K - {\<zero>} \<subseteq> carrier (mult_of R)
 2. Group.group (mult_of R\<lparr>carrier := K - {\<zero>}\<rparr>)
[PROOF STEP]
show "K - {\<zero>} \<subseteq> carrier (mult_of R)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. K - {\<zero>} \<subseteq> carrier (mult_of R)
[PROOF STEP]
by (simp add: Diff_mono assms carrier_mult_of subfieldE(3))
[PROOF STATE]
proof (state)
this:
K - {\<zero>} \<subseteq> carrier (mult_of R)

goal (1 subgoal):
 1. Group.group (mult_of R\<lparr>carrier := K - {\<zero>}\<rparr>)
[PROOF STEP]
show "group ((mult_of R) \<lparr> carrier := K - {\<zero>} \<rparr>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Group.group (mult_of R\<lparr>carrier := K - {\<zero>}\<rparr>)
[PROOF STEP]
using field.field_mult_group[OF subfield_iff(2)[OF assms]]
[PROOF STATE]
proof (prove)
using this:
Group.group (mult_of (R\<lparr>carrier := K\<rparr>))

goal (1 subgoal):
 1. Group.group (mult_of R\<lparr>carrier := K - {\<zero>}\<rparr>)
[PROOF STEP]
unfolding mult_of_def
[PROOF STATE]
proof (prove)
using this:
Group.group \<lparr>carrier = carrier (R\<lparr>carrier := K\<rparr>) - {\<zero>\<^bsub>R\<lparr>carrier := K\<rparr>\<^esub>}, mult = (\<otimes>\<^bsub>R\<lparr>carrier := K\<rparr>\<^esub>), one = \<one>\<^bsub>R\<lparr>carrier := K\<rparr>\<^esub>\<rparr>

goal (1 subgoal):
 1. Group.group (\<lparr>carrier = carrier R - {\<zero>}, mult = (\<otimes>), one = \<one>\<rparr>\<lparr>carrier := K - {\<zero>}\<rparr>)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Group.group (mult_of R\<lparr>carrier := K - {\<zero>}\<rparr>)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma continuous_imp_quotient_map:
   "\<lbrakk>continuous_map X Y f; compact_space X; Hausdorff_space Y; f ` (topspace X) = topspace Y\<rbrakk>
        \<Longrightarrow> quotient_map X Y f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>continuous_map X Y f; compact_space X; Hausdorff_space Y; f ` topspace X = topspace Y\<rbrakk> \<Longrightarrow> quotient_map X Y f
[PROOF STEP]
by (simp add: continuous_imp_closed_map continuous_closed_imp_quotient_map)


[STATEMENT]
lemma bits_ident:
  "push_bit n (drop_bit n a) + take_bit n a = a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. push_bit n (drop_bit n a) + take_bit n a = a
[PROOF STEP]
using div_mult_mod_eq
[PROOF STATE]
proof (prove)
using this:
?a div ?b * ?b + ?a mod ?b = ?a

goal (1 subgoal):
 1. push_bit n (drop_bit n a) + take_bit n a = a
[PROOF STEP]
by (simp add: push_bit_eq_mult take_bit_eq_mod drop_bit_eq_div)


[STATEMENT]
lemma fps_exp_neq_0 [simp]: "\<not>fps_exp (c :: 'a :: field_char_0) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fps_exp c \<noteq> 0
[PROOF STEP]
unfolding fps_const_0_eq_0 [symmetric] fps_exp_eq_fps_const_iff
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> (c = (0::'a) \<and> (0::'a) = (1::'a))
[PROOF STEP]
by simp


[STATEMENT]
lemma topology_bases_eq_aux:
   "\<lbrakk>(arbitrary union_of P) S;
     \<And>U x. \<lbrakk>P U; x \<in> U\<rbrakk> \<Longrightarrow> \<exists>V. Q V \<and> x \<in> V \<and> V \<subseteq> U\<rbrakk>
        \<Longrightarrow> (arbitrary union_of Q) S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(arbitrary union_of P) S; \<And>U x. \<lbrakk>P U; x \<in> U\<rbrakk> \<Longrightarrow> \<exists>V. Q V \<and> x \<in> V \<and> V \<subseteq> U\<rbrakk> \<Longrightarrow> (arbitrary union_of Q) S
[PROOF STEP]
by (metis arbitrary_union_of_alt arbitrary_union_of_idempot)


[STATEMENT]
lemma S'_var:
  "S' = S - M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. S' = S - M
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. S' = S - M
[PROOF STEP]
have "S' = S * (1 - Z\<^sup>T)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. S' = S * ((1::'a) - Z\<^sup>T)
[PROOF STEP]
by (simp add: Z_point covector_comp_inf vector_conv_compl)
[PROOF STATE]
proof (state)
this:
S' = S * ((1::'a) - Z\<^sup>T)

goal (1 subgoal):
 1. S' = S - M
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
S' = S * ((1::'a) - Z\<^sup>T)

goal (1 subgoal):
 1. S' = S - M
[PROOF STEP]
have "... = S * (1 - Z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. S * ((1::'a) - Z\<^sup>T) = S * ((1::'a) - Z)
[PROOF STEP]
by (metis conv_complement one_inf_conv)
[PROOF STATE]
proof (state)
this:
S * ((1::'a) - Z\<^sup>T) = S * ((1::'a) - Z)

goal (1 subgoal):
 1. S' = S - M
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
S * ((1::'a) - Z\<^sup>T) = S * ((1::'a) - Z)

goal (1 subgoal):
 1. S' = S - M
[PROOF STEP]
have "... = S * 1 \<sqinter> S * -Z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. S * ((1::'a) - Z) = S * (1::'a) \<sqinter> S * - Z
[PROOF STEP]
by (simp add: S_mapping univalent_comp_left_dist_inf)
[PROOF STATE]
proof (state)
this:
S * ((1::'a) - Z) = S * (1::'a) \<sqinter> S * - Z

goal (1 subgoal):
 1. S' = S - M
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
S * ((1::'a) - Z) = S * (1::'a) \<sqinter> S * - Z

goal (1 subgoal):
 1. S' = S - M
[PROOF STEP]
have "... = S - M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. S * (1::'a) \<sqinter> S * - Z = S - M
[PROOF STEP]
by (simp add: comp_mapping_complement S_mapping)
[PROOF STATE]
proof (state)
this:
S * (1::'a) \<sqinter> S * - Z = S - M

goal (1 subgoal):
 1. S' = S - M
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
S' = S - M
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
S' = S - M

goal (1 subgoal):
 1. S' = S - M
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
S' = S - M

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma cot_pfd_real_minus [simp]: "cot_pfd (-x :: real) = -cot_pfd x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cot_pfd (- x) = - cot_pfd x
[PROOF STEP]
using cot_pfd_complex_minus[of "of_real x"]
[PROOF STATE]
proof (prove)
using this:
cot_pfd (- complex_of_real x) = - cot_pfd (complex_of_real x)

goal (1 subgoal):
 1. cot_pfd (- x) = - cot_pfd x
[PROOF STEP]
unfolding of_real_minus [symmetric] cot_pfd_complex_of_real of_real_eq_iff
[PROOF STATE]
proof (prove)
using this:
cot_pfd (- x) = - cot_pfd x

goal (1 subgoal):
 1. cot_pfd (- x) = - cot_pfd x
[PROOF STEP]
.


[STATEMENT]
lemma outSetCorelatedEmpty2:
 assumes "outSetCorelated x = {}"   and correct3:"OUTfromV_VARto"
 shows  "OUTfromV x = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. OUTfromV x = {}
[PROOF STEP]
proof (rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. OUTfromV x \<noteq> {} \<Longrightarrow> False
[PROOF STEP]
assume OUTfromVNonempty:"OUTfromV x \<noteq> {}"
[PROOF STATE]
proof (state)
this:
OUTfromV x \<noteq> {}

goal (1 subgoal):
 1. OUTfromV x \<noteq> {} \<Longrightarrow> False
[PROOF STEP]
from this and correct3
[PROOF STATE]
proof (chain)
picking this:
OUTfromV x \<noteq> {}
OUTfromV_VARto
[PROOF STEP]
have "x \<in> outSetCorelated x"
[PROOF STATE]
proof (prove)
using this:
OUTfromV x \<noteq> {}
OUTfromV_VARto

goal (1 subgoal):
 1. x \<in> outSetCorelated x
[PROOF STEP]
by (rule outSetCorelatedNonemptyX)
[PROOF STATE]
proof (state)
this:
x \<in> outSetCorelated x

goal (1 subgoal):
 1. OUTfromV x \<noteq> {} \<Longrightarrow> False
[PROOF STEP]
from this and assms
[PROOF STATE]
proof (chain)
picking this:
x \<in> outSetCorelated x
outSetCorelated x = {}
OUTfromV_VARto
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
x \<in> outSetCorelated x
outSetCorelated x = {}
OUTfromV_VARto

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem Euler_Rule_Amicable_1:
  fixes m n a :: nat
  assumes "m \<ge> 1" and "n \<ge> 1" and "a \<ge> 1"
      and "Esigma m = Esigma n" and "Esigma a * Esigma m = a*(m+n)"
      and "gcd a m =1" and "gcd a n =1"
      shows "(a*m) Amic (a*n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a * m) Amic (a * n)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (a * m) Amic (a * n)
[PROOF STEP]
have a: "Esigma (a*m) =(Esigma a)*(Esigma m)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Esigma (a * m) = Esigma a * Esigma m
[PROOF STEP]
using assms  gcd_Esigma_mult
[PROOF STATE]
proof (prove)
using this:
1 \<le> m
1 \<le> n
1 \<le> a
Esigma m = Esigma n
Esigma a * Esigma m = a * (m + n)
gcd a m = 1
gcd a n = 1
gcd ?m ?n = 1 \<Longrightarrow> Esigma (?m * ?n) = Esigma ?m * Esigma ?n

goal (1 subgoal):
 1. Esigma (a * m) = Esigma a * Esigma m
[PROOF STEP]
by (simp add: mult.commute)
[PROOF STATE]
proof (state)
this:
Esigma (a * m) = Esigma a * Esigma m

goal (1 subgoal):
 1. (a * m) Amic (a * n)
[PROOF STEP]
have b: "Esigma (a*m) = Esigma (a*n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Esigma (a * m) = Esigma (a * n)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Esigma (a * m) = Esigma (a * n)
[PROOF STEP]
have c: "Esigma (a*n) = (Esigma a)*(Esigma n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Esigma (a * n) = Esigma a * Esigma n
[PROOF STEP]
using gcd_Esigma_mult \<open>gcd a n =1\<close>
[PROOF STATE]
proof (prove)
using this:
gcd ?m ?n = 1 \<Longrightarrow> Esigma (?m * ?n) = Esigma ?m * Esigma ?n
gcd a n = 1

goal (1 subgoal):
 1. Esigma (a * n) = Esigma a * Esigma n
[PROOF STEP]
by (metis assms(4) a )
[PROOF STATE]
proof (state)
this:
Esigma (a * n) = Esigma a * Esigma n

goal (1 subgoal):
 1. Esigma (a * m) = Esigma (a * n)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Esigma (a * m) = Esigma (a * n)
[PROOF STEP]
using c a assms
[PROOF STATE]
proof (prove)
using this:
Esigma (a * n) = Esigma a * Esigma n
Esigma (a * m) = Esigma a * Esigma m
1 \<le> m
1 \<le> n
1 \<le> a
Esigma m = Esigma n
Esigma a * Esigma m = a * (m + n)
gcd a m = 1
gcd a n = 1

goal (1 subgoal):
 1. Esigma (a * m) = Esigma (a * n)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Esigma (a * m) = Esigma (a * n)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
Esigma (a * m) = Esigma (a * n)

goal (1 subgoal):
 1. (a * m) Amic (a * n)
[PROOF STEP]
have d: " Esigma (a*m) = a*m + a*n "
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Esigma (a * m) = a * m + a * n
[PROOF STEP]
using a assms
[PROOF STATE]
proof (prove)
using this:
Esigma (a * m) = Esigma a * Esigma m
1 \<le> m
1 \<le> n
1 \<le> a
Esigma m = Esigma n
Esigma a * Esigma m = a * (m + n)
gcd a m = 1
gcd a n = 1

goal (1 subgoal):
 1. Esigma (a * m) = a * m + a * n
[PROOF STEP]
by (simp add: add_mult_distrib2)
[PROOF STATE]
proof (state)
this:
Esigma (a * m) = a * m + a * n

goal (1 subgoal):
 1. (a * m) Amic (a * n)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a * m) Amic (a * n)
[PROOF STEP]
using a b d Amicable_pair_equiv_def_conv assms
[PROOF STATE]
proof (prove)
using this:
Esigma (a * m) = Esigma a * Esigma m
Esigma (a * m) = Esigma (a * n)
Esigma (a * m) = a * m + a * n
\<lbrakk>1 \<le> ?m; 1 \<le> ?n; Esigma ?m = Esigma ?n \<and> Esigma ?m = ?m + ?n\<rbrakk> \<Longrightarrow> ?m Amic ?n
1 \<le> m
1 \<le> n
1 \<le> a
Esigma m = Esigma n
Esigma a * Esigma m = a * (m + n)
gcd a m = 1
gcd a n = 1

goal (1 subgoal):
 1. (a * m) Amic (a * n)
[PROOF STEP]
by (simp add: Suc_leI)
[PROOF STATE]
proof (state)
this:
(a * m) Amic (a * n)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma scc_non_empty'[simp]: "is_scc E U \<Longrightarrow> U\<noteq>{}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_scc E U \<Longrightarrow> U \<noteq> {}
[PROOF STEP]
unfolding is_scc_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. U \<times> U \<subseteq> E\<^sup>* \<and> (\<forall>V. U \<subset> V \<longrightarrow> \<not> V \<times> V \<subseteq> E\<^sup>*) \<Longrightarrow> U \<noteq> {}
[PROOF STEP]
by auto


[STATEMENT]
lemma closedin_derived_set:
     "closedin (subtopology X T) S \<longleftrightarrow>
      S \<subseteq> topspace X \<and> S \<subseteq> T \<and> (\<forall>x. x \<in> X derived_set_of S \<and> x \<in> T \<longrightarrow> x \<in> S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closedin (subtopology X T) S = (S \<subseteq> topspace X \<and> S \<subseteq> T \<and> (\<forall>x. x \<in> X derived_set_of S \<and> x \<in> T \<longrightarrow> x \<in> S))
[PROOF STEP]
by (auto simp: closedin_contains_derived_set derived_set_of_subtopology Int_absorb1)


[STATEMENT]
lemma nullhomotopic_through_contractible:
  fixes S :: "_::topological_space set"
  assumes f: "continuous_on S f" "f ` S \<subseteq> T"
      and g: "continuous_on T g" "g ` T \<subseteq> U"
      and T: "contractible T"
    obtains c where "homotopic_with_canon (\<lambda>h. True) S U (g \<circ> f) (\<lambda>x. c)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>c. homotopic_with_canon (\<lambda>h. True) S U (g \<circ> f) (\<lambda>x. c) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<And>c. homotopic_with_canon (\<lambda>h. True) S U (g \<circ> f) (\<lambda>x. c) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
obtain b where b: "homotopic_with_canon (\<lambda>x. True) T T id (\<lambda>x. b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>b. homotopic_with_canon (\<lambda>x. True) T T id (\<lambda>x. b) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
continuous_on S f
f ` S \<subseteq> T
continuous_on T g
g ` T \<subseteq> U
contractible T

goal (1 subgoal):
 1. (\<And>b. homotopic_with_canon (\<lambda>x. True) T T id (\<lambda>x. b) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (force simp: contractible_def)
[PROOF STATE]
proof (state)
this:
homotopic_with_canon (\<lambda>x. True) T T id (\<lambda>x. b)

goal (1 subgoal):
 1. (\<And>c. homotopic_with_canon (\<lambda>h. True) S U (g \<circ> f) (\<lambda>x. c) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
have "homotopic_with_canon (\<lambda>f. True) T U (g \<circ> id) (g \<circ> (\<lambda>x. b))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. homotopic_with_canon (\<lambda>f. True) T U (g \<circ> id) (g \<circ> (\<lambda>x. b))
[PROOF STEP]
by (metis Abstract_Topology.continuous_map_subtopology_eu b g homotopic_with_compose_continuous_map_left)
[PROOF STATE]
proof (state)
this:
homotopic_with_canon (\<lambda>f. True) T U (g \<circ> id) (g \<circ> (\<lambda>x. b))

goal (1 subgoal):
 1. (\<And>c. homotopic_with_canon (\<lambda>h. True) S U (g \<circ> f) (\<lambda>x. c) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
homotopic_with_canon (\<lambda>f. True) T U (g \<circ> id) (g \<circ> (\<lambda>x. b))
[PROOF STEP]
have "homotopic_with_canon (\<lambda>f. True) S U (g \<circ> id \<circ> f) (g \<circ> (\<lambda>x. b) \<circ> f)"
[PROOF STATE]
proof (prove)
using this:
homotopic_with_canon (\<lambda>f. True) T U (g \<circ> id) (g \<circ> (\<lambda>x. b))

goal (1 subgoal):
 1. homotopic_with_canon (\<lambda>f. True) S U (g \<circ> id \<circ> f) (g \<circ> (\<lambda>x. b) \<circ> f)
[PROOF STEP]
by (simp add: f homotopic_with_compose_continuous_map_right)
[PROOF STATE]
proof (state)
this:
homotopic_with_canon (\<lambda>f. True) S U (g \<circ> id \<circ> f) (g \<circ> (\<lambda>x. b) \<circ> f)

goal (1 subgoal):
 1. (\<And>c. homotopic_with_canon (\<lambda>h. True) S U (g \<circ> f) (\<lambda>x. c) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
homotopic_with_canon (\<lambda>f. True) S U (g \<circ> id \<circ> f) (g \<circ> (\<lambda>x. b) \<circ> f)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
homotopic_with_canon (\<lambda>f. True) S U (g \<circ> id \<circ> f) (g \<circ> (\<lambda>x. b) \<circ> f)

goal (1 subgoal):
 1. thesis
[PROOF STEP]
by (simp add: comp_def that)
[PROOF STATE]
proof (state)
this:
thesis

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem sym_mpoly_representation_unique:
  fixes p :: "'a mpoly mpoly"
  assumes "finite A"
          "insertion (sym_mpoly A) p = insertion (sym_mpoly A) q"
          "\<And>m. vars (coeff p m) \<inter> A = {}" "\<And>m. vars (coeff q m) \<inter> A = {}"
          "vars p \<subseteq> {1..n}" "vars q \<subseteq> {1..n}"
  shows   "p = q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p = q
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. p = q
[PROOF STEP]
have "p - q = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p - q = 0
[PROOF STEP]
proof (rule sym_mpoly_representation_unique_aux)
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. finite A
 2. insertion (sym_mpoly A) (p - q) = 0
 3. \<And>m. vars (MPoly_Type.coeff (p - q) m) \<inter> A = {}
 4. vars (p - q) \<subseteq> {1..n}
[PROOF STEP]
fix m
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. finite A
 2. insertion (sym_mpoly A) (p - q) = 0
 3. \<And>m. vars (MPoly_Type.coeff (p - q) m) \<inter> A = {}
 4. vars (p - q) \<subseteq> {1..n}
[PROOF STEP]
show "vars (coeff (p - q) m) \<inter> A = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vars (MPoly_Type.coeff (p - q) m) \<inter> A = {}
[PROOF STEP]
using vars_diff[of "coeff p m" "coeff q m"] assms(3,4)[of m]
[PROOF STATE]
proof (prove)
using this:
vars (MPoly_Type.coeff p m - MPoly_Type.coeff q m) \<subseteq> vars (MPoly_Type.coeff p m) \<union> vars (MPoly_Type.coeff q m)
vars (MPoly_Type.coeff p m) \<inter> A = {}
vars (MPoly_Type.coeff q m) \<inter> A = {}

goal (1 subgoal):
 1. vars (MPoly_Type.coeff (p - q) m) \<inter> A = {}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
vars (MPoly_Type.coeff (p - q) m) \<inter> A = {}

goal (3 subgoals):
 1. finite A
 2. insertion (sym_mpoly A) (p - q) = 0
 3. vars (p - q) \<subseteq> {1..n}
[PROOF STEP]
qed (insert assms vars_diff[of p q], auto simp: insertion_diff)
[PROOF STATE]
proof (state)
this:
p - q = 0

goal (1 subgoal):
 1. p = q
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
p - q = 0

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma surj_to_image:"f \<in> A \<rightarrow> B \<Longrightarrow> surj_to f A (f ` A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<in> A \<rightarrow> B \<Longrightarrow> surj_to f A (f ` A)
[PROOF STEP]
apply (rule surj_to_test[of "f" "A" "f ` A"])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. f \<in> A \<rightarrow> B \<Longrightarrow> f \<in> A \<rightarrow> f ` A
 2. f \<in> A \<rightarrow> B \<Longrightarrow> \<forall>b\<in>f ` A. \<exists>a\<in>A. f a = b
[PROOF STEP]
apply (rule func_to_img[of "f" "A" "B"], assumption)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<in> A \<rightarrow> B \<Longrightarrow> \<forall>b\<in>f ` A. \<exists>a\<in>A. f a = b
[PROOF STEP]
apply (rule ballI, simp add:image_def, erule bexE, simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>b x. \<lbrakk>f \<in> A \<rightarrow> B; x \<in> A; b = f x\<rbrakk> \<Longrightarrow> \<exists>a\<in>A. f a = f x
[PROOF STEP]
apply blast
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma reflect_poly_irreducible:
  fixes x :: "'a :: {field_char_0,field_gcd}"
  assumes p: "irreducible p" and x: "p represents x" and x0: "x \<noteq> 0"
  shows "irreducible (reflect_poly p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. irreducible (reflect_poly p)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. irreducible (reflect_poly p)
[PROOF STEP]
from represents_inverse[OF x0 x]
[PROOF STATE]
proof (chain)
picking this:
reflect_poly p represents inverse x
[PROOF STEP]
have y: "(reflect_poly p) represents (inverse x)"
[PROOF STATE]
proof (prove)
using this:
reflect_poly p represents inverse x

goal (1 subgoal):
 1. reflect_poly p represents inverse x
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
reflect_poly p represents inverse x

goal (1 subgoal):
 1. irreducible (reflect_poly p)
[PROOF STEP]
from x0
[PROOF STATE]
proof (chain)
picking this:
x \<noteq> (0::'a)
[PROOF STEP]
have ix0: "inverse x \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
x \<noteq> (0::'a)

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

goal (1 subgoal):
 1. irreducible (reflect_poly p)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. irreducible (reflect_poly p)
[PROOF STEP]
proof (rule irreducible_preservation[OF p x y])
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. degree (reflect_poly p) \<le> degree p
 2. \<And>q. q represents inverse x \<Longrightarrow> ?f q represents x \<and> degree (?f q) \<le> degree q
 3. primitive (reflect_poly p)
[PROOF STEP]
from x irreducible_imp_primitive[OF p]
[PROOF STATE]
proof (chain)
picking this:
p represents x
degree p \<noteq> 0 \<Longrightarrow> primitive p
[PROOF STEP]
show "primitive (reflect_poly p)"
[PROOF STATE]
proof (prove)
using this:
p represents x
degree p \<noteq> 0 \<Longrightarrow> primitive p

goal (1 subgoal):
 1. primitive (reflect_poly p)
[PROOF STEP]
by (auto simp: content_reflect_poly)
[PROOF STATE]
proof (state)
this:
primitive (reflect_poly p)

goal (2 subgoals):
 1. degree (reflect_poly p) \<le> degree p
 2. \<And>q. q represents inverse x \<Longrightarrow> ?f q represents x \<and> degree (?f q) \<le> degree q
[PROOF STEP]
fix q
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. degree (reflect_poly p) \<le> degree p
 2. \<And>q. q represents inverse x \<Longrightarrow> ?f q represents x \<and> degree (?f q) \<le> degree q
[PROOF STEP]
assume "q represents (inverse x)"
[PROOF STATE]
proof (state)
this:
q represents inverse x

goal (2 subgoals):
 1. degree (reflect_poly p) \<le> degree p
 2. \<And>q. q represents inverse x \<Longrightarrow> ?f q represents x \<and> degree (?f q) \<le> degree q
[PROOF STEP]
from represents_inverse[OF ix0 this]
[PROOF STATE]
proof (chain)
picking this:
reflect_poly q represents inverse (inverse x)
[PROOF STEP]
have "(reflect_poly q) represents x"
[PROOF STATE]
proof (prove)
using this:
reflect_poly q represents inverse (inverse x)

goal (1 subgoal):
 1. reflect_poly q represents x
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
reflect_poly q represents x

goal (2 subgoals):
 1. degree (reflect_poly p) \<le> degree p
 2. \<And>q. q represents inverse x \<Longrightarrow> ?f q represents x \<and> degree (?f q) \<le> degree q
[PROOF STEP]
with degree_reflect_poly_le
[PROOF STATE]
proof (chain)
picking this:
degree (reflect_poly ?p) \<le> degree ?p
reflect_poly q represents x
[PROOF STEP]
show "(reflect_poly q) represents x \<and> degree (reflect_poly q) \<le> degree q"
[PROOF STATE]
proof (prove)
using this:
degree (reflect_poly ?p) \<le> degree ?p
reflect_poly q represents x

goal (1 subgoal):
 1. reflect_poly q represents x \<and> degree (reflect_poly q) \<le> degree q
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
reflect_poly q represents x \<and> degree (reflect_poly q) \<le> degree q

goal (1 subgoal):
 1. degree (reflect_poly p) \<le> degree p
[PROOF STEP]
qed (insert p, auto simp: degree_reflect_poly_le)
[PROOF STATE]
proof (state)
this:
irreducible (reflect_poly p)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma wf_fmla_atom_constT_imp_objT: "wf_fmla_atom (ty_term Q constT) a \<Longrightarrow> wf_fmla_atom (ty_term Q objT) a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wf_fmla_atom (ty_term Q constT) a \<Longrightarrow> wf_fmla_atom (ty_term Q objT) a
[PROOF STEP]
apply (erule wf_fmla_atom_mono[rotated])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ty_term Q constT \<subseteq>\<^sub>m ty_term Q objT
[PROOF STEP]
apply (rule ty_term_mono)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. Q \<subseteq>\<^sub>m Q
 2. constT \<subseteq>\<^sub>m objT
[PROOF STEP]
by (simp_all add: constT_ss_objT)


[STATEMENT]
lemma D_base_finite':
  "finite {len m i j xs | xs. set xs \<subseteq> {0..k} \<and> distinct (i # j # xs)}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {len m i j xs |xs. set xs \<subseteq> {0..k} \<and> distinct (i # j # xs)}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. finite {len m i j xs |xs. set xs \<subseteq> {0..k} \<and> distinct (i # j # xs)}
[PROOF STEP]
have "{len m i j xs | xs. set xs \<subseteq> {0..k} \<and> distinct (i # j # xs)}
        \<subseteq> {len m i j xs | xs. set xs \<subseteq> {0..k} \<and> distinct xs}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {len m i j xs |xs. set xs \<subseteq> {0..k} \<and> distinct (i # j # xs)} \<subseteq> {len m i j xs |xs. set xs \<subseteq> {0..k} \<and> distinct xs}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{len m i j xs |xs. set xs \<subseteq> {0..k} \<and> distinct (i # j # xs)} \<subseteq> {len m i j xs |xs. set xs \<subseteq> {0..k} \<and> distinct xs}

goal (1 subgoal):
 1. finite {len m i j xs |xs. set xs \<subseteq> {0..k} \<and> distinct (i # j # xs)}
[PROOF STEP]
with D_base_finite[of m i j k]
[PROOF STATE]
proof (chain)
picking this:
finite {len m i j xs |xs. set xs \<subseteq> {0..k} \<and> distinct xs}
{len m i j xs |xs. set xs \<subseteq> {0..k} \<and> distinct (i # j # xs)} \<subseteq> {len m i j xs |xs. set xs \<subseteq> {0..k} \<and> distinct xs}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
finite {len m i j xs |xs. set xs \<subseteq> {0..k} \<and> distinct xs}
{len m i j xs |xs. set xs \<subseteq> {0..k} \<and> distinct (i # j # xs)} \<subseteq> {len m i j xs |xs. set xs \<subseteq> {0..k} \<and> distinct xs}

goal (1 subgoal):
 1. finite {len m i j xs |xs. set xs \<subseteq> {0..k} \<and> distinct (i # j # xs)}
[PROOF STEP]
by (rule rev_finite_subset)
[PROOF STATE]
proof (state)
this:
finite {len m i j xs |xs. set xs \<subseteq> {0..k} \<and> distinct (i # j # xs)}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma [simp]: "c + (a \<sqinter> b) = (c + a) \<sqinter> (c + b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c + a \<sqinter> b = (c + a) \<sqinter> (c + b)
[PROOF STEP]
apply (rule order.antisym)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. c + a \<sqinter> b \<le> (c + a) \<sqinter> (c + b)
 2. (c + a) \<sqinter> (c + b) \<le> c + a \<sqinter> b
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. c + a \<sqinter> b \<le> c + a \<and> c + a \<sqinter> b \<le> c + b
 2. (c + a) \<sqinter> (c + b) \<le> c + a \<sqinter> b
[PROOF STEP]
apply safe
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. c + a \<sqinter> b \<le> c + a
 2. c + a \<sqinter> b \<le> c + b
 3. (c + a) \<sqinter> (c + b) \<le> c + a \<sqinter> b
[PROOF STEP]
apply (rule add_order_preserving_left)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. a \<sqinter> b \<le> a
 2. c + a \<sqinter> b \<le> c + b
 3. (c + a) \<sqinter> (c + b) \<le> c + a \<sqinter> b
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. c + a \<sqinter> b \<le> c + b
 2. (c + a) \<sqinter> (c + b) \<le> c + a \<sqinter> b
[PROOF STEP]
apply (rule add_order_preserving_left)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. a \<sqinter> b \<le> b
 2. (c + a) \<sqinter> (c + b) \<le> c + a \<sqinter> b
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (c + a) \<sqinter> (c + b) \<le> c + a \<sqinter> b
[PROOF STEP]
apply (rule left_move_to_left)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - c + (c + a) \<sqinter> (c + b) \<le> a \<sqinter> b
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - c + (c + a) \<sqinter> (c + b) \<le> a \<and> - c + (c + a) \<sqinter> (c + b) \<le> b
[PROOF STEP]
apply safe
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. - c + (c + a) \<sqinter> (c + b) \<le> a
 2. - c + (c + a) \<sqinter> (c + b) \<le> b
[PROOF STEP]
apply (rule left_move_to_right)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. (c + a) \<sqinter> (c + b) \<le> - (- c) + a
 2. - c + (c + a) \<sqinter> (c + b) \<le> b
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - c + (c + a) \<sqinter> (c + b) \<le> b
[PROOF STEP]
apply (rule left_move_to_right)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (c + a) \<sqinter> (c + b) \<le> - (- c) + b
[PROOF STEP]
by simp


[STATEMENT]
lemma list_ordered_pairs_set_containment :
  assumes "x \<in> list.set xs"
  and     "y \<in> list.set xs"
  and     "x \<noteq> y"
shows "(x,y) \<in> list.set (list_ordered_pairs xs) \<or> (y,x) \<in> list.set (list_ordered_pairs xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x, y) \<in> set (list_ordered_pairs xs) \<or> (y, x) \<in> set (list_ordered_pairs xs)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
x \<in> set xs
y \<in> set xs
x \<noteq> y

goal (1 subgoal):
 1. (x, y) \<in> set (list_ordered_pairs xs) \<or> (y, x) \<in> set (list_ordered_pairs xs)
[PROOF STEP]
by (induction xs; auto)


[STATEMENT]
lemma int_xor_ge0 [simp]:
  \<open>x XOR y \<ge> 0 \<longleftrightarrow> (x \<ge> 0 \<longleftrightarrow> y \<ge> 0)\<close> for x y :: int
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0 \<le> x XOR y) = ((0 \<le> x) = (0 \<le> y))
[PROOF STEP]
by (fact xor_nonnegative_int_iff)


[STATEMENT]
lemma arc_blocks_end_subset: assumes "E \<subseteq> arcs G"  and "{x, y} \<in> (arc_to_block ` E)"
  shows "(x, y) \<in> ((arc_to_ends G) ` E) \<or> (y, x) \<in> ((arc_to_ends G) ` E)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x, y) \<in> arc_to_ends G ` E \<or> (y, x) \<in> arc_to_ends G ` E
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (x, y) \<in> arc_to_ends G ` E \<or> (y, x) \<in> arc_to_ends G ` E
[PROOF STEP]
obtain e where "e \<in> E" and "arc_to_block e = {x,y}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>e. \<lbrakk>e \<in> E; arc_to_block e = {x, y}\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
E \<subseteq> arcs G
{x, y} \<in> arc_to_block ` E

goal (1 subgoal):
 1. (\<And>e. \<lbrakk>e \<in> E; arc_to_block e = {x, y}\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
e \<in> E
arc_to_block e = {x, y}

goal (1 subgoal):
 1. (x, y) \<in> arc_to_ends G ` E \<or> (y, x) \<in> arc_to_ends G ` E
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
e \<in> E
arc_to_block e = {x, y}
[PROOF STEP]
have "arc_to_ends G e = (x, y) \<or> arc_to_ends G e = (y, x)"
[PROOF STATE]
proof (prove)
using this:
e \<in> E
arc_to_block e = {x, y}

goal (1 subgoal):
 1. arc_to_ends G e = (x, y) \<or> arc_to_ends G e = (y, x)
[PROOF STEP]
using arc_to_ends_to_block
[PROOF STATE]
proof (prove)
using this:
e \<in> E
arc_to_block e = {x, y}
arc_to_block ?e = {?x, ?y} \<Longrightarrow> arc_to_ends G ?e = (?x, ?y) \<or> arc_to_ends G ?e = (?y, ?x)

goal (1 subgoal):
 1. arc_to_ends G e = (x, y) \<or> arc_to_ends G e = (y, x)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
arc_to_ends G e = (x, y) \<or> arc_to_ends G e = (y, x)

goal (1 subgoal):
 1. (x, y) \<in> arc_to_ends G ` E \<or> (y, x) \<in> arc_to_ends G ` E
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
arc_to_ends G e = (x, y) \<or> arc_to_ends G e = (y, x)

goal (1 subgoal):
 1. (x, y) \<in> arc_to_ends G ` E \<or> (y, x) \<in> arc_to_ends G ` E
[PROOF STEP]
by (metis \<open>e \<in> E\<close> image_iff)
[PROOF STATE]
proof (state)
this:
(x, y) \<in> arc_to_ends G ` E \<or> (y, x) \<in> arc_to_ends G ` E

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma comp_fun_idem_insert_clause: "comp_fun_idem insert_clause"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. comp_fun_idem insert_clause
[PROOF STEP]
apply(unfold_locales)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>y x. insert_clause y \<circ> insert_clause x = insert_clause x \<circ> insert_clause y
 2. \<And>x. insert_clause x \<circ> insert_clause x = insert_clause x
[PROOF STEP]
subgoal for x y
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. insert_clause x \<circ> insert_clause y = insert_clause y \<circ> insert_clause x
[PROOF STEP]
by(cases x; cases y; simp; metis commute_left_comp comp_fun_commute rewriteL_comp_comp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. insert_clause x \<circ> insert_clause x = insert_clause x
[PROOF STEP]
subgoal for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. insert_clause x \<circ> insert_clause x = insert_clause x
[PROOF STEP]
by(cases x; simp; metis (no_types, opaque_lifting) commute_left_comp comp_assoc comp_fun_idem)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma genby_lcoset_empty: "(w::'a::group_add) +o \<langle>{}\<rangle> = {w}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. w +o \<langle>{}\<rangle> = {w}
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. w +o \<langle>{}\<rangle> = {w}
[PROOF STEP]
have "\<langle>{}::'a set\<rangle> = (0::'a set)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<langle>{}\<rangle> = 0
[PROOF STEP]
using genby_empty
[PROOF STATE]
proof (prove)
using this:
\<langle>{}\<rangle> = 0

goal (1 subgoal):
 1. \<langle>{}\<rangle> = 0
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
\<langle>{}\<rangle> = 0

goal (1 subgoal):
 1. w +o \<langle>{}\<rangle> = {w}
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<langle>{}\<rangle> = 0

goal (1 subgoal):
 1. w +o \<langle>{}\<rangle> = {w}
[PROOF STEP]
using lcoset_0
[PROOF STATE]
proof (prove)
using this:
\<langle>{}\<rangle> = 0
?w +o 0 = {?w}

goal (1 subgoal):
 1. w +o \<langle>{}\<rangle> = {w}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
w +o \<langle>{}\<rangle> = {w}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in topology) open_kriterion:
  assumes t_contains_open: "\<And> x. x\<in>t \<Longrightarrow> \<exists>t'. t' open \<and> x\<in>t' \<and> t'\<subseteq>t"
  shows "t open"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. t open
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. t open
[PROOF STEP]
let ?M = "\<Union>x\<in>t. {t'. t' open \<and> x\<in>t' \<and> t'\<subseteq>t}"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. t open
[PROOF STEP]
have "\<forall> m \<in> ?M. m open"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>m\<in>\<Union>x\<in>t. {t'. t' open \<and> x \<in> t' \<and> t' \<subseteq> t}. m open
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<forall>m\<in>\<Union>x\<in>t. {t'. t' open \<and> x \<in> t' \<and> t' \<subseteq> t}. m open

goal (1 subgoal):
 1. t open
[PROOF STEP]
hence  "\<Union>?M open"
[PROOF STATE]
proof (prove)
using this:
\<forall>m\<in>\<Union>x\<in>t. {t'. t' open \<and> x \<in> t' \<and> t' \<subseteq> t}. m open

goal (1 subgoal):
 1. \<Union> (\<Union>x\<in>t. {t'. t' open \<and> x \<in> t' \<and> t' \<subseteq> t}) open
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<Union> (\<Union>x\<in>t. {t'. t' open \<and> x \<in> t' \<and> t' \<subseteq> t}) open

goal (1 subgoal):
 1. t open
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<Union> (\<Union>x\<in>t. {t'. t' open \<and> x \<in> t' \<and> t' \<subseteq> t}) open

goal (1 subgoal):
 1. t open
[PROOF STEP]
have "t = \<Union>?M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. t = \<Union> (\<Union>x\<in>t. {t'. t' open \<and> x \<in> t' \<and> t' \<subseteq> t})
[PROOF STEP]
by (auto dest!: t_contains_open)
[PROOF STATE]
proof (state)
this:
t = \<Union> (\<Union>x\<in>t. {t'. t' open \<and> x \<in> t' \<and> t' \<subseteq> t})

goal (1 subgoal):
 1. t open
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<Union> (\<Union>x\<in>t. {t'. t' open \<and> x \<in> t' \<and> t' \<subseteq> t}) open
t = \<Union> (\<Union>x\<in>t. {t'. t' open \<and> x \<in> t' \<and> t' \<subseteq> t})
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<Union> (\<Union>x\<in>t. {t'. t' open \<and> x \<in> t' \<and> t' \<subseteq> t}) open
t = \<Union> (\<Union>x\<in>t. {t'. t' open \<and> x \<in> t' \<and> t' \<subseteq> t})

goal (1 subgoal):
 1. t open
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
t open

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ex_set_conv: "(\<exists>x. x \<in> set xs) \<longleftrightarrow> xs \<noteq> []"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>x. x \<in> set xs) = (xs \<noteq> [])
[PROOF STEP]
apply(auto)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. xs \<noteq> [] \<Longrightarrow> \<exists>x. x \<in> set xs
[PROOF STEP]
apply(auto simp add: neq_Nil_conv)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma less_divide_eq_1_neg [simp]:
  "a < 0 \<Longrightarrow> (1 < b/a) = (b < a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a < (0::'a) \<Longrightarrow> ((1::'a) < b / a) = (b < a)
[PROOF STEP]
using local.dual_order.strict_iff_order
[PROOF STATE]
proof (prove)
using this:
(?b < ?a) = (?b \<le> ?a \<and> ?a \<noteq> ?b)

goal (1 subgoal):
 1. a < (0::'a) \<Longrightarrow> ((1::'a) < b / a) = (b < a)
[PROOF STEP]
by auto


[STATEMENT]
lemma inj_on_linepath:
  assumes "a \<noteq> b" shows "inj_on (linepath a b) {0..1}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on (linepath a b) {0..1}
[PROOF STEP]
proof (clarsimp simp: inj_on_def linepath_def)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x y. \<lbrakk>(1 - x) *\<^sub>R a + x *\<^sub>R b = (1 - y) *\<^sub>R a + y *\<^sub>R b; 0 \<le> x; x \<le> 1; 0 \<le> y; y \<le> 1\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
fix x y
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x y. \<lbrakk>(1 - x) *\<^sub>R a + x *\<^sub>R b = (1 - y) *\<^sub>R a + y *\<^sub>R b; 0 \<le> x; x \<le> 1; 0 \<le> y; y \<le> 1\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
assume "(1 - x) *\<^sub>R a + x *\<^sub>R b = (1 - y) *\<^sub>R a + y *\<^sub>R b" "0 \<le> x" "x \<le> 1" "0 \<le> y" "y \<le> 1"
[PROOF STATE]
proof (state)
this:
(1 - x) *\<^sub>R a + x *\<^sub>R b = (1 - y) *\<^sub>R a + y *\<^sub>R b
0 \<le> x
x \<le> 1
0 \<le> y
y \<le> 1

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>(1 - x) *\<^sub>R a + x *\<^sub>R b = (1 - y) *\<^sub>R a + y *\<^sub>R b; 0 \<le> x; x \<le> 1; 0 \<le> y; y \<le> 1\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(1 - x) *\<^sub>R a + x *\<^sub>R b = (1 - y) *\<^sub>R a + y *\<^sub>R b
0 \<le> x
x \<le> 1
0 \<le> y
y \<le> 1
[PROOF STEP]
have "x *\<^sub>R (a - b) = y *\<^sub>R (a - b)"
[PROOF STATE]
proof (prove)
using this:
(1 - x) *\<^sub>R a + x *\<^sub>R b = (1 - y) *\<^sub>R a + y *\<^sub>R b
0 \<le> x
x \<le> 1
0 \<le> y
y \<le> 1

goal (1 subgoal):
 1. x *\<^sub>R (a - b) = y *\<^sub>R (a - b)
[PROOF STEP]
by (auto simp: algebra_simps)
[PROOF STATE]
proof (state)
this:
x *\<^sub>R (a - b) = y *\<^sub>R (a - b)

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>(1 - x) *\<^sub>R a + x *\<^sub>R b = (1 - y) *\<^sub>R a + y *\<^sub>R b; 0 \<le> x; x \<le> 1; 0 \<le> y; y \<le> 1\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x *\<^sub>R (a - b) = y *\<^sub>R (a - b)
[PROOF STEP]
show "x=y"
[PROOF STATE]
proof (prove)
using this:
x *\<^sub>R (a - b) = y *\<^sub>R (a - b)

goal (1 subgoal):
 1. x = y
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
x *\<^sub>R (a - b) = y *\<^sub>R (a - b)
a \<noteq> b

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma index_zip_replicate2[simp]: "index (zip as (replicate d b)) (a, b) = index as a"
  if "d = length as"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. index (zip as (replicate d b)) (a, b) = index as a
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
d = length as

goal (1 subgoal):
 1. index (zip as (replicate d b)) (a, b) = index as a
[PROOF STEP]
by (induction as arbitrary: d) auto


[STATEMENT]
lemma tmf_ivl_cs_length:
  assumes "tmf_ivl_cs prec n A a f = Some cs"
  shows "length cs = n + 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length cs = n + 1
[PROOF STEP]
by (simp add: Some_those_length[OF assms[unfolded tmf_ivl_cs.simps]])


[STATEMENT]
lemma fds_perzeta_frac [simp]: "fds_perzeta (frac q) = fds_perzeta q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fds_perzeta (frac q) = fds_perzeta q
[PROOF STEP]
using fds_perzeta.plus_of_int[of "frac q" "\<lfloor>q\<rfloor>"]
[PROOF STATE]
proof (prove)
using this:
fds_perzeta (frac q + real_of_int \<lfloor>q\<rfloor>) = fds_perzeta (frac q)

goal (1 subgoal):
 1. fds_perzeta (frac q) = fds_perzeta q
[PROOF STEP]
by (simp add: frac_def)


[STATEMENT]
lemma finite_measure_restr_to_subalg:
  assumes "subalgebra M F"
          "finite_measure M"
  shows "finite_measure (restr_to_subalg M F)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite_measure (restr_to_subalg M F)
[PROOF STEP]
by (metis (no_types, lifting) assms emeasure_restr_to_subalg finite_measure.finite_emeasure_space
    finite_measureI sets.top space_restr_to_subalg subalgebra_def infinity_ennreal_def)


[STATEMENT]
lemma fmrestrict_set_fmmap[simp]: "fmrestrict_set A (fmmap f m) = fmmap f (fmrestrict_set A m)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fmrestrict_set A (fmmap f m) = fmmap f (fmrestrict_set A m)
[PROOF STEP]
unfolding fmfilter_alt_defs
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fmfilter (\<lambda>a. a \<in> A) (fmmap f m) = fmmap f (fmfilter (\<lambda>a. a \<in> A) m)
[PROOF STEP]
by simp


[STATEMENT]
lemma run_eval_list: "\<exists>run_eval_list. \<forall>env es s. evaluate_list True env s es (run_eval_list env es s)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>run_eval_list. \<forall>env es s. evaluate_list True env s es (run_eval_list env es s)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>run_eval_list. \<forall>env es s. evaluate_list True env s es (run_eval_list env es s)
[PROOF STEP]
define f where "f env_es_s = (case env_es_s of (env, es, s::'a state) \<Rightarrow> evaluate_list True env s es)" for env_es_s
[PROOF STATE]
proof (state)
this:
f ?env_es_s = (case ?env_es_s of (env, es, s) \<Rightarrow> evaluate_list True env s es)

goal (1 subgoal):
 1. \<exists>run_eval_list. \<forall>env es s. evaluate_list True env s es (run_eval_list env es s)
[PROOF STEP]
have "\<exists>g. \<forall>env_es_s. f env_es_s (g env_es_s)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>g. \<forall>env_es_s. f env_es_s (g env_es_s)
[PROOF STEP]
proof (rule choice, safe, unfold f_def prod.case)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a aa b. Ex (evaluate_list True a b aa)
[PROOF STEP]
fix env es
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a aa b. Ex (evaluate_list True a b aa)
[PROOF STEP]
fix s :: "'a state"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a aa b. Ex (evaluate_list True a b aa)
[PROOF STEP]
obtain s' r where "evaluate_list True env s es (s', r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>s' r. evaluate_list True env s es (s', r) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis evaluate_list_total)
[PROOF STATE]
proof (state)
this:
evaluate_list True env s es (s', r)

goal (1 subgoal):
 1. \<And>a aa b. Ex (evaluate_list True a b aa)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
evaluate_list True env s es (s', r)
[PROOF STEP]
show "\<exists>r. evaluate_list True env s es r"
[PROOF STATE]
proof (prove)
using this:
evaluate_list True env s es (s', r)

goal (1 subgoal):
 1. \<exists>r. evaluate_list True env s es r
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>r. evaluate_list True env s es r

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<exists>g. \<forall>env_es_s. f env_es_s (g env_es_s)

goal (1 subgoal):
 1. \<exists>run_eval_list. \<forall>env es s. evaluate_list True env s es (run_eval_list env es s)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>g. \<forall>env_es_s. f env_es_s (g env_es_s)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<exists>g. \<forall>env_es_s. f env_es_s (g env_es_s)

goal (1 subgoal):
 1. \<exists>run_eval_list. \<forall>env es s. evaluate_list True env s es (run_eval_list env es s)
[PROOF STEP]
unfolding f_def
[PROOF STATE]
proof (prove)
using this:
\<exists>g. \<forall>env_es_s. (case env_es_s of (env, es, s) \<Rightarrow> evaluate_list True env s es) (g env_es_s)

goal (1 subgoal):
 1. \<exists>run_eval_list. \<forall>env es s. evaluate_list True env s es (run_eval_list env es s)
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
\<exists>run_eval_list. \<forall>env es s. evaluate_list True env s es (run_eval_list env es s)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma coreflexive_pp_dist_comp:
  assumes "coreflexive x"
      and "coreflexive y"
    shows "(x * y)'' = x '' * y ''"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x * y) ' ' = x ' ' * y ' '
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (x * y) ' ' = x ' ' * y ' '
[PROOF STEP]
have "(x * y)'' = --(x * y) \<sqinter> 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x * y) ' ' = - (x * y) '
[PROOF STEP]
by (simp add: double_coreflexive_complement)
[PROOF STATE]
proof (state)
this:
(x * y) ' ' = - (x * y) '

goal (1 subgoal):
 1. (x * y) ' ' = x ' ' * y ' '
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(x * y) ' ' = - (x * y) '

goal (1 subgoal):
 1. (x * y) ' ' = x ' ' * y ' '
[PROOF STEP]
have "... = --x \<sqinter> --y \<sqinter> 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - (x * y) ' = - - x \<sqinter> - - y \<sqinter> (1::'a)
[PROOF STEP]
by (simp add: assms coreflexive_comp_inf)
[PROOF STATE]
proof (state)
this:
- (x * y) ' = - - x \<sqinter> - - y \<sqinter> (1::'a)

goal (1 subgoal):
 1. (x * y) ' ' = x ' ' * y ' '
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
- (x * y) ' = - - x \<sqinter> - - y \<sqinter> (1::'a)

goal (1 subgoal):
 1. (x * y) ' ' = x ' ' * y ' '
[PROOF STEP]
have "... = (--x \<sqinter> 1) * (--y \<sqinter> 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - - x \<sqinter> - - y \<sqinter> (1::'a) = - x ' * - y '
[PROOF STEP]
by (simp add: coreflexive_comp_inf inf.left_commute inf.sup_monoid.add_assoc)
[PROOF STATE]
proof (state)
this:
- - x \<sqinter> - - y \<sqinter> (1::'a) = - x ' * - y '

goal (1 subgoal):
 1. (x * y) ' ' = x ' ' * y ' '
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
- - x \<sqinter> - - y \<sqinter> (1::'a) = - x ' * - y '

goal (1 subgoal):
 1. (x * y) ' ' = x ' ' * y ' '
[PROOF STEP]
have "... = x '' * y ''"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - x ' * - y ' = x ' ' * y ' '
[PROOF STEP]
by (simp add: double_coreflexive_complement)
[PROOF STATE]
proof (state)
this:
- x ' * - y ' = x ' ' * y ' '

goal (1 subgoal):
 1. (x * y) ' ' = x ' ' * y ' '
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(x * y) ' ' = x ' ' * y ' '
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(x * y) ' ' = x ' ' * y ' '

goal (1 subgoal):
 1. (x * y) ' ' = x ' ' * y ' '
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(x * y) ' ' = x ' ' * y ' '

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma map_tabulate[simp]: "map f (tabulate g x n) = tabulate (\<lambda>x. f (g x)) x n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map f (tabulate g x n) = tabulate (\<lambda>x. f (g x)) x n
[PROOF STEP]
by (induction n arbitrary: x) simp_all


[STATEMENT]
lemma axis_inverse:
  fixes v :: "real^'n"
  assumes "v \<in> Basis"
  shows "\<exists>i. v = axis i 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>i. v = axis i 1
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>i. v = axis i 1
[PROOF STEP]
have "v \<in> (\<Union>n. \<Union>r\<in>Basis. {axis n r})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. v \<in> (\<Union>n. \<Union>r\<in>Basis. {axis n r})
[PROOF STEP]
using assms Basis_vec_def
[PROOF STATE]
proof (prove)
using this:
v \<in> Basis
Basis = (\<Union>i. \<Union>u\<in>Basis. {axis i u})

goal (1 subgoal):
 1. v \<in> (\<Union>n. \<Union>r\<in>Basis. {axis n r})
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
v \<in> (\<Union>n. \<Union>r\<in>Basis. {axis n r})

goal (1 subgoal):
 1. \<exists>i. v = axis i 1
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
v \<in> (\<Union>n. \<Union>r\<in>Basis. {axis n r})
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
v \<in> (\<Union>n. \<Union>r\<in>Basis. {axis n r})

goal (1 subgoal):
 1. \<exists>i. v = axis i 1
[PROOF STEP]
by (force simp add: vec_eq_iff)
[PROOF STATE]
proof (state)
this:
\<exists>i. v = axis i 1

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma rec_by_index_inj: "rec_by_index x1 y1 = rec_by_index x2 y2 \<Longrightarrow> x1=x2 \<and> y1=y2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rec_by_index x1 y1 = rec_by_index x2 y2 \<Longrightarrow> x1 = x2 \<and> y1 = y2
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. rec_by_index x1 y1 = rec_by_index x2 y2 \<Longrightarrow> x1 = x2 \<and> y1 = y2
[PROOF STEP]
assume "rec_by_index x1 y1 = rec_by_index x2 y2"
[PROOF STATE]
proof (state)
this:
rec_by_index x1 y1 = rec_by_index x2 y2

goal (1 subgoal):
 1. rec_by_index x1 y1 = rec_by_index x2 y2 \<Longrightarrow> x1 = x2 \<and> y1 = y2
[PROOF STEP]
hence "c_pair 6 (c_pair x1 y1) = c_pair 6 (c_pair x2 y2)"
[PROOF STATE]
proof (prove)
using this:
rec_by_index x1 y1 = rec_by_index x2 y2

goal (1 subgoal):
 1. c_pair 6 (c_pair x1 y1) = c_pair 6 (c_pair x2 y2)
[PROOF STEP]
by (unfold rec_by_index_def)
[PROOF STATE]
proof (state)
this:
c_pair 6 (c_pair x1 y1) = c_pair 6 (c_pair x2 y2)

goal (1 subgoal):
 1. rec_by_index x1 y1 = rec_by_index x2 y2 \<Longrightarrow> x1 = x2 \<and> y1 = y2
[PROOF STEP]
hence "c_pair x1 y1 = c_pair x2 y2"
[PROOF STATE]
proof (prove)
using this:
c_pair 6 (c_pair x1 y1) = c_pair 6 (c_pair x2 y2)

goal (1 subgoal):
 1. c_pair x1 y1 = c_pair x2 y2
[PROOF STEP]
by (rule c_pair_inj2)
[PROOF STATE]
proof (state)
this:
c_pair x1 y1 = c_pair x2 y2

goal (1 subgoal):
 1. rec_by_index x1 y1 = rec_by_index x2 y2 \<Longrightarrow> x1 = x2 \<and> y1 = y2
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
c_pair x1 y1 = c_pair x2 y2

goal (1 subgoal):
 1. x1 = x2 \<and> y1 = y2
[PROOF STEP]
by (rule c_pair_inj)
[PROOF STATE]
proof (state)
this:
x1 = x2 \<and> y1 = y2

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma kpower_inv:
  fixes F :: "'a \<Rightarrow> 'a set"
  assumes "\<forall>s. I s \<longrightarrow> (\<forall>s'. s' \<in> F s \<longrightarrow> I s')"
  shows "\<forall>s. I s \<longrightarrow> (\<forall>s'. s' \<in> (kpower F n s) \<longrightarrow> I s')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>s. I s \<longrightarrow> (\<forall>s'. s' \<in> kpower F n s \<longrightarrow> I s')
[PROOF STEP]
apply(clarsimp, induct n)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>s s'. \<lbrakk>I s; s' \<in> kpower F 0 s\<rbrakk> \<Longrightarrow> I s'
 2. \<And>n s s'. \<lbrakk>\<And>s s'. \<lbrakk>I s; s' \<in> kpower F n s\<rbrakk> \<Longrightarrow> I s'; I s; s' \<in> kpower F (Suc n) s\<rbrakk> \<Longrightarrow> I s'
[PROOF STEP]
unfolding kpower_base kpower_simp
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>s s'. \<lbrakk>I s; s' \<in> skip s\<rbrakk> \<Longrightarrow> I s'
 2. \<And>n s s'. \<lbrakk>\<And>s s'. \<lbrakk>I s; s' \<in> kpower F n s\<rbrakk> \<Longrightarrow> I s'; I s; s' \<in> (F ; kpower F n) s\<rbrakk> \<Longrightarrow> I s'
[PROOF STEP]
apply(simp_all add: kcomp_eq, clarsimp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n s s' y. \<lbrakk>\<And>s s'. \<lbrakk>I s; s' \<in> kpower F n s\<rbrakk> \<Longrightarrow> I s'; I s; s' \<in> kpower F n y; y \<in> F s\<rbrakk> \<Longrightarrow> I s'
[PROOF STEP]
apply(subgoal_tac "I y", simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n s s' y. \<lbrakk>\<And>s s'. \<lbrakk>I s; s' \<in> kpower F n s\<rbrakk> \<Longrightarrow> I s'; I s; s' \<in> kpower F n y; y \<in> F s\<rbrakk> \<Longrightarrow> I y
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<forall>s. I s \<longrightarrow> (\<forall>s'. s' \<in> F s \<longrightarrow> I s')

goal (1 subgoal):
 1. \<And>n s s' y. \<lbrakk>\<And>s s'. \<lbrakk>I s; s' \<in> kpower F n s\<rbrakk> \<Longrightarrow> I s'; I s; s' \<in> kpower F n y; y \<in> F s\<rbrakk> \<Longrightarrow> I y
[PROOF STEP]
by blast


[STATEMENT]
lemma quat_inner_k_left [simp]: "inner \<k> x = Im3 x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<k> \<bullet> x = Im3 x
[PROOF STEP]
unfolding inner_quat_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. quat.Re \<k> * quat.Re x + Im1 \<k> * Im1 x + Im2 \<k> * Im2 x + Im3 \<k> * Im3 x = Im3 x
[PROOF STEP]
by simp


[STATEMENT]
lemma Replace_cong [cong]:
    "\<lbrakk> A=B;  \<And>x y. x \<^bold>\<in> B \<Longrightarrow> P x y \<longleftrightarrow> Q x y \<rbrakk>  \<Longrightarrow> Replace A P = Replace B Q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>A = B; \<And>x y. x \<^bold>\<in> B \<Longrightarrow> P x y = Q x y\<rbrakk> \<Longrightarrow> Replace A P = Replace B Q
[PROOF STEP]
by (simp add: hf_ext cong: conj_cong)


[STATEMENT]
lemma sums_mult_D: "(\<lambda>n. c * f n) sums a \<Longrightarrow> c \<noteq> 0 \<Longrightarrow> f sums (a/c)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(\<lambda>n. c * f n) sums a; c \<noteq> (0::'a)\<rbrakk> \<Longrightarrow> f sums (a / c)
[PROOF STEP]
using sums_mult_iff
[PROOF STATE]
proof (prove)
using this:
?c \<noteq> (0::?'a) \<Longrightarrow> (\<lambda>n. ?c * ?f n) sums (?c * ?d) = ?f sums ?d

goal (1 subgoal):
 1. \<lbrakk>(\<lambda>n. c * f n) sums a; c \<noteq> (0::'a)\<rbrakk> \<Longrightarrow> f sums (a / c)
[PROOF STEP]
by fastforce


[STATEMENT]
lemma insert_transpose_board:
  "insert (transpose_square s\<^sub>i) (transpose_board b) = transpose_board (insert s\<^sub>i b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. insert (transpose_square s\<^sub>i) (transpose_board b) = transpose_board (insert s\<^sub>i b)
[PROOF STEP]
unfolding transpose_board_def transpose_square_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. insert (case s\<^sub>i of (i, j) \<Rightarrow> (j, i)) {(j, i) |i j. (i, j) \<in> b} = {(j, i) |i j. (i, j) \<in> insert s\<^sub>i b}
[PROOF STEP]
by (auto split: prod.splits)