[STATEMENT]
lemma zer_iff:
  fixes p:: "real poly"
  fixes ls:: "real poly list"
  shows "poly (sum_list (map (\<lambda>x. x^2) ls)) x = 0 \<longleftrightarrow> (\<forall>i \<in> set ls. poly i x = 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (poly (sum_list (map power2 ls)) x = 0) = (\<forall>i\<in>set ls. poly i x = 0)
[PROOF STEP]
proof (induct ls)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (poly (sum_list (map power2 [])) x = 0) = (\<forall>i\<in>set []. poly i x = 0)
 2. \<And>a ls. (poly (sum_list (map power2 ls)) x = 0) = (\<forall>i\<in>set ls. poly i x = 0) \<Longrightarrow> (poly (sum_list (map power2 (a # ls))) x = 0) = (\<forall>i\<in>set (a # ls). poly i x = 0)
[PROOF STEP]
case Nil
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. (poly (sum_list (map power2 [])) x = 0) = (\<forall>i\<in>set []. poly i x = 0)
 2. \<And>a ls. (poly (sum_list (map power2 ls)) x = 0) = (\<forall>i\<in>set ls. poly i x = 0) \<Longrightarrow> (poly (sum_list (map power2 (a # ls))) x = 0) = (\<forall>i\<in>set (a # ls). poly i x = 0)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (poly (sum_list (map power2 [])) x = 0) = (\<forall>i\<in>set []. poly i x = 0)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(poly (sum_list (map power2 [])) x = 0) = (\<forall>i\<in>set []. poly i x = 0)

goal (1 subgoal):
 1. \<And>a ls. (poly (sum_list (map power2 ls)) x = 0) = (\<forall>i\<in>set ls. poly i x = 0) \<Longrightarrow> (poly (sum_list (map power2 (a # ls))) x = 0) = (\<forall>i\<in>set (a # ls). poly i x = 0)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a ls. (poly (sum_list (map power2 ls)) x = 0) = (\<forall>i\<in>set ls. poly i x = 0) \<Longrightarrow> (poly (sum_list (map power2 (a # ls))) x = 0) = (\<forall>i\<in>set (a # ls). poly i x = 0)
[PROOF STEP]
case (Cons a I1)
[PROOF STATE]
proof (state)
this:
(poly (sum_list (map power2 I1)) x = 0) = (\<forall>i\<in>set I1. poly i x = 0)

goal (1 subgoal):
 1. \<And>a ls. (poly (sum_list (map power2 ls)) x = 0) = (\<forall>i\<in>set ls. poly i x = 0) \<Longrightarrow> (poly (sum_list (map power2 (a # ls))) x = 0) = (\<forall>i\<in>set (a # ls). poly i x = 0)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(poly (sum_list (map power2 I1)) x = 0) = (\<forall>i\<in>set I1. poly i x = 0)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
(poly (sum_list (map power2 I1)) x = 0) = (\<forall>i\<in>set I1. poly i x = 0)

goal (1 subgoal):
 1. (poly (sum_list (map power2 (a # I1))) x = 0) = (\<forall>i\<in>set (a # I1). poly i x = 0)
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (poly (sum_list (map power2 I1)) x = 0) = (\<forall>i\<in>set I1. poly i x = 0) \<Longrightarrow> ((poly a x)\<^sup>2 + poly (sum_list (map power2 I1)) x = 0) = (poly a x = 0 \<and> (\<forall>i\<in>set I1. poly i x = 0))
[PROOF STEP]
apply (subst add_nonneg_eq_0_iff)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. (poly (sum_list (map power2 I1)) x = 0) = (\<forall>i\<in>set I1. poly i x = 0) \<Longrightarrow> 0 \<le> (poly a x)\<^sup>2
 2. (poly (sum_list (map power2 I1)) x = 0) = (\<forall>i\<in>set I1. poly i x = 0) \<Longrightarrow> 0 \<le> poly (sum_list (map power2 I1)) x
 3. (poly (sum_list (map power2 I1)) x = 0) = (\<forall>i\<in>set I1. poly i x = 0) \<Longrightarrow> ((poly a x)\<^sup>2 = 0 \<and> poly (sum_list (map power2 I1)) x = 0) = (poly a x = 0 \<and> (\<forall>i\<in>set I1. poly i x = 0))
[PROOF STEP]
using zero_le_power2
[PROOF STATE]
proof (prove)
using this:
(0::?'a) \<le> ?a\<^sup>2

goal (3 subgoals):
 1. (poly (sum_list (map power2 I1)) x = 0) = (\<forall>i\<in>set I1. poly i x = 0) \<Longrightarrow> 0 \<le> (poly a x)\<^sup>2
 2. (poly (sum_list (map power2 I1)) x = 0) = (\<forall>i\<in>set I1. poly i x = 0) \<Longrightarrow> 0 \<le> poly (sum_list (map power2 I1)) x
 3. (poly (sum_list (map power2 I1)) x = 0) = (\<forall>i\<in>set I1. poly i x = 0) \<Longrightarrow> ((poly a x)\<^sup>2 = 0 \<and> poly (sum_list (map power2 I1)) x = 0) = (poly a x = 0 \<and> (\<forall>i\<in>set I1. poly i x = 0))
[PROOF STEP]
apply blast
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. (poly (sum_list (map power2 I1)) x = 0) = (\<forall>i\<in>set I1. poly i x = 0) \<Longrightarrow> 0 \<le> poly (sum_list (map power2 I1)) x
 2. (poly (sum_list (map power2 I1)) x = 0) = (\<forall>i\<in>set I1. poly i x = 0) \<Longrightarrow> ((poly a x)\<^sup>2 = 0 \<and> poly (sum_list (map power2 I1)) x = 0) = (poly a x = 0 \<and> (\<forall>i\<in>set I1. poly i x = 0))
[PROOF STEP]
using sum_list_map_power2_poly
[PROOF STATE]
proof (prove)
using this:
0 \<le> poly (sum_list (map power2 ?ls)) ?x

goal (2 subgoals):
 1. (poly (sum_list (map power2 I1)) x = 0) = (\<forall>i\<in>set I1. poly i x = 0) \<Longrightarrow> 0 \<le> poly (sum_list (map power2 I1)) x
 2. (poly (sum_list (map power2 I1)) x = 0) = (\<forall>i\<in>set I1. poly i x = 0) \<Longrightarrow> ((poly a x)\<^sup>2 = 0 \<and> poly (sum_list (map power2 I1)) x = 0) = (poly a x = 0 \<and> (\<forall>i\<in>set I1. poly i x = 0))
[PROOF STEP]
apply presburger
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (poly (sum_list (map power2 I1)) x = 0) = (\<forall>i\<in>set I1. poly i x = 0) \<Longrightarrow> ((poly a x)\<^sup>2 = 0 \<and> poly (sum_list (map power2 I1)) x = 0) = (poly a x = 0 \<and> (\<forall>i\<in>set I1. poly i x = 0))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(poly (sum_list (map power2 (a # I1))) x = 0) = (\<forall>i\<in>set (a # I1). poly i x = 0)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma fimage_Suc_o_Suc_eq_fimage_Suc_iff[simp]:
  "((Suc \<circ> Suc) |`| X = Suc |`| Y) \<longleftrightarrow> (Suc |`| X = Y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((Suc \<circ> Suc) |`| X = Suc |`| Y) = (Suc |`| X = Y)
[PROOF STEP]
by (metis fimage_Suc_inj fset.map_comp)


[STATEMENT]
lemma nonEmptyListFiltered:
  assumes "P -` {True} \<inter> set l \<noteq> {}"
  shows "[n. n \<leftarrow> [0..<size l], P (l!n)] \<noteq> []"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. concat (map (\<lambda>n. if P (l ! n) then [n] else []) [0..<length l]) \<noteq> []
[PROOF STEP]
using assms filterpositions2_def lm117 lm114
[PROOF STATE]
proof (prove)
using this:
P -` {True} \<inter> set l \<noteq> {}
filterpositions2 ?P ?l = concat (map (\<lambda>n. if ?P (?l ! n) then [n] else []) [0..<length ?l])
?P -` {True} \<inter> set ?l \<noteq> {} \<Longrightarrow> \<exists>n\<in>{0..<length ?l}. ?P (?l ! n)
\<exists>n\<in>{0..<length ?l}. ?P (?l ! n) \<Longrightarrow> concat (map (\<lambda>n. if ?P (?l ! n) then [n] else []) [0..<length ?l]) \<noteq> []

goal (1 subgoal):
 1. concat (map (\<lambda>n. if P (l ! n) then [n] else []) [0..<length l]) \<noteq> []
[PROOF STEP]
by metis


[STATEMENT]
lemma Zp_res_of_pow:
  assumes "a \<in> carrier Z\<^sub>p"
  assumes "b \<in> carrier Z\<^sub>p"
  assumes "a n = b n"
  shows "(a[^]\<^bsub>Z\<^sub>p\<^esub>(k::nat)) n = (b[^]\<^bsub>Z\<^sub>p\<^esub>(k::nat)) n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a [^]\<^bsub>Z\<^sub>p\<^esub> k) n = (b [^]\<^bsub>Z\<^sub>p\<^esub> k) n
[PROOF STEP]
apply(induction k)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. (a [^]\<^bsub>Z\<^sub>p\<^esub> 0) n = (b [^]\<^bsub>Z\<^sub>p\<^esub> 0) n
 2. \<And>k. (a [^]\<^bsub>Z\<^sub>p\<^esub> k) n = (b [^]\<^bsub>Z\<^sub>p\<^esub> k) n \<Longrightarrow> (a [^]\<^bsub>Z\<^sub>p\<^esub> Suc k) n = (b [^]\<^bsub>Z\<^sub>p\<^esub> Suc k) n
[PROOF STEP]
using assms Group.nat_pow_0 to_Zp_one
[PROOF STATE]
proof (prove)
using this:
a \<in> carrier Z\<^sub>p
b \<in> carrier Z\<^sub>p
a n = b n
?x [^]\<^bsub>?G\<^esub> 0 = \<one>\<^bsub>?G\<^esub>
to_Zp \<one> = \<one>\<^bsub>Z\<^sub>p\<^esub>

goal (2 subgoals):
 1. (a [^]\<^bsub>Z\<^sub>p\<^esub> 0) n = (b [^]\<^bsub>Z\<^sub>p\<^esub> 0) n
 2. \<And>k. (a [^]\<^bsub>Z\<^sub>p\<^esub> k) n = (b [^]\<^bsub>Z\<^sub>p\<^esub> k) n \<Longrightarrow> (a [^]\<^bsub>Z\<^sub>p\<^esub> Suc k) n = (b [^]\<^bsub>Z\<^sub>p\<^esub> Suc k) n
[PROOF STEP]
apply metis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>k. (a [^]\<^bsub>Z\<^sub>p\<^esub> k) n = (b [^]\<^bsub>Z\<^sub>p\<^esub> k) n \<Longrightarrow> (a [^]\<^bsub>Z\<^sub>p\<^esub> Suc k) n = (b [^]\<^bsub>Z\<^sub>p\<^esub> Suc k) n
[PROOF STEP]
using Zp.geometric_series_id[of a b] Zp_residue_mult_zero(1) assms(1) assms(2) assms(3)
    pow_closed res_diff_zero_fact'' res_diff_zero_fact(1)
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>a \<in> carrier Z\<^sub>p; b \<in> carrier Z\<^sub>p\<rbrakk> \<Longrightarrow> a [^]\<^bsub>Z\<^sub>p\<^esub> Suc ?n \<ominus>\<^bsub>Z\<^sub>p\<^esub> b [^]\<^bsub>Z\<^sub>p\<^esub> Suc ?n = (a \<ominus>\<^bsub>Z\<^sub>p\<^esub> b) \<otimes>\<^bsub>Z\<^sub>p\<^esub> Zp.geometric_series ?n a b
?a ?k = 0 \<Longrightarrow> (?a \<otimes>\<^bsub>Z\<^sub>p\<^esub> ?b) ?k = 0
a \<in> carrier Z\<^sub>p
b \<in> carrier Z\<^sub>p
a n = b n
?a \<in> carrier Z\<^sub>p \<Longrightarrow> ?a [^]\<^bsub>Z\<^sub>p\<^esub> ?n \<in> carrier Z\<^sub>p
\<lbrakk>?a \<in> carrier Z\<^sub>p; ?b \<in> carrier Z\<^sub>p; ?a ?k = ?b ?k\<rbrakk> \<Longrightarrow> (?a \<ominus>\<^bsub>Z\<^sub>p\<^esub> ?b) ?k = 0
\<lbrakk>?a \<in> carrier Z\<^sub>p; ?b \<in> carrier Z\<^sub>p; (?a \<ominus>\<^bsub>Z\<^sub>p\<^esub> ?b) ?k = 0\<rbrakk> \<Longrightarrow> ?a ?k = ?b ?k

goal (1 subgoal):
 1. \<And>k. (a [^]\<^bsub>Z\<^sub>p\<^esub> k) n = (b [^]\<^bsub>Z\<^sub>p\<^esub> k) n \<Longrightarrow> (a [^]\<^bsub>Z\<^sub>p\<^esub> Suc k) n = (b [^]\<^bsub>Z\<^sub>p\<^esub> Suc k) n
[PROOF STEP]
by metis


[STATEMENT]
lemma huntington_3_pp[simp]:
  "-(-x \<squnion> -y) \<squnion> -(-x \<squnion> y) = --x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - (- x \<squnion> - y) \<squnion> - (- x \<squnion> y) = - - x
[PROOF STEP]
using sba2_commutative maddux_3_3
[PROOF STATE]
proof (prove)
using this:
?x \<squnion> ?y = ?y \<squnion> ?x
- (?x \<squnion> ?y) \<squnion> - (?x \<squnion> - ?y) = - ?x

goal (1 subgoal):
 1. - (- x \<squnion> - y) \<squnion> - (- x \<squnion> y) = - - x
[PROOF STEP]
by fastforce


[STATEMENT]
lemma rev_transversal_segment: "rev.transversal_segment a b = transversal_segment a b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rev.transversal_segment a b = transversal_segment a b
[PROOF STEP]
by (auto simp: transversal_segment_def rev.transversal_segment_def)


[STATEMENT]
lemma monad_zero_minus_iff: "x \<in> monad 0 \<longleftrightarrow> - x \<in> monad 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<in> monad 0) = (- x \<in> monad 0)
[PROOF STEP]
by (simp add: Infinitesimal_monad_zero_iff [symmetric])


[STATEMENT]
lemma mat_vec_mult_assoc:
  assumes "A \<in> carrier_mat n p"
and "B\<in> carrier_mat p q"
and "dim_vec v = q"
shows "A *\<^sub>v (B *\<^sub>v v) = (A * B) *\<^sub>v v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A *\<^sub>v (B *\<^sub>v v) = A * B *\<^sub>v v
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat n p
B \<in> carrier_mat p q
dim_vec v = q

goal (1 subgoal):
 1. A *\<^sub>v (B *\<^sub>v v) = A * B *\<^sub>v v
[PROOF STEP]
by auto


[STATEMENT]
lemma brnL_Suc[simp]: "n < length cl \<Longrightarrow> brnL cl (Suc n) = brnL cl n + brn (cl ! n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n < length cl \<Longrightarrow> brnL cl (Suc n) = brnL cl n + brn (cl ! n)
[PROOF STEP]
unfolding brnL_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n < length cl \<Longrightarrow> lsum brn (take (Suc n) cl) = lsum brn (take n cl) + brn (cl ! n)
[PROOF STEP]
using take_Suc_conv_app_nth[of n cl]
[PROOF STATE]
proof (prove)
using this:
n < length cl \<Longrightarrow> take (Suc n) cl = take n cl @ [cl ! n]

goal (1 subgoal):
 1. n < length cl \<Longrightarrow> lsum brn (take (Suc n) cl) = lsum brn (take n cl) + brn (cl ! n)
[PROOF STEP]
by simp


[STATEMENT]
lemma icard_Diff_singleton_if: "icard (A - {x}) = (if x \<in> A then icard A - 1 else icard A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. icard (A - {x}) = (if x \<in> A then icard A - 1 else icard A)
[PROOF STEP]
by (simp add: icard_Diff_singleton)


[STATEMENT]
lemma Lcm_factorial_eq_0_iff:
  "Lcm_factorial A = 0 \<longleftrightarrow> 0 \<in> A \<or> \<not>subset_mset.bdd_above (prime_factorization ` A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (Lcm_factorial A = (0::'a)) = ((0::'a) \<in> A \<or> \<not> subset_mset.bdd_above (prime_factorization ` A))
[PROOF STEP]
by (auto simp: Lcm_factorial_def in_Sup_multiset_iff)


[STATEMENT]
lemma SUB[import_const "-" : minus]:
  "(\<forall>m::nat. m - (id 0) = m) \<and> (\<forall>m n. m - (Suc n) = pred (m - n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>m. m - id 0 = m) \<and> (\<forall>m n. m - Suc n = pred (m - n))
[PROOF STEP]
by simp


[STATEMENT]
lemma k_mod_eq: "(\<forall>p::nat. prime p \<and> [p = 3] (mod 4) \<longrightarrow> P p) = (\<forall>k. prime (4*k+3) \<longrightarrow> P (4*k+3))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>p. prime p \<and> [p = 3] (mod 4) \<longrightarrow> P p) = (\<forall>k. prime (4 * k + 3) \<longrightarrow> P (4 * k + 3))
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<forall>p. prime p \<and> [p = 3] (mod 4) \<longrightarrow> P p \<Longrightarrow> \<forall>k. prime (4 * k + 3) \<longrightarrow> P (4 * k + 3)
 2. \<forall>k. prime (4 * k + 3) \<longrightarrow> P (4 * k + 3) \<Longrightarrow> \<forall>p. prime p \<and> [p = 3] (mod 4) \<longrightarrow> P p
[PROOF STEP]
assume a1: "\<forall>p. prime p \<and> [p = 3] (mod 4) \<longrightarrow> P p"
[PROOF STATE]
proof (state)
this:
\<forall>p. prime p \<and> [p = 3] (mod 4) \<longrightarrow> P p

goal (2 subgoals):
 1. \<forall>p. prime p \<and> [p = 3] (mod 4) \<longrightarrow> P p \<Longrightarrow> \<forall>k. prime (4 * k + 3) \<longrightarrow> P (4 * k + 3)
 2. \<forall>k. prime (4 * k + 3) \<longrightarrow> P (4 * k + 3) \<Longrightarrow> \<forall>p. prime p \<and> [p = 3] (mod 4) \<longrightarrow> P p
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
\<forall>p. prime p \<and> [p = 3] (mod 4) \<longrightarrow> P p

goal (2 subgoals):
 1. \<forall>p. prime p \<and> [p = 3] (mod 4) \<longrightarrow> P p \<Longrightarrow> \<forall>k. prime (4 * k + 3) \<longrightarrow> P (4 * k + 3)
 2. \<forall>k. prime (4 * k + 3) \<longrightarrow> P (4 * k + 3) \<Longrightarrow> \<forall>p. prime p \<and> [p = 3] (mod 4) \<longrightarrow> P p
[PROOF STEP]
fix k :: nat
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<forall>p. prime p \<and> [p = 3] (mod 4) \<longrightarrow> P p \<Longrightarrow> \<forall>k. prime (4 * k + 3) \<longrightarrow> P (4 * k + 3)
 2. \<forall>k. prime (4 * k + 3) \<longrightarrow> P (4 * k + 3) \<Longrightarrow> \<forall>p. prime p \<and> [p = 3] (mod 4) \<longrightarrow> P p
[PROOF STEP]
assume "prime (4 * k + 3)"
[PROOF STATE]
proof (state)
this:
prime (4 * k + 3)

goal (2 subgoals):
 1. \<forall>p. prime p \<and> [p = 3] (mod 4) \<longrightarrow> P p \<Longrightarrow> \<forall>k. prime (4 * k + 3) \<longrightarrow> P (4 * k + 3)
 2. \<forall>k. prime (4 * k + 3) \<longrightarrow> P (4 * k + 3) \<Longrightarrow> \<forall>p. prime p \<and> [p = 3] (mod 4) \<longrightarrow> P p
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
prime (4 * k + 3)

goal (2 subgoals):
 1. \<forall>p. prime p \<and> [p = 3] (mod 4) \<longrightarrow> P p \<Longrightarrow> \<forall>k. prime (4 * k + 3) \<longrightarrow> P (4 * k + 3)
 2. \<forall>k. prime (4 * k + 3) \<longrightarrow> P (4 * k + 3) \<Longrightarrow> \<forall>p. prime p \<and> [p = 3] (mod 4) \<longrightarrow> P p
[PROOF STEP]
hence "[4*k+3 = 3] (mod 4)"
[PROOF STATE]
proof (prove)
using this:
prime (4 * k + 3)

goal (1 subgoal):
 1. [4 * k + 3 = 3] (mod 4)
[PROOF STEP]
by (simp add: cong_add_rcancel_0_nat cong_mult_self_left)
[PROOF STATE]
proof (state)
this:
[4 * k + 3 = 3] (mod 4)

goal (2 subgoals):
 1. \<forall>p. prime p \<and> [p = 3] (mod 4) \<longrightarrow> P p \<Longrightarrow> \<forall>k. prime (4 * k + 3) \<longrightarrow> P (4 * k + 3)
 2. \<forall>k. prime (4 * k + 3) \<longrightarrow> P (4 * k + 3) \<Longrightarrow> \<forall>p. prime p \<and> [p = 3] (mod 4) \<longrightarrow> P p
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
prime (4 * k + 3)
[4 * k + 3 = 3] (mod 4)
[PROOF STEP]
have "P (4 * k + 3)"
[PROOF STATE]
proof (prove)
using this:
prime (4 * k + 3)
[4 * k + 3 = 3] (mod 4)

goal (1 subgoal):
 1. P (4 * k + 3)
[PROOF STEP]
using a1
[PROOF STATE]
proof (prove)
using this:
prime (4 * k + 3)
[4 * k + 3 = 3] (mod 4)
\<forall>p. prime p \<and> [p = 3] (mod 4) \<longrightarrow> P p

goal (1 subgoal):
 1. P (4 * k + 3)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
P (4 * k + 3)

goal (2 subgoals):
 1. \<forall>p. prime p \<and> [p = 3] (mod 4) \<longrightarrow> P p \<Longrightarrow> \<forall>k. prime (4 * k + 3) \<longrightarrow> P (4 * k + 3)
 2. \<forall>k. prime (4 * k + 3) \<longrightarrow> P (4 * k + 3) \<Longrightarrow> \<forall>p. prime p \<and> [p = 3] (mod 4) \<longrightarrow> P p
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
prime (4 * ?k2 + 3) \<Longrightarrow> P (4 * ?k2 + 3)

goal (2 subgoals):
 1. \<forall>p. prime p \<and> [p = 3] (mod 4) \<longrightarrow> P p \<Longrightarrow> \<forall>k. prime (4 * k + 3) \<longrightarrow> P (4 * k + 3)
 2. \<forall>k. prime (4 * k + 3) \<longrightarrow> P (4 * k + 3) \<Longrightarrow> \<forall>p. prime p \<and> [p = 3] (mod 4) \<longrightarrow> P p
[PROOF STEP]
thus "\<forall>k. prime (4 * k + 3) \<longrightarrow> P (4 * k + 3)"
[PROOF STATE]
proof (prove)
using this:
prime (4 * ?k2 + 3) \<Longrightarrow> P (4 * ?k2 + 3)

goal (1 subgoal):
 1. \<forall>k. prime (4 * k + 3) \<longrightarrow> P (4 * k + 3)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<forall>k. prime (4 * k + 3) \<longrightarrow> P (4 * k + 3)

goal (1 subgoal):
 1. \<forall>k. prime (4 * k + 3) \<longrightarrow> P (4 * k + 3) \<Longrightarrow> \<forall>p. prime p \<and> [p = 3] (mod 4) \<longrightarrow> P p
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<forall>k. prime (4 * k + 3) \<longrightarrow> P (4 * k + 3) \<Longrightarrow> \<forall>p. prime p \<and> [p = 3] (mod 4) \<longrightarrow> P p
[PROOF STEP]
assume a1: "\<forall>k. prime (4 * k + 3) \<longrightarrow> P (4 * k + 3)"
[PROOF STATE]
proof (state)
this:
\<forall>k. prime (4 * k + 3) \<longrightarrow> P (4 * k + 3)

goal (1 subgoal):
 1. \<forall>k. prime (4 * k + 3) \<longrightarrow> P (4 * k + 3) \<Longrightarrow> \<forall>p. prime p \<and> [p = 3] (mod 4) \<longrightarrow> P p
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
\<forall>k. prime (4 * k + 3) \<longrightarrow> P (4 * k + 3)

goal (1 subgoal):
 1. \<forall>k. prime (4 * k + 3) \<longrightarrow> P (4 * k + 3) \<Longrightarrow> \<forall>p. prime p \<and> [p = 3] (mod 4) \<longrightarrow> P p
[PROOF STEP]
fix p :: nat
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<forall>k. prime (4 * k + 3) \<longrightarrow> P (4 * k + 3) \<Longrightarrow> \<forall>p. prime p \<and> [p = 3] (mod 4) \<longrightarrow> P p
[PROOF STEP]
assume "prime p" "[p = 3] (mod 4)"
[PROOF STATE]
proof (state)
this:
prime p
[p = 3] (mod 4)

goal (1 subgoal):
 1. \<forall>k. prime (4 * k + 3) \<longrightarrow> P (4 * k + 3) \<Longrightarrow> \<forall>p. prime p \<and> [p = 3] (mod 4) \<longrightarrow> P p
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
prime p
[p = 3] (mod 4)

goal (1 subgoal):
 1. \<forall>k. prime (4 * k + 3) \<longrightarrow> P (4 * k + 3) \<Longrightarrow> \<forall>p. prime p \<and> [p = 3] (mod 4) \<longrightarrow> P p
[PROOF STEP]
with aux_lemma
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>[?a = ?b] (mod ?c); ?b < ?c\<rbrakk> \<Longrightarrow> \<exists>k. ?a = ?c * k + ?b
prime p
[p = 3] (mod 4)
[PROOF STEP]
obtain k where "p = 4*k+3"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>[?a = ?b] (mod ?c); ?b < ?c\<rbrakk> \<Longrightarrow> \<exists>k. ?a = ?c * k + ?b
prime p
[p = 3] (mod 4)

goal (1 subgoal):
 1. (\<And>k. p = 4 * k + 3 \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
p = 4 * k + 3

goal (1 subgoal):
 1. \<forall>k. prime (4 * k + 3) \<longrightarrow> P (4 * k + 3) \<Longrightarrow> \<forall>p. prime p \<and> [p = 3] (mod 4) \<longrightarrow> P p
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
prime p
[p = 3] (mod 4)
p = 4 * k + 3
[PROOF STEP]
have "P p"
[PROOF STATE]
proof (prove)
using this:
prime p
[p = 3] (mod 4)
p = 4 * k + 3

goal (1 subgoal):
 1. P p
[PROOF STEP]
using a1
[PROOF STATE]
proof (prove)
using this:
prime p
[p = 3] (mod 4)
p = 4 * k + 3
\<forall>k. prime (4 * k + 3) \<longrightarrow> P (4 * k + 3)

goal (1 subgoal):
 1. P p
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
P p

goal (1 subgoal):
 1. \<forall>k. prime (4 * k + 3) \<longrightarrow> P (4 * k + 3) \<Longrightarrow> \<forall>p. prime p \<and> [p = 3] (mod 4) \<longrightarrow> P p
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
\<lbrakk>prime ?p2; [?p2 = 3] (mod 4)\<rbrakk> \<Longrightarrow> P ?p2

goal (1 subgoal):
 1. \<forall>k. prime (4 * k + 3) \<longrightarrow> P (4 * k + 3) \<Longrightarrow> \<forall>p. prime p \<and> [p = 3] (mod 4) \<longrightarrow> P p
[PROOF STEP]
thus "\<forall>p. prime p \<and> [p = 3] (mod 4) \<longrightarrow> P p"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>prime ?p2; [?p2 = 3] (mod 4)\<rbrakk> \<Longrightarrow> P ?p2

goal (1 subgoal):
 1. \<forall>p. prime p \<and> [p = 3] (mod 4) \<longrightarrow> P p
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<forall>p. prime p \<and> [p = 3] (mod 4) \<longrightarrow> P p

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma spy_method_via_h_framework_completeness_and_finiteness :
  fixes M1 :: "('a::linorder,'b::linorder,'c::linorder) fsm"
  fixes M2 :: "('e,'b,'c) fsm"
  assumes "observable M1"
  and     "observable M2"
  and     "minimal M1"
  and     "minimal M2"
  and     "size_r M1 \<le> m"
  and     "size M2 \<le> m"
  and     "inputs M2 = inputs M1"
  and     "outputs M2 = outputs M1"
shows "(L M1 = L M2) \<longleftrightarrow> ((L M1 \<inter> set (spy_method_via_h_framework M1 m)) = (L M2 \<inter> set (spy_method_via_h_framework M1 m)))"
and "finite_tree (spy_method_via_h_framework M1 m)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (L M1 = L M2) = (L M1 \<inter> Prefix_Tree.set (spy_method_via_h_framework M1 m) = L M2 \<inter> Prefix_Tree.set (spy_method_via_h_framework M1 m)) &&& finite_tree (spy_method_via_h_framework M1 m)
[PROOF STEP]
using h_framework_static_with_simple_graph_completeness_and_finiteness[OF assms, where dist_fun="(\<lambda> k q . get_HSI M1 q)"]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<And>q1 q2. \<lbrakk>q1 \<in> FSM.states M1; q2 \<in> FSM.states M1; q1 \<noteq> q2\<rbrakk> \<Longrightarrow> \<exists>io. \<forall>k1 k2. io \<in> Prefix_Tree.set (get_HSI M1 q1) \<inter> Prefix_Tree.set (get_HSI M1 q2) \<and> distinguishes M1 q1 q2 io; \<And>q k. q \<in> FSM.states M1 \<Longrightarrow> finite_tree (get_HSI M1 q)\<rbrakk> \<Longrightarrow> (L M1 = L M2) = (L M1 \<inter> Prefix_Tree.set (h_framework_static_with_simple_graph M1 (\<lambda>k. get_HSI M1) m) = L M2 \<inter> Prefix_Tree.set (h_framework_static_with_simple_graph M1 (\<lambda>k. get_HSI M1) m))
\<lbrakk>\<And>q1 q2. \<lbrakk>q1 \<in> FSM.states M1; q2 \<in> FSM.states M1; q1 \<noteq> q2\<rbrakk> \<Longrightarrow> \<exists>io. \<forall>k1 k2. io \<in> Prefix_Tree.set (get_HSI M1 q1) \<inter> Prefix_Tree.set (get_HSI M1 q2) \<and> distinguishes M1 q1 q2 io; \<And>q k. q \<in> FSM.states M1 \<Longrightarrow> finite_tree (get_HSI M1 q)\<rbrakk> \<Longrightarrow> finite_tree (h_framework_static_with_simple_graph M1 (\<lambda>k. get_HSI M1) m)

goal (1 subgoal):
 1. (L M1 = L M2) = (L M1 \<inter> Prefix_Tree.set (spy_method_via_h_framework M1 m) = L M2 \<inter> Prefix_Tree.set (spy_method_via_h_framework M1 m)) &&& finite_tree (spy_method_via_h_framework M1 m)
[PROOF STEP]
using get_HSI_distinguishes[OF assms(1,3)]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<And>q1 q2. \<lbrakk>q1 \<in> FSM.states M1; q2 \<in> FSM.states M1; q1 \<noteq> q2\<rbrakk> \<Longrightarrow> \<exists>io. \<forall>k1 k2. io \<in> Prefix_Tree.set (get_HSI M1 q1) \<inter> Prefix_Tree.set (get_HSI M1 q2) \<and> distinguishes M1 q1 q2 io; \<And>q k. q \<in> FSM.states M1 \<Longrightarrow> finite_tree (get_HSI M1 q)\<rbrakk> \<Longrightarrow> (L M1 = L M2) = (L M1 \<inter> Prefix_Tree.set (h_framework_static_with_simple_graph M1 (\<lambda>k. get_HSI M1) m) = L M2 \<inter> Prefix_Tree.set (h_framework_static_with_simple_graph M1 (\<lambda>k. get_HSI M1) m))
\<lbrakk>\<And>q1 q2. \<lbrakk>q1 \<in> FSM.states M1; q2 \<in> FSM.states M1; q1 \<noteq> q2\<rbrakk> \<Longrightarrow> \<exists>io. \<forall>k1 k2. io \<in> Prefix_Tree.set (get_HSI M1 q1) \<inter> Prefix_Tree.set (get_HSI M1 q2) \<and> distinguishes M1 q1 q2 io; \<And>q k. q \<in> FSM.states M1 \<Longrightarrow> finite_tree (get_HSI M1 q)\<rbrakk> \<Longrightarrow> finite_tree (h_framework_static_with_simple_graph M1 (\<lambda>k. get_HSI M1) m)
\<lbrakk>?q1.0 \<in> FSM.states M1; ?q2.0 \<in> FSM.states M1; ?q1.0 \<noteq> ?q2.0\<rbrakk> \<Longrightarrow> \<exists>io\<in>Prefix_Tree.set (get_HSI M1 ?q1.0) \<inter> Prefix_Tree.set (get_HSI M1 ?q2.0). distinguishes M1 ?q1.0 ?q2.0 io

goal (1 subgoal):
 1. (L M1 = L M2) = (L M1 \<inter> Prefix_Tree.set (spy_method_via_h_framework M1 m) = L M2 \<inter> Prefix_Tree.set (spy_method_via_h_framework M1 m)) &&& finite_tree (spy_method_via_h_framework M1 m)
[PROOF STEP]
using get_HSI_finite
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<And>q1 q2. \<lbrakk>q1 \<in> FSM.states M1; q2 \<in> FSM.states M1; q1 \<noteq> q2\<rbrakk> \<Longrightarrow> \<exists>io. \<forall>k1 k2. io \<in> Prefix_Tree.set (get_HSI M1 q1) \<inter> Prefix_Tree.set (get_HSI M1 q2) \<and> distinguishes M1 q1 q2 io; \<And>q k. q \<in> FSM.states M1 \<Longrightarrow> finite_tree (get_HSI M1 q)\<rbrakk> \<Longrightarrow> (L M1 = L M2) = (L M1 \<inter> Prefix_Tree.set (h_framework_static_with_simple_graph M1 (\<lambda>k. get_HSI M1) m) = L M2 \<inter> Prefix_Tree.set (h_framework_static_with_simple_graph M1 (\<lambda>k. get_HSI M1) m))
\<lbrakk>\<And>q1 q2. \<lbrakk>q1 \<in> FSM.states M1; q2 \<in> FSM.states M1; q1 \<noteq> q2\<rbrakk> \<Longrightarrow> \<exists>io. \<forall>k1 k2. io \<in> Prefix_Tree.set (get_HSI M1 q1) \<inter> Prefix_Tree.set (get_HSI M1 q2) \<and> distinguishes M1 q1 q2 io; \<And>q k. q \<in> FSM.states M1 \<Longrightarrow> finite_tree (get_HSI M1 q)\<rbrakk> \<Longrightarrow> finite_tree (h_framework_static_with_simple_graph M1 (\<lambda>k. get_HSI M1) m)
\<lbrakk>?q1.0 \<in> FSM.states M1; ?q2.0 \<in> FSM.states M1; ?q1.0 \<noteq> ?q2.0\<rbrakk> \<Longrightarrow> \<exists>io\<in>Prefix_Tree.set (get_HSI M1 ?q1.0) \<inter> Prefix_Tree.set (get_HSI M1 ?q2.0). distinguishes M1 ?q1.0 ?q2.0 io
finite_tree (get_HSI ?M ?q)

goal (1 subgoal):
 1. (L M1 = L M2) = (L M1 \<inter> Prefix_Tree.set (spy_method_via_h_framework M1 m) = L M2 \<inter> Prefix_Tree.set (spy_method_via_h_framework M1 m)) &&& finite_tree (spy_method_via_h_framework M1 m)
[PROOF STEP]
unfolding spy_method_via_h_framework_def
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<And>q1 q2. \<lbrakk>q1 \<in> FSM.states M1; q2 \<in> FSM.states M1; q1 \<noteq> q2\<rbrakk> \<Longrightarrow> \<exists>io. \<forall>k1 k2. io \<in> Prefix_Tree.set (get_HSI M1 q1) \<inter> Prefix_Tree.set (get_HSI M1 q2) \<and> distinguishes M1 q1 q2 io; \<And>q k. q \<in> FSM.states M1 \<Longrightarrow> finite_tree (get_HSI M1 q)\<rbrakk> \<Longrightarrow> (L M1 = L M2) = (L M1 \<inter> Prefix_Tree.set (h_framework_static_with_simple_graph M1 (\<lambda>k. get_HSI M1) m) = L M2 \<inter> Prefix_Tree.set (h_framework_static_with_simple_graph M1 (\<lambda>k. get_HSI M1) m))
\<lbrakk>\<And>q1 q2. \<lbrakk>q1 \<in> FSM.states M1; q2 \<in> FSM.states M1; q1 \<noteq> q2\<rbrakk> \<Longrightarrow> \<exists>io. \<forall>k1 k2. io \<in> Prefix_Tree.set (get_HSI M1 q1) \<inter> Prefix_Tree.set (get_HSI M1 q2) \<and> distinguishes M1 q1 q2 io; \<And>q k. q \<in> FSM.states M1 \<Longrightarrow> finite_tree (get_HSI M1 q)\<rbrakk> \<Longrightarrow> finite_tree (h_framework_static_with_simple_graph M1 (\<lambda>k. get_HSI M1) m)
\<lbrakk>?q1.0 \<in> FSM.states M1; ?q2.0 \<in> FSM.states M1; ?q1.0 \<noteq> ?q2.0\<rbrakk> \<Longrightarrow> \<exists>io\<in>Prefix_Tree.set (get_HSI M1 ?q1.0) \<inter> Prefix_Tree.set (get_HSI M1 ?q2.0). distinguishes M1 ?q1.0 ?q2.0 io
finite_tree (get_HSI ?M ?q)

goal (1 subgoal):
 1. (L M1 = L M2) = (L M1 \<inter> Prefix_Tree.set (h_framework_static_with_simple_graph M1 (\<lambda>k. get_HSI M1) m) = L M2 \<inter> Prefix_Tree.set (h_framework_static_with_simple_graph M1 (\<lambda>k. get_HSI M1) m)) &&& finite_tree (h_framework_static_with_simple_graph M1 (\<lambda>k. get_HSI M1) m)
[PROOF STEP]
by blast+


[STATEMENT]
lemma contour_integral_bound_part_circlepath:
  assumes "f contour_integrable_on part_circlepath c r a b"
  assumes "B \<ge> 0" "r \<ge> 0" "\<And>x. x \<in> path_image (part_circlepath c r a b) \<Longrightarrow> norm (f x) \<le> B"
  shows   "norm (contour_integral (part_circlepath c r a b) f) \<le> B * r * \<bar>b - a\<bar>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cmod (contour_integral (part_circlepath c r a b) f) \<le> B * r * \<bar>b - a\<bar>
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. cmod (contour_integral (part_circlepath c r a b) f) \<le> B * r * \<bar>b - a\<bar>
[PROOF STEP]
let ?I = "integral {0..1} (\<lambda>x. f (part_circlepath c r a b x) * \<i> * of_real (r * (b - a)) *
              exp (\<i> * linepath a b x))"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. cmod (contour_integral (part_circlepath c r a b) f) \<le> B * r * \<bar>b - a\<bar>
[PROOF STEP]
have "norm ?I \<le> integral {0..1} (\<lambda>x::real. B * 1 * (r * \<bar>b - a\<bar>) * 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cmod (integral {0..1} (\<lambda>x. f (part_circlepath c r a b x) * \<i> * complex_of_real (r * (b - a)) * exp (\<i> * complex_of_real (linepath a b x)))) \<le> integral {0..1} (\<lambda>x. B * 1 * (r * \<bar>b - a\<bar>) * 1)
[PROOF STEP]
proof (rule integral_norm_bound_integral, goal_cases)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. (\<lambda>x. f (part_circlepath c r a b x) * \<i> * complex_of_real (r * (b - a)) * exp (\<i> * complex_of_real (linepath a b x))) integrable_on {0..1}
 2. (\<lambda>x. B * 1 * (r * \<bar>b - a\<bar>) * 1) integrable_on {0..1}
 3. \<And>x. x \<in> {0..1} \<Longrightarrow> cmod (f (part_circlepath c r a b x) * \<i> * complex_of_real (r * (b - a)) * exp (\<i> * complex_of_real (linepath a b x))) \<le> B * 1 * (r * \<bar>b - a\<bar>) * 1
[PROOF STEP]
case 1
[PROOF STATE]
proof (state)
this:

goal (3 subgoals):
 1. (\<lambda>x. f (part_circlepath c r a b x) * \<i> * complex_of_real (r * (b - a)) * exp (\<i> * complex_of_real (linepath a b x))) integrable_on {0..1}
 2. (\<lambda>x. B * 1 * (r * \<bar>b - a\<bar>) * 1) integrable_on {0..1}
 3. \<And>x. x \<in> {0..1} \<Longrightarrow> cmod (f (part_circlepath c r a b x) * \<i> * complex_of_real (r * (b - a)) * exp (\<i> * complex_of_real (linepath a b x))) \<le> B * 1 * (r * \<bar>b - a\<bar>) * 1
[PROOF STEP]
with assms(1)
[PROOF STATE]
proof (chain)
picking this:
f contour_integrable_on part_circlepath c r a b
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
f contour_integrable_on part_circlepath c r a b

goal (1 subgoal):
 1. (\<lambda>x. f (part_circlepath c r a b x) * \<i> * complex_of_real (r * (b - a)) * exp (\<i> * complex_of_real (linepath a b x))) integrable_on {0..1}
[PROOF STEP]
by (simp add: contour_integrable_on vector_derivative_part_circlepath mult_ac)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. f (part_circlepath c r a b x) * \<i> * complex_of_real (r * (b - a)) * exp (\<i> * complex_of_real (linepath a b x))) integrable_on {0..1}

goal (2 subgoals):
 1. (\<lambda>x. B * 1 * (r * \<bar>b - a\<bar>) * 1) integrable_on {0..1}
 2. \<And>x. x \<in> {0..1} \<Longrightarrow> cmod (f (part_circlepath c r a b x) * \<i> * complex_of_real (r * (b - a)) * exp (\<i> * complex_of_real (linepath a b x))) \<le> B * 1 * (r * \<bar>b - a\<bar>) * 1
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (\<lambda>x. B * 1 * (r * \<bar>b - a\<bar>) * 1) integrable_on {0..1}
 2. \<And>x. x \<in> {0..1} \<Longrightarrow> cmod (f (part_circlepath c r a b x) * \<i> * complex_of_real (r * (b - a)) * exp (\<i> * complex_of_real (linepath a b x))) \<le> B * 1 * (r * \<bar>b - a\<bar>) * 1
[PROOF STEP]
case (3 x)
[PROOF STATE]
proof (state)
this:
x \<in> {0..1}

goal (2 subgoals):
 1. (\<lambda>x. B * 1 * (r * \<bar>b - a\<bar>) * 1) integrable_on {0..1}
 2. \<And>x. x \<in> {0..1} \<Longrightarrow> cmod (f (part_circlepath c r a b x) * \<i> * complex_of_real (r * (b - a)) * exp (\<i> * complex_of_real (linepath a b x))) \<le> B * 1 * (r * \<bar>b - a\<bar>) * 1
[PROOF STEP]
with assms(2-)
[PROOF STATE]
proof (chain)
picking this:
0 \<le> B
0 \<le> r
?x \<in> path_image (part_circlepath c r a b) \<Longrightarrow> cmod (f ?x) \<le> B
x \<in> {0..1}
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
0 \<le> B
0 \<le> r
?x \<in> path_image (part_circlepath c r a b) \<Longrightarrow> cmod (f ?x) \<le> B
x \<in> {0..1}

goal (1 subgoal):
 1. cmod (f (part_circlepath c r a b x) * \<i> * complex_of_real (r * (b - a)) * exp (\<i> * complex_of_real (linepath a b x))) \<le> B * 1 * (r * \<bar>b - a\<bar>) * 1
[PROOF STEP]
unfolding norm_mult norm_of_real abs_mult
[PROOF STATE]
proof (prove)
using this:
0 \<le> B
0 \<le> r
?x \<in> path_image (part_circlepath c r a b) \<Longrightarrow> cmod (f ?x) \<le> B
x \<in> {0..1}

goal (1 subgoal):
 1. cmod (f (part_circlepath c r a b x)) * cmod \<i> * (\<bar>r\<bar> * \<bar>b - a\<bar>) * cmod (exp (\<i> * complex_of_real (linepath a b x))) \<le> B * 1 * (r * \<bar>b - a\<bar>) * 1
[PROOF STEP]
by (intro mult_mono) (auto simp: path_image_def)
[PROOF STATE]
proof (state)
this:
cmod (f (part_circlepath c r a b x) * \<i> * complex_of_real (r * (b - a)) * exp (\<i> * complex_of_real (linepath a b x))) \<le> B * 1 * (r * \<bar>b - a\<bar>) * 1

goal (1 subgoal):
 1. (\<lambda>x. B * 1 * (r * \<bar>b - a\<bar>) * 1) integrable_on {0..1}
[PROOF STEP]
qed auto
[PROOF STATE]
proof (state)
this:
cmod (integral {0..1} (\<lambda>x. f (part_circlepath c r a b x) * \<i> * complex_of_real (r * (b - a)) * exp (\<i> * complex_of_real (linepath a b x)))) \<le> integral {0..1} (\<lambda>x. B * 1 * (r * \<bar>b - a\<bar>) * 1)

goal (1 subgoal):
 1. cmod (contour_integral (part_circlepath c r a b) f) \<le> B * r * \<bar>b - a\<bar>
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
cmod (integral {0..1} (\<lambda>x. f (part_circlepath c r a b x) * \<i> * complex_of_real (r * (b - a)) * exp (\<i> * complex_of_real (linepath a b x)))) \<le> integral {0..1} (\<lambda>x. B * 1 * (r * \<bar>b - a\<bar>) * 1)

goal (1 subgoal):
 1. cmod (contour_integral (part_circlepath c r a b) f) \<le> B * r * \<bar>b - a\<bar>
[PROOF STEP]
have "?I = contour_integral (part_circlepath c r a b) f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral {0..1} (\<lambda>x. f (part_circlepath c r a b x) * \<i> * complex_of_real (r * (b - a)) * exp (\<i> * complex_of_real (linepath a b x))) = contour_integral (part_circlepath c r a b) f
[PROOF STEP]
by (simp add: contour_integral_integral vector_derivative_part_circlepath mult_ac)
[PROOF STATE]
proof (state)
this:
integral {0..1} (\<lambda>x. f (part_circlepath c r a b x) * \<i> * complex_of_real (r * (b - a)) * exp (\<i> * complex_of_real (linepath a b x))) = contour_integral (part_circlepath c r a b) f

goal (1 subgoal):
 1. cmod (contour_integral (part_circlepath c r a b) f) \<le> B * r * \<bar>b - a\<bar>
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
cmod (contour_integral (part_circlepath c r a b) f) \<le> integral {0..1} (\<lambda>x. B * 1 * (r * \<bar>b - a\<bar>) * 1)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
cmod (contour_integral (part_circlepath c r a b) f) \<le> integral {0..1} (\<lambda>x. B * 1 * (r * \<bar>b - a\<bar>) * 1)

goal (1 subgoal):
 1. cmod (contour_integral (part_circlepath c r a b) f) \<le> B * r * \<bar>b - a\<bar>
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
cmod (contour_integral (part_circlepath c r a b) f) \<le> B * r * \<bar>b - a\<bar>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma matpow_1_commute: "matpow (A + mat 1) n ** A = A ** matpow (A + mat 1) n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. matpow (A + mat 1) n ** A = A ** matpow (A + mat 1) n
[PROOF STEP]
by (induct n, auto simp: matrix_add_rdistrib matrix_add_ldistrib matrix_mul_rid matrix_mul_lid
  matrix_mul_assoc[symmetric])


[STATEMENT]
lemma bigo_useful_add: "f =o O(h) \<Longrightarrow> g =o O(h) \<Longrightarrow> f + g =o O(h)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>f \<in> O(h); g \<in> O(h)\<rbrakk> \<Longrightarrow> f + g \<in> O(h)
[PROOF STEP]
apply (subst bigo_plus_idemp [symmetric])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>f \<in> O(h); g \<in> O(h)\<rbrakk> \<Longrightarrow> f + g \<in> O(h) + O(h)
[PROOF STEP]
apply (rule set_plus_intro)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>f \<in> O(h); g \<in> O(h)\<rbrakk> \<Longrightarrow> f \<in> O(h)
 2. \<lbrakk>f \<in> O(h); g \<in> O(h)\<rbrakk> \<Longrightarrow> g \<in> O(h)
[PROOF STEP]
apply assumption+
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma finite_natarray2: "finite {(x, y). x < (m::nat) & y < (n::nat)}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {(x, y). x < m \<and> y < n}
[PROOF STEP]
by simp


[STATEMENT]
lemma F_Mprefix :
"F(\<box> x \<in> A \<rightarrow> P x) = {(tr,ref). tr=[] \<and>  ref \<inter> (ev ` A) = {}} \<union>
                     {(tr,ref). tr \<noteq> [] \<and> hd tr \<in> (ev ` A) \<and>
                               (\<exists> a. ev a = (hd tr) \<and> (tl tr,ref) \<in> F(P a))}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. F (Mprefix A P) = {(tr, ref). tr = [] \<and> ref \<inter> ev ` A = {}} \<union> {(tr, ref). tr \<noteq> [] \<and> hd tr \<in> ev ` A \<and> (\<exists>a. ev a = hd tr \<and> (tl tr, ref) \<in> F (P a))}
[PROOF STEP]
by(simp add:Mprefix_def F_def Rep_Abs_Mp'' FAILURES_def)


[STATEMENT]
lemma T\<^sub>p_split: "length qs1=length as1 \<Longrightarrow> T\<^sub>p s (qs1@qs2) (as1@as2) = T\<^sub>p s qs1 as1 + T\<^sub>p (steps s qs1 as1) qs2 as2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length qs1 = length as1 \<Longrightarrow> T\<^sub>p s (qs1 @ qs2) (as1 @ as2) = T\<^sub>p s qs1 as1 + T\<^sub>p (Partial_Cost_Model.steps s qs1 as1) qs2 as2
[PROOF STEP]
apply(induct qs1 as1 arbitrary: s rule: list_induct2)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>s. T\<^sub>p s ([] @ qs2) ([] @ as2) = T\<^sub>p s [] [] + T\<^sub>p (Partial_Cost_Model.steps s [] []) qs2 as2
 2. \<And>x xs y ys s. \<lbrakk>length xs = length ys; \<And>s. T\<^sub>p s (xs @ qs2) (ys @ as2) = T\<^sub>p s xs ys + T\<^sub>p (Partial_Cost_Model.steps s xs ys) qs2 as2\<rbrakk> \<Longrightarrow> T\<^sub>p s ((x # xs) @ qs2) ((y # ys) @ as2) = T\<^sub>p s (x # xs) (y # ys) + T\<^sub>p (Partial_Cost_Model.steps s (x # xs) (y # ys)) qs2 as2
[PROOF STEP]
by(simp_all)


[STATEMENT]
lemma numeral_less_eq_signed_real_of_word_sum:
  \<open>numeral n \<le> signed_real_of_word v + signed_real_of_word w
    \<longleftrightarrow> numeral n \<le> sint v + sint w\<close> (is \<open>?P \<longleftrightarrow> ?Q\<close>)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (numeral n \<le> signed_real_of_word v + signed_real_of_word w) = (numeral n \<le> sint v + sint w)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (numeral n \<le> signed_real_of_word v + signed_real_of_word w) = (numeral n \<le> sint v + sint w)
[PROOF STEP]
have \<open>?Q \<longleftrightarrow> real_of_int (numeral n) \<le> real_of_int (sint v + sint w)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (numeral n \<le> sint v + sint w) = (real_of_int (numeral n) \<le> real_of_int (sint v + sint w))
[PROOF STEP]
by (simp only: of_int_le_iff)
[PROOF STATE]
proof (state)
this:
(numeral n \<le> sint v + sint w) = (real_of_int (numeral n) \<le> real_of_int (sint v + sint w))

goal (1 subgoal):
 1. (numeral n \<le> signed_real_of_word v + signed_real_of_word w) = (numeral n \<le> sint v + sint w)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(numeral n \<le> sint v + sint w) = (real_of_int (numeral n) \<le> real_of_int (sint v + sint w))

goal (1 subgoal):
 1. (numeral n \<le> signed_real_of_word v + signed_real_of_word w) = (numeral n \<le> sint v + sint w)
[PROOF STEP]
have \<open>\<dots> \<longleftrightarrow> ?P\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (real_of_int (numeral n) \<le> real_of_int (sint v + sint w)) = (numeral n \<le> signed_real_of_word v + signed_real_of_word w)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(real_of_int (numeral n) \<le> real_of_int (sint v + sint w)) = (numeral n \<le> signed_real_of_word v + signed_real_of_word w)

goal (1 subgoal):
 1. (numeral n \<le> signed_real_of_word v + signed_real_of_word w) = (numeral n \<le> sint v + sint w)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(numeral n \<le> sint v + sint w) = (numeral n \<le> signed_real_of_word v + signed_real_of_word w)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(numeral n \<le> sint v + sint w) = (numeral n \<le> signed_real_of_word v + signed_real_of_word w)

goal (1 subgoal):
 1. (numeral n \<le> signed_real_of_word v + signed_real_of_word w) = (numeral n \<le> sint v + sint w)
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
(numeral n \<le> signed_real_of_word v + signed_real_of_word w) = (numeral n \<le> sint v + sint w)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma column_Gram_Schmidt_column_k_repeated_0:
  fixes A::"'a::{real_inner}^'n::{mod_type}^'m::{mod_type}"
  assumes i_not_k: "i\<noteq>k" and ik: "i<k"
  and c_eq: "column k (Gram_Schmidt_column_k A (to_nat k))
  = column i (Gram_Schmidt_column_k A (to_nat k))"
  and o: "pairwise orthogonal {column i A|i. i<k}"
  shows "column k (Gram_Schmidt_column_k A (to_nat k)) = 0"
  and "column i (Gram_Schmidt_column_k A (to_nat k)) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. column k (Gram_Schmidt_column_k A (mod_type_class.to_nat k)) = 0 &&& column i (Gram_Schmidt_column_k A (mod_type_class.to_nat k)) = 0
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. column k (Gram_Schmidt_column_k A (mod_type_class.to_nat k)) = 0
 2. column i (Gram_Schmidt_column_k A (mod_type_class.to_nat k)) = 0
[PROOF STEP]
have "column k (Gram_Schmidt_column_k A (to_nat k))
    = column k A - (\<Sum>x\<in>{column i A |i. i < k}. (x \<bullet> column k A / (x \<bullet> x)) *\<^sub>R x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. column k (Gram_Schmidt_column_k A (mod_type_class.to_nat k)) = column k A - (\<Sum>x\<in>{column i A |i. i < k}. (x \<bullet> column k A / (x \<bullet> x)) *\<^sub>R x)
[PROOF STEP]
by (rule column_Gram_Schmidt_column_k)
[PROOF STATE]
proof (state)
this:
column k (Gram_Schmidt_column_k A (mod_type_class.to_nat k)) = column k A - (\<Sum>x\<in>{column i A |i. i < k}. (x \<bullet> column k A / (x \<bullet> x)) *\<^sub>R x)

goal (2 subgoals):
 1. column k (Gram_Schmidt_column_k A (mod_type_class.to_nat k)) = 0
 2. column i (Gram_Schmidt_column_k A (mod_type_class.to_nat k)) = 0
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
column k (Gram_Schmidt_column_k A (mod_type_class.to_nat k)) = column k A - (\<Sum>x\<in>{column i A |i. i < k}. (x \<bullet> column k A / (x \<bullet> x)) *\<^sub>R x)

goal (2 subgoals):
 1. column k (Gram_Schmidt_column_k A (mod_type_class.to_nat k)) = 0
 2. column i (Gram_Schmidt_column_k A (mod_type_class.to_nat k)) = 0
[PROOF STEP]
have "... = column k A - proj_onto (column k A) {column i A |i. i < k}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. column k A - (\<Sum>x\<in>{column i A |i. i < k}. (x \<bullet> column k A / (x \<bullet> x)) *\<^sub>R x) = column k A - proj_onto (column k A) {column i A |i. i < k}
[PROOF STEP]
unfolding proj_onto_def proj_def[abs_def]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. column k A - (\<Sum>x\<in>{column i A |i. i < k}. (x \<bullet> column k A / (x \<bullet> x)) *\<^sub>R x) = column k A - (\<Sum>u\<in>{column i A |i. i < k}. (column k A \<bullet> u / (u \<bullet> u)) *\<^sub>R u)
[PROOF STEP]
by (metis (no_types, lifting) inner_commute)
[PROOF STATE]
proof (state)
this:
column k A - (\<Sum>x\<in>{column i A |i. i < k}. (x \<bullet> column k A / (x \<bullet> x)) *\<^sub>R x) = column k A - proj_onto (column k A) {column i A |i. i < k}

goal (2 subgoals):
 1. column k (Gram_Schmidt_column_k A (mod_type_class.to_nat k)) = 0
 2. column i (Gram_Schmidt_column_k A (mod_type_class.to_nat k)) = 0
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
column k (Gram_Schmidt_column_k A (mod_type_class.to_nat k)) = column k A - proj_onto (column k A) {column i A |i. i < k}
[PROOF STEP]
have col_k_rw: "column k (Gram_Schmidt_column_k A (to_nat k))
    = column k A - proj_onto (column k A) {column i A |i. i < k}"
[PROOF STATE]
proof (prove)
using this:
column k (Gram_Schmidt_column_k A (mod_type_class.to_nat k)) = column k A - proj_onto (column k A) {column i A |i. i < k}

goal (1 subgoal):
 1. column k (Gram_Schmidt_column_k A (mod_type_class.to_nat k)) = column k A - proj_onto (column k A) {column i A |i. i < k}
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
column k (Gram_Schmidt_column_k A (mod_type_class.to_nat k)) = column k A - proj_onto (column k A) {column i A |i. i < k}

goal (2 subgoals):
 1. column k (Gram_Schmidt_column_k A (mod_type_class.to_nat k)) = 0
 2. column i (Gram_Schmidt_column_k A (mod_type_class.to_nat k)) = 0
[PROOF STEP]
have "orthogonal (column k (Gram_Schmidt_column_k A (to_nat k)))
    (column i (Gram_Schmidt_column_k A (to_nat k)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. orthogonal (column k (Gram_Schmidt_column_k A (mod_type_class.to_nat k))) (column i (Gram_Schmidt_column_k A (mod_type_class.to_nat k)))
[PROOF STEP]
unfolding col_k_rw
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. orthogonal (column k A - proj_onto (column k A) {column i A |i. i < k}) (column i (Gram_Schmidt_column_k A (mod_type_class.to_nat k)))
[PROOF STEP]
proof (rule orthogonal_proj_set[OF _ _ o])
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. column i (Gram_Schmidt_column_k A (mod_type_class.to_nat k)) \<in> {column i A |i. i < k}
 2. finite {column i A |i. i < k}
[PROOF STEP]
have "column i (Gram_Schmidt_column_k A (to_nat k)) = column i A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. column i (Gram_Schmidt_column_k A (mod_type_class.to_nat k)) = column i A
[PROOF STEP]
using column_Gram_Schmidt_column_k'[OF i_not_k]
[PROOF STATE]
proof (prove)
using this:
column i (Gram_Schmidt_column_k ?A (mod_type_class.to_nat k)) = column i ?A

goal (1 subgoal):
 1. column i (Gram_Schmidt_column_k A (mod_type_class.to_nat k)) = column i A
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
column i (Gram_Schmidt_column_k A (mod_type_class.to_nat k)) = column i A

goal (2 subgoals):
 1. column i (Gram_Schmidt_column_k A (mod_type_class.to_nat k)) \<in> {column i A |i. i < k}
 2. finite {column i A |i. i < k}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
column i (Gram_Schmidt_column_k A (mod_type_class.to_nat k)) = column i A

goal (2 subgoals):
 1. column i (Gram_Schmidt_column_k A (mod_type_class.to_nat k)) \<in> {column i A |i. i < k}
 2. finite {column i A |i. i < k}
[PROOF STEP]
have "...  \<in> {column i A |i. i < k}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. column i A \<in> {column i A |i. i < k}
[PROOF STEP]
using assms(2)
[PROOF STATE]
proof (prove)
using this:
i < k

goal (1 subgoal):
 1. column i A \<in> {column i A |i. i < k}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
column i A \<in> {column i A |i. i < k}

goal (2 subgoals):
 1. column i (Gram_Schmidt_column_k A (mod_type_class.to_nat k)) \<in> {column i A |i. i < k}
 2. finite {column i A |i. i < k}
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
column i (Gram_Schmidt_column_k A (mod_type_class.to_nat k)) \<in> {column i A |i. i < k}
[PROOF STEP]
show "column i (Gram_Schmidt_column_k A (to_nat k)) \<in> {column i A |i. i < k}"
[PROOF STATE]
proof (prove)
using this:
column i (Gram_Schmidt_column_k A (mod_type_class.to_nat k)) \<in> {column i A |i. i < k}

goal (1 subgoal):
 1. column i (Gram_Schmidt_column_k A (mod_type_class.to_nat k)) \<in> {column i A |i. i < k}
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
column i (Gram_Schmidt_column_k A (mod_type_class.to_nat k)) \<in> {column i A |i. i < k}

goal (1 subgoal):
 1. finite {column i A |i. i < k}
[PROOF STEP]
show "finite {column i A |i. i < k}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {column i A |i. i < k}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
finite {column i A |i. i < k}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
orthogonal (column k (Gram_Schmidt_column_k A (mod_type_class.to_nat k))) (column i (Gram_Schmidt_column_k A (mod_type_class.to_nat k)))

goal (2 subgoals):
 1. column k (Gram_Schmidt_column_k A (mod_type_class.to_nat k)) = 0
 2. column i (Gram_Schmidt_column_k A (mod_type_class.to_nat k)) = 0
[PROOF STEP]
thus "column k (Gram_Schmidt_column_k A (to_nat k)) = 0"
    and "column i (Gram_Schmidt_column_k A (to_nat k)) = 0"
[PROOF STATE]
proof (prove)
using this:
orthogonal (column k (Gram_Schmidt_column_k A (mod_type_class.to_nat k))) (column i (Gram_Schmidt_column_k A (mod_type_class.to_nat k)))

goal (1 subgoal):
 1. column k (Gram_Schmidt_column_k A (mod_type_class.to_nat k)) = 0 &&& column i (Gram_Schmidt_column_k A (mod_type_class.to_nat k)) = 0
[PROOF STEP]
unfolding orthogonal_def c_eq inner_eq_zero_iff
[PROOF STATE]
proof (prove)
using this:
column i (Gram_Schmidt_column_k A (mod_type_class.to_nat k)) = 0

goal (1 subgoal):
 1. column i (Gram_Schmidt_column_k A (mod_type_class.to_nat k)) = 0 &&& column i (Gram_Schmidt_column_k A (mod_type_class.to_nat k)) = 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
column k (Gram_Schmidt_column_k A (mod_type_class.to_nat k)) = 0
column i (Gram_Schmidt_column_k A (mod_type_class.to_nat k)) = 0

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma mult_less_multiset\<^sub>D\<^sub>M: "(M, N) \<in> mult {(x, y). x < y} \<longleftrightarrow> less_multiset\<^sub>D\<^sub>M M N"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((M, N) \<in> mult {(x, y). x < y}) = less_multiset\<^sub>D\<^sub>M M N
[PROOF STEP]
unfolding multp_def[of "(<)", symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. multp (<) M N = less_multiset\<^sub>D\<^sub>M M N
[PROOF STEP]
using multp_eq_multp\<^sub>D\<^sub>M[of "(<)", simplified]
[PROOF STATE]
proof (prove)
using this:
multp (<) = multp\<^sub>D\<^sub>M (<)

goal (1 subgoal):
 1. multp (<) M N = less_multiset\<^sub>D\<^sub>M M N
[PROOF STEP]
by (simp add: multp\<^sub>D\<^sub>M_def less_multiset\<^sub>D\<^sub>M_def)


[STATEMENT]
lemma star_right_induct_mult_iff:
  "y * x \<le> y \<longleftrightarrow> y * x\<^sup>\<star> \<le> y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (y * x \<le> y) = (y * x\<^sup>\<star> \<le> y)
[PROOF STEP]
using mult_right_isotone order_trans star.circ_increasing star_right_induct_mult
[PROOF STATE]
proof (prove)
using this:
?x \<le> ?y \<Longrightarrow> ?z * ?x \<le> ?z * ?y
\<lbrakk>?x \<le> ?y; ?y \<le> ?z\<rbrakk> \<Longrightarrow> ?x \<le> ?z
?x \<le> ?x\<^sup>\<star>
?y * ?x \<le> ?y \<Longrightarrow> ?y * ?x\<^sup>\<star> \<le> ?y

goal (1 subgoal):
 1. (y * x \<le> y) = (y * x\<^sup>\<star> \<le> y)
[PROOF STEP]
by blast


[STATEMENT]
lemma eventually_eventually:
  "eventually (\<lambda>y. eventually P (nhds y)) (nhds x) = eventually P (nhds x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>\<^sub>F y in nhds x. eventually P (nhds y)) = eventually P (nhds x)
[PROOF STEP]
by (auto simp: eventually_nhds)


[STATEMENT]
lemma degree_synthetic_div: "degree (synthetic_div p c) = degree p - 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree (synthetic_div p c) = degree p - 1
[PROOF STEP]
by (induct p) (simp_all add: synthetic_div_eq_0_iff)


[STATEMENT]
lemma fixed_point_unique: "\<exists>!x\<in>iter_space. P x = x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>!x. x \<in> iter_space \<and> P x = x
[PROOF STEP]
using lipschitz lipschitz_bound_maxmin lipschitz_P T_def
      complete_UNIV iv_defined
[PROOF STATE]
proof (prove)
using this:
?t \<in> T \<Longrightarrow> L-lipschitz_on X (f ?t)
(tmax - tmin) * L < 1
((tmax - tmin) * L)-lipschitz_on iter_space P
T = {tmin..tmax}
complete UNIV
t0 \<in> T
x0 \<in> X

goal (1 subgoal):
 1. \<exists>!x. x \<in> iter_space \<and> P x = x
[PROOF STEP]
by (intro banach_fix)
    (auto
      intro: P_self_mapping split_mult_pos_le
      intro!: closed_iter_space iter_space_notempty mult_nonneg_nonneg
      simp: lipschitz_on_def complete_eq_closed)


[STATEMENT]
lemma cblinfun_image_sup[simp]:
  fixes A B :: \<open>'a::chilbert_space ccsubspace\<close> and U :: "'a \<Rightarrow>\<^sub>C\<^sub>L'b::chilbert_space"
  shows \<open>U *\<^sub>S (sup A B) = sup (U *\<^sub>S A) (U *\<^sub>S B)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. U *\<^sub>S (A \<squnion> B) = U *\<^sub>S A \<squnion> U *\<^sub>S B
[PROOF STEP]
apply transfer
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>U A B. \<lbrakk>bounded_clinear U; closed_csubspace A; closed_csubspace B\<rbrakk> \<Longrightarrow> closure (U ` (A +\<^sub>M B)) = closure (U ` A) +\<^sub>M closure (U ` B)
[PROOF STEP]
using bounded_clinear.bounded_linear closure_image_closed_sum
[PROOF STATE]
proof (prove)
using this:
bounded_clinear ?f \<Longrightarrow> bounded_linear ?f
bounded_linear ?U \<Longrightarrow> closure (?U ` (?A +\<^sub>M ?B)) = closure (?U ` ?A) +\<^sub>M closure (?U ` ?B)

goal (1 subgoal):
 1. \<And>U A B. \<lbrakk>bounded_clinear U; closed_csubspace A; closed_csubspace B\<rbrakk> \<Longrightarrow> closure (U ` (A +\<^sub>M B)) = closure (U ` A) +\<^sub>M closure (U ` B)
[PROOF STEP]
by blast


[STATEMENT]
lemma bijective_linorder_matrix_unique:
  fixes f :: "('a::finite,'b::non_trivial_linorder_stone_relation_algebra_expansion) square"
  shows "matrix_stone_relation_algebra.bijective f \<longleftrightarrow> (\<forall>j . \<exists>!i . f (i,j) = top \<and> (\<forall>k . i \<noteq> k \<longrightarrow> f (k,j) = bot))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. matrix_stone_relation_algebra.bijective f = (\<forall>j. \<exists>!i. f (i, j) = top \<and> (\<forall>k. i \<noteq> k \<longrightarrow> f (k, j) = bot))
[PROOF STEP]
by (unfold matrix_stone_relation_algebra.bijective_conv_mapping mapping_linorder_matrix_unique) (simp add: conv_matrix_def)


[STATEMENT]
lemma biQuot_lQuot_rQuot: "biQuot x y A = lQuot x (rQuot y A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. biQuot x y A = lQuot x (rQuot y A)
[PROOF STEP]
unfolding biQuot_def rQuot_def lQuot_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {xs. x # xs @ [y] \<in> A} = {xs. x # xs \<in> {xs. xs @ [y] \<in> A}}
[PROOF STEP]
by auto


[STATEMENT]
lemma f_Exec_Stream_Acc_LocalState_nth: "
  \<lbrakk> 0 < k; n < length xs \<rbrakk> \<Longrightarrow>
  f_Exec_Comp_Stream_Acc_LocalState k localState trans_fun xs c ! n =
  localState (f_Exec_Comp trans_fun (xs \<down> Suc n \<odot>\<^sub>f k) c)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < k; n < length xs\<rbrakk> \<Longrightarrow> f_Exec_Comp_Stream_Acc_LocalState k localState trans_fun xs c ! n = localState (f_Exec_Comp trans_fun (xs \<down> Suc n \<odot> k) c)
[PROOF STEP]
apply (simp add: f_Exec_Comp_Stream_Acc_LocalState_def f_shrink_last_map)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < k; n < length xs\<rbrakk> \<Longrightarrow> map localState (f_Exec_Comp_Stream trans_fun (xs \<odot> k) c \<div>\<^sub>l k) ! n = localState (f_Exec_Comp trans_fun (xs \<down> Suc n \<odot> k) c)
[PROOF STEP]
apply (simp add: f_shrink_last_nth' f_shrink_last_length del: mult_Suc)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < k; n < length xs\<rbrakk> \<Longrightarrow> localState (f_Exec_Comp_Stream trans_fun (xs \<odot> k) c ! (Suc n * k - Suc 0)) = localState (f_Exec_Comp trans_fun (xs \<down> Suc n \<odot> k) c)
[PROOF STEP]
apply (simp add: f_Exec_Stream_nth less_imp_Suc_mult_pred_less f_expand_take_mod del: mult_Suc)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma word_cat_bl: "word_cat a b = of_bl (to_bl a @ to_bl b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. word_cat a b = of_bl (to_bl a @ to_bl b)
[PROOF STEP]
apply (rule bit_word_eqI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. n < LENGTH('a) \<Longrightarrow> bit (word_cat a b) n = bit (of_bl (to_bl a @ to_bl b)) n
[PROOF STEP]
apply (simp add: bit_word_cat_iff bit_of_bl_iff nth_append not_less nth_rev_to_bl)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. n < LENGTH('a) \<Longrightarrow> LENGTH('c) \<le> n \<longrightarrow> bit a (n - LENGTH('c)) = (rev (to_bl a) ! (n - LENGTH('c)) \<and> n < LENGTH('b) + LENGTH('c))
[PROOF STEP]
apply (meson bit_word.rep_eq less_diff_conv2 nth_rev_to_bl)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma open_Collect_eucl_less[simp, intro]:
  fixes a :: "'a::euclidean_space"
  shows "open {x. x <e a}" "open {x. a <e x}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. open {x. x <e a} &&& open {x. a <e x}
[PROOF STEP]
by (auto simp: eucl_less_eq_halfspaces open_halfspace_component_lt open_halfspace_component_gt)


[STATEMENT]
lemma tagged_division_of_finite: "s tagged_division_of i \<Longrightarrow> finite s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. s tagged_division_of i \<Longrightarrow> finite s
[PROOF STEP]
unfolding tagged_division_of_def tagged_partial_division_of_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (finite s \<and> (\<forall>x K. (x, K) \<in> s \<longrightarrow> x \<in> K \<and> K \<subseteq> i \<and> (\<exists>a b. K = cbox a b)) \<and> (\<forall>x1 K1 x2 K2. (x1, K1) \<in> s \<and> (x2, K2) \<in> s \<and> (x1, K1) \<noteq> (x2, K2) \<longrightarrow> interior K1 \<inter> interior K2 = {})) \<and> \<Union> {K. \<exists>x. (x, K) \<in> s} = i \<Longrightarrow> finite s
[PROOF STEP]
by auto


[STATEMENT]
lemma graph_lm_3: "((x,y) \<in> graph f) = (y = f x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((x, y) \<in> graph f) = (y = f x)
[PROOF STEP]
by (unfold graph_def, auto)


[STATEMENT]
lemma Borsukian_injective_linear_image:
  fixes f :: "'a::euclidean_space \<Rightarrow> 'b::euclidean_space"
  assumes "linear f" "inj f"
    shows "Borsukian(f ` S) \<longleftrightarrow> Borsukian S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Borsukian (f ` S) = Borsukian S
[PROOF STEP]
using assms homeomorphic_Borsukian_eq linear_homeomorphic_image
[PROOF STATE]
proof (prove)
using this:
linear f
inj f
?S homeomorphic ?T \<Longrightarrow> Borsukian ?S = Borsukian ?T
\<lbrakk>linear ?f; inj ?f\<rbrakk> \<Longrightarrow> ?S homeomorphic ?f ` ?S

goal (1 subgoal):
 1. Borsukian (f ` S) = Borsukian S
[PROOF STEP]
by blast


[STATEMENT]
lemma unitary_adjoint [simp]:
  assumes "A \<in> carrier_mat n n" "unitary A"
  shows "unitary (adjoint A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. unitary (adjoint A)
[PROOF STEP]
unfolding unitary_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. adjoint A \<in> carrier_mat (dim_row (adjoint A)) (dim_row (adjoint A)) \<and> inverts_mat (adjoint A) (adjoint (adjoint A))
[PROOF STEP]
using  adjoint_dim[OF assms(1)] assms
[PROOF STATE]
proof (prove)
using this:
adjoint A \<in> carrier_mat n n
A \<in> carrier_mat n n
unitary A

goal (1 subgoal):
 1. adjoint A \<in> carrier_mat (dim_row (adjoint A)) (dim_row (adjoint A)) \<and> inverts_mat (adjoint A) (adjoint (adjoint A))
[PROOF STEP]
by (auto simp add: unitaryD2[OF assms] adjoint_adjoint)


[STATEMENT]
lemma GreenThm_typeI_typeII_divisible_region_finite_holes:
  assumes valid_cube_boundary: "\<forall>(k,\<gamma>)\<in>boundary C. valid_path \<gamma>" and
    only_vertical_division:
    "only_vertical_division (boundary C) two_chain_typeI" and
    only_horizontal_division:
    "only_horizontal_division (boundary C) two_chain_typeII" and
    s_is_oneCube: "s = cubeImage C"
  shows "integral (cubeImage C) (\<lambda>x. partial_vector_derivative (\<lambda>x. F x \<bullet> j) i x - partial_vector_derivative (\<lambda>x. F x \<bullet> i) j x) =
                     one_chain_line_integral F {i, j} (boundary C)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral (cubeImage C) (\<lambda>x. partial_vector_derivative (\<lambda>x. F x \<bullet> j) i x - partial_vector_derivative (\<lambda>x. F x \<bullet> i) j x) = one_chain_line_integral F {i, j} (boundary C)
[PROOF STEP]
using GreenThm_typeI_typeII_divisible_region[OF only_vertical_division
      two_cube_boundary_is_boundary only_horizontal_division two_cube_boundary_is_boundary
      common_boundary_subdiv_exists_refl[OF assms(1)]] s_is_oneCube
[PROOF STATE]
proof (prove)
using this:
integral s (\<lambda>x. partial_vector_derivative (\<lambda>x. F x \<bullet> j) i x - partial_vector_derivative (\<lambda>x. F x \<bullet> i) j x) = one_chain_line_integral F {i, j} (boundary C)
integral s (\<lambda>x. partial_vector_derivative (\<lambda>x. F x \<bullet> j) i x - partial_vector_derivative (\<lambda>x. F x \<bullet> i) j x) = one_chain_line_integral F {i, j} (boundary C)
s = cubeImage C

goal (1 subgoal):
 1. integral (cubeImage C) (\<lambda>x. partial_vector_derivative (\<lambda>x. F x \<bullet> j) i x - partial_vector_derivative (\<lambda>x. F x \<bullet> i) j x) = one_chain_line_integral F {i, j} (boundary C)
[PROOF STEP]
by auto


[STATEMENT]
lemma integrable_subinterval_real:
  fixes f :: "real \<Rightarrow> 'a::banach"
  assumes "f integrable_on {a..b}"
    and "{c..d} \<subseteq> {a..b}"
  shows "f integrable_on {c..d}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f integrable_on {c..d}
[PROOF STEP]
by (metis assms box_real(2) integrable_subinterval)


[STATEMENT]
lemma subspace_Times: "m1.subspace A \<Longrightarrow> m2.subspace B \<Longrightarrow> p.subspace (A \<times> B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>m1.subspace A; m2.subspace B\<rbrakk> \<Longrightarrow> p.subspace (A \<times> B)
[PROOF STEP]
unfolding m1.subspace_def m2.subspace_def p.subspace_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(0::'b) \<in> A \<and> (\<forall>x\<in>A. \<forall>y\<in>A. x + y \<in> A) \<and> (\<forall>c. \<forall>x\<in>A. s1 c x \<in> A); (0::'c) \<in> B \<and> (\<forall>x\<in>B. \<forall>y\<in>B. x + y \<in> B) \<and> (\<forall>c. \<forall>x\<in>B. s2 c x \<in> B)\<rbrakk> \<Longrightarrow> 0 \<in> A \<times> B \<and> (\<forall>x\<in>A \<times> B. \<forall>y\<in>A \<times> B. x + y \<in> A \<times> B) \<and> (\<forall>c. \<forall>x\<in>A \<times> B. scale c x \<in> A \<times> B)
[PROOF STEP]
by (auto simp: zero_prod_def scale_def)


[STATEMENT]
lemma Plus_subset_Plus_iff [simp]: "A <+> B \<subseteq> C <+> D \<longleftrightarrow> A \<subseteq> C \<and> B \<subseteq> D"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (A <+> B \<subseteq> C <+> D) = (A \<subseteq> C \<and> B \<subseteq> D)
[PROOF STEP]
by auto


[STATEMENT]
lemma interior_convex_hull_eq_empty:
  fixes S :: "'a::euclidean_space set"
  assumes "card S = Suc (DIM ('a))"
  shows   "interior(convex hull S) = {} \<longleftrightarrow> affine_dependent S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (interior (convex hull S) = {}) = affine_dependent S
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. interior (convex hull S) = {} \<Longrightarrow> affine_dependent S
 2. affine_dependent S \<Longrightarrow> interior (convex hull S) = {}
[PROOF STEP]
show "affine_dependent S \<Longrightarrow> interior (convex hull S) = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. affine_dependent S \<Longrightarrow> interior (convex hull S) = {}
[PROOF STEP]
proof (clarsimp simp: affine_dependent_def)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>x \<in> S; x \<in> affine hull (S - {x})\<rbrakk> \<Longrightarrow> interior (convex hull S) = {}
[PROOF STEP]
fix a b
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>x \<in> S; x \<in> affine hull (S - {x})\<rbrakk> \<Longrightarrow> interior (convex hull S) = {}
[PROOF STEP]
assume "b \<in> S" "b \<in> affine hull (S - {b})"
[PROOF STATE]
proof (state)
this:
b \<in> S
b \<in> affine hull (S - {b})

goal (1 subgoal):
 1. \<And>x. \<lbrakk>x \<in> S; x \<in> affine hull (S - {x})\<rbrakk> \<Longrightarrow> interior (convex hull S) = {}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
b \<in> S
b \<in> affine hull (S - {b})
[PROOF STEP]
have "interior(affine hull S) = {}"
[PROOF STATE]
proof (prove)
using this:
b \<in> S
b \<in> affine hull (S - {b})

goal (1 subgoal):
 1. interior (affine hull S) = {}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
b \<in> S
b \<in> affine hull (S - {b})
card S = Suc DIM('a)

goal (1 subgoal):
 1. interior (affine hull S) = {}
[PROOF STEP]
by (metis DIM_positive One_nat_def Suc_mono card.remove card.infinite empty_interior_affine_hull eq_iff hull_redundant insert_Diff not_less zero_le_one)
[PROOF STATE]
proof (state)
this:
interior (affine hull S) = {}

goal (1 subgoal):
 1. \<And>x. \<lbrakk>x \<in> S; x \<in> affine hull (S - {x})\<rbrakk> \<Longrightarrow> interior (convex hull S) = {}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
interior (affine hull S) = {}
[PROOF STEP]
show "interior (convex hull S) = {}"
[PROOF STATE]
proof (prove)
using this:
interior (affine hull S) = {}

goal (1 subgoal):
 1. interior (convex hull S) = {}
[PROOF STEP]
using affine_hull_nonempty_interior
[PROOF STATE]
proof (prove)
using this:
interior (affine hull S) = {}
interior ?S \<noteq> {} \<Longrightarrow> affine hull ?S = UNIV

goal (1 subgoal):
 1. interior (convex hull S) = {}
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
interior (convex hull S) = {}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
affine_dependent S \<Longrightarrow> interior (convex hull S) = {}

goal (1 subgoal):
 1. interior (convex hull S) = {} \<Longrightarrow> affine_dependent S
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. interior (convex hull S) = {} \<Longrightarrow> affine_dependent S
[PROOF STEP]
show "interior (convex hull S) = {} \<Longrightarrow> affine_dependent S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. interior (convex hull S) = {} \<Longrightarrow> affine_dependent S
[PROOF STEP]
by (metis affine_hull_convex_hull affine_hull_empty affine_independent_span_eq assms convex_convex_hull empty_not_UNIV rel_interior_eq_empty rel_interior_interior)
[PROOF STATE]
proof (state)
this:
interior (convex hull S) = {} \<Longrightarrow> affine_dependent S

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma less_imp_not_less:
  assumes "x <\<^sub>a y"
  shows "(\<not> y <\<^sub>a x) \<longleftrightarrow> True"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<not> y <\<^sub>a x) = True
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
x <\<^sub>a y

goal (1 subgoal):
 1. (\<not> y <\<^sub>a x) = True
[PROOF STEP]
by (elim less_asym) simp


[STATEMENT]
lemma all_trie_eq_ran:
  "invar_trie t \<Longrightarrow> all_trie P t = (\<forall>x \<in> ran(lookup_trie t). P x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. invar_trie t \<Longrightarrow> all_trie P t = (\<forall>x\<in>ran (lookup_trie t). P x)
[PROOF STEP]
by(induction P t rule: all_trie.induct)
  (auto simp add: ran_lookup_Trie split: prod.splits option.split)


[STATEMENT]
lemma graph_minus_aimpl:
  fixes E1 E2 :: "'a rel"
  shows "E1-E2 = E_of_succ (\<lambda>x. E1``{x} - E2``{x})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. E1 - E2 = E_of_succ (\<lambda>x. E1 `` {x} - E2 `` {x})
[PROOF STEP]
by (auto simp: E_of_succ_def)


[STATEMENT]
lemma poly_finite_fourier_poly:
  fixes m :: int and ws
  defines "k \<equiv> length ws"
  assumes "m \<in> {0..<k}"
  assumes "m < length ws"
  shows "poly (finite_fourier_poly ws) (unity_root k m) = ws ! (nat m)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly (finite_fourier_poly ws) (unity_root k m) = ws ! nat m
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. poly (finite_fourier_poly ws) (unity_root k m) = ws ! nat m
[PROOF STEP]
have "k > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < k
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
k \<equiv> length ws
m \<in> {0..<int k}
m < int (length ws)

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

goal (1 subgoal):
 1. poly (finite_fourier_poly ws) (unity_root k m) = ws ! nat m
[PROOF STEP]
have distr: "
   (\<Sum>j<length ws. ws ! j * unity_root k (-i*j))*(unity_root k (m*i)) =
   (\<Sum>j<length ws. ws ! j * unity_root k (-i*j)*(unity_root k (m*i)))"
   for i
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>j<length ws. ws ! j * unity_root k (- i * int j)) * unity_root k (m * i) = (\<Sum>j<length ws. ws ! j * unity_root k (- i * int j) * unity_root k (m * i))
[PROOF STEP]
using sum_distrib_right[of "\<lambda>j. ws ! j * unity_root k (-i*j)"
                            "{..<k}" "(unity_root k (m*i))"]
[PROOF STATE]
proof (prove)
using this:
(\<Sum>j<k. ws ! j * unity_root k (- i * int j)) * unity_root k (m * i) = (\<Sum>n<k. ws ! n * unity_root k (- i * int n) * unity_root k (m * i))

goal (1 subgoal):
 1. (\<Sum>j<length ws. ws ! j * unity_root k (- i * int j)) * unity_root k (m * i) = (\<Sum>j<length ws. ws ! j * unity_root k (- i * int j) * unity_root k (m * i))
[PROOF STEP]
using k_def
[PROOF STATE]
proof (prove)
using this:
(\<Sum>j<k. ws ! j * unity_root k (- i * int j)) * unity_root k (m * i) = (\<Sum>n<k. ws ! n * unity_root k (- i * int n) * unity_root k (m * i))
k \<equiv> length ws

goal (1 subgoal):
 1. (\<Sum>j<length ws. ws ! j * unity_root k (- i * int j)) * unity_root k (m * i) = (\<Sum>j<length ws. ws ! j * unity_root k (- i * int j) * unity_root k (m * i))
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(\<Sum>j<length ws. ws ! j * unity_root k (- ?i * int j)) * unity_root k (m * ?i) = (\<Sum>j<length ws. ws ! j * unity_root k (- ?i * int j) * unity_root k (m * ?i))

goal (1 subgoal):
 1. poly (finite_fourier_poly ws) (unity_root k m) = ws ! nat m
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
(\<Sum>j<length ws. ws ! j * unity_root k (- ?i * int j)) * unity_root k (m * ?i) = (\<Sum>j<length ws. ws ! j * unity_root k (- ?i * int j) * unity_root k (m * ?i))

goal (1 subgoal):
 1. poly (finite_fourier_poly ws) (unity_root k m) = ws ! nat m
[PROOF STEP]
fix j i :: nat
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. poly (finite_fourier_poly ws) (unity_root k m) = ws ! nat m
[PROOF STEP]
have "unity_root k (-i*j)*(unity_root k (m*i)) = unity_root k (-i*j+m*i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. unity_root k (- int i * int j) * unity_root k (m * int i) = unity_root k (- int i * int j + m * int i)
[PROOF STEP]
by (simp add: unity_root_diff unity_root_uminus field_simps)
[PROOF STATE]
proof (state)
this:
unity_root k (- int i * int j) * unity_root k (m * int i) = unity_root k (- int i * int j + m * int i)

goal (1 subgoal):
 1. poly (finite_fourier_poly ws) (unity_root k m) = ws ! nat m
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
unity_root k (- int i * int j) * unity_root k (m * int i) = unity_root k (- int i * int j + m * int i)

goal (1 subgoal):
 1. poly (finite_fourier_poly ws) (unity_root k m) = ws ! nat m
[PROOF STEP]
have "\<dots> = unity_root k (i*(m-j))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. unity_root k (- int i * int j + m * int i) = unity_root k (int i * (m - int j))
[PROOF STEP]
by (simp add: algebra_simps)
[PROOF STATE]
proof (state)
this:
unity_root k (- int i * int j + m * int i) = unity_root k (int i * (m - int j))

goal (1 subgoal):
 1. poly (finite_fourier_poly ws) (unity_root k m) = ws ! nat m
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
unity_root k (- int i * int j) * unity_root k (m * int i) = unity_root k (int i * (m - int j))
[PROOF STEP]
have "unity_root k (-i*j)*(unity_root k (m*i)) = unity_root k (i*(m-j))"
[PROOF STATE]
proof (prove)
using this:
unity_root k (- int i * int j) * unity_root k (m * int i) = unity_root k (int i * (m - int j))

goal (1 subgoal):
 1. unity_root k (- int i * int j) * unity_root k (m * int i) = unity_root k (int i * (m - int j))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
unity_root k (- int i * int j) * unity_root k (m * int i) = unity_root k (int i * (m - int j))

goal (1 subgoal):
 1. poly (finite_fourier_poly ws) (unity_root k m) = ws ! nat m
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
unity_root k (- int i * int j) * unity_root k (m * int i) = unity_root k (int i * (m - int j))
[PROOF STEP]
have "ws ! j * unity_root k (-i*j)*(unity_root k (m*i)) =
              ws ! j * unity_root k (i*(m-j))"
[PROOF STATE]
proof (prove)
using this:
unity_root k (- int i * int j) * unity_root k (m * int i) = unity_root k (int i * (m - int j))

goal (1 subgoal):
 1. ws ! j * unity_root k (- int i * int j) * unity_root k (m * int i) = ws ! j * unity_root k (int i * (m - int j))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
ws ! j * unity_root k (- int i * int j) * unity_root k (m * int i) = ws ! j * unity_root k (int i * (m - int j))

goal (1 subgoal):
 1. poly (finite_fourier_poly ws) (unity_root k m) = ws ! nat m
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
ws ! ?j2 * unity_root k (- int ?i2 * int ?j2) * unity_root k (m * int ?i2) = ws ! ?j2 * unity_root k (int ?i2 * (m - int ?j2))

goal (1 subgoal):
 1. poly (finite_fourier_poly ws) (unity_root k m) = ws ! nat m
[PROOF STEP]
note prod = this
[PROOF STATE]
proof (state)
this:
ws ! ?j2 * unity_root k (- int ?i2 * int ?j2) * unity_root k (m * int ?i2) = ws ! ?j2 * unity_root k (int ?i2 * (m - int ?j2))

goal (1 subgoal):
 1. poly (finite_fourier_poly ws) (unity_root k m) = ws ! nat m
[PROOF STEP]
have zeros:
   "(unity_root_sum k (m-j) \<noteq> 0 \<longleftrightarrow> m = j)
     " if "j \<ge> 0 \<and> j < k"  for j
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (unity_root_sum k (m - int j) \<noteq> 0) = (m = int j)
[PROOF STEP]
using k_def that assms unity_root_sum_nonzero_iff[of _ "m-j"]
[PROOF STATE]
proof (prove)
using this:
k \<equiv> length ws
0 \<le> j \<and> j < k
k \<equiv> length ws
m \<in> {0..<int k}
m < int (length ws)
\<lbrakk>1 \<le> ?k; m - int j \<in> {- int ?k<..<int ?k}\<rbrakk> \<Longrightarrow> (unity_root_sum ?k (m - int j) \<noteq> 0) = (m - int j = 0)

goal (1 subgoal):
 1. (unity_root_sum k (m - int j) \<noteq> 0) = (m = int j)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
0 \<le> ?j \<and> ?j < k \<Longrightarrow> (unity_root_sum k (m - int ?j) \<noteq> 0) = (m = int ?j)

goal (1 subgoal):
 1. poly (finite_fourier_poly ws) (unity_root k m) = ws ! nat m
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 \<le> ?j \<and> ?j < k \<Longrightarrow> (unity_root_sum k (m - int ?j) \<noteq> 0) = (m = int ?j)
[PROOF STEP]
have sum_eq:
    "(\<Sum>j\<le>k-1. ws ! j * unity_root_sum k (m-j)) =
          (\<Sum>j\<in>{nat m}.  ws ! j * unity_root_sum k (m-j))"
[PROOF STATE]
proof (prove)
using this:
0 \<le> ?j \<and> ?j < k \<Longrightarrow> (unity_root_sum k (m - int ?j) \<noteq> 0) = (m = int ?j)

goal (1 subgoal):
 1. (\<Sum>j\<le>k - 1. ws ! j * unity_root_sum k (m - int j)) = (\<Sum>j\<in>{nat m}. ws ! j * unity_root_sum k (m - int j))
[PROOF STEP]
using assms(2)
[PROOF STATE]
proof (prove)
using this:
0 \<le> ?j \<and> ?j < k \<Longrightarrow> (unity_root_sum k (m - int ?j) \<noteq> 0) = (m = int ?j)
m \<in> {0..<int k}

goal (1 subgoal):
 1. (\<Sum>j\<le>k - 1. ws ! j * unity_root_sum k (m - int j)) = (\<Sum>j\<in>{nat m}. ws ! j * unity_root_sum k (m - int j))
[PROOF STEP]
by (intro sum.mono_neutral_right,auto)
[PROOF STATE]
proof (state)
this:
(\<Sum>j\<le>k - 1. ws ! j * unity_root_sum k (m - int j)) = (\<Sum>j\<in>{nat m}. ws ! j * unity_root_sum k (m - int j))

goal (1 subgoal):
 1. poly (finite_fourier_poly ws) (unity_root k m) = ws ! nat m
[PROOF STEP]
have "poly (finite_fourier_poly ws) (unity_root k m) =
        (\<Sum>i\<le>k-1. coeff (finite_fourier_poly ws) i * (unity_root k m) ^ i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly (finite_fourier_poly ws) (unity_root k m) = (\<Sum>i\<le>k - 1. coeff (finite_fourier_poly ws) i * unity_root k m ^ i)
[PROOF STEP]
using degree_finite_fourier_poly[of ws] k_def
          poly_altdef'[of "finite_fourier_poly ws" "k-1" "unity_root k m"]
[PROOF STATE]
proof (prove)
using this:
degree (finite_fourier_poly ws) \<le> length ws - 1
k \<equiv> length ws
degree (finite_fourier_poly ws) \<le> k - 1 \<Longrightarrow> poly (finite_fourier_poly ws) (unity_root k m) = (\<Sum>i\<le>k - 1. coeff (finite_fourier_poly ws) i * unity_root k m ^ i)

goal (1 subgoal):
 1. poly (finite_fourier_poly ws) (unity_root k m) = (\<Sum>i\<le>k - 1. coeff (finite_fourier_poly ws) i * unity_root k m ^ i)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
poly (finite_fourier_poly ws) (unity_root k m) = (\<Sum>i\<le>k - 1. coeff (finite_fourier_poly ws) i * unity_root k m ^ i)

goal (1 subgoal):
 1. poly (finite_fourier_poly ws) (unity_root k m) = ws ! nat m
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
poly (finite_fourier_poly ws) (unity_root k m) = (\<Sum>i\<le>k - 1. coeff (finite_fourier_poly ws) i * unity_root k m ^ i)

goal (1 subgoal):
 1. poly (finite_fourier_poly ws) (unity_root k m) = ws ! nat m
[PROOF STEP]
have "\<dots> = (\<Sum>i<k. coeff (finite_fourier_poly ws) i * (unity_root k m) ^ i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i\<le>k - 1. coeff (finite_fourier_poly ws) i * unity_root k m ^ i) = (\<Sum>i<k. coeff (finite_fourier_poly ws) i * unity_root k m ^ i)
[PROOF STEP]
using assms(2)
[PROOF STATE]
proof (prove)
using this:
m \<in> {0..<int k}

goal (1 subgoal):
 1. (\<Sum>i\<le>k - 1. coeff (finite_fourier_poly ws) i * unity_root k m ^ i) = (\<Sum>i<k. coeff (finite_fourier_poly ws) i * unity_root k m ^ i)
[PROOF STEP]
by (intro sum.cong) auto
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<le>k - 1. coeff (finite_fourier_poly ws) i * unity_root k m ^ i) = (\<Sum>i<k. coeff (finite_fourier_poly ws) i * unity_root k m ^ i)

goal (1 subgoal):
 1. poly (finite_fourier_poly ws) (unity_root k m) = ws ! nat m
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<le>k - 1. coeff (finite_fourier_poly ws) i * unity_root k m ^ i) = (\<Sum>i<k. coeff (finite_fourier_poly ws) i * unity_root k m ^ i)

goal (1 subgoal):
 1. poly (finite_fourier_poly ws) (unity_root k m) = ws ! nat m
[PROOF STEP]
have "\<dots> = (\<Sum>i<k. 1 / k *
    (\<Sum>j<k. ws ! j * unity_root k (-i*j)) * (unity_root k m) ^ i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i<k. coeff (finite_fourier_poly ws) i * unity_root k m ^ i) = (\<Sum>i<k. complex_of_real (1 / real k) * (\<Sum>j<k. ws ! j * unity_root k (- int i * int j)) * unity_root k m ^ i)
[PROOF STEP]
using coeff_finite_fourier_poly[of _ ws] k_def
[PROOF STATE]
proof (prove)
using this:
?n < length ws \<Longrightarrow> coeff (finite_fourier_poly ws) ?n = 1 / of_nat (length ws) * (\<Sum>m<length ws. ws ! m * unity_root (length ws) (- int ?n * int m))
k \<equiv> length ws

goal (1 subgoal):
 1. (\<Sum>i<k. coeff (finite_fourier_poly ws) i * unity_root k m ^ i) = (\<Sum>i<k. complex_of_real (1 / real k) * (\<Sum>j<k. ws ! j * unity_root k (- int i * int j)) * unity_root k m ^ i)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<Sum>i<k. coeff (finite_fourier_poly ws) i * unity_root k m ^ i) = (\<Sum>i<k. complex_of_real (1 / real k) * (\<Sum>j<k. ws ! j * unity_root k (- int i * int j)) * unity_root k m ^ i)

goal (1 subgoal):
 1. poly (finite_fourier_poly ws) (unity_root k m) = ws ! nat m
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>i<k. coeff (finite_fourier_poly ws) i * unity_root k m ^ i) = (\<Sum>i<k. complex_of_real (1 / real k) * (\<Sum>j<k. ws ! j * unity_root k (- int i * int j)) * unity_root k m ^ i)

goal (1 subgoal):
 1. poly (finite_fourier_poly ws) (unity_root k m) = ws ! nat m
[PROOF STEP]
have "\<dots> = (\<Sum>i<k. 1 / k *
    (\<Sum>j<k. ws ! j * unity_root k (-i*j))*(unity_root k (m*i)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i<k. complex_of_real (1 / real k) * (\<Sum>j<k. ws ! j * unity_root k (- int i * int j)) * unity_root k m ^ i) = (\<Sum>i<k. complex_of_real (1 / real k) * (\<Sum>j<k. ws ! j * unity_root k (- int i * int j)) * unity_root k (m * int i))
[PROOF STEP]
using unity_root_pow
[PROOF STATE]
proof (prove)
using this:
unity_root ?k ?n ^ ?m = unity_root ?k (?n * int ?m)

goal (1 subgoal):
 1. (\<Sum>i<k. complex_of_real (1 / real k) * (\<Sum>j<k. ws ! j * unity_root k (- int i * int j)) * unity_root k m ^ i) = (\<Sum>i<k. complex_of_real (1 / real k) * (\<Sum>j<k. ws ! j * unity_root k (- int i * int j)) * unity_root k (m * int i))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<Sum>i<k. complex_of_real (1 / real k) * (\<Sum>j<k. ws ! j * unity_root k (- int i * int j)) * unity_root k m ^ i) = (\<Sum>i<k. complex_of_real (1 / real k) * (\<Sum>j<k. ws ! j * unity_root k (- int i * int j)) * unity_root k (m * int i))

goal (1 subgoal):
 1. poly (finite_fourier_poly ws) (unity_root k m) = ws ! nat m
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>i<k. complex_of_real (1 / real k) * (\<Sum>j<k. ws ! j * unity_root k (- int i * int j)) * unity_root k m ^ i) = (\<Sum>i<k. complex_of_real (1 / real k) * (\<Sum>j<k. ws ! j * unity_root k (- int i * int j)) * unity_root k (m * int i))

goal (1 subgoal):
 1. poly (finite_fourier_poly ws) (unity_root k m) = ws ! nat m
[PROOF STEP]
have "\<dots> = (\<Sum>i<k. 1 / k *
    (\<Sum>j<k. ws ! j * unity_root k (-i*j)*(unity_root k (m*i))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i<k. complex_of_real (1 / real k) * (\<Sum>j<k. ws ! j * unity_root k (- int i * int j)) * unity_root k (m * int i)) = (\<Sum>i<k. complex_of_real (1 / real k) * (\<Sum>j<k. ws ! j * unity_root k (- int i * int j) * unity_root k (m * int i)))
[PROOF STEP]
using distr k_def
[PROOF STATE]
proof (prove)
using this:
(\<Sum>j<length ws. ws ! j * unity_root k (- ?i * int j)) * unity_root k (m * ?i) = (\<Sum>j<length ws. ws ! j * unity_root k (- ?i * int j) * unity_root k (m * ?i))
k \<equiv> length ws

goal (1 subgoal):
 1. (\<Sum>i<k. complex_of_real (1 / real k) * (\<Sum>j<k. ws ! j * unity_root k (- int i * int j)) * unity_root k (m * int i)) = (\<Sum>i<k. complex_of_real (1 / real k) * (\<Sum>j<k. ws ! j * unity_root k (- int i * int j) * unity_root k (m * int i)))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<Sum>i<k. complex_of_real (1 / real k) * (\<Sum>j<k. ws ! j * unity_root k (- int i * int j)) * unity_root k (m * int i)) = (\<Sum>i<k. complex_of_real (1 / real k) * (\<Sum>j<k. ws ! j * unity_root k (- int i * int j) * unity_root k (m * int i)))

goal (1 subgoal):
 1. poly (finite_fourier_poly ws) (unity_root k m) = ws ! nat m
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>i<k. complex_of_real (1 / real k) * (\<Sum>j<k. ws ! j * unity_root k (- int i * int j)) * unity_root k (m * int i)) = (\<Sum>i<k. complex_of_real (1 / real k) * (\<Sum>j<k. ws ! j * unity_root k (- int i * int j) * unity_root k (m * int i)))

goal (1 subgoal):
 1. poly (finite_fourier_poly ws) (unity_root k m) = ws ! nat m
[PROOF STEP]
have "\<dots> = (\<Sum>i<k. 1 / k *
    (\<Sum>j<k. ws ! j * unity_root k (i*(m-j))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i<k. complex_of_real (1 / real k) * (\<Sum>j<k. ws ! j * unity_root k (- int i * int j) * unity_root k (m * int i))) = (\<Sum>i<k. complex_of_real (1 / real k) * (\<Sum>j<k. ws ! j * unity_root k (int i * (m - int j))))
[PROOF STEP]
using prod
[PROOF STATE]
proof (prove)
using this:
ws ! ?j2 * unity_root k (- int ?i2 * int ?j2) * unity_root k (m * int ?i2) = ws ! ?j2 * unity_root k (int ?i2 * (m - int ?j2))

goal (1 subgoal):
 1. (\<Sum>i<k. complex_of_real (1 / real k) * (\<Sum>j<k. ws ! j * unity_root k (- int i * int j) * unity_root k (m * int i))) = (\<Sum>i<k. complex_of_real (1 / real k) * (\<Sum>j<k. ws ! j * unity_root k (int i * (m - int j))))
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
(\<Sum>i<k. complex_of_real (1 / real k) * (\<Sum>j<k. ws ! j * unity_root k (- int i * int j) * unity_root k (m * int i))) = (\<Sum>i<k. complex_of_real (1 / real k) * (\<Sum>j<k. ws ! j * unity_root k (int i * (m - int j))))

goal (1 subgoal):
 1. poly (finite_fourier_poly ws) (unity_root k m) = ws ! nat m
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>i<k. complex_of_real (1 / real k) * (\<Sum>j<k. ws ! j * unity_root k (- int i * int j) * unity_root k (m * int i))) = (\<Sum>i<k. complex_of_real (1 / real k) * (\<Sum>j<k. ws ! j * unity_root k (int i * (m - int j))))

goal (1 subgoal):
 1. poly (finite_fourier_poly ws) (unity_root k m) = ws ! nat m
[PROOF STEP]
have "\<dots> = 1 / k * (\<Sum>i<k.
    (\<Sum>j<k. ws ! j * unity_root k (i*(m-j))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i<k. complex_of_real (1 / real k) * (\<Sum>j<k. ws ! j * unity_root k (int i * (m - int j)))) = complex_of_real (1 / real k) * (\<Sum>i<k. \<Sum>j<k. ws ! j * unity_root k (int i * (m - int j)))
[PROOF STEP]
by (simp add: sum_distrib_left)
[PROOF STATE]
proof (state)
this:
(\<Sum>i<k. complex_of_real (1 / real k) * (\<Sum>j<k. ws ! j * unity_root k (int i * (m - int j)))) = complex_of_real (1 / real k) * (\<Sum>i<k. \<Sum>j<k. ws ! j * unity_root k (int i * (m - int j)))

goal (1 subgoal):
 1. poly (finite_fourier_poly ws) (unity_root k m) = ws ! nat m
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>i<k. complex_of_real (1 / real k) * (\<Sum>j<k. ws ! j * unity_root k (int i * (m - int j)))) = complex_of_real (1 / real k) * (\<Sum>i<k. \<Sum>j<k. ws ! j * unity_root k (int i * (m - int j)))

goal (1 subgoal):
 1. poly (finite_fourier_poly ws) (unity_root k m) = ws ! nat m
[PROOF STEP]
have "\<dots> = 1 / k * (\<Sum>j<k.
    (\<Sum>i<k. ws ! j * unity_root k (i*(m-j))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. complex_of_real (1 / real k) * (\<Sum>i<k. \<Sum>j<k. ws ! j * unity_root k (int i * (m - int j))) = complex_of_real (1 / real k) * (\<Sum>j<k. \<Sum>i<k. ws ! j * unity_root k (int i * (m - int j)))
[PROOF STEP]
using sum.swap
[PROOF STATE]
proof (prove)
using this:
(\<Sum>i\<in>?A. sum (?g i) ?B) = (\<Sum>j\<in>?B. \<Sum>i\<in>?A. ?g i j)

goal (1 subgoal):
 1. complex_of_real (1 / real k) * (\<Sum>i<k. \<Sum>j<k. ws ! j * unity_root k (int i * (m - int j))) = complex_of_real (1 / real k) * (\<Sum>j<k. \<Sum>i<k. ws ! j * unity_root k (int i * (m - int j)))
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
complex_of_real (1 / real k) * (\<Sum>i<k. \<Sum>j<k. ws ! j * unity_root k (int i * (m - int j))) = complex_of_real (1 / real k) * (\<Sum>j<k. \<Sum>i<k. ws ! j * unity_root k (int i * (m - int j)))

goal (1 subgoal):
 1. poly (finite_fourier_poly ws) (unity_root k m) = ws ! nat m
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
complex_of_real (1 / real k) * (\<Sum>i<k. \<Sum>j<k. ws ! j * unity_root k (int i * (m - int j))) = complex_of_real (1 / real k) * (\<Sum>j<k. \<Sum>i<k. ws ! j * unity_root k (int i * (m - int j)))

goal (1 subgoal):
 1. poly (finite_fourier_poly ws) (unity_root k m) = ws ! nat m
[PROOF STEP]
have "\<dots> = 1 / k * (\<Sum>j<k. ws ! j * (\<Sum>i<k. unity_root k (i*(m-j))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. complex_of_real (1 / real k) * (\<Sum>j<k. \<Sum>i<k. ws ! j * unity_root k (int i * (m - int j))) = complex_of_real (1 / real k) * (\<Sum>j<k. ws ! j * (\<Sum>i<k. unity_root k (int i * (m - int j))))
[PROOF STEP]
by (simp add: vector_space_over_itself.scale_sum_right)
[PROOF STATE]
proof (state)
this:
complex_of_real (1 / real k) * (\<Sum>j<k. \<Sum>i<k. ws ! j * unity_root k (int i * (m - int j))) = complex_of_real (1 / real k) * (\<Sum>j<k. ws ! j * (\<Sum>i<k. unity_root k (int i * (m - int j))))

goal (1 subgoal):
 1. poly (finite_fourier_poly ws) (unity_root k m) = ws ! nat m
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
complex_of_real (1 / real k) * (\<Sum>j<k. \<Sum>i<k. ws ! j * unity_root k (int i * (m - int j))) = complex_of_real (1 / real k) * (\<Sum>j<k. ws ! j * (\<Sum>i<k. unity_root k (int i * (m - int j))))

goal (1 subgoal):
 1. poly (finite_fourier_poly ws) (unity_root k m) = ws ! nat m
[PROOF STEP]
have "\<dots> = 1 / k * (\<Sum>j<k. ws ! j * unity_root_sum k (m-j))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. complex_of_real (1 / real k) * (\<Sum>j<k. ws ! j * (\<Sum>i<k. unity_root k (int i * (m - int j)))) = complex_of_real (1 / real k) * (\<Sum>j<k. ws ! j * unity_root_sum k (m - int j))
[PROOF STEP]
unfolding unity_root_sum_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. complex_of_real (1 / real k) * (\<Sum>j<k. ws ! j * (\<Sum>i<k. unity_root k (int i * (m - int j)))) = complex_of_real (1 / real k) * (\<Sum>j<k. ws ! j * (\<Sum>ma<k. unity_root k ((m - int j) * int ma)))
[PROOF STEP]
by (simp add: algebra_simps)
[PROOF STATE]
proof (state)
this:
complex_of_real (1 / real k) * (\<Sum>j<k. ws ! j * (\<Sum>i<k. unity_root k (int i * (m - int j)))) = complex_of_real (1 / real k) * (\<Sum>j<k. ws ! j * unity_root_sum k (m - int j))

goal (1 subgoal):
 1. poly (finite_fourier_poly ws) (unity_root k m) = ws ! nat m
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
complex_of_real (1 / real k) * (\<Sum>j<k. ws ! j * (\<Sum>i<k. unity_root k (int i * (m - int j)))) = complex_of_real (1 / real k) * (\<Sum>j<k. ws ! j * unity_root_sum k (m - int j))

goal (1 subgoal):
 1. poly (finite_fourier_poly ws) (unity_root k m) = ws ! nat m
[PROOF STEP]
have "(\<Sum>j<k. ws ! j * unity_root_sum k (m-j)) = (\<Sum>j\<le>k-1. ws ! j * unity_root_sum k (m-j))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>j<k. ws ! j * unity_root_sum k (m - int j)) = (\<Sum>j\<le>k - 1. ws ! j * unity_root_sum k (m - int j))
[PROOF STEP]
using \<open>k > 0\<close>
[PROOF STATE]
proof (prove)
using this:
0 < k

goal (1 subgoal):
 1. (\<Sum>j<k. ws ! j * unity_root_sum k (m - int j)) = (\<Sum>j\<le>k - 1. ws ! j * unity_root_sum k (m - int j))
[PROOF STEP]
by (intro sum.cong) auto
[PROOF STATE]
proof (state)
this:
(\<Sum>j<k. ws ! j * unity_root_sum k (m - int j)) = (\<Sum>j\<le>k - 1. ws ! j * unity_root_sum k (m - int j))

goal (1 subgoal):
 1. poly (finite_fourier_poly ws) (unity_root k m) = ws ! nat m
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>j<k. ws ! j * unity_root_sum k (m - int j)) = (\<Sum>j\<le>k - 1. ws ! j * unity_root_sum k (m - int j))

goal (1 subgoal):
 1. poly (finite_fourier_poly ws) (unity_root k m) = ws ! nat m
[PROOF STEP]
have "\<dots> = (\<Sum>j\<in>{nat m}.  ws ! j * unity_root_sum k (m-j))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>j\<le>k - 1. ws ! j * unity_root_sum k (m - int j)) = (\<Sum>j\<in>{nat m}. ws ! j * unity_root_sum k (m - int j))
[PROOF STEP]
using sum_eq
[PROOF STATE]
proof (prove)
using this:
(\<Sum>j\<le>k - 1. ws ! j * unity_root_sum k (m - int j)) = (\<Sum>j\<in>{nat m}. ws ! j * unity_root_sum k (m - int j))

goal (1 subgoal):
 1. (\<Sum>j\<le>k - 1. ws ! j * unity_root_sum k (m - int j)) = (\<Sum>j\<in>{nat m}. ws ! j * unity_root_sum k (m - int j))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(\<Sum>j\<le>k - 1. ws ! j * unity_root_sum k (m - int j)) = (\<Sum>j\<in>{nat m}. ws ! j * unity_root_sum k (m - int j))

goal (1 subgoal):
 1. poly (finite_fourier_poly ws) (unity_root k m) = ws ! nat m
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>j\<le>k - 1. ws ! j * unity_root_sum k (m - int j)) = (\<Sum>j\<in>{nat m}. ws ! j * unity_root_sum k (m - int j))

goal (1 subgoal):
 1. poly (finite_fourier_poly ws) (unity_root k m) = ws ! nat m
[PROOF STEP]
have "\<dots> = ws ! (nat m) * k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>j\<in>{nat m}. ws ! j * unity_root_sum k (m - int j)) = ws ! nat m * of_nat k
[PROOF STEP]
using assms(2)
[PROOF STATE]
proof (prove)
using this:
m \<in> {0..<int k}

goal (1 subgoal):
 1. (\<Sum>j\<in>{nat m}. ws ! j * unity_root_sum k (m - int j)) = ws ! nat m * of_nat k
[PROOF STEP]
by (auto simp: algebra_simps)
[PROOF STATE]
proof (state)
this:
(\<Sum>j\<in>{nat m}. ws ! j * unity_root_sum k (m - int j)) = ws ! nat m * of_nat k

goal (1 subgoal):
 1. poly (finite_fourier_poly ws) (unity_root k m) = ws ! nat m
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
poly (finite_fourier_poly ws) (unity_root k m) = complex_of_real (1 / real k) * (ws ! nat m * of_nat k)
[PROOF STEP]
have "poly (finite_fourier_poly ws) (unity_root k m) = ws ! (nat m)"
[PROOF STATE]
proof (prove)
using this:
poly (finite_fourier_poly ws) (unity_root k m) = complex_of_real (1 / real k) * (ws ! nat m * of_nat k)

goal (1 subgoal):
 1. poly (finite_fourier_poly ws) (unity_root k m) = ws ! nat m
[PROOF STEP]
using assms(2)
[PROOF STATE]
proof (prove)
using this:
poly (finite_fourier_poly ws) (unity_root k m) = complex_of_real (1 / real k) * (ws ! nat m * of_nat k)
m \<in> {0..<int k}

goal (1 subgoal):
 1. poly (finite_fourier_poly ws) (unity_root k m) = ws ! nat m
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
poly (finite_fourier_poly ws) (unity_root k m) = ws ! nat m

goal (1 subgoal):
 1. poly (finite_fourier_poly ws) (unity_root k m) = ws ! nat m
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
poly (finite_fourier_poly ws) (unity_root k m) = ws ! nat m
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
poly (finite_fourier_poly ws) (unity_root k m) = ws ! nat m

goal (1 subgoal):
 1. poly (finite_fourier_poly ws) (unity_root k m) = ws ! nat m
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
poly (finite_fourier_poly ws) (unity_root k m) = ws ! nat m

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma inv_DirProd [simp]:
  assumes "group G" and "group H"
  assumes g: "g \<in> carrier G"
      and h: "h \<in> carrier H"
  shows "m_inv (G \<times>\<times> H) (g, h) = (inv\<^bsub>G\<^esub> g, inv\<^bsub>H\<^esub> h)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inv\<^bsub>G \<times>\<times> H\<^esub> (g, h) = (inv\<^bsub>G\<^esub> g, inv\<^bsub>H\<^esub> h)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. inv\<^bsub>G \<times>\<times> H\<^esub> (g, h) = (inv\<^bsub>G\<^esub> g, inv\<^bsub>H\<^esub> h)
[PROOF STEP]
interpret G: group G
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Group.group G
[PROOF STEP]
by fact
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. inv\<^bsub>G \<times>\<times> H\<^esub> (g, h) = (inv\<^bsub>G\<^esub> g, inv\<^bsub>H\<^esub> h)
[PROOF STEP]
interpret H: group H
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Group.group H
[PROOF STEP]
by fact
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. inv\<^bsub>G \<times>\<times> H\<^esub> (g, h) = (inv\<^bsub>G\<^esub> g, inv\<^bsub>H\<^esub> h)
[PROOF STEP]
interpret Prod: group "G \<times>\<times> H"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Group.group (G \<times>\<times> H)
[PROOF STEP]
by (auto intro: DirProd_group group.intro group.axioms assms)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. inv\<^bsub>G \<times>\<times> H\<^esub> (g, h) = (inv\<^bsub>G\<^esub> g, inv\<^bsub>H\<^esub> h)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inv\<^bsub>G \<times>\<times> H\<^esub> (g, h) = (inv\<^bsub>G\<^esub> g, inv\<^bsub>H\<^esub> h)
[PROOF STEP]
by (simp add: Prod.inv_equality g h)
[PROOF STATE]
proof (state)
this:
inv\<^bsub>G \<times>\<times> H\<^esub> (g, h) = (inv\<^bsub>G\<^esub> g, inv\<^bsub>H\<^esub> h)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Int_interval_mixed_eq_empty:
  fixes a :: "'a::euclidean_space"
   assumes "box c d \<noteq> {}"
  shows "box a b \<inter> cbox c d = {} \<longleftrightarrow> box a b \<inter> box c d = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (box a b \<inter> cbox c d = {}) = (box a b \<inter> box c d = {})
[PROOF STEP]
unfolding closure_box[OF assms, symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (box a b \<inter> closure (box c d) = {}) = (box a b \<inter> box c d = {})
[PROOF STEP]
unfolding open_Int_closure_eq_empty[OF open_box]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (box a b \<inter> box c d = {}) = (box a b \<inter> box c d = {})
[PROOF STEP]
..


[STATEMENT]
lemma Infinitesimal_hypreal_sqrt_imp_Infinitesimal:
     "\<lbrakk>0 \<le> x; ( *f* sqrt) x \<in> Infinitesimal\<rbrakk> \<Longrightarrow> x \<in> Infinitesimal"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 \<le> x; (*f* sqrt) x \<in> Infinitesimal\<rbrakk> \<Longrightarrow> x \<in> Infinitesimal
[PROOF STEP]
using hypreal_sqrt_approx_zero2 mem_infmal_iff
[PROOF STATE]
proof (prove)
using this:
0 \<le> ?x \<Longrightarrow> ((*f* sqrt) ?x \<approx> 0) = (?x \<approx> 0)
(?x \<in> Infinitesimal) = (?x \<approx> 0)

goal (1 subgoal):
 1. \<lbrakk>0 \<le> x; (*f* sqrt) x \<in> Infinitesimal\<rbrakk> \<Longrightarrow> x \<in> Infinitesimal
[PROOF STEP]
by blast


[STATEMENT]
lemma (in ring) inv_eq_neg_one_eq: "x \<in> Units R \<Longrightarrow> inv x = \<ominus> \<one> \<longleftrightarrow> x = \<ominus> \<one>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> Units R \<Longrightarrow> (inv x = \<ominus> \<one>) = (x = \<ominus> \<one>)
[PROOF STEP]
by (metis Units_inv_inv inv_neg_one)


[STATEMENT]
theorem symrun_interp_fixpoint:
  \<open>\<Inter> ((\<lambda>\<gamma>. \<lbrakk> \<gamma> \<rbrakk>\<^sub>p\<^sub>r\<^sub>i\<^sub>m) ` set \<Gamma>) = \<lbrakk>\<lbrakk> \<Gamma> \<rbrakk>\<rbrakk>\<^sub>p\<^sub>r\<^sub>i\<^sub>m\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Inter> (symbolic_run_interpretation_primitive ` set \<Gamma>) = \<lbrakk>\<lbrakk> \<Gamma> \<rbrakk>\<rbrakk>\<^sub>p\<^sub>r\<^sub>i\<^sub>m
[PROOF STEP]
by (induction \<Gamma>, simp+)


[STATEMENT]
lemma gen_analz_insert_eq [rule_format]:
     "X \<in> analz H \<Longrightarrow> \<forall>G. H \<subseteq> G \<longrightarrow> analz (insert X G) = analz G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. X \<in> analz H \<Longrightarrow> \<forall>G. H \<subseteq> G \<longrightarrow> analz (insert X G) = analz G
[PROOF STEP]
by (blast intro: analz_cut analz_insertI analz_mono [THEN [2] rev_subsetD])