[STATEMENT]
theorem eval_nnf : "\<forall>\<Gamma>. eval \<phi> \<Gamma> = eval (nnf \<phi>) \<Gamma>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<Gamma>. eval \<phi> \<Gamma> = eval (nnf \<phi>) \<Gamma>
[PROOF STEP]
apply(induction \<phi>)
[PROOF STATE]
proof (prove)
goal (10 subgoals):
 1. \<forall>\<Gamma>. eval TrueF \<Gamma> = eval (nnf TrueF) \<Gamma>
 2. \<forall>\<Gamma>. eval FalseF \<Gamma> = eval (nnf FalseF) \<Gamma>
 3. \<And>x. \<forall>\<Gamma>. eval (fm.Atom x) \<Gamma> = eval (nnf (fm.Atom x)) \<Gamma>
 4. \<And>\<phi>1 \<phi>2. \<lbrakk>\<forall>\<Gamma>. eval \<phi>1 \<Gamma> = eval (nnf \<phi>1) \<Gamma>; \<forall>\<Gamma>. eval \<phi>2 \<Gamma> = eval (nnf \<phi>2) \<Gamma>\<rbrakk> \<Longrightarrow> \<forall>\<Gamma>. eval (And \<phi>1 \<phi>2) \<Gamma> = eval (nnf (And \<phi>1 \<phi>2)) \<Gamma>
 5. \<And>\<phi>1 \<phi>2. \<lbrakk>\<forall>\<Gamma>. eval \<phi>1 \<Gamma> = eval (nnf \<phi>1) \<Gamma>; \<forall>\<Gamma>. eval \<phi>2 \<Gamma> = eval (nnf \<phi>2) \<Gamma>\<rbrakk> \<Longrightarrow> \<forall>\<Gamma>. eval (Or \<phi>1 \<phi>2) \<Gamma> = eval (nnf (Or \<phi>1 \<phi>2)) \<Gamma>
 6. \<And>\<phi>. \<forall>\<Gamma>. eval \<phi> \<Gamma> = eval (nnf \<phi>) \<Gamma> \<Longrightarrow> \<forall>\<Gamma>. eval (Neg \<phi>) \<Gamma> = eval (nnf (Neg \<phi>)) \<Gamma>
 7. \<And>\<phi>. \<forall>\<Gamma>. eval \<phi> \<Gamma> = eval (nnf \<phi>) \<Gamma> \<Longrightarrow> \<forall>\<Gamma>. eval (ExQ \<phi>) \<Gamma> = eval (nnf (ExQ \<phi>)) \<Gamma>
 8. \<And>\<phi>. \<forall>\<Gamma>. eval \<phi> \<Gamma> = eval (nnf \<phi>) \<Gamma> \<Longrightarrow> \<forall>\<Gamma>. eval (AllQ \<phi>) \<Gamma> = eval (nnf (AllQ \<phi>)) \<Gamma>
 9. \<And>x1 \<phi>. \<forall>\<Gamma>. eval \<phi> \<Gamma> = eval (nnf \<phi>) \<Gamma> \<Longrightarrow> \<forall>\<Gamma>. eval (ExN x1 \<phi>) \<Gamma> = eval (nnf (ExN x1 \<phi>)) \<Gamma>
 10. \<And>x1 \<phi>. \<forall>\<Gamma>. eval \<phi> \<Gamma> = eval (nnf \<phi>) \<Gamma> \<Longrightarrow> \<forall>\<Gamma>. eval (AllN x1 \<phi>) \<Gamma> = eval (nnf (AllN x1 \<phi>)) \<Gamma>
[PROOF STEP]
apply(simp_all)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>\<phi>. \<forall>\<Gamma>. eval \<phi> \<Gamma> = eval (nnf \<phi>) \<Gamma> \<Longrightarrow> \<forall>\<Gamma>. (\<not> eval (nnf \<phi>) \<Gamma>) = eval (nnf (Neg \<phi>)) \<Gamma>
[PROOF STEP]
using neg_nnf
[PROOF STATE]
proof (prove)
using this:
\<forall>\<Gamma>. (\<not> eval (nnf (Neg ?\<phi>)) \<Gamma>) = eval (nnf ?\<phi>) \<Gamma>

goal (1 subgoal):
 1. \<And>\<phi>. \<forall>\<Gamma>. eval \<phi> \<Gamma> = eval (nnf \<phi>) \<Gamma> \<Longrightarrow> \<forall>\<Gamma>. (\<not> eval (nnf \<phi>) \<Gamma>) = eval (nnf (Neg \<phi>)) \<Gamma>
[PROOF STEP]
by blast


[STATEMENT]
lemma t_bound: "t \<le> 81 / (real_of_rat \<delta>)\<^sup>2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real t \<le> 81 / (real_of_rat \<delta>)\<^sup>2
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. real t \<le> 81 / (real_of_rat \<delta>)\<^sup>2
[PROOF STEP]
have "t \<le> 80 / (real_of_rat \<delta>)\<^sup>2 + 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real t \<le> 80 / (real_of_rat \<delta>)\<^sup>2 + 1
[PROOF STEP]
using t_def t_gt_0
[PROOF STATE]
proof (prove)
using this:
t = nat \<lceil>80 / (real_of_rat \<delta>)\<^sup>2\<rceil>
0 < t

goal (1 subgoal):
 1. real t \<le> 80 / (real_of_rat \<delta>)\<^sup>2 + 1
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
real t \<le> 80 / (real_of_rat \<delta>)\<^sup>2 + 1

goal (1 subgoal):
 1. real t \<le> 81 / (real_of_rat \<delta>)\<^sup>2
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
real t \<le> 80 / (real_of_rat \<delta>)\<^sup>2 + 1

goal (1 subgoal):
 1. real t \<le> 81 / (real_of_rat \<delta>)\<^sup>2
[PROOF STEP]
have "... \<le> 80 / (real_of_rat \<delta>)\<^sup>2 + 1 /  (real_of_rat \<delta>)\<^sup>2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 80 / (real_of_rat \<delta>)\<^sup>2 + 1 \<le> 80 / (real_of_rat \<delta>)\<^sup>2 + 1 / (real_of_rat \<delta>)\<^sup>2
[PROOF STEP]
using \<delta>_range
[PROOF STATE]
proof (prove)
using this:
\<delta> \<in> {0<..<1}

goal (1 subgoal):
 1. 80 / (real_of_rat \<delta>)\<^sup>2 + 1 \<le> 80 / (real_of_rat \<delta>)\<^sup>2 + 1 / (real_of_rat \<delta>)\<^sup>2
[PROOF STEP]
by (intro add_mono, simp, simp add:power_le_one)
[PROOF STATE]
proof (state)
this:
80 / (real_of_rat \<delta>)\<^sup>2 + 1 \<le> 80 / (real_of_rat \<delta>)\<^sup>2 + 1 / (real_of_rat \<delta>)\<^sup>2

goal (1 subgoal):
 1. real t \<le> 81 / (real_of_rat \<delta>)\<^sup>2
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
80 / (real_of_rat \<delta>)\<^sup>2 + 1 \<le> 80 / (real_of_rat \<delta>)\<^sup>2 + 1 / (real_of_rat \<delta>)\<^sup>2

goal (1 subgoal):
 1. real t \<le> 81 / (real_of_rat \<delta>)\<^sup>2
[PROOF STEP]
have "... = 81 / (real_of_rat \<delta>)\<^sup>2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 80 / (real_of_rat \<delta>)\<^sup>2 + 1 / (real_of_rat \<delta>)\<^sup>2 = 81 / (real_of_rat \<delta>)\<^sup>2
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
80 / (real_of_rat \<delta>)\<^sup>2 + 1 / (real_of_rat \<delta>)\<^sup>2 = 81 / (real_of_rat \<delta>)\<^sup>2

goal (1 subgoal):
 1. real t \<le> 81 / (real_of_rat \<delta>)\<^sup>2
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
real t \<le> 81 / (real_of_rat \<delta>)\<^sup>2
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
real t \<le> 81 / (real_of_rat \<delta>)\<^sup>2

goal (1 subgoal):
 1. real t \<le> 81 / (real_of_rat \<delta>)\<^sup>2
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
real t \<le> 81 / (real_of_rat \<delta>)\<^sup>2

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma AE_pmfI: "(\<And>y. y \<in> set_pmf M \<Longrightarrow> P y) \<Longrightarrow> almost_everywhere (measure_pmf M) P"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>y. y \<in> set_pmf M \<Longrightarrow> P y) \<Longrightarrow> almost_everywhere (measure_pmf M) P
[PROOF STEP]
by(simp add: AE_measure_pmf_iff)


[STATEMENT]
theorem Polygamma_plus1:
  assumes "z \<noteq> 0"
  shows   "Polygamma n (z + 1) = Polygamma n z + (-1)^n * fact n / (z ^ Suc n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Polygamma n (z + (1::'a)) = Polygamma n z + (- (1::'a)) ^ n * fact n / z ^ Suc n
[PROOF STEP]
proof (cases "n = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. n = 0 \<Longrightarrow> Polygamma n (z + (1::'a)) = Polygamma n z + (- (1::'a)) ^ n * fact n / z ^ Suc n
 2. n \<noteq> 0 \<Longrightarrow> Polygamma n (z + (1::'a)) = Polygamma n z + (- (1::'a)) ^ n * fact n / z ^ Suc n
[PROOF STEP]
assume n: "n \<noteq> 0"
[PROOF STATE]
proof (state)
this:
n \<noteq> 0

goal (2 subgoals):
 1. n = 0 \<Longrightarrow> Polygamma n (z + (1::'a)) = Polygamma n z + (- (1::'a)) ^ n * fact n / z ^ Suc n
 2. n \<noteq> 0 \<Longrightarrow> Polygamma n (z + (1::'a)) = Polygamma n z + (- (1::'a)) ^ n * fact n / z ^ Suc n
[PROOF STEP]
let ?f = "\<lambda>k. inverse ((z + of_nat k) ^ Suc n)"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. n = 0 \<Longrightarrow> Polygamma n (z + (1::'a)) = Polygamma n z + (- (1::'a)) ^ n * fact n / z ^ Suc n
 2. n \<noteq> 0 \<Longrightarrow> Polygamma n (z + (1::'a)) = Polygamma n z + (- (1::'a)) ^ n * fact n / z ^ Suc n
[PROOF STEP]
have "Polygamma n (z + 1) = (-1) ^ Suc n * fact n * (\<Sum>k. ?f (k+1))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Polygamma n (z + (1::'a)) = (- (1::'a)) ^ Suc n * fact n * (\<Sum>k. inverse ((z + of_nat (k + 1)) ^ Suc n))
[PROOF STEP]
using n
[PROOF STATE]
proof (prove)
using this:
n \<noteq> 0

goal (1 subgoal):
 1. Polygamma n (z + (1::'a)) = (- (1::'a)) ^ Suc n * fact n * (\<Sum>k. inverse ((z + of_nat (k + 1)) ^ Suc n))
[PROOF STEP]
by (simp add: Polygamma_def add_ac)
[PROOF STATE]
proof (state)
this:
Polygamma n (z + (1::'a)) = (- (1::'a)) ^ Suc n * fact n * (\<Sum>k. inverse ((z + of_nat (k + 1)) ^ Suc n))

goal (2 subgoals):
 1. n = 0 \<Longrightarrow> Polygamma n (z + (1::'a)) = Polygamma n z + (- (1::'a)) ^ n * fact n / z ^ Suc n
 2. n \<noteq> 0 \<Longrightarrow> Polygamma n (z + (1::'a)) = Polygamma n z + (- (1::'a)) ^ n * fact n / z ^ Suc n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
Polygamma n (z + (1::'a)) = (- (1::'a)) ^ Suc n * fact n * (\<Sum>k. inverse ((z + of_nat (k + 1)) ^ Suc n))

goal (2 subgoals):
 1. n = 0 \<Longrightarrow> Polygamma n (z + (1::'a)) = Polygamma n z + (- (1::'a)) ^ n * fact n / z ^ Suc n
 2. n \<noteq> 0 \<Longrightarrow> Polygamma n (z + (1::'a)) = Polygamma n z + (- (1::'a)) ^ n * fact n / z ^ Suc n
[PROOF STEP]
have "(\<Sum>k. ?f (k+1)) + (\<Sum>k<1. ?f k) = (\<Sum>k. ?f k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>k. inverse ((z + of_nat (k + 1)) ^ Suc n)) + (\<Sum>k<1. inverse ((z + of_nat k) ^ Suc n)) = (\<Sum>k. inverse ((z + of_nat k) ^ Suc n))
[PROOF STEP]
using Polygamma_converges'[OF assms, of "Suc n"] n
[PROOF STATE]
proof (prove)
using this:
2 \<le> Suc n \<Longrightarrow> summable (\<lambda>k. inverse ((z + of_nat k) ^ Suc n))
n \<noteq> 0

goal (1 subgoal):
 1. (\<Sum>k. inverse ((z + of_nat (k + 1)) ^ Suc n)) + (\<Sum>k<1. inverse ((z + of_nat k) ^ Suc n)) = (\<Sum>k. inverse ((z + of_nat k) ^ Suc n))
[PROOF STEP]
by (subst suminf_split_initial_segment [symmetric]) simp_all
[PROOF STATE]
proof (state)
this:
(\<Sum>k. inverse ((z + of_nat (k + 1)) ^ Suc n)) + (\<Sum>k<1. inverse ((z + of_nat k) ^ Suc n)) = (\<Sum>k. inverse ((z + of_nat k) ^ Suc n))

goal (2 subgoals):
 1. n = 0 \<Longrightarrow> Polygamma n (z + (1::'a)) = Polygamma n z + (- (1::'a)) ^ n * fact n / z ^ Suc n
 2. n \<noteq> 0 \<Longrightarrow> Polygamma n (z + (1::'a)) = Polygamma n z + (- (1::'a)) ^ n * fact n / z ^ Suc n
[PROOF STEP]
hence "(\<Sum>k. ?f (k+1)) = (\<Sum>k. ?f k) - inverse (z ^ Suc n)"
[PROOF STATE]
proof (prove)
using this:
(\<Sum>k. inverse ((z + of_nat (k + 1)) ^ Suc n)) + (\<Sum>k<1. inverse ((z + of_nat k) ^ Suc n)) = (\<Sum>k. inverse ((z + of_nat k) ^ Suc n))

goal (1 subgoal):
 1. (\<Sum>k. inverse ((z + of_nat (k + 1)) ^ Suc n)) = (\<Sum>k. inverse ((z + of_nat k) ^ Suc n)) - inverse (z ^ Suc n)
[PROOF STEP]
by (simp add: algebra_simps)
[PROOF STATE]
proof (state)
this:
(\<Sum>k. inverse ((z + of_nat (k + 1)) ^ Suc n)) = (\<Sum>k. inverse ((z + of_nat k) ^ Suc n)) - inverse (z ^ Suc n)

goal (2 subgoals):
 1. n = 0 \<Longrightarrow> Polygamma n (z + (1::'a)) = Polygamma n z + (- (1::'a)) ^ n * fact n / z ^ Suc n
 2. n \<noteq> 0 \<Longrightarrow> Polygamma n (z + (1::'a)) = Polygamma n z + (- (1::'a)) ^ n * fact n / z ^ Suc n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>k. inverse ((z + of_nat (k + 1)) ^ Suc n)) = (\<Sum>k. inverse ((z + of_nat k) ^ Suc n)) - inverse (z ^ Suc n)

goal (2 subgoals):
 1. n = 0 \<Longrightarrow> Polygamma n (z + (1::'a)) = Polygamma n z + (- (1::'a)) ^ n * fact n / z ^ Suc n
 2. n \<noteq> 0 \<Longrightarrow> Polygamma n (z + (1::'a)) = Polygamma n z + (- (1::'a)) ^ n * fact n / z ^ Suc n
[PROOF STEP]
have "(-1) ^ Suc n * fact n * ((\<Sum>k. ?f k) - inverse (z ^ Suc n)) =
               Polygamma n z + (-1)^n * fact n / (z ^ Suc n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (- (1::'a)) ^ Suc n * fact n * ((\<Sum>k. inverse ((z + of_nat k) ^ Suc n)) - inverse (z ^ Suc n)) = Polygamma n z + (- (1::'a)) ^ n * fact n / z ^ Suc n
[PROOF STEP]
using n
[PROOF STATE]
proof (prove)
using this:
n \<noteq> 0

goal (1 subgoal):
 1. (- (1::'a)) ^ Suc n * fact n * ((\<Sum>k. inverse ((z + of_nat k) ^ Suc n)) - inverse (z ^ Suc n)) = Polygamma n z + (- (1::'a)) ^ n * fact n / z ^ Suc n
[PROOF STEP]
by (simp add: inverse_eq_divide algebra_simps Polygamma_def)
[PROOF STATE]
proof (state)
this:
(- (1::'a)) ^ Suc n * fact n * ((\<Sum>k. inverse ((z + of_nat k) ^ Suc n)) - inverse (z ^ Suc n)) = Polygamma n z + (- (1::'a)) ^ n * fact n / z ^ Suc n

goal (2 subgoals):
 1. n = 0 \<Longrightarrow> Polygamma n (z + (1::'a)) = Polygamma n z + (- (1::'a)) ^ n * fact n / z ^ Suc n
 2. n \<noteq> 0 \<Longrightarrow> Polygamma n (z + (1::'a)) = Polygamma n z + (- (1::'a)) ^ n * fact n / z ^ Suc n
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
Polygamma n (z + (1::'a)) = Polygamma n z + (- (1::'a)) ^ n * fact n / z ^ Suc n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
Polygamma n (z + (1::'a)) = Polygamma n z + (- (1::'a)) ^ n * fact n / z ^ Suc n

goal (1 subgoal):
 1. Polygamma n (z + (1::'a)) = Polygamma n z + (- (1::'a)) ^ n * fact n / z ^ Suc n
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
Polygamma n (z + (1::'a)) = Polygamma n z + (- (1::'a)) ^ n * fact n / z ^ Suc n

goal (1 subgoal):
 1. n = 0 \<Longrightarrow> Polygamma n (z + (1::'a)) = Polygamma n z + (- (1::'a)) ^ n * fact n / z ^ Suc n
[PROOF STEP]
qed (insert assms, simp add: Digamma_plus1 inverse_eq_divide)


[STATEMENT]
lemma st_1 [simp]: "st 1 = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. st 1 = 1
[PROOF STEP]
by (simp add: st_SReal_eq)


[STATEMENT]
lemma permutes_inv:
  assumes "p permutes S"
  shows "inv p permutes S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inv p permutes S
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
p permutes S

goal (1 subgoal):
 1. inv p permutes S
[PROOF STEP]
unfolding permutes_def permutes_inv_eq[OF assms]
[PROOF STATE]
proof (prove)
using this:
(\<forall>x. x \<notin> S \<longrightarrow> p x = x) \<and> (\<forall>y. \<exists>!x. p x = y)

goal (1 subgoal):
 1. (\<forall>x. x \<notin> S \<longrightarrow> p x = x) \<and> (\<forall>y. \<exists>!x. p y = x)
[PROOF STEP]
by metis


[STATEMENT]
lemma optimize_matches_append: "optimize_matches f (rs1@rs2) = optimize_matches f rs1 @ optimize_matches f rs2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. optimize_matches f (rs1 @ rs2) = optimize_matches f rs1 @ optimize_matches f rs2
[PROOF STEP]
by(simp add: optimize_matches_def optimize_matches_option_append)


[STATEMENT]
lemma has_derivative_transform_within_open:
  assumes "(f has_derivative f') (at x within t)"
    and "open s"
    and "x \<in> s"
    and "\<And>x. x\<in>s \<Longrightarrow> f x = g x"
  shows "(g has_derivative f') (at x within t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (g has_derivative f') (at x within t)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
(f has_derivative f') (at x within t)
open s
x \<in> s
?x \<in> s \<Longrightarrow> f ?x = g ?x

goal (1 subgoal):
 1. (g has_derivative f') (at x within t)
[PROOF STEP]
unfolding has_derivative_within
[PROOF STATE]
proof (prove)
using this:
bounded_linear f' \<and> ((\<lambda>y. (1 / norm (y - x)) *\<^sub>R (f y - (f x + f' (y - x)))) \<longlongrightarrow> (0::'b)) (at x within t)
open s
x \<in> s
?x \<in> s \<Longrightarrow> f ?x = g ?x

goal (1 subgoal):
 1. bounded_linear f' \<and> ((\<lambda>y. (1 / norm (y - x)) *\<^sub>R (g y - (g x + f' (y - x)))) \<longlongrightarrow> (0::'b)) (at x within t)
[PROOF STEP]
by (force simp add: intro: Lim_transform_within_open)


[STATEMENT]
lemma Ngt0_iff[simp]:
  assumes nx: "isnormNum x"
  shows "((INum x :: 'a::{field_char_0,linordered_field}) > 0) = 0<\<^sub>N x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((0::'a) < INum x) = 0<\<^sub>N x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ((0::'a) < INum x) = 0<\<^sub>N x
[PROOF STEP]
obtain a b where x: "x = (a, b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>a b. x = (a, b) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (cases x)
[PROOF STATE]
proof (state)
this:
x = (a, b)

goal (1 subgoal):
 1. ((0::'a) < INum x) = 0<\<^sub>N x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((0::'a) < INum x) = 0<\<^sub>N x
[PROOF STEP]
proof (cases "a = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. a = 0 \<Longrightarrow> ((0::'a) < INum x) = 0<\<^sub>N x
 2. a \<noteq> 0 \<Longrightarrow> ((0::'a) < INum x) = 0<\<^sub>N x
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
a = 0

goal (2 subgoals):
 1. a = 0 \<Longrightarrow> ((0::'a) < INum x) = 0<\<^sub>N x
 2. a \<noteq> 0 \<Longrightarrow> ((0::'a) < INum x) = 0<\<^sub>N x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a = 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
a = 0

goal (1 subgoal):
 1. ((0::'a) < INum x) = 0<\<^sub>N x
[PROOF STEP]
by (simp add: x Ngt0_def INum_def)
[PROOF STATE]
proof (state)
this:
((0::'a) < INum x) = 0<\<^sub>N x

goal (1 subgoal):
 1. a \<noteq> 0 \<Longrightarrow> ((0::'a) < INum x) = 0<\<^sub>N x
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. a \<noteq> 0 \<Longrightarrow> ((0::'a) < INum x) = 0<\<^sub>N x
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
a \<noteq> 0

goal (1 subgoal):
 1. a \<noteq> 0 \<Longrightarrow> ((0::'a) < INum x) = 0<\<^sub>N x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a \<noteq> 0
[PROOF STEP]
have b: "(of_int b::'a) > 0"
[PROOF STATE]
proof (prove)
using this:
a \<noteq> 0

goal (1 subgoal):
 1. (0::'a) < of_int b
[PROOF STEP]
using nx
[PROOF STATE]
proof (prove)
using this:
a \<noteq> 0
isnormNum x

goal (1 subgoal):
 1. (0::'a) < of_int b
[PROOF STEP]
by (simp add: x isnormNum_def)
[PROOF STATE]
proof (state)
this:
(0::'a) < of_int b

goal (1 subgoal):
 1. a \<noteq> 0 \<Longrightarrow> ((0::'a) < INum x) = 0<\<^sub>N x
[PROOF STEP]
from pos_less_divide_eq[OF b, where b="of_int a" and a="0::'a"]
[PROOF STATE]
proof (chain)
picking this:
((0::'a) < of_int a / of_int b) = ((0::'a) * of_int b < of_int a)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
((0::'a) < of_int a / of_int b) = ((0::'a) * of_int b < of_int a)

goal (1 subgoal):
 1. ((0::'a) < INum x) = 0<\<^sub>N x
[PROOF STEP]
by (simp add: x Ngt0_def INum_def)
[PROOF STATE]
proof (state)
this:
((0::'a) < INum x) = 0<\<^sub>N x

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
((0::'a) < INum x) = 0<\<^sub>N x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma T2I:
  fixes T (structure) assumes "topology T"
  assumes I: "\<And>x y. \<lbrakk> x \<in> carrier; y \<in> carrier; x \<noteq> y \<rbrakk> \<Longrightarrow>
           \<exists> u \<in> nhds x. \<exists> v \<in> nhds y. u \<inter> v = {}"
  shows "T2 T"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. T2 T
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. T2 T
[PROOF STEP]
interpret topology T
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. topology T
[PROOF STEP]
by fact
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. T2 T
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. T2 T
[PROOF STEP]
apply intro_locales
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. T0_axioms T
 2. T1_axioms T
 3. T2_axioms T
[PROOF STEP]
apply (rule T2_axiom_implies_T0_axiom)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<forall>x\<in>carrier. \<forall>y\<in>carrier. x \<noteq> y \<longrightarrow> (\<exists>u\<in>nhds x. \<exists>v\<in>nhds y. u \<inter> v = {})
 2. T1_axioms T
 3. T2_axioms T
[PROOF STEP]
using I
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?x \<in> carrier; ?y \<in> carrier; ?x \<noteq> ?y\<rbrakk> \<Longrightarrow> \<exists>u\<in>nhds ?x. \<exists>v\<in>nhds ?y. u \<inter> v = {}

goal (3 subgoals):
 1. \<forall>x\<in>carrier. \<forall>y\<in>carrier. x \<noteq> y \<longrightarrow> (\<exists>u\<in>nhds x. \<exists>v\<in>nhds y. u \<inter> v = {})
 2. T1_axioms T
 3. T2_axioms T
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. T1_axioms T
 2. T2_axioms T
[PROOF STEP]
apply (rule T2_axiom_implies_T1_axiom)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<forall>x\<in>carrier. \<forall>y\<in>carrier. x \<noteq> y \<longrightarrow> (\<exists>u\<in>nhds x. \<exists>v\<in>nhds y. u \<inter> v = {})
 2. T2_axioms T
[PROOF STEP]
using I
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?x \<in> carrier; ?y \<in> carrier; ?x \<noteq> ?y\<rbrakk> \<Longrightarrow> \<exists>u\<in>nhds ?x. \<exists>v\<in>nhds ?y. u \<inter> v = {}

goal (2 subgoals):
 1. \<forall>x\<in>carrier. \<forall>y\<in>carrier. x \<noteq> y \<longrightarrow> (\<exists>u\<in>nhds x. \<exists>v\<in>nhds y. u \<inter> v = {})
 2. T2_axioms T
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. T2_axioms T
[PROOF STEP]
apply unfold_locales
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>carrier. \<forall>y\<in>carrier. x \<noteq> y \<longrightarrow> (\<exists>u\<in>nhds x. \<exists>v\<in>nhds y. u \<inter> v = {})
[PROOF STEP]
using I
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?x \<in> carrier; ?y \<in> carrier; ?x \<noteq> ?y\<rbrakk> \<Longrightarrow> \<exists>u\<in>nhds ?x. \<exists>v\<in>nhds ?y. u \<inter> v = {}

goal (1 subgoal):
 1. \<forall>x\<in>carrier. \<forall>y\<in>carrier. x \<noteq> y \<longrightarrow> (\<exists>u\<in>nhds x. \<exists>v\<in>nhds y. u \<inter> v = {})
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
T2 T

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma scalar_coeff: "a \<in> carrier R \<Longrightarrow> coeff (map (\<lambda>b. a \<otimes> b) p) = (\<lambda>i. a \<otimes> (coeff p) i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<in> carrier R \<Longrightarrow> local.coeff (map ((\<otimes>) a) p) = (\<lambda>i. a \<otimes> local.coeff p i)
[PROOF STEP]
by (induction p) (auto)


[STATEMENT]
lemma einterpret_mmult_fa:
  assumes [simp]: "Dn = CARD('n::enum)" "Dm = CARD('m::enum)" "Dl = CARD('l::enum)"
    "length A = CARD('l)*CARD('m)" "length B = CARD('m)*CARD('n)"
  shows "einterpret (mmult_fa Dl Dm Dn A B) vs = (einterpret A vs::((real, 'm::enum) vec, 'l) vec) ** (einterpret B vs::((real, 'n::enum) vec, 'm) vec)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. einterpret (mmult_fa Dl Dm Dn A B) vs = einterpret A vs ** einterpret B vs
[PROOF STEP]
apply (vector matrix_matrix_mult_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>i ia. einterpret (mmult_fa Dl Dm Dn A B) vs $ i $ ia = (\<Sum>k\<in>UNIV. einterpret A vs $ i $ k * einterpret B vs $ k $ ia)
[PROOF STEP]
apply (auto simp: mmult_fa_def vec_nth_eucl_of_list_eq2 index_Basis_list_axis2
      concat_map_map_index length_concat o_def sum_list_distinct_conv_sum_set
      interpret_floatarith_inner_eq)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i ia. (\<Sum>ib<CARD('m). interpret_floatarith (A ! (index enum_class.enum i * CARD('m) + ib)) vs * interpret_floatarith (B ! (ib * CARD('n) + index enum_class.enum ia)) vs) = (\<Sum>k\<in>UNIV. interpret_floatarith (A ! (index enum_class.enum i * CARD('m) + index enum_class.enum k)) vs * interpret_floatarith (B ! (index enum_class.enum k * CARD('n) + index enum_class.enum ia)) vs)
[PROOF STEP]
apply (subst sum_index_enum_eq)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i ia. (\<Sum>ib<CARD('m). interpret_floatarith (A ! (index enum_class.enum i * CARD('m) + ib)) vs * interpret_floatarith (B ! (ib * CARD('n) + index enum_class.enum ia)) vs) = (\<Sum>ib<CARD('m). interpret_floatarith (A ! (index enum_class.enum i * CARD('m) + ib)) vs * interpret_floatarith (B ! (ib * CARD('n) + index enum_class.enum ia)) vs)
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma UINF_insert [simp]: "(\<Sqinter> i\<in>insert x xs \<bullet> P(i)) = (P(x) \<sqinter> (\<Sqinter> i\<in>xs \<bullet> P(i)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sqinter> i \<in> insert x xs \<bullet> P i) = P x \<sqinter> (\<Sqinter> i \<in> xs \<bullet> P i)
[PROOF STEP]
apply (pred_simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>b. \<Sqinter>{uu_. \<exists>xa. uu_ = \<lbrakk>P xa\<rbrakk>\<^sub>e b \<and> (xa = x \<or> xa \<in> xs)} = \<lbrakk>P x\<rbrakk>\<^sub>e b \<sqinter> \<Sqinter>{uu_. \<exists>x. uu_ = \<lbrakk>P x\<rbrakk>\<^sub>e b \<and> x \<in> xs}
[PROOF STEP]
apply (subst Sup_insert[THEN sym])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>b. \<Sqinter>{uu_. \<exists>xa. uu_ = \<lbrakk>P xa\<rbrakk>\<^sub>e b \<and> (xa = x \<or> xa \<in> xs)} = \<Sqinter>insert (\<lbrakk>P x\<rbrakk>\<^sub>e b) {uu_. \<exists>x. uu_ = \<lbrakk>P x\<rbrakk>\<^sub>e b \<and> x \<in> xs}
[PROOF STEP]
apply (rule_tac cong[of Sup Sup])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>b. Sup = Sup
 2. \<And>b. {uu_. \<exists>xa. uu_ = \<lbrakk>P xa\<rbrakk>\<^sub>e b \<and> (xa = x \<or> xa \<in> xs)} = insert (\<lbrakk>P x\<rbrakk>\<^sub>e b) {uu_. \<exists>x. uu_ = \<lbrakk>P x\<rbrakk>\<^sub>e b \<and> x \<in> xs}
[PROOF STEP]
apply (auto)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma plus_in_intervalI:
  fixes x y :: "'a :: ordered_ab_semigroup_add"
  shows "x \<in>\<^sub>i X \<Longrightarrow> y \<in>\<^sub>i Y \<Longrightarrow> x + y \<in>\<^sub>i X + Y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<in>\<^sub>i X; y \<in>\<^sub>i Y\<rbrakk> \<Longrightarrow> x + y \<in>\<^sub>i X + Y
[PROOF STEP]
by (simp add: add_mono_thms_linordered_semiring(1) set_of_eq)


[STATEMENT]
lemma
  unity_root_k_0 [simp]: "unity_root k 0 = 1" and
  unity_root_0_n [simp]: "unity_root 0 n = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. unity_root k 0 = 1 &&& unity_root 0 n = 1
[PROOF STEP]
unfolding unity_root_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cis (2 * pi * real_of_int 0 / real k) = 1 &&& cis (2 * pi * real_of_int n / real 0) = 1
[PROOF STEP]
by simp+


[STATEMENT]
lemma vars_minus_Var_subset:
  \<open>vars (p' - Var x :: 'a :: {ab_group_add,one,zero_neq_one} mpoly) \<subseteq>  \<V> \<Longrightarrow> vars p' \<subseteq> insert x \<V>\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vars (p' - Var x) \<subseteq> \<V> \<Longrightarrow> vars p' \<subseteq> insert x \<V>
[PROOF STEP]
using vars_add[of \<open>p' - Var x\<close> \<open>Var x\<close>]
[PROOF STATE]
proof (prove)
using this:
vars (p' - Var x + Var x) \<subseteq> vars (p' - Var x) \<union> vars (Var x)

goal (1 subgoal):
 1. vars (p' - Var x) \<subseteq> \<V> \<Longrightarrow> vars p' \<subseteq> insert x \<V>
[PROOF STEP]
by auto


[STATEMENT]
lemma pairwise_orthogonal_insert:
  assumes "pairwise orthogonal S"
  and "\<And>y. y \<in> S \<Longrightarrow> orthogonal x y"
  shows "pairwise orthogonal (insert x S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pairwise orthogonal (insert x S)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
pairwise orthogonal S
?y \<in> S \<Longrightarrow> orthogonal x ?y

goal (1 subgoal):
 1. pairwise orthogonal (insert x S)
[PROOF STEP]
unfolding pairwise_def
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>S. \<forall>y\<in>S. x \<noteq> y \<longrightarrow> orthogonal x y
?y \<in> S \<Longrightarrow> orthogonal x ?y

goal (1 subgoal):
 1. \<forall>xa\<in>insert x S. \<forall>y\<in>insert x S. xa \<noteq> y \<longrightarrow> orthogonal xa y
[PROOF STEP]
by (auto simp add: orthogonal_commute)


[STATEMENT]
theorem weak_distributivity1:
 "weak_matrix_match A1 A2 B1
  \<Longrightarrow> ((rat_poly.matrix_mult A1  A2)\<otimes> B1)
               = (rat_poly.matrix_mult (A1 \<otimes> B1) (A2))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. weak_matrix_match A1 A2 B1 \<Longrightarrow> rat_poly.matrix_mult A1 A2 \<otimes> B1 = rat_poly.matrix_mult (A1 \<otimes> B1) A2
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. weak_matrix_match A1 A2 B1 \<Longrightarrow> rat_poly.matrix_mult A1 A2 \<otimes> B1 = rat_poly.matrix_mult (A1 \<otimes> B1) A2
[PROOF STEP]
assume assms:"weak_matrix_match A1 A2 B1"
[PROOF STATE]
proof (state)
this:
weak_matrix_match A1 A2 B1

goal (1 subgoal):
 1. weak_matrix_match A1 A2 B1 \<Longrightarrow> rat_poly.matrix_mult A1 A2 \<otimes> B1 = rat_poly.matrix_mult (A1 \<otimes> B1) A2
[PROOF STEP]
have 1:"length B1 = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length B1 = 1
[PROOF STEP]
using assms weak_matrix_match_def
[PROOF STATE]
proof (prove)
using this:
weak_matrix_match A1 A2 B1
weak_matrix_match ?A1.0 ?A2.0 ?B1.0 \<equiv> mat (rat_poly.row_length ?A1.0) (length ?A1.0) ?A1.0 \<and> mat (rat_poly.row_length ?A2.0) (length ?A2.0) ?A2.0 \<and> mat (rat_poly.row_length ?B1.0) 1 ?B1.0 \<and> ?A1.0 \<noteq> [] \<and> ?A2.0 \<noteq> [] \<and> ?B1.0 \<noteq> [] \<and> length ?A1.0 = rat_poly.row_length ?A2.0

goal (1 subgoal):
 1. length B1 = 1
[PROOF STEP]
by (metis rat_poly.matrix_row_length rat_poly.unique_row_col(2))
[PROOF STATE]
proof (state)
this:
length B1 = 1

goal (1 subgoal):
 1. weak_matrix_match A1 A2 B1 \<Longrightarrow> rat_poly.matrix_mult A1 A2 \<otimes> B1 = rat_poly.matrix_mult (A1 \<otimes> B1) A2
[PROOF STEP]
have "[[1]] \<noteq> []"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [[1::'a]] \<noteq> []
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
[[1::?'a1]] \<noteq> []

goal (1 subgoal):
 1. weak_matrix_match A1 A2 B1 \<Longrightarrow> rat_poly.matrix_mult A1 A2 \<otimes> B1 = rat_poly.matrix_mult (A1 \<otimes> B1) A2
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
[[1::?'a1]] \<noteq> []

goal (1 subgoal):
 1. weak_matrix_match A1 A2 B1 \<Longrightarrow> rat_poly.matrix_mult A1 A2 \<otimes> B1 = rat_poly.matrix_mult (A1 \<otimes> B1) A2
[PROOF STEP]
have "mat 1 1 [[1]]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat 1 1 [[1::'a]]
[PROOF STEP]
unfolding mat_def Ball_def vec_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length [[1::'a]] = 1 \<and> (\<forall>x. x \<in> set [[1::'a]] \<longrightarrow> length x = 1)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
mat 1 1 [[1::?'a2]]

goal (1 subgoal):
 1. weak_matrix_match A1 A2 B1 \<Longrightarrow> rat_poly.matrix_mult A1 A2 \<otimes> B1 = rat_poly.matrix_mult (A1 \<otimes> B1) A2
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
mat 1 1 [[1::?'a2]]

goal (1 subgoal):
 1. weak_matrix_match A1 A2 B1 \<Longrightarrow> rat_poly.matrix_mult A1 A2 \<otimes> B1 = rat_poly.matrix_mult (A1 \<otimes> B1) A2
[PROOF STEP]
have "rat_poly.row_length [[1]] = length B1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rat_poly.row_length [[1]] = length B1
[PROOF STEP]
unfolding rat_poly.row_length_def 1
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if [[1]] = [] then 0 else length (hd [[1]])) = 1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
rat_poly.row_length [[1]] = length B1

goal (1 subgoal):
 1. weak_matrix_match A1 A2 B1 \<Longrightarrow> rat_poly.matrix_mult A1 A2 \<otimes> B1 = rat_poly.matrix_mult (A1 \<otimes> B1) A2
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
[[1::?'a1]] \<noteq> []
mat 1 1 [[1::?'a2]]
rat_poly.row_length [[1]] = length B1
[PROOF STEP]
have "rat_poly.matrix_match A1 A2 B1 [[1]]"
[PROOF STATE]
proof (prove)
using this:
[[1::?'a1]] \<noteq> []
mat 1 1 [[1::?'a2]]
rat_poly.row_length [[1]] = length B1

goal (1 subgoal):
 1. rat_poly.matrix_match A1 A2 B1 [[1]]
[PROOF STEP]
unfolding rat_poly.matrix_match_def
[PROOF STATE]
proof (prove)
using this:
[[1::?'a1]] \<noteq> []
mat 1 1 [[1::?'a2]]
rat_poly.row_length [[1]] = length B1

goal (1 subgoal):
 1. mat (rat_poly.row_length A1) (length A1) A1 \<and> mat (rat_poly.row_length A2) (length A2) A2 \<and> mat (rat_poly.row_length B1) (length B1) B1 \<and> mat (rat_poly.row_length [[1]]) (length [[1]]) [[1]] \<and> length A1 = rat_poly.row_length A2 \<and> length B1 = rat_poly.row_length [[1]] \<and> A1 \<noteq> [] \<and> A2 \<noteq> [] \<and> B1 \<noteq> [] \<and> [[1]] \<noteq> []
[PROOF STEP]
using assms weak_matrix_match_def "1" blockmat.simps(1)
              matrix_blockmat
[PROOF STATE]
proof (prove)
using this:
[[1::?'a1]] \<noteq> []
mat 1 1 [[1::?'a2]]
rat_poly.row_length [[1]] = length B1
weak_matrix_match A1 A2 B1
weak_matrix_match ?A1.0 ?A2.0 ?B1.0 \<equiv> mat (rat_poly.row_length ?A1.0) (length ?A1.0) ?A1.0 \<and> mat (rat_poly.row_length ?A2.0) (length ?A2.0) ?A2.0 \<and> mat (rat_poly.row_length ?B1.0) 1 ?B1.0 \<and> ?A1.0 \<noteq> [] \<and> ?A2.0 \<noteq> [] \<and> ?B1.0 \<noteq> [] \<and> length ?A1.0 = rat_poly.row_length ?A2.0
length B1 = 1
blockmat [] = [[1]]
mat (rat_poly.row_length (blockmat ?ls)) (length (blockmat ?ls)) (blockmat ?ls)

goal (1 subgoal):
 1. mat (rat_poly.row_length A1) (length A1) A1 \<and> mat (rat_poly.row_length A2) (length A2) A2 \<and> mat (rat_poly.row_length B1) (length B1) B1 \<and> mat (rat_poly.row_length [[1]]) (length [[1]]) [[1]] \<and> length A1 = rat_poly.row_length A2 \<and> length B1 = rat_poly.row_length [[1]] \<and> A1 \<noteq> [] \<and> A2 \<noteq> [] \<and> B1 \<noteq> [] \<and> [[1]] \<noteq> []
[PROOF STEP]
by (metis (opaque_lifting, no_types))
[PROOF STATE]
proof (state)
this:
rat_poly.matrix_match A1 A2 B1 [[1]]

goal (1 subgoal):
 1. weak_matrix_match A1 A2 B1 \<Longrightarrow> rat_poly.matrix_mult A1 A2 \<otimes> B1 = rat_poly.matrix_mult (A1 \<otimes> B1) A2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
rat_poly.matrix_match A1 A2 B1 [[1]]
[PROOF STEP]
have "((rat_poly.matrix_mult A1  A2)\<otimes>(rat_poly.matrix_mult B1  [[1]]))
               = (rat_poly.matrix_mult (A1 \<otimes> B1) (A2 \<otimes> [[1]]))"
[PROOF STATE]
proof (prove)
using this:
rat_poly.matrix_match A1 A2 B1 [[1]]

goal (1 subgoal):
 1. rat_poly.matrix_mult A1 A2 \<otimes> rat_poly.matrix_mult B1 [[1]] = rat_poly.matrix_mult (A1 \<otimes> B1) (A2 \<otimes> [[1]])
[PROOF STEP]
using rat_poly.distributivity
[PROOF STATE]
proof (prove)
using this:
rat_poly.matrix_match A1 A2 B1 [[1]]
rat_poly.matrix_match ?A1.0 ?A2.0 ?B1.0 ?B2.0 \<Longrightarrow> rat_poly.matrix_mult ?A1.0 ?A2.0 \<otimes> rat_poly.matrix_mult ?B1.0 ?B2.0 = rat_poly.matrix_mult (?A1.0 \<otimes> ?B1.0) (?A2.0 \<otimes> ?B2.0)

goal (1 subgoal):
 1. rat_poly.matrix_mult A1 A2 \<otimes> rat_poly.matrix_mult B1 [[1]] = rat_poly.matrix_mult (A1 \<otimes> B1) (A2 \<otimes> [[1]])
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
rat_poly.matrix_mult A1 A2 \<otimes> rat_poly.matrix_mult B1 [[1]] = rat_poly.matrix_mult (A1 \<otimes> B1) (A2 \<otimes> [[1]])

goal (1 subgoal):
 1. weak_matrix_match A1 A2 B1 \<Longrightarrow> rat_poly.matrix_mult A1 A2 \<otimes> B1 = rat_poly.matrix_mult (A1 \<otimes> B1) A2
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
rat_poly.matrix_mult A1 A2 \<otimes> rat_poly.matrix_mult B1 [[1]] = rat_poly.matrix_mult (A1 \<otimes> B1) (A2 \<otimes> [[1]])

goal (1 subgoal):
 1. weak_matrix_match A1 A2 B1 \<Longrightarrow> rat_poly.matrix_mult A1 A2 \<otimes> B1 = rat_poly.matrix_mult (A1 \<otimes> B1) A2
[PROOF STEP]
have "(rat_poly.matrix_mult B1  [[1]]) = B1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rat_poly.matrix_mult B1 [[1]] = B1
[PROOF STEP]
using weak_matrix_match_def  assms mat1_equiv mat1_mult_right
[PROOF STATE]
proof (prove)
using this:
weak_matrix_match ?A1.0 ?A2.0 ?B1.0 \<equiv> mat (rat_poly.row_length ?A1.0) (length ?A1.0) ?A1.0 \<and> mat (rat_poly.row_length ?A2.0) (length ?A2.0) ?A2.0 \<and> mat (rat_poly.row_length ?B1.0) 1 ?B1.0 \<and> ?A1.0 \<noteq> [] \<and> ?A2.0 \<noteq> [] \<and> ?B1.0 \<noteq> [] \<and> length ?A1.0 = rat_poly.row_length ?A2.0
weak_matrix_match A1 A2 B1
mat1 1 = [[1]]
mat ?nr ?nc ?m \<Longrightarrow> mat_mult ?nr ?m (mat1 ?nc) = ?m

goal (1 subgoal):
 1. rat_poly.matrix_mult B1 [[1]] = B1
[PROOF STEP]
by (metis)
[PROOF STATE]
proof (state)
this:
rat_poly.matrix_mult B1 [[1]] = B1

goal (1 subgoal):
 1. weak_matrix_match A1 A2 B1 \<Longrightarrow> rat_poly.matrix_mult A1 A2 \<otimes> B1 = rat_poly.matrix_mult (A1 \<otimes> B1) A2
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
rat_poly.matrix_mult B1 [[1]] = B1

goal (1 subgoal):
 1. weak_matrix_match A1 A2 B1 \<Longrightarrow> rat_poly.matrix_mult A1 A2 \<otimes> B1 = rat_poly.matrix_mult (A1 \<otimes> B1) A2
[PROOF STEP]
have "(A2 \<otimes> [[1]]) = A2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A2 \<otimes> [[1]] = A2
[PROOF STEP]
using  rat_poly.Tensor_right_id
[PROOF STATE]
proof (prove)
using this:
?xs \<otimes> [[1]] = ?xs

goal (1 subgoal):
 1. A2 \<otimes> [[1]] = A2
[PROOF STEP]
by (metis)
[PROOF STATE]
proof (state)
this:
A2 \<otimes> [[1]] = A2

goal (1 subgoal):
 1. weak_matrix_match A1 A2 B1 \<Longrightarrow> rat_poly.matrix_mult A1 A2 \<otimes> B1 = rat_poly.matrix_mult (A1 \<otimes> B1) A2
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
rat_poly.matrix_mult A1 A2 \<otimes> rat_poly.matrix_mult B1 [[1]] = rat_poly.matrix_mult (A1 \<otimes> B1) (A2 \<otimes> [[1]])
rat_poly.matrix_mult B1 [[1]] = B1
A2 \<otimes> [[1]] = A2
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
rat_poly.matrix_mult A1 A2 \<otimes> rat_poly.matrix_mult B1 [[1]] = rat_poly.matrix_mult (A1 \<otimes> B1) (A2 \<otimes> [[1]])
rat_poly.matrix_mult B1 [[1]] = B1
A2 \<otimes> [[1]] = A2

goal (1 subgoal):
 1. rat_poly.matrix_mult A1 A2 \<otimes> B1 = rat_poly.matrix_mult (A1 \<otimes> B1) A2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
rat_poly.matrix_mult A1 A2 \<otimes> B1 = rat_poly.matrix_mult (A1 \<otimes> B1) A2

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Arcsin_sin:
    assumes "\<bar>Re z\<bar> < pi/2 \<or> (\<bar>Re z\<bar> = pi/2 \<and> Im z = 0)"
      shows "Arcsin(sin z) = z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Arcsin (sin z) = z
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Arcsin (sin z) = z
[PROOF STEP]
have "Arcsin(sin z) = - (\<i> * Ln (csqrt (1 - (\<i> * (exp (\<i>*z) - inverse (exp (\<i>*z))))\<^sup>2 / 4) - (inverse (exp (\<i>*z)) - exp (\<i>*z)) / 2))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Arcsin (sin z) = - (\<i> * Ln (csqrt (1 - (\<i> * (exp (\<i> * z) - inverse (exp (\<i> * z))))\<^sup>2 / 4) - (inverse (exp (\<i> * z)) - exp (\<i> * z)) / 2))
[PROOF STEP]
by (simp add: sin_exp_eq Arcsin_def exp_minus power_divide)
[PROOF STATE]
proof (state)
this:
Arcsin (sin z) = - (\<i> * Ln (csqrt (1 - (\<i> * (exp (\<i> * z) - inverse (exp (\<i> * z))))\<^sup>2 / 4) - (inverse (exp (\<i> * z)) - exp (\<i> * z)) / 2))

goal (1 subgoal):
 1. Arcsin (sin z) = z
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
Arcsin (sin z) = - (\<i> * Ln (csqrt (1 - (\<i> * (exp (\<i> * z) - inverse (exp (\<i> * z))))\<^sup>2 / 4) - (inverse (exp (\<i> * z)) - exp (\<i> * z)) / 2))

goal (1 subgoal):
 1. Arcsin (sin z) = z
[PROOF STEP]
have "\<dots> = - (\<i> * Ln (csqrt (((exp (\<i>*z) + inverse (exp (\<i>*z)))/2)\<^sup>2) - (inverse (exp (\<i>*z)) - exp (\<i>*z)) / 2))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - (\<i> * Ln (csqrt (1 - (\<i> * (exp (\<i> * z) - inverse (exp (\<i> * z))))\<^sup>2 / 4) - (inverse (exp (\<i> * z)) - exp (\<i> * z)) / 2)) = - (\<i> * Ln (csqrt (((exp (\<i> * z) + inverse (exp (\<i> * z))) / 2)\<^sup>2) - (inverse (exp (\<i> * z)) - exp (\<i> * z)) / 2))
[PROOF STEP]
by (simp add: field_simps power2_eq_square)
[PROOF STATE]
proof (state)
this:
- (\<i> * Ln (csqrt (1 - (\<i> * (exp (\<i> * z) - inverse (exp (\<i> * z))))\<^sup>2 / 4) - (inverse (exp (\<i> * z)) - exp (\<i> * z)) / 2)) = - (\<i> * Ln (csqrt (((exp (\<i> * z) + inverse (exp (\<i> * z))) / 2)\<^sup>2) - (inverse (exp (\<i> * z)) - exp (\<i> * z)) / 2))

goal (1 subgoal):
 1. Arcsin (sin z) = z
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
- (\<i> * Ln (csqrt (1 - (\<i> * (exp (\<i> * z) - inverse (exp (\<i> * z))))\<^sup>2 / 4) - (inverse (exp (\<i> * z)) - exp (\<i> * z)) / 2)) = - (\<i> * Ln (csqrt (((exp (\<i> * z) + inverse (exp (\<i> * z))) / 2)\<^sup>2) - (inverse (exp (\<i> * z)) - exp (\<i> * z)) / 2))

goal (1 subgoal):
 1. Arcsin (sin z) = z
[PROOF STEP]
have "\<dots> = - (\<i> * Ln (((exp (\<i>*z) + inverse (exp (\<i>*z)))/2) - (inverse (exp (\<i>*z)) - exp (\<i>*z)) / 2))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - (\<i> * Ln (csqrt (((exp (\<i> * z) + inverse (exp (\<i> * z))) / 2)\<^sup>2) - (inverse (exp (\<i> * z)) - exp (\<i> * z)) / 2)) = - (\<i> * Ln ((exp (\<i> * z) + inverse (exp (\<i> * z))) / 2 - (inverse (exp (\<i> * z)) - exp (\<i> * z)) / 2))
[PROOF STEP]
apply (subst csqrt_square)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. 0 < Re ((exp (\<i> * z) + inverse (exp (\<i> * z))) / 2) \<or> Re ((exp (\<i> * z) + inverse (exp (\<i> * z))) / 2) = 0 \<and> 0 \<le> Im ((exp (\<i> * z) + inverse (exp (\<i> * z))) / 2)
 2. - (\<i> * Ln ((exp (\<i> * z) + inverse (exp (\<i> * z))) / 2 - (inverse (exp (\<i> * z)) - exp (\<i> * z)) / 2)) = - (\<i> * Ln ((exp (\<i> * z) + inverse (exp (\<i> * z))) / 2 - (inverse (exp (\<i> * z)) - exp (\<i> * z)) / 2))
[PROOF STEP]
using assms Re_eq_pihalf_lemma Re_less_pihalf_lemma
[PROOF STATE]
proof (prove)
using this:
\<bar>Re z\<bar> < pi / 2 \<or> \<bar>Re z\<bar> = pi / 2 \<and> Im z = 0
\<lbrakk>\<bar>Re ?z\<bar> = pi / 2; Im ?z = 0\<rbrakk> \<Longrightarrow> Re ((exp (\<i> * ?z) + inverse (exp (\<i> * ?z))) / 2) = 0 \<and> 0 \<le> Im ((exp (\<i> * ?z) + inverse (exp (\<i> * ?z))) / 2)
\<bar>Re ?z\<bar> < pi / 2 \<Longrightarrow> 0 < Re ((exp (\<i> * ?z) + inverse (exp (\<i> * ?z))) / 2)

goal (2 subgoals):
 1. 0 < Re ((exp (\<i> * z) + inverse (exp (\<i> * z))) / 2) \<or> Re ((exp (\<i> * z) + inverse (exp (\<i> * z))) / 2) = 0 \<and> 0 \<le> Im ((exp (\<i> * z) + inverse (exp (\<i> * z))) / 2)
 2. - (\<i> * Ln ((exp (\<i> * z) + inverse (exp (\<i> * z))) / 2 - (inverse (exp (\<i> * z)) - exp (\<i> * z)) / 2)) = - (\<i> * Ln ((exp (\<i> * z) + inverse (exp (\<i> * z))) / 2 - (inverse (exp (\<i> * z)) - exp (\<i> * z)) / 2))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
- (\<i> * Ln (csqrt (((exp (\<i> * z) + inverse (exp (\<i> * z))) / 2)\<^sup>2) - (inverse (exp (\<i> * z)) - exp (\<i> * z)) / 2)) = - (\<i> * Ln ((exp (\<i> * z) + inverse (exp (\<i> * z))) / 2 - (inverse (exp (\<i> * z)) - exp (\<i> * z)) / 2))

goal (1 subgoal):
 1. Arcsin (sin z) = z
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
- (\<i> * Ln (csqrt (((exp (\<i> * z) + inverse (exp (\<i> * z))) / 2)\<^sup>2) - (inverse (exp (\<i> * z)) - exp (\<i> * z)) / 2)) = - (\<i> * Ln ((exp (\<i> * z) + inverse (exp (\<i> * z))) / 2 - (inverse (exp (\<i> * z)) - exp (\<i> * z)) / 2))

goal (1 subgoal):
 1. Arcsin (sin z) = z
[PROOF STEP]
have "\<dots> =  - (\<i> * Ln (exp (\<i>*z)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - (\<i> * Ln ((exp (\<i> * z) + inverse (exp (\<i> * z))) / 2 - (inverse (exp (\<i> * z)) - exp (\<i> * z)) / 2)) = - (\<i> * Ln (exp (\<i> * z)))
[PROOF STEP]
by (simp add: field_simps power2_eq_square)
[PROOF STATE]
proof (state)
this:
- (\<i> * Ln ((exp (\<i> * z) + inverse (exp (\<i> * z))) / 2 - (inverse (exp (\<i> * z)) - exp (\<i> * z)) / 2)) = - (\<i> * Ln (exp (\<i> * z)))

goal (1 subgoal):
 1. Arcsin (sin z) = z
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
- (\<i> * Ln ((exp (\<i> * z) + inverse (exp (\<i> * z))) / 2 - (inverse (exp (\<i> * z)) - exp (\<i> * z)) / 2)) = - (\<i> * Ln (exp (\<i> * z)))

goal (1 subgoal):
 1. Arcsin (sin z) = z
[PROOF STEP]
have "\<dots> = z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - (\<i> * Ln (exp (\<i> * z))) = z
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<bar>Re z\<bar> < pi / 2 \<or> \<bar>Re z\<bar> = pi / 2 \<and> Im z = 0

goal (1 subgoal):
 1. - (\<i> * Ln (exp (\<i> * z))) = z
[PROOF STEP]
by (auto simp: abs_if simp del: eq_divide_eq_numeral1 split: if_split_asm)
[PROOF STATE]
proof (state)
this:
- (\<i> * Ln (exp (\<i> * z))) = z

goal (1 subgoal):
 1. Arcsin (sin z) = z
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
Arcsin (sin z) = z
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
Arcsin (sin z) = z

goal (1 subgoal):
 1. Arcsin (sin z) = z
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
Arcsin (sin z) = z

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma continuous_map_limit:
  assumes "continuous_map X Y g" and f: "limitin X f l F"
  shows "limitin Y (g \<circ> f) (g l) F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. limitin Y (g \<circ> f) (g l) F
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. limitin Y (g \<circ> f) (g l) F
[PROOF STEP]
have "g l \<in> topspace Y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. g l \<in> topspace Y
[PROOF STEP]
by (meson assms continuous_map_def limitin_topspace)
[PROOF STATE]
proof (state)
this:
g l \<in> topspace Y

goal (1 subgoal):
 1. limitin Y (g \<circ> f) (g l) F
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
g l \<in> topspace Y

goal (1 subgoal):
 1. limitin Y (g \<circ> f) (g l) F
[PROOF STEP]
have "\<And>U. \<lbrakk>\<forall>V. openin X V \<and> l \<in> V \<longrightarrow> (\<forall>\<^sub>F x in F. f x \<in> V); openin Y U; g l \<in> U\<rbrakk>
            \<Longrightarrow> \<forall>\<^sub>F x in F. g (f x) \<in> U"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>U. \<lbrakk>\<forall>V. openin X V \<and> l \<in> V \<longrightarrow> (\<forall>\<^sub>F x in F. f x \<in> V); openin Y U; g l \<in> U\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F x in F. g (f x) \<in> U
[PROOF STEP]
using assms eventually_mono
[PROOF STATE]
proof (prove)
using this:
continuous_map X Y g
limitin X f l F
\<lbrakk>eventually ?P ?F; \<And>x. ?P x \<Longrightarrow> ?Q x\<rbrakk> \<Longrightarrow> eventually ?Q ?F

goal (1 subgoal):
 1. \<And>U. \<lbrakk>\<forall>V. openin X V \<and> l \<in> V \<longrightarrow> (\<forall>\<^sub>F x in F. f x \<in> V); openin Y U; g l \<in> U\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F x in F. g (f x) \<in> U
[PROOF STEP]
by (fastforce simp: limitin_def dest!: openin_continuous_map_preimage)
[PROOF STATE]
proof (state)
this:
\<lbrakk>\<forall>V. openin X V \<and> l \<in> V \<longrightarrow> (\<forall>\<^sub>F x in F. f x \<in> V); openin Y ?U; g l \<in> ?U\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F x in F. g (f x) \<in> ?U

goal (1 subgoal):
 1. limitin Y (g \<circ> f) (g l) F
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
g l \<in> topspace Y
\<lbrakk>\<forall>V. openin X V \<and> l \<in> V \<longrightarrow> (\<forall>\<^sub>F x in F. f x \<in> V); openin Y ?U; g l \<in> ?U\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F x in F. g (f x) \<in> ?U
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
g l \<in> topspace Y
\<lbrakk>\<forall>V. openin X V \<and> l \<in> V \<longrightarrow> (\<forall>\<^sub>F x in F. f x \<in> V); openin Y ?U; g l \<in> ?U\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F x in F. g (f x) \<in> ?U

goal (1 subgoal):
 1. limitin Y (g \<circ> f) (g l) F
[PROOF STEP]
using f
[PROOF STATE]
proof (prove)
using this:
g l \<in> topspace Y
\<lbrakk>\<forall>V. openin X V \<and> l \<in> V \<longrightarrow> (\<forall>\<^sub>F x in F. f x \<in> V); openin Y ?U; g l \<in> ?U\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F x in F. g (f x) \<in> ?U
limitin X f l F

goal (1 subgoal):
 1. limitin Y (g \<circ> f) (g l) F
[PROOF STEP]
by (fastforce simp add: limitin_def)
[PROOF STATE]
proof (state)
this:
limitin Y (g \<circ> f) (g l) F

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma sigma_sets_subseteq: assumes "A \<subseteq> B" shows "sigma_sets X A \<subseteq> sigma_sets X B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sigma_sets X A \<subseteq> sigma_sets X B
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> sigma_sets X A \<Longrightarrow> x \<in> sigma_sets X B
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> sigma_sets X A \<Longrightarrow> x \<in> sigma_sets X B
[PROOF STEP]
assume "x \<in> sigma_sets X A"
[PROOF STATE]
proof (state)
this:
x \<in> sigma_sets X A

goal (1 subgoal):
 1. \<And>x. x \<in> sigma_sets X A \<Longrightarrow> x \<in> sigma_sets X B
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<in> sigma_sets X A
[PROOF STEP]
show "x \<in> sigma_sets X B"
[PROOF STATE]
proof (prove)
using this:
x \<in> sigma_sets X A

goal (1 subgoal):
 1. x \<in> sigma_sets X B
[PROOF STEP]
by induct (insert \<open>A \<subseteq> B\<close>, auto intro: sigma_sets.intros(2-))
[PROOF STATE]
proof (state)
this:
x \<in> sigma_sets X B

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma split_time_empty_Suc:
  assumes h1:"i < n"
         and h2:"0 < i"
  shows "split_time s (Suc n) ((Suc n)* t + i)  = split_time s n (n * t + i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. split_time s (Suc n) (Suc n * t + i) = split_time s n (n * t + i)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. split_time s (Suc n) (Suc n * t + i) = split_time s n (n * t + i)
[PROOF STEP]
from h1
[PROOF STATE]
proof (chain)
picking this:
i < n
[PROOF STEP]
have "i < Suc n"
[PROOF STATE]
proof (prove)
using this:
i < n

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

goal (1 subgoal):
 1. split_time s (Suc n) (Suc n * t + i) = split_time s n (n * t + i)
[PROOF STEP]
from this and h2
[PROOF STATE]
proof (chain)
picking this:
i < Suc n
0 < i
[PROOF STEP]
have sg2:"split_time s (Suc n) (Suc n * t + i) = []"
[PROOF STATE]
proof (prove)
using this:
i < Suc n
0 < i

goal (1 subgoal):
 1. split_time s (Suc n) (Suc n * t + i) = []
[PROOF STEP]
by (rule split_time_empty)
[PROOF STATE]
proof (state)
this:
split_time s (Suc n) (Suc n * t + i) = []

goal (1 subgoal):
 1. split_time s (Suc n) (Suc n * t + i) = split_time s n (n * t + i)
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
i < n
0 < i
[PROOF STEP]
have sg3:"split_time s n (n * t + i) = []"
[PROOF STATE]
proof (prove)
using this:
i < n
0 < i

goal (1 subgoal):
 1. split_time s n (n * t + i) = []
[PROOF STEP]
by (rule split_time_empty)
[PROOF STATE]
proof (state)
this:
split_time s n (n * t + i) = []

goal (1 subgoal):
 1. split_time s (Suc n) (Suc n * t + i) = split_time s n (n * t + i)
[PROOF STEP]
from sg3 and sg2
[PROOF STATE]
proof (chain)
picking this:
split_time s n (n * t + i) = []
split_time s (Suc n) (Suc n * t + i) = []
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
split_time s n (n * t + i) = []
split_time s (Suc n) (Suc n * t + i) = []

goal (1 subgoal):
 1. split_time s (Suc n) (Suc n * t + i) = split_time s n (n * t + i)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
split_time s (Suc n) (Suc n * t + i) = split_time s n (n * t + i)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma polynomial_function_diff [intro]:
    "\<lbrakk>polynomial_function f; polynomial_function g\<rbrakk> \<Longrightarrow> polynomial_function (\<lambda>x. f x - g x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>polynomial_function f; polynomial_function g\<rbrakk> \<Longrightarrow> polynomial_function (\<lambda>x. f x - g x)
[PROOF STEP]
unfolding add_uminus_conv_diff [symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>polynomial_function f; polynomial_function g\<rbrakk> \<Longrightarrow> polynomial_function (\<lambda>x. f x + - g x)
[PROOF STEP]
by (metis polynomial_function_add polynomial_function_minus)


[STATEMENT]
lemma annilr: "annil x = annir x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. annil x = annir x
[PROOF STEP]
by (metis annil_def annir_def add_comm)


[STATEMENT]
lemma all_edges_between_disjnt2: "disjnt Y Z \<Longrightarrow> disjnt (all_edges_between X Y) (all_edges_between X Z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. disjnt Y Z \<Longrightarrow> disjnt (all_edges_between X Y) (all_edges_between X Z)
[PROOF STEP]
by (auto simp: all_edges_between_def disjnt_iff)


[STATEMENT]
lemma all1_lemma [simp]:
  "rec_eval (rec_all1 f) [x, y] = (if (\<forall>z \<le> x. 0 < rec_eval f [z, y]) then 1 else 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rec_eval (rec_all1 f) [x, y] = (if \<forall>z\<le>x. 0 < rec_eval f [z, y] then 1 else 0)
[PROOF STEP]
by (simp add: rec_all1_def)


[STATEMENT]
lemma is_pole_divide:
  fixes f :: "'a :: t2_space \<Rightarrow> 'b :: real_normed_field"
  assumes "isCont f z" "filterlim g (at 0) (at z)" "f z \<noteq> 0"
  shows   "is_pole (\<lambda>z. f z / g z) z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_pole (\<lambda>z. f z / g z) z
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. is_pole (\<lambda>z. f z / g z) z
[PROOF STEP]
have "filterlim (\<lambda>z. f z * inverse (g z)) at_infinity (at z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. LIM z at z. f z * inverse (g z) :> at_infinity
[PROOF STEP]
by (intro tendsto_mult_filterlim_at_infinity[of _ "f z"]
                 filterlim_compose[OF filterlim_inverse_at_infinity])+
       (insert assms, auto simp: isCont_def)
[PROOF STATE]
proof (state)
this:
LIM z at z. f z * inverse (g z) :> at_infinity

goal (1 subgoal):
 1. is_pole (\<lambda>z. f z / g z) z
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
LIM z at z. f z * inverse (g z) :> at_infinity

goal (1 subgoal):
 1. is_pole (\<lambda>z. f z / g z) z
[PROOF STEP]
by (simp add: field_split_simps is_pole_def)
[PROOF STATE]
proof (state)
this:
is_pole (\<lambda>z. f z / g z) z

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma join_leftcomm: "x \<squnion> (y \<squnion> z) = y \<squnion> (x \<squnion> z)" if "x \<in> carrier L" "y \<in> carrier L" "z \<in> carrier L"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<squnion> (y \<squnion> z) = y \<squnion> (x \<squnion> z)
[PROOF STEP]
by (metis join_assoc join_comm that)


[STATEMENT]
lemma LBINT_I0c_sin_scale_divide:
  assumes "T \<ge> 0"
  shows "LBINT t=0..T. sin (t * \<theta>) / t = sgn \<theta> * Si (T * \<bar>\<theta>\<bar>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. LBINT t=0..ereal T. sin (t * \<theta>) / t = sgn \<theta> * Si (T * \<bar>\<theta>\<bar>)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. LBINT t=0..ereal T. sin (t * \<theta>) / t = sgn \<theta> * Si (T * \<bar>\<theta>\<bar>)
[PROOF STEP]
{
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. LBINT t=0..ereal T. sin (t * \<theta>) / t = sgn \<theta> * Si (T * \<bar>\<theta>\<bar>)
[PROOF STEP]
assume "0 < \<theta>"
[PROOF STATE]
proof (state)
this:
0 < \<theta>

goal (1 subgoal):
 1. LBINT t=0..ereal T. sin (t * \<theta>) / t = sgn \<theta> * Si (T * \<bar>\<theta>\<bar>)
[PROOF STEP]
have "(LBINT t=ereal 0..T. sin (t * \<theta>) / t) = (LBINT t=ereal 0..T. \<theta> *\<^sub>R sinc (t * \<theta>))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. LBINT t=ereal 0..ereal T. sin (t * \<theta>) / t = LBINT t=ereal 0..ereal T. \<theta> *\<^sub>R sinc (t * \<theta>)
[PROOF STEP]
by (rule interval_integral_discrete_difference[of "{0}"]) auto
[PROOF STATE]
proof (state)
this:
LBINT t=ereal 0..ereal T. sin (t * \<theta>) / t = LBINT t=ereal 0..ereal T. \<theta> *\<^sub>R sinc (t * \<theta>)

goal (1 subgoal):
 1. LBINT t=0..ereal T. sin (t * \<theta>) / t = sgn \<theta> * Si (T * \<bar>\<theta>\<bar>)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
LBINT t=ereal 0..ereal T. sin (t * \<theta>) / t = LBINT t=ereal 0..ereal T. \<theta> *\<^sub>R sinc (t * \<theta>)

goal (1 subgoal):
 1. LBINT t=0..ereal T. sin (t * \<theta>) / t = sgn \<theta> * Si (T * \<bar>\<theta>\<bar>)
[PROOF STEP]
have "\<dots> = (LBINT t=ereal (0 * \<theta>)..T * \<theta>. sinc t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. LBINT t=ereal 0..ereal T. \<theta> *\<^sub>R sinc (t * \<theta>) = interval_lebesgue_integral lborel (ereal (0 * \<theta>)) (ereal (T * \<theta>)) sinc
[PROOF STEP]
apply (rule interval_integral_substitution_finite [OF assms])
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>t. \<lbrakk>0 \<le> t; t \<le> T\<rbrakk> \<Longrightarrow> ((\<lambda>x. x * \<theta>) has_real_derivative \<theta>) (at t within {0..T})
 2. continuous_on ((\<lambda>x. x * \<theta>) ` {0..T}) sinc
 3. continuous_on {0..T} (\<lambda>x. \<theta>)
[PROOF STEP]
apply (subst mult.commute, rule DERIV_subset)
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<And>t. \<lbrakk>0 \<le> t; t \<le> T\<rbrakk> \<Longrightarrow> ((*) \<theta> has_real_derivative \<theta>) (at t within ?s7 t)
 2. \<And>t. \<lbrakk>0 \<le> t; t \<le> T\<rbrakk> \<Longrightarrow> {0..T} \<subseteq> ?s7 t
 3. continuous_on ((\<lambda>x. x * \<theta>) ` {0..T}) sinc
 4. continuous_on {0..T} (\<lambda>x. \<theta>)
[PROOF STEP]
by (auto intro!: derivative_intros continuous_at_imp_continuous_on isCont_sinc)
[PROOF STATE]
proof (state)
this:
LBINT t=ereal 0..ereal T. \<theta> *\<^sub>R sinc (t * \<theta>) = interval_lebesgue_integral lborel (ereal (0 * \<theta>)) (ereal (T * \<theta>)) sinc

goal (1 subgoal):
 1. LBINT t=0..ereal T. sin (t * \<theta>) / t = sgn \<theta> * Si (T * \<bar>\<theta>\<bar>)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
LBINT t=ereal 0..ereal T. \<theta> *\<^sub>R sinc (t * \<theta>) = interval_lebesgue_integral lborel (ereal (0 * \<theta>)) (ereal (T * \<theta>)) sinc

goal (1 subgoal):
 1. LBINT t=0..ereal T. sin (t * \<theta>) / t = sgn \<theta> * Si (T * \<bar>\<theta>\<bar>)
[PROOF STEP]
have "\<dots> = (LBINT t=ereal (0 * \<theta>)..T * \<theta>. sin t / t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. interval_lebesgue_integral lborel (ereal (0 * \<theta>)) (ereal (T * \<theta>)) sinc = LBINT t=ereal (0 * \<theta>)..ereal (T * \<theta>). sin t / t
[PROOF STEP]
by (rule interval_integral_discrete_difference[of "{0}"]) auto
[PROOF STATE]
proof (state)
this:
interval_lebesgue_integral lborel (ereal (0 * \<theta>)) (ereal (T * \<theta>)) sinc = LBINT t=ereal (0 * \<theta>)..ereal (T * \<theta>). sin t / t

goal (1 subgoal):
 1. LBINT t=0..ereal T. sin (t * \<theta>) / t = sgn \<theta> * Si (T * \<bar>\<theta>\<bar>)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
LBINT t=ereal 0..ereal T. sin (t * \<theta>) / t = LBINT t=ereal (0 * \<theta>)..ereal (T * \<theta>). sin t / t
[PROOF STEP]
have "(LBINT t=ereal 0..T. sin (t * \<theta>) / t) = (LBINT t=ereal 0..T * \<theta>. sin t / t)"
[PROOF STATE]
proof (prove)
using this:
LBINT t=ereal 0..ereal T. sin (t * \<theta>) / t = LBINT t=ereal (0 * \<theta>)..ereal (T * \<theta>). sin t / t

goal (1 subgoal):
 1. LBINT t=ereal 0..ereal T. sin (t * \<theta>) / t = LBINT t=ereal 0..ereal (T * \<theta>). sin t / t
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
LBINT t=ereal 0..ereal T. sin (t * \<theta>) / t = LBINT t=ereal 0..ereal (T * \<theta>). sin t / t

goal (1 subgoal):
 1. LBINT t=0..ereal T. sin (t * \<theta>) / t = sgn \<theta> * Si (T * \<bar>\<theta>\<bar>)
[PROOF STEP]
hence "LBINT x. indicator {0<..<T} x * sin (x * \<theta>) / x =
        LBINT x. indicator {0<..<T * \<theta>} x * sin x / x"
[PROOF STATE]
proof (prove)
using this:
LBINT t=ereal 0..ereal T. sin (t * \<theta>) / t = LBINT t=ereal 0..ereal (T * \<theta>). sin t / t

goal (1 subgoal):
 1. LBINT x. indicat_real {0<..<T} x * sin (x * \<theta>) / x = LBINT x. indicat_real {0<..<T * \<theta>} x * sin x / x
[PROOF STEP]
using assms \<open>0 < \<theta>\<close>
[PROOF STATE]
proof (prove)
using this:
LBINT t=ereal 0..ereal T. sin (t * \<theta>) / t = LBINT t=ereal 0..ereal (T * \<theta>). sin t / t
0 \<le> T
0 < \<theta>

goal (1 subgoal):
 1. LBINT x. indicat_real {0<..<T} x * sin (x * \<theta>) / x = LBINT x. indicat_real {0<..<T * \<theta>} x * sin x / x
[PROOF STEP]
unfolding interval_lebesgue_integral_def einterval_eq zero_ereal_def
[PROOF STATE]
proof (prove)
using this:
(if ereal 0 \<le> ereal T then LBINT t:{0<..<T}. sin (t * \<theta>) / t else - (LBINT t:{T<..<0}. sin (t * \<theta>) / t)) = (if ereal 0 \<le> ereal (T * \<theta>) then LBINT t:{0<..<T * \<theta>}. sin t / t else - (LBINT t:{T * \<theta><..<0}. sin t / t))
0 \<le> T
0 < \<theta>

goal (1 subgoal):
 1. LBINT x. indicat_real {0<..<T} x * sin (x * \<theta>) / x = LBINT x. indicat_real {0<..<T * \<theta>} x * sin x / x
[PROOF STEP]
by (auto simp: ac_simps set_lebesgue_integral_def)
[PROOF STATE]
proof (state)
this:
LBINT x. indicat_real {0<..<T} x * sin (x * \<theta>) / x = LBINT x. indicat_real {0<..<T * \<theta>} x * sin x / x

goal (1 subgoal):
 1. LBINT t=0..ereal T. sin (t * \<theta>) / t = sgn \<theta> * Si (T * \<bar>\<theta>\<bar>)
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
0 < \<theta> \<Longrightarrow> LBINT x. indicat_real {0<..<T} x * sin (x * \<theta>) / x = LBINT x. indicat_real {0<..<T * \<theta>} x * sin x / x

goal (1 subgoal):
 1. LBINT t=0..ereal T. sin (t * \<theta>) / t = sgn \<theta> * Si (T * \<bar>\<theta>\<bar>)
[PROOF STEP]
note aux1 = this
[PROOF STATE]
proof (state)
this:
0 < \<theta> \<Longrightarrow> LBINT x. indicat_real {0<..<T} x * sin (x * \<theta>) / x = LBINT x. indicat_real {0<..<T * \<theta>} x * sin x / x

goal (1 subgoal):
 1. LBINT t=0..ereal T. sin (t * \<theta>) / t = sgn \<theta> * Si (T * \<bar>\<theta>\<bar>)
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
0 < \<theta> \<Longrightarrow> LBINT x. indicat_real {0<..<T} x * sin (x * \<theta>) / x = LBINT x. indicat_real {0<..<T * \<theta>} x * sin x / x

goal (1 subgoal):
 1. LBINT t=0..ereal T. sin (t * \<theta>) / t = sgn \<theta> * Si (T * \<bar>\<theta>\<bar>)
[PROOF STEP]
assume "0 > \<theta>"
[PROOF STATE]
proof (state)
this:
\<theta> < 0

goal (1 subgoal):
 1. LBINT t=0..ereal T. sin (t * \<theta>) / t = sgn \<theta> * Si (T * \<bar>\<theta>\<bar>)
[PROOF STEP]
have [simp]: "integrable lborel (\<lambda>x. sin (x * \<theta>) * indicator {0<..<T} x / x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integrable lborel (\<lambda>x. sin (x * \<theta>) * indicat_real {0<..<T} x / x)
[PROOF STEP]
using integrable_sinc' [of T \<theta>] assms
[PROOF STATE]
proof (prove)
using this:
interval_lebesgue_integrable lborel (ereal 0) (ereal T) (\<lambda>t. sin (t * \<theta>) / t)
0 \<le> T

goal (1 subgoal):
 1. integrable lborel (\<lambda>x. sin (x * \<theta>) * indicat_real {0<..<T} x / x)
[PROOF STEP]
by (simp add: interval_lebesgue_integrable_def set_integrable_def ac_simps)
[PROOF STATE]
proof (state)
this:
integrable lborel (\<lambda>x. sin (x * \<theta>) * indicat_real {0<..<T} x / x)

goal (1 subgoal):
 1. LBINT t=0..ereal T. sin (t * \<theta>) / t = sgn \<theta> * Si (T * \<bar>\<theta>\<bar>)
[PROOF STEP]
have "(LBINT t=ereal 0..T. sin (t * -\<theta>) / t) = (LBINT t=ereal 0..T. -\<theta> *\<^sub>R sinc (t * -\<theta>))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. LBINT t=ereal 0..ereal T. sin (t * - \<theta>) / t = LBINT t=ereal 0..ereal T. - \<theta> *\<^sub>R sinc (t * - \<theta>)
[PROOF STEP]
by (rule interval_integral_discrete_difference[of "{0}"]) auto
[PROOF STATE]
proof (state)
this:
LBINT t=ereal 0..ereal T. sin (t * - \<theta>) / t = LBINT t=ereal 0..ereal T. - \<theta> *\<^sub>R sinc (t * - \<theta>)

goal (1 subgoal):
 1. LBINT t=0..ereal T. sin (t * \<theta>) / t = sgn \<theta> * Si (T * \<bar>\<theta>\<bar>)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
LBINT t=ereal 0..ereal T. sin (t * - \<theta>) / t = LBINT t=ereal 0..ereal T. - \<theta> *\<^sub>R sinc (t * - \<theta>)

goal (1 subgoal):
 1. LBINT t=0..ereal T. sin (t * \<theta>) / t = sgn \<theta> * Si (T * \<bar>\<theta>\<bar>)
[PROOF STEP]
have "\<dots> = (LBINT t=ereal (0 * -\<theta>)..T * -\<theta>. sinc t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. LBINT t=ereal 0..ereal T. - \<theta> *\<^sub>R sinc (t * - \<theta>) = interval_lebesgue_integral lborel (ereal (0 * - \<theta>)) (ereal (T * - \<theta>)) sinc
[PROOF STEP]
apply (rule interval_integral_substitution_finite [OF assms])
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>t. \<lbrakk>0 \<le> t; t \<le> T\<rbrakk> \<Longrightarrow> ((\<lambda>x. x * - \<theta>) has_real_derivative - \<theta>) (at t within {0..T})
 2. continuous_on ((\<lambda>x. x * - \<theta>) ` {0..T}) sinc
 3. continuous_on {0..T} (\<lambda>x. - \<theta>)
[PROOF STEP]
apply (subst mult.commute, rule DERIV_subset)
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<And>t. \<lbrakk>0 \<le> t; t \<le> T\<rbrakk> \<Longrightarrow> ((*) (- \<theta>) has_real_derivative - \<theta>) (at t within ?s7 t)
 2. \<And>t. \<lbrakk>0 \<le> t; t \<le> T\<rbrakk> \<Longrightarrow> {0..T} \<subseteq> ?s7 t
 3. continuous_on ((\<lambda>x. x * - \<theta>) ` {0..T}) sinc
 4. continuous_on {0..T} (\<lambda>x. - \<theta>)
[PROOF STEP]
by (auto intro!: derivative_intros continuous_at_imp_continuous_on isCont_sinc)
[PROOF STATE]
proof (state)
this:
LBINT t=ereal 0..ereal T. - \<theta> *\<^sub>R sinc (t * - \<theta>) = interval_lebesgue_integral lborel (ereal (0 * - \<theta>)) (ereal (T * - \<theta>)) sinc

goal (1 subgoal):
 1. LBINT t=0..ereal T. sin (t * \<theta>) / t = sgn \<theta> * Si (T * \<bar>\<theta>\<bar>)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
LBINT t=ereal 0..ereal T. - \<theta> *\<^sub>R sinc (t * - \<theta>) = interval_lebesgue_integral lborel (ereal (0 * - \<theta>)) (ereal (T * - \<theta>)) sinc

goal (1 subgoal):
 1. LBINT t=0..ereal T. sin (t * \<theta>) / t = sgn \<theta> * Si (T * \<bar>\<theta>\<bar>)
[PROOF STEP]
have "\<dots> = (LBINT t=ereal (0 * -\<theta>)..T * -\<theta>. sin t / t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. interval_lebesgue_integral lborel (ereal (0 * - \<theta>)) (ereal (T * - \<theta>)) sinc = LBINT t=ereal (0 * - \<theta>)..ereal (T * - \<theta>). sin t / t
[PROOF STEP]
by (rule interval_integral_discrete_difference[of "{0}"]) auto
[PROOF STATE]
proof (state)
this:
interval_lebesgue_integral lborel (ereal (0 * - \<theta>)) (ereal (T * - \<theta>)) sinc = LBINT t=ereal (0 * - \<theta>)..ereal (T * - \<theta>). sin t / t

goal (1 subgoal):
 1. LBINT t=0..ereal T. sin (t * \<theta>) / t = sgn \<theta> * Si (T * \<bar>\<theta>\<bar>)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
LBINT t=ereal 0..ereal T. sin (t * - \<theta>) / t = LBINT t=ereal (0 * - \<theta>)..ereal (T * - \<theta>). sin t / t
[PROOF STEP]
have "(LBINT t=ereal 0..T. sin (t * -\<theta>) / t) = (LBINT t=ereal 0..T * -\<theta>. sin t / t)"
[PROOF STATE]
proof (prove)
using this:
LBINT t=ereal 0..ereal T. sin (t * - \<theta>) / t = LBINT t=ereal (0 * - \<theta>)..ereal (T * - \<theta>). sin t / t

goal (1 subgoal):
 1. LBINT t=ereal 0..ereal T. sin (t * - \<theta>) / t = LBINT t=ereal 0..ereal (T * - \<theta>). sin t / t
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
LBINT t=ereal 0..ereal T. sin (t * - \<theta>) / t = LBINT t=ereal 0..ereal (T * - \<theta>). sin t / t

goal (1 subgoal):
 1. LBINT t=0..ereal T. sin (t * \<theta>) / t = sgn \<theta> * Si (T * \<bar>\<theta>\<bar>)
[PROOF STEP]
hence "LBINT x. indicator {0<..<T} x * sin (x * \<theta>) / x =
       - (LBINT x. indicator {0<..<- (T * \<theta>)} x * sin x / x)"
[PROOF STATE]
proof (prove)
using this:
LBINT t=ereal 0..ereal T. sin (t * - \<theta>) / t = LBINT t=ereal 0..ereal (T * - \<theta>). sin t / t

goal (1 subgoal):
 1. LBINT x. indicat_real {0<..<T} x * sin (x * \<theta>) / x = - (LBINT x. indicat_real {0<..<- (T * \<theta>)} x * sin x / x)
[PROOF STEP]
using assms \<open>0 > \<theta>\<close>
[PROOF STATE]
proof (prove)
using this:
LBINT t=ereal 0..ereal T. sin (t * - \<theta>) / t = LBINT t=ereal 0..ereal (T * - \<theta>). sin t / t
0 \<le> T
\<theta> < 0

goal (1 subgoal):
 1. LBINT x. indicat_real {0<..<T} x * sin (x * \<theta>) / x = - (LBINT x. indicat_real {0<..<- (T * \<theta>)} x * sin x / x)
[PROOF STEP]
unfolding interval_lebesgue_integral_def einterval_eq zero_ereal_def
[PROOF STATE]
proof (prove)
using this:
(if ereal 0 \<le> ereal T then LBINT t:{0<..<T}. sin (t * - \<theta>) / t else - (LBINT t:{T<..<0}. sin (t * - \<theta>) / t)) = (if ereal 0 \<le> ereal (T * - \<theta>) then LBINT t:{0<..<T * - \<theta>}. sin t / t else - (LBINT t:{T * - \<theta><..<0}. sin t / t))
0 \<le> T
\<theta> < 0

goal (1 subgoal):
 1. LBINT x. indicat_real {0<..<T} x * sin (x * \<theta>) / x = - (LBINT x. indicat_real {0<..<- (T * \<theta>)} x * sin x / x)
[PROOF STEP]
by (auto simp add: field_simps mult_le_0_iff set_lebesgue_integral_def split: if_split_asm)
[PROOF STATE]
proof (state)
this:
LBINT x. indicat_real {0<..<T} x * sin (x * \<theta>) / x = - (LBINT x. indicat_real {0<..<- (T * \<theta>)} x * sin x / x)

goal (1 subgoal):
 1. LBINT t=0..ereal T. sin (t * \<theta>) / t = sgn \<theta> * Si (T * \<bar>\<theta>\<bar>)
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
\<theta> < 0 \<Longrightarrow> LBINT x. indicat_real {0<..<T} x * sin (x * \<theta>) / x = - (LBINT x. indicat_real {0<..<- (T * \<theta>)} x * sin x / x)

goal (1 subgoal):
 1. LBINT t=0..ereal T. sin (t * \<theta>) / t = sgn \<theta> * Si (T * \<bar>\<theta>\<bar>)
[PROOF STEP]
note aux2 = this
[PROOF STATE]
proof (state)
this:
\<theta> < 0 \<Longrightarrow> LBINT x. indicat_real {0<..<T} x * sin (x * \<theta>) / x = - (LBINT x. indicat_real {0<..<- (T * \<theta>)} x * sin x / x)

goal (1 subgoal):
 1. LBINT t=0..ereal T. sin (t * \<theta>) / t = sgn \<theta> * Si (T * \<bar>\<theta>\<bar>)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. LBINT t=0..ereal T. sin (t * \<theta>) / t = sgn \<theta> * Si (T * \<bar>\<theta>\<bar>)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
0 \<le> T

goal (1 subgoal):
 1. LBINT t=0..ereal T. sin (t * \<theta>) / t = sgn \<theta> * Si (T * \<bar>\<theta>\<bar>)
[PROOF STEP]
unfolding Si_def interval_lebesgue_integral_def set_lebesgue_integral_def sgn_real_def einterval_eq zero_ereal_def
[PROOF STATE]
proof (prove)
using this:
0 \<le> T

goal (1 subgoal):
 1. (if ereal 0 \<le> ereal T then LBINT x. indicat_real {0<..<T} x *\<^sub>R (sin (x * \<theta>) / x) else - (LBINT x. indicat_real {T<..<0} x *\<^sub>R (sin (x * \<theta>) / x))) = (if \<theta> = 0 then 0 else if 0 < \<theta> then 1 else - 1) * (if ereal 0 \<le> ereal (T * \<bar>\<theta>\<bar>) then LBINT x. indicat_real {0<..<T * \<bar>\<theta>\<bar>} x *\<^sub>R (sin x / x) else - (LBINT x. indicat_real {T * \<bar>\<theta>\<bar><..<0} x *\<^sub>R (sin x / x)))
[PROOF STEP]
by (auto simp: aux1 aux2)
[PROOF STATE]
proof (state)
this:
LBINT t=0..ereal T. sin (t * \<theta>) / t = sgn \<theta> * Si (T * \<bar>\<theta>\<bar>)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma partition_by_partition_by:
  "length xs = sum_list (map sum_list ys) \<Longrightarrow>
   partition_by (partition_by xs (concat ys)) (map length ys) =
   map (\<lambda>i. partition_by (partition_by xs (map sum_list ys) ! i) (ys ! i)) [0..<length ys]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length xs = sum_list (map sum_list ys) \<Longrightarrow> partition_by (partition_by xs (concat ys)) (map length ys) = map (\<lambda>i. partition_by (partition_by xs (map sum_list ys) ! i) (ys ! i)) [0..<length ys]
[PROOF STEP]
by (auto simp: partition_by_concat2 intro: partition_by_concat_id)


[STATEMENT]
lemma path_entry_last: "path_entry (g_E G) p n \<Longrightarrow> p \<noteq> [] \<Longrightarrow> last p = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>path_entry (g_E G) p n; p \<noteq> []\<rbrakk> \<Longrightarrow> last p = 0
[PROOF STEP]
apply (induct rule: path_entry.induct)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. [] \<noteq> [] \<Longrightarrow> last [] = 0
 2. \<And>u v l. \<lbrakk>(u, v) \<in> g_E G; path_entry (g_E G) l u; l \<noteq> [] \<Longrightarrow> last l = 0; u # l \<noteq> []\<rbrakk> \<Longrightarrow> last (u # l) = 0
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>u v l. \<lbrakk>(u, v) \<in> g_E G; path_entry (g_E G) l u; l \<noteq> [] \<Longrightarrow> last l = 0; u # l \<noteq> []\<rbrakk> \<Longrightarrow> last (u # l) = 0
[PROOF STEP]
apply (simp add: path_entry_cons_conv neq_Nil_conv)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>u v l. \<lbrakk>(u, v) \<in> g_E G; path_entry (g_E G) l u; \<exists>y ys. l = y # ys \<Longrightarrow> last l = 0\<rbrakk> \<Longrightarrow> l = [] \<longrightarrow> u = 0
[PROOF STEP]
apply (auto simp add:path_entry0_empty_conv)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma rtranclp_closed_sub': "rtranclp R q q' \<Longrightarrow> q' = q \<or> (\<exists>q''. R q q'' \<and> rtranclp R q'' q')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. R\<^sup>*\<^sup>* q q' \<Longrightarrow> q' = q \<or> (\<exists>q''. R q q'' \<and> R\<^sup>*\<^sup>* q'' q')
[PROOF STEP]
using converse_rtranclpE
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?r\<^sup>*\<^sup>* ?x ?z; ?x = ?z \<Longrightarrow> ?P; \<And>y. \<lbrakk>?r ?x y; ?r\<^sup>*\<^sup>* y ?z\<rbrakk> \<Longrightarrow> ?P\<rbrakk> \<Longrightarrow> ?P

goal (1 subgoal):
 1. R\<^sup>*\<^sup>* q q' \<Longrightarrow> q' = q \<or> (\<exists>q''. R q q'' \<and> R\<^sup>*\<^sup>* q'' q')
[PROOF STEP]
by force


[STATEMENT]
lemma eq_fract:
  shows "\<And>a b c d. b \<noteq> 0 \<Longrightarrow> d \<noteq> 0 \<Longrightarrow> Fract a b = Fract c d \<longleftrightarrow> a * d = c * b"
    and "\<And>a. Fract a 0 = Fract 0 1"
    and "\<And>a c. Fract 0 a = Fract 0 c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>a b c d. \<lbrakk>b \<noteq> (0::'a); d \<noteq> (0::'a)\<rbrakk> \<Longrightarrow> (Fract a b = Fract c d) = (a * d = c * b)) &&& (\<And>a. Fract a (0::'b) = Fract (0::'b) (1::'b)) &&& (\<And>a c. Fract (0::'c) a = Fract (0::'c) c)
[PROOF STEP]
by(transfer; simp)+


[STATEMENT]
lemma sign_changes_poly_times_root_minus_x:
  fixes g :: "'a :: linordered_idom poly" and a :: 'a
  assumes nz: "g \<noteq> 0" and pos: "a > 0"
  defines "v \<equiv> coeff_sign_changes"
  shows "v ([:a, -1:] * g) - v g > 0 \<and> odd (v ([:a, -1:] * g) - v g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < v ([:a, - (1::'a):] * g) - v g \<and> odd (v ([:a, - (1::'a):] * g) - v g)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 0 < v ([:a, - (1::'a):] * g) - v g \<and> odd (v ([:a, - (1::'a):] * g) - v g)
[PROOF STEP]
have "0 < v ([:1, - 1:] * reduce_root a g) - v (reduce_root a g) \<and>
            odd (v ([:1, - 1:] * reduce_root a g) - v (reduce_root a g))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < v ([:1::'a, - (1::'a):] * reduce_root a g) - v (reduce_root a g) \<and> odd (v ([:1::'a, - (1::'a):] * reduce_root a g) - v (reduce_root a g))
[PROOF STEP]
using nz pos
[PROOF STATE]
proof (prove)
using this:
g \<noteq> 0
(0::'a) < a

goal (1 subgoal):
 1. 0 < v ([:1::'a, - (1::'a):] * reduce_root a g) - v (reduce_root a g) \<and> odd (v ([:1::'a, - (1::'a):] * reduce_root a g) - v (reduce_root a g))
[PROOF STEP]
unfolding v_def
[PROOF STATE]
proof (prove)
using this:
g \<noteq> 0
(0::'a) < a

goal (1 subgoal):
 1. 0 < sign_changes (coeffs ([:1::'a, - (1::'a):] * reduce_root a g)) - sign_changes (coeffs (reduce_root a g)) \<and> odd (sign_changes (coeffs ([:1::'a, - (1::'a):] * reduce_root a g)) - sign_changes (coeffs (reduce_root a g)))
[PROOF STEP]
by (intro sign_changes_poly_times_one_minus_x) simp_all
[PROOF STATE]
proof (state)
this:
0 < v ([:1::'a, - (1::'a):] * reduce_root a g) - v (reduce_root a g) \<and> odd (v ([:1::'a, - (1::'a):] * reduce_root a g) - v (reduce_root a g))

goal (1 subgoal):
 1. 0 < v ([:a, - (1::'a):] * g) - v g \<and> odd (v ([:a, - (1::'a):] * g) - v g)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
0 < v ([:1::'a, - (1::'a):] * reduce_root a g) - v (reduce_root a g) \<and> odd (v ([:1::'a, - (1::'a):] * reduce_root a g) - v (reduce_root a g))

goal (1 subgoal):
 1. 0 < v ([:a, - (1::'a):] * g) - v g \<and> odd (v ([:a, - (1::'a):] * g) - v g)
[PROOF STEP]
have "v ([:1, -1:] * reduce_root a g) = v (smult a ([:1, -1:] * reduce_root a g))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. v ([:1::'a, - (1::'a):] * reduce_root a g) = v (smult a ([:1::'a, - (1::'a):] * reduce_root a g))
[PROOF STEP]
unfolding v_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sign_changes (coeffs ([:1::'a, - (1::'a):] * reduce_root a g)) = sign_changes (coeffs (smult a ([:1::'a, - (1::'a):] * reduce_root a g)))
[PROOF STEP]
by (simp add: coeff_sign_changes_smult pos)
[PROOF STATE]
proof (state)
this:
v ([:1::'a, - (1::'a):] * reduce_root a g) = v (smult a ([:1::'a, - (1::'a):] * reduce_root a g))

goal (1 subgoal):
 1. 0 < v ([:a, - (1::'a):] * g) - v g \<and> odd (v ([:a, - (1::'a):] * g) - v g)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
v ([:1::'a, - (1::'a):] * reduce_root a g) = v (smult a ([:1::'a, - (1::'a):] * reduce_root a g))

goal (1 subgoal):
 1. 0 < v ([:a, - (1::'a):] * g) - v g \<and> odd (v ([:a, - (1::'a):] * g) - v g)
[PROOF STEP]
have "smult a ([:1, -1:] * reduce_root a g) = [:a:] * [:1, -1:] * reduce_root a g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. smult a ([:1::'a, - (1::'a):] * reduce_root a g) = [:a:] * [:1::'a, - (1::'a):] * reduce_root a g
[PROOF STEP]
by (subst mult.assoc) simp
[PROOF STATE]
proof (state)
this:
smult a ([:1::'a, - (1::'a):] * reduce_root a g) = [:a:] * [:1::'a, - (1::'a):] * reduce_root a g

goal (1 subgoal):
 1. 0 < v ([:a, - (1::'a):] * g) - v g \<and> odd (v ([:a, - (1::'a):] * g) - v g)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
smult a ([:1::'a, - (1::'a):] * reduce_root a g) = [:a:] * [:1::'a, - (1::'a):] * reduce_root a g

goal (1 subgoal):
 1. 0 < v ([:a, - (1::'a):] * g) - v g \<and> odd (v ([:a, - (1::'a):] * g) - v g)
[PROOF STEP]
have "[:a:] * [:1, -1:] = reduce_root a [:a, -1:]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [:a:] * [:1::'a, - (1::'a):] = reduce_root a [:a, - (1::'a):]
[PROOF STEP]
by (simp add: reduce_root_def pcompose_pCons)
[PROOF STATE]
proof (state)
this:
[:a:] * [:1::'a, - (1::'a):] = reduce_root a [:a, - (1::'a):]

goal (1 subgoal):
 1. 0 < v ([:a, - (1::'a):] * g) - v g \<and> odd (v ([:a, - (1::'a):] * g) - v g)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
[:a:] * [:1::'a, - (1::'a):] = reduce_root a [:a, - (1::'a):]

goal (1 subgoal):
 1. 0 < v ([:a, - (1::'a):] * g) - v g \<and> odd (v ([:a, - (1::'a):] * g) - v g)
[PROOF STEP]
have "\<dots> * reduce_root a g = reduce_root a ([:a, -1:] * g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. reduce_root a [:a, - (1::'a):] * reduce_root a g = reduce_root a ([:a, - (1::'a):] * g)
[PROOF STEP]
unfolding reduce_root_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [:a, - (1::'a):] \<circ>\<^sub>p [:0::'a, a:] * g \<circ>\<^sub>p [:0::'a, a:] = ([:a, - (1::'a):] * g) \<circ>\<^sub>p [:0::'a, a:]
[PROOF STEP]
by (simp only: pcompose_mult)
[PROOF STATE]
proof (state)
this:
reduce_root a [:a, - (1::'a):] * reduce_root a g = reduce_root a ([:a, - (1::'a):] * g)

goal (1 subgoal):
 1. 0 < v ([:a, - (1::'a):] * g) - v g \<and> odd (v ([:a, - (1::'a):] * g) - v g)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
reduce_root a [:a, - (1::'a):] * reduce_root a g = reduce_root a ([:a, - (1::'a):] * g)

goal (1 subgoal):
 1. 0 < v ([:a, - (1::'a):] * g) - v g \<and> odd (v ([:a, - (1::'a):] * g) - v g)
[PROOF STEP]
have "v \<dots> = v ([:a, -1:] * g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. v (reduce_root a ([:a, - (1::'a):] * g)) = v ([:a, - (1::'a):] * g)
[PROOF STEP]
by (simp add: v_def coeff_sign_changes_reduce_root pos)
[PROOF STATE]
proof (state)
this:
v (reduce_root a ([:a, - (1::'a):] * g)) = v ([:a, - (1::'a):] * g)

goal (1 subgoal):
 1. 0 < v ([:a, - (1::'a):] * g) - v g \<and> odd (v ([:a, - (1::'a):] * g) - v g)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
v (reduce_root a ([:a, - (1::'a):] * g)) = v ([:a, - (1::'a):] * g)

goal (1 subgoal):
 1. 0 < v ([:a, - (1::'a):] * g) - v g \<and> odd (v ([:a, - (1::'a):] * g) - v g)
[PROOF STEP]
have "v (reduce_root a g) = v g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. v (reduce_root a g) = v g
[PROOF STEP]
by (simp add: v_def coeff_sign_changes_reduce_root pos)
[PROOF STATE]
proof (state)
this:
v (reduce_root a g) = v g

goal (1 subgoal):
 1. 0 < v ([:a, - (1::'a):] * g) - v g \<and> odd (v ([:a, - (1::'a):] * g) - v g)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
0 < v ([:a, - (1::'a):] * g) - v g \<and> odd (v ([:a, - (1::'a):] * g) - v g)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
0 < v ([:a, - (1::'a):] * g) - v g \<and> odd (v ([:a, - (1::'a):] * g) - v g)

goal (1 subgoal):
 1. 0 < v ([:a, - (1::'a):] * g) - v g \<and> odd (v ([:a, - (1::'a):] * g) - v g)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
0 < v ([:a, - (1::'a):] * g) - v g \<and> odd (v ([:a, - (1::'a):] * g) - v g)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma AR_Times:
  fixes S :: "'a::euclidean_space set" and T :: "'b::euclidean_space set"
  assumes "AR S" "AR T" shows "AR(S \<times> T)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. AR (S \<times> T)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
AR S
AR T

goal (1 subgoal):
 1. AR (S \<times> T)
[PROOF STEP]
by (simp add: AR_ANR ANR_Times contractible_Times)


[STATEMENT]
lemma suc_le_pow_2:
  "1 < (n::nat) \<Longrightarrow> Suc n < 2 ^ n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 < n \<Longrightarrow> Suc n < 2 ^ n
[PROOF STEP]
by (induct n; clarsimp)
     (case_tac "n = 1"; clarsimp)


[STATEMENT]
lemma Ruzsa_triangle_ineq2:
  assumes U: "finite U" "U \<subseteq> G" "U \<noteq> {}"
    and   V: "finite V" "V \<subseteq> G"
    and   W: "finite W" "W \<subseteq> G"
  shows "Ruzsa_distance V W \<le> (Ruzsa_distance V U) * (Ruzsa_distance U W)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Ruzsa_distance V W \<le> Ruzsa_distance V U * Ruzsa_distance U W
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Ruzsa_distance V W \<le> Ruzsa_distance V U * Ruzsa_distance U W
[PROOF STEP]
have  "card U * card (differenceset V W) \<le> card (differenceset U V) * card (differenceset U W)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card U * card (differenceset V W) \<le> card (differenceset U V) * card (differenceset U W)
[PROOF STEP]
using assms Ruzsa_triangle_ineq1
[PROOF STATE]
proof (prove)
using this:
finite U
U \<subseteq> G
U \<noteq> {}
finite V
V \<subseteq> G
finite W
W \<subseteq> G
\<lbrakk>finite ?U; ?U \<subseteq> G; finite ?V; ?V \<subseteq> G; finite ?W; ?W \<subseteq> G\<rbrakk> \<Longrightarrow> card ?U * card (differenceset ?V ?W) \<le> card (differenceset ?U ?V) * card (differenceset ?U ?W)

goal (1 subgoal):
 1. card U * card (differenceset V W) \<le> card (differenceset U V) * card (differenceset U W)
[PROOF STEP]
by metis
  \<comment>\<open>now divide both sides with the same quantity\<close>
[PROOF STATE]
proof (state)
this:
card U * card (differenceset V W) \<le> card (differenceset U V) * card (differenceset U W)

goal (1 subgoal):
 1. Ruzsa_distance V W \<le> Ruzsa_distance V U * Ruzsa_distance U W
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
card U * card (differenceset V W) \<le> card (differenceset U V) * card (differenceset U W)
[PROOF STEP]
have "card U * card (differenceset V W) / (card U * sqrt (card V) * sqrt (card W))
         \<le> card (differenceset U V) * card (differenceset U W) / (card U * sqrt (card V) * sqrt (card W))"
[PROOF STATE]
proof (prove)
using this:
card U * card (differenceset V W) \<le> card (differenceset U V) * card (differenceset U W)

goal (1 subgoal):
 1. real (card U * card (differenceset V W)) / (real (card U) * sqrt (real (card V)) * sqrt (real (card W))) \<le> real (card (differenceset U V) * card (differenceset U W)) / (real (card U) * sqrt (real (card V)) * sqrt (real (card W)))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
card U * card (differenceset V W) \<le> card (differenceset U V) * card (differenceset U W)
finite U
U \<subseteq> G
U \<noteq> {}
finite V
V \<subseteq> G
finite W
W \<subseteq> G

goal (1 subgoal):
 1. real (card U * card (differenceset V W)) / (real (card U) * sqrt (real (card V)) * sqrt (real (card W))) \<le> real (card (differenceset U V) * card (differenceset U W)) / (real (card U) * sqrt (real (card V)) * sqrt (real (card W)))
[PROOF STEP]
by (metis divide_right_mono mult_eq_0_iff mult_left_mono of_nat_0_le_iff of_nat_mono real_sqrt_ge_0_iff)
[PROOF STATE]
proof (state)
this:
real (card U * card (differenceset V W)) / (real (card U) * sqrt (real (card V)) * sqrt (real (card W))) \<le> real (card (differenceset U V) * card (differenceset U W)) / (real (card U) * sqrt (real (card V)) * sqrt (real (card W)))

goal (1 subgoal):
 1. Ruzsa_distance V W \<le> Ruzsa_distance V U * Ruzsa_distance U W
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
real (card U * card (differenceset V W)) / (real (card U) * sqrt (real (card V)) * sqrt (real (card W))) \<le> real (card (differenceset U V) * card (differenceset U W)) / (real (card U) * sqrt (real (card V)) * sqrt (real (card W)))
[PROOF STEP]
have *: "card(differenceset V W) / (sqrt(card V) * sqrt(card W)) \<le>
                card (differenceset U V) * card (differenceset U W)
                / (card U * sqrt(card V) * sqrt(card W))"
[PROOF STATE]
proof (prove)
using this:
real (card U * card (differenceset V W)) / (real (card U) * sqrt (real (card V)) * sqrt (real (card W))) \<le> real (card (differenceset U V) * card (differenceset U W)) / (real (card U) * sqrt (real (card V)) * sqrt (real (card W)))

goal (1 subgoal):
 1. real (card (differenceset V W)) / (sqrt (real (card V)) * sqrt (real (card W))) \<le> real (card (differenceset U V) * card (differenceset U W)) / (real (card U) * sqrt (real (card V)) * sqrt (real (card W)))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
real (card U * card (differenceset V W)) / (real (card U) * sqrt (real (card V)) * sqrt (real (card W))) \<le> real (card (differenceset U V) * card (differenceset U W)) / (real (card U) * sqrt (real (card V)) * sqrt (real (card W)))
finite U
U \<subseteq> G
U \<noteq> {}
finite V
V \<subseteq> G
finite W
W \<subseteq> G

goal (1 subgoal):
 1. real (card (differenceset V W)) / (sqrt (real (card V)) * sqrt (real (card W))) \<le> real (card (differenceset U V) * card (differenceset U W)) / (real (card U) * sqrt (real (card V)) * sqrt (real (card W)))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
real (card (differenceset V W)) / (sqrt (real (card V)) * sqrt (real (card W))) \<le> real (card (differenceset U V) * card (differenceset U W)) / (real (card U) * sqrt (real (card V)) * sqrt (real (card W)))

goal (1 subgoal):
 1. Ruzsa_distance V W \<le> Ruzsa_distance V U * Ruzsa_distance U W
[PROOF STEP]
have "card (differenceset U V) * card (differenceset U W)/(card U * sqrt(card V) * sqrt(card W))
                  = card(differenceset V U) / (sqrt(card U) * sqrt(card V))*
                    card(differenceset U W) / (sqrt(card U) * sqrt(card W))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real (card (differenceset U V) * card (differenceset U W)) / (real (card U) * sqrt (real (card V)) * sqrt (real (card W))) = real (card (differenceset V U)) / (sqrt (real (card U)) * sqrt (real (card V))) * real (card (differenceset U W)) / (sqrt (real (card U)) * sqrt (real (card W)))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
finite U
U \<subseteq> G
U \<noteq> {}
finite V
V \<subseteq> G
finite W
W \<subseteq> G

goal (1 subgoal):
 1. real (card (differenceset U V) * card (differenceset U W)) / (real (card U) * sqrt (real (card V)) * sqrt (real (card W))) = real (card (differenceset V U)) / (sqrt (real (card U)) * sqrt (real (card V))) * real (card (differenceset U W)) / (sqrt (real (card U)) * sqrt (real (card W)))
[PROOF STEP]
by (simp add: divide_simps) (metis card_minusset differenceset_commute minus_minusset)
[PROOF STATE]
proof (state)
this:
real (card (differenceset U V) * card (differenceset U W)) / (real (card U) * sqrt (real (card V)) * sqrt (real (card W))) = real (card (differenceset V U)) / (sqrt (real (card U)) * sqrt (real (card V))) * real (card (differenceset U W)) / (sqrt (real (card U)) * sqrt (real (card W)))

goal (1 subgoal):
 1. Ruzsa_distance V W \<le> Ruzsa_distance V U * Ruzsa_distance U W
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
real (card (differenceset U V) * card (differenceset U W)) / (real (card U) * sqrt (real (card V)) * sqrt (real (card W))) = real (card (differenceset V U)) / (sqrt (real (card U)) * sqrt (real (card V))) * real (card (differenceset U W)) / (sqrt (real (card U)) * sqrt (real (card W)))
[PROOF STEP]
have
     "card(differenceset V W) / (sqrt(card V) * sqrt(card W)) \<le>
       card(differenceset V U) / (sqrt(card U) * sqrt(card V)) *
       card(differenceset U W) / (sqrt(card U) * sqrt(card W))"
[PROOF STATE]
proof (prove)
using this:
real (card (differenceset U V) * card (differenceset U W)) / (real (card U) * sqrt (real (card V)) * sqrt (real (card W))) = real (card (differenceset V U)) / (sqrt (real (card U)) * sqrt (real (card V))) * real (card (differenceset U W)) / (sqrt (real (card U)) * sqrt (real (card W)))

goal (1 subgoal):
 1. real (card (differenceset V W)) / (sqrt (real (card V)) * sqrt (real (card W))) \<le> real (card (differenceset V U)) / (sqrt (real (card U)) * sqrt (real (card V))) * real (card (differenceset U W)) / (sqrt (real (card U)) * sqrt (real (card W)))
[PROOF STEP]
using * assms
[PROOF STATE]
proof (prove)
using this:
real (card (differenceset U V) * card (differenceset U W)) / (real (card U) * sqrt (real (card V)) * sqrt (real (card W))) = real (card (differenceset V U)) / (sqrt (real (card U)) * sqrt (real (card V))) * real (card (differenceset U W)) / (sqrt (real (card U)) * sqrt (real (card W)))
real (card (differenceset V W)) / (sqrt (real (card V)) * sqrt (real (card W))) \<le> real (card (differenceset U V) * card (differenceset U W)) / (real (card U) * sqrt (real (card V)) * sqrt (real (card W)))
finite U
U \<subseteq> G
U \<noteq> {}
finite V
V \<subseteq> G
finite W
W \<subseteq> G

goal (1 subgoal):
 1. real (card (differenceset V W)) / (sqrt (real (card V)) * sqrt (real (card W))) \<le> real (card (differenceset V U)) / (sqrt (real (card U)) * sqrt (real (card V))) * real (card (differenceset U W)) / (sqrt (real (card U)) * sqrt (real (card W)))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
real (card (differenceset V W)) / (sqrt (real (card V)) * sqrt (real (card W))) \<le> real (card (differenceset V U)) / (sqrt (real (card U)) * sqrt (real (card V))) * real (card (differenceset U W)) / (sqrt (real (card U)) * sqrt (real (card W)))

goal (1 subgoal):
 1. Ruzsa_distance V W \<le> Ruzsa_distance V U * Ruzsa_distance U W
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
real (card (differenceset V W)) / (sqrt (real (card V)) * sqrt (real (card W))) \<le> real (card (differenceset V U)) / (sqrt (real (card U)) * sqrt (real (card V))) * real (card (differenceset U W)) / (sqrt (real (card U)) * sqrt (real (card W)))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
real (card (differenceset V W)) / (sqrt (real (card V)) * sqrt (real (card W))) \<le> real (card (differenceset V U)) / (sqrt (real (card U)) * sqrt (real (card V))) * real (card (differenceset U W)) / (sqrt (real (card U)) * sqrt (real (card W)))

goal (1 subgoal):
 1. Ruzsa_distance V W \<le> Ruzsa_distance V U * Ruzsa_distance U W
[PROOF STEP]
unfolding Ruzsa_distance_def
[PROOF STATE]
proof (prove)
using this:
real (card (differenceset V W)) / (sqrt (real (card V)) * sqrt (real (card W))) \<le> real (card (differenceset V U)) / (sqrt (real (card U)) * sqrt (real (card V))) * real (card (differenceset U W)) / (sqrt (real (card U)) * sqrt (real (card W)))

goal (1 subgoal):
 1. real (card (differenceset V W)) / (sqrt (real (card V)) * sqrt (real (card W))) \<le> real (card (differenceset V U)) / (sqrt (real (card V)) * sqrt (real (card U))) * (real (card (differenceset U W)) / (sqrt (real (card U)) * sqrt (real (card W))))
[PROOF STEP]
by (metis divide_divide_eq_left divide_divide_eq_left' times_divide_eq_right)
[PROOF STATE]
proof (state)
this:
Ruzsa_distance V W \<le> Ruzsa_distance V U * Ruzsa_distance U W

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Qp_funs_a_inv:
  assumes "x \<in> carrier (Q\<^sub>p\<^bsup>n\<^esup>)"
  assumes "f \<in> (carrier (Fun\<^bsub>n\<^esub> Q\<^sub>p))"
  shows "(\<ominus>\<^bsub>Fun\<^bsub>n\<^esub> Q\<^sub>p\<^esub> f) x = \<ominus> (f x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<ominus>\<^bsub>function_ring (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) Q\<^sub>p\<^esub> f) x = \<ominus> f x
[PROOF STEP]
using assms local.function_uminus_eval
[PROOF STATE]
proof (prove)
using this:
x \<in> carrier (Q\<^sub>p\<^bsup>n\<^esup>)
f \<in> carrier (function_ring (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) Q\<^sub>p)
\<lbrakk>?a \<in> carrier (Q\<^sub>p\<^bsup>?n\<^esup>); ?f \<in> carrier (function_ring (carrier (Q\<^sub>p\<^bsup>?n\<^esup>)) Q\<^sub>p)\<rbrakk> \<Longrightarrow> function_uminus (carrier (Q\<^sub>p\<^bsup>?n\<^esup>)) Q\<^sub>p ?f ?a = \<ominus> ?f ?a

goal (1 subgoal):
 1. (\<ominus>\<^bsub>function_ring (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) Q\<^sub>p\<^esub> f) x = \<ominus> f x
[PROOF STEP]
by (simp add: local.function_uminus_eval'')


[STATEMENT]
theorem exp_Euler: "exp(\<i> * z) = cos(z) + \<i> * sin(z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. exp (\<i> * z) = cos z + \<i> * sin z
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. exp (\<i> * z) = cos z + \<i> * sin z
[PROOF STEP]
have "(\<lambda>n. (cos_coeff n + \<i> * sin_coeff n) * z^n) = (\<lambda>n. (\<i> * z) ^ n /\<^sub>R (fact n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. (complex_of_real (cos_coeff n) + \<i> * complex_of_real (sin_coeff n)) * z ^ n) = (\<lambda>n. (\<i> * z) ^ n /\<^sub>R fact n)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. (complex_of_real (cos_coeff n) + \<i> * complex_of_real (sin_coeff n)) * z ^ n = (\<i> * z) ^ n /\<^sub>R fact n
[PROOF STEP]
fix n
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. (complex_of_real (cos_coeff n) + \<i> * complex_of_real (sin_coeff n)) * z ^ n = (\<i> * z) ^ n /\<^sub>R fact n
[PROOF STEP]
show "(cos_coeff n + \<i> * sin_coeff n) * z^n = (\<i> * z) ^ n /\<^sub>R (fact n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (complex_of_real (cos_coeff n) + \<i> * complex_of_real (sin_coeff n)) * z ^ n = (\<i> * z) ^ n /\<^sub>R fact n
[PROOF STEP]
by (auto simp: cos_coeff_def sin_coeff_def scaleR_conv_of_real field_simps elim!: evenE oddE)
[PROOF STATE]
proof (state)
this:
(complex_of_real (cos_coeff n) + \<i> * complex_of_real (sin_coeff n)) * z ^ n = (\<i> * z) ^ n /\<^sub>R fact n

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<lambda>n. (complex_of_real (cos_coeff n) + \<i> * complex_of_real (sin_coeff n)) * z ^ n) = (\<lambda>n. (\<i> * z) ^ n /\<^sub>R fact n)

goal (1 subgoal):
 1. exp (\<i> * z) = cos z + \<i> * sin z
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<lambda>n. (complex_of_real (cos_coeff n) + \<i> * complex_of_real (sin_coeff n)) * z ^ n) = (\<lambda>n. (\<i> * z) ^ n /\<^sub>R fact n)

goal (1 subgoal):
 1. exp (\<i> * z) = cos z + \<i> * sin z
[PROOF STEP]
have "\<dots> sums (exp (\<i> * z))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. (\<i> * z) ^ n /\<^sub>R fact n) sums exp (\<i> * z)
[PROOF STEP]
by (rule exp_converges)
[PROOF STATE]
proof (state)
this:
(\<lambda>n. (\<i> * z) ^ n /\<^sub>R fact n) sums exp (\<i> * z)

goal (1 subgoal):
 1. exp (\<i> * z) = cos z + \<i> * sin z
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>n. (complex_of_real (cos_coeff n) + \<i> * complex_of_real (sin_coeff n)) * z ^ n) sums exp (\<i> * z)
[PROOF STEP]
have "(\<lambda>n. (cos_coeff n + \<i> * sin_coeff n) * z^n) sums (exp (\<i> * z))"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. (complex_of_real (cos_coeff n) + \<i> * complex_of_real (sin_coeff n)) * z ^ n) sums exp (\<i> * z)

goal (1 subgoal):
 1. (\<lambda>n. (complex_of_real (cos_coeff n) + \<i> * complex_of_real (sin_coeff n)) * z ^ n) sums exp (\<i> * z)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(\<lambda>n. (complex_of_real (cos_coeff n) + \<i> * complex_of_real (sin_coeff n)) * z ^ n) sums exp (\<i> * z)

goal (1 subgoal):
 1. exp (\<i> * z) = cos z + \<i> * sin z
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(\<lambda>n. (complex_of_real (cos_coeff n) + \<i> * complex_of_real (sin_coeff n)) * z ^ n) sums exp (\<i> * z)

goal (1 subgoal):
 1. exp (\<i> * z) = cos z + \<i> * sin z
[PROOF STEP]
have "(\<lambda>n. (cos_coeff n + \<i> * sin_coeff n) * z^n) sums (cos z + \<i> * sin z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. (complex_of_real (cos_coeff n) + \<i> * complex_of_real (sin_coeff n)) * z ^ n) sums (cos z + \<i> * sin z)
[PROOF STEP]
using sums_add [OF cos_converges [of z] sin_i_eq [of z]]
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. cos_coeff n *\<^sub>R z ^ n + \<i> * complex_of_real (sin_coeff n) * z ^ n) sums (cos z + \<i> * sin z)

goal (1 subgoal):
 1. (\<lambda>n. (complex_of_real (cos_coeff n) + \<i> * complex_of_real (sin_coeff n)) * z ^ n) sums (cos z + \<i> * sin z)
[PROOF STEP]
by (simp add: field_simps scaleR_conv_of_real)
[PROOF STATE]
proof (state)
this:
(\<lambda>n. (complex_of_real (cos_coeff n) + \<i> * complex_of_real (sin_coeff n)) * z ^ n) sums (cos z + \<i> * sin z)

goal (1 subgoal):
 1. exp (\<i> * z) = cos z + \<i> * sin z
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>n. (complex_of_real (cos_coeff n) + \<i> * complex_of_real (sin_coeff n)) * z ^ n) sums exp (\<i> * z)
(\<lambda>n. (complex_of_real (cos_coeff n) + \<i> * complex_of_real (sin_coeff n)) * z ^ n) sums (cos z + \<i> * sin z)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. (complex_of_real (cos_coeff n) + \<i> * complex_of_real (sin_coeff n)) * z ^ n) sums exp (\<i> * z)
(\<lambda>n. (complex_of_real (cos_coeff n) + \<i> * complex_of_real (sin_coeff n)) * z ^ n) sums (cos z + \<i> * sin z)

goal (1 subgoal):
 1. exp (\<i> * z) = cos z + \<i> * sin z
[PROOF STEP]
using sums_unique2
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. (complex_of_real (cos_coeff n) + \<i> * complex_of_real (sin_coeff n)) * z ^ n) sums exp (\<i> * z)
(\<lambda>n. (complex_of_real (cos_coeff n) + \<i> * complex_of_real (sin_coeff n)) * z ^ n) sums (cos z + \<i> * sin z)
\<lbrakk>?f sums ?a; ?f sums ?b\<rbrakk> \<Longrightarrow> ?a = ?b

goal (1 subgoal):
 1. exp (\<i> * z) = cos z + \<i> * sin z
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
exp (\<i> * z) = cos z + \<i> * sin z

goal:
No subgoals!
[PROOF STEP]
qed