[STATEMENT]
lemma nth_no_overlap: "length xs = length ys \<Longrightarrow> \<forall> i < length xs. xs ! i \<noteq> ys ! i \<Longrightarrow> no_overlap xs ys"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>length xs = length ys; \<forall>i<length xs. xs ! i \<noteq> ys ! i\<rbrakk> \<Longrightarrow> no_overlap xs ys
[PROOF STEP]
proof (induct xs ys rule: list_induct2)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<forall>i<length []. [] ! i \<noteq> [] ! i \<Longrightarrow> no_overlap [] []
 2. \<And>x xs y ys. \<lbrakk>length xs = length ys; \<forall>i<length xs. xs ! i \<noteq> ys ! i \<Longrightarrow> no_overlap xs ys; \<forall>i<length (x # xs). (x # xs) ! i \<noteq> (y # ys) ! i\<rbrakk> \<Longrightarrow> no_overlap (x # xs) (y # ys)
[PROOF STEP]
case (Cons x xs y ys)
[PROOF STATE]
proof (state)
this:
length xs = length ys
\<forall>i<length xs. xs ! i \<noteq> ys ! i \<Longrightarrow> no_overlap xs ys
\<forall>i<length (x # xs). (x # xs) ! i \<noteq> (y # ys) ! i

goal (2 subgoals):
 1. \<forall>i<length []. [] ! i \<noteq> [] ! i \<Longrightarrow> no_overlap [] []
 2. \<And>x xs y ys. \<lbrakk>length xs = length ys; \<forall>i<length xs. xs ! i \<noteq> ys ! i \<Longrightarrow> no_overlap xs ys; \<forall>i<length (x # xs). (x # xs) ! i \<noteq> (y # ys) ! i\<rbrakk> \<Longrightarrow> no_overlap (x # xs) (y # ys)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
length xs = length ys
\<forall>i<length xs. xs ! i \<noteq> ys ! i \<Longrightarrow> no_overlap xs ys
\<forall>i<length (x # xs). (x # xs) ! i \<noteq> (y # ys) ! i
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
length xs = length ys
\<forall>i<length xs. xs ! i \<noteq> ys ! i \<Longrightarrow> no_overlap xs ys
\<forall>i<length (x # xs). (x # xs) ! i \<noteq> (y # ys) ! i

goal (1 subgoal):
 1. no_overlap (x # xs) (y # ys)
[PROOF STEP]
using Suc_less_eq nth_Cons_Suc
[PROOF STATE]
proof (prove)
using this:
length xs = length ys
\<forall>i<length xs. xs ! i \<noteq> ys ! i \<Longrightarrow> no_overlap xs ys
\<forall>i<length (x # xs). (x # xs) ! i \<noteq> (y # ys) ! i
(Suc ?m < Suc ?n) = (?m < ?n)
(?x # ?xs) ! Suc ?n = ?xs ! ?n

goal (1 subgoal):
 1. no_overlap (x # xs) (y # ys)
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
no_overlap (x # xs) (y # ys)

goal (1 subgoal):
 1. \<forall>i<length []. [] ! i \<noteq> [] ! i \<Longrightarrow> no_overlap [] []
[PROOF STEP]
qed simp


[STATEMENT]
lemma gbinomial_code [code]:
  "a gchoose k =
    (if k = 0 then 1
     else fold_atLeastAtMost_nat (\<lambda>k acc. (a - of_nat k) * acc) 0 (k - 1) 1 / fact k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a gchoose k = (if k = 0 then 1::'a else fold_atLeastAtMost_nat (\<lambda>k. (*) (a - of_nat k)) 0 (k - 1) (1::'a) / fact k)
[PROOF STEP]
by (cases k)
    (simp_all add: gbinomial_prod_rev prod_atLeastAtMost_code [symmetric]
      atLeastLessThanSuc_atLeastAtMost)


[STATEMENT]
lemma has_derivative_power_int[simp, derivative_intros]:
  fixes f :: "_ \<Rightarrow> 'a::real_normed_field"
  assumes x:  "f x \<noteq> 0"
    and f: "(f has_derivative f') (at x within S)"
  shows "((\<lambda>x. power_int (f x) n) has_derivative (\<lambda>h. f' h * (of_int n * power_int (f x) (n - 1))))
           (at x within S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. f x powi n) has_derivative (\<lambda>h. f' h * (of_int n * f x powi (n - 1)))) (at x within S)
[PROOF STEP]
using has_derivative_compose[OF f has_derivative_power_int', OF x]
[PROOF STATE]
proof (prove)
using this:
((\<lambda>x. f x powi ?n1) has_derivative (\<lambda>xa. f' xa * (of_int ?n1 * f x powi (?n1 - 1)))) (at x within S)

goal (1 subgoal):
 1. ((\<lambda>x. f x powi n) has_derivative (\<lambda>h. f' h * (of_int n * f x powi (n - 1)))) (at x within S)
[PROOF STEP]
.


[STATEMENT]
lemma moebius_prod_not_coprime:
  assumes "\<not> coprime N d"
  shows "moebius_mu (N*d) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. moebius_mu (N * d) = (0::'a)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. moebius_mu (N * d) = (0::'a)
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
\<not> coprime N d
[PROOF STEP]
obtain l where l_form: "l dvd N \<and> l dvd d \<and> \<not> is_unit l"
[PROOF STATE]
proof (prove)
using this:
\<not> coprime N d

goal (1 subgoal):
 1. (\<And>l. l dvd N \<and> l dvd d \<and> \<not> is_unit l \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding coprime_def
[PROOF STATE]
proof (prove)
using this:
\<not> (\<forall>c. c dvd N \<longrightarrow> c dvd d \<longrightarrow> is_unit c)

goal (1 subgoal):
 1. (\<And>l. l dvd N \<and> l dvd d \<and> \<not> is_unit l \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
l dvd N \<and> l dvd d \<and> \<not> is_unit l

goal (1 subgoal):
 1. moebius_mu (N * d) = (0::'a)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
l dvd N \<and> l dvd d \<and> \<not> is_unit l
[PROOF STEP]
have "l * l dvd N * d"
[PROOF STATE]
proof (prove)
using this:
l dvd N \<and> l dvd d \<and> \<not> is_unit l

goal (1 subgoal):
 1. l * l dvd N * d
[PROOF STEP]
using mult_dvd_mono
[PROOF STATE]
proof (prove)
using this:
l dvd N \<and> l dvd d \<and> \<not> is_unit l
\<lbrakk>?a dvd ?b; ?c dvd ?d\<rbrakk> \<Longrightarrow> ?a * ?c dvd ?b * ?d

goal (1 subgoal):
 1. l * l dvd N * d
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
l * l dvd N * d

goal (1 subgoal):
 1. moebius_mu (N * d) = (0::'a)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
l * l dvd N * d
[PROOF STEP]
have "l\<^sup>2 dvd N*d"
[PROOF STATE]
proof (prove)
using this:
l * l dvd N * d

goal (1 subgoal):
 1. l\<^sup>2 dvd N * d
[PROOF STEP]
by (subst power2_eq_square,blast)
[PROOF STATE]
proof (state)
this:
l\<^sup>2 dvd N * d

goal (1 subgoal):
 1. moebius_mu (N * d) = (0::'a)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
l\<^sup>2 dvd N * d
[PROOF STEP]
have "\<not> squarefree (N*d)"
[PROOF STATE]
proof (prove)
using this:
l\<^sup>2 dvd N * d

goal (1 subgoal):
 1. \<not> squarefree (N * d)
[PROOF STEP]
unfolding squarefree_def coprime_def
[PROOF STATE]
proof (prove)
using this:
l\<^sup>2 dvd N * d

goal (1 subgoal):
 1. \<not> (\<forall>x. x\<^sup>2 dvd N * d \<longrightarrow> is_unit x)
[PROOF STEP]
using l_form
[PROOF STATE]
proof (prove)
using this:
l\<^sup>2 dvd N * d
l dvd N \<and> l dvd d \<and> \<not> is_unit l

goal (1 subgoal):
 1. \<not> (\<forall>x. x\<^sup>2 dvd N * d \<longrightarrow> is_unit x)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<not> squarefree (N * d)

goal (1 subgoal):
 1. moebius_mu (N * d) = (0::'a)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> squarefree (N * d)
[PROOF STEP]
show "moebius_mu (N*d) = 0"
[PROOF STATE]
proof (prove)
using this:
\<not> squarefree (N * d)

goal (1 subgoal):
 1. moebius_mu (N * d) = (0::'b)
[PROOF STEP]
using moebius_mu_def
[PROOF STATE]
proof (prove)
using this:
\<not> squarefree (N * d)
moebius_mu ?n = (if squarefree ?n then (- (1::?'a)) ^ card (prime_factors ?n) else (0::?'a))

goal (1 subgoal):
 1. moebius_mu (N * d) = (0::'b)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
moebius_mu (N * d) = (0::?'b1)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma sums_integral_count_space_nat:
  fixes f :: "nat \<Rightarrow> _::{banach,second_countable_topology}"
  assumes *: "integrable (count_space UNIV) f"
  shows "f sums (integral\<^sup>L (count_space UNIV) f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f sums integral\<^sup>L (count_space UNIV) f
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. f sums integral\<^sup>L (count_space UNIV) f
[PROOF STEP]
let ?f = "\<lambda>n i. indicator {n} i *\<^sub>R f i"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. f sums integral\<^sup>L (count_space UNIV) f
[PROOF STEP]
have f': "\<And>n i. ?f n i = indicator {n} i *\<^sub>R f n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n i. indicat_real {n} i *\<^sub>R f i = indicat_real {n} i *\<^sub>R f n
[PROOF STEP]
by (auto simp: fun_eq_iff split: split_indicator)
[PROOF STATE]
proof (state)
this:
indicat_real {?n} ?i *\<^sub>R f ?i = indicat_real {?n} ?i *\<^sub>R f ?n

goal (1 subgoal):
 1. f sums integral\<^sup>L (count_space UNIV) f
[PROOF STEP]
have "(\<lambda>i. \<integral>n. ?f i n \<partial>count_space UNIV) sums \<integral> n. (\<Sum>i. ?f i n) \<partial>count_space UNIV"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>i. LINT n|count_space UNIV. indicat_real {i} n *\<^sub>R f n) sums (LINT n|count_space UNIV. (\<Sum>i. indicat_real {i} n *\<^sub>R f n))
[PROOF STEP]
proof (rule sums_integral)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>i. integrable (count_space UNIV) (\<lambda>n. indicat_real {i} n *\<^sub>R f n)
 2. AE n in count_space UNIV. summable (\<lambda>i. norm (indicat_real {i} n *\<^sub>R f n))
 3. summable (\<lambda>i. LINT n|count_space UNIV. norm (indicat_real {i} n *\<^sub>R f n))
[PROOF STEP]
show "\<And>i. integrable (count_space UNIV) (?f i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i. integrable (count_space UNIV) (\<lambda>ia. indicat_real {i} ia *\<^sub>R f ia)
[PROOF STEP]
using *
[PROOF STATE]
proof (prove)
using this:
integrable (count_space UNIV) f

goal (1 subgoal):
 1. \<And>i. integrable (count_space UNIV) (\<lambda>ia. indicat_real {i} ia *\<^sub>R f ia)
[PROOF STEP]
by (intro integrable_mult_indicator) auto
[PROOF STATE]
proof (state)
this:
integrable (count_space UNIV) (\<lambda>i. indicat_real {?i} i *\<^sub>R f i)

goal (2 subgoals):
 1. AE n in count_space UNIV. summable (\<lambda>i. norm (indicat_real {i} n *\<^sub>R f n))
 2. summable (\<lambda>i. LINT n|count_space UNIV. norm (indicat_real {i} n *\<^sub>R f n))
[PROOF STEP]
show "AE n in count_space UNIV. summable (\<lambda>i. norm (?f i n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. AE n in count_space UNIV. summable (\<lambda>i. norm (indicat_real {i} n *\<^sub>R f n))
[PROOF STEP]
using summable_finite[of "{n}" "\<lambda>i. norm (?f i n)" for n]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>finite {?n2}; \<And>n. n \<notin> {?n2} \<Longrightarrow> norm (indicat_real {n} ?n2 *\<^sub>R f ?n2) = 0\<rbrakk> \<Longrightarrow> summable (\<lambda>i. norm (indicat_real {i} ?n2 *\<^sub>R f ?n2))

goal (1 subgoal):
 1. AE n in count_space UNIV. summable (\<lambda>i. norm (indicat_real {i} n *\<^sub>R f n))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
AE n in count_space UNIV. summable (\<lambda>i. norm (indicat_real {i} n *\<^sub>R f n))

goal (1 subgoal):
 1. summable (\<lambda>i. LINT n|count_space UNIV. norm (indicat_real {i} n *\<^sub>R f n))
[PROOF STEP]
show "summable (\<lambda>i. \<integral> n. norm (?f i n) \<partial>count_space UNIV)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. summable (\<lambda>i. LINT n|count_space UNIV. norm (indicat_real {i} n *\<^sub>R f n))
[PROOF STEP]
using *
[PROOF STATE]
proof (prove)
using this:
integrable (count_space UNIV) f

goal (1 subgoal):
 1. summable (\<lambda>i. LINT n|count_space UNIV. norm (indicat_real {i} n *\<^sub>R f n))
[PROOF STEP]
by (subst f') (simp add: integrable_count_space_nat_iff)
[PROOF STATE]
proof (state)
this:
summable (\<lambda>i. LINT n|count_space UNIV. norm (indicat_real {i} n *\<^sub>R f n))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<lambda>i. LINT n|count_space UNIV. indicat_real {i} n *\<^sub>R f n) sums (LINT n|count_space UNIV. (\<Sum>i. indicat_real {i} n *\<^sub>R f n))

goal (1 subgoal):
 1. f sums integral\<^sup>L (count_space UNIV) f
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<lambda>i. LINT n|count_space UNIV. indicat_real {i} n *\<^sub>R f n) sums (LINT n|count_space UNIV. (\<Sum>i. indicat_real {i} n *\<^sub>R f n))

goal (1 subgoal):
 1. f sums integral\<^sup>L (count_space UNIV) f
[PROOF STEP]
have "(\<integral> n. (\<Sum>i. ?f i n) \<partial>count_space UNIV) = (\<integral>n. f n \<partial>count_space UNIV)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. LINT n|count_space UNIV. (\<Sum>i. indicat_real {i} n *\<^sub>R f n) = integral\<^sup>L (count_space UNIV) f
[PROOF STEP]
using suminf_finite[of "{n}" "\<lambda>i. ?f i n" for n]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>finite {?n2}; \<And>n. n \<notin> {?n2} \<Longrightarrow> indicat_real {n} ?n2 *\<^sub>R f ?n2 = (0::'b)\<rbrakk> \<Longrightarrow> (\<Sum>i. indicat_real {i} ?n2 *\<^sub>R f ?n2) = (\<Sum>n\<in>{?n2}. indicat_real {n} ?n2 *\<^sub>R f ?n2)

goal (1 subgoal):
 1. LINT n|count_space UNIV. (\<Sum>i. indicat_real {i} n *\<^sub>R f n) = integral\<^sup>L (count_space UNIV) f
[PROOF STEP]
by (auto intro!: integral_cong)
[PROOF STATE]
proof (state)
this:
LINT n|count_space UNIV. (\<Sum>i. indicat_real {i} n *\<^sub>R f n) = integral\<^sup>L (count_space UNIV) f

goal (1 subgoal):
 1. f sums integral\<^sup>L (count_space UNIV) f
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
LINT n|count_space UNIV. (\<Sum>i. indicat_real {i} n *\<^sub>R f n) = integral\<^sup>L (count_space UNIV) f

goal (1 subgoal):
 1. f sums integral\<^sup>L (count_space UNIV) f
[PROOF STEP]
have "(\<lambda>i. \<integral>n. ?f i n \<partial>count_space UNIV) = f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>i. LINT n|count_space UNIV. indicat_real {i} n *\<^sub>R f n) = f
[PROOF STEP]
by (subst f') simp
[PROOF STATE]
proof (state)
this:
(\<lambda>i. LINT n|count_space UNIV. indicat_real {i} n *\<^sub>R f n) = f

goal (1 subgoal):
 1. f sums integral\<^sup>L (count_space UNIV) f
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
f sums integral\<^sup>L (count_space UNIV) f
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
f sums integral\<^sup>L (count_space UNIV) f

goal (1 subgoal):
 1. f sums integral\<^sup>L (count_space UNIV) f
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
f sums integral\<^sup>L (count_space UNIV) f

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma zero_notin_augmentum [simp]: "0 \<notin> set ns \<Longrightarrow> 0 \<notin> set (augmentum ns)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<notin> set ns \<Longrightarrow> 0 \<notin> set (augmentum ns)
[PROOF STEP]
by (induction ns) auto


[STATEMENT]
lemma set_of_map_finite: "finite (dom m) \<Longrightarrow> finite (set_of_map m)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (dom m) \<Longrightarrow> finite (set_of_map m)
[PROOF STEP]
unfolding set_of_map_alt_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (dom m) \<Longrightarrow> finite ((\<lambda>k. (k, the (m k))) ` dom m)
[PROOF STEP]
by auto


[STATEMENT]
lemma listrel_Cons:
  "listrel r `` {x#xs} = set_Cons (r``{x}) (listrel r `` {xs})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. listrel r `` {x # xs} = set_Cons (r `` {x}) (listrel r `` {xs})
[PROOF STEP]
by (auto simp add: set_Cons_def intro: listrel.intros)


[STATEMENT]
lemma tan_eq_arctan_Ex:
  shows "tan x = y \<longleftrightarrow> (\<exists>k::int. x = arctan y + k*pi \<or> (x = pi/2 + k*pi \<and> y=0))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (tan x = y) = (\<exists>xa. x = arctan y + real_of_int xa * pi \<or> x = pi / 2 + real_of_int xa * pi \<and> y = 0)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. tan x = y \<Longrightarrow> \<exists>xa. x = arctan y + real_of_int xa * pi \<or> x = pi / 2 + real_of_int xa * pi \<and> y = 0
 2. \<exists>xa. x = arctan y + real_of_int xa * pi \<or> x = pi / 2 + real_of_int xa * pi \<and> y = 0 \<Longrightarrow> tan x = y
[PROOF STEP]
assume asm:"tan x = y"
[PROOF STATE]
proof (state)
this:
tan x = y

goal (2 subgoals):
 1. tan x = y \<Longrightarrow> \<exists>xa. x = arctan y + real_of_int xa * pi \<or> x = pi / 2 + real_of_int xa * pi \<and> y = 0
 2. \<exists>xa. x = arctan y + real_of_int xa * pi \<or> x = pi / 2 + real_of_int xa * pi \<and> y = 0 \<Longrightarrow> tan x = y
[PROOF STEP]
obtain k::int where k:"-pi/2 < x-k*pi" "x-k*pi \<le> pi/2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>k. \<lbrakk>- pi / 2 < x - real_of_int k * pi; x - real_of_int k * pi \<le> pi / 2\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<And>k. \<lbrakk>- pi / 2 < x - real_of_int k * pi; x - real_of_int k * pi \<le> pi / 2\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
define k where "k=ceiling (x/pi - 1/2)"
[PROOF STATE]
proof (state)
this:
k = \<lceil>x / pi - 1 / 2\<rceil>

goal (1 subgoal):
 1. (\<And>k. \<lbrakk>- pi / 2 < x - real_of_int k * pi; x - real_of_int k * pi \<le> pi / 2\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
have "(x/pi - 1/2)\<le>k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x / pi - 1 / 2 \<le> real_of_int k
[PROOF STEP]
unfolding k_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x / pi - 1 / 2 \<le> real_of_int \<lceil>x / pi - 1 / 2\<rceil>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x / pi - 1 / 2 \<le> real_of_int k

goal (1 subgoal):
 1. (\<And>k. \<lbrakk>- pi / 2 < x - real_of_int k * pi; x - real_of_int k * pi \<le> pi / 2\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x / pi - 1 / 2 \<le> real_of_int k
[PROOF STEP]
have "x-k*pi \<le> pi/2"
[PROOF STATE]
proof (prove)
using this:
x / pi - 1 / 2 \<le> real_of_int k

goal (1 subgoal):
 1. x - real_of_int k * pi \<le> pi / 2
[PROOF STEP]
by (auto simp add:field_simps)
[PROOF STATE]
proof (state)
this:
x - real_of_int k * pi \<le> pi / 2

goal (1 subgoal):
 1. (\<And>k. \<lbrakk>- pi / 2 < x - real_of_int k * pi; x - real_of_int k * pi \<le> pi / 2\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
x - real_of_int k * pi \<le> pi / 2

goal (1 subgoal):
 1. (\<And>k. \<lbrakk>- pi / 2 < x - real_of_int k * pi; x - real_of_int k * pi \<le> pi / 2\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
have "k-1 < x/pi - 1/2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real_of_int (k - 1) < x / pi - 1 / 2
[PROOF STEP]
unfolding k_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real_of_int (\<lceil>x / pi - 1 / 2\<rceil> - 1) < x / pi - 1 / 2
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
real_of_int (k - 1) < x / pi - 1 / 2

goal (1 subgoal):
 1. (\<And>k. \<lbrakk>- pi / 2 < x - real_of_int k * pi; x - real_of_int k * pi \<le> pi / 2\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
real_of_int (k - 1) < x / pi - 1 / 2
[PROOF STEP]
have "-pi/2 < x-k*pi"
[PROOF STATE]
proof (prove)
using this:
real_of_int (k - 1) < x / pi - 1 / 2

goal (1 subgoal):
 1. - pi / 2 < x - real_of_int k * pi
[PROOF STEP]
by (auto simp add:field_simps)
[PROOF STATE]
proof (state)
this:
- pi / 2 < x - real_of_int k * pi

goal (1 subgoal):
 1. (\<And>k. \<lbrakk>- pi / 2 < x - real_of_int k * pi; x - real_of_int k * pi \<le> pi / 2\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
x - real_of_int k * pi \<le> pi / 2
- pi / 2 < x - real_of_int k * pi
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
x - real_of_int k * pi \<le> pi / 2
- pi / 2 < x - real_of_int k * pi

goal (1 subgoal):
 1. thesis
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
x - real_of_int k * pi \<le> pi / 2
- pi / 2 < x - real_of_int k * pi
\<lbrakk>- pi / 2 < x - real_of_int ?k * pi; x - real_of_int ?k * pi \<le> pi / 2\<rbrakk> \<Longrightarrow> thesis

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
- pi / 2 < x - real_of_int k * pi
x - real_of_int k * pi \<le> pi / 2

goal (2 subgoals):
 1. tan x = y \<Longrightarrow> \<exists>xa. x = arctan y + real_of_int xa * pi \<or> x = pi / 2 + real_of_int xa * pi \<and> y = 0
 2. \<exists>xa. x = arctan y + real_of_int xa * pi \<or> x = pi / 2 + real_of_int xa * pi \<and> y = 0 \<Longrightarrow> tan x = y
[PROOF STEP]
have "x = arctan y + of_int k * pi" when "x \<noteq> pi/2 + k*pi"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x = arctan y + real_of_int k * pi
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x = arctan y + real_of_int k * pi
[PROOF STEP]
have "tan (x - k * pi) = y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. tan (x - real_of_int k * pi) = y
[PROOF STEP]
using asm tan_periodic_int[of _ "-k"]
[PROOF STATE]
proof (prove)
using this:
tan x = y
tan (?x + real_of_int (- k) * pi) = tan ?x

goal (1 subgoal):
 1. tan (x - real_of_int k * pi) = y
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
tan (x - real_of_int k * pi) = y

goal (1 subgoal):
 1. x = arctan y + real_of_int k * pi
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
tan (x - real_of_int k * pi) = y
[PROOF STEP]
have "arctan y = x - real_of_int k * pi"
[PROOF STATE]
proof (prove)
using this:
tan (x - real_of_int k * pi) = y

goal (1 subgoal):
 1. arctan y = x - real_of_int k * pi
[PROOF STEP]
apply (intro arctan_unique)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. tan (x - real_of_int k * pi) = y \<Longrightarrow> - (pi / 2) < x - real_of_int k * pi
 2. tan (x - real_of_int k * pi) = y \<Longrightarrow> x - real_of_int k * pi < pi / 2
 3. tan (x - real_of_int k * pi) = y \<Longrightarrow> tan (x - real_of_int k * pi) = y
[PROOF STEP]
using k that
[PROOF STATE]
proof (prove)
using this:
- pi / 2 < x - real_of_int k * pi
x - real_of_int k * pi \<le> pi / 2
x \<noteq> pi / 2 + real_of_int k * pi

goal (3 subgoals):
 1. tan (x - real_of_int k * pi) = y \<Longrightarrow> - (pi / 2) < x - real_of_int k * pi
 2. tan (x - real_of_int k * pi) = y \<Longrightarrow> x - real_of_int k * pi < pi / 2
 3. tan (x - real_of_int k * pi) = y \<Longrightarrow> tan (x - real_of_int k * pi) = y
[PROOF STEP]
by (auto simp add:field_simps)
[PROOF STATE]
proof (state)
this:
arctan y = x - real_of_int k * pi

goal (1 subgoal):
 1. x = arctan y + real_of_int k * pi
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
arctan y = x - real_of_int k * pi
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
arctan y = x - real_of_int k * pi

goal (1 subgoal):
 1. x = arctan y + real_of_int k * pi
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x = arctan y + real_of_int k * pi

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
x \<noteq> pi / 2 + real_of_int k * pi \<Longrightarrow> x = arctan y + real_of_int k * pi

goal (2 subgoals):
 1. tan x = y \<Longrightarrow> \<exists>xa. x = arctan y + real_of_int xa * pi \<or> x = pi / 2 + real_of_int xa * pi \<and> y = 0
 2. \<exists>xa. x = arctan y + real_of_int xa * pi \<or> x = pi / 2 + real_of_int xa * pi \<and> y = 0 \<Longrightarrow> tan x = y
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
x \<noteq> pi / 2 + real_of_int k * pi \<Longrightarrow> x = arctan y + real_of_int k * pi

goal (2 subgoals):
 1. tan x = y \<Longrightarrow> \<exists>xa. x = arctan y + real_of_int xa * pi \<or> x = pi / 2 + real_of_int xa * pi \<and> y = 0
 2. \<exists>xa. x = arctan y + real_of_int xa * pi \<or> x = pi / 2 + real_of_int xa * pi \<and> y = 0 \<Longrightarrow> tan x = y
[PROOF STEP]
have "y=0" when "x = pi/2 + k*pi"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y = 0
[PROOF STEP]
using asm that
[PROOF STATE]
proof (prove)
using this:
tan x = y
x = pi / 2 + real_of_int k * pi

goal (1 subgoal):
 1. y = 0
[PROOF STEP]
by auto (simp add: tan_def)
[PROOF STATE]
proof (state)
this:
x = pi / 2 + real_of_int k * pi \<Longrightarrow> y = 0

goal (2 subgoals):
 1. tan x = y \<Longrightarrow> \<exists>xa. x = arctan y + real_of_int xa * pi \<or> x = pi / 2 + real_of_int xa * pi \<and> y = 0
 2. \<exists>xa. x = arctan y + real_of_int xa * pi \<or> x = pi / 2 + real_of_int xa * pi \<and> y = 0 \<Longrightarrow> tan x = y
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
x \<noteq> pi / 2 + real_of_int k * pi \<Longrightarrow> x = arctan y + real_of_int k * pi
x = pi / 2 + real_of_int k * pi \<Longrightarrow> y = 0
[PROOF STEP]
show "\<exists>k. x = arctan y + of_int k * pi \<or> (x = pi/2 + k*pi \<and> y=0)"
[PROOF STATE]
proof (prove)
using this:
x \<noteq> pi / 2 + real_of_int k * pi \<Longrightarrow> x = arctan y + real_of_int k * pi
x = pi / 2 + real_of_int k * pi \<Longrightarrow> y = 0

goal (1 subgoal):
 1. \<exists>k. x = arctan y + real_of_int k * pi \<or> x = pi / 2 + real_of_int k * pi \<and> y = 0
[PROOF STEP]
using k
[PROOF STATE]
proof (prove)
using this:
x \<noteq> pi / 2 + real_of_int k * pi \<Longrightarrow> x = arctan y + real_of_int k * pi
x = pi / 2 + real_of_int k * pi \<Longrightarrow> y = 0
- pi / 2 < x - real_of_int k * pi
x - real_of_int k * pi \<le> pi / 2

goal (1 subgoal):
 1. \<exists>k. x = arctan y + real_of_int k * pi \<or> x = pi / 2 + real_of_int k * pi \<and> y = 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>k. x = arctan y + real_of_int k * pi \<or> x = pi / 2 + real_of_int k * pi \<and> y = 0

goal (1 subgoal):
 1. \<exists>xa. x = arctan y + real_of_int xa * pi \<or> x = pi / 2 + real_of_int xa * pi \<and> y = 0 \<Longrightarrow> tan x = y
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>xa. x = arctan y + real_of_int xa * pi \<or> x = pi / 2 + real_of_int xa * pi \<and> y = 0 \<Longrightarrow> tan x = y
[PROOF STEP]
assume "\<exists>k::int. x = arctan y +  k * pi \<or> x = pi / 2 + k * pi \<and> y = 0"
[PROOF STATE]
proof (state)
this:
\<exists>xa. x = arctan y + real_of_int xa * pi \<or> x = pi / 2 + real_of_int xa * pi \<and> y = 0

goal (1 subgoal):
 1. \<exists>xa. x = arctan y + real_of_int xa * pi \<or> x = pi / 2 + real_of_int xa * pi \<and> y = 0 \<Longrightarrow> tan x = y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>xa. x = arctan y + real_of_int xa * pi \<or> x = pi / 2 + real_of_int xa * pi \<and> y = 0
[PROOF STEP]
show "tan x = y"
[PROOF STATE]
proof (prove)
using this:
\<exists>xa. x = arctan y + real_of_int xa * pi \<or> x = pi / 2 + real_of_int xa * pi \<and> y = 0

goal (1 subgoal):
 1. tan x = y
[PROOF STEP]
by (metis arctan_unique cos_pi_half division_ring_divide_zero tan_def tan_periodic_int tan_total)
[PROOF STATE]
proof (state)
this:
tan x = y

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma homotopy_equivalence_reduced_homology_group_isomorphisms:
  assumes contf: "continuous_map X Y f" and contg: "continuous_map Y X g"
    and gf: "homotopic_with (\<lambda>h. True) X X (g \<circ> f) id"
    and fg: "homotopic_with (\<lambda>k. True) Y Y (f \<circ> g) id"
  shows "group_isomorphisms (reduced_homology_group p X) (reduced_homology_group p Y)
                               (hom_induced p X {} Y {} f) (hom_induced p Y {} X {} g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. group_isomorphisms (reduced_homology_group p X) (reduced_homology_group p Y) (hom_induced p X {} Y {} f) (hom_induced p Y {} X {} g)
[PROOF STEP]
proof (simp add: hom_induced_reduced_hom group_isomorphisms_def, intro conjI ballI)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x. x \<in> carrier (reduced_homology_group p X) \<Longrightarrow> hom_induced p Y {} X {} g (hom_induced p X {} Y {} f x) = x
 2. \<And>y. y \<in> carrier (reduced_homology_group p Y) \<Longrightarrow> hom_induced p X {} Y {} f (hom_induced p Y {} X {} g y) = y
[PROOF STEP]
fix a
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x. x \<in> carrier (reduced_homology_group p X) \<Longrightarrow> hom_induced p Y {} X {} g (hom_induced p X {} Y {} f x) = x
 2. \<And>y. y \<in> carrier (reduced_homology_group p Y) \<Longrightarrow> hom_induced p X {} Y {} f (hom_induced p Y {} X {} g y) = y
[PROOF STEP]
assume "a \<in> carrier (reduced_homology_group p X)"
[PROOF STATE]
proof (state)
this:
a \<in> carrier (reduced_homology_group p X)

goal (2 subgoals):
 1. \<And>x. x \<in> carrier (reduced_homology_group p X) \<Longrightarrow> hom_induced p Y {} X {} g (hom_induced p X {} Y {} f x) = x
 2. \<And>y. y \<in> carrier (reduced_homology_group p Y) \<Longrightarrow> hom_induced p X {} Y {} f (hom_induced p Y {} X {} g y) = y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a \<in> carrier (reduced_homology_group p X)
[PROOF STEP]
have "(hom_induced p Y {} X {} g \<circ> hom_induced p X {} Y {} f) a = a"
[PROOF STATE]
proof (prove)
using this:
a \<in> carrier (reduced_homology_group p X)

goal (1 subgoal):
 1. (hom_induced p Y {} X {} g \<circ> hom_induced p X {} Y {} f) a = a
[PROOF STEP]
apply (simp add: contf contg flip: hom_induced_compose)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<in> carrier (reduced_homology_group p X) \<Longrightarrow> hom_induced p X {} X {} (g \<circ> f) a = a
[PROOF STEP]
using carrier_reduced_homology_group_subset gf hom_induced_id homology_homotopy_empty
[PROOF STATE]
proof (prove)
using this:
carrier (reduced_homology_group ?p ?X) \<subseteq> carrier (homology_group ?p ?X)
homotopic_with (\<lambda>h. True) X X (g \<circ> f) id
?c \<in> carrier (relative_homology_group ?p ?X ?S) \<Longrightarrow> hom_induced ?p ?X ?S ?X ?S id ?c = ?c
homotopic_with (\<lambda>h. True) ?X ?Y ?f ?g \<Longrightarrow> hom_induced ?p ?X {} ?Y {} ?f = hom_induced ?p ?X {} ?Y {} ?g

goal (1 subgoal):
 1. a \<in> carrier (reduced_homology_group p X) \<Longrightarrow> hom_induced p X {} X {} (g \<circ> f) a = a
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
(hom_induced p Y {} X {} g \<circ> hom_induced p X {} Y {} f) a = a

goal (2 subgoals):
 1. \<And>x. x \<in> carrier (reduced_homology_group p X) \<Longrightarrow> hom_induced p Y {} X {} g (hom_induced p X {} Y {} f x) = x
 2. \<And>y. y \<in> carrier (reduced_homology_group p Y) \<Longrightarrow> hom_induced p X {} Y {} f (hom_induced p Y {} X {} g y) = y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(hom_induced p Y {} X {} g \<circ> hom_induced p X {} Y {} f) a = a
[PROOF STEP]
show "hom_induced p Y {} X {} g (hom_induced p X {} Y {} f a) = a"
[PROOF STATE]
proof (prove)
using this:
(hom_induced p Y {} X {} g \<circ> hom_induced p X {} Y {} f) a = a

goal (1 subgoal):
 1. hom_induced p Y {} X {} g (hom_induced p X {} Y {} f a) = a
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
hom_induced p Y {} X {} g (hom_induced p X {} Y {} f a) = a

goal (1 subgoal):
 1. \<And>y. y \<in> carrier (reduced_homology_group p Y) \<Longrightarrow> hom_induced p X {} Y {} f (hom_induced p Y {} X {} g y) = y
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>y. y \<in> carrier (reduced_homology_group p Y) \<Longrightarrow> hom_induced p X {} Y {} f (hom_induced p Y {} X {} g y) = y
[PROOF STEP]
fix b
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>y. y \<in> carrier (reduced_homology_group p Y) \<Longrightarrow> hom_induced p X {} Y {} f (hom_induced p Y {} X {} g y) = y
[PROOF STEP]
assume "b \<in> carrier (reduced_homology_group p Y)"
[PROOF STATE]
proof (state)
this:
b \<in> carrier (reduced_homology_group p Y)

goal (1 subgoal):
 1. \<And>y. y \<in> carrier (reduced_homology_group p Y) \<Longrightarrow> hom_induced p X {} Y {} f (hom_induced p Y {} X {} g y) = y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
b \<in> carrier (reduced_homology_group p Y)
[PROOF STEP]
have "(hom_induced p X {} Y {} f \<circ> hom_induced p Y {} X {} g) b = b"
[PROOF STATE]
proof (prove)
using this:
b \<in> carrier (reduced_homology_group p Y)

goal (1 subgoal):
 1. (hom_induced p X {} Y {} f \<circ> hom_induced p Y {} X {} g) b = b
[PROOF STEP]
apply (simp add: contf contg flip: hom_induced_compose)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. b \<in> carrier (reduced_homology_group p Y) \<Longrightarrow> hom_induced p Y {} Y {} (f \<circ> g) b = b
[PROOF STEP]
using carrier_reduced_homology_group_subset fg hom_induced_id homology_homotopy_empty
[PROOF STATE]
proof (prove)
using this:
carrier (reduced_homology_group ?p ?X) \<subseteq> carrier (homology_group ?p ?X)
homotopic_with (\<lambda>k. True) Y Y (f \<circ> g) id
?c \<in> carrier (relative_homology_group ?p ?X ?S) \<Longrightarrow> hom_induced ?p ?X ?S ?X ?S id ?c = ?c
homotopic_with (\<lambda>h. True) ?X ?Y ?f ?g \<Longrightarrow> hom_induced ?p ?X {} ?Y {} ?f = hom_induced ?p ?X {} ?Y {} ?g

goal (1 subgoal):
 1. b \<in> carrier (reduced_homology_group p Y) \<Longrightarrow> hom_induced p Y {} Y {} (f \<circ> g) b = b
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
(hom_induced p X {} Y {} f \<circ> hom_induced p Y {} X {} g) b = b

goal (1 subgoal):
 1. \<And>y. y \<in> carrier (reduced_homology_group p Y) \<Longrightarrow> hom_induced p X {} Y {} f (hom_induced p Y {} X {} g y) = y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(hom_induced p X {} Y {} f \<circ> hom_induced p Y {} X {} g) b = b
[PROOF STEP]
show "hom_induced p X {} Y {} f (hom_induced p Y {} X {} g b) = b"
[PROOF STATE]
proof (prove)
using this:
(hom_induced p X {} Y {} f \<circ> hom_induced p Y {} X {} g) b = b

goal (1 subgoal):
 1. hom_induced p X {} Y {} f (hom_induced p Y {} X {} g b) = b
[PROOF STEP]
by (simp add: carrier_reduced_homology_group)
[PROOF STATE]
proof (state)
this:
hom_induced p X {} Y {} f (hom_induced p Y {} X {} g b) = b

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma prv_cnj_imp_monoR2:
assumes "\<phi> \<in> fmla" and "\<chi> \<in> fmla" and "\<psi> \<in> fmla"
assumes "prv (imp \<phi> (imp \<chi> \<psi>))"
shows "prv (imp (cnj \<phi> \<chi>) \<psi>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prv (imp (cnj \<phi> \<chi>) \<psi>)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. prv (imp (cnj \<phi> \<chi>) \<psi>)
[PROOF STEP]
have "prv (imp (cnj \<phi> \<chi>) (cnj \<phi> \<chi>))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prv (imp (cnj \<phi> \<chi>) (cnj \<phi> \<chi>))
[PROOF STEP]
using prv_imp_refl
[PROOF STATE]
proof (prove)
using this:
?\<phi> \<in> fmla \<Longrightarrow> prv (imp ?\<phi> ?\<phi>)

goal (1 subgoal):
 1. prv (imp (cnj \<phi> \<chi>) (cnj \<phi> \<chi>))
[PROOF STEP]
by (blast intro: assms(1-3))
[PROOF STATE]
proof (state)
this:
prv (imp (cnj \<phi> \<chi>) (cnj \<phi> \<chi>))

goal (1 subgoal):
 1. prv (imp (cnj \<phi> \<chi>) \<psi>)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
prv (imp (cnj \<phi> \<chi>) (cnj \<phi> \<chi>))
[PROOF STEP]
have "prv (imp (imp (cnj \<phi> \<chi>) (imp (cnj \<phi> \<chi>) \<psi>)) (imp (cnj \<phi> \<chi>) \<psi>))"
[PROOF STATE]
proof (prove)
using this:
prv (imp (cnj \<phi> \<chi>) (cnj \<phi> \<chi>))

goal (1 subgoal):
 1. prv (imp (imp (cnj \<phi> \<chi>) (imp (cnj \<phi> \<chi>) \<psi>)) (imp (cnj \<phi> \<chi>) \<psi>))
[PROOF STEP]
by (metis (no_types) cnj imp assms(1-3) prv_imp_com prv_imp_mp prv_imp_trans)
[PROOF STATE]
proof (state)
this:
prv (imp (imp (cnj \<phi> \<chi>) (imp (cnj \<phi> \<chi>) \<psi>)) (imp (cnj \<phi> \<chi>) \<psi>))

goal (1 subgoal):
 1. prv (imp (cnj \<phi> \<chi>) \<psi>)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
prv (imp (imp (cnj \<phi> \<chi>) (imp (cnj \<phi> \<chi>) \<psi>)) (imp (cnj \<phi> \<chi>) \<psi>))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
prv (imp (imp (cnj \<phi> \<chi>) (imp (cnj \<phi> \<chi>) \<psi>)) (imp (cnj \<phi> \<chi>) \<psi>))

goal (1 subgoal):
 1. prv (imp (cnj \<phi> \<chi>) \<psi>)
[PROOF STEP]
by (metis (no_types) imp cnj assms prv_imp_cnjL prv_imp_cnjR prv_imp_com prv_imp_mp prv_prv_imp_trans)
[PROOF STATE]
proof (state)
this:
prv (imp (cnj \<phi> \<chi>) \<psi>)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma negative_psi':
assumes "i\<le>j"
shows "\<psi>inv^i * \<psi> ^j = \<psi>^(j-i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<psi>inv ^ i * \<psi> ^ j = \<psi> ^ (j - i)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<psi>inv ^ i * \<psi> ^ j = \<psi> ^ (j - i)
[PROOF STEP]
have j: "\<psi>^j = \<psi>^i * \<psi>^(j-i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<psi> ^ j = \<psi> ^ i * \<psi> ^ (j - i)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
i \<le> j

goal (1 subgoal):
 1. \<psi> ^ j = \<psi> ^ i * \<psi> ^ (j - i)
[PROOF STEP]
by (metis le_add_diff_inverse power_add)
[PROOF STATE]
proof (state)
this:
\<psi> ^ j = \<psi> ^ i * \<psi> ^ (j - i)

goal (1 subgoal):
 1. \<psi>inv ^ i * \<psi> ^ j = \<psi> ^ (j - i)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<psi>inv ^ i * \<psi> ^ j = \<psi> ^ (j - i)
[PROOF STEP]
unfolding j mult.assoc[symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<psi>inv ^ i * \<psi> ^ i * \<psi> ^ (j - i) = \<psi> ^ (j - i)
[PROOF STEP]
using inv_psi_exp[of i]
[PROOF STATE]
proof (prove)
using this:
\<psi>inv ^ i * \<psi> ^ i = 1

goal (1 subgoal):
 1. \<psi>inv ^ i * \<psi> ^ i * \<psi> ^ (j - i) = \<psi> ^ (j - i)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<psi>inv ^ i * \<psi> ^ j = \<psi> ^ (j - i)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma exp_divide_power_eq:
  fixes x :: "'a::{real_normed_field,banach}"
  assumes "n > 0"
  shows "exp (x / of_nat n) ^ n = exp x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. exp (x / of_nat n) ^ n = exp x
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
0 < n

goal (1 subgoal):
 1. exp (x / of_nat n) ^ n = exp x
[PROOF STEP]
proof (induction n arbitrary: x)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x. 0 < 0 \<Longrightarrow> exp (x / of_nat 0) ^ 0 = exp x
 2. \<And>n x. \<lbrakk>\<And>x. 0 < n \<Longrightarrow> exp (x / of_nat n) ^ n = exp x; 0 < Suc n\<rbrakk> \<Longrightarrow> exp (x / of_nat (Suc n)) ^ Suc n = exp x
[PROOF STEP]
case (Suc n)
[PROOF STATE]
proof (state)
this:
0 < n \<Longrightarrow> exp (?x / of_nat n) ^ n = exp ?x
0 < Suc n

goal (2 subgoals):
 1. \<And>x. 0 < 0 \<Longrightarrow> exp (x / of_nat 0) ^ 0 = exp x
 2. \<And>n x. \<lbrakk>\<And>x. 0 < n \<Longrightarrow> exp (x / of_nat n) ^ n = exp x; 0 < Suc n\<rbrakk> \<Longrightarrow> exp (x / of_nat (Suc n)) ^ Suc n = exp x
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. exp (x / of_nat (Suc n)) ^ Suc n = exp x
[PROOF STEP]
proof (cases "n = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. n = 0 \<Longrightarrow> exp (x / of_nat (Suc n)) ^ Suc n = exp x
 2. n \<noteq> 0 \<Longrightarrow> exp (x / of_nat (Suc n)) ^ Suc n = exp x
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
n = 0

goal (2 subgoals):
 1. n = 0 \<Longrightarrow> exp (x / of_nat (Suc n)) ^ Suc n = exp x
 2. n \<noteq> 0 \<Longrightarrow> exp (x / of_nat (Suc n)) ^ Suc n = exp x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
n = 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
n = 0

goal (1 subgoal):
 1. exp (x / of_nat (Suc n)) ^ Suc n = exp x
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
exp (x / of_nat (Suc n)) ^ Suc n = exp x

goal (1 subgoal):
 1. n \<noteq> 0 \<Longrightarrow> exp (x / of_nat (Suc n)) ^ Suc n = exp x
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. n \<noteq> 0 \<Longrightarrow> exp (x / of_nat (Suc n)) ^ Suc n = exp x
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
n \<noteq> 0

goal (1 subgoal):
 1. n \<noteq> 0 \<Longrightarrow> exp (x / of_nat (Suc n)) ^ Suc n = exp x
[PROOF STEP]
have [simp]: "1 + (of_nat n * of_nat n + of_nat n * 2) \<noteq> (0::'a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (1::'a) + (of_nat n * of_nat n + of_nat n * (2::'a)) \<noteq> (0::'a)
[PROOF STEP]
using of_nat_eq_iff [of "1 + n * n + n * 2" "0"]
[PROOF STATE]
proof (prove)
using this:
(of_nat (1 + n * n + n * 2) = of_nat 0) = (1 + n * n + n * 2 = 0)

goal (1 subgoal):
 1. (1::'a) + (of_nat n * of_nat n + of_nat n * (2::'a)) \<noteq> (0::'a)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(1::'a) + (of_nat n * of_nat n + of_nat n * (2::'a)) \<noteq> (0::'a)

goal (1 subgoal):
 1. n \<noteq> 0 \<Longrightarrow> exp (x / of_nat (Suc n)) ^ Suc n = exp x
[PROOF STEP]
from False
[PROOF STATE]
proof (chain)
picking this:
n \<noteq> 0
[PROOF STEP]
have [simp]: "x * of_nat n / (1 + of_nat n) / of_nat n = x / (1 + of_nat n)"
[PROOF STATE]
proof (prove)
using this:
n \<noteq> 0

goal (1 subgoal):
 1. x * of_nat n / ((1::'a) + of_nat n) / of_nat n = x / ((1::'a) + of_nat n)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
x * of_nat n / ((1::'a) + of_nat n) / of_nat n = x / ((1::'a) + of_nat n)

goal (1 subgoal):
 1. n \<noteq> 0 \<Longrightarrow> exp (x / of_nat (Suc n)) ^ Suc n = exp x
[PROOF STEP]
have [simp]: "x / (1 + of_nat n) + x * of_nat n / (1 + of_nat n) = x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x / ((1::'a) + of_nat n) + x * of_nat n / ((1::'a) + of_nat n) = x
[PROOF STEP]
using of_nat_neq_0
[PROOF STATE]
proof (prove)
using this:
of_nat (Suc ?n) \<noteq> (0::?'a)

goal (1 subgoal):
 1. x / ((1::'a) + of_nat n) + x * of_nat n / ((1::'a) + of_nat n) = x
[PROOF STEP]
by (auto simp add: field_split_simps)
[PROOF STATE]
proof (state)
this:
x / ((1::'a) + of_nat n) + x * of_nat n / ((1::'a) + of_nat n) = x

goal (1 subgoal):
 1. n \<noteq> 0 \<Longrightarrow> exp (x / of_nat (Suc n)) ^ Suc n = exp x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. exp (x / of_nat (Suc n)) ^ Suc n = exp x
[PROOF STEP]
using Suc.IH [of "x * of_nat n / (1 + of_nat n)"] False
[PROOF STATE]
proof (prove)
using this:
0 < n \<Longrightarrow> exp (x * of_nat n / ((1::'a) + of_nat n) / of_nat n) ^ n = exp (x * of_nat n / ((1::'a) + of_nat n))
n \<noteq> 0

goal (1 subgoal):
 1. exp (x / of_nat (Suc n)) ^ Suc n = exp x
[PROOF STEP]
by (simp add: exp_add [symmetric])
[PROOF STATE]
proof (state)
this:
exp (x / of_nat (Suc n)) ^ Suc n = exp x

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
exp (x / of_nat (Suc n)) ^ Suc n = exp x

goal (1 subgoal):
 1. \<And>x. 0 < 0 \<Longrightarrow> exp (x / of_nat 0) ^ 0 = exp x
[PROOF STEP]
qed simp


[STATEMENT]
lemma uminus_bounded_comp [simp]:
  fixes f :: "'a \<Rightarrow> 'b::real_normed_vector"
  shows "bounded ((\<lambda>x. - f x) ` S) \<longleftrightarrow> bounded (f ` S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bounded ((\<lambda>x. - f x) ` S) = bounded (f ` S)
[PROOF STEP]
using bounded_uminus[of "f ` S"]
[PROOF STATE]
proof (prove)
using this:
bounded (uminus ` f ` S) = bounded (f ` S)

goal (1 subgoal):
 1. bounded ((\<lambda>x. - f x) ` S) = bounded (f ` S)
[PROOF STEP]
by (auto simp: image_image)


[STATEMENT]
lemma ffact_Suc_rev_nat:
  "ffact (Suc n) m = (m - n) * ffact n m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ffact (Suc n) m = (m - n) * ffact n m
[PROOF STEP]
proof (cases "n \<le> m")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. n \<le> m \<Longrightarrow> ffact (Suc n) m = (m - n) * ffact n m
 2. \<not> n \<le> m \<Longrightarrow> ffact (Suc n) m = (m - n) * ffact n m
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
n \<le> m

goal (2 subgoals):
 1. n \<le> m \<Longrightarrow> ffact (Suc n) m = (m - n) * ffact n m
 2. \<not> n \<le> m \<Longrightarrow> ffact (Suc n) m = (m - n) * ffact n m
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
n \<le> m
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
n \<le> m

goal (1 subgoal):
 1. ffact (Suc n) m = (m - n) * ffact n m
[PROOF STEP]
by (simp add: ffact_def pochhammer_rec Suc_diff_le)
[PROOF STATE]
proof (state)
this:
ffact (Suc n) m = (m - n) * ffact n m

goal (1 subgoal):
 1. \<not> n \<le> m \<Longrightarrow> ffact (Suc n) m = (m - n) * ffact n m
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> n \<le> m \<Longrightarrow> ffact (Suc n) m = (m - n) * ffact n m
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> n \<le> m

goal (1 subgoal):
 1. \<not> n \<le> m \<Longrightarrow> ffact (Suc n) m = (m - n) * ffact n m
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> n \<le> m
[PROOF STEP]
have "m < n"
[PROOF STATE]
proof (prove)
using this:
\<not> n \<le> m

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

goal (1 subgoal):
 1. \<not> n \<le> m \<Longrightarrow> ffact (Suc n) m = (m - n) * ffact n m
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
m < n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
m < n

goal (1 subgoal):
 1. ffact (Suc n) m = (m - n) * ffact n m
[PROOF STEP]
by (simp add: ffact_nat_triv)
[PROOF STATE]
proof (state)
this:
ffact (Suc n) m = (m - n) * ffact n m

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in ccw_vector_space) convex3:
  assumes "u \<ge> 0" "v \<ge> 0" "u + v = 1" "ccw a b d" "ccw a b c"
  shows "ccw a b (u *\<^sub>R c + v *\<^sub>R d)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ccw a b (u *\<^sub>R c + v *\<^sub>R d)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ccw a b (u *\<^sub>R c + v *\<^sub>R d)
[PROOF STEP]
have "v = 1 - u"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. v = 1 - u
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
0 \<le> u
0 \<le> v
u + v = 1
ccw a b d
ccw a b c

goal (1 subgoal):
 1. v = 1 - u
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
v = 1 - u

goal (1 subgoal):
 1. ccw a b (u *\<^sub>R c + v *\<^sub>R d)
[PROOF STEP]
hence "ccw 0 (b - a) (u *\<^sub>R (c - a) + v *\<^sub>R (d - a))"
[PROOF STATE]
proof (prove)
using this:
v = 1 - u

goal (1 subgoal):
 1. ccw (0::'a) (b - a) (u *\<^sub>R (c - a) + v *\<^sub>R (d - a))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
v = 1 - u
0 \<le> u
0 \<le> v
u + v = 1
ccw a b d
ccw a b c

goal (1 subgoal):
 1. ccw (0::'a) (b - a) (u *\<^sub>R (c - a) + v *\<^sub>R (d - a))
[PROOF STEP]
by (cases "u = 0" "v = 0" rule: bool.exhaust[case_product bool.exhaust])
      (auto simp add: translate_origin intro!: add3)
[PROOF STATE]
proof (state)
this:
ccw (0::'a) (b - a) (u *\<^sub>R (c - a) + v *\<^sub>R (d - a))

goal (1 subgoal):
 1. ccw a b (u *\<^sub>R c + v *\<^sub>R d)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
ccw (0::'a) (b - a) (u *\<^sub>R (c - a) + v *\<^sub>R (d - a))

goal (1 subgoal):
 1. ccw a b (u *\<^sub>R c + v *\<^sub>R d)
[PROOF STEP]
have "(u + v) *\<^sub>R a = a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (u + v) *\<^sub>R a = a
[PROOF STEP]
by (simp add: assms)
[PROOF STATE]
proof (state)
this:
(u + v) *\<^sub>R a = a

goal (1 subgoal):
 1. ccw a b (u *\<^sub>R c + v *\<^sub>R d)
[PROOF STEP]
hence "u *\<^sub>R (c - a) + v *\<^sub>R (d - a) = u *\<^sub>R c + v *\<^sub>R d - a"
[PROOF STATE]
proof (prove)
using this:
(u + v) *\<^sub>R a = a

goal (1 subgoal):
 1. u *\<^sub>R (c - a) + v *\<^sub>R (d - a) = u *\<^sub>R c + v *\<^sub>R d - a
[PROOF STEP]
by (auto simp: algebra_simps)
[PROOF STATE]
proof (state)
this:
u *\<^sub>R (c - a) + v *\<^sub>R (d - a) = u *\<^sub>R c + v *\<^sub>R d - a

goal (1 subgoal):
 1. ccw a b (u *\<^sub>R c + v *\<^sub>R d)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
ccw (0::'a) (b - a) (u *\<^sub>R c + v *\<^sub>R d - a)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
ccw (0::'a) (b - a) (u *\<^sub>R c + v *\<^sub>R d - a)

goal (1 subgoal):
 1. ccw a b (u *\<^sub>R c + v *\<^sub>R d)
[PROOF STEP]
by (simp add: translate_origin)
[PROOF STATE]
proof (state)
this:
ccw a b (u *\<^sub>R c + v *\<^sub>R d)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma coeff_sign_changes_reduce_root:
  assumes "a > (0 :: 'a :: linordered_idom)"
  shows   "coeff_sign_changes (reduce_root a p) = coeff_sign_changes p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sign_changes (coeffs (reduce_root a p)) = sign_changes (coeffs p)
[PROOF STEP]
proof (intro sign_changes_cong, induction p)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. map sgn (coeffs (reduce_root a 0)) = map sgn (coeffs 0)
 2. \<And>aa p. \<lbrakk>aa \<noteq> (0::'a) \<or> p \<noteq> 0; map sgn (coeffs (reduce_root a p)) = map sgn (coeffs p)\<rbrakk> \<Longrightarrow> map sgn (coeffs (reduce_root a (pCons aa p))) = map sgn (coeffs (pCons aa p))
[PROOF STEP]
case (pCons c p)
[PROOF STATE]
proof (state)
this:
c \<noteq> (0::'a) \<or> p \<noteq> 0
map sgn (coeffs (reduce_root a p)) = map sgn (coeffs p)

goal (2 subgoals):
 1. map sgn (coeffs (reduce_root a 0)) = map sgn (coeffs 0)
 2. \<And>aa p. \<lbrakk>aa \<noteq> (0::'a) \<or> p \<noteq> 0; map sgn (coeffs (reduce_root a p)) = map sgn (coeffs p)\<rbrakk> \<Longrightarrow> map sgn (coeffs (reduce_root a (pCons aa p))) = map sgn (coeffs (pCons aa p))
[PROOF STEP]
have "map sgn (coeffs (reduce_root a (pCons c p))) =
             cCons (sgn c) (map sgn (coeffs (reduce_root a p)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map sgn (coeffs (reduce_root a (pCons c p))) = cCons (sgn c) (map sgn (coeffs (reduce_root a p)))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
(0::'a) < a

goal (1 subgoal):
 1. map sgn (coeffs (reduce_root a (pCons c p))) = cCons (sgn c) (map sgn (coeffs (reduce_root a p)))
[PROOF STEP]
by (auto simp add: cCons_def sgn_0_0 sgn_mult reduce_root_pCons coeffs_smult)
[PROOF STATE]
proof (state)
this:
map sgn (coeffs (reduce_root a (pCons c p))) = cCons (sgn c) (map sgn (coeffs (reduce_root a p)))

goal (2 subgoals):
 1. map sgn (coeffs (reduce_root a 0)) = map sgn (coeffs 0)
 2. \<And>aa p. \<lbrakk>aa \<noteq> (0::'a) \<or> p \<noteq> 0; map sgn (coeffs (reduce_root a p)) = map sgn (coeffs p)\<rbrakk> \<Longrightarrow> map sgn (coeffs (reduce_root a (pCons aa p))) = map sgn (coeffs (pCons aa p))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
map sgn (coeffs (reduce_root a (pCons c p))) = cCons (sgn c) (map sgn (coeffs (reduce_root a p)))

goal (2 subgoals):
 1. map sgn (coeffs (reduce_root a 0)) = map sgn (coeffs 0)
 2. \<And>aa p. \<lbrakk>aa \<noteq> (0::'a) \<or> p \<noteq> 0; map sgn (coeffs (reduce_root a p)) = map sgn (coeffs p)\<rbrakk> \<Longrightarrow> map sgn (coeffs (reduce_root a (pCons aa p))) = map sgn (coeffs (pCons aa p))
[PROOF STEP]
note pCons.IH
[PROOF STATE]
proof (state)
this:
map sgn (coeffs (reduce_root a p)) = map sgn (coeffs p)

goal (2 subgoals):
 1. map sgn (coeffs (reduce_root a 0)) = map sgn (coeffs 0)
 2. \<And>aa p. \<lbrakk>aa \<noteq> (0::'a) \<or> p \<noteq> 0; map sgn (coeffs (reduce_root a p)) = map sgn (coeffs p)\<rbrakk> \<Longrightarrow> map sgn (coeffs (reduce_root a (pCons aa p))) = map sgn (coeffs (pCons aa p))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
map sgn (coeffs (reduce_root a p)) = map sgn (coeffs p)

goal (2 subgoals):
 1. map sgn (coeffs (reduce_root a 0)) = map sgn (coeffs 0)
 2. \<And>aa p. \<lbrakk>aa \<noteq> (0::'a) \<or> p \<noteq> 0; map sgn (coeffs (reduce_root a p)) = map sgn (coeffs p)\<rbrakk> \<Longrightarrow> map sgn (coeffs (reduce_root a (pCons aa p))) = map sgn (coeffs (pCons aa p))
[PROOF STEP]
have "cCons (sgn c) (map sgn (coeffs p)) = map sgn (coeffs (pCons c p))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cCons (sgn c) (map sgn (coeffs p)) = map sgn (coeffs (pCons c p))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
(0::'a) < a

goal (1 subgoal):
 1. cCons (sgn c) (map sgn (coeffs p)) = map sgn (coeffs (pCons c p))
[PROOF STEP]
by (auto simp add: cCons_def sgn_0_0)
[PROOF STATE]
proof (state)
this:
cCons (sgn c) (map sgn (coeffs p)) = map sgn (coeffs (pCons c p))

goal (2 subgoals):
 1. map sgn (coeffs (reduce_root a 0)) = map sgn (coeffs 0)
 2. \<And>aa p. \<lbrakk>aa \<noteq> (0::'a) \<or> p \<noteq> 0; map sgn (coeffs (reduce_root a p)) = map sgn (coeffs p)\<rbrakk> \<Longrightarrow> map sgn (coeffs (reduce_root a (pCons aa p))) = map sgn (coeffs (pCons aa p))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
map sgn (coeffs (reduce_root a (pCons c p))) = map sgn (coeffs (pCons c p))
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
map sgn (coeffs (reduce_root a (pCons c p))) = map sgn (coeffs (pCons c p))

goal (1 subgoal):
 1. map sgn (coeffs (reduce_root a (pCons c p))) = map sgn (coeffs (pCons c p))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
map sgn (coeffs (reduce_root a (pCons c p))) = map sgn (coeffs (pCons c p))

goal (1 subgoal):
 1. map sgn (coeffs (reduce_root a 0)) = map sgn (coeffs 0)
[PROOF STEP]
qed (simp_all add: reduce_root_def)


[STATEMENT]
lemma homogeneousI: "(\<And>s t. s \<in> keys p \<Longrightarrow> t \<in> keys p \<Longrightarrow> deg_pm s = deg_pm t) \<Longrightarrow> homogeneous p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>s t. \<lbrakk>s \<in> keys p; t \<in> keys p\<rbrakk> \<Longrightarrow> deg_pm s = deg_pm t) \<Longrightarrow> homogeneous p
[PROOF STEP]
unfolding homogeneous_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>s t. \<lbrakk>s \<in> keys p; t \<in> keys p\<rbrakk> \<Longrightarrow> deg_pm s = deg_pm t) \<Longrightarrow> \<forall>s\<in>keys p. \<forall>t\<in>keys p. deg_pm s = deg_pm t
[PROOF STEP]
by blast


[STATEMENT]
lemma continuous_uminus_ereal [continuous_intros]: "continuous_on (A :: ereal set) uminus"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on A uminus
[PROOF STEP]
unfolding continuous_on_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>A. (uminus \<longlongrightarrow> - x) (at x within A)
[PROOF STEP]
by (intro ballI tendsto_uminus_ereal[of "\<lambda>x. x::ereal"]) simp


[STATEMENT]
lemma tendsto_matrix_matrix_mult[tendsto_intros]:
  "((**) (A :: 'a :: real_normed_algebra_1 ^ 'n ^ 'k) \<longlongrightarrow> A ** B) (at B within S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((**) A \<longlongrightarrow> A ** B) (at B within S)
[PROOF STEP]
unfolding matrix_matrix_mult_def[abs_def]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>m'. \<chi>i j. \<Sum>k\<in>UNIV. A $h i $h k * m' $h k $h j) \<longlongrightarrow> (\<chi>i j. \<Sum>k\<in>UNIV. A $h i $h k * B $h k $h j)) (at B within S)
[PROOF STEP]
by (auto intro!: tendsto_intros)


[STATEMENT]
lemma of_rat_eq_0_iff [simp]: "of_rat a = 0 \<longleftrightarrow> a = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (of_rat a = (0::'a)) = (a = 0)
[PROOF STEP]
using of_rat_eq_iff [of _ 0]
[PROOF STATE]
proof (prove)
using this:
(of_rat ?a = of_rat 0) = (?a = 0)

goal (1 subgoal):
 1. (of_rat a = (0::'a)) = (a = 0)
[PROOF STEP]
by simp


[STATEMENT]
lemma discount_factor_times_rfr:
  assumes "-1 < r"
  shows "(1+r) * discount_factor r (Suc n) w = discount_factor r n w"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (1 + r) * discount_factor r (Suc n) w = discount_factor r n w
[PROOF STEP]
unfolding discount_factor_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (1 + r) * inverse (disc_rfr_proc r (Suc n) w) = inverse (disc_rfr_proc r n w)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
- 1 < r

goal (1 subgoal):
 1. (1 + r) * inverse (disc_rfr_proc r (Suc n) w) = inverse (disc_rfr_proc r n w)
[PROOF STEP]
by simp


[STATEMENT]
lemma shortest_path_inf:  "\<not> vert_connected u v \<Longrightarrow> shortest_path u v = \<infinity>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> vert_connected u v \<Longrightarrow> shortest_path u v = \<infinity>
[PROOF STEP]
using connecting_paths_empty_iff shortest_path_def
[PROOF STATE]
proof (prove)
using this:
vert_connected ?u ?v = (connecting_paths ?u ?v \<noteq> {})
shortest_path ?u ?v \<equiv> INF p\<in>connecting_paths ?u ?v. enat (walk_length p)

goal (1 subgoal):
 1. \<not> vert_connected u v \<Longrightarrow> shortest_path u v = \<infinity>
[PROOF STEP]
by (simp add: top_enat_def)


[STATEMENT]
lemma finite_imp_finite_prob_proj:
  fixes PROB
  assumes "finite PROB"
  shows "(finite (prob_proj PROB vs))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (prob_proj PROB vs)
[PROOF STEP]
unfolding prob_proj_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite ((\<lambda>a. action_proj a vs) ` PROB)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
finite PROB

goal (1 subgoal):
 1. finite ((\<lambda>a. action_proj a vs) ` PROB)
[PROOF STEP]
by simp

\<comment> \<open>NOTE Base 2 in 5th assumption had to be explicitely fixed to 'nat' type to be able to use the
linearity lemma for powers of natural numbers.\<close>


[STATEMENT]
lemma rel_interior_eq_empty:
  fixes S :: "'n::euclidean_space set"
  assumes "convex S"
  shows "rel_interior S = {} \<longleftrightarrow> S = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (rel_interior S = {}) = (S = {})
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (rel_interior S = {}) = (S = {})
[PROOF STEP]
{
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (rel_interior S = {}) = (S = {})
[PROOF STEP]
assume "S \<noteq> {}"
[PROOF STATE]
proof (state)
this:
S \<noteq> {}

goal (1 subgoal):
 1. (rel_interior S = {}) = (S = {})
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
S \<noteq> {}
[PROOF STEP]
obtain a where "a \<in> S"
[PROOF STATE]
proof (prove)
using this:
S \<noteq> {}

goal (1 subgoal):
 1. (\<And>a. a \<in> S \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
a \<in> S

goal (1 subgoal):
 1. (rel_interior S = {}) = (S = {})
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a \<in> S
[PROOF STEP]
have "0 \<in> (+) (-a) ` S"
[PROOF STATE]
proof (prove)
using this:
a \<in> S

goal (1 subgoal):
 1. (0::'n) \<in> (+) (- a) ` S
[PROOF STEP]
using assms exI[of "(\<lambda>x. x \<in> S \<and> - a + x = 0)" a]
[PROOF STATE]
proof (prove)
using this:
a \<in> S
convex S
a \<in> S \<and> - a + a = (0::'n) \<Longrightarrow> \<exists>x. x \<in> S \<and> - a + x = (0::'n)

goal (1 subgoal):
 1. (0::'n) \<in> (+) (- a) ` S
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(0::'n) \<in> (+) (- a) ` S

goal (1 subgoal):
 1. (rel_interior S = {}) = (S = {})
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(0::'n) \<in> (+) (- a) ` S
[PROOF STEP]
have "rel_interior ((+) (-a) ` S) \<noteq> {}"
[PROOF STATE]
proof (prove)
using this:
(0::'n) \<in> (+) (- a) ` S

goal (1 subgoal):
 1. rel_interior ((+) (- a) ` S) \<noteq> {}
[PROOF STEP]
using rel_interior_convex_nonempty_aux[of "(+) (-a) ` S"]
        convex_translation[of S "-a"] assms
[PROOF STATE]
proof (prove)
using this:
(0::'n) \<in> (+) (- a) ` S
\<lbrakk>convex ((+) (- a) ` S); (0::'n) \<in> (+) (- a) ` S\<rbrakk> \<Longrightarrow> rel_interior ((+) (- a) ` S) \<noteq> {}
convex S \<Longrightarrow> convex ((+) (- a) ` S)
convex S

goal (1 subgoal):
 1. rel_interior ((+) (- a) ` S) \<noteq> {}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
rel_interior ((+) (- a) ` S) \<noteq> {}

goal (1 subgoal):
 1. (rel_interior S = {}) = (S = {})
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
rel_interior ((+) (- a) ` S) \<noteq> {}
[PROOF STEP]
have "rel_interior S \<noteq> {}"
[PROOF STATE]
proof (prove)
using this:
rel_interior ((+) (- a) ` S) \<noteq> {}

goal (1 subgoal):
 1. rel_interior S \<noteq> {}
[PROOF STEP]
using rel_interior_translation [of "- a"]
[PROOF STATE]
proof (prove)
using this:
rel_interior ((+) (- a) ` S) \<noteq> {}
rel_interior ((+) (- a) ` ?S) = (+) (- a) ` rel_interior ?S

goal (1 subgoal):
 1. rel_interior S \<noteq> {}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
rel_interior S \<noteq> {}

goal (1 subgoal):
 1. (rel_interior S = {}) = (S = {})
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
S \<noteq> {} \<Longrightarrow> rel_interior S \<noteq> {}

goal (1 subgoal):
 1. (rel_interior S = {}) = (S = {})
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
S \<noteq> {} \<Longrightarrow> rel_interior S \<noteq> {}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
S \<noteq> {} \<Longrightarrow> rel_interior S \<noteq> {}

goal (1 subgoal):
 1. (rel_interior S = {}) = (S = {})
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(rel_interior S = {}) = (S = {})

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma efficient_code:
  assumes "set (ps ()) = (\<lambda>p. (p, multiplicity p n - 1)) ` prime_factors n" "distinct (ps ())"
  shows   "f n = (if n = 0 then 0 else (\<Prod>(p,d) \<leftarrow> ps (). f_prime_power p (Suc d)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f n = (if n = 0 then 0::'a else \<Prod>(p, d)\<leftarrow>ps (). f_prime_power p (Suc d))
[PROOF STEP]
using efficient_code_aux[of n "ps ()"] assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>0 < n; set (ps ()) = (\<lambda>p. (p, multiplicity p n - 1)) ` prime_factors n; distinct (ps ())\<rbrakk> \<Longrightarrow> f n = (\<Prod>(p, d)\<leftarrow>ps (). f_prime_power p (Suc d))
set (ps ()) = (\<lambda>p. (p, multiplicity p n - 1)) ` prime_factors n
distinct (ps ())

goal (1 subgoal):
 1. f n = (if n = 0 then 0::'a else \<Prod>(p, d)\<leftarrow>ps (). f_prime_power p (Suc d))
[PROOF STEP]
by simp


[STATEMENT]
lemma psign_diff_linear_comp:
  fixes b c::real
  defines "h \<equiv> (\<lambda>p. pcompose p [:b,c:])"
  shows "psign_diff (h p) (h q) x = psign_diff p q (c * x + b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. psign_diff (h p) (h q) x = psign_diff p q (c * x + b)
[PROOF STEP]
unfolding psign_diff_def h_def poly_pcompose
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if poly p (poly [:b, c:] x) = 0 \<and> poly q (poly [:b, c:] x) = 0 then 1 else \<bar>sign (poly p (poly [:b, c:] x)) - sign (poly q (poly [:b, c:] x))\<bar>) = (if poly p (c * x + b) = 0 \<and> poly q (c * x + b) = 0 then 1 else \<bar>sign (poly p (c * x + b)) - sign (poly q (c * x + b))\<bar>)
[PROOF STEP]
by (smt (verit, del_insts) mult.commute mult_eq_0_iff poly_0 poly_pCons)


[STATEMENT]
lemma piecewise_C1_differentiable_on_ident [simp, derivative_intros]:
  fixes f :: "real \<Rightarrow> 'a::real_normed_vector"
  shows "(\<lambda>x. x) piecewise_C1_differentiable_on S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. x) piecewise_C1_differentiable_on S
[PROOF STEP]
unfolding piecewise_C1_differentiable_on_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on S (\<lambda>x. x) \<and> (\<exists>Sa. finite Sa \<and> (\<lambda>x. x) C1_differentiable_on S - Sa)
[PROOF STEP]
using C1_differentiable_on_ident
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. x) C1_differentiable_on ?S

goal (1 subgoal):
 1. continuous_on S (\<lambda>x. x) \<and> (\<exists>Sa. finite Sa \<and> (\<lambda>x. x) C1_differentiable_on S - Sa)
[PROOF STEP]
by (blast intro: continuous_on_id C1_differentiable_on_ident)


[STATEMENT]
lemma model_to_dimacs_model_distinct:
  "1 < n_vars \<Longrightarrow> distinct (map dimacs_lit_to_var (model_to_dimacs_model M [1..<n_vars]))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 < n_vars \<Longrightarrow> distinct (map dimacs_lit_to_var (model_to_dimacs_model M [1..<n_vars]))
[PROOF STEP]
by (induction n_vars)
     (fastforce elim!: int_cases2'
                simp add: dimacs_lit_to_var_def model_to_dimacs_model_append'
                          model_to_dimacs_neg_nin model_to_dimacs_pos_nin)+


[STATEMENT]
lemma vifintersection_antimono1:
  assumes "I \<noteq> 0" and "I \<subseteq>\<^sub>\<circ> J"
  shows "(\<Inter>\<^sub>\<circ>j\<in>\<^sub>\<circ>J. f j) \<subseteq>\<^sub>\<circ> (\<Inter>\<^sub>\<circ>i\<in>\<^sub>\<circ>I. f i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Inter>\<^sub>\<circ> (VLambda J f `\<^sub>\<circ> J) \<subseteq>\<^sub>\<circ> \<Inter>\<^sub>\<circ> (VLambda I f `\<^sub>\<circ> I)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
I \<noteq> 0
I \<subseteq>\<^sub>\<circ> J

goal (1 subgoal):
 1. \<Inter>\<^sub>\<circ> (VLambda J f `\<^sub>\<circ> J) \<subseteq>\<^sub>\<circ> \<Inter>\<^sub>\<circ> (VLambda I f `\<^sub>\<circ> I)
[PROOF STEP]
by blast


[STATEMENT]
lemma szip_smap [simp]: "szip (smap f xs) (smap g ys) = smap (map_prod f g) (szip xs ys)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. szip (smap f xs) (smap g ys) = smap (map_prod f g) (szip xs ys)
[PROOF STEP]
by(coinduction arbitrary: xs ys) auto


[STATEMENT]
lemma infnorm_set_image:
  fixes x :: "'a::euclidean_space"
  shows "{\<bar>x \<bullet> i\<bar> |i. i \<in> Basis} = (\<lambda>i. \<bar>x \<bullet> i\<bar>) ` Basis"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {\<bar>x \<bullet> i\<bar> |i. i \<in> Basis} = (\<lambda>i. \<bar>x \<bullet> i\<bar>) ` Basis
[PROOF STEP]
by blast


[STATEMENT]
lemma align_lem_and:
  assumes "length xs = n + m" "length ys = n + m"
    and "drop m xs = replicate n False" "take m ys = replicate m False"
  shows "map2 (\<and>) xs ys = replicate (n + m) False"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map2 (\<and>) xs ys = replicate (n + m) False
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
length xs = n + m
length ys = n + m
drop m xs = replicate n False
take m ys = replicate m False

goal (1 subgoal):
 1. map2 (\<and>) xs ys = replicate (n + m) False
[PROOF STEP]
proof (induction xs arbitrary: ys m)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>ys m. \<lbrakk>length [] = n + m; length ys = n + m; drop m [] = replicate n False; take m ys = replicate m False\<rbrakk> \<Longrightarrow> map2 (\<and>) [] ys = replicate (n + m) False
 2. \<And>a xs ys m. \<lbrakk>\<And>ys m. \<lbrakk>length xs = n + m; length ys = n + m; drop m xs = replicate n False; take m ys = replicate m False\<rbrakk> \<Longrightarrow> map2 (\<and>) xs ys = replicate (n + m) False; length (a # xs) = n + m; length ys = n + m; drop m (a # xs) = replicate n False; take m ys = replicate m False\<rbrakk> \<Longrightarrow> map2 (\<and>) (a # xs) ys = replicate (n + m) False
[PROOF STEP]
case (Cons a xs)
[PROOF STATE]
proof (state)
this:
\<lbrakk>length xs = n + ?m; length ?ys = n + ?m; drop ?m xs = replicate n False; take ?m ?ys = replicate ?m False\<rbrakk> \<Longrightarrow> map2 (\<and>) xs ?ys = replicate (n + ?m) False
length (a # xs) = n + m
length ys = n + m
drop m (a # xs) = replicate n False
take m ys = replicate m False

goal (2 subgoals):
 1. \<And>ys m. \<lbrakk>length [] = n + m; length ys = n + m; drop m [] = replicate n False; take m ys = replicate m False\<rbrakk> \<Longrightarrow> map2 (\<and>) [] ys = replicate (n + m) False
 2. \<And>a xs ys m. \<lbrakk>\<And>ys m. \<lbrakk>length xs = n + m; length ys = n + m; drop m xs = replicate n False; take m ys = replicate m False\<rbrakk> \<Longrightarrow> map2 (\<and>) xs ys = replicate (n + m) False; length (a # xs) = n + m; length ys = n + m; drop m (a # xs) = replicate n False; take m ys = replicate m False\<rbrakk> \<Longrightarrow> map2 (\<and>) (a # xs) ys = replicate (n + m) False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>length xs = n + ?m; length ?ys = n + ?m; drop ?m xs = replicate n False; take ?m ?ys = replicate ?m False\<rbrakk> \<Longrightarrow> map2 (\<and>) xs ?ys = replicate (n + ?m) False
length (a # xs) = n + m
length ys = n + m
drop m (a # xs) = replicate n False
take m ys = replicate m False
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>length xs = n + ?m; length ?ys = n + ?m; drop ?m xs = replicate n False; take ?m ?ys = replicate ?m False\<rbrakk> \<Longrightarrow> map2 (\<and>) xs ?ys = replicate (n + ?m) False
length (a # xs) = n + m
length ys = n + m
drop m (a # xs) = replicate n False
take m ys = replicate m False

goal (1 subgoal):
 1. map2 (\<and>) (a # xs) ys = replicate (n + m) False
[PROOF STEP]
by (cases m) (auto simp: length_Suc_conv set_replicate_conv_if False_map2_and)
[PROOF STATE]
proof (state)
this:
map2 (\<and>) (a # xs) ys = replicate (n + m) False

goal (1 subgoal):
 1. \<And>ys m. \<lbrakk>length [] = n + m; length ys = n + m; drop m [] = replicate n False; take m ys = replicate m False\<rbrakk> \<Longrightarrow> map2 (\<and>) [] ys = replicate (n + m) False
[PROOF STEP]
qed auto


[STATEMENT]
lemma div_Tr1:"\<lbrakk> (0::nat) < r; 0 < s; l \<le> s * r\<rbrakk> \<Longrightarrow> l div s \<le> r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < r; 0 < s; l \<le> s * r\<rbrakk> \<Longrightarrow> l div s \<le> r
[PROOF STEP]
apply (frule_tac m = l and n = "s * r" and k = s in div_le_mono)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < r; 0 < s; l \<le> s * r; l div s \<le> s * r div s\<rbrakk> \<Longrightarrow> l div s \<le> r
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma Collect_eq:
  "{x. P x} = {x. Q x} \<longleftrightarrow> (\<forall>x. P x = Q x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ({x. P x} = {x. Q x}) = (\<forall>x. P x = Q x)
[PROOF STEP]
by (rule iffI) auto


[STATEMENT]
lemma emeasure_compl:
  "s \<in> sets M \<Longrightarrow> emeasure M s \<noteq> \<infinity> \<Longrightarrow> emeasure M (space M - s) = emeasure M (space M) - emeasure M s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>s \<in> sets M; emeasure M s \<noteq> \<infinity>\<rbrakk> \<Longrightarrow> emeasure M (space M - s) = emeasure M (space M) - emeasure M s
[PROOF STEP]
by (rule emeasure_Diff) (auto dest: sets.sets_into_space)


[STATEMENT]
lemma complex_split_polar2: "\<forall>n. \<exists>r a. (z n) = complex_of_real r * Complex (cos a) (sin a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>n. \<exists>r a. z n = complex_of_real r * Complex (cos a) (sin a)
[PROOF STEP]
unfolding Complex_eq
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>n. \<exists>r a. z n = complex_of_real r * (complex_of_real (cos a) + \<i> * complex_of_real (sin a))
[PROOF STEP]
by (auto intro: complex_split_polar)


[STATEMENT]
lemma ent_disjE: "\<lbrakk> A\<Longrightarrow>\<^sub>AC; B\<Longrightarrow>\<^sub>AC \<rbrakk> \<Longrightarrow> A\<or>\<^sub>AB \<Longrightarrow>\<^sub>AC"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>A \<Longrightarrow>\<^sub>A C; B \<Longrightarrow>\<^sub>A C\<rbrakk> \<Longrightarrow> A \<or>\<^sub>A B \<Longrightarrow>\<^sub>A C
[PROOF STEP]
unfolding entails_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>h. h \<Turnstile> A \<longrightarrow> h \<Turnstile> C; \<forall>h. h \<Turnstile> B \<longrightarrow> h \<Turnstile> C\<rbrakk> \<Longrightarrow> \<forall>h. h \<Turnstile> A \<or>\<^sub>A B \<longrightarrow> h \<Turnstile> C
[PROOF STEP]
by auto


[STATEMENT]
lemma hypnat_mult_is_0 [simp]: "\<And>m n::hypnat. m * n = 0 \<longleftrightarrow> m = 0 \<or> n = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>m n. (m * n = 0) = (m = 0 \<or> n = 0)
[PROOF STEP]
by transfer (rule mult_is_0)


[STATEMENT]
theorem LT18: "\<turnstile> (A \<leadsto> (B \<or> C)) \<longrightarrow> (B \<leadsto> D) \<longrightarrow> (C \<leadsto> D) \<longrightarrow> (A \<leadsto> D)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<turnstile> (A \<leadsto> B \<or> C) \<longrightarrow> (B \<leadsto> D) \<longrightarrow> (C \<leadsto> D) \<longrightarrow> A \<leadsto> D
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<turnstile> (A \<leadsto> B \<or> C) \<longrightarrow> (B \<leadsto> D) \<longrightarrow> (C \<leadsto> D) \<longrightarrow> A \<leadsto> D
[PROOF STEP]
have "\<turnstile> (B \<leadsto> D) \<longrightarrow> (C \<leadsto> D) \<longrightarrow> ((B \<or> C) \<leadsto> D)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<turnstile> (B \<leadsto> D) \<longrightarrow> (C \<leadsto> D) \<longrightarrow> B \<or> C \<leadsto> D
[PROOF STEP]
by (rule LT16)
[PROOF STATE]
proof (state)
this:
\<turnstile> (B \<leadsto> D) \<longrightarrow> (C \<leadsto> D) \<longrightarrow> B \<or> C \<leadsto> D

goal (1 subgoal):
 1. \<turnstile> (A \<leadsto> B \<or> C) \<longrightarrow> (B \<leadsto> D) \<longrightarrow> (C \<leadsto> D) \<longrightarrow> A \<leadsto> D
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<turnstile> (B \<leadsto> D) \<longrightarrow> (C \<leadsto> D) \<longrightarrow> B \<or> C \<leadsto> D

goal (1 subgoal):
 1. \<turnstile> (A \<leadsto> B \<or> C) \<longrightarrow> (B \<leadsto> D) \<longrightarrow> (C \<leadsto> D) \<longrightarrow> A \<leadsto> D
[PROOF STEP]
by (force elim: LT13[unlift_rule])
[PROOF STATE]
proof (state)
this:
\<turnstile> (A \<leadsto> B \<or> C) \<longrightarrow> (B \<leadsto> D) \<longrightarrow> (C \<leadsto> D) \<longrightarrow> A \<leadsto> D

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma is_basis_columns_fst_QR_decomposition:
  fixes A::"real^'n::{mod_type}^'m::{mod_type}"
  assumes b: "is_basis (columns A)"
  and c: "card (columns A) = ncols A"
  shows "is_basis (columns (fst (QR_decomposition A)))
  \<and> card (columns (fst (QR_decomposition A))) = ncols A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_basis (columns (fst (QR_decomposition A))) \<and> card (columns (fst (QR_decomposition A))) = ncols A
[PROOF STEP]
proof (rule conjI, unfold is_basis_def, rule conjI)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. vec.independent (columns (fst (QR_decomposition A)))
 2. vec.span (columns (fst (QR_decomposition A))) = UNIV
 3. card (columns (fst (QR_decomposition A))) = ncols A
[PROOF STEP]
have "vec.span (columns (fst (QR_decomposition A))) = vec.span (columns (Gram_Schmidt_matrix A))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec.span (columns (fst (QR_decomposition A))) = vec.span (columns (Gram_Schmidt_matrix A))
[PROOF STEP]
unfolding vec.span_eq
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. columns (fst (QR_decomposition A)) \<subseteq> vec.span (columns (Gram_Schmidt_matrix A)) \<and> columns (Gram_Schmidt_matrix A) \<subseteq> vec.span (columns (fst (QR_decomposition A)))
[PROOF STEP]
proof (auto)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x. x \<in> columns (fst (QR_decomposition A)) \<Longrightarrow> x \<in> vec.span (columns (Gram_Schmidt_matrix A))
 2. \<And>x. x \<in> columns (Gram_Schmidt_matrix A) \<Longrightarrow> x \<in> vec.span (columns (fst (QR_decomposition A)))
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x. x \<in> columns (fst (QR_decomposition A)) \<Longrightarrow> x \<in> vec.span (columns (Gram_Schmidt_matrix A))
 2. \<And>x. x \<in> columns (Gram_Schmidt_matrix A) \<Longrightarrow> x \<in> vec.span (columns (fst (QR_decomposition A)))
[PROOF STEP]
show "x \<in> vec.span (columns (Gram_Schmidt_matrix A))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> vec.span (columns (Gram_Schmidt_matrix A))
[PROOF STEP]
using assms(1) assms(2) is_basis_columns_Gram_Schmidt_matrix is_basis_def
[PROOF STATE]
proof (prove)
using this:
is_basis (columns A)
card (columns A) = ncols A
\<lbrakk>is_basis (columns ?A); card (columns ?A) = ncols ?A\<rbrakk> \<Longrightarrow> is_basis (columns (Gram_Schmidt_matrix ?A)) \<and> card (columns (Gram_Schmidt_matrix ?A)) = ncols ?A
is_basis ?S \<equiv> vec.independent ?S \<and> vec.span ?S = UNIV

goal (1 subgoal):
 1. x \<in> vec.span (columns (Gram_Schmidt_matrix A))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x \<in> vec.span (columns (Gram_Schmidt_matrix A))

goal (1 subgoal):
 1. \<And>x. x \<in> columns (Gram_Schmidt_matrix A) \<Longrightarrow> x \<in> vec.span (columns (fst (QR_decomposition A)))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> columns (Gram_Schmidt_matrix A) \<Longrightarrow> x \<in> vec.span (columns (fst (QR_decomposition A)))
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> columns (Gram_Schmidt_matrix A) \<Longrightarrow> x \<in> vec.span (columns (fst (QR_decomposition A)))
[PROOF STEP]
assume x: "x \<in> columns (Gram_Schmidt_matrix A)"
[PROOF STATE]
proof (state)
this:
x \<in> columns (Gram_Schmidt_matrix A)

goal (1 subgoal):
 1. \<And>x. x \<in> columns (Gram_Schmidt_matrix A) \<Longrightarrow> x \<in> vec.span (columns (fst (QR_decomposition A)))
[PROOF STEP]
from this
[PROOF STATE]
proof (chain)
picking this:
x \<in> columns (Gram_Schmidt_matrix A)
[PROOF STEP]
obtain i where x_col_i: "x=column i (Gram_Schmidt_matrix A)"
[PROOF STATE]
proof (prove)
using this:
x \<in> columns (Gram_Schmidt_matrix A)

goal (1 subgoal):
 1. (\<And>i. x = column i (Gram_Schmidt_matrix A) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding columns_def
[PROOF STATE]
proof (prove)
using this:
x \<in> {column i (Gram_Schmidt_matrix A) |i. i \<in> UNIV}

goal (1 subgoal):
 1. (\<And>i. x = column i (Gram_Schmidt_matrix A) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
x = column i (Gram_Schmidt_matrix A)

goal (1 subgoal):
 1. \<And>x. x \<in> columns (Gram_Schmidt_matrix A) \<Longrightarrow> x \<in> vec.span (columns (fst (QR_decomposition A)))
[PROOF STEP]
have zero_not_in: "x \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<noteq> 0
[PROOF STEP]
using is_basis_columns_Gram_Schmidt_matrix[OF b c]
[PROOF STATE]
proof (prove)
using this:
is_basis (columns (Gram_Schmidt_matrix A)) \<and> card (columns (Gram_Schmidt_matrix A)) = ncols A

goal (1 subgoal):
 1. x \<noteq> 0
[PROOF STEP]
unfolding is_basis_def
[PROOF STATE]
proof (prove)
using this:
(vec.independent (columns (Gram_Schmidt_matrix A)) \<and> vec.span (columns (Gram_Schmidt_matrix A)) = UNIV) \<and> card (columns (Gram_Schmidt_matrix A)) = ncols A

goal (1 subgoal):
 1. x \<noteq> 0
[PROOF STEP]
using vec.dependent_zero[of "(columns (Gram_Schmidt_matrix A))"] x
[PROOF STATE]
proof (prove)
using this:
(vec.independent (columns (Gram_Schmidt_matrix A)) \<and> vec.span (columns (Gram_Schmidt_matrix A)) = UNIV) \<and> card (columns (Gram_Schmidt_matrix A)) = ncols A
0 \<in> columns (Gram_Schmidt_matrix A) \<Longrightarrow> vec.dependent (columns (Gram_Schmidt_matrix A))
x \<in> columns (Gram_Schmidt_matrix A)

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

goal (1 subgoal):
 1. \<And>x. x \<in> columns (Gram_Schmidt_matrix A) \<Longrightarrow> x \<in> vec.span (columns (fst (QR_decomposition A)))
[PROOF STEP]
have "x=column i (Gram_Schmidt_matrix A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x = column i (Gram_Schmidt_matrix A)
[PROOF STEP]
using x_col_i
[PROOF STATE]
proof (prove)
using this:
x = column i (Gram_Schmidt_matrix A)

goal (1 subgoal):
 1. x = column i (Gram_Schmidt_matrix A)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
x = column i (Gram_Schmidt_matrix A)

goal (1 subgoal):
 1. \<And>x. x \<in> columns (Gram_Schmidt_matrix A) \<Longrightarrow> x \<in> vec.span (columns (fst (QR_decomposition A)))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
x = column i (Gram_Schmidt_matrix A)

goal (1 subgoal):
 1. \<And>x. x \<in> columns (Gram_Schmidt_matrix A) \<Longrightarrow> x \<in> vec.span (columns (fst (QR_decomposition A)))
[PROOF STEP]
have "... = norm (column i (Gram_Schmidt_matrix A)) *\<^sub>R column i (divide_by_norm (Gram_Schmidt_matrix A))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. column i (Gram_Schmidt_matrix A) = norm (column i (Gram_Schmidt_matrix A)) *\<^sub>R column i (divide_by_norm (Gram_Schmidt_matrix A))
[PROOF STEP]
using zero_not_in
[PROOF STATE]
proof (prove)
using this:
x \<noteq> 0

goal (1 subgoal):
 1. column i (Gram_Schmidt_matrix A) = norm (column i (Gram_Schmidt_matrix A)) *\<^sub>R column i (divide_by_norm (Gram_Schmidt_matrix A))
[PROOF STEP]
unfolding x_col_i columns_def divide_by_norm_def column_def normalize_def
[PROOF STATE]
proof (prove)
using this:
(\<chi>ia. Gram_Schmidt_matrix A $ ia $ i) \<noteq> 0

goal (1 subgoal):
 1. (\<chi>ia. Gram_Schmidt_matrix A $ ia $ i) = norm (\<chi>ia. Gram_Schmidt_matrix A $ ia $ i) *\<^sub>R (\<chi>ia. (\<chi>a b. ((1 / norm (\<chi>i. Gram_Schmidt_matrix A $ i $ b)) *\<^sub>R (\<chi>i. Gram_Schmidt_matrix A $ i $ b)) $ a) $ ia $ i)
[PROOF STEP]
by vector
[PROOF STATE]
proof (state)
this:
column i (Gram_Schmidt_matrix A) = norm (column i (Gram_Schmidt_matrix A)) *\<^sub>R column i (divide_by_norm (Gram_Schmidt_matrix A))

goal (1 subgoal):
 1. \<And>x. x \<in> columns (Gram_Schmidt_matrix A) \<Longrightarrow> x \<in> vec.span (columns (fst (QR_decomposition A)))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
x = norm (column i (Gram_Schmidt_matrix A)) *\<^sub>R column i (divide_by_norm (Gram_Schmidt_matrix A))
[PROOF STEP]
have x_eq: "x = norm (column i (Gram_Schmidt_matrix A)) *\<^sub>R column i (divide_by_norm (Gram_Schmidt_matrix A))"
[PROOF STATE]
proof (prove)
using this:
x = norm (column i (Gram_Schmidt_matrix A)) *\<^sub>R column i (divide_by_norm (Gram_Schmidt_matrix A))

goal (1 subgoal):
 1. x = norm (column i (Gram_Schmidt_matrix A)) *\<^sub>R column i (divide_by_norm (Gram_Schmidt_matrix A))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
x = norm (column i (Gram_Schmidt_matrix A)) *\<^sub>R column i (divide_by_norm (Gram_Schmidt_matrix A))

goal (1 subgoal):
 1. \<And>x. x \<in> columns (Gram_Schmidt_matrix A) \<Longrightarrow> x \<in> vec.span (columns (fst (QR_decomposition A)))
[PROOF STEP]
show "x \<in> vec.span (columns (fst (QR_decomposition A)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> vec.span (columns (fst (QR_decomposition A)))
[PROOF STEP]
unfolding x_eq span_vec_eq
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (column i (Gram_Schmidt_matrix A)) *\<^sub>R column i (divide_by_norm (Gram_Schmidt_matrix A)) \<in> span (columns (fst (QR_decomposition A)))
[PROOF STEP]
apply (rule subspace_mul)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. subspace (span (columns (fst (QR_decomposition A))))
 2. column i (divide_by_norm (Gram_Schmidt_matrix A)) \<in> span (columns (fst (QR_decomposition A)))
[PROOF STEP]
apply (auto simp add: columns_def QR_decomposition_def Let_def subspace_span intro: span_superset)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. column i (divide_by_norm (Gram_Schmidt_matrix A)) \<in> span {uu_. \<exists>i. uu_ = column i (divide_by_norm (Gram_Schmidt_matrix A))}
[PROOF STEP]
using span_superset
[PROOF STATE]
proof (prove)
using this:
?S \<subseteq> span ?S

goal (1 subgoal):
 1. column i (divide_by_norm (Gram_Schmidt_matrix A)) \<in> span {uu_. \<exists>i. uu_ = column i (divide_by_norm (Gram_Schmidt_matrix A))}
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
x \<in> vec.span (columns (fst (QR_decomposition A)))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
vec.span (columns (fst (QR_decomposition A))) = vec.span (columns (Gram_Schmidt_matrix A))

goal (3 subgoals):
 1. vec.independent (columns (fst (QR_decomposition A)))
 2. vec.span (columns (fst (QR_decomposition A))) = UNIV
 3. card (columns (fst (QR_decomposition A))) = ncols A
[PROOF STEP]
thus s: "vec.span (columns (fst (QR_decomposition A))) = (UNIV::(real^'m::{mod_type}) set)"
[PROOF STATE]
proof (prove)
using this:
vec.span (columns (fst (QR_decomposition A))) = vec.span (columns (Gram_Schmidt_matrix A))

goal (1 subgoal):
 1. vec.span (columns (fst (QR_decomposition A))) = UNIV
[PROOF STEP]
using is_basis_columns_Gram_Schmidt_matrix[OF b c]
[PROOF STATE]
proof (prove)
using this:
vec.span (columns (fst (QR_decomposition A))) = vec.span (columns (Gram_Schmidt_matrix A))
is_basis (columns (Gram_Schmidt_matrix A)) \<and> card (columns (Gram_Schmidt_matrix A)) = ncols A

goal (1 subgoal):
 1. vec.span (columns (fst (QR_decomposition A))) = UNIV
[PROOF STEP]
unfolding is_basis_def
[PROOF STATE]
proof (prove)
using this:
vec.span (columns (fst (QR_decomposition A))) = vec.span (columns (Gram_Schmidt_matrix A))
(vec.independent (columns (Gram_Schmidt_matrix A)) \<and> vec.span (columns (Gram_Schmidt_matrix A)) = UNIV) \<and> card (columns (Gram_Schmidt_matrix A)) = ncols A

goal (1 subgoal):
 1. vec.span (columns (fst (QR_decomposition A))) = UNIV
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
vec.span (columns (fst (QR_decomposition A))) = UNIV

goal (2 subgoals):
 1. vec.independent (columns (fst (QR_decomposition A)))
 2. card (columns (fst (QR_decomposition A))) = ncols A
[PROOF STEP]
thus "card (columns (fst (QR_decomposition A))) = ncols A"
[PROOF STATE]
proof (prove)
using this:
vec.span (columns (fst (QR_decomposition A))) = UNIV

goal (1 subgoal):
 1. card (columns (fst (QR_decomposition A))) = ncols A
[PROOF STEP]
by (metis (opaque_lifting, mono_tags) b c card_columns_le_ncols vec.card_le_dim_spanning
      finite_columns vec.indep_card_eq_dim_span is_basis_def ncols_def top_greatest)
[PROOF STATE]
proof (state)
this:
card (columns (fst (QR_decomposition A))) = ncols A

goal (1 subgoal):
 1. vec.independent (columns (fst (QR_decomposition A)))
[PROOF STEP]
thus "vec.independent (columns (fst (QR_decomposition A)))"
[PROOF STATE]
proof (prove)
using this:
card (columns (fst (QR_decomposition A))) = ncols A

goal (1 subgoal):
 1. vec.independent (columns (fst (QR_decomposition A)))
[PROOF STEP]
by (metis s b c vec.card_eq_dim_span_indep finite_columns vec.indep_card_eq_dim_span is_basis_def)
[PROOF STATE]
proof (state)
this:
vec.independent (columns (fst (QR_decomposition A)))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma scale_cancel_left [simp]: "scale a x = scale a y \<longleftrightarrow> x = y \<or> a = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a *s x = a *s y) = (x = y \<or> a = (0::'a))
[PROOF STEP]
by (auto intro: scale_left_imp_eq)


[STATEMENT]
lemma gauss_cnj_dvd_right_iff: "a dvd gauss_cnj b \<longleftrightarrow> gauss_cnj a dvd b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a dvd gauss_cnj b) = (gauss_cnj a dvd b)
[PROOF STEP]
by (rule gauss_cnj_dvd_left_iff [symmetric])


[STATEMENT]
lemma (in Ring) imset:"\<lbrakk>\<forall>k\<le> (Suc n). ideal R (J k)\<rbrakk>
\<Longrightarrow> {I. \<exists>k\<le> (Suc n). I = J k} = {J k| k. k \<in> {j. j \<le> (Suc n)}}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>k\<le>Suc n. ideal R (J k) \<Longrightarrow> {I. \<exists>k\<le>Suc n. I = J k} = {J k |k. k \<in> {j. j \<le> Suc n}}
[PROOF STEP]
apply blast
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
theorem list_order_irrefl:
  assumes "list_ops ops"
  shows "\<not> list_order ops x x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> List_Spec.list_order ops x x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> List_Spec.list_order ops x x
[PROOF STEP]
have "list_order ops x x \<Longrightarrow> False"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. List_Spec.list_order ops x x \<Longrightarrow> False
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. List_Spec.list_order ops x x \<Longrightarrow> False
[PROOF STEP]
assume "list_order ops x x"
[PROOF STATE]
proof (state)
this:
List_Spec.list_order ops x x

goal (1 subgoal):
 1. List_Spec.list_order ops x x \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
List_Spec.list_order ops x x
[PROOF STEP]
obtain xs ys zs where split: "fst (interp_ops ops) = xs @ [x] @ ys @ [x] @ zs"
[PROOF STATE]
proof (prove)
using this:
List_Spec.list_order ops x x

goal (1 subgoal):
 1. (\<And>xs ys zs. fst (interp_ops ops) = xs @ [x] @ ys @ [x] @ zs \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (meson List_Spec.list_order_def)
[PROOF STATE]
proof (state)
this:
fst (interp_ops ops) = xs @ [x] @ ys @ [x] @ zs

goal (1 subgoal):
 1. List_Spec.list_order ops x x \<Longrightarrow> False
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
fst (interp_ops ops) = xs @ [x] @ ys @ [x] @ zs

goal (1 subgoal):
 1. List_Spec.list_order ops x x \<Longrightarrow> False
[PROOF STEP]
have "distinct (fst (interp_ops ops))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distinct (fst (interp_ops ops))
[PROOF STEP]
by (simp add: assms interp_ops_distinct)
[PROOF STATE]
proof (state)
this:
distinct (fst (interp_ops ops))

goal (1 subgoal):
 1. List_Spec.list_order ops x x \<Longrightarrow> False
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
fst (interp_ops ops) = xs @ [x] @ ys @ [x] @ zs
distinct (fst (interp_ops ops))
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
fst (interp_ops ops) = xs @ [x] @ ys @ [x] @ zs
distinct (fst (interp_ops ops))

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
List_Spec.list_order ops x x \<Longrightarrow> False

goal (1 subgoal):
 1. \<not> List_Spec.list_order ops x x
[PROOF STEP]
thus "\<not> list_order ops x x"
[PROOF STATE]
proof (prove)
using this:
List_Spec.list_order ops x x \<Longrightarrow> False

goal (1 subgoal):
 1. \<not> List_Spec.list_order ops x x
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<not> List_Spec.list_order ops x x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Fourier_sum_limit_Dirichlet_kernel_part:
  assumes f: "f absolutely_integrable_on {-pi..pi}"
    and periodic: "\<And>x. f(x + 2*pi) = f x"
    and d: "0 < d" "d \<le> pi"
  shows "(\<lambda>n. \<Sum>k\<le>n. Fourier_coefficient f k * trigonometric_set k t) \<longlonglongrightarrow> l
     \<longleftrightarrow> (\<lambda>n. (LINT x|lebesgue_on {0..d}. Dirichlet_kernel n x * ((f(t+x) + f(t-x)) - 2*l))) \<longlonglongrightarrow> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. \<Sum>k\<le>n. Fourier_coefficient f k * trigonometric_set k t) \<longlonglongrightarrow> l = (\<lambda>n. LINT x|lebesgue_on {0..d}. Dirichlet_kernel n x * (f (t + x) + f (t - x) - 2 * l)) \<longlonglongrightarrow> 0
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<lambda>n. \<Sum>k\<le>n. Fourier_coefficient f k * trigonometric_set k t) \<longlonglongrightarrow> l = (\<lambda>n. LINT x|lebesgue_on {0..d}. Dirichlet_kernel n x * (f (t + x) + f (t - x) - 2 * l)) \<longlonglongrightarrow> 0
[PROOF STEP]
have "(\<lambda>x. f(t+x)) absolutely_integrable_on {-pi..pi}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. f (t + x)) absolutely_integrable_on {- pi..pi}
[PROOF STEP]
using absolutely_integrable_periodic_offset [OF f, of t] periodic
[PROOF STATE]
proof (prove)
using this:
(\<And>x. f (x + (pi - - pi)) = f x) \<Longrightarrow> (\<lambda>x. f (x + t)) absolutely_integrable_on {- pi..pi}
(\<And>x. f (x + (pi - - pi)) = f x) \<Longrightarrow> (\<lambda>x. f (t + x)) absolutely_integrable_on {- pi..pi}
f (?x + 2 * pi) = f ?x

goal (1 subgoal):
 1. (\<lambda>x. f (t + x)) absolutely_integrable_on {- pi..pi}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<lambda>x. f (t + x)) absolutely_integrable_on {- pi..pi}

goal (1 subgoal):
 1. (\<lambda>n. \<Sum>k\<le>n. Fourier_coefficient f k * trigonometric_set k t) \<longlonglongrightarrow> l = (\<lambda>n. LINT x|lebesgue_on {0..d}. Dirichlet_kernel n x * (f (t + x) + f (t - x) - 2 * l)) \<longlonglongrightarrow> 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>x. f (t + x)) absolutely_integrable_on {- pi..pi}
[PROOF STEP]
have int: "(\<lambda>x. f(t+x) - l) absolutely_integrable_on {-pi..pi}"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. f (t + x)) absolutely_integrable_on {- pi..pi}

goal (1 subgoal):
 1. (\<lambda>x. f (t + x) - l) absolutely_integrable_on {- pi..pi}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<lambda>x. f (t + x) - l) absolutely_integrable_on {- pi..pi}

goal (1 subgoal):
 1. (\<lambda>n. \<Sum>k\<le>n. Fourier_coefficient f k * trigonometric_set k t) \<longlonglongrightarrow> l = (\<lambda>n. LINT x|lebesgue_on {0..d}. Dirichlet_kernel n x * (f (t + x) + f (t - x) - 2 * l)) \<longlonglongrightarrow> 0
[PROOF STEP]
have "(\<lambda>n. LINT x|lebesgue_on {0..pi}. Dirichlet_kernel n x * (f(t+x) + f(t-x) - 2*l)) \<longlonglongrightarrow> 0
    \<longleftrightarrow> (\<lambda>n. LINT x|lebesgue_on {0..d}. Dirichlet_kernel n x * (f(t+x) + f(t-x) - 2*l)) \<longlonglongrightarrow> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. LINT x|lebesgue_on {0..pi}. Dirichlet_kernel n x * (f (t + x) + f (t - x) - 2 * l)) \<longlonglongrightarrow> 0 = (\<lambda>n. LINT x|lebesgue_on {0..d}. Dirichlet_kernel n x * (f (t + x) + f (t - x) - 2 * l)) \<longlonglongrightarrow> 0
[PROOF STEP]
by (rule Lim_transform_eq) (use Riemann_localization_integral_range_half [OF int d] in auto)
[PROOF STATE]
proof (state)
this:
(\<lambda>n. LINT x|lebesgue_on {0..pi}. Dirichlet_kernel n x * (f (t + x) + f (t - x) - 2 * l)) \<longlonglongrightarrow> 0 = (\<lambda>n. LINT x|lebesgue_on {0..d}. Dirichlet_kernel n x * (f (t + x) + f (t - x) - 2 * l)) \<longlonglongrightarrow> 0

goal (1 subgoal):
 1. (\<lambda>n. \<Sum>k\<le>n. Fourier_coefficient f k * trigonometric_set k t) \<longlonglongrightarrow> l = (\<lambda>n. LINT x|lebesgue_on {0..d}. Dirichlet_kernel n x * (f (t + x) + f (t - x) - 2 * l)) \<longlonglongrightarrow> 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>n. LINT x|lebesgue_on {0..pi}. Dirichlet_kernel n x * (f (t + x) + f (t - x) - 2 * l)) \<longlonglongrightarrow> 0 = (\<lambda>n. LINT x|lebesgue_on {0..d}. Dirichlet_kernel n x * (f (t + x) + f (t - x) - 2 * l)) \<longlonglongrightarrow> 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. LINT x|lebesgue_on {0..pi}. Dirichlet_kernel n x * (f (t + x) + f (t - x) - 2 * l)) \<longlonglongrightarrow> 0 = (\<lambda>n. LINT x|lebesgue_on {0..d}. Dirichlet_kernel n x * (f (t + x) + f (t - x) - 2 * l)) \<longlonglongrightarrow> 0

goal (1 subgoal):
 1. (\<lambda>n. \<Sum>k\<le>n. Fourier_coefficient f k * trigonometric_set k t) \<longlonglongrightarrow> l = (\<lambda>n. LINT x|lebesgue_on {0..d}. Dirichlet_kernel n x * (f (t + x) + f (t - x) - 2 * l)) \<longlonglongrightarrow> 0
[PROOF STEP]
by (simp add: Fourier_sum_limit_Dirichlet_kernel_half assms)
[PROOF STATE]
proof (state)
this:
(\<lambda>n. \<Sum>k\<le>n. Fourier_coefficient f k * trigonometric_set k t) \<longlonglongrightarrow> l = (\<lambda>n. LINT x|lebesgue_on {0..d}. Dirichlet_kernel n x * (f (t + x) + f (t - x) - 2 * l)) \<longlonglongrightarrow> 0

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma lin_indpt_take_cols_id:
  shows "lin_indpt (set (cols (take_cols (1\<^sub>m n) inds)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lin_indpt (set (cols (take_cols (1\<^sub>m n) inds)))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. lin_indpt (set (cols (take_cols (1\<^sub>m n) inds)))
[PROOF STEP]
have subset_h: "set (cols (take_cols (1\<^sub>m n) inds)) \<subseteq> set (cols (1\<^sub>m n)::'a vec list)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (cols (take_cols (1\<^sub>m n) inds)) \<subseteq> set (cols (1\<^sub>m n))
[PROOF STEP]
using cols_take_cols_subset
[PROOF STATE]
proof (prove)
using this:
set (cols (take_cols ?A ?inds)) \<subseteq> set (cols ?A)

goal (1 subgoal):
 1. set (cols (take_cols (1\<^sub>m n) inds)) \<subseteq> set (cols (1\<^sub>m n))
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
set (cols (take_cols (1\<^sub>m n) inds)) \<subseteq> set (cols (1\<^sub>m n))

goal (1 subgoal):
 1. lin_indpt (set (cols (take_cols (1\<^sub>m n) inds)))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
set (cols (take_cols (1\<^sub>m n) inds)) \<subseteq> set (cols (1\<^sub>m n))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
set (cols (take_cols (1\<^sub>m n) inds)) \<subseteq> set (cols (1\<^sub>m n))

goal (1 subgoal):
 1. lin_indpt (set (cols (take_cols (1\<^sub>m n) inds)))
[PROOF STEP]
using lin_indpt_id subset_li_is_li
[PROOF STATE]
proof (prove)
using this:
set (cols (take_cols (1\<^sub>m n) inds)) \<subseteq> set (cols (1\<^sub>m n))
lin_indpt (set (cols (1\<^sub>m n)))
\<lbrakk>lin_indpt ?A; ?B \<subseteq> ?A\<rbrakk> \<Longrightarrow> lin_indpt ?B

goal (1 subgoal):
 1. lin_indpt (set (cols (take_cols (1\<^sub>m n) inds)))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
lin_indpt (set (cols (take_cols (1\<^sub>m n) inds)))

goal:
No subgoals!
[PROOF STEP]
qed