[STATEMENT]
lemma sum_of_unit_vec_to_col:
  assumes "dim_col A = n" and "i < n" and "j < n"
  shows "col A i + c \<cdot>\<^sub>v col A j = A * |unit_vec n i + c \<cdot>\<^sub>v unit_vec n j\<rangle>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. col A i + c \<cdot>\<^sub>v col A j = col_fst (A * |unit_vec n i + c \<cdot>\<^sub>v unit_vec n j\<rangle>)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>ia. ia < dim_vec (col_fst (A * |unit_vec n i + c \<cdot>\<^sub>v unit_vec n j\<rangle>)) \<Longrightarrow> (col A i + c \<cdot>\<^sub>v col A j) $ ia = col_fst (A * |unit_vec n i + c \<cdot>\<^sub>v unit_vec n j\<rangle>) $ ia
 2. dim_vec (col A i + c \<cdot>\<^sub>v col A j) = dim_vec (col_fst (A * |unit_vec n i + c \<cdot>\<^sub>v unit_vec n j\<rangle>))
[PROOF STEP]
show "dim_vec (col A i + c \<cdot>\<^sub>v col A j) = dim_vec (col_fst (A * |unit_vec n i + c \<cdot>\<^sub>v unit_vec n j\<rangle>))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_vec (col A i + c \<cdot>\<^sub>v col A j) = dim_vec (col_fst (A * |unit_vec n i + c \<cdot>\<^sub>v unit_vec n j\<rangle>))
[PROOF STEP]
using assms(1)
[PROOF STATE]
proof (prove)
using this:
dim_col A = n

goal (1 subgoal):
 1. dim_vec (col A i + c \<cdot>\<^sub>v col A j) = dim_vec (col_fst (A * |unit_vec n i + c \<cdot>\<^sub>v unit_vec n j\<rangle>))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
dim_vec (col A i + c \<cdot>\<^sub>v col A j) = dim_vec (col_fst (A * |unit_vec n i + c \<cdot>\<^sub>v unit_vec n j\<rangle>))

goal (1 subgoal):
 1. \<And>ia. ia < dim_vec (col_fst (A * |unit_vec n i + c \<cdot>\<^sub>v unit_vec n j\<rangle>)) \<Longrightarrow> (col A i + c \<cdot>\<^sub>v col A j) $ ia = col_fst (A * |unit_vec n i + c \<cdot>\<^sub>v unit_vec n j\<rangle>) $ ia
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>ia. ia < dim_vec (col_fst (A * |unit_vec n i + c \<cdot>\<^sub>v unit_vec n j\<rangle>)) \<Longrightarrow> (col A i + c \<cdot>\<^sub>v col A j) $ ia = col_fst (A * |unit_vec n i + c \<cdot>\<^sub>v unit_vec n j\<rangle>) $ ia
[PROOF STEP]
fix k
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>ia. ia < dim_vec (col_fst (A * |unit_vec n i + c \<cdot>\<^sub>v unit_vec n j\<rangle>)) \<Longrightarrow> (col A i + c \<cdot>\<^sub>v col A j) $ ia = col_fst (A * |unit_vec n i + c \<cdot>\<^sub>v unit_vec n j\<rangle>) $ ia
[PROOF STEP]
assume "k < dim_vec (col_fst (A * |unit_vec n i + c \<cdot>\<^sub>v unit_vec n j\<rangle>))"
[PROOF STATE]
proof (state)
this:
k < dim_vec (col_fst (A * |unit_vec n i + c \<cdot>\<^sub>v unit_vec n j\<rangle>))

goal (1 subgoal):
 1. \<And>ia. ia < dim_vec (col_fst (A * |unit_vec n i + c \<cdot>\<^sub>v unit_vec n j\<rangle>)) \<Longrightarrow> (col A i + c \<cdot>\<^sub>v col A j) $ ia = col_fst (A * |unit_vec n i + c \<cdot>\<^sub>v unit_vec n j\<rangle>) $ ia
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
k < dim_vec (col_fst (A * |unit_vec n i + c \<cdot>\<^sub>v unit_vec n j\<rangle>))
[PROOF STEP]
have f0:"k < dim_row A"
[PROOF STATE]
proof (prove)
using this:
k < dim_vec (col_fst (A * |unit_vec n i + c \<cdot>\<^sub>v unit_vec n j\<rangle>))

goal (1 subgoal):
 1. k < dim_row A
[PROOF STEP]
using assms(1)
[PROOF STATE]
proof (prove)
using this:
k < dim_vec (col_fst (A * |unit_vec n i + c \<cdot>\<^sub>v unit_vec n j\<rangle>))
dim_col A = n

goal (1 subgoal):
 1. k < dim_row A
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
k < dim_row A

goal (1 subgoal):
 1. \<And>ia. ia < dim_vec (col_fst (A * |unit_vec n i + c \<cdot>\<^sub>v unit_vec n j\<rangle>)) \<Longrightarrow> (col A i + c \<cdot>\<^sub>v col A j) $ ia = col_fst (A * |unit_vec n i + c \<cdot>\<^sub>v unit_vec n j\<rangle>) $ ia
[PROOF STEP]
have "(col A i + c \<cdot>\<^sub>v col A j) $ k = A $$ (k, i) + c * A $$ (k, j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (col A i + c \<cdot>\<^sub>v col A j) $ k = A $$ (k, i) + c * A $$ (k, j)
[PROOF STEP]
using f0 assms(1-3)
[PROOF STATE]
proof (prove)
using this:
k < dim_row A
dim_col A = n
i < n
j < n

goal (1 subgoal):
 1. (col A i + c \<cdot>\<^sub>v col A j) $ k = A $$ (k, i) + c * A $$ (k, j)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(col A i + c \<cdot>\<^sub>v col A j) $ k = A $$ (k, i) + c * A $$ (k, j)

goal (1 subgoal):
 1. \<And>ia. ia < dim_vec (col_fst (A * |unit_vec n i + c \<cdot>\<^sub>v unit_vec n j\<rangle>)) \<Longrightarrow> (col A i + c \<cdot>\<^sub>v col A j) $ ia = col_fst (A * |unit_vec n i + c \<cdot>\<^sub>v unit_vec n j\<rangle>) $ ia
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(col A i + c \<cdot>\<^sub>v col A j) $ k = A $$ (k, i) + c * A $$ (k, j)

goal (1 subgoal):
 1. \<And>ia. ia < dim_vec (col_fst (A * |unit_vec n i + c \<cdot>\<^sub>v unit_vec n j\<rangle>)) \<Longrightarrow> (col A i + c \<cdot>\<^sub>v col A j) $ ia = col_fst (A * |unit_vec n i + c \<cdot>\<^sub>v unit_vec n j\<rangle>) $ ia
[PROOF STEP]
have "(\<Sum>x<n. A $$ (k, x) * ((if x = i then 1 else 0) + c * (if x = j then 1 else 0))) =
                 (\<Sum>x<n. A $$ (k, x) * (if x = i then 1 else 0)) +
                 (\<Sum>x<n. A $$ (k, x) * c * (if x = j then 1 else 0))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>x<n. A $$ (k, x) * ((if x = i then 1 else 0) + c * (if x = j then 1 else 0))) = (\<Sum>x<n. A $$ (k, x) * (if x = i then 1 else 0)) + (\<Sum>x<n. A $$ (k, x) * c * (if x = j then 1 else 0))
[PROOF STEP]
by (auto simp add: sum.distrib algebra_simps)
[PROOF STATE]
proof (state)
this:
(\<Sum>x<n. A $$ (k, x) * ((if x = i then 1 else 0) + c * (if x = j then 1 else 0))) = (\<Sum>x<n. A $$ (k, x) * (if x = i then 1 else 0)) + (\<Sum>x<n. A $$ (k, x) * c * (if x = j then 1 else 0))

goal (1 subgoal):
 1. \<And>ia. ia < dim_vec (col_fst (A * |unit_vec n i + c \<cdot>\<^sub>v unit_vec n j\<rangle>)) \<Longrightarrow> (col A i + c \<cdot>\<^sub>v col A j) $ ia = col_fst (A * |unit_vec n i + c \<cdot>\<^sub>v unit_vec n j\<rangle>) $ ia
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(\<Sum>x<n. A $$ (k, x) * ((if x = i then 1 else 0) + c * (if x = j then 1 else 0))) = (\<Sum>x<n. A $$ (k, x) * (if x = i then 1 else 0)) + (\<Sum>x<n. A $$ (k, x) * c * (if x = j then 1 else 0))

goal (1 subgoal):
 1. \<And>ia. ia < dim_vec (col_fst (A * |unit_vec n i + c \<cdot>\<^sub>v unit_vec n j\<rangle>)) \<Longrightarrow> (col A i + c \<cdot>\<^sub>v col A j) $ ia = col_fst (A * |unit_vec n i + c \<cdot>\<^sub>v unit_vec n j\<rangle>) $ ia
[PROOF STEP]
have "\<forall>x<n. A $$ (k, x) * (if x = i then 1 else 0) = (if x = i then A $$ (k, x) else 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x<n. A $$ (k, x) * (if x = i then 1 else 0) = (if x = i then A $$ (k, x) else 0)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<forall>x<n. A $$ (k, x) * (if x = i then 1 else 0) = (if x = i then A $$ (k, x) else 0)

goal (1 subgoal):
 1. \<And>ia. ia < dim_vec (col_fst (A * |unit_vec n i + c \<cdot>\<^sub>v unit_vec n j\<rangle>)) \<Longrightarrow> (col A i + c \<cdot>\<^sub>v col A j) $ ia = col_fst (A * |unit_vec n i + c \<cdot>\<^sub>v unit_vec n j\<rangle>) $ ia
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<forall>x<n. A $$ (k, x) * (if x = i then 1 else 0) = (if x = i then A $$ (k, x) else 0)

goal (1 subgoal):
 1. \<And>ia. ia < dim_vec (col_fst (A * |unit_vec n i + c \<cdot>\<^sub>v unit_vec n j\<rangle>)) \<Longrightarrow> (col A i + c \<cdot>\<^sub>v col A j) $ ia = col_fst (A * |unit_vec n i + c \<cdot>\<^sub>v unit_vec n j\<rangle>) $ ia
[PROOF STEP]
have "\<forall>x<n. A $$ (k, x) * c * (if x = j then 1 else 0) = (if x = j then A $$ (k, x) * c else 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x<n. A $$ (k, x) * c * (if x = j then 1 else 0) = (if x = j then A $$ (k, x) * c else 0)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<forall>x<n. A $$ (k, x) * c * (if x = j then 1 else 0) = (if x = j then A $$ (k, x) * c else 0)

goal (1 subgoal):
 1. \<And>ia. ia < dim_vec (col_fst (A * |unit_vec n i + c \<cdot>\<^sub>v unit_vec n j\<rangle>)) \<Longrightarrow> (col A i + c \<cdot>\<^sub>v col A j) $ ia = col_fst (A * |unit_vec n i + c \<cdot>\<^sub>v unit_vec n j\<rangle>) $ ia
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
(col A i + c \<cdot>\<^sub>v col A j) $ k = A $$ (k, i) + c * A $$ (k, j)
(\<Sum>x<n. A $$ (k, x) * ((if x = i then 1 else 0) + c * (if x = j then 1 else 0))) = (\<Sum>x<n. A $$ (k, x) * (if x = i then 1 else 0)) + (\<Sum>x<n. A $$ (k, x) * c * (if x = j then 1 else 0))
\<forall>x<n. A $$ (k, x) * (if x = i then 1 else 0) = (if x = i then A $$ (k, x) else 0)
\<forall>x<n. A $$ (k, x) * c * (if x = j then 1 else 0) = (if x = j then A $$ (k, x) * c else 0)
[PROOF STEP]
show "(col A i + c \<cdot>\<^sub>v col A j) $ k = col_fst (A * |unit_vec n i + c \<cdot>\<^sub>v unit_vec n j\<rangle>) $ k"
[PROOF STATE]
proof (prove)
using this:
(col A i + c \<cdot>\<^sub>v col A j) $ k = A $$ (k, i) + c * A $$ (k, j)
(\<Sum>x<n. A $$ (k, x) * ((if x = i then 1 else 0) + c * (if x = j then 1 else 0))) = (\<Sum>x<n. A $$ (k, x) * (if x = i then 1 else 0)) + (\<Sum>x<n. A $$ (k, x) * c * (if x = j then 1 else 0))
\<forall>x<n. A $$ (k, x) * (if x = i then 1 else 0) = (if x = i then A $$ (k, x) else 0)
\<forall>x<n. A $$ (k, x) * c * (if x = j then 1 else 0) = (if x = j then A $$ (k, x) * c else 0)

goal (1 subgoal):
 1. (col A i + c \<cdot>\<^sub>v col A j) $ k = col_fst (A * |unit_vec n i + c \<cdot>\<^sub>v unit_vec n j\<rangle>) $ k
[PROOF STEP]
using f0 assms(1-3) times_mat_def scalar_prod_def ket_vec_def
[PROOF STATE]
proof (prove)
using this:
(col A i + c \<cdot>\<^sub>v col A j) $ k = A $$ (k, i) + c * A $$ (k, j)
(\<Sum>x<n. A $$ (k, x) * ((if x = i then 1 else 0) + c * (if x = j then 1 else 0))) = (\<Sum>x<n. A $$ (k, x) * (if x = i then 1 else 0)) + (\<Sum>x<n. A $$ (k, x) * c * (if x = j then 1 else 0))
\<forall>x<n. A $$ (k, x) * (if x = i then 1 else 0) = (if x = i then A $$ (k, x) else 0)
\<forall>x<n. A $$ (k, x) * c * (if x = j then 1 else 0) = (if x = j then A $$ (k, x) * c else 0)
k < dim_row A
dim_col A = n
i < n
j < n
?A * ?B \<equiv> mat (dim_row ?A) (dim_col ?B) (\<lambda>(i, j). row ?A i \<bullet> col ?B j)
?v \<bullet> ?w \<equiv> \<Sum>i = 0..<dim_vec ?w. ?v $ i * ?w $ i
|?v\<rangle> \<equiv> mat (dim_vec ?v) 1 (\<lambda>(i, j). ?v $ i)

goal (1 subgoal):
 1. (col A i + c \<cdot>\<^sub>v col A j) $ k = col_fst (A * |unit_vec n i + c \<cdot>\<^sub>v unit_vec n j\<rangle>) $ k
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(col A i + c \<cdot>\<^sub>v col A j) $ k = col_fst (A * |unit_vec n i + c \<cdot>\<^sub>v unit_vec n j\<rangle>) $ k

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma commutativity_sums_over_funs:
  fixes X :: "'x set"
  fixes Y :: "'y set"
  shows "(\<Sum>i\<in>X. \<Sum>j\<in>Y. (f i j *\<^sub>R C \<bullet> g j)) = (\<Sum>j\<in>Y.\<Sum>i\<in>X. (f i j *\<^sub>R C \<bullet> g j))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i\<in>X. \<Sum>j\<in>Y. f i j *\<^sub>R C \<bullet> g j) = (\<Sum>j\<in>Y. \<Sum>i\<in>X. f i j *\<^sub>R C \<bullet> g j)
[PROOF STEP]
using Groups_Big.comm_monoid_add_class.sum.swap
[PROOF STATE]
proof (prove)
using this:
(\<Sum>i\<in>?A. sum (?g i) ?B) = (\<Sum>j\<in>?B. \<Sum>i\<in>?A. ?g i j)

goal (1 subgoal):
 1. (\<Sum>i\<in>X. \<Sum>j\<in>Y. f i j *\<^sub>R C \<bullet> g j) = (\<Sum>j\<in>Y. \<Sum>i\<in>X. f i j *\<^sub>R C \<bullet> g j)
[PROOF STEP]
by auto


[STATEMENT]
lemma co_continuous_dist_descending_chain:
  assumes "x \<in> Co_continuous"
      and "descending_chain f"
    shows "x * (INF n::nat . f n) = (INF n::nat . x * f n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x * \<Sqinter> range f = (\<Sqinter>n. x * f n)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x * \<Sqinter> range f = (\<Sqinter>n. x * f n)
[PROOF STEP]
have "x ^ o * (SUP n::nat . (dual o f) n) = (SUP n::nat . x ^ o * (dual o f) n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x ^ o * \<Squnion> range (dual \<circ> f) = (\<Squnion>n. x ^ o * (dual \<circ> f) n)
[PROOF STEP]
by (smt assms Continuous_dual SUP_cong ascending_chain_dual continuous_dist_ascending_chain descending_chain_def dual_dual o_def)
[PROOF STATE]
proof (state)
this:
x ^ o * \<Squnion> range (dual \<circ> f) = (\<Squnion>n. x ^ o * (dual \<circ> f) n)

goal (1 subgoal):
 1. x * \<Sqinter> range f = (\<Sqinter>n. x * f n)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
x ^ o * \<Squnion> range (dual \<circ> f) = (\<Squnion>n. x ^ o * (dual \<circ> f) n)

goal (1 subgoal):
 1. x * \<Sqinter> range f = (\<Sqinter>n. x * f n)
[PROOF STEP]
by (smt INF_cong dual_SUP dual_comp dual_dual o_def)
[PROOF STATE]
proof (state)
this:
x * \<Sqinter> range f = (\<Sqinter>n. x * f n)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma infsum_mono_neutral:
  fixes f :: "'a\<Rightarrow>'b::{ordered_comm_monoid_add,linorder_topology}"
  assumes "f summable_on A" and "g summable_on B"
  assumes \<open>\<And>x. x \<in> A\<inter>B \<Longrightarrow> f x \<le> g x\<close>
  assumes \<open>\<And>x. x \<in> A-B \<Longrightarrow> f x \<le> 0\<close>
  assumes \<open>\<And>x. x \<in> B-A \<Longrightarrow> g x \<ge> 0\<close>
  shows "infsum f A \<le> infsum g B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. infsum f A \<le> infsum g B
[PROOF STEP]
by (rule has_sum_mono_neutral[of f A _ g B _]) (use assms in \<open>auto intro: has_sum_infsum\<close>)


[STATEMENT]
lemma (in padic_integers) ord_Zp_ultrametric_diff:
  assumes "x \<in> nonzero Zp"
  assumes "y \<in> nonzero Zp"
  assumes "x \<noteq> y "
  shows "ord_Zp (x \<ominus> y) \<ge> min (ord_Zp x) (ord_Zp y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. min (ord_Zp x) (ord_Zp y) \<le> ord_Zp (x \<ominus> y)
[PROOF STEP]
using assms ord_Zp_ultrametric[of x "\<ominus> y"]
[PROOF STATE]
proof (prove)
using this:
x \<in> nonzero Zp
y \<in> nonzero Zp
x \<noteq> y
\<lbrakk>x \<in> nonzero Zp; \<ominus> y \<in> nonzero Zp; x \<oplus> \<ominus> y \<in> nonzero Zp\<rbrakk> \<Longrightarrow> min (ord_Zp x) (ord_Zp (\<ominus> y)) \<le> ord_Zp (x \<oplus> \<ominus> y)

goal (1 subgoal):
 1. min (ord_Zp x) (ord_Zp y) \<le> ord_Zp (x \<ominus> y)
[PROOF STEP]
unfolding a_minus_def
[PROOF STATE]
proof (prove)
using this:
x \<in> nonzero Zp
y \<in> nonzero Zp
x \<noteq> y
\<lbrakk>x \<in> nonzero Zp; \<ominus> y \<in> nonzero Zp; x \<oplus> \<ominus> y \<in> nonzero Zp\<rbrakk> \<Longrightarrow> min (ord_Zp x) (ord_Zp (\<ominus> y)) \<le> ord_Zp (x \<oplus> \<ominus> y)

goal (1 subgoal):
 1. min (ord_Zp x) (ord_Zp y) \<le> ord_Zp (x \<oplus> \<ominus> y)
[PROOF STEP]
by (metis (no_types, lifting) R.a_transpose_inv R.add.inv_closed R.add.m_closed R.l_neg nonzero_closed ord_Zp_of_a_inv ord_of_nonzero(2) ord_pos)


[STATEMENT]
lemma poly_no_roots_less_leq:
  "(\<forall>x. a < x \<and> x \<le> b \<longrightarrow> poly p x \<noteq> 0) \<longleftrightarrow>
   ((a \<ge> b \<or> (p \<noteq> 0 \<and> count_roots_between p a b = 0)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>x. a < x \<and> x \<le> b \<longrightarrow> poly p x \<noteq> 0) = (b \<le> a \<or> p \<noteq> 0 \<and> count_roots_between p a b = 0)
[PROOF STEP]
by (auto simp: count_roots_between_correct card_eq_0_iff not_le
           dest: poly_roots_finite)


[STATEMENT]
lemma octo_norm_property:
  "inner x y = (1/2)* ((norm(x+y))^2 - (norm(x))^2 - (norm(y))^2) " for x y ::octo
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<bullet> y = 1 / 2 * ((norm (x + y))\<^sup>2 - (norm x)\<^sup>2 - (norm y)\<^sup>2)
[PROOF STEP]
by (simp add: dot_norm norm_octo_def)


[STATEMENT]
lemma Basis_list_R3: "Basis_list = [(1,0,0), (0, 1, 0), (0, 0, 1)::R3]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Basis_list = [(1, 0, 0), (0, 1, 0), (0, 0, 1)]
[PROOF STEP]
by (auto simp: Basis_list_prod_def Basis_list_real_def zero_prod_def)


[STATEMENT]
lemma eventually_lower_bound_power_even_nonpos:
  assumes "even n" "eventually (\<lambda>x. u x \<le> (0::real)) at_top"
          "eventually (\<lambda>x. f x \<le> u x) at_top"
  shows   "eventually (\<lambda>x. u x ^ n \<le> f x ^ n) at_top"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. u x ^ n \<le> f x ^ n
[PROOF STEP]
using assms(2-)
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in at_top. u x \<le> 0
\<forall>\<^sub>F x in at_top. f x \<le> u x

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. u x ^ n \<le> f x ^ n
[PROOF STEP]
by eventually_elim (rule power_mono_even, auto simp: assms(1))


[STATEMENT]
lemma (in prob_space) indep_setD:
  assumes indep: "indep_set A B" and ev: "a \<in> A" "b \<in> B"
  shows "prob (a \<inter> b) = prob a * prob b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prob (a \<inter> b) = prob a * prob b
[PROOF STEP]
using indep[unfolded indep_set_def, THEN indep_setsD, of UNIV "case_bool a b"] ev
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>UNIV \<subseteq> UNIV; UNIV \<noteq> {}; finite UNIV; \<forall>j\<in>UNIV. (case j of True \<Rightarrow> a | False \<Rightarrow> b) \<in> (case j of True \<Rightarrow> A | False \<Rightarrow> B)\<rbrakk> \<Longrightarrow> prob (\<Inter>j. case j of True \<Rightarrow> a | False \<Rightarrow> b) = (\<Prod>j\<in>UNIV. prob (case j of True \<Rightarrow> a | False \<Rightarrow> b))
a \<in> A
b \<in> B

goal (1 subgoal):
 1. prob (a \<inter> b) = prob a * prob b
[PROOF STEP]
by (simp add: ac_simps UNIV_bool)


[STATEMENT]
lemma horner_eval_Suc[simp]:
  fixes x::"'a::linordered_idom"
  shows "horner_eval f x (Suc n) = horner_eval f x n + (f n) * x^n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. horner_eval f x (Suc n) = horner_eval f x n + f n * x ^ n
[PROOF STEP]
unfolding horner_eval_eq_setsum
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i<Suc n. f i * x ^ i) = (\<Sum>i<n. f i * x ^ i) + f n * x ^ n
[PROOF STEP]
by simp


[STATEMENT]
lemma Sup_upto_llist_eq_Sup_llist_ltake: "Sup_upto_llist Xs j = Sup_llist (ltake (eSuc j) Xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Sup_upto_llist Xs j = Sup_llist (ltake (eSuc j) Xs)
[PROOF STEP]
unfolding Sup_upto_llist_def Sup_llist_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union> (lnth Xs ` {i. enat i < llength Xs \<and> enat i \<le> j}) = \<Union> (lnth (ltake (eSuc j) Xs) ` {i. enat i < llength (ltake (eSuc j) Xs)})
[PROOF STEP]
by (smt Collect_cong Sup.SUP_cong iless_Suc_eq lnth_ltake less_llength_ltake mem_Collect_eq)


[STATEMENT]
lemma interval_integral_eq_integral':
  fixes f :: "real \<Rightarrow> 'a::euclidean_space"
  shows "a \<le> b \<Longrightarrow> set_integrable lborel (einterval a b) f \<Longrightarrow> LBINT x=a..b. f x = integral (einterval a b) f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<le> b; set_integrable lborel (einterval a b) f\<rbrakk> \<Longrightarrow> interval_lebesgue_integral lborel a b f = integral (einterval a b) f
[PROOF STEP]
by (subst interval_lebesgue_integral_le_eq, simp) (rule set_borel_integral_eq_integral)


[STATEMENT]
lemma triangle_inequality_2:
  assumes "Bet A' B' C'" and
    "Cong A B A' B'" and
    "Cong B C B' C'"
  shows "A C Le A' C'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A C Le A' C'
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. A C Le A' C'
[PROOF STEP]
obtain D where P1: "Bet A B D \<and> Cong B D B C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>D. Bet A B D \<and> Cong B D B C \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using segment_construction
[PROOF STATE]
proof (prove)
using this:
\<forall>a b c q. \<exists>x. Bet q a x \<and> Cong a x b c

goal (1 subgoal):
 1. (\<And>D. Bet A B D \<and> Cong B D B C \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
Bet A B D \<and> Cong B D B C

goal (1 subgoal):
 1. A C Le A' C'
[PROOF STEP]
have P2: "A C Le A D"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A C Le A D
[PROOF STEP]
by (meson P1 Tarski_neutral_dimensionless.triangle_inequality Tarski_neutral_dimensionless_axioms not_cong_3412)
[PROOF STATE]
proof (state)
this:
A C Le A D

goal (1 subgoal):
 1. A C Le A' C'
[PROOF STEP]
have "Cong A D A' C'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Cong A D A' C'
[PROOF STEP]
using P1 assms(1) assms(2) assms(3) cong_transitivity l2_11_b
[PROOF STATE]
proof (prove)
using this:
Bet A B D \<and> Cong B D B C
Bet A' B' C'
Cong A B A' B'
Cong B C B' C'
\<lbrakk>Cong ?A ?B ?C ?D; Cong ?C ?D ?E ?F\<rbrakk> \<Longrightarrow> Cong ?A ?B ?E ?F
\<lbrakk>Bet ?A ?B ?C; Bet ?A' ?B' ?C'; Cong ?A ?B ?A' ?B'; Cong ?B ?C ?B' ?C'\<rbrakk> \<Longrightarrow> Cong ?A ?C ?A' ?C'

goal (1 subgoal):
 1. Cong A D A' C'
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
Cong A D A' C'

goal (1 subgoal):
 1. A C Le A' C'
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
Cong A D A' C'

goal (1 subgoal):
 1. A C Le A' C'
[PROOF STEP]
using P2 cong__le le_transitivity
[PROOF STATE]
proof (prove)
using this:
Cong A D A' C'
A C Le A D
Cong ?A ?B ?C ?D \<Longrightarrow> ?A ?B Le ?C ?D
\<lbrakk>?A ?B Le ?C ?D; ?C ?D Le ?E ?F\<rbrakk> \<Longrightarrow> ?A ?B Le ?E ?F

goal (1 subgoal):
 1. A C Le A' C'
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
A C Le A' C'

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma bounded_Times:
  assumes "bounded s" "bounded t"
  shows "bounded (s \<times> t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bounded (s \<times> t)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. bounded (s \<times> t)
[PROOF STEP]
obtain x y a b where "\<forall>z\<in>s. dist x z \<le> a" "\<forall>z\<in>t. dist y z \<le> b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>x a y b. \<lbrakk>\<forall>z\<in>s. dist x z \<le> a; \<forall>z\<in>t. dist y z \<le> b\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms [unfolded bounded_def]
[PROOF STATE]
proof (prove)
using this:
\<exists>x e. \<forall>y\<in>s. dist x y \<le> e
\<exists>x e. \<forall>y\<in>t. dist x y \<le> e

goal (1 subgoal):
 1. (\<And>x a y b. \<lbrakk>\<forall>z\<in>s. dist x z \<le> a; \<forall>z\<in>t. dist y z \<le> b\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>z\<in>s. dist x z \<le> a
\<forall>z\<in>t. dist y z \<le> b

goal (1 subgoal):
 1. bounded (s \<times> t)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>z\<in>s. dist x z \<le> a
\<forall>z\<in>t. dist y z \<le> b
[PROOF STEP]
have "\<forall>z\<in>s \<times> t. dist (x, y) z \<le> sqrt (a\<^sup>2 + b\<^sup>2)"
[PROOF STATE]
proof (prove)
using this:
\<forall>z\<in>s. dist x z \<le> a
\<forall>z\<in>t. dist y z \<le> b

goal (1 subgoal):
 1. \<forall>z\<in>s \<times> t. dist (x, y) z \<le> sqrt (a\<^sup>2 + b\<^sup>2)
[PROOF STEP]
by (auto simp: dist_Pair_Pair real_sqrt_le_mono add_mono power_mono)
[PROOF STATE]
proof (state)
this:
\<forall>z\<in>s \<times> t. dist (x, y) z \<le> sqrt (a\<^sup>2 + b\<^sup>2)

goal (1 subgoal):
 1. bounded (s \<times> t)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>z\<in>s \<times> t. dist (x, y) z \<le> sqrt (a\<^sup>2 + b\<^sup>2)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<forall>z\<in>s \<times> t. dist (x, y) z \<le> sqrt (a\<^sup>2 + b\<^sup>2)

goal (1 subgoal):
 1. bounded (s \<times> t)
[PROOF STEP]
unfolding bounded_any_center [where a="(x, y)"]
[PROOF STATE]
proof (prove)
using this:
\<forall>z\<in>s \<times> t. dist (x, y) z \<le> sqrt (a\<^sup>2 + b\<^sup>2)

goal (1 subgoal):
 1. \<exists>e. \<forall>ya\<in>s \<times> t. dist (x, y) ya \<le> e
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
bounded (s \<times> t)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem (in group_action) stabilizer_subgroup:
  assumes "x \<in> E"
  shows "subgroup (stabilizer G \<phi> x) G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subgroup (stabilizer G \<phi> x) G
[PROOF STEP]
unfolding subgroup_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (stabilizer G \<phi> x \<subseteq> carrier G \<and> (\<forall>xa y. xa \<in> stabilizer G \<phi> x \<longrightarrow> y \<in> stabilizer G \<phi> x \<longrightarrow> xa \<otimes> y \<in> stabilizer G \<phi> x)) \<and> \<one> \<in> stabilizer G \<phi> x \<and> (\<forall>xa. xa \<in> stabilizer G \<phi> x \<longrightarrow> inv xa \<in> stabilizer G \<phi> x)
[PROOF STEP]
using stabilizer_subset stabilizer_m_closed stabilizer_one_closed
        stabilizer_m_inv_closed assms
[PROOF STATE]
proof (prove)
using this:
stabilizer G \<phi> ?x \<subseteq> carrier G
\<lbrakk>?x \<in> E; ?g1.0 \<in> stabilizer G \<phi> ?x; ?g2.0 \<in> stabilizer G \<phi> ?x\<rbrakk> \<Longrightarrow> ?g1.0 \<otimes> ?g2.0 \<in> stabilizer G \<phi> ?x
?x \<in> E \<Longrightarrow> \<one> \<in> stabilizer G \<phi> ?x
\<lbrakk>?x \<in> E; ?g \<in> stabilizer G \<phi> ?x\<rbrakk> \<Longrightarrow> inv ?g \<in> stabilizer G \<phi> ?x
x \<in> E

goal (1 subgoal):
 1. (stabilizer G \<phi> x \<subseteq> carrier G \<and> (\<forall>xa y. xa \<in> stabilizer G \<phi> x \<longrightarrow> y \<in> stabilizer G \<phi> x \<longrightarrow> xa \<otimes> y \<in> stabilizer G \<phi> x)) \<and> \<one> \<in> stabilizer G \<phi> x \<and> (\<forall>xa. xa \<in> stabilizer G \<phi> x \<longrightarrow> inv xa \<in> stabilizer G \<phi> x)
[PROOF STEP]
by simp


[STATEMENT]
lemma vector_derivative_diff_at [simp,derivative_intros]:
  "\<lbrakk>f differentiable at a; g differentiable at a\<rbrakk>
   \<Longrightarrow> vector_derivative (\<lambda>x. f x - g x) (at a) = vector_derivative f (at a) - vector_derivative g (at a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>f differentiable at a; g differentiable at a\<rbrakk> \<Longrightarrow> vector_derivative (\<lambda>x. f x - g x) (at a) = vector_derivative f (at a) - vector_derivative g (at a)
[PROOF STEP]
by (simp add: vector_derivative_at has_vector_derivative_diff vector_derivative_works [symmetric])


[STATEMENT]
lemma compact_space_discrete_topology: "compact_space(discrete_topology X) \<longleftrightarrow> finite X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. compact_space (discrete_topology X) = finite X
[PROOF STEP]
by (simp add: compactin_discrete_topology compact_space_def)


[STATEMENT]
lemma convex_rel_interior_if2:
  fixes S :: "'n::euclidean_space set"
  assumes "convex S"
  assumes "z \<in> rel_interior S"
  shows "\<forall>x\<in>affine hull S. \<exists>e. e > 1 \<and> (1 - e)*\<^sub>R x + e *\<^sub>R z \<in> S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>affine hull S. \<exists>e>1. (1 - e) *\<^sub>R x + e *\<^sub>R z \<in> S
[PROOF STEP]
using convex_rel_interior_if[of S z] assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>convex S; z \<in> rel_interior S\<rbrakk> \<Longrightarrow> \<forall>x\<in>affine hull S. \<exists>m>1. \<forall>e. 1 < e \<and> e \<le> m \<longrightarrow> (1 - e) *\<^sub>R x + e *\<^sub>R z \<in> S
convex S
z \<in> rel_interior S

goal (1 subgoal):
 1. \<forall>x\<in>affine hull S. \<exists>e>1. (1 - e) *\<^sub>R x + e *\<^sub>R z \<in> S
[PROOF STEP]
by auto


[STATEMENT]
lemma diameter_bounded:
  assumes "bounded S"
  shows "\<forall>x\<in>S. \<forall>y\<in>S. dist x y \<le> diameter S"
    and "\<forall>d>0. d < diameter S \<longrightarrow> (\<exists>x\<in>S. \<exists>y\<in>S. dist x y > d)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>S. \<forall>y\<in>S. dist x y \<le> diameter S &&& \<forall>d>0. d < diameter S \<longrightarrow> (\<exists>x\<in>S. \<exists>y\<in>S. d < dist x y)
[PROOF STEP]
using diameter_bounded_bound[of S] diameter_lower_bounded[of S] assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>bounded S; ?x \<in> S; ?y \<in> S\<rbrakk> \<Longrightarrow> dist ?x ?y \<le> diameter S
\<lbrakk>bounded S; 0 < ?d; ?d < diameter S\<rbrakk> \<Longrightarrow> \<exists>x\<in>S. \<exists>y\<in>S. ?d < dist x y
bounded S

goal (1 subgoal):
 1. \<forall>x\<in>S. \<forall>y\<in>S. dist x y \<le> diameter S &&& \<forall>d>0. d < diameter S \<longrightarrow> (\<exists>x\<in>S. \<exists>y\<in>S. d < dist x y)
[PROOF STEP]
by auto


[STATEMENT]
lemma at_top_within_at_top_bounded_right:
  fixes a b::"'a::{dense_order,linorder_topology}"
  assumes "a < b"
  shows "at_top_within {a..<b} = at_left b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. at_top_within {a..<b} = at_left b
[PROOF STEP]
unfolding at_top_within_def at_left_eq[OF assms(1)]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (INF k\<in>{a..<b}. principal ({k..} \<inter> {a..<b})) = (INF a\<in>{..<b}. principal {a<..<b})
[PROOF STEP]
apply (auto intro!: INF_eq)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>i. \<lbrakk>a \<le> i; i < b\<rbrakk> \<Longrightarrow> \<exists>j\<in>{..<b}. {j<..<b} \<subseteq> {i..<b}
 2. \<And>j. j < b \<Longrightarrow> \<exists>i\<in>{a..<b}. b \<le> i \<or> j < i
[PROOF STEP]
apply (smt atLeastLessThan_iff greaterThanLessThan_iff le_less lessThan_iff max.absorb1 subset_eq)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>j. j < b \<Longrightarrow> \<exists>i\<in>{a..<b}. b \<le> i \<or> j < i
[PROOF STEP]
by (metis assms atLeastLessThan_iff dense linear max.absorb1 not_less order_trans)


[STATEMENT]
lemma of_int_hom_less: "(of_int_hom.vec_hom v :: 'a :: linordered_field vec) <\<^sub>v of_int_hom.vec_hom w \<longleftrightarrow> v <\<^sub>v w"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (of_int_hom.vec_hom v <\<^sub>v of_int_hom.vec_hom w) = (v <\<^sub>v w)
[PROOF STEP]
unfolding less_vec_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (dim_vec (of_int_hom.vec_hom v) = dim_vec (of_int_hom.vec_hom w) \<and> (\<forall>i<dim_vec (of_int_hom.vec_hom w). of_int_hom.vec_hom v $ i < of_int_hom.vec_hom w $ i)) = (dim_vec v = dim_vec w \<and> (\<forall>i<dim_vec w. v $ i < w $ i))
[PROOF STEP]
by auto


[STATEMENT]
lemma "lives agatha \<and> lives butler \<and> lives charles \<and>
       (killed agatha agatha \<or> killed butler agatha \<or> killed charles agatha) \<and>
       (\<forall>x y. killed x y \<longrightarrow> hates x y \<and> \<not>richer x y) \<and>
       (\<forall>x. hates agatha x \<longrightarrow> \<not>hates charles x) \<and>
       (hates agatha agatha \<and> hates agatha charles) \<and>
       (\<forall>x. lives x \<and> \<not>richer x agatha \<longrightarrow> hates butler x) \<and>
       (\<forall>x. hates agatha x \<longrightarrow> hates butler x) \<and>
       (\<forall>x. \<not>hates x agatha \<or> \<not>hates x butler \<or> \<not>hates x charles) \<longrightarrow>
       (\<exists>x. killed x agatha)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lives agatha \<and> lives butler \<and> lives charles \<and> (killed agatha agatha \<or> killed butler agatha \<or> killed charles agatha) \<and> (\<forall>x y. killed x y \<longrightarrow> hates x y \<and> \<not> richer x y) \<and> (\<forall>x. hates agatha x \<longrightarrow> \<not> hates charles x) \<and> (hates agatha agatha \<and> hates agatha charles) \<and> (\<forall>x. lives x \<and> \<not> richer x agatha \<longrightarrow> hates butler x) \<and> (\<forall>x. hates agatha x \<longrightarrow> hates butler x) \<and> (\<forall>x. \<not> hates x agatha \<or> \<not> hates x butler \<or> \<not> hates x charles) \<longrightarrow> (\<exists>x. killed x agatha)
[PROOF STEP]
by meson


[STATEMENT]
lemma of_nat_xor_eq:
  \<open>of_nat (m XOR n) = of_nat m XOR of_nat n\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. of_nat (m XOR n) = of_nat m XOR of_nat n
[PROOF STEP]
by (rule bit_eqI) (simp add: bit_of_nat_iff bit_xor_iff Bit_Operations.bit_xor_iff)


[STATEMENT]
lemma (in group) finite_cyclic_subgroup_order:
   "x \<in> carrier G \<Longrightarrow> finite(carrier(subgroup_generated G {x})) \<longleftrightarrow> ord x \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> carrier G \<Longrightarrow> finite (carrier (subgroup_generated G {x})) = (ord x \<noteq> 0)
[PROOF STEP]
by (simp add: finite_cyclic_subgroup ord_eq_0)


[STATEMENT]
lemma abs_infty_poly_triangle_ineq:
  "abs_infty_poly (x+y) \<le> abs_infty_poly x + abs_infty_poly y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. abs_infty_poly (x + y) \<le> abs_infty_poly x + abs_infty_poly y
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. abs_infty_poly (x + y) \<le> abs_infty_poly x + abs_infty_poly y
[PROOF STEP]
have "abs_infty_q (poly.coeff (of_qr x) xa +
    poly.coeff (of_qr y) xa) \<le>
    abs_infty_q (poly.coeff (of_qr x) xa) +
    abs_infty_q (poly.coeff (of_qr y) xa)"
    for xa
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. abs_infty_q (poly.coeff (of_qr x) xa + poly.coeff (of_qr y) xa) \<le> abs_infty_q (poly.coeff (of_qr x) xa) + abs_infty_q (poly.coeff (of_qr y) xa)
[PROOF STEP]
using abs_infty_q_triangle_ineq[of
      "poly.coeff (of_qr x) xa" "poly.coeff (of_qr y) xa"]
[PROOF STATE]
proof (prove)
using this:
abs_infty_q (poly.coeff (of_qr x) xa + poly.coeff (of_qr y) xa) \<le> abs_infty_q (poly.coeff (of_qr x) xa) + abs_infty_q (poly.coeff (of_qr y) xa)

goal (1 subgoal):
 1. abs_infty_q (poly.coeff (of_qr x) xa + poly.coeff (of_qr y) xa) \<le> abs_infty_q (poly.coeff (of_qr x) xa) + abs_infty_q (poly.coeff (of_qr y) xa)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
abs_infty_q (poly.coeff (of_qr x) ?xa + poly.coeff (of_qr y) ?xa) \<le> abs_infty_q (poly.coeff (of_qr x) ?xa) + abs_infty_q (poly.coeff (of_qr y) ?xa)

goal (1 subgoal):
 1. abs_infty_poly (x + y) \<le> abs_infty_poly x + abs_infty_poly y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
abs_infty_q (poly.coeff (of_qr x) ?xa + poly.coeff (of_qr y) ?xa) \<le> abs_infty_q (poly.coeff (of_qr x) ?xa) + abs_infty_q (poly.coeff (of_qr y) ?xa)
[PROOF STEP]
have abs_q_triang: "\<forall>xa.
    abs_infty_q (poly.coeff (of_qr x) xa + poly.coeff (of_qr y) xa) \<le>
    abs_infty_q (poly.coeff (of_qr x) xa) +
    abs_infty_q (poly.coeff (of_qr y) xa)"
[PROOF STATE]
proof (prove)
using this:
abs_infty_q (poly.coeff (of_qr x) ?xa + poly.coeff (of_qr y) ?xa) \<le> abs_infty_q (poly.coeff (of_qr x) ?xa) + abs_infty_q (poly.coeff (of_qr y) ?xa)

goal (1 subgoal):
 1. \<forall>xa. abs_infty_q (poly.coeff (of_qr x) xa + poly.coeff (of_qr y) xa) \<le> abs_infty_q (poly.coeff (of_qr x) xa) + abs_infty_q (poly.coeff (of_qr y) xa)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>xa. abs_infty_q (poly.coeff (of_qr x) xa + poly.coeff (of_qr y) xa) \<le> abs_infty_q (poly.coeff (of_qr x) xa) + abs_infty_q (poly.coeff (of_qr y) xa)

goal (1 subgoal):
 1. abs_infty_poly (x + y) \<le> abs_infty_poly x + abs_infty_poly y
[PROOF STEP]
have "(MAX xa. abs_infty_q (poly.coeff (of_qr x) xa +
      poly.coeff (of_qr y) xa))
    \<le> (MAX xa. abs_infty_q (poly.coeff (of_qr x) xa) +
      abs_infty_q (poly.coeff (of_qr y) xa))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (MAX xa. abs_infty_q (poly.coeff (of_qr x) xa + poly.coeff (of_qr y) xa)) \<le> (MAX xa. abs_infty_q (poly.coeff (of_qr x) xa) + abs_infty_q (poly.coeff (of_qr y) xa))
[PROOF STEP]
using Max_mono'[OF abs_q_triang finite_Max_sum finite_Max_sum']
[PROOF STATE]
proof (prove)
using this:
(MAX xa. abs_infty_q (poly.coeff (of_qr x) xa + poly.coeff (of_qr y) xa)) \<le> (MAX xa. abs_infty_q (poly.coeff (of_qr x) xa) + abs_infty_q (poly.coeff (of_qr y) xa))

goal (1 subgoal):
 1. (MAX xa. abs_infty_q (poly.coeff (of_qr x) xa + poly.coeff (of_qr y) xa)) \<le> (MAX xa. abs_infty_q (poly.coeff (of_qr x) xa) + abs_infty_q (poly.coeff (of_qr y) xa))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(MAX xa. abs_infty_q (poly.coeff (of_qr x) xa + poly.coeff (of_qr y) xa)) \<le> (MAX xa. abs_infty_q (poly.coeff (of_qr x) xa) + abs_infty_q (poly.coeff (of_qr y) xa))

goal (1 subgoal):
 1. abs_infty_poly (x + y) \<le> abs_infty_poly x + abs_infty_poly y
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(MAX xa. abs_infty_q (poly.coeff (of_qr x) xa + poly.coeff (of_qr y) xa)) \<le> (MAX xa. abs_infty_q (poly.coeff (of_qr x) xa) + abs_infty_q (poly.coeff (of_qr y) xa))

goal (1 subgoal):
 1. abs_infty_poly (x + y) \<le> abs_infty_poly x + abs_infty_poly y
[PROOF STEP]
have "\<dots> \<le> (MAX xa. abs_infty_q (poly.coeff (of_qr x) xa)) +
       (MAX xb. abs_infty_q (poly.coeff (of_qr y) xb))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (MAX xa. abs_infty_q (poly.coeff (of_qr x) xa) + abs_infty_q (poly.coeff (of_qr y) xa)) \<le> (MAX xa. abs_infty_q (poly.coeff (of_qr x) xa)) + (MAX xb. abs_infty_q (poly.coeff (of_qr y) xb))
[PROOF STEP]
using Max_mono_plus[OF finite_Max[of x] finite_Max[of y]]
[PROOF STATE]
proof (prove)
using this:
(MAX xa. abs_infty_q (poly.coeff (of_qr x) xa) + abs_infty_q (poly.coeff (of_qr y) xa)) \<le> (MAX xa. abs_infty_q (poly.coeff (of_qr x) xa)) + (MAX x. abs_infty_q (poly.coeff (of_qr y) x))

goal (1 subgoal):
 1. (MAX xa. abs_infty_q (poly.coeff (of_qr x) xa) + abs_infty_q (poly.coeff (of_qr y) xa)) \<le> (MAX xa. abs_infty_q (poly.coeff (of_qr x) xa)) + (MAX xb. abs_infty_q (poly.coeff (of_qr y) xb))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(MAX xa. abs_infty_q (poly.coeff (of_qr x) xa) + abs_infty_q (poly.coeff (of_qr y) xa)) \<le> (MAX xa. abs_infty_q (poly.coeff (of_qr x) xa)) + (MAX xb. abs_infty_q (poly.coeff (of_qr y) xb))

goal (1 subgoal):
 1. abs_infty_poly (x + y) \<le> abs_infty_poly x + abs_infty_poly y
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(MAX xa. abs_infty_q (poly.coeff (of_qr x) xa + poly.coeff (of_qr y) xa)) \<le> (MAX xa. abs_infty_q (poly.coeff (of_qr x) xa)) + (MAX xb. abs_infty_q (poly.coeff (of_qr y) xb))
[PROOF STEP]
have "(MAX xa. abs_infty_q (poly.coeff (of_qr x) xa +
      poly.coeff (of_qr y) xa))
    \<le> (MAX xa. abs_infty_q (poly.coeff (of_qr x) xa)) +
       (MAX xb. abs_infty_q (poly.coeff (of_qr y) xb))"
[PROOF STATE]
proof (prove)
using this:
(MAX xa. abs_infty_q (poly.coeff (of_qr x) xa + poly.coeff (of_qr y) xa)) \<le> (MAX xa. abs_infty_q (poly.coeff (of_qr x) xa)) + (MAX xb. abs_infty_q (poly.coeff (of_qr y) xb))

goal (1 subgoal):
 1. (MAX xa. abs_infty_q (poly.coeff (of_qr x) xa + poly.coeff (of_qr y) xa)) \<le> (MAX xa. abs_infty_q (poly.coeff (of_qr x) xa)) + (MAX xb. abs_infty_q (poly.coeff (of_qr y) xb))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(MAX xa. abs_infty_q (poly.coeff (of_qr x) xa + poly.coeff (of_qr y) xa)) \<le> (MAX xa. abs_infty_q (poly.coeff (of_qr x) xa)) + (MAX xb. abs_infty_q (poly.coeff (of_qr y) xb))

goal (1 subgoal):
 1. abs_infty_poly (x + y) \<le> abs_infty_poly x + abs_infty_poly y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(MAX xa. abs_infty_q (poly.coeff (of_qr x) xa + poly.coeff (of_qr y) xa)) \<le> (MAX xa. abs_infty_q (poly.coeff (of_qr x) xa)) + (MAX xb. abs_infty_q (poly.coeff (of_qr y) xb))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(MAX xa. abs_infty_q (poly.coeff (of_qr x) xa + poly.coeff (of_qr y) xa)) \<le> (MAX xa. abs_infty_q (poly.coeff (of_qr x) xa)) + (MAX xb. abs_infty_q (poly.coeff (of_qr y) xb))

goal (1 subgoal):
 1. abs_infty_poly (x + y) \<le> abs_infty_poly x + abs_infty_poly y
[PROOF STEP]
by (auto simp add: abs_infty_poly_def)
[PROOF STATE]
proof (state)
this:
abs_infty_poly (x + y) \<le> abs_infty_poly x + abs_infty_poly y

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma push_bit_numeral_minus_1 [simp]:
  \<open>push_bit (numeral n) (- 1) = - (2 ^ numeral n)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. push_bit (numeral n) (- (1::'a)) = - ((2::'a) ^ numeral n)
[PROOF STEP]
by (simp add: push_bit_eq_mult)


[STATEMENT]
lemma sum_even_odd_split: "even (a::nat) \<Longrightarrow> (\<Sum>j=0..<(a div 2). f (2*j))+ (\<Sum>j=0..<(a div 2). f (2*j+1)) =  (\<Sum>j=0..<a. f j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. even a \<Longrightarrow> (\<Sum>j = 0..<a div 2. f (2 * j)) + (\<Sum>j = 0..<a div 2. f (2 * j + 1)) = sum f {0..<a}
[PROOF STEP]
by (induction a, simp)(metis even_two_times_div_two sum_splice)


[STATEMENT]
lemma fib_rec_even': "fib (2 * n) = (2 * fib (n - 1) + fib n) * fib n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fib (2 * n) = (2 * fib (n - 1) + fib n) * fib n
[PROOF STEP]
by (subst fib_rec_even, cases n) simp_all


[STATEMENT]
lemma intersects_y_axis_iff:
  assumes "is_poincare_line H"
  shows "(\<exists> y \<in> unit_disc. y \<in> circline_set H \<inter> circline_set y_axis) \<longleftrightarrow> intersects_y_axis H" (is "?lhs \<longleftrightarrow> ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>y\<in>unit_disc. y \<in> circline_set H \<inter> circline_set y_axis) = intersects_y_axis H
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<exists>y\<in>unit_disc. y \<in> circline_set H \<inter> circline_set y_axis) = intersects_y_axis H
[PROOF STEP]
let ?R = "moebius_rotation (pi / 2)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<exists>y\<in>unit_disc. y \<in> circline_set H \<inter> circline_set y_axis) = intersects_y_axis H
[PROOF STEP]
let ?H' = "moebius_circline ?R H"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<exists>y\<in>unit_disc. y \<in> circline_set H \<inter> circline_set y_axis) = intersects_y_axis H
[PROOF STEP]
have 1: "is_poincare_line ?H'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_poincare_line (moebius_circline (moebius_rotation (pi / 2)) H)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
is_poincare_line H

goal (1 subgoal):
 1. is_poincare_line (moebius_circline (moebius_rotation (pi / 2)) H)
[PROOF STEP]
using unit_circle_fix_preserve_is_poincare_line[OF _ assms, of ?R]
[PROOF STATE]
proof (prove)
using this:
is_poincare_line H
unit_circle_fix (moebius_rotation (pi / 2)) \<Longrightarrow> is_poincare_line (moebius_circline (moebius_rotation (pi / 2)) H)

goal (1 subgoal):
 1. is_poincare_line (moebius_circline (moebius_rotation (pi / 2)) H)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
is_poincare_line (moebius_circline (moebius_rotation (pi / 2)) H)

goal (1 subgoal):
 1. (\<exists>y\<in>unit_disc. y \<in> circline_set H \<inter> circline_set y_axis) = intersects_y_axis H
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>y\<in>unit_disc. y \<in> circline_set H \<inter> circline_set y_axis) = intersects_y_axis H
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<exists>y\<in>unit_disc. y \<in> circline_set H \<inter> circline_set y_axis \<Longrightarrow> intersects_y_axis H
 2. intersects_y_axis H \<Longrightarrow> \<exists>y\<in>unit_disc. y \<in> circline_set H \<inter> circline_set y_axis
[PROOF STEP]
assume "?lhs"
[PROOF STATE]
proof (state)
this:
\<exists>y\<in>unit_disc. y \<in> circline_set H \<inter> circline_set y_axis

goal (2 subgoals):
 1. \<exists>y\<in>unit_disc. y \<in> circline_set H \<inter> circline_set y_axis \<Longrightarrow> intersects_y_axis H
 2. intersects_y_axis H \<Longrightarrow> \<exists>y\<in>unit_disc. y \<in> circline_set H \<inter> circline_set y_axis
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>y\<in>unit_disc. y \<in> circline_set H \<inter> circline_set y_axis
[PROOF STEP]
obtain y where "y \<in> unit_disc" "y \<in> circline_set H \<inter> circline_set y_axis"
[PROOF STATE]
proof (prove)
using this:
\<exists>y\<in>unit_disc. y \<in> circline_set H \<inter> circline_set y_axis

goal (1 subgoal):
 1. (\<And>y. \<lbrakk>y \<in> unit_disc; y \<in> circline_set H \<inter> circline_set y_axis\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
y \<in> unit_disc
y \<in> circline_set H \<inter> circline_set y_axis

goal (2 subgoals):
 1. \<exists>y\<in>unit_disc. y \<in> circline_set H \<inter> circline_set y_axis \<Longrightarrow> intersects_y_axis H
 2. intersects_y_axis H \<Longrightarrow> \<exists>y\<in>unit_disc. y \<in> circline_set H \<inter> circline_set y_axis
[PROOF STEP]
hence "moebius_pt ?R y \<in> unit_disc \<and> moebius_pt ?R y \<in> circline_set ?H' \<inter> circline_set x_axis"
[PROOF STATE]
proof (prove)
using this:
y \<in> unit_disc
y \<in> circline_set H \<inter> circline_set y_axis

goal (1 subgoal):
 1. moebius_pt (moebius_rotation (pi / 2)) y \<in> unit_disc \<and> moebius_pt (moebius_rotation (pi / 2)) y \<in> circline_set (moebius_circline (moebius_rotation (pi / 2)) H) \<inter> circline_set x_axis
[PROOF STEP]
using rotation_pi_2_y_axis
[PROOF STATE]
proof (prove)
using this:
y \<in> unit_disc
y \<in> circline_set H \<inter> circline_set y_axis
moebius_circline (moebius_rotation (pi / 2)) y_axis = x_axis

goal (1 subgoal):
 1. moebius_pt (moebius_rotation (pi / 2)) y \<in> unit_disc \<and> moebius_pt (moebius_rotation (pi / 2)) y \<in> circline_set (moebius_circline (moebius_rotation (pi / 2)) H) \<inter> circline_set x_axis
[PROOF STEP]
by (metis Int_iff circline_set_moebius_circline_E moebius_circline_comp_inv_left moebius_pt_comp_inv_left unit_disc_fix_discI unit_disc_fix_rotation)
[PROOF STATE]
proof (state)
this:
moebius_pt (moebius_rotation (pi / 2)) y \<in> unit_disc \<and> moebius_pt (moebius_rotation (pi / 2)) y \<in> circline_set (moebius_circline (moebius_rotation (pi / 2)) H) \<inter> circline_set x_axis

goal (2 subgoals):
 1. \<exists>y\<in>unit_disc. y \<in> circline_set H \<inter> circline_set y_axis \<Longrightarrow> intersects_y_axis H
 2. intersects_y_axis H \<Longrightarrow> \<exists>y\<in>unit_disc. y \<in> circline_set H \<inter> circline_set y_axis
[PROOF STEP]
thus ?rhs
[PROOF STATE]
proof (prove)
using this:
moebius_pt (moebius_rotation (pi / 2)) y \<in> unit_disc \<and> moebius_pt (moebius_rotation (pi / 2)) y \<in> circline_set (moebius_circline (moebius_rotation (pi / 2)) H) \<inter> circline_set x_axis

goal (1 subgoal):
 1. intersects_y_axis H
[PROOF STEP]
using intersects_x_axis_iff[OF 1]
[PROOF STATE]
proof (prove)
using this:
moebius_pt (moebius_rotation (pi / 2)) y \<in> unit_disc \<and> moebius_pt (moebius_rotation (pi / 2)) y \<in> circline_set (moebius_circline (moebius_rotation (pi / 2)) H) \<inter> circline_set x_axis
(\<exists>x\<in>unit_disc. x \<in> circline_set (moebius_circline (moebius_rotation (pi / 2)) H) \<inter> circline_set x_axis) = intersects_x_axis (moebius_circline (moebius_rotation (pi / 2)) H)

goal (1 subgoal):
 1. intersects_y_axis H
[PROOF STEP]
using intersects_x_axis_intersects_y_axis[of H]
[PROOF STATE]
proof (prove)
using this:
moebius_pt (moebius_rotation (pi / 2)) y \<in> unit_disc \<and> moebius_pt (moebius_rotation (pi / 2)) y \<in> circline_set (moebius_circline (moebius_rotation (pi / 2)) H) \<inter> circline_set x_axis
(\<exists>x\<in>unit_disc. x \<in> circline_set (moebius_circline (moebius_rotation (pi / 2)) H) \<inter> circline_set x_axis) = intersects_x_axis (moebius_circline (moebius_rotation (pi / 2)) H)
intersects_x_axis (moebius_circline (moebius_rotation (pi / 2)) H) = intersects_y_axis H

goal (1 subgoal):
 1. intersects_y_axis H
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
intersects_y_axis H

goal (1 subgoal):
 1. intersects_y_axis H \<Longrightarrow> \<exists>y\<in>unit_disc. y \<in> circline_set H \<inter> circline_set y_axis
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. intersects_y_axis H \<Longrightarrow> \<exists>y\<in>unit_disc. y \<in> circline_set H \<inter> circline_set y_axis
[PROOF STEP]
assume "intersects_y_axis H"
[PROOF STATE]
proof (state)
this:
intersects_y_axis H

goal (1 subgoal):
 1. intersects_y_axis H \<Longrightarrow> \<exists>y\<in>unit_disc. y \<in> circline_set H \<inter> circline_set y_axis
[PROOF STEP]
hence "intersects_x_axis ?H'"
[PROOF STATE]
proof (prove)
using this:
intersects_y_axis H

goal (1 subgoal):
 1. intersects_x_axis (moebius_circline (moebius_rotation (pi / 2)) H)
[PROOF STEP]
using intersects_x_axis_intersects_y_axis[of H]
[PROOF STATE]
proof (prove)
using this:
intersects_y_axis H
intersects_x_axis (moebius_circline (moebius_rotation (pi / 2)) H) = intersects_y_axis H

goal (1 subgoal):
 1. intersects_x_axis (moebius_circline (moebius_rotation (pi / 2)) H)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
intersects_x_axis (moebius_circline (moebius_rotation (pi / 2)) H)

goal (1 subgoal):
 1. intersects_y_axis H \<Longrightarrow> \<exists>y\<in>unit_disc. y \<in> circline_set H \<inter> circline_set y_axis
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
intersects_x_axis (moebius_circline (moebius_rotation (pi / 2)) H)
[PROOF STEP]
obtain x where *: "x \<in> unit_disc" "x \<in> circline_set ?H' \<inter> circline_set x_axis"
[PROOF STATE]
proof (prove)
using this:
intersects_x_axis (moebius_circline (moebius_rotation (pi / 2)) H)

goal (1 subgoal):
 1. (\<And>x. \<lbrakk>x \<in> unit_disc; x \<in> circline_set (moebius_circline (moebius_rotation (pi / 2)) H) \<inter> circline_set x_axis\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using intersects_x_axis_iff[OF 1]
[PROOF STATE]
proof (prove)
using this:
intersects_x_axis (moebius_circline (moebius_rotation (pi / 2)) H)
(\<exists>x\<in>unit_disc. x \<in> circline_set (moebius_circline (moebius_rotation (pi / 2)) H) \<inter> circline_set x_axis) = intersects_x_axis (moebius_circline (moebius_rotation (pi / 2)) H)

goal (1 subgoal):
 1. (\<And>x. \<lbrakk>x \<in> unit_disc; x \<in> circline_set (moebius_circline (moebius_rotation (pi / 2)) H) \<inter> circline_set x_axis\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x \<in> unit_disc
x \<in> circline_set (moebius_circline (moebius_rotation (pi / 2)) H) \<inter> circline_set x_axis

goal (1 subgoal):
 1. intersects_y_axis H \<Longrightarrow> \<exists>y\<in>unit_disc. y \<in> circline_set H \<inter> circline_set y_axis
[PROOF STEP]
let ?y = "moebius_pt (-?R) x"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. intersects_y_axis H \<Longrightarrow> \<exists>y\<in>unit_disc. y \<in> circline_set H \<inter> circline_set y_axis
[PROOF STEP]
have "?y \<in> unit_disc \<and> ?y \<in> circline_set H \<inter> circline_set y_axis"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. moebius_pt (- moebius_rotation (pi / 2)) x \<in> unit_disc \<and> moebius_pt (- moebius_rotation (pi / 2)) x \<in> circline_set H \<inter> circline_set y_axis
[PROOF STEP]
using * rotation_pi_2_y_axis[symmetric]
[PROOF STATE]
proof (prove)
using this:
x \<in> unit_disc
x \<in> circline_set (moebius_circline (moebius_rotation (pi / 2)) H) \<inter> circline_set x_axis
x_axis = moebius_circline (moebius_rotation (pi / 2)) y_axis

goal (1 subgoal):
 1. moebius_pt (- moebius_rotation (pi / 2)) x \<in> unit_disc \<and> moebius_pt (- moebius_rotation (pi / 2)) x \<in> circline_set H \<inter> circline_set y_axis
[PROOF STEP]
by (metis Int_iff circline_set_moebius_circline_E moebius_pt_comp_inv_left moebius_rotation_uminus uminus_moebius_def unit_disc_fix_discI unit_disc_fix_rotation)
[PROOF STATE]
proof (state)
this:
moebius_pt (- moebius_rotation (pi / 2)) x \<in> unit_disc \<and> moebius_pt (- moebius_rotation (pi / 2)) x \<in> circline_set H \<inter> circline_set y_axis

goal (1 subgoal):
 1. intersects_y_axis H \<Longrightarrow> \<exists>y\<in>unit_disc. y \<in> circline_set H \<inter> circline_set y_axis
[PROOF STEP]
thus ?lhs
[PROOF STATE]
proof (prove)
using this:
moebius_pt (- moebius_rotation (pi / 2)) x \<in> unit_disc \<and> moebius_pt (- moebius_rotation (pi / 2)) x \<in> circline_set H \<inter> circline_set y_axis

goal (1 subgoal):
 1. \<exists>y\<in>unit_disc. y \<in> circline_set H \<inter> circline_set y_axis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>y\<in>unit_disc. y \<in> circline_set H \<inter> circline_set y_axis

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<exists>y\<in>unit_disc. y \<in> circline_set H \<inter> circline_set y_axis) = intersects_y_axis H

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in Group) Nfunc_LeastTr2_3:"\<lbrakk>\<forall>l \<le> (n::nat). G \<guillemotright> f l; \<forall>l \<le> n. G \<guillemotright> g l;
      i \<le> n; f i \<noteq> g i\<rbrakk>  \<Longrightarrow>
      f (LEAST k. (f k \<noteq>  g k)) \<noteq> g (LEAST k. (f k \<noteq>  g k))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>l\<le>n. G \<guillemotright> f l ; \<forall>l\<le>n. G \<guillemotright> g l ; i \<le> n; f i \<noteq> g i\<rbrakk> \<Longrightarrow> f (LEAST k. f k \<noteq> g k) \<noteq> g (LEAST k. f k \<noteq> g k)
[PROOF STEP]
apply (frule  Nfunc_LeastTr2_1 [of "i" "n" "f" "g"], assumption+)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>\<forall>l\<le>n. G \<guillemotright> f l ; \<forall>l\<le>n. G \<guillemotright> g l ; i \<le> n; f i \<noteq> g i\<rbrakk> \<Longrightarrow> NfuncPair_neq_at f g i
 2. \<lbrakk>\<forall>l\<le>n. G \<guillemotright> f l ; \<forall>l\<le>n. G \<guillemotright> g l ; i \<le> n; f i \<noteq> g i; NfuncPair_neq_at f g (LEAST k. NfuncPair_neq_at f g k)\<rbrakk> \<Longrightarrow> f (LEAST k. f k \<noteq> g k) \<noteq> g (LEAST k. f k \<noteq> g k)
[PROOF STEP]
apply (simp add:NfuncPair_neq_at_def)+
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma ex_countable_subset_image:
   "(\<exists>T. countable T \<and> T \<subseteq> f ` S \<and> P T) \<longleftrightarrow> (\<exists>T. countable T \<and> T \<subseteq> S \<and> P (f ` T))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>T. countable T \<and> T \<subseteq> f ` S \<and> P T) = (\<exists>T. countable T \<and> T \<subseteq> S \<and> P (f ` T))
[PROOF STEP]
by (metis countable_subset_image)


[STATEMENT]
lemma nonnegative_absolutely_integrable_1:
  fixes f :: "'a :: euclidean_space \<Rightarrow> real"
  assumes f: "f integrable_on A" and "\<And>x. x \<in> A \<Longrightarrow> 0 \<le> f x"
  shows "f absolutely_integrable_on A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f absolutely_integrable_on A
[PROOF STEP]
by (rule absolutely_integrable_onI [OF f]) (use assms in \<open>simp add: integrable_eq\<close>)


[STATEMENT]
lemma matrix_add_left_commute [simp]:
  "(A::('a::ab_semigroup_add,'m,'n) matrix) + (B + C) = B + (A + C)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A + (B + C) = B + (A + C)
[PROOF STEP]
by (metis matrix_add_assoc matrix_add_commute)


[STATEMENT]
lemma power_set_add:
  "A *^ (n + m) = (A *^ n) ** (A *^ m)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A *^ (n + m) = A *^ n ** A *^ m
[PROOF STEP]
apply (induct_tac m)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. A *^ (n + 0) = A *^ n ** A *^ 0
 2. \<And>na. A *^ (n + na) = A *^ n ** A *^ na \<Longrightarrow> A *^ (n + Suc na) = A *^ n ** A *^ Suc na
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. A *^ n = A *^ n ** {1::'a}
 2. \<And>na. A *^ (n + na) = A *^ n ** A *^ na \<Longrightarrow> A *^ (n + Suc na) = A *^ n ** A *^ Suc na
[PROOF STEP]
apply (simp add: times_set_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>na. A *^ (n + na) = A *^ n ** A *^ na \<Longrightarrow> A *^ (n + Suc na) = A *^ n ** A *^ Suc na
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>na. A *^ (n + na) = A *^ n ** A *^ na \<Longrightarrow> A ** (A *^ n ** A *^ na) = A *^ n ** (A ** A *^ na)
[PROOF STEP]
apply (subst times_set_assoc)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>na. A *^ (n + na) = A *^ n ** A *^ na \<Longrightarrow> A ** A *^ n ** A *^ na = A *^ n ** (A ** A *^ na)
[PROOF STEP]
apply (subst times_set_assoc)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>na. A *^ (n + na) = A *^ n ** A *^ na \<Longrightarrow> A ** A *^ n ** A *^ na = A *^ n ** A ** A *^ na
[PROOF STEP]
apply (subst power_set_Suc2 [THEN sym])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>na. A *^ (n + na) = A *^ n ** A *^ na \<Longrightarrow> A ** A *^ n ** A *^ na = A *^ Suc n ** A *^ na
[PROOF STEP]
by simp


[STATEMENT]
lemma arcosh_real_at_top:
  "filterlim (arcosh :: real \<Rightarrow> real) at_top at_top"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. filterlim arcosh at_top at_top
[PROOF STEP]
proof (subst filterlim_cong[OF refl refl])
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<forall>\<^sub>F x in at_top. arcosh x = ?g x
 2. filterlim ?g at_top at_top
[PROOF STEP]
show "filterlim (\<lambda>x. ln (x + sqrt (-1 + x\<^sup>2))) at_top at_top"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. LIM x at_top. ln (x + sqrt (- 1 + x\<^sup>2)) :> at_top
[PROOF STEP]
by (intro filterlim_compose[OF ln_at_top filterlim_at_top_add_at_top] filterlim_ident
              filterlim_compose[OF sqrt_at_top] filterlim_tendsto_add_at_top[OF tendsto_const]
              filterlim_pow_at_top) auto
[PROOF STATE]
proof (state)
this:
LIM x at_top. ln (x + sqrt (- 1 + x\<^sup>2)) :> at_top

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. arcosh x = ln (x + sqrt (- 1 + x\<^sup>2))
[PROOF STEP]
qed (auto intro!: eventually_mono[OF eventually_ge_at_top[of 1]] simp: arcosh_real_def)


[STATEMENT]
lemma nth_append:
  "(xs @ ys)!n = (if n < length xs then xs!n else ys!(n - length xs))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (xs @ ys) ! n = (if n < length xs then xs ! n else ys ! (n - length xs))
[PROOF STEP]
proof (induct xs arbitrary: n)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>n. ([] @ ys) ! n = (if n < length [] then [] ! n else ys ! (n - length []))
 2. \<And>a xs n. (\<And>n. (xs @ ys) ! n = (if n < length xs then xs ! n else ys ! (n - length xs))) \<Longrightarrow> ((a # xs) @ ys) ! n = (if n < length (a # xs) then (a # xs) ! n else ys ! (n - length (a # xs)))
[PROOF STEP]
case (Cons x xs)
[PROOF STATE]
proof (state)
this:
(xs @ ys) ! ?n = (if ?n < length xs then xs ! ?n else ys ! (?n - length xs))

goal (2 subgoals):
 1. \<And>n. ([] @ ys) ! n = (if n < length [] then [] ! n else ys ! (n - length []))
 2. \<And>a xs n. (\<And>n. (xs @ ys) ! n = (if n < length xs then xs ! n else ys ! (n - length xs))) \<Longrightarrow> ((a # xs) @ ys) ! n = (if n < length (a # xs) then (a # xs) ! n else ys ! (n - length (a # xs)))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(xs @ ys) ! ?n = (if ?n < length xs then xs ! ?n else ys ! (?n - length xs))
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
(xs @ ys) ! ?n = (if ?n < length xs then xs ! ?n else ys ! (?n - length xs))

goal (1 subgoal):
 1. ((x # xs) @ ys) ! n = (if n < length (x # xs) then (x # xs) ! n else ys ! (n - length (x # xs)))
[PROOF STEP]
using less_Suc_eq_0_disj
[PROOF STATE]
proof (prove)
using this:
(xs @ ys) ! ?n = (if ?n < length xs then xs ! ?n else ys ! (?n - length xs))
(?m < Suc ?n) = (?m = 0 \<or> (\<exists>j. ?m = Suc j \<and> j < ?n))

goal (1 subgoal):
 1. ((x # xs) @ ys) ! n = (if n < length (x # xs) then (x # xs) ! n else ys ! (n - length (x # xs)))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
((x # xs) @ ys) ! n = (if n < length (x # xs) then (x # xs) ! n else ys ! (n - length (x # xs)))

goal (1 subgoal):
 1. \<And>n. ([] @ ys) ! n = (if n < length [] then [] ! n else ys ! (n - length []))
[PROOF STEP]
qed simp


[STATEMENT]
lemma closure_of_locally_finite_Union:
  assumes "locally_finite_in X \"
  shows "X closure_of (\<Union>\) = \<Union>((\<lambda>S. X closure_of S) ` \)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. X closure_of \<Union> \ = \<Union> ((closure_of) X ` \)
[PROOF STEP]
proof (rule closure_of_unique)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<Union> \ \<subseteq> \<Union> ((closure_of) X ` \)
 2. closedin X (\<Union> ((closure_of) X ` \))
 3. \<And>T'. \<lbrakk>\<Union> \ \<subseteq> T'; closedin X T'\<rbrakk> \<Longrightarrow> \<Union> ((closure_of) X ` \) \<subseteq> T'
[PROOF STEP]
show "\<Union> \ \<subseteq> \<Union> ((closure_of) X ` \)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union> \ \<subseteq> \<Union> ((closure_of) X ` \)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
locally_finite_in X \

goal (1 subgoal):
 1. \<Union> \ \<subseteq> \<Union> ((closure_of) X ` \)
[PROOF STEP]
by (simp add: SUP_upper2 Sup_le_iff closure_of_subset locally_finite_in_def)
[PROOF STATE]
proof (state)
this:
\<Union> \ \<subseteq> \<Union> ((closure_of) X ` \)

goal (2 subgoals):
 1. closedin X (\<Union> ((closure_of) X ` \))
 2. \<And>T'. \<lbrakk>\<Union> \ \<subseteq> T'; closedin X T'\<rbrakk> \<Longrightarrow> \<Union> ((closure_of) X ` \) \<subseteq> T'
[PROOF STEP]
show "closedin X (\<Union> ((closure_of) X ` \))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closedin X (\<Union> ((closure_of) X ` \))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
locally_finite_in X \

goal (1 subgoal):
 1. closedin X (\<Union> ((closure_of) X ` \))
[PROOF STEP]
by (simp add: closedin_Union_locally_finite_closure)
[PROOF STATE]
proof (state)
this:
closedin X (\<Union> ((closure_of) X ` \))

goal (1 subgoal):
 1. \<And>T'. \<lbrakk>\<Union> \ \<subseteq> T'; closedin X T'\<rbrakk> \<Longrightarrow> \<Union> ((closure_of) X ` \) \<subseteq> T'
[PROOF STEP]
show "\<And>T'. \<lbrakk>\<Union> \ \<subseteq> T'; closedin X T'\<rbrakk> \<Longrightarrow> \<Union> ((closure_of) X ` \) \<subseteq> T'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>T'. \<lbrakk>\<Union> \ \<subseteq> T'; closedin X T'\<rbrakk> \<Longrightarrow> \<Union> ((closure_of) X ` \) \<subseteq> T'
[PROOF STEP]
by (simp add: Sup_le_iff closure_of_minimal)
[PROOF STATE]
proof (state)
this:
\<lbrakk>\<Union> \ \<subseteq> ?T'; closedin X ?T'\<rbrakk> \<Longrightarrow> \<Union> ((closure_of) X ` \) \<subseteq> ?T'

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem MVT:
  fixes a b :: real
  assumes lt: "a < b"
    and contf: "continuous_on {a..b} f"
    and dif: "\<And>x. \<lbrakk>a < x; x < b\<rbrakk> \<Longrightarrow> f differentiable (at x)"
  shows "\<exists>l z. a < z \<and> z < b \<and> DERIV f z :> l \<and> f b - f a = (b - a) * l"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>l z. a < z \<and> z < b \<and> (f has_real_derivative l) (at z) \<and> f b - f a = (b - a) * l
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>l z. a < z \<and> z < b \<and> (f has_real_derivative l) (at z) \<and> f b - f a = (b - a) * l
[PROOF STEP]
obtain f' :: "real \<Rightarrow> real \<Rightarrow> real"
    where derf: "\<And>x. a < x \<Longrightarrow> x < b \<Longrightarrow> (f has_derivative f' x) (at x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>f'. (\<And>x. \<lbrakk>a < x; x < b\<rbrakk> \<Longrightarrow> (f has_derivative f' x) (at x)) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using dif
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>a < ?x; ?x < b\<rbrakk> \<Longrightarrow> f differentiable at ?x

goal (1 subgoal):
 1. (\<And>f'. (\<And>x. \<lbrakk>a < x; x < b\<rbrakk> \<Longrightarrow> (f has_derivative f' x) (at x)) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding differentiable_def
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>a < ?x; ?x < b\<rbrakk> \<Longrightarrow> \<exists>D. (f has_derivative D) (at ?x)

goal (1 subgoal):
 1. (\<And>f'. (\<And>x. \<lbrakk>a < x; x < b\<rbrakk> \<Longrightarrow> (f has_derivative f' x) (at x)) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
\<lbrakk>a < ?x; ?x < b\<rbrakk> \<Longrightarrow> (f has_derivative f' ?x) (at ?x)

goal (1 subgoal):
 1. \<exists>l z. a < z \<and> z < b \<and> (f has_real_derivative l) (at z) \<and> f b - f a = (b - a) * l
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>a < ?x; ?x < b\<rbrakk> \<Longrightarrow> (f has_derivative f' ?x) (at ?x)
[PROOF STEP]
obtain z where "a < z" "z < b" "f b - f a = (f' z) (b - a)"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>a < ?x; ?x < b\<rbrakk> \<Longrightarrow> (f has_derivative f' ?x) (at ?x)

goal (1 subgoal):
 1. (\<And>z. \<lbrakk>a < z; z < b; f b - f a = f' z (b - a)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using mvt [OF lt contf]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>a < ?x; ?x < b\<rbrakk> \<Longrightarrow> (f has_derivative f' ?x) (at ?x)
\<lbrakk>\<And>x. \<lbrakk>a < x; x < b\<rbrakk> \<Longrightarrow> (f has_derivative ?f' x) (at x); \<And>\<xi>. \<lbrakk>a < \<xi>; \<xi> < b; f b - f a = ?f' \<xi> (b - a)\<rbrakk> \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. (\<And>z. \<lbrakk>a < z; z < b; f b - f a = f' z (b - a)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
a < z
z < b
f b - f a = f' z (b - a)

goal (1 subgoal):
 1. \<exists>l z. a < z \<and> z < b \<and> (f has_real_derivative l) (at z) \<and> f b - f a = (b - a) * l
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a < z
z < b
f b - f a = f' z (b - a)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
a < z
z < b
f b - f a = f' z (b - a)

goal (1 subgoal):
 1. \<exists>l z. a < z \<and> z < b \<and> (f has_real_derivative l) (at z) \<and> f b - f a = (b - a) * l
[PROOF STEP]
by (simp add: ac_simps)
      (metis derf dif has_derivative_unique has_field_derivative_imp_has_derivative real_differentiable_def)
[PROOF STATE]
proof (state)
this:
\<exists>l z. a < z \<and> z < b \<and> (f has_real_derivative l) (at z) \<and> f b - f a = (b - a) * l

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma eln_strict_mono2 [mono_intros]:
  assumes "x < y"
  shows "eln x < eln y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eln x < eln y
[PROOF STEP]
using eln_strict_mono assms
[PROOF STATE]
proof (prove)
using this:
strict_mono eln
x < y

goal (1 subgoal):
 1. eln x < eln y
[PROOF STEP]
unfolding strict_mono_def
[PROOF STATE]
proof (prove)
using this:
\<forall>x y. x < y \<longrightarrow> eln x < eln y
x < y

goal (1 subgoal):
 1. eln x < eln y
[PROOF STEP]
by auto


[STATEMENT]
lemma compact_affinity:
  fixes s :: "'a::real_normed_vector set"
  assumes "compact s"
  shows "compact ((\<lambda>x. a + c *\<^sub>R x) ` s)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. compact ((\<lambda>x. a + c *\<^sub>R x) ` s)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. compact ((\<lambda>x. a + c *\<^sub>R x) ` s)
[PROOF STEP]
have "(+) a ` (*\<^sub>R) c ` s = (\<lambda>x. a + c *\<^sub>R x) ` s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (+) a ` (*\<^sub>R) c ` s = (\<lambda>x. a + c *\<^sub>R x) ` s
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(+) a ` (*\<^sub>R) c ` s = (\<lambda>x. a + c *\<^sub>R x) ` s

goal (1 subgoal):
 1. compact ((\<lambda>x. a + c *\<^sub>R x) ` s)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(+) a ` (*\<^sub>R) c ` s = (\<lambda>x. a + c *\<^sub>R x) ` s
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(+) a ` (*\<^sub>R) c ` s = (\<lambda>x. a + c *\<^sub>R x) ` s

goal (1 subgoal):
 1. compact ((\<lambda>x. a + c *\<^sub>R x) ` s)
[PROOF STEP]
using compact_translation[OF compact_scaling[OF assms], of a c]
[PROOF STATE]
proof (prove)
using this:
(+) a ` (*\<^sub>R) c ` s = (\<lambda>x. a + c *\<^sub>R x) ` s
compact ((+) a ` (*\<^sub>R) c ` s)

goal (1 subgoal):
 1. compact ((\<lambda>x. a + c *\<^sub>R x) ` s)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
compact ((\<lambda>x. a + c *\<^sub>R x) ` s)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma bbox_bdia_demorgan: "( [R| (f::'b \<Rightarrow> 'c::complete_boolean_algebra) x) = - \<langle>R| (\<lambda>y. -f y) x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [R| f x = -  \<langle>R| (\<lambda>y. - f y) x
[PROOF STEP]
apply (simp add: bbox_def bdia_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Sqinter>{f xa |xa. (xa, x) \<in> R} = - \<Squnion>{- f xa |xa. (xa, x) \<in> R}
[PROOF STEP]
apply (rule antisym)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<Sqinter>{f xa |xa. (xa, x) \<in> R} \<le> - \<Squnion>{- f xa |xa. (xa, x) \<in> R}
 2. - \<Squnion>{- f xa |xa. (xa, x) \<in> R} \<le> \<Sqinter>{f xa |xa. (xa, x) \<in> R}
[PROOF STEP]
apply (simp add: uminus_Sup)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<Sqinter>{f xa |xa. (xa, x) \<in> R} \<le> \<Sqinter>(uminus ` {- f xa |xa. (xa, x) \<in> R})
 2. - \<Squnion>{- f xa |xa. (xa, x) \<in> R} \<le> \<Sqinter>{f xa |xa. (xa, x) \<in> R}
[PROOF STEP]
apply (rule INF_greatest; rule Inf_lower)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>xa. xa \<in> {- f xa |xa. (xa, x) \<in> R} \<Longrightarrow> - xa \<in> {f xa |xa. (xa, x) \<in> R}
 2. - \<Squnion>{- f xa |xa. (xa, x) \<in> R} \<le> \<Sqinter>{f xa |xa. (xa, x) \<in> R}
[PROOF STEP]
apply auto[1]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - \<Squnion>{- f xa |xa. (xa, x) \<in> R} \<le> \<Sqinter>{f xa |xa. (xa, x) \<in> R}
[PROOF STEP]
apply (rule Inf_greatest)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>xa. xa \<in> {f xa |xa. (xa, x) \<in> R} \<Longrightarrow> - \<Squnion>{- f xa |xa. (xa, x) \<in> R} \<le> xa
[PROOF STEP]
by (simp add: Sup_upper compl_le_swap2)


[STATEMENT]
lemma ModuleEnd_over_field_is_VectorSpaceEnd :
  fixes   smult :: "'f::field \<Rightarrow> 'v::ab_group_add \<Rightarrow> 'v"
  assumes "ModuleEnd smult V T"
  shows   "VectorSpaceEnd smult V T"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. VectorSpaceEnd smult V T
[PROOF STEP]
proof (rule VectorSpaceEndI, rule VectorSpaceHom.intro)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. ModuleHom smult V smult T
 2. T ` V \<subseteq> V
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
ModuleEnd smult V T
[PROOF STEP]
show "ModuleHom smult V smult T"
[PROOF STATE]
proof (prove)
using this:
ModuleEnd smult V T

goal (1 subgoal):
 1. ModuleHom smult V smult T
[PROOF STEP]
using ModuleEnd.axioms(1)
[PROOF STATE]
proof (prove)
using this:
ModuleEnd smult V T
ModuleEnd ?smult ?M ?T \<Longrightarrow> ModuleHom ?smult ?M ?smult ?T

goal (1 subgoal):
 1. ModuleHom smult V smult T
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
ModuleHom smult V smult T

goal (1 subgoal):
 1. T ` V \<subseteq> V
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
ModuleEnd smult V T
[PROOF STEP]
show "T ` V \<subseteq>  V"
[PROOF STATE]
proof (prove)
using this:
ModuleEnd smult V T

goal (1 subgoal):
 1. T ` V \<subseteq> V
[PROOF STEP]
using ModuleEnd.endomorph
[PROOF STATE]
proof (prove)
using this:
ModuleEnd smult V T
ModuleEnd ?smult ?M ?T \<Longrightarrow> ?T ` ?M \<subseteq> ?M

goal (1 subgoal):
 1. T ` V \<subseteq> V
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
T ` V \<subseteq> V

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma numeral_less_ennreal_iff [simp]: "numeral w < ennreal n \<longleftrightarrow> numeral w < n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (numeral w < ennreal n) = (numeral w < n)
[PROOF STEP]
using ennreal_less_iff zero_le_numeral
[PROOF STATE]
proof (prove)
using this:
0 \<le> ?r \<Longrightarrow> (ennreal ?r < ennreal ?q) = (?r < ?q)
(0::?'a) \<le> numeral ?n

goal (1 subgoal):
 1. (numeral w < ennreal n) = (numeral w < n)
[PROOF STEP]
by fastforce


[STATEMENT]
lemma div_2_mult_2_bds:
  fixes n d :: nat
  assumes "d > 0"
  shows "0 \<le> \<lfloor>n / d\<rfloor> - 2 * \<lfloor>(n div 2) / d\<rfloor>" "\<lfloor>n / d\<rfloor> - 2 * \<lfloor>(n div 2) / d\<rfloor> \<le> 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> \<lfloor>real n / real d\<rfloor> - 2 * \<lfloor>real (n div 2) / real d\<rfloor> &&& \<lfloor>real n / real d\<rfloor> - 2 * \<lfloor>real (n div 2) / real d\<rfloor> \<le> 1
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. 0 \<le> \<lfloor>real n / real d\<rfloor> - 2 * \<lfloor>real (n div 2) / real d\<rfloor>
 2. \<lfloor>real n / real d\<rfloor> - 2 * \<lfloor>real (n div 2) / real d\<rfloor> \<le> 1
[PROOF STEP]
have "\<lfloor>2::real\<rfloor> * \<lfloor>(n div 2) / d\<rfloor> \<le> \<lfloor>2 * ((n div 2) / d)\<rfloor>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lfloor>2\<rfloor> * \<lfloor>real (n div 2) / real d\<rfloor> \<le> \<lfloor>2 * (real (n div 2) / real d)\<rfloor>
[PROOF STEP]
by (rule le_mult_floor) simp_all
[PROOF STATE]
proof (state)
this:
\<lfloor>2\<rfloor> * \<lfloor>real (n div 2) / real d\<rfloor> \<le> \<lfloor>2 * (real (n div 2) / real d)\<rfloor>

goal (2 subgoals):
 1. 0 \<le> \<lfloor>real n / real d\<rfloor> - 2 * \<lfloor>real (n div 2) / real d\<rfloor>
 2. \<lfloor>real n / real d\<rfloor> - 2 * \<lfloor>real (n div 2) / real d\<rfloor> \<le> 1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<lfloor>2\<rfloor> * \<lfloor>real (n div 2) / real d\<rfloor> \<le> \<lfloor>2 * (real (n div 2) / real d)\<rfloor>

goal (2 subgoals):
 1. 0 \<le> \<lfloor>real n / real d\<rfloor> - 2 * \<lfloor>real (n div 2) / real d\<rfloor>
 2. \<lfloor>real n / real d\<rfloor> - 2 * \<lfloor>real (n div 2) / real d\<rfloor> \<le> 1
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
0 < d
[PROOF STEP]
have "\<dots> \<le> \<lfloor>n / d\<rfloor>"
[PROOF STATE]
proof (prove)
using this:
0 < d

goal (1 subgoal):
 1. \<lfloor>2 * (real (n div 2) / real d)\<rfloor> \<le> \<lfloor>real n / real d\<rfloor>
[PROOF STEP]
by (intro floor_mono) (simp_all add: field_simps)
[PROOF STATE]
proof (state)
this:
\<lfloor>2 * (real (n div 2) / real d)\<rfloor> \<le> \<lfloor>real n / real d\<rfloor>

goal (2 subgoals):
 1. 0 \<le> \<lfloor>real n / real d\<rfloor> - 2 * \<lfloor>real (n div 2) / real d\<rfloor>
 2. \<lfloor>real n / real d\<rfloor> - 2 * \<lfloor>real (n div 2) / real d\<rfloor> \<le> 1
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
\<lfloor>2\<rfloor> * \<lfloor>real (n div 2) / real d\<rfloor> \<le> \<lfloor>real n / real d\<rfloor>
[PROOF STEP]
show "0 \<le> \<lfloor>n / d\<rfloor> - 2 * \<lfloor>(n div 2) / d\<rfloor>"
[PROOF STATE]
proof (prove)
using this:
\<lfloor>2\<rfloor> * \<lfloor>real (n div 2) / real d\<rfloor> \<le> \<lfloor>real n / real d\<rfloor>

goal (1 subgoal):
 1. 0 \<le> \<lfloor>real n / real d\<rfloor> - 2 * \<lfloor>real (n div 2) / real d\<rfloor>
[PROOF STEP]
by (simp add: algebra_simps)
[PROOF STATE]
proof (state)
this:
0 \<le> \<lfloor>real n / real d\<rfloor> - 2 * \<lfloor>real (n div 2) / real d\<rfloor>

goal (1 subgoal):
 1. \<lfloor>real n / real d\<rfloor> - 2 * \<lfloor>real (n div 2) / real d\<rfloor> \<le> 1
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lfloor>real n / real d\<rfloor> - 2 * \<lfloor>real (n div 2) / real d\<rfloor> \<le> 1
[PROOF STEP]
have "real (n div d) \<le> real (2 * ((n div 2) div d) + 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real (n div d) \<le> real (2 * (n div 2 div d) + 1)
[PROOF STEP]
by (subst div_mult2_eq [symmetric], simp only: mult.commute, subst div_mult2_eq) simp
[PROOF STATE]
proof (state)
this:
real (n div d) \<le> real (2 * (n div 2 div d) + 1)

goal (1 subgoal):
 1. \<lfloor>real n / real d\<rfloor> - 2 * \<lfloor>real (n div 2) / real d\<rfloor> \<le> 1
[PROOF STEP]
thus "\<lfloor>n / d\<rfloor> - 2 * \<lfloor>(n div 2) / d\<rfloor> \<le> 1"
[PROOF STATE]
proof (prove)
using this:
real (n div d) \<le> real (2 * (n div 2 div d) + 1)

goal (1 subgoal):
 1. \<lfloor>real n / real d\<rfloor> - 2 * \<lfloor>real (n div 2) / real d\<rfloor> \<le> 1
[PROOF STEP]
unfolding of_nat_add of_nat_mult floor_conv_div_nat [symmetric]
[PROOF STATE]
proof (prove)
using this:
real_of_int \<lfloor>real n / real d\<rfloor> \<le> real 2 * real_of_int \<lfloor>real_of_int \<lfloor>real n / real 2\<rfloor> / real d\<rfloor> + real 1

goal (1 subgoal):
 1. \<lfloor>real n / real d\<rfloor> - 2 * \<lfloor>real_of_int \<lfloor>real n / real 2\<rfloor> / real d\<rfloor> \<le> 1
[PROOF STEP]
by simp_all
[PROOF STATE]
proof (state)
this:
\<lfloor>real n / real d\<rfloor> - 2 * \<lfloor>real (n div 2) / real d\<rfloor> \<le> 1

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma card1_Tr2:"\<lbrakk>finite A; card A = Suc 0\<rbrakk> \<Longrightarrow>
                  \<exists>f. f \<in> {0::nat} \<rightarrow> A \<and> surj_to f {0} A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite A; card A = Suc 0\<rbrakk> \<Longrightarrow> \<exists>f. f \<in> {0} \<rightarrow> A \<and> surj_to f {0} A
[PROOF STEP]
apply (frule card_nonzero[of "A"], simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite A; card A = Suc 0; A \<noteq> {}\<rbrakk> \<Longrightarrow> \<exists>f. f \<in> {0} \<rightarrow> A \<and> surj_to f {0} A
[PROOF STEP]
apply (cut_tac nonempty_ex[of "A"], erule exE)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x. \<lbrakk>finite A; card A = Suc 0; A \<noteq> {}; x \<in> A\<rbrakk> \<Longrightarrow> \<exists>f. f \<in> {0} \<rightarrow> A \<and> surj_to f {0} A
 2. \<lbrakk>finite A; card A = Suc 0; A \<noteq> {}\<rbrakk> \<Longrightarrow> A \<noteq> {}
[PROOF STEP]
apply (frule_tac a = x in card1_tr0[of "A"], assumption+)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x. \<lbrakk>finite A; card A = Suc 0; A \<noteq> {}; x \<in> A; {x} = A\<rbrakk> \<Longrightarrow> \<exists>f. f \<in> {0} \<rightarrow> A \<and> surj_to f {0} A
 2. \<lbrakk>finite A; card A = Suc 0; A \<noteq> {}\<rbrakk> \<Longrightarrow> A \<noteq> {}
[PROOF STEP]
apply (rotate_tac -1, frule sym, thin_tac "{x} = A", simp)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x. A = {x} \<Longrightarrow> \<exists>f. f 0 = x \<and> surj_to f {0} {x}
 2. \<lbrakk>finite A; card A = Suc 0; A \<noteq> {}\<rbrakk> \<Longrightarrow> A \<noteq> {}
[PROOF STEP]
apply (cut_tac x = x in card1_tr1, blast, simp)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma idx_pm_of_pm_plus: "idx_pm_of_pm xs (f + g) = idx_pm_of_pm xs f + idx_pm_of_pm xs g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. idx_pm_of_pm xs (f + g) = idx_pm_of_pm xs f + idx_pm_of_pm xs g
[PROOF STEP]
by (rule poly_mapping_eqI, simp add: lookup_idx_pm_of_pm lookup_add when_def)


[STATEMENT]
lemma perm_rem_commutes:
  assumes "bij f" shows "perm_rem a (perm_rem b f) = perm_rem b (perm_rem a f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. perm_rem a (perm_rem b f) = perm_rem b (perm_rem a f)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. perm_rem a (perm_rem b f) = perm_rem b (perm_rem a f)
[PROOF STEP]
have bij_simp: "\<And>x y. f x = f y \<longleftrightarrow> x = y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x y. (f x = f y) = (x = y)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
bij f

goal (1 subgoal):
 1. \<And>x y. (f x = f y) = (x = y)
[PROOF STEP]
by (auto simp: bij_iff)
[PROOF STATE]
proof (state)
this:
(f ?x = f ?y) = (?x = ?y)

goal (1 subgoal):
 1. perm_rem a (perm_rem b f) = perm_rem b (perm_rem a f)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. perm_rem a (perm_rem b f) = perm_rem b (perm_rem a f)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
bij f

goal (1 subgoal):
 1. perm_rem a (perm_rem b f) = perm_rem b (perm_rem a f)
[PROOF STEP]
by (auto simp: perm_rem_conv bij_simp fun_eq_iff)
[PROOF STATE]
proof (state)
this:
perm_rem a (perm_rem b f) = perm_rem b (perm_rem a f)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma exp_diff: "exp (x - y) = exp x / exp y"
  for x :: "'a::{real_normed_field,banach}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. exp (x - y) = exp x / exp y
[PROOF STEP]
using exp_add [of x "- y"]
[PROOF STATE]
proof (prove)
using this:
exp (x + - y) = exp x * exp (- y)

goal (1 subgoal):
 1. exp (x - y) = exp x / exp y
[PROOF STEP]
by (simp add: exp_minus divide_inverse)


[STATEMENT]
theorem inorder_delete:
  "sorted(inorder t) \<Longrightarrow> inorder (delete x t) = del_list x (inorder t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Sorted_Less.sorted (Tree2.inorder t) \<Longrightarrow> Tree2.inorder (delete x t) = del_list x (Tree2.inorder t)
[PROOF STEP]
by(induction t)
  (auto simp: del_list_simps inorder_balL inorder_balR inorder_split_maxD split: prod.splits)


[STATEMENT]
lemma count_Sigma_mset: "count (Sigma_mset A B) (a, b) = count A a * count (B a) b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. count (Sigma_mset A B) (a, b) = count A a * count (B a) b
[PROOF STEP]
by (induction A) (auto simp: Sigma_mset_def count_image_mset_Pair)


[STATEMENT]
lemma bl_or_bin: "map2 (\<or>) (bin_to_bl n v) (bin_to_bl n w) = bin_to_bl n (v OR w)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map2 (\<or>) (bin_to_bl n v) (bin_to_bl n w) = bin_to_bl n (v OR w)
[PROOF STEP]
by (simp add: bin_to_bl_def bl_or_aux_bin)


[STATEMENT]
lemma LIM_CRLIM_Re_Im_iff: "f \<midarrow>a\<rightarrow> L \<longleftrightarrow> (\<lambda>x. Re (f x)) \<midarrow>a\<rightarrow> Re L \<and> (\<lambda>x. Im (f x)) \<midarrow>a\<rightarrow> Im L"
  for f :: "'a::real_normed_vector \<Rightarrow> complex"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<midarrow>a\<rightarrow> L = ((\<lambda>x. Re (f x)) \<midarrow>a\<rightarrow> Re L \<and> (\<lambda>x. Im (f x)) \<midarrow>a\<rightarrow> Im L)
[PROOF STEP]
by (simp add: LIM_NSLIM_iff NSLIM_NSCRLIM_Re_Im_iff)


[STATEMENT]
lemma remove1_mset_eq_add_mset_iff:
   \<open>remove1_mset a A = add_mset a A' \<longleftrightarrow> A = add_mset a (add_mset a A')\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (remove1_mset a A = add_mset a A') = (A = add_mset a (add_mset a A'))
[PROOF STEP]
by (metis add_mset_add_single add_mset_diff_bothsides diff_zero remove1_mset_eqE)


[STATEMENT]
lemma all_subset_image_inj:
   "(\<forall>T. T \<subseteq> f ` S \<longrightarrow> P T) \<longleftrightarrow> (\<forall>T. T \<subseteq> S \<and> inj_on f T \<longrightarrow> P(f ` T))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>T\<subseteq>f ` S. P T) = (\<forall>T. T \<subseteq> S \<and> inj_on f T \<longrightarrow> P (f ` T))
[PROOF STEP]
by (metis subset_image_inj)


[STATEMENT]
lemma gcd_fib_diff: "m \<le> n \<Longrightarrow> gcd (fib m) (fib (n - m)) = gcd (fib m) (fib n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. m \<le> n \<Longrightarrow> gcd (fib m) (fib (n - m)) = gcd (fib m) (fib n)
[PROOF STEP]
by (simp add: gcd_fib_add [symmetric, of _ "n-m"])


[STATEMENT]
lemma wens_single_eq_Union:
      "wens_single act B = \<Union>(range (wens_single_finite act B))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wens_single act B = \<Union> (range (wens_single_finite act B))
[PROOF STEP]
by (simp add: wens_single_finite_def wens_single_def, blast)


[STATEMENT]
lemma powhr_less_cancel_iff [simp]: "1 < x \<Longrightarrow> x powhr a < x powhr b \<longleftrightarrow> a < b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 < x \<Longrightarrow> (x powhr a < x powhr b) = (a < b)
[PROOF STEP]
by (blast intro: powhr_less_cancel powhr_less_mono)


[STATEMENT]
lemma subsuming_states_append:
  "distinct (map fst (xs @ ys)) \<Longrightarrow>
     (map_of (xs @ ys)) \<subseteq>\<^sub>m s \<longleftrightarrow> ((map_of ys) \<subseteq>\<^sub>m s \<and> (map_of xs) \<subseteq>\<^sub>m s)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distinct (map fst (xs @ ys)) \<Longrightarrow> (map_of (xs @ ys) \<subseteq>\<^sub>m s) = (map_of ys \<subseteq>\<^sub>m s \<and> map_of xs \<subseteq>\<^sub>m s)
[PROOF STEP]
unfolding map_of_append
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distinct (map fst (xs @ ys)) \<Longrightarrow> (map_of ys ++ map_of xs \<subseteq>\<^sub>m s) = (map_of ys \<subseteq>\<^sub>m s \<and> map_of xs \<subseteq>\<^sub>m s)
[PROOF STEP]
apply(intro subsuming_states_map_add)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>distinct (map fst (xs @ ys)); x \<in> dom (map_of ys) \<inter> dom (map_of xs)\<rbrakk> \<Longrightarrow> map_of ys x = map_of xs x
[PROOF STEP]
apply (auto simp add: image_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x y ya. \<lbrakk>distinct (map fst xs); (x, y) \<in> set ys; (x, ya) \<in> set xs; distinct (map fst ys); {y. \<exists>x\<in>set xs. y = fst x} \<inter> {y. \<exists>x\<in>set ys. y = fst x} = {}\<rbrakk> \<Longrightarrow> y = ya
[PROOF STEP]
by (metis (mono_tags, lifting) IntI empty_iff fst_conv mem_Collect_eq)


[STATEMENT]
lemma digit_shift_preserves_digits:
  assumes "b>1"
  shows "nth_digit (b * y) (Suc t) b = nth_digit y t b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nth_digit (b * y) (Suc t) b = nth_digit y t b
[PROOF STEP]
using nth_digit_def assms
[PROOF STATE]
proof (prove)
using this:
nth_digit ?num ?k ?base = ?num div ?base ^ ?k mod ?base
1 < b

goal (1 subgoal):
 1. nth_digit (b * y) (Suc t) b = nth_digit y t b
[PROOF STEP]
by auto


[STATEMENT]
lemma INT_le_equals_Int:
     "(\<Inter>i \<in> atMost n. A i) =
      A 0 \<inter> (\<Inter>i \<in> lessThan n. -A i \<union> A(Suc i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Inter> (A ` {..n}) = A 0 \<inter> (\<Inter>i<n. - A i \<union> A (Suc i))
[PROOF STEP]
by (induct n)
    (simp_all add: Int_ac Int_Un_distrib Int_Un_distrib2
      INT_le_equals_Int_lemma lessThan_Suc atMost_Suc)


[STATEMENT]
lemma eval_fds_at_nat: "eval_fds f (of_nat k) = (\<Sum>n. fds_nth f n / of_nat n ^ k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eval_fds f (of_nat k) = (\<Sum>n. fds_nth f n / of_nat n ^ k)
[PROOF STEP]
unfolding eval_fds_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>n. fds_nth f n / nat_power n (of_nat k)) = (\<Sum>n. fds_nth f n / of_nat n ^ k)
[PROOF STEP]
proof (intro suminf_cong, goal_cases)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. fds_nth f n / nat_power n (of_nat k) = fds_nth f n / of_nat n ^ k
[PROOF STEP]
case (1 n)
[PROOF STATE]
proof (state)
this:

goal (1 subgoal):
 1. \<And>n. fds_nth f n / nat_power n (of_nat k) = fds_nth f n / of_nat n ^ k
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fds_nth f n / nat_power n (of_nat k) = fds_nth f n / of_nat n ^ k
[PROOF STEP]
by (cases "n = 0") simp_all
[PROOF STATE]
proof (state)
this:
fds_nth f n / nat_power n (of_nat k) = fds_nth f n / of_nat n ^ k

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Sigma_mset_plus_distrib1[simp]: "Sigma_mset (A + B) C = Sigma_mset A C + Sigma_mset B C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Sigma_mset (A + B) C = Sigma_mset A C + Sigma_mset B C
[PROOF STEP]
unfolding Sigma_mset_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>a\<in>#A + B. image_mset (Pair a) (C a)) = (\<Sum>a\<in>#A. image_mset (Pair a) (C a)) + (\<Sum>a\<in>#B. image_mset (Pair a) (C a))
[PROOF STEP]
by auto


[STATEMENT]
lemma floor_le_one [simp]: "\<lfloor>x\<rfloor> \<le> 1 \<longleftrightarrow> x < 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lfloor>x\<rfloor> \<le> 1) = (x < (2::'a))
[PROOF STEP]
by (simp add: floor_le_iff)


[STATEMENT]
lemma Gramian_matrix_alt_def: "k \<le> length G \<Longrightarrow>
  Gramian_matrix G k = (let M = mat_of_rows n (take k G) in M * M\<^sup>T)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. k \<le> length G \<Longrightarrow> Gramian_matrix G k = (let M = mat_of_rows n (take k G) in M * M\<^sup>T)
[PROOF STEP]
unfolding Gramian_matrix_def Let_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. k \<le> length G \<Longrightarrow> mat k n (\<lambda>(i, y). G ! i $ y) * (mat k n (\<lambda>(i, y). G ! i $ y))\<^sup>T = mat_of_rows n (take k G) * (mat_of_rows n (take k G))\<^sup>T
[PROOF STEP]
by (rule arg_cong[of _ _ "\<lambda> x. x * x\<^sup>T"], unfold mat_of_rows_def, intro eq_matI, auto)


[STATEMENT]
lemma connected_local:
 "connected S \<longleftrightarrow>
  \<not> (\<exists>e1 e2.
      openin (top_of_set S) e1 \<and>
      openin (top_of_set S) e2 \<and>
      S \<subseteq> e1 \<union> e2 \<and>
      e1 \<inter> e2 = {} \<and>
      e1 \<noteq> {} \<and>
      e2 \<noteq> {})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. connected S = (\<nexists>e1 e2. openin (top_of_set S) e1 \<and> openin (top_of_set S) e2 \<and> S \<subseteq> e1 \<union> e2 \<and> e1 \<inter> e2 = {} \<and> e1 \<noteq> {} \<and> e2 \<noteq> {})
[PROOF STEP]
unfolding connected_def openin_open
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<nexists>A B. open A \<and> open B \<and> S \<subseteq> A \<union> B \<and> A \<inter> B \<inter> S = {} \<and> A \<inter> S \<noteq> {} \<and> B \<inter> S \<noteq> {}) = (\<nexists>e1 e2. (\<exists>T. open T \<and> e1 = S \<inter> T) \<and> (\<exists>T. open T \<and> e2 = S \<inter> T) \<and> S \<subseteq> e1 \<union> e2 \<and> e1 \<inter> e2 = {} \<and> e1 \<noteq> {} \<and> e2 \<noteq> {})
[PROOF STEP]
by safe blast+


[STATEMENT]
lemma ceiling_le_iff: "\<lceil>x\<rceil> \<le> z \<longleftrightarrow> x \<le> of_int z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lceil>x\<rceil> \<le> z) = (x \<le> of_int z)
[PROOF STEP]
unfolding ceiling_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (- \<lfloor>- x\<rfloor> \<le> z) = (x \<le> of_int z)
[PROOF STEP]
using le_floor_iff [of "- z" "- x"]
[PROOF STATE]
proof (prove)
using this:
(- z \<le> \<lfloor>- x\<rfloor>) = (of_int (- z) \<le> - x)

goal (1 subgoal):
 1. (- \<lfloor>- x\<rfloor> \<le> z) = (x \<le> of_int z)
[PROOF STEP]
by auto


[STATEMENT]
lemma varsAppendFormulae:
  fixes formula1 :: Formula and formula2 :: Formula
  shows "vars (formula1 @ formula2) = vars formula1 \<union> vars formula2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vars (formula1 @ formula2) = vars formula1 \<union> vars formula2
[PROOF STEP]
by (induct formula1) auto


[STATEMENT]
lemma poly_pos:
  "(\<forall>x. poly p x > 0) \<longleftrightarrow> (
        p \<noteq> 0 \<and> poly_inf p = 1 \<and> count_roots p = 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>x. 0 < poly p x) = (p \<noteq> 0 \<and> poly_inf p = 1 \<and> count_roots p = 0)
[PROOF STEP]
by (simp only: Let_def poly_pos poly_no_roots, blast)


[STATEMENT]
lemma poly_mult_const':
  assumes "set p \<subseteq> carrier R" "a \<in> carrier R"
  shows "poly_mult [ a ] p = normalize (map (\<lambda>b. a \<otimes> b) p)"
    and "poly_mult p [ a ] = normalize (map (\<lambda>b. a \<otimes> b) p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly_mult [a] p = local.normalize (map ((\<otimes>) a) p) &&& poly_mult p [a] = local.normalize (map ((\<otimes>) a) p)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. poly_mult [a] p = local.normalize (map ((\<otimes>) a) p)
 2. poly_mult p [a] = local.normalize (map ((\<otimes>) a) p)
[PROOF STEP]
have "map2 (\<oplus>) (map ((\<otimes>) a) p) (replicate (length p) \<zero>) = map ((\<otimes>) a) p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map2 (\<oplus>) (map ((\<otimes>) a) p) (replicate (length p) \<zero>) = map ((\<otimes>) a) p
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
set p \<subseteq> carrier R
a \<in> carrier R

goal (1 subgoal):
 1. map2 (\<oplus>) (map ((\<otimes>) a) p) (replicate (length p) \<zero>) = map ((\<otimes>) a) p
[PROOF STEP]
by (induction p) (auto)
[PROOF STATE]
proof (state)
this:
map2 (\<oplus>) (map ((\<otimes>) a) p) (replicate (length p) \<zero>) = map ((\<otimes>) a) p

goal (2 subgoals):
 1. poly_mult [a] p = local.normalize (map ((\<otimes>) a) p)
 2. poly_mult p [a] = local.normalize (map ((\<otimes>) a) p)
[PROOF STEP]
thus "poly_mult [ a ] p = normalize (map (\<lambda>b. a \<otimes> b) p)"
[PROOF STATE]
proof (prove)
using this:
map2 (\<oplus>) (map ((\<otimes>) a) p) (replicate (length p) \<zero>) = map ((\<otimes>) a) p

goal (1 subgoal):
 1. poly_mult [a] p = local.normalize (map ((\<otimes>) a) p)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
poly_mult [a] p = local.normalize (map ((\<otimes>) a) p)

goal (1 subgoal):
 1. poly_mult p [a] = local.normalize (map ((\<otimes>) a) p)
[PROOF STEP]
thus "poly_mult p [ a ] = normalize (map (\<lambda>b. a \<otimes> b) p)"
[PROOF STATE]
proof (prove)
using this:
poly_mult [a] p = local.normalize (map ((\<otimes>) a) p)

goal (1 subgoal):
 1. poly_mult p [a] = local.normalize (map ((\<otimes>) a) p)
[PROOF STEP]
using poly_mult_comm[OF assms(1), of "[ a ]"] assms(2)
[PROOF STATE]
proof (prove)
using this:
poly_mult [a] p = local.normalize (map ((\<otimes>) a) p)
set [a] \<subseteq> carrier R \<Longrightarrow> poly_mult p [a] = poly_mult [a] p
a \<in> carrier R

goal (1 subgoal):
 1. poly_mult p [a] = local.normalize (map ((\<otimes>) a) p)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
poly_mult p [a] = local.normalize (map ((\<otimes>) a) p)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem "(\<exists>m::nat. n = 2 * m) --> (n + 1) div 2 = n div 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>m. n = 2 * m) \<longrightarrow> (n + 1) div 2 = n div 2
[PROOF STEP]
by presburger


[STATEMENT]
lemma rbt_lookup_rbtreeify:
  "\<lbrakk> sorted (map fst kvs); distinct (map fst kvs) \<rbrakk> \<Longrightarrow>
  rbt_lookup (rbtreeify kvs) = map_of kvs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>sorted (map fst kvs); distinct (map fst kvs)\<rbrakk> \<Longrightarrow> rbt_lookup (rbtreeify kvs) = map_of kvs
[PROOF STEP]
by(simp add: map_of_entries[symmetric] rbt_sorted_rbtreeify)


[STATEMENT]
lemma end_smult_distrib_right :
  assumes "range T \<subseteq> V"
  shows   "(a+b) \<cdot>\<cdot> T = a \<cdot>\<cdot> T + b \<cdot>\<cdot> T"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a + b) \<cdot>\<cdot> T = a \<cdot>\<cdot> T + b \<cdot>\<cdot> T
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>v. ((a + b) \<cdot>\<cdot> T) v = (a \<cdot>\<cdot> T + b \<cdot>\<cdot> T) v
[PROOF STEP]
fix v
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>v. ((a + b) \<cdot>\<cdot> T) v = (a \<cdot>\<cdot> T + b \<cdot>\<cdot> T) v
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
range T \<subseteq> V
[PROOF STEP]
show "((a+b) \<cdot>\<cdot> T) v = (a \<cdot>\<cdot> T + b \<cdot>\<cdot> T) v"
[PROOF STATE]
proof (prove)
using this:
range T \<subseteq> V

goal (1 subgoal):
 1. ((a + b) \<cdot>\<cdot> T) v = (a \<cdot>\<cdot> T + b \<cdot>\<cdot> T) v
[PROOF STEP]
using smult_distrib_right[of a b "T v"]
[PROOF STATE]
proof (prove)
using this:
range T \<subseteq> V
\<lbrakk>a \<in> UNIV; b \<in> UNIV; T v \<in> V\<rbrakk> \<Longrightarrow> ((a + b) \<cdot>\<cdot> T) v = (a \<cdot>\<cdot> T) v + (b \<cdot>\<cdot> T) v

goal (1 subgoal):
 1. ((a + b) \<cdot>\<cdot> T) v = (a \<cdot>\<cdot> T + b \<cdot>\<cdot> T) v
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
((a + b) \<cdot>\<cdot> T) v = (a \<cdot>\<cdot> T + b \<cdot>\<cdot> T) v

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma circle_y_x_coord_bounds:
  assumes "0 \<le> (x::real)" "x \<le> 1"
  shows "0 \<le> circle_y (x_coord x) \<and> circle_y (x_coord x) \<le> 1/2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> circle_y (x_coord x) \<and> circle_y (x_coord x) \<le> 1 / 2
[PROOF STEP]
using circle_y_bounds[OF x_coord_bounds[OF assms]]
[PROOF STATE]
proof (prove)
using this:
0 \<le> circle_y (x_coord x)
circle_y (x_coord x) \<le> 1 / 2

goal (1 subgoal):
 1. 0 \<le> circle_y (x_coord x) \<and> circle_y (x_coord x) \<le> 1 / 2
[PROOF STEP]
by auto


[STATEMENT]
lemma mat_kernel_mult_subset: assumes A: "A \<in> carrier_mat nr nc"
  and B: "B \<in> carrier_mat n nr"
  shows "mat_kernel A \<subseteq> mat_kernel (B * A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat_kernel A \<subseteq> mat_kernel (B * A)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. mat_kernel A \<subseteq> mat_kernel (B * A)
[PROOF STEP]
from A B
[PROOF STATE]
proof (chain)
picking this:
A \<in> carrier_mat nr nc
B \<in> carrier_mat n nr
[PROOF STEP]
have BA: "B * A \<in> carrier_mat n nc"
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat nr nc
B \<in> carrier_mat n nr

goal (1 subgoal):
 1. B * A \<in> carrier_mat n nc
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
B * A \<in> carrier_mat n nc

goal (1 subgoal):
 1. mat_kernel A \<subseteq> mat_kernel (B * A)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat_kernel A \<subseteq> mat_kernel (B * A)
[PROOF STEP]
unfolding mat_kernel[OF BA] mat_kernel[OF A]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {v \<in> carrier_vec nc. A *\<^sub>v v = 0\<^sub>v nr} \<subseteq> {v \<in> carrier_vec nc. B * A *\<^sub>v v = 0\<^sub>v n}
[PROOF STEP]
using A B
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat nr nc
B \<in> carrier_mat n nr

goal (1 subgoal):
 1. {v \<in> carrier_vec nc. A *\<^sub>v v = 0\<^sub>v nr} \<subseteq> {v \<in> carrier_vec nc. B * A *\<^sub>v v = 0\<^sub>v n}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
mat_kernel A \<subseteq> mat_kernel (B * A)

goal:
No subgoals!
[PROOF STEP]
qed