[STATEMENT]
lemma homeomorphic_subspaces:
  fixes S :: "'a::euclidean_space set"
    and T :: "'b::euclidean_space set"
  assumes S: "subspace S"
      and T: "subspace T"
      and d: "dim S = dim T"
    shows "S homeomorphic T"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. S homeomorphic T
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. S homeomorphic T
[PROOF STEP]
obtain f g where "linear f" "linear g" "f ` S = T" "g ` T = S"
                   "\<And>x. x \<in> S \<Longrightarrow> g(f x) = x" "\<And>x. x \<in> T \<Longrightarrow> f(g x) = x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>f g. \<lbrakk>linear f; linear g; f ` S = T; g ` T = S; \<And>x. x \<in> S \<Longrightarrow> g (f x) = x; \<And>x. x \<in> T \<Longrightarrow> f (g x) = x\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (blast intro: isometries_subspaces [OF assms])
[PROOF STATE]
proof (state)
this:
linear f
linear g
f ` S = T
g ` T = S
?x \<in> S \<Longrightarrow> g (f ?x) = ?x
?x \<in> T \<Longrightarrow> f (g ?x) = ?x

goal (1 subgoal):
 1. S homeomorphic T
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
linear f
linear g
f ` S = T
g ` T = S
?x \<in> S \<Longrightarrow> g (f ?x) = ?x
?x \<in> T \<Longrightarrow> f (g ?x) = ?x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
linear f
linear g
f ` S = T
g ` T = S
?x \<in> S \<Longrightarrow> g (f ?x) = ?x
?x \<in> T \<Longrightarrow> f (g ?x) = ?x

goal (1 subgoal):
 1. S homeomorphic T
[PROOF STEP]
unfolding homeomorphic_def homeomorphism_def
[PROOF STATE]
proof (prove)
using this:
linear f
linear g
f ` S = T
g ` T = S
?x \<in> S \<Longrightarrow> g (f ?x) = ?x
?x \<in> T \<Longrightarrow> f (g ?x) = ?x

goal (1 subgoal):
 1. \<exists>f g. (\<forall>x\<in>S. g (f x) = x) \<and> f ` S = T \<and> continuous_on S f \<and> (\<forall>y\<in>T. f (g y) = y) \<and> g ` T = S \<and> continuous_on T g
[PROOF STEP]
apply (rule_tac x=f in exI, rule_tac x=g in exI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>linear f; linear g; f ` S = T; g ` T = S; \<And>x. x \<in> S \<Longrightarrow> g (f x) = x; \<And>x. x \<in> T \<Longrightarrow> f (g x) = x; linear f; linear g; f ` S = T; g ` T = S; \<And>x. x \<in> S \<Longrightarrow> g (f x) = x; \<And>x. x \<in> T \<Longrightarrow> f (g x) = x\<rbrakk> \<Longrightarrow> (\<forall>x\<in>S. g (f x) = x) \<and> f ` S = T \<and> continuous_on S f \<and> (\<forall>y\<in>T. f (g y) = y) \<and> g ` T = S \<and> continuous_on T g
[PROOF STEP]
apply (auto simp: linear_continuous_on linear_conv_bounded_linear)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
S homeomorphic T

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma sylvester_mat_sub_index:
  fixes p q
  assumes i: "i < m+n" and j: "j < m+n"
  shows "sylvester_mat_sub m n p q $$ (i,j) =
    (if i < n then
       if i \<le> j \<and> j - i \<le> m then coeff p (m + i - j) else 0
     else if i - n \<le> j \<and> j \<le> i then coeff q (i-j) else 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sylvester_mat_sub m n p q $$ (i, j) = (if i < n then if i \<le> j \<and> j - i \<le> m then coeff p (m + i - j) else (0::'a) else if i - n \<le> j \<and> j \<le> i then coeff q (i - j) else (0::'a))
[PROOF STEP]
unfolding sylvester_mat_sub_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat (m + n) (m + n) (\<lambda>(i, j). if i < n then if i \<le> j \<and> j - i \<le> m then coeff p (m + i - j) else (0::'a) else if i - n \<le> j \<and> j \<le> i then coeff q (i - j) else (0::'a)) $$ (i, j) = (if i < n then if i \<le> j \<and> j - i \<le> m then coeff p (m + i - j) else (0::'a) else if i - n \<le> j \<and> j \<le> i then coeff q (i - j) else (0::'a))
[PROOF STEP]
unfolding index_mat(1)[OF i j]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (case (i, j) of (i, j) \<Rightarrow> if i < n then if i \<le> j \<and> j - i \<le> m then coeff p (m + i - j) else (0::'a) else if i - n \<le> j \<and> j \<le> i then coeff q (i - j) else (0::'a)) = (if i < n then if i \<le> j \<and> j - i \<le> m then coeff p (m + i - j) else (0::'a) else if i - n \<le> j \<and> j \<le> i then coeff q (i - j) else (0::'a))
[PROOF STEP]
by auto


[STATEMENT]
lemma nat_div_eq_Suc_0_iff: "n div m = Suc 0 \<longleftrightarrow> m \<le> n \<and> n < 2 * m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (n div m = Suc 0) = (m \<le> n \<and> n < 2 * m)
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. n div m = Suc 0 \<Longrightarrow> m \<le> n
 2. n div m = Suc 0 \<Longrightarrow> n < 2 * m
 3. \<lbrakk>m \<le> n; n < 2 * m\<rbrakk> \<Longrightarrow> n div m = Suc 0
[PROOF STEP]
using div_greater_zero_iff
[PROOF STATE]
proof (prove)
using this:
(0 < ?m div ?n) = (?n \<le> ?m \<and> 0 < ?n)

goal (3 subgoals):
 1. n div m = Suc 0 \<Longrightarrow> m \<le> n
 2. n div m = Suc 0 \<Longrightarrow> n < 2 * m
 3. \<lbrakk>m \<le> n; n < 2 * m\<rbrakk> \<Longrightarrow> n div m = Suc 0
[PROOF STEP]
apply fastforce
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. n div m = Suc 0 \<Longrightarrow> n < 2 * m
 2. \<lbrakk>m \<le> n; n < 2 * m\<rbrakk> \<Longrightarrow> n div m = Suc 0
[PROOF STEP]
apply (metis One_nat_def div_greater_zero_iff dividend_less_div_times mult.right_neutral mult_Suc mult_numeral_1 numeral_2_eq_2 zero_less_numeral)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>m \<le> n; n < 2 * m\<rbrakk> \<Longrightarrow> n div m = Suc 0
[PROOF STEP]
apply (simp add: div_nat_eqI)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma card_vimage_inter:
  assumes inj: "inj_on f A" and subset: "X \<subseteq> f ` A"
  shows   "card (f -` X \<inter> A) = card X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (f -` X \<inter> A) = card X
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. card (f -` X \<inter> A) = card X
[PROOF STEP]
have "card (f -` X \<inter> A) = card (f ` (f -` X \<inter> A))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (f -` X \<inter> A) = card (f ` (f -` X \<inter> A))
[PROOF STEP]
by (subst card_image) (auto intro!: inj_on_subset[OF inj])
[PROOF STATE]
proof (state)
this:
card (f -` X \<inter> A) = card (f ` (f -` X \<inter> A))

goal (1 subgoal):
 1. card (f -` X \<inter> A) = card X
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
card (f -` X \<inter> A) = card (f ` (f -` X \<inter> A))

goal (1 subgoal):
 1. card (f -` X \<inter> A) = card X
[PROOF STEP]
have "f ` (f -` X \<inter> A) = X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f ` (f -` X \<inter> A) = X
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
inj_on f A
X \<subseteq> f ` A

goal (1 subgoal):
 1. f ` (f -` X \<inter> A) = X
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
f ` (f -` X \<inter> A) = X

goal (1 subgoal):
 1. card (f -` X \<inter> A) = card X
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
card (f -` X \<inter> A) = card X
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
card (f -` X \<inter> A) = card X

goal (1 subgoal):
 1. card (f -` X \<inter> A) = card X
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
card (f -` X \<inter> A) = card X

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma has_derivative_zero_constant:
  fixes f :: "'a::real_normed_vector \<Rightarrow> 'b::real_normed_vector"
  assumes "convex s"
    and "\<And>x. x \<in> s \<Longrightarrow> (f has_derivative (\<lambda>h. 0)) (at x within s)"
  shows "\<exists>c. \<forall>x\<in>s. f x = c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>c. \<forall>x\<in>s. f x = c
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>c. \<forall>x\<in>s. f x = c
[PROOF STEP]
{
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>c. \<forall>x\<in>s. f x = c
[PROOF STEP]
fix x y
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>c. \<forall>x\<in>s. f x = c
[PROOF STEP]
assume "x \<in> s" "y \<in> s"
[PROOF STATE]
proof (state)
this:
x \<in> s
y \<in> s

goal (1 subgoal):
 1. \<exists>c. \<forall>x\<in>s. f x = c
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<in> s
y \<in> s
[PROOF STEP]
have "norm (f x - f y) \<le> 0 * norm (x - y)"
[PROOF STATE]
proof (prove)
using this:
x \<in> s
y \<in> s

goal (1 subgoal):
 1. norm (f x - f y) \<le> 0 * norm (x - y)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
x \<in> s
y \<in> s
convex s
?x \<in> s \<Longrightarrow> (f has_derivative (\<lambda>h. 0::'b)) (at ?x within s)

goal (1 subgoal):
 1. norm (f x - f y) \<le> 0 * norm (x - y)
[PROOF STEP]
by (intro differentiable_bound[of s]) (auto simp: onorm_zero)
[PROOF STATE]
proof (state)
this:
norm (f x - f y) \<le> 0 * norm (x - y)

goal (1 subgoal):
 1. \<exists>c. \<forall>x\<in>s. f x = c
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
norm (f x - f y) \<le> 0 * norm (x - y)
[PROOF STEP]
have "f x = f y"
[PROOF STATE]
proof (prove)
using this:
norm (f x - f y) \<le> 0 * norm (x - y)

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

goal (1 subgoal):
 1. \<exists>c. \<forall>x\<in>s. f x = c
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
\<lbrakk>?x2 \<in> s; ?y2 \<in> s\<rbrakk> \<Longrightarrow> f ?x2 = f ?y2

goal (1 subgoal):
 1. \<exists>c. \<forall>x\<in>s. f x = c
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>?x2 \<in> s; ?y2 \<in> s\<rbrakk> \<Longrightarrow> f ?x2 = f ?y2
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?x2 \<in> s; ?y2 \<in> s\<rbrakk> \<Longrightarrow> f ?x2 = f ?y2

goal (1 subgoal):
 1. \<exists>c. \<forall>x\<in>s. f x = c
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
\<exists>c. \<forall>x\<in>s. f x = c

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma sum_sq_mtx_diag[simp]: "(\<Sum>n<m. sq_mtx_diag (g n)) = (\<d>\<i>\<a>\<g> i. \<Sum>n<m. (g n i))" for m::nat
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>n<m. sq_mtx_diag (g n)) = (\<d>\<i>\<a>\<g> i. \<Sum>n<m. g n i)
[PROOF STEP]
by (induct m, simp, subst sq_mtx_eq_iff, simp_all)


[STATEMENT]
lemma "!!a::int. [| a < b; c < d |] ==> a+c+ 1 < b+d"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a. \<lbrakk>a < b; c < d\<rbrakk> \<Longrightarrow> a + c + 1 < b + d
[PROOF STEP]
by arith


[STATEMENT]
lemma mult_succ: "x * succ y = x*y + x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x * ZFC_in_HOL.succ y = x * y + x
[PROOF STEP]
by (simp add: mult_insert plus_eq_lift succ_def)


[STATEMENT]
lemma uint_word_ariths:
  fixes a b :: "'a::len word"
  shows "uint (a + b) = (uint a + uint b) mod 2 ^ LENGTH('a::len)"
    and "uint (a - b) = (uint a - uint b) mod 2 ^ LENGTH('a)"
    and "uint (a * b) = uint a * uint b mod 2 ^ LENGTH('a)"
    and "uint (- a) = - uint a mod 2 ^ LENGTH('a)"
    and "uint (word_succ a) = (uint a + 1) mod 2 ^ LENGTH('a)"
    and "uint (word_pred a) = (uint a - 1) mod 2 ^ LENGTH('a)"
    and "uint (0 :: 'a word) = 0 mod 2 ^ LENGTH('a)"
    and "uint (1 :: 'a word) = 1 mod 2 ^ LENGTH('a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((uint (a + b) = (uint a + uint b) mod 2 ^ LENGTH('a) &&& uint (a - b) = (uint a - uint b) mod 2 ^ LENGTH('a)) &&& uint (a * b) = uint a * uint b mod 2 ^ LENGTH('a) &&& uint (- a) = - uint a mod 2 ^ LENGTH('a)) &&& (uint (word_succ a) = (uint a + 1) mod 2 ^ LENGTH('a) &&& uint (word_pred a) = (uint a - 1) mod 2 ^ LENGTH('a)) &&& uint 0 = 0 mod 2 ^ LENGTH('a) &&& uint 1 = 1 mod 2 ^ LENGTH('a)
[PROOF STEP]
by (simp_all only: word_arith_wis uint_word_of_int_eq flip: take_bit_eq_mod)


[STATEMENT]
lemma Ord_vpair_in_Vset_succI[intro]:
  assumes "Ord \<alpha>" and "a \<in>\<^sub>\<circ> Vset \<alpha>" and "b \<in>\<^sub>\<circ> Vset \<alpha>"
  shows "\<langle>a, b\<rangle> \<in>\<^sub>\<circ> Vset (succ (succ \<alpha>))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<langle>a, b\<rangle> \<in>\<^sub>\<circ> Vset (ZFC_in_HOL.succ (ZFC_in_HOL.succ \<alpha>))
[PROOF STEP]
unfolding vpair_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set {set {a}, set {a, b}} \<in>\<^sub>\<circ> Vset (ZFC_in_HOL.succ (ZFC_in_HOL.succ \<alpha>))
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. set {set {a}, set {a, b}} \<in>\<^sub>\<circ> Vset (ZFC_in_HOL.succ (ZFC_in_HOL.succ \<alpha>))
[PROOF STEP]
have aab: "set {set {a}, set {a, b}} = vinsert (set {a}) (set {set {a, b}})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set {set {a}, set {a, b}} = vinsert (set {a}) (set {set {a, b}})
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
set {set {a}, set {a, b}} = vinsert (set {a}) (set {set {a, b}})

goal (1 subgoal):
 1. set {set {a}, set {a, b}} \<in>\<^sub>\<circ> Vset (ZFC_in_HOL.succ (ZFC_in_HOL.succ \<alpha>))
[PROOF STEP]
show "set {set {a}, set {a, b}} \<in>\<^sub>\<circ> Vset (succ (succ \<alpha>))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set {set {a}, set {a, b}} \<in>\<^sub>\<circ> Vset (ZFC_in_HOL.succ (ZFC_in_HOL.succ \<alpha>))
[PROOF STEP]
unfolding aab
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vinsert (set {a}) (set {set {a, b}}) \<in>\<^sub>\<circ> Vset (ZFC_in_HOL.succ (ZFC_in_HOL.succ \<alpha>))
[PROOF STEP]
by
      (
        intro
          assms
          vinsert_in_Vset_succI'
          Ord_vsingleton_in_Vset_succI
          Ord_vdoubleton_in_Vset_succI
          Ord_succ
      )
[PROOF STATE]
proof (state)
this:
set {set {a}, set {a, b}} \<in>\<^sub>\<circ> Vset (ZFC_in_HOL.succ (ZFC_in_HOL.succ \<alpha>))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in semiring) finsum_product:
  assumes A: "finite A" and B: "finite B"
  and f: "f \<in> A \<rightarrow> carrier R" and g: "g \<in> B \<rightarrow> carrier R"
  shows "finsum R f A \<otimes> finsum R g B = (\<Oplus>i\<in>A. \<Oplus>j\<in>B. f i \<otimes> g j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finsum R f A \<otimes> finsum R g B = (\<Oplus>i\<in>A. \<Oplus>j\<in>B. f i \<otimes> g j)
[PROOF STEP]
unfolding finsum_ldistr[OF A finsum_closed[OF g] f]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Oplus>i\<in>A. f i \<otimes> finsum R g B) = (\<Oplus>i\<in>A. \<Oplus>j\<in>B. f i \<otimes> g j)
[PROOF STEP]
proof (rule finsum_cong'[OF refl])
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (\<lambda>i. \<Oplus>j\<in>B. f i \<otimes> g j) \<in> A \<rightarrow> carrier R
 2. \<And>i. i \<in> A \<Longrightarrow> f i \<otimes> finsum R g B = (\<Oplus>j\<in>B. f i \<otimes> g j)
[PROOF STEP]
fix a
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (\<lambda>i. \<Oplus>j\<in>B. f i \<otimes> g j) \<in> A \<rightarrow> carrier R
 2. \<And>i. i \<in> A \<Longrightarrow> f i \<otimes> finsum R g B = (\<Oplus>j\<in>B. f i \<otimes> g j)
[PROOF STEP]
assume a: "a \<in> A"
[PROOF STATE]
proof (state)
this:
a \<in> A

goal (2 subgoals):
 1. (\<lambda>i. \<Oplus>j\<in>B. f i \<otimes> g j) \<in> A \<rightarrow> carrier R
 2. \<And>i. i \<in> A \<Longrightarrow> f i \<otimes> finsum R g B = (\<Oplus>j\<in>B. f i \<otimes> g j)
[PROOF STEP]
show "f a \<otimes> finsum R g B = (\<Oplus>j\<in>B. f a \<otimes> g j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f a \<otimes> finsum R g B = (\<Oplus>j\<in>B. f a \<otimes> g j)
[PROOF STEP]
by (rule finsum_rdistr[OF B _ g], insert a f, auto)
[PROOF STATE]
proof (state)
this:
f a \<otimes> finsum R g B = (\<Oplus>j\<in>B. f a \<otimes> g j)

goal (1 subgoal):
 1. (\<lambda>i. \<Oplus>j\<in>B. f i \<otimes> g j) \<in> A \<rightarrow> carrier R
[PROOF STEP]
qed (insert f g B, auto intro: finsum_closed)


[STATEMENT]
lemma contour_integral_linepath_same_Im:
  fixes a b :: complex and f :: "complex \<Rightarrow> complex"
  assumes "Im a = Im b" "Re a < Re b"
  shows   "contour_integral (linepath a b) f = integral {Re a..Re b} (\<lambda>x. f (x + Im a * \<i>))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. contour_integral (linepath a b) f = integral {Re a..Re b} (\<lambda>x. f (complex_of_real x + complex_of_real (Im a) * \<i>))
[PROOF STEP]
proof (cases "f contour_integrable_on linepath a b")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. f contour_integrable_on linepath a b \<Longrightarrow> contour_integral (linepath a b) f = integral {Re a..Re b} (\<lambda>x. f (complex_of_real x + complex_of_real (Im a) * \<i>))
 2. \<not> f contour_integrable_on linepath a b \<Longrightarrow> contour_integral (linepath a b) f = integral {Re a..Re b} (\<lambda>x. f (complex_of_real x + complex_of_real (Im a) * \<i>))
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
f contour_integrable_on linepath a b

goal (2 subgoals):
 1. f contour_integrable_on linepath a b \<Longrightarrow> contour_integral (linepath a b) f = integral {Re a..Re b} (\<lambda>x. f (complex_of_real x + complex_of_real (Im a) * \<i>))
 2. \<not> f contour_integrable_on linepath a b \<Longrightarrow> contour_integral (linepath a b) f = integral {Re a..Re b} (\<lambda>x. f (complex_of_real x + complex_of_real (Im a) * \<i>))
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
f contour_integrable_on linepath a b

goal (1 subgoal):
 1. contour_integral (linepath a b) f = integral {Re a..Re b} (\<lambda>x. f (complex_of_real x + complex_of_real (Im a) * \<i>))
[PROOF STEP]
using has_contour_integral_linepath_same_Im_iff[OF assms, of f]
[PROOF STATE]
proof (prove)
using this:
f contour_integrable_on linepath a b
(f has_contour_integral ?I) (linepath a b) = ((\<lambda>x. f (complex_of_real x + complex_of_real (Im a) * \<i>)) has_integral ?I) {Re a..Re b}

goal (1 subgoal):
 1. contour_integral (linepath a b) f = integral {Re a..Re b} (\<lambda>x. f (complex_of_real x + complex_of_real (Im a) * \<i>))
[PROOF STEP]
using has_contour_integral_integral has_contour_integral_unique
[PROOF STATE]
proof (prove)
using this:
f contour_integrable_on linepath a b
(f has_contour_integral ?I) (linepath a b) = ((\<lambda>x. f (complex_of_real x + complex_of_real (Im a) * \<i>)) has_integral ?I) {Re a..Re b}
?f contour_integrable_on ?i \<Longrightarrow> (?f has_contour_integral contour_integral ?i ?f) ?i
\<lbrakk>(?f has_contour_integral ?i) ?g; (?f has_contour_integral ?j) ?g\<rbrakk> \<Longrightarrow> ?i = ?j

goal (1 subgoal):
 1. contour_integral (linepath a b) f = integral {Re a..Re b} (\<lambda>x. f (complex_of_real x + complex_of_real (Im a) * \<i>))
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
contour_integral (linepath a b) f = integral {Re a..Re b} (\<lambda>x. f (complex_of_real x + complex_of_real (Im a) * \<i>))

goal (1 subgoal):
 1. \<not> f contour_integrable_on linepath a b \<Longrightarrow> contour_integral (linepath a b) f = integral {Re a..Re b} (\<lambda>x. f (complex_of_real x + complex_of_real (Im a) * \<i>))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> f contour_integrable_on linepath a b \<Longrightarrow> contour_integral (linepath a b) f = integral {Re a..Re b} (\<lambda>x. f (complex_of_real x + complex_of_real (Im a) * \<i>))
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> f contour_integrable_on linepath a b

goal (1 subgoal):
 1. \<not> f contour_integrable_on linepath a b \<Longrightarrow> contour_integral (linepath a b) f = integral {Re a..Re b} (\<lambda>x. f (complex_of_real x + complex_of_real (Im a) * \<i>))
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<not> f contour_integrable_on linepath a b

goal (1 subgoal):
 1. contour_integral (linepath a b) f = integral {Re a..Re b} (\<lambda>x. f (complex_of_real x + complex_of_real (Im a) * \<i>))
[PROOF STEP]
using contour_integrable_linepath_same_Im_iff[OF assms, of f]
[PROOF STATE]
proof (prove)
using this:
\<not> f contour_integrable_on linepath a b
(f contour_integrable_on linepath a b) = ((\<lambda>x. f (complex_of_real x + complex_of_real (Im a) * \<i>)) integrable_on {Re a..Re b})

goal (1 subgoal):
 1. contour_integral (linepath a b) f = integral {Re a..Re b} (\<lambda>x. f (complex_of_real x + complex_of_real (Im a) * \<i>))
[PROOF STEP]
by (simp add: not_integrable_contour_integral not_integrable_integral)
[PROOF STATE]
proof (state)
this:
contour_integral (linepath a b) f = integral {Re a..Re b} (\<lambda>x. f (complex_of_real x + complex_of_real (Im a) * \<i>))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma bijective_alt: "bijective R \<longleftrightarrow> single_valued R \<and> single_valued (R\<inverse>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bijective R = (single_valued R \<and> single_valued (R\<inverse>))
[PROOF STEP]
unfolding bijective_def single_valued_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<forall>x y z. (x, y) \<in> R \<and> (x, z) \<in> R \<longrightarrow> y = z) \<and> (\<forall>x y z. (x, z) \<in> R \<and> (y, z) \<in> R \<longrightarrow> x = y)) = ((\<forall>x y. (x, y) \<in> R \<longrightarrow> (\<forall>z. (x, z) \<in> R \<longrightarrow> y = z)) \<and> (\<forall>x y. (x, y) \<in> R\<inverse> \<longrightarrow> (\<forall>z. (x, z) \<in> R\<inverse> \<longrightarrow> y = z)))
[PROOF STEP]
by blast


[STATEMENT]
lemma card_UNIV_sum: "CARD('a + 'b) = (if CARD('a) \<noteq> 0 \<and> CARD('b) \<noteq> 0 then CARD('a) + CARD('b) else 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. CARD('a + 'b) = (if CARD('a) \<noteq> 0 \<and> CARD('b) \<noteq> 0 then CARD('a) + CARD('b) else 0)
[PROOF STEP]
unfolding UNIV_Plus_UNIV[symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (UNIV <+> UNIV) = (if CARD('a) \<noteq> 0 \<and> CARD('b) \<noteq> 0 then CARD('a) + CARD('b) else 0)
[PROOF STEP]
by(auto simp add: card_eq_0_iff card_Plus simp del: UNIV_Plus_UNIV)


[STATEMENT]
lemma continuous_le_on_closure:
  fixes a::real
  assumes f: "continuous_on (closure s) f"
      and x: "x \<in> closure(s)"
      and xlo: "\<And>x. x \<in> s ==> f(x) \<le> a"
    shows "f(x) \<le> a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f x \<le> a
[PROOF STEP]
using image_closure_subset [OF f, where T=" {x. x \<le> a}" ] assms
    continuous_on_closed_Collect_le[of "UNIV" "\<lambda>x. x" "\<lambda>x. a"]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>closed {x. x \<le> a}; f ` s \<subseteq> {x. x \<le> a}\<rbrakk> \<Longrightarrow> f ` closure s \<subseteq> {x. x \<le> a}
continuous_on (closure s) f
x \<in> closure s
?x \<in> s \<Longrightarrow> f ?x \<le> a
\<lbrakk>continuous_on UNIV (\<lambda>x. x); continuous_on UNIV (\<lambda>x. a); closed UNIV\<rbrakk> \<Longrightarrow> closed {x \<in> UNIV. x \<le> a}

goal (1 subgoal):
 1. f x \<le> a
[PROOF STEP]
by auto


[STATEMENT]
lemma card_segments [simp]: "card (segments n) = n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (segments n) = n
[PROOF STEP]
by (simp add: segments_def segment_def card_image divide_right_mono inj_on_def)


[STATEMENT]
lemma input_sizes_deep_model:
assumes "length rs \<ge> 2"
shows "input_sizes (deep_model_l rs) = replicate (2^(length rs - 2)) (last rs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. input_sizes (deep_model_l rs) = replicate (2 ^ (length rs - 2)) (last rs)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. input_sizes (deep_model_l rs) = replicate (2 ^ (length rs - 2)) (last rs)
[PROOF STEP]
have "input_sizes (deep_model_l rs) = input_sizes (deep_model'_l (tl rs))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. input_sizes (deep_model_l rs) = input_sizes (deep_model'_l (tl rs))
[PROOF STEP]
by (metis One_nat_def Suc_1 assms hd_Cons_tl deep_model.elims input_sizes.simps(2) length_Cons
    length_greater_0_conv lessI linorder_not_le list.size(3) not_numeral_le_zero nth_tl)
[PROOF STATE]
proof (state)
this:
input_sizes (deep_model_l rs) = input_sizes (deep_model'_l (tl rs))

goal (1 subgoal):
 1. input_sizes (deep_model_l rs) = replicate (2 ^ (length rs - 2)) (last rs)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
input_sizes (deep_model_l rs) = input_sizes (deep_model'_l (tl rs))

goal (1 subgoal):
 1. input_sizes (deep_model_l rs) = replicate (2 ^ (length rs - 2)) (last rs)
[PROOF STEP]
have "... = replicate (2^(length rs - 2)) (last rs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. input_sizes (deep_model'_l (tl rs)) = replicate (2 ^ (length rs - 2)) (last rs)
[PROOF STEP]
using input_sizes_deep_model'
[PROOF STATE]
proof (prove)
using this:
1 \<le> length ?rs \<Longrightarrow> input_sizes (deep_model'_l ?rs) = replicate (2 ^ (length ?rs - 1)) (last ?rs)

goal (1 subgoal):
 1. input_sizes (deep_model'_l (tl rs)) = replicate (2 ^ (length rs - 2)) (last rs)
[PROOF STEP]
by (metis (no_types, lifting) One_nat_def Suc_1 Suc_eq_plus1 assms diff_diff_left hd_Cons_tl
    last_tl length_Cons length_tl linorder_not_le list.size(3) not_less_eq not_numeral_le_zero
    numeral_le_one_iff semiring_norm(69))
[PROOF STATE]
proof (state)
this:
input_sizes (deep_model'_l (tl rs)) = replicate (2 ^ (length rs - 2)) (last rs)

goal (1 subgoal):
 1. input_sizes (deep_model_l rs) = replicate (2 ^ (length rs - 2)) (last rs)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
input_sizes (deep_model_l rs) = replicate (2 ^ (length rs - 2)) (last rs)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
input_sizes (deep_model_l rs) = replicate (2 ^ (length rs - 2)) (last rs)

goal (1 subgoal):
 1. input_sizes (deep_model_l rs) = replicate (2 ^ (length rs - 2)) (last rs)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
input_sizes (deep_model_l rs) = replicate (2 ^ (length rs - 2)) (last rs)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma csquare_continuous:
  fixes e :: real
  shows "e > 0 \<Longrightarrow> \<exists>d. 0 < d \<and> (\<forall>y. cmod (y - x) < d \<longrightarrow> cmod (y * y - x * x) < e)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < e \<Longrightarrow> \<exists>d>0. \<forall>y. cmod (y - x) < d \<longrightarrow> cmod (y * y - x * x) < e
[PROOF STEP]
using isCont_power[OF continuous_ident, of x, unfolded isCont_def LIM_eq, rule_format, of e 2]
[PROOF STATE]
proof (prove)
using this:
0 < e \<Longrightarrow> \<exists>s>0. \<forall>xa. xa \<noteq> x \<and> cmod (xa - x) < s \<longrightarrow> cmod (xa\<^sup>2 - x\<^sup>2) < e

goal (1 subgoal):
 1. 0 < e \<Longrightarrow> \<exists>d>0. \<forall>y. cmod (y - x) < d \<longrightarrow> cmod (y * y - x * x) < e
[PROOF STEP]
by (force simp add: power2_eq_square)


[STATEMENT]
lemma ldropWhile_eq_LNil_iff: "ldropWhile P xs = LNil \<longleftrightarrow> (\<forall>x \<in> lset xs. P x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (ldropWhile P xs = LNil) = (\<forall>x\<in>lset xs. P x)
[PROOF STEP]
by(induct xs) simp_all


[STATEMENT]
lemma sgn1_zero_eq_arg_zero: "(sgn1 x = 0) = (x = 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (sgn1 x = 0) = (x = 0)
[PROOF STEP]
by (cases x) auto


[STATEMENT]
lemma (in complete_boolean_algebra) join_shunt: "x \<squnion> y = \<top> \<longleftrightarrow> -x \<le> y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<squnion> y = \<top>) = (- x \<le> y)
[PROOF STEP]
by (metis compl_sup compl_top_eq double_compl meet_shunt)


[STATEMENT]
lemma (in comm_semiring_0) poly_mult_assoc: "poly ((a *** b) *** c) x = poly (a *** (b *** c)) x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly (a *** b *** c) x = poly (a *** (b *** c)) x
[PROOF STEP]
by (simp add: poly_mult mult.assoc)


[STATEMENT]
lemma fcard_pfsubset: "A |\<subseteq>| B \<Longrightarrow> fcard A < fcard B \<Longrightarrow> A < B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>A |\<subseteq>| B; fcard A < fcard B\<rbrakk> \<Longrightarrow> A |\<subset>| B
[PROOF STEP]
by transfer (rule card_psubset)


[STATEMENT]
lemma Union_take_drop_id: "\<Union>(set (drop n l)) \<union> \<Union>(set (take n l)) = \<Union>(set l)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union> (set (drop n l)) \<union> \<Union> (set (take n l)) = \<Union> (set l)
[PROOF STEP]
by (metis Union_Un_distrib append_take_drop_id set_union_code sup_commute)


[STATEMENT]
lemma (in finite_cyclic_group)
  defines ic: "induce_char \<equiv> (\<lambda>c::complex. (\<lambda>a. if a\<in>carrier G then c powi get_exp gen a else 0))"
  shows order_Characters: "order (Characters G) = order G"
  and   gen_fixes_char: "\<lbrakk>character G a; character G b; a gen = b gen\<rbrakk> \<Longrightarrow> a = b"
  and   unity_root_induce_char: "z ^ order G = 1 \<Longrightarrow> character G (induce_char z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. order (Characters G) = order G &&& (\<lbrakk>character G a; character G b; a gen = b gen\<rbrakk> \<Longrightarrow> a = b) &&& (z ^ order G = 1 \<Longrightarrow> character G (induce_char z))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. order (Characters G) = order G
 2. \<lbrakk>character G a; character G b; a gen = b gen\<rbrakk> \<Longrightarrow> a = b
 3. z ^ order G = 1 \<Longrightarrow> character G (induce_char z)
[PROOF STEP]
interpret C: finite_comm_group "Characters G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite_comm_group (Characters G)
[PROOF STEP]
using finite_comm_group_Characters
[PROOF STATE]
proof (prove)
using this:
finite_comm_group (Characters G)

goal (1 subgoal):
 1. finite_comm_group (Characters G)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. order (Characters G) = order G
 2. \<lbrakk>character G a; character G b; a gen = b gen\<rbrakk> \<Longrightarrow> a = b
 3. z ^ order G = 1 \<Longrightarrow> character G (induce_char z)
[PROOF STEP]
define n where "n = order G"
[PROOF STATE]
proof (state)
this:
n = order G

goal (3 subgoals):
 1. order (Characters G) = order G
 2. \<lbrakk>character G a; character G b; a gen = b gen\<rbrakk> \<Longrightarrow> a = b
 3. z ^ order G = 1 \<Longrightarrow> character G (induce_char z)
[PROOF STEP]
hence n: "n > 0"
[PROOF STATE]
proof (prove)
using this:
n = order G

goal (1 subgoal):
 1. 0 < n
[PROOF STEP]
using order_gt_0
[PROOF STATE]
proof (prove)
using this:
n = order G
0 < order G

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

goal (3 subgoals):
 1. order (Characters G) = order G
 2. \<lbrakk>character G a; character G b; a gen = b gen\<rbrakk> \<Longrightarrow> a = b
 3. z ^ order G = 1 \<Longrightarrow> character G (induce_char z)
[PROOF STEP]
from n_def
[PROOF STATE]
proof (chain)
picking this:
n = order G
[PROOF STEP]
have nog: "n = ord gen"
[PROOF STATE]
proof (prove)
using this:
n = order G

goal (1 subgoal):
 1. n = ord gen
[PROOF STEP]
using ord_gen_is_group_order
[PROOF STATE]
proof (prove)
using this:
n = order G
ord gen = order G

goal (1 subgoal):
 1. n = ord gen
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
n = ord gen

goal (3 subgoals):
 1. order (Characters G) = order G
 2. \<lbrakk>character G a; character G b; a gen = b gen\<rbrakk> \<Longrightarrow> a = b
 3. z ^ order G = 1 \<Longrightarrow> character G (induce_char z)
[PROOF STEP]
have xnz: "x \<noteq> 0" if "x ^ n = 1" for x::complex
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<noteq> 0
[PROOF STEP]
using n(1) that
[PROOF STATE]
proof (prove)
using this:
0 < n
x ^ n = 1

goal (1 subgoal):
 1. x \<noteq> 0
[PROOF STEP]
by (metis zero_neq_one zero_power)
[PROOF STATE]
proof (state)
this:
?x2 ^ n = 1 \<Longrightarrow> ?x2 \<noteq> 0

goal (3 subgoals):
 1. order (Characters G) = order G
 2. \<lbrakk>character G a; character G b; a gen = b gen\<rbrakk> \<Longrightarrow> a = b
 3. z ^ order G = 1 \<Longrightarrow> character G (induce_char z)
[PROOF STEP]
have m: "x powi m = x powi (m mod n)" if "x ^ n = 1" for x::complex and m::int
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x powi m = x powi (m mod int n)
[PROOF STEP]
using powi_mod[OF that n]
[PROOF STATE]
proof (prove)
using this:
x powi ?m = x powi (?m mod int n)

goal (1 subgoal):
 1. x powi m = x powi (m mod int n)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
?x2 ^ n = 1 \<Longrightarrow> ?x2 powi ?m2 = ?x2 powi (?m2 mod int n)

goal (3 subgoals):
 1. order (Characters G) = order G
 2. \<lbrakk>character G a; character G b; a gen = b gen\<rbrakk> \<Longrightarrow> a = b
 3. z ^ order G = 1 \<Longrightarrow> character G (induce_char z)
[PROOF STEP]
show cf: "character G (induce_char x)" if x: "x ^ n = 1" for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. character G (induce_char x)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. induce_char x \<one> \<noteq> 0
 2. \<And>a. a \<notin> carrier G \<Longrightarrow> induce_char x a = 0
 3. \<And>a b. \<lbrakk>a \<in> carrier G; b \<in> carrier G\<rbrakk> \<Longrightarrow> induce_char x (a \<otimes> b) = induce_char x a * induce_char x b
[PROOF STEP]
show "induce_char x \<one> \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. induce_char x \<one> \<noteq> 0
[PROOF STEP]
using xnz[OF that]
[PROOF STATE]
proof (prove)
using this:
x \<noteq> 0

goal (1 subgoal):
 1. induce_char x \<one> \<noteq> 0
[PROOF STEP]
unfolding ic
[PROOF STATE]
proof (prove)
using this:
x \<noteq> 0

goal (1 subgoal):
 1. (if \<one> \<in> carrier G then x powi get_exp gen \<one> else 0) \<noteq> 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
induce_char x \<one> \<noteq> 0

goal (2 subgoals):
 1. \<And>a. a \<notin> carrier G \<Longrightarrow> induce_char x a = 0
 2. \<And>a b. \<lbrakk>a \<in> carrier G; b \<in> carrier G\<rbrakk> \<Longrightarrow> induce_char x (a \<otimes> b) = induce_char x a * induce_char x b
[PROOF STEP]
show "induce_char x a = 0" if "a \<notin> carrier G" for a
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. induce_char x a = 0
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
a \<notin> carrier G

goal (1 subgoal):
 1. induce_char x a = 0
[PROOF STEP]
unfolding ic
[PROOF STATE]
proof (prove)
using this:
a \<notin> carrier G

goal (1 subgoal):
 1. (if a \<in> carrier G then x powi get_exp gen a else 0) = 0
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
?a2 \<notin> carrier G \<Longrightarrow> induce_char x ?a2 = 0

goal (1 subgoal):
 1. \<And>a b. \<lbrakk>a \<in> carrier G; b \<in> carrier G\<rbrakk> \<Longrightarrow> induce_char x (a \<otimes> b) = induce_char x a * induce_char x b
[PROOF STEP]
show "induce_char x (a \<otimes> b) = induce_char x a * induce_char x b"
      if "a \<in> carrier G" "b \<in> carrier G" for a b
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. induce_char x (a \<otimes> b) = induce_char x a * induce_char x b
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. induce_char x (a \<otimes> b) = induce_char x a * induce_char x b
[PROOF STEP]
have "x powi get_exp gen (a \<otimes> b) = x powi get_exp gen a * x powi get_exp gen b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x powi get_exp gen (a \<otimes> b) = x powi get_exp gen a * x powi get_exp gen b
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x powi get_exp gen (a \<otimes> b) = x powi get_exp gen a * x powi get_exp gen b
[PROOF STEP]
have "x powi get_exp gen (a \<otimes> b) = x powi ((get_exp gen a + get_exp gen b) mod n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x powi get_exp gen (a \<otimes> b) = x powi ((get_exp gen a + get_exp gen b) mod int n)
[PROOF STEP]
using m[OF x] get_exp_mult_mod[OF that] n_def ord_gen_is_group_order
[PROOF STATE]
proof (prove)
using this:
x powi ?m2 = x powi (?m2 mod int n)
get_exp gen (a \<otimes> b) mod int (ord gen) = (get_exp gen a + get_exp gen b) mod int (ord gen)
n = order G
ord gen = order G

goal (1 subgoal):
 1. x powi get_exp gen (a \<otimes> b) = x powi ((get_exp gen a + get_exp gen b) mod int n)
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
x powi get_exp gen (a \<otimes> b) = x powi ((get_exp gen a + get_exp gen b) mod int n)

goal (1 subgoal):
 1. x powi get_exp gen (a \<otimes> b) = x powi get_exp gen a * x powi get_exp gen b
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
x powi get_exp gen (a \<otimes> b) = x powi ((get_exp gen a + get_exp gen b) mod int n)

goal (1 subgoal):
 1. x powi get_exp gen (a \<otimes> b) = x powi get_exp gen a * x powi get_exp gen b
[PROOF STEP]
have "\<dots> = x powi (get_exp gen a + get_exp gen b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x powi ((get_exp gen a + get_exp gen b) mod int n) = x powi (get_exp gen a + get_exp gen b)
[PROOF STEP]
using m[OF x]
[PROOF STATE]
proof (prove)
using this:
x powi ?m2 = x powi (?m2 mod int n)

goal (1 subgoal):
 1. x powi ((get_exp gen a + get_exp gen b) mod int n) = x powi (get_exp gen a + get_exp gen b)
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
x powi ((get_exp gen a + get_exp gen b) mod int n) = x powi (get_exp gen a + get_exp gen b)

goal (1 subgoal):
 1. x powi get_exp gen (a \<otimes> b) = x powi get_exp gen a * x powi get_exp gen b
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
x powi get_exp gen (a \<otimes> b) = x powi (get_exp gen a + get_exp gen b)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
x powi get_exp gen (a \<otimes> b) = x powi (get_exp gen a + get_exp gen b)

goal (1 subgoal):
 1. x powi get_exp gen (a \<otimes> b) = x powi get_exp gen a * x powi get_exp gen b
[PROOF STEP]
by (simp add: power_int_add xnz[OF x])
[PROOF STATE]
proof (state)
this:
x powi get_exp gen (a \<otimes> b) = x powi get_exp gen a * x powi get_exp gen b

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
x powi get_exp gen (a \<otimes> b) = x powi get_exp gen a * x powi get_exp gen b

goal (1 subgoal):
 1. induce_char x (a \<otimes> b) = induce_char x a * induce_char x b
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
x powi get_exp gen (a \<otimes> b) = x powi get_exp gen a * x powi get_exp gen b

goal (1 subgoal):
 1. induce_char x (a \<otimes> b) = induce_char x a * induce_char x b
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
x powi get_exp gen (a \<otimes> b) = x powi get_exp gen a * x powi get_exp gen b
a \<in> carrier G
b \<in> carrier G

goal (1 subgoal):
 1. induce_char x (a \<otimes> b) = induce_char x a * induce_char x b
[PROOF STEP]
unfolding ic
[PROOF STATE]
proof (prove)
using this:
x powi get_exp gen (a \<otimes> b) = x powi get_exp gen a * x powi get_exp gen b
a \<in> carrier G
b \<in> carrier G

goal (1 subgoal):
 1. (if a \<otimes> b \<in> carrier G then x powi get_exp gen (a \<otimes> b) else 0) = (if a \<in> carrier G then x powi get_exp gen a else 0) * (if b \<in> carrier G then x powi get_exp gen b else 0)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
induce_char x (a \<otimes> b) = induce_char x a * induce_char x b

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<lbrakk>?a2 \<in> carrier G; ?b2 \<in> carrier G\<rbrakk> \<Longrightarrow> induce_char x (?a2 \<otimes> ?b2) = induce_char x ?a2 * induce_char x ?b2

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
?x2 ^ n = 1 \<Longrightarrow> character G (induce_char ?x2)

goal (2 subgoals):
 1. order (Characters G) = order G
 2. \<lbrakk>character G a; character G b; a gen = b gen\<rbrakk> \<Longrightarrow> a = b
[PROOF STEP]
define get_c where gc: "get_c = (\<lambda>c::'a \<Rightarrow> complex. c gen)"
[PROOF STATE]
proof (state)
this:
get_c = (\<lambda>c. c gen)

goal (2 subgoals):
 1. order (Characters G) = order G
 2. \<lbrakk>character G a; character G b; a gen = b gen\<rbrakk> \<Longrightarrow> a = b
[PROOF STEP]
have biji: "bij_betw induce_char {z. z ^ n = 1} (characters G)"
   and bijg: "bij_betw get_c (characters G) {z. z ^ n = 1}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bij_betw induce_char {z. z ^ n = 1} (characters G) &&& bij_betw get_c (characters G) {z. z ^ n = 1}
[PROOF STEP]
proof (intro bij_betwI[of _ _ _ get_c])
[PROOF STATE]
proof (state)
goal (5 subgoals):
 1. induce_char \<in> {z. z ^ n = 1} \<rightarrow> characters G
 2. get_c \<in> characters G \<rightarrow> {z. z ^ n = 1}
 3. \<And>x. x \<in> {z. z ^ n = 1} \<Longrightarrow> get_c (induce_char x) = x
 4. \<And>y. y \<in> characters G \<Longrightarrow> induce_char (get_c y) = y
 5. bij_betw get_c (characters G) {z. z ^ n = 1}
[PROOF STEP]
show iin: "induce_char \<in> {z. z ^ n = 1} \<rightarrow> characters G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. induce_char \<in> {z. z ^ n = 1} \<rightarrow> characters G
[PROOF STEP]
using cf
[PROOF STATE]
proof (prove)
using this:
?x2 ^ n = 1 \<Longrightarrow> character G (induce_char ?x2)

goal (1 subgoal):
 1. induce_char \<in> {z. z ^ n = 1} \<rightarrow> characters G
[PROOF STEP]
unfolding characters_def
[PROOF STATE]
proof (prove)
using this:
?x2 ^ n = 1 \<Longrightarrow> character G (induce_char ?x2)

goal (1 subgoal):
 1. induce_char \<in> {z. z ^ n = 1} \<rightarrow> Collect (character G)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
induce_char \<in> {z. z ^ n = 1} \<rightarrow> characters G

goal (4 subgoals):
 1. get_c \<in> characters G \<rightarrow> {z. z ^ n = 1}
 2. \<And>x. x \<in> {z. z ^ n = 1} \<Longrightarrow> get_c (induce_char x) = x
 3. \<And>y. y \<in> characters G \<Longrightarrow> induce_char (get_c y) = y
 4. bij_betw get_c (characters G) {z. z ^ n = 1}
[PROOF STEP]
show gi: "get_c (induce_char x) = x" if "x \<in> {z. z ^ n = 1}" for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. get_c (induce_char x) = x
[PROOF STEP]
proof (cases "n = 1")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. n = 1 \<Longrightarrow> get_c (induce_char x) = x
 2. n \<noteq> 1 \<Longrightarrow> get_c (induce_char x) = x
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
n = 1

goal (2 subgoals):
 1. n = 1 \<Longrightarrow> get_c (induce_char x) = x
 2. n \<noteq> 1 \<Longrightarrow> get_c (induce_char x) = x
[PROOF STEP]
with that
[PROOF STATE]
proof (chain)
picking this:
x \<in> {z. z ^ n = 1}
n = 1
[PROOF STEP]
have "x = 1"
[PROOF STATE]
proof (prove)
using this:
x \<in> {z. z ^ n = 1}
n = 1

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

goal (2 subgoals):
 1. n = 1 \<Longrightarrow> get_c (induce_char x) = x
 2. n \<noteq> 1 \<Longrightarrow> get_c (induce_char x) = x
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
x = 1

goal (1 subgoal):
 1. get_c (induce_char x) = x
[PROOF STEP]
unfolding ic gc
[PROOF STATE]
proof (prove)
using this:
x = 1

goal (1 subgoal):
 1. (if gen \<in> carrier G then x powi get_exp gen gen else 0) = x
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
get_c (induce_char x) = x

goal (1 subgoal):
 1. n \<noteq> 1 \<Longrightarrow> get_c (induce_char x) = x
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. n \<noteq> 1 \<Longrightarrow> get_c (induce_char x) = x
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
n \<noteq> 1

goal (1 subgoal):
 1. n \<noteq> 1 \<Longrightarrow> get_c (induce_char x) = x
[PROOF STEP]
have x: "x ^ n = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x ^ n = 1
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
x \<in> {z. z ^ n = 1}

goal (1 subgoal):
 1. x ^ n = 1
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
x ^ n = 1

goal (1 subgoal):
 1. n \<noteq> 1 \<Longrightarrow> get_c (induce_char x) = x
[PROOF STEP]
have "x powi get_exp gen gen = x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x powi get_exp gen gen = x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x powi get_exp gen gen = x
[PROOF STEP]
have "x powi get_exp gen gen = x powi (get_exp gen gen mod n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x powi get_exp gen gen = x powi (get_exp gen gen mod int n)
[PROOF STEP]
using m[OF x]
[PROOF STATE]
proof (prove)
using this:
x powi ?m2 = x powi (?m2 mod int n)

goal (1 subgoal):
 1. x powi get_exp gen gen = x powi (get_exp gen gen mod int n)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
x powi get_exp gen gen = x powi (get_exp gen gen mod int n)

goal (1 subgoal):
 1. x powi get_exp gen gen = x
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
x powi get_exp gen gen = x powi (get_exp gen gen mod int n)

goal (1 subgoal):
 1. x powi get_exp gen gen = x
[PROOF STEP]
have "(get_exp gen gen mod n) = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. get_exp gen gen mod int n = 1
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. get_exp gen gen mod int n = 1
[PROOF STEP]
have "1 = 1 mod int n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 = 1 mod int n
[PROOF STEP]
using False n
[PROOF STATE]
proof (prove)
using this:
n \<noteq> 1
0 < n

goal (1 subgoal):
 1. 1 = 1 mod int n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
1 = 1 mod int n

goal (1 subgoal):
 1. get_exp gen gen mod int n = 1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
1 = 1 mod int n

goal (1 subgoal):
 1. get_exp gen gen mod int n = 1
[PROOF STEP]
have "\<dots> = get_exp gen gen mod n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 mod int n = get_exp gen gen mod int n
[PROOF STEP]
by (unfold nog, intro pow_eq_int_mod[OF gen_closed],
                use get_exp_fulfills[OF gen_closed] in auto)
[PROOF STATE]
proof (state)
this:
1 mod int n = get_exp gen gen mod int n

goal (1 subgoal):
 1. get_exp gen gen mod int n = 1
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
1 = get_exp gen gen mod int n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
1 = get_exp gen gen mod int n

goal (1 subgoal):
 1. get_exp gen gen mod int n = 1
[PROOF STEP]
by argo
[PROOF STATE]
proof (state)
this:
get_exp gen gen mod int n = 1

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
get_exp gen gen mod int n = 1

goal (1 subgoal):
 1. x powi get_exp gen gen = x
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
x powi get_exp gen gen = x powi (get_exp gen gen mod int n)
get_exp gen gen mod int n = 1
[PROOF STEP]
show "x powi get_exp gen gen = x"
[PROOF STATE]
proof (prove)
using this:
x powi get_exp gen gen = x powi (get_exp gen gen mod int n)
get_exp gen gen mod int n = 1

goal (1 subgoal):
 1. x powi get_exp gen gen = x
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
x powi get_exp gen gen = x

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
x powi get_exp gen gen = x

goal (1 subgoal):
 1. n \<noteq> 1 \<Longrightarrow> get_c (induce_char x) = x
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
x powi get_exp gen gen = x

goal (1 subgoal):
 1. get_c (induce_char x) = x
[PROOF STEP]
unfolding ic gc
[PROOF STATE]
proof (prove)
using this:
x powi get_exp gen gen = x

goal (1 subgoal):
 1. (if gen \<in> carrier G then x powi get_exp gen gen else 0) = x
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
get_c (induce_char x) = x

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
?x2 \<in> {z. z ^ n = 1} \<Longrightarrow> get_c (induce_char ?x2) = ?x2

goal (3 subgoals):
 1. get_c \<in> characters G \<rightarrow> {z. z ^ n = 1}
 2. \<And>y. y \<in> characters G \<Longrightarrow> induce_char (get_c y) = y
 3. bij_betw get_c (characters G) {z. z ^ n = 1}
[PROOF STEP]
show gin: "get_c \<in> characters G \<rightarrow> {z. z ^ n = 1}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. get_c \<in> characters G \<rightarrow> {z. z ^ n = 1}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. get_c \<in> characters G \<rightarrow> {z. z ^ n = 1}
[PROOF STEP]
have "False" if "get_c c ^ n \<noteq> 1" "character G c" for c
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. False
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. False
[PROOF STEP]
interpret character G c
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. character G c
[PROOF STEP]
by fact
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. False
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. False
[PROOF STEP]
using that(1)[unfolded gc]
[PROOF STATE]
proof (prove)
using this:
c gen ^ n \<noteq> 1

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<lbrakk>get_c ?c2 ^ n \<noteq> 1; character G ?c2\<rbrakk> \<Longrightarrow> False

goal (1 subgoal):
 1. get_c \<in> characters G \<rightarrow> {z. z ^ n = 1}
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>get_c ?c2 ^ n \<noteq> 1; character G ?c2\<rbrakk> \<Longrightarrow> False

goal (1 subgoal):
 1. get_c \<in> characters G \<rightarrow> {z. z ^ n = 1}
[PROOF STEP]
unfolding characters_def
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>get_c ?c2 ^ n \<noteq> 1; character G ?c2\<rbrakk> \<Longrightarrow> False

goal (1 subgoal):
 1. get_c \<in> Collect (character G) \<rightarrow> {z. z ^ n = 1}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
get_c \<in> characters G \<rightarrow> {z. z ^ n = 1}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
get_c \<in> characters G \<rightarrow> {z. z ^ n = 1}

goal (2 subgoals):
 1. \<And>y. y \<in> characters G \<Longrightarrow> induce_char (get_c y) = y
 2. bij_betw get_c (characters G) {z. z ^ n = 1}
[PROOF STEP]
show ig: "induce_char (get_c y) = y" if y: "y \<in> characters G" for y
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. induce_char (get_c y) = y
[PROOF STEP]
proof (cases "n = 1")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. n = 1 \<Longrightarrow> induce_char (get_c y) = y
 2. n \<noteq> 1 \<Longrightarrow> induce_char (get_c y) = y
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
n = 1

goal (2 subgoals):
 1. n = 1 \<Longrightarrow> induce_char (get_c y) = y
 2. n \<noteq> 1 \<Longrightarrow> induce_char (get_c y) = y
[PROOF STEP]
hence "y = principal_char G"
[PROOF STATE]
proof (prove)
using this:
n = 1

goal (1 subgoal):
 1. y = principal_char G
[PROOF STEP]
using y n_def character.character_in_order_1 characters_def
[PROOF STATE]
proof (prove)
using this:
n = 1
y \<in> characters G
n = order G
\<lbrakk>character ?G ?\<chi>; order ?G = 1\<rbrakk> \<Longrightarrow> ?\<chi> = principal_char ?G
characters ?G = {\<chi>. character ?G \<chi>}

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

goal (2 subgoals):
 1. n = 1 \<Longrightarrow> induce_char (get_c y) = y
 2. n \<noteq> 1 \<Longrightarrow> induce_char (get_c y) = y
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
y = principal_char G

goal (1 subgoal):
 1. induce_char (get_c y) = y
[PROOF STEP]
unfolding ic gc principal_char_def
[PROOF STATE]
proof (prove)
using this:
y = (\<lambda>a. if a \<in> carrier G then 1 else 0)

goal (1 subgoal):
 1. (\<lambda>a. if a \<in> carrier G then y gen powi get_exp gen a else 0) = y
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
induce_char (get_c y) = y

goal (1 subgoal):
 1. n \<noteq> 1 \<Longrightarrow> induce_char (get_c y) = y
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. n \<noteq> 1 \<Longrightarrow> induce_char (get_c y) = y
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
n \<noteq> 1

goal (1 subgoal):
 1. n \<noteq> 1 \<Longrightarrow> induce_char (get_c y) = y
[PROOF STEP]
have yc: "y \<in> carrier (Characters G)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y \<in> carrier (Characters G)
[PROOF STEP]
using y[unfolded carrier_Characters[symmetric]]
[PROOF STATE]
proof (prove)
using this:
y \<in> carrier (Characters G)

goal (1 subgoal):
 1. y \<in> carrier (Characters G)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
y \<in> carrier (Characters G)

goal (1 subgoal):
 1. n \<noteq> 1 \<Longrightarrow> induce_char (get_c y) = y
[PROOF STEP]
interpret character G y
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. character G y
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
y \<in> characters G

goal (1 subgoal):
 1. character G y
[PROOF STEP]
unfolding characters_def
[PROOF STATE]
proof (prove)
using this:
y \<in> Collect (character G)

goal (1 subgoal):
 1. character G y
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. n \<noteq> 1 \<Longrightarrow> induce_char (get_c y) = y
[PROOF STEP]
have ygo: "y gen ^ n = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y gen ^ n = 1
[PROOF STEP]
using char_root'[OF gen_closed] n_def
[PROOF STATE]
proof (prove)
using this:
y gen ^ order G = 1
n = order G

goal (1 subgoal):
 1. y gen ^ n = 1
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
y gen ^ n = 1

goal (1 subgoal):
 1. n \<noteq> 1 \<Longrightarrow> induce_char (get_c y) = y
[PROOF STEP]
have "y gen powi get_exp gen a = y a" if "a \<in> carrier G" for a
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y gen powi get_exp gen a = y a
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
a \<in> carrier G

goal (1 subgoal):
 1. y gen powi get_exp gen a = y a
[PROOF STEP]
proof(induction rule: generator_induct1)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. y gen powi get_exp gen gen = y gen
 2. \<And>x. \<lbrakk>x \<in> carrier G; y gen powi get_exp gen x = y x\<rbrakk> \<Longrightarrow> y gen powi get_exp gen (x \<otimes> gen) = y (x \<otimes> gen)
[PROOF STEP]
case gen
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. y gen powi get_exp gen gen = y gen
 2. \<And>x. \<lbrakk>x \<in> carrier G; y gen powi get_exp gen x = y x\<rbrakk> \<Longrightarrow> y gen powi get_exp gen (x \<otimes> gen) = y (x \<otimes> gen)
[PROOF STEP]
have "y gen powi get_exp gen gen = y gen powi (get_exp gen gen mod n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y gen powi get_exp gen gen = y gen powi (get_exp gen gen mod int n)
[PROOF STEP]
using m[OF ygo]
[PROOF STATE]
proof (prove)
using this:
y gen powi ?m2 = y gen powi (?m2 mod int n)

goal (1 subgoal):
 1. y gen powi get_exp gen gen = y gen powi (get_exp gen gen mod int n)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
y gen powi get_exp gen gen = y gen powi (get_exp gen gen mod int n)

goal (2 subgoals):
 1. y gen powi get_exp gen gen = y gen
 2. \<And>x. \<lbrakk>x \<in> carrier G; y gen powi get_exp gen x = y x\<rbrakk> \<Longrightarrow> y gen powi get_exp gen (x \<otimes> gen) = y (x \<otimes> gen)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
y gen powi get_exp gen gen = y gen powi (get_exp gen gen mod int n)

goal (2 subgoals):
 1. y gen powi get_exp gen gen = y gen
 2. \<And>x. \<lbrakk>x \<in> carrier G; y gen powi get_exp gen x = y x\<rbrakk> \<Longrightarrow> y gen powi get_exp gen (x \<otimes> gen) = y (x \<otimes> gen)
[PROOF STEP]
have "\<dots> = y gen powi ((1::int) mod n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y gen powi (get_exp gen gen mod int n) = y gen powi (1 mod int n)
[PROOF STEP]
using get_exp_self[OF gen_closed] nog
[PROOF STATE]
proof (prove)
using this:
get_exp gen gen mod int (ord gen) = 1 mod int (ord gen)
n = ord gen

goal (1 subgoal):
 1. y gen powi (get_exp gen gen mod int n) = y gen powi (1 mod int n)
[PROOF STEP]
by argo
[PROOF STATE]
proof (state)
this:
y gen powi (get_exp gen gen mod int n) = y gen powi (1 mod int n)

goal (2 subgoals):
 1. y gen powi get_exp gen gen = y gen
 2. \<And>x. \<lbrakk>x \<in> carrier G; y gen powi get_exp gen x = y x\<rbrakk> \<Longrightarrow> y gen powi get_exp gen (x \<otimes> gen) = y (x \<otimes> gen)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
y gen powi (get_exp gen gen mod int n) = y gen powi (1 mod int n)

goal (2 subgoals):
 1. y gen powi get_exp gen gen = y gen
 2. \<And>x. \<lbrakk>x \<in> carrier G; y gen powi get_exp gen x = y x\<rbrakk> \<Longrightarrow> y gen powi get_exp gen (x \<otimes> gen) = y (x \<otimes> gen)
[PROOF STEP]
have "\<dots> = y gen powi 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y gen powi (1 mod int n) = y gen powi 1
[PROOF STEP]
using False n
[PROOF STATE]
proof (prove)
using this:
n \<noteq> 1
0 < n

goal (1 subgoal):
 1. y gen powi (1 mod int n) = y gen powi 1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
y gen powi (1 mod int n) = y gen powi 1

goal (2 subgoals):
 1. y gen powi get_exp gen gen = y gen
 2. \<And>x. \<lbrakk>x \<in> carrier G; y gen powi get_exp gen x = y x\<rbrakk> \<Longrightarrow> y gen powi get_exp gen (x \<otimes> gen) = y (x \<otimes> gen)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
y gen powi get_exp gen gen = y gen powi 1
[PROOF STEP]
have yg: "y gen powi get_exp gen gen = y gen"
[PROOF STATE]
proof (prove)
using this:
y gen powi get_exp gen gen = y gen powi 1

goal (1 subgoal):
 1. y gen powi get_exp gen gen = y gen
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
y gen powi get_exp gen gen = y gen

goal (2 subgoals):
 1. y gen powi get_exp gen gen = y gen
 2. \<And>x. \<lbrakk>x \<in> carrier G; y gen powi get_exp gen x = y x\<rbrakk> \<Longrightarrow> y gen powi get_exp gen (x \<otimes> gen) = y (x \<otimes> gen)
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
y gen powi get_exp gen gen = y gen

goal (1 subgoal):
 1. y gen powi get_exp gen gen = y gen
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
y gen powi get_exp gen gen = y gen

goal (1 subgoal):
 1. \<And>x. \<lbrakk>x \<in> carrier G; y gen powi get_exp gen x = y x\<rbrakk> \<Longrightarrow> y gen powi get_exp gen (x \<otimes> gen) = y (x \<otimes> gen)
[PROOF STEP]
case (step x)
[PROOF STATE]
proof (state)
this:
x \<in> carrier G
y gen powi get_exp gen x = y x

goal (1 subgoal):
 1. \<And>x. \<lbrakk>x \<in> carrier G; y gen powi get_exp gen x = y x\<rbrakk> \<Longrightarrow> y gen powi get_exp gen (x \<otimes> gen) = y (x \<otimes> gen)
[PROOF STEP]
have "y gen powi get_exp gen (x \<otimes> gen) = y gen powi (get_exp gen (x \<otimes> gen) mod n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y gen powi get_exp gen (x \<otimes> gen) = y gen powi (get_exp gen (x \<otimes> gen) mod int n)
[PROOF STEP]
using m[OF ygo]
[PROOF STATE]
proof (prove)
using this:
y gen powi ?m2 = y gen powi (?m2 mod int n)

goal (1 subgoal):
 1. y gen powi get_exp gen (x \<otimes> gen) = y gen powi (get_exp gen (x \<otimes> gen) mod int n)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
y gen powi get_exp gen (x \<otimes> gen) = y gen powi (get_exp gen (x \<otimes> gen) mod int n)

goal (1 subgoal):
 1. \<And>x. \<lbrakk>x \<in> carrier G; y gen powi get_exp gen x = y x\<rbrakk> \<Longrightarrow> y gen powi get_exp gen (x \<otimes> gen) = y (x \<otimes> gen)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
y gen powi get_exp gen (x \<otimes> gen) = y gen powi (get_exp gen (x \<otimes> gen) mod int n)

goal (1 subgoal):
 1. \<And>x. \<lbrakk>x \<in> carrier G; y gen powi get_exp gen x = y x\<rbrakk> \<Longrightarrow> y gen powi get_exp gen (x \<otimes> gen) = y (x \<otimes> gen)
[PROOF STEP]
have "\<dots> = y gen powi ((get_exp gen x + get_exp gen gen) mod n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y gen powi (get_exp gen (x \<otimes> gen) mod int n) = y gen powi ((get_exp gen x + get_exp gen gen) mod int n)
[PROOF STEP]
using get_exp_mult_mod[OF step(1) gen_closed, unfolded nog[symmetric]]
[PROOF STATE]
proof (prove)
using this:
get_exp gen (x \<otimes> gen) mod int n = (get_exp gen x + get_exp gen gen) mod int n

goal (1 subgoal):
 1. y gen powi (get_exp gen (x \<otimes> gen) mod int n) = y gen powi ((get_exp gen x + get_exp gen gen) mod int n)
[PROOF STEP]
by argo
[PROOF STATE]
proof (state)
this:
y gen powi (get_exp gen (x \<otimes> gen) mod int n) = y gen powi ((get_exp gen x + get_exp gen gen) mod int n)

goal (1 subgoal):
 1. \<And>x. \<lbrakk>x \<in> carrier G; y gen powi get_exp gen x = y x\<rbrakk> \<Longrightarrow> y gen powi get_exp gen (x \<otimes> gen) = y (x \<otimes> gen)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
y gen powi (get_exp gen (x \<otimes> gen) mod int n) = y gen powi ((get_exp gen x + get_exp gen gen) mod int n)

goal (1 subgoal):
 1. \<And>x. \<lbrakk>x \<in> carrier G; y gen powi get_exp gen x = y x\<rbrakk> \<Longrightarrow> y gen powi get_exp gen (x \<otimes> gen) = y (x \<otimes> gen)
[PROOF STEP]
have "\<dots> = y gen powi (get_exp gen x + get_exp gen gen)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y gen powi ((get_exp gen x + get_exp gen gen) mod int n) = y gen powi (get_exp gen x + get_exp gen gen)
[PROOF STEP]
using m[OF ygo]
[PROOF STATE]
proof (prove)
using this:
y gen powi ?m2 = y gen powi (?m2 mod int n)

goal (1 subgoal):
 1. y gen powi ((get_exp gen x + get_exp gen gen) mod int n) = y gen powi (get_exp gen x + get_exp gen gen)
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
y gen powi ((get_exp gen x + get_exp gen gen) mod int n) = y gen powi (get_exp gen x + get_exp gen gen)

goal (1 subgoal):
 1. \<And>x. \<lbrakk>x \<in> carrier G; y gen powi get_exp gen x = y x\<rbrakk> \<Longrightarrow> y gen powi get_exp gen (x \<otimes> gen) = y (x \<otimes> gen)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
y gen powi ((get_exp gen x + get_exp gen gen) mod int n) = y gen powi (get_exp gen x + get_exp gen gen)

goal (1 subgoal):
 1. \<And>x. \<lbrakk>x \<in> carrier G; y gen powi get_exp gen x = y x\<rbrakk> \<Longrightarrow> y gen powi get_exp gen (x \<otimes> gen) = y (x \<otimes> gen)
[PROOF STEP]
have "\<dots> = y gen powi get_exp gen x * y gen powi get_exp gen gen"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y gen powi (get_exp gen x + get_exp gen gen) = y gen powi get_exp gen x * y gen powi get_exp gen gen
[PROOF STEP]
by (simp add: char_eq_0_iff power_int_add)
[PROOF STATE]
proof (state)
this:
y gen powi (get_exp gen x + get_exp gen gen) = y gen powi get_exp gen x * y gen powi get_exp gen gen

goal (1 subgoal):
 1. \<And>x. \<lbrakk>x \<in> carrier G; y gen powi get_exp gen x = y x\<rbrakk> \<Longrightarrow> y gen powi get_exp gen (x \<otimes> gen) = y (x \<otimes> gen)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
y gen powi (get_exp gen x + get_exp gen gen) = y gen powi get_exp gen x * y gen powi get_exp gen gen

goal (1 subgoal):
 1. \<And>x. \<lbrakk>x \<in> carrier G; y gen powi get_exp gen x = y x\<rbrakk> \<Longrightarrow> y gen powi get_exp gen (x \<otimes> gen) = y (x \<otimes> gen)
[PROOF STEP]
have "\<dots> = y x * y gen"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y gen powi get_exp gen x * y gen powi get_exp gen gen = y x * y gen
[PROOF STEP]
using yg step(2)
[PROOF STATE]
proof (prove)
using this:
y gen powi get_exp gen gen = y gen
y gen powi get_exp gen x = y x

goal (1 subgoal):
 1. y gen powi get_exp gen x * y gen powi get_exp gen gen = y x * y gen
[PROOF STEP]
by argo
[PROOF STATE]
proof (state)
this:
y gen powi get_exp gen x * y gen powi get_exp gen gen = y x * y gen

goal (1 subgoal):
 1. \<And>x. \<lbrakk>x \<in> carrier G; y gen powi get_exp gen x = y x\<rbrakk> \<Longrightarrow> y gen powi get_exp gen (x \<otimes> gen) = y (x \<otimes> gen)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
y gen powi get_exp gen x * y gen powi get_exp gen gen = y x * y gen

goal (1 subgoal):
 1. \<And>x. \<lbrakk>x \<in> carrier G; y gen powi get_exp gen x = y x\<rbrakk> \<Longrightarrow> y gen powi get_exp gen (x \<otimes> gen) = y (x \<otimes> gen)
[PROOF STEP]
have "\<dots> = y (x \<otimes> gen)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y x * y gen = y (x \<otimes> gen)
[PROOF STEP]
using step(1)
[PROOF STATE]
proof (prove)
using this:
x \<in> carrier G

goal (1 subgoal):
 1. y x * y gen = y (x \<otimes> gen)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
y x * y gen = y (x \<otimes> gen)

goal (1 subgoal):
 1. \<And>x. \<lbrakk>x \<in> carrier G; y gen powi get_exp gen x = y x\<rbrakk> \<Longrightarrow> y gen powi get_exp gen (x \<otimes> gen) = y (x \<otimes> gen)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
y gen powi get_exp gen (x \<otimes> gen) = y (x \<otimes> gen)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
y gen powi get_exp gen (x \<otimes> gen) = y (x \<otimes> gen)

goal (1 subgoal):
 1. y gen powi get_exp gen (x \<otimes> gen) = y (x \<otimes> gen)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
y gen powi get_exp gen (x \<otimes> gen) = y (x \<otimes> gen)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
?a2 \<in> carrier G \<Longrightarrow> y gen powi get_exp gen ?a2 = y ?a2

goal (1 subgoal):
 1. n \<noteq> 1 \<Longrightarrow> induce_char (get_c y) = y
[PROOF STEP]
thus "induce_char (get_c y) = y"
[PROOF STATE]
proof (prove)
using this:
?a2 \<in> carrier G \<Longrightarrow> y gen powi get_exp gen ?a2 = y ?a2

goal (1 subgoal):
 1. induce_char (get_c y) = y
[PROOF STEP]
unfolding ic gc
[PROOF STATE]
proof (prove)
using this:
?a2 \<in> carrier G \<Longrightarrow> y gen powi get_exp gen ?a2 = y ?a2

goal (1 subgoal):
 1. (\<lambda>a. if a \<in> carrier G then y gen powi get_exp gen a else 0) = y
[PROOF STEP]
using char_eq_0
[PROOF STATE]
proof (prove)
using this:
?a2 \<in> carrier G \<Longrightarrow> y gen powi get_exp gen ?a2 = y ?a2
?a \<notin> carrier G \<Longrightarrow> y ?a = 0

goal (1 subgoal):
 1. (\<lambda>a. if a \<in> carrier G then y gen powi get_exp gen a else 0) = y
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
induce_char (get_c y) = y

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
?y2 \<in> characters G \<Longrightarrow> induce_char (get_c ?y2) = ?y2

goal (1 subgoal):
 1. bij_betw get_c (characters G) {z. z ^ n = 1}
[PROOF STEP]
show "bij_betw get_c (characters G) {z. z ^ n = 1}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bij_betw get_c (characters G) {z. z ^ n = 1}
[PROOF STEP]
using ig gi iin gin
[PROOF STATE]
proof (prove)
using this:
?y2 \<in> characters G \<Longrightarrow> induce_char (get_c ?y2) = ?y2
?x2 \<in> {z. z ^ n = 1} \<Longrightarrow> get_c (induce_char ?x2) = ?x2
induce_char \<in> {z. z ^ n = 1} \<rightarrow> characters G
get_c \<in> characters G \<rightarrow> {z. z ^ n = 1}

goal (1 subgoal):
 1. bij_betw get_c (characters G) {z. z ^ n = 1}
[PROOF STEP]
by (auto intro: bij_betwI)
[PROOF STATE]
proof (state)
this:
bij_betw get_c (characters G) {z. z ^ n = 1}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
bij_betw induce_char {z. z ^ n = 1} (characters G)
bij_betw get_c (characters G) {z. z ^ n = 1}

goal (2 subgoals):
 1. order (Characters G) = order G
 2. \<lbrakk>character G a; character G b; a gen = b gen\<rbrakk> \<Longrightarrow> a = b
[PROOF STEP]
with card_roots_unity_eq[OF n] n_def
[PROOF STATE]
proof (chain)
picking this:
card {z. z ^ n = 1} = n
n = order G
bij_betw induce_char {z. z ^ n = 1} (characters G)
bij_betw get_c (characters G) {z. z ^ n = 1}
[PROOF STEP]
show "order (Characters G) = order G"
[PROOF STATE]
proof (prove)
using this:
card {z. z ^ n = 1} = n
n = order G
bij_betw induce_char {z. z ^ n = 1} (characters G)
bij_betw get_c (characters G) {z. z ^ n = 1}

goal (1 subgoal):
 1. order (Characters G) = order G
[PROOF STEP]
unfolding order_def
[PROOF STATE]
proof (prove)
using this:
card {z. z ^ n = 1} = n
n = card (carrier G)
bij_betw induce_char {z. z ^ n = 1} (characters G)
bij_betw get_c (characters G) {z. z ^ n = 1}

goal (1 subgoal):
 1. card (carrier (Characters G)) = card (carrier G)
[PROOF STEP]
by (metis bij_betw_same_card carrier_Characters)
[PROOF STATE]
proof (state)
this:
order (Characters G) = order G

goal (1 subgoal):
 1. \<lbrakk>character G a; character G b; a gen = b gen\<rbrakk> \<Longrightarrow> a = b
[PROOF STEP]
assume assm: "character G a" "character G b" "a gen = b gen"
[PROOF STATE]
proof (state)
this:
character G a
character G b
a gen = b gen

goal (1 subgoal):
 1. \<lbrakk>character G a; character G b; a gen = b gen\<rbrakk> \<Longrightarrow> a = b
[PROOF STEP]
with bijg[unfolded gc characters_def bij_betw_def inj_on_def]
[PROOF STATE]
proof (chain)
picking this:
(\<forall>x\<in>Collect (character G). \<forall>y\<in>Collect (character G). x gen = y gen \<longrightarrow> x = y) \<and> (\<lambda>c. c gen) ` Collect (character G) = {z. z ^ n = 1}
character G a
character G b
a gen = b gen
[PROOF STEP]
show "a = b"
[PROOF STATE]
proof (prove)
using this:
(\<forall>x\<in>Collect (character G). \<forall>y\<in>Collect (character G). x gen = y gen \<longrightarrow> x = y) \<and> (\<lambda>c. c gen) ` Collect (character G) = {z. z ^ n = 1}
character G a
character G b
a gen = b gen

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma integral_normal_density[simp]: "(\<integral>x. normal_density \<mu> \<sigma> x \<partial>lborel) = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral\<^sup>L lborel (normal_density \<mu> \<sigma>) = 1
[PROOF STEP]
using integral_normal_moment_even[of \<sigma> \<mu> 0]
[PROOF STATE]
proof (prove)
using this:
0 < \<sigma> \<Longrightarrow> LBINT x. normal_density \<mu> \<sigma> x * (x - \<mu>) ^ (2 * 0) = fact (2 * 0) / ((2 / \<sigma>\<^sup>2) ^ 0 * fact 0)

goal (1 subgoal):
 1. integral\<^sup>L lborel (normal_density \<mu> \<sigma>) = 1
[PROOF STEP]
by simp


[STATEMENT]
lemma fps_conv_radius_binomial:
  fixes c :: "'a :: {real_normed_field,banach}"
  shows "fps_conv_radius (fps_binomial c) = (if c \<in> \<nat> then \<infinity> else 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fps_conv_radius (fps_binomial c) = (if c \<in> \<nat> then \<infinity> else 1)
[PROOF STEP]
unfolding fps_conv_radius_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. conv_radius (fps_nth (fps_binomial c)) = (if c \<in> \<nat> then \<infinity> else 1)
[PROOF STEP]
by (simp add: conv_radius_gchoose)


[STATEMENT]
lemma pgte_pgt:
  assumes "pgt a b"
      and "pgte c d"
    shows "pgt (padd a c) (padd b d)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pgt (padd a c) (padd b d)
[PROOF STEP]
using assms(1) assms(2) padd.rep_eq pgt.rep_eq pgte.rep_eq
[PROOF STATE]
proof (prove)
using this:
pgt a b
pgte c d
Rep_prat (padd ?x ?xa) = Rep_prat ?x + Rep_prat ?xa
pgt ?x ?xa = (Rep_prat ?xa < Rep_prat ?x)
pgte ?x ?xa = (Rep_prat ?xa \<le> Rep_prat ?x)

goal (1 subgoal):
 1. pgt (padd a c) (padd b d)
[PROOF STEP]
by auto


[STATEMENT]
lemma bigomegaI_tendsto:
  assumes c_not_0:  "(c::real) \<noteq> 0"
  assumes lim:      "((\<lambda>x. f x / g x) \<longlongrightarrow> c) F"
  shows   "f \<in> \<Omega>[F](g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<in> \<Omega>[F](g)
[PROOF STEP]
by (rule bigomegaI_tendsto_norm[OF _ tendsto_norm, of c]) (insert assms, simp_all)


[STATEMENT]
lemma sum_inverse_squares_expansion:
  assumes n: "n > 0" and N: "N > 0"
  shows "(\<Sum>k=1..n. 1 / real k ^ 2) =
            pi ^ 2 / 6 - 1 / real n + 1 / (2 * real n ^ 2) -
                     (\<Sum>i=1..N. bernoulli (2*i) / n ^ (2*i+1)) -
                    EM_remainder (2*N+1) (\<lambda>x. -fact (2*N+2) / x ^ (2*N+3)) (int n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>k = 1..n. 1 / (real k)\<^sup>2) = pi\<^sup>2 / 6 - 1 / real n + 1 / (2 * (real n)\<^sup>2) - (\<Sum>i = 1..N. bernoulli (2 * i) / real (n ^ (2 * i + 1))) - EM_remainder (2 * N + 1) (\<lambda>x. - fact (2 * N + 2) / x ^ (2 * N + 3)) (int n)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<Sum>k = 1..n. 1 / (real k)\<^sup>2) = pi\<^sup>2 / 6 - 1 / real n + 1 / (2 * (real n)\<^sup>2) - (\<Sum>i = 1..N. bernoulli (2 * i) / real (n ^ (2 * i + 1))) - EM_remainder (2 * N + 1) (\<lambda>x. - fact (2 * N + 2) / x ^ (2 * N + 3)) (int n)
[PROOF STEP]
have 3: "3 = Suc (Suc (Suc 0))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 3 = Suc (Suc (Suc 0))
[PROOF STEP]
by (simp add: eval_nat_numeral)
[PROOF STATE]
proof (state)
this:
3 = Suc (Suc (Suc 0))

goal (1 subgoal):
 1. (\<Sum>k = 1..n. 1 / (real k)\<^sup>2) = pi\<^sup>2 / 6 - 1 / real n + 1 / (2 * (real n)\<^sup>2) - (\<Sum>i = 1..N. bernoulli (2 * i) / real (n ^ (2 * i + 1))) - EM_remainder (2 * N + 1) (\<lambda>x. - fact (2 * N + 2) / x ^ (2 * N + 3)) (int n)
[PROOF STEP]
define fs where "fs = (\<lambda>k x. (-1) ^ k * fact (Suc k) / x ^ (k+2) :: real)"
[PROOF STATE]
proof (state)
this:
fs = (\<lambda>k x. (- 1) ^ k * fact (Suc k) / x ^ (k + 2))

goal (1 subgoal):
 1. (\<Sum>k = 1..n. 1 / (real k)\<^sup>2) = pi\<^sup>2 / 6 - 1 / real n + 1 / (2 * (real n)\<^sup>2) - (\<Sum>i = 1..N. bernoulli (2 * i) / real (n ^ (2 * i + 1))) - EM_remainder (2 * N + 1) (\<lambda>x. - fact (2 * N + 2) / x ^ (2 * N + 3)) (int n)
[PROOF STEP]
interpret euler_maclaurin_nat' "\<lambda>x. -1/x" "\<lambda>x. 1/x^2" fs 1 N "pi^2/6" "{}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. euler_maclaurin_nat' ((/) (- 1)) (\<lambda>x. 1 / x\<^sup>2) fs 1 N (pi\<^sup>2 / 6) {}
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (7 subgoals):
 1. finite {}
 2. fs 0 = (\<lambda>x. 1 / x\<^sup>2)
 3. \<And>k. k \<le> 2 * N + 1 \<Longrightarrow> continuous_on {real 1..} (fs k)
 4. \<And>k x. \<lbrakk>k \<le> 2 * N; x \<in> {real 1..} - {}\<rbrakk> \<Longrightarrow> (fs k has_vector_derivative fs (Suc k) x) (at x)
 5. continuous_on {real 1..} ((/) (- 1))
 6. \<And>x. x \<in> {real 1..} - {} \<Longrightarrow> ((/) (- 1) has_vector_derivative 1 / x\<^sup>2) (at x)
 7. (\<lambda>b. (\<Sum>k = 1..b. 1 / (real k)\<^sup>2) - - 1 / real b - (\<Sum>i<2 * N + 1. (bernoulli' (Suc i) / fact (Suc i)) *\<^sub>R fs i (real b))) \<longlonglongrightarrow> pi\<^sup>2 / 6
[PROOF STEP]
fix k x
[PROOF STATE]
proof (state)
goal (7 subgoals):
 1. finite {}
 2. fs 0 = (\<lambda>x. 1 / x\<^sup>2)
 3. \<And>k. k \<le> 2 * N + 1 \<Longrightarrow> continuous_on {real 1..} (fs k)
 4. \<And>k x. \<lbrakk>k \<le> 2 * N; x \<in> {real 1..} - {}\<rbrakk> \<Longrightarrow> (fs k has_vector_derivative fs (Suc k) x) (at x)
 5. continuous_on {real 1..} ((/) (- 1))
 6. \<And>x. x \<in> {real 1..} - {} \<Longrightarrow> ((/) (- 1) has_vector_derivative 1 / x\<^sup>2) (at x)
 7. (\<lambda>b. (\<Sum>k = 1..b. 1 / (real k)\<^sup>2) - - 1 / real b - (\<Sum>i<2 * N + 1. (bernoulli' (Suc i) / fact (Suc i)) *\<^sub>R fs i (real b))) \<longlonglongrightarrow> pi\<^sup>2 / 6
[PROOF STEP]
assume "k \<le> 2*N" "x \<in> {real 1..} - {}"
[PROOF STATE]
proof (state)
this:
k \<le> 2 * N
x \<in> {real 1..} - {}

goal (7 subgoals):
 1. finite {}
 2. fs 0 = (\<lambda>x. 1 / x\<^sup>2)
 3. \<And>k. k \<le> 2 * N + 1 \<Longrightarrow> continuous_on {real 1..} (fs k)
 4. \<And>k x. \<lbrakk>k \<le> 2 * N; x \<in> {real 1..} - {}\<rbrakk> \<Longrightarrow> (fs k has_vector_derivative fs (Suc k) x) (at x)
 5. continuous_on {real 1..} ((/) (- 1))
 6. \<And>x. x \<in> {real 1..} - {} \<Longrightarrow> ((/) (- 1) has_vector_derivative 1 / x\<^sup>2) (at x)
 7. (\<lambda>b. (\<Sum>k = 1..b. 1 / (real k)\<^sup>2) - - 1 / real b - (\<Sum>i<2 * N + 1. (bernoulli' (Suc i) / fact (Suc i)) *\<^sub>R fs i (real b))) \<longlonglongrightarrow> pi\<^sup>2 / 6
[PROOF STEP]
thus "(fs k has_vector_derivative fs (Suc k) x) (at x)"
[PROOF STATE]
proof (prove)
using this:
k \<le> 2 * N
x \<in> {real 1..} - {}

goal (1 subgoal):
 1. (fs k has_vector_derivative fs (Suc k) x) (at x)
[PROOF STEP]
by (cases "k = 0")
         (auto intro!: derivative_eq_intros
               simp: fs_def has_real_derivative_iff_has_vector_derivative [symmetric]
                     field_simps power_diff)
[PROOF STATE]
proof (state)
this:
(fs k has_vector_derivative fs (Suc k) x) (at x)

goal (6 subgoals):
 1. finite {}
 2. fs 0 = (\<lambda>x. 1 / x\<^sup>2)
 3. \<And>k. k \<le> 2 * N + 1 \<Longrightarrow> continuous_on {real 1..} (fs k)
 4. continuous_on {real 1..} ((/) (- 1))
 5. \<And>x. x \<in> {real 1..} - {} \<Longrightarrow> ((/) (- 1) has_vector_derivative 1 / x\<^sup>2) (at x)
 6. (\<lambda>b. (\<Sum>k = 1..b. 1 / (real k)\<^sup>2) - - 1 / real b - (\<Sum>i<2 * N + 1. (bernoulli' (Suc i) / fact (Suc i)) *\<^sub>R fs i (real b))) \<longlonglongrightarrow> pi\<^sup>2 / 6
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (6 subgoals):
 1. finite {}
 2. fs 0 = (\<lambda>x. 1 / x\<^sup>2)
 3. \<And>k. k \<le> 2 * N + 1 \<Longrightarrow> continuous_on {real 1..} (fs k)
 4. continuous_on {real 1..} ((/) (- 1))
 5. \<And>x. x \<in> {real 1..} - {} \<Longrightarrow> ((/) (- 1) has_vector_derivative 1 / x\<^sup>2) (at x)
 6. (\<lambda>b. (\<Sum>k = 1..b. 1 / (real k)\<^sup>2) - - 1 / real b - (\<Sum>i<2 * N + 1. (bernoulli' (Suc i) / fact (Suc i)) *\<^sub>R fs i (real b))) \<longlonglongrightarrow> pi\<^sup>2 / 6
[PROOF STEP]
from inverse_squares_sums
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>n. 1 / real ((n + 1)\<^sup>2)) sums (pi\<^sup>2 / 6)
[PROOF STEP]
have "(\<lambda>n. \<Sum>k<n. 1 / real (Suc k) ^ 2) \<longlonglongrightarrow> pi\<^sup>2 / 6"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. 1 / real ((n + 1)\<^sup>2)) sums (pi\<^sup>2 / 6)

goal (1 subgoal):
 1. (\<lambda>n. \<Sum>k<n. 1 / (real (Suc k))\<^sup>2) \<longlonglongrightarrow> pi\<^sup>2 / 6
[PROOF STEP]
by (simp add: sums_def)
[PROOF STATE]
proof (state)
this:
(\<lambda>n. \<Sum>k<n. 1 / (real (Suc k))\<^sup>2) \<longlonglongrightarrow> pi\<^sup>2 / 6

goal (6 subgoals):
 1. finite {}
 2. fs 0 = (\<lambda>x. 1 / x\<^sup>2)
 3. \<And>k. k \<le> 2 * N + 1 \<Longrightarrow> continuous_on {real 1..} (fs k)
 4. continuous_on {real 1..} ((/) (- 1))
 5. \<And>x. x \<in> {real 1..} - {} \<Longrightarrow> ((/) (- 1) has_vector_derivative 1 / x\<^sup>2) (at x)
 6. (\<lambda>b. (\<Sum>k = 1..b. 1 / (real k)\<^sup>2) - - 1 / real b - (\<Sum>i<2 * N + 1. (bernoulli' (Suc i) / fact (Suc i)) *\<^sub>R fs i (real b))) \<longlonglongrightarrow> pi\<^sup>2 / 6
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<lambda>n. \<Sum>k<n. 1 / (real (Suc k))\<^sup>2) \<longlonglongrightarrow> pi\<^sup>2 / 6

goal (6 subgoals):
 1. finite {}
 2. fs 0 = (\<lambda>x. 1 / x\<^sup>2)
 3. \<And>k. k \<le> 2 * N + 1 \<Longrightarrow> continuous_on {real 1..} (fs k)
 4. continuous_on {real 1..} ((/) (- 1))
 5. \<And>x. x \<in> {real 1..} - {} \<Longrightarrow> ((/) (- 1) has_vector_derivative 1 / x\<^sup>2) (at x)
 6. (\<lambda>b. (\<Sum>k = 1..b. 1 / (real k)\<^sup>2) - - 1 / real b - (\<Sum>i<2 * N + 1. (bernoulli' (Suc i) / fact (Suc i)) *\<^sub>R fs i (real b))) \<longlonglongrightarrow> pi\<^sup>2 / 6
[PROOF STEP]
have "(\<lambda>n. \<Sum>k<n. 1 / real (Suc k) ^ 2) = (\<lambda>n. \<Sum>k=1..n. 1 / real k ^ 2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. \<Sum>k<n. 1 / (real (Suc k))\<^sup>2) = (\<lambda>n. \<Sum>k = 1..n. 1 / (real k)\<^sup>2)
[PROOF STEP]
by (intro ext sum.reindex_bij_witness[of _ "\<lambda>n. n - 1" Suc]) auto
[PROOF STATE]
proof (state)
this:
(\<lambda>n. \<Sum>k<n. 1 / (real (Suc k))\<^sup>2) = (\<lambda>n. \<Sum>k = 1..n. 1 / (real k)\<^sup>2)

goal (6 subgoals):
 1. finite {}
 2. fs 0 = (\<lambda>x. 1 / x\<^sup>2)
 3. \<And>k. k \<le> 2 * N + 1 \<Longrightarrow> continuous_on {real 1..} (fs k)
 4. continuous_on {real 1..} ((/) (- 1))
 5. \<And>x. x \<in> {real 1..} - {} \<Longrightarrow> ((/) (- 1) has_vector_derivative 1 / x\<^sup>2) (at x)
 6. (\<lambda>b. (\<Sum>k = 1..b. 1 / (real k)\<^sup>2) - - 1 / real b - (\<Sum>i<2 * N + 1. (bernoulli' (Suc i) / fact (Suc i)) *\<^sub>R fs i (real b))) \<longlonglongrightarrow> pi\<^sup>2 / 6
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>n. \<Sum>k = 1..n. 1 / (real k)\<^sup>2) \<longlonglongrightarrow> pi\<^sup>2 / 6
[PROOF STEP]
have "(\<lambda>b. (\<Sum>k = 1..b. 1 / real k^2) + 1 / real b -
                 (\<Sum>i<2*N+1. bernoulli' (Suc i) * (- 1) ^ i / (real b ^ (i+2))))
            \<longlonglongrightarrow> (pi^2/6 + 0 - (\<Sum>i<2*N+1. 0))"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. \<Sum>k = 1..n. 1 / (real k)\<^sup>2) \<longlonglongrightarrow> pi\<^sup>2 / 6

goal (1 subgoal):
 1. (\<lambda>b. (\<Sum>k = 1..b. 1 / (real k)\<^sup>2) + 1 / real b - (\<Sum>i<2 * N + 1. bernoulli' (Suc i) * (- 1) ^ i / real b ^ (i + 2))) \<longlonglongrightarrow> pi\<^sup>2 / 6 + 0 - (\<Sum>i<2 * N + 1. 0)
[PROOF STEP]
by (intro tendsto_diff tendsto_add real_tendsto_divide_at_top[OF tendsto_const]
            filterlim_tendsto_pos_mult_at_top[OF tendsto_const] filterlim_pow_at_top
            filterlim_real_sequentially tendsto_sum) auto
[PROOF STATE]
proof (state)
this:
(\<lambda>b. (\<Sum>k = 1..b. 1 / (real k)\<^sup>2) + 1 / real b - (\<Sum>i<2 * N + 1. bernoulli' (Suc i) * (- 1) ^ i / real b ^ (i + 2))) \<longlonglongrightarrow> pi\<^sup>2 / 6 + 0 - (\<Sum>i<2 * N + 1. 0)

goal (6 subgoals):
 1. finite {}
 2. fs 0 = (\<lambda>x. 1 / x\<^sup>2)
 3. \<And>k. k \<le> 2 * N + 1 \<Longrightarrow> continuous_on {real 1..} (fs k)
 4. continuous_on {real 1..} ((/) (- 1))
 5. \<And>x. x \<in> {real 1..} - {} \<Longrightarrow> ((/) (- 1) has_vector_derivative 1 / x\<^sup>2) (at x)
 6. (\<lambda>b. (\<Sum>k = 1..b. 1 / (real k)\<^sup>2) - - 1 / real b - (\<Sum>i<2 * N + 1. (bernoulli' (Suc i) / fact (Suc i)) *\<^sub>R fs i (real b))) \<longlonglongrightarrow> pi\<^sup>2 / 6
[PROOF STEP]
thus "(\<lambda>b. (\<Sum>k = 1..b. 1 / real k^2) - (- 1 / real b) -
            (\<Sum>i<2*N+1. (bernoulli' (Suc i) / fact (Suc i)) *\<^sub>R fs i (real b))) \<longlonglongrightarrow> pi^2/6"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>b. (\<Sum>k = 1..b. 1 / (real k)\<^sup>2) + 1 / real b - (\<Sum>i<2 * N + 1. bernoulli' (Suc i) * (- 1) ^ i / real b ^ (i + 2))) \<longlonglongrightarrow> pi\<^sup>2 / 6 + 0 - (\<Sum>i<2 * N + 1. 0)

goal (1 subgoal):
 1. (\<lambda>b. (\<Sum>k = 1..b. 1 / (real k)\<^sup>2) - - 1 / real b - (\<Sum>i<2 * N + 1. (bernoulli' (Suc i) / fact (Suc i)) *\<^sub>R fs i (real b))) \<longlonglongrightarrow> pi\<^sup>2 / 6
[PROOF STEP]
by (simp add: harm_def field_simps fs_def del: power_Suc of_nat_Suc)
[PROOF STATE]
proof (state)
this:
(\<lambda>b. (\<Sum>k = 1..b. 1 / (real k)\<^sup>2) - - 1 / real b - (\<Sum>i<2 * N + 1. (bernoulli' (Suc i) / fact (Suc i)) *\<^sub>R fs i (real b))) \<longlonglongrightarrow> pi\<^sup>2 / 6

goal (5 subgoals):
 1. finite {}
 2. fs 0 = (\<lambda>x. 1 / x\<^sup>2)
 3. \<And>k. k \<le> 2 * N + 1 \<Longrightarrow> continuous_on {real 1..} (fs k)
 4. continuous_on {real 1..} ((/) (- 1))
 5. \<And>x. x \<in> {real 1..} - {} \<Longrightarrow> ((/) (- 1) has_vector_derivative 1 / x\<^sup>2) (at x)
[PROOF STEP]
qed (insert n N, auto intro!: continuous_intros derivative_eq_intros
         simp: fs_def has_real_derivative_iff_has_vector_derivative [symmetric] power2_eq_square)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<Sum>k = 1..n. 1 / (real k)\<^sup>2) = pi\<^sup>2 / 6 - 1 / real n + 1 / (2 * (real n)\<^sup>2) - (\<Sum>i = 1..N. bernoulli (2 * i) / real (n ^ (2 * i + 1))) - EM_remainder (2 * N + 1) (\<lambda>x. - fact (2 * N + 2) / x ^ (2 * N + 3)) (int n)
[PROOF STEP]
have "(\<Sum>k=1..n. 1 / real k ^ 2) = - 1 / real n + pi^2/6 + (1/2) *\<^sub>R (1 / real n^2) +
               (\<Sum>i=1..N. (bernoulli (2*i) / fact (2*i)) *\<^sub>R fs (2*i-1) (real n)) -
               EM_remainder (2*N+1) (fs (2*N+1)) (int n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>k = 1..n. 1 / (real k)\<^sup>2) = - 1 / real n + pi\<^sup>2 / 6 + (1 / 2) *\<^sub>R (1 / (real n)\<^sup>2) + (\<Sum>i = 1..N. (bernoulli (2 * i) / fact (2 * i)) *\<^sub>R fs (2 * i - 1) (real n)) - EM_remainder (2 * N + 1) (fs (2 * N + 1)) (int n)
[PROOF STEP]
using n N
[PROOF STATE]
proof (prove)
using this:
0 < n
0 < 2 * N + 1

goal (1 subgoal):
 1. (\<Sum>k = 1..n. 1 / (real k)\<^sup>2) = - 1 / real n + pi\<^sup>2 / 6 + (1 / 2) *\<^sub>R (1 / (real n)\<^sup>2) + (\<Sum>i = 1..N. (bernoulli (2 * i) / fact (2 * i)) *\<^sub>R fs (2 * i - 1) (real n)) - EM_remainder (2 * N + 1) (fs (2 * N + 1)) (int n)
[PROOF STEP]
using n
[PROOF STATE]
proof (prove)
using this:
0 < n
0 < 2 * N + 1
0 < n

goal (1 subgoal):
 1. (\<Sum>k = 1..n. 1 / (real k)\<^sup>2) = - 1 / real n + pi\<^sup>2 / 6 + (1 / 2) *\<^sub>R (1 / (real n)\<^sup>2) + (\<Sum>i = 1..N. (bernoulli (2 * i) / fact (2 * i)) *\<^sub>R fs (2 * i - 1) (real n)) - EM_remainder (2 * N + 1) (fs (2 * N + 1)) (int n)
[PROOF STEP]
by (intro euler_maclaurin_strong_nat') simp_all
[PROOF STATE]
proof (state)
this:
(\<Sum>k = 1..n. 1 / (real k)\<^sup>2) = - 1 / real n + pi\<^sup>2 / 6 + (1 / 2) *\<^sub>R (1 / (real n)\<^sup>2) + (\<Sum>i = 1..N. (bernoulli (2 * i) / fact (2 * i)) *\<^sub>R fs (2 * i - 1) (real n)) - EM_remainder (2 * N + 1) (fs (2 * N + 1)) (int n)

goal (1 subgoal):
 1. (\<Sum>k = 1..n. 1 / (real k)\<^sup>2) = pi\<^sup>2 / 6 - 1 / real n + 1 / (2 * (real n)\<^sup>2) - (\<Sum>i = 1..N. bernoulli (2 * i) / real (n ^ (2 * i + 1))) - EM_remainder (2 * N + 1) (\<lambda>x. - fact (2 * N + 2) / x ^ (2 * N + 3)) (int n)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>k = 1..n. 1 / (real k)\<^sup>2) = - 1 / real n + pi\<^sup>2 / 6 + (1 / 2) *\<^sub>R (1 / (real n)\<^sup>2) + (\<Sum>i = 1..N. (bernoulli (2 * i) / fact (2 * i)) *\<^sub>R fs (2 * i - 1) (real n)) - EM_remainder (2 * N + 1) (fs (2 * N + 1)) (int n)

goal (1 subgoal):
 1. (\<Sum>k = 1..n. 1 / (real k)\<^sup>2) = pi\<^sup>2 / 6 - 1 / real n + 1 / (2 * (real n)\<^sup>2) - (\<Sum>i = 1..N. bernoulli (2 * i) / real (n ^ (2 * i + 1))) - EM_remainder (2 * N + 1) (\<lambda>x. - fact (2 * N + 2) / x ^ (2 * N + 3)) (int n)
[PROOF STEP]
have "(\<Sum>i=1..N. (bernoulli (2*i) / fact (2*i)) *\<^sub>R (fs (2*i-1) (real n))) =
               (\<Sum>i=1..N. -(bernoulli (2*i) / (real n ^ (2*i+1))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i = 1..N. (bernoulli (2 * i) / fact (2 * i)) *\<^sub>R fs (2 * i - 1) (real n)) = (\<Sum>i = 1..N. - (bernoulli (2 * i) / real n ^ (2 * i + 1)))
[PROOF STEP]
by (intro sum.cong refl)
       (simp_all add: fs_def divide_simps fact_reduce del: of_nat_Suc power_Suc)
[PROOF STATE]
proof (state)
this:
(\<Sum>i = 1..N. (bernoulli (2 * i) / fact (2 * i)) *\<^sub>R fs (2 * i - 1) (real n)) = (\<Sum>i = 1..N. - (bernoulli (2 * i) / real n ^ (2 * i + 1)))

goal (1 subgoal):
 1. (\<Sum>k = 1..n. 1 / (real k)\<^sup>2) = pi\<^sup>2 / 6 - 1 / real n + 1 / (2 * (real n)\<^sup>2) - (\<Sum>i = 1..N. bernoulli (2 * i) / real (n ^ (2 * i + 1))) - EM_remainder (2 * N + 1) (\<lambda>x. - fact (2 * N + 2) / x ^ (2 * N + 3)) (int n)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>i = 1..N. (bernoulli (2 * i) / fact (2 * i)) *\<^sub>R fs (2 * i - 1) (real n)) = (\<Sum>i = 1..N. - (bernoulli (2 * i) / real n ^ (2 * i + 1)))

goal (1 subgoal):
 1. (\<Sum>k = 1..n. 1 / (real k)\<^sup>2) = pi\<^sup>2 / 6 - 1 / real n + 1 / (2 * (real n)\<^sup>2) - (\<Sum>i = 1..N. bernoulli (2 * i) / real (n ^ (2 * i + 1))) - EM_remainder (2 * N + 1) (\<lambda>x. - fact (2 * N + 2) / x ^ (2 * N + 3)) (int n)
[PROOF STEP]
have "\<dots> = -(\<Sum>i=1..N. bernoulli (2*i) / real n ^ (2*i+1))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i = 1..N. - (bernoulli (2 * i) / real n ^ (2 * i + 1))) = - (\<Sum>i = 1..N. bernoulli (2 * i) / real n ^ (2 * i + 1))
[PROOF STEP]
by (simp add: sum_negf)
[PROOF STATE]
proof (state)
this:
(\<Sum>i = 1..N. - (bernoulli (2 * i) / real n ^ (2 * i + 1))) = - (\<Sum>i = 1..N. bernoulli (2 * i) / real n ^ (2 * i + 1))

goal (1 subgoal):
 1. (\<Sum>k = 1..n. 1 / (real k)\<^sup>2) = pi\<^sup>2 / 6 - 1 / real n + 1 / (2 * (real n)\<^sup>2) - (\<Sum>i = 1..N. bernoulli (2 * i) / real (n ^ (2 * i + 1))) - EM_remainder (2 * N + 1) (\<lambda>x. - fact (2 * N + 2) / x ^ (2 * N + 3)) (int n)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<Sum>k = 1..n. 1 / (real k)\<^sup>2) = - 1 / real n + pi\<^sup>2 / 6 + (1 / 2) *\<^sub>R (1 / (real n)\<^sup>2) + - (\<Sum>i = 1..N. bernoulli (2 * i) / real n ^ (2 * i + 1)) - EM_remainder (2 * N + 1) (fs (2 * N + 1)) (int n)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<Sum>k = 1..n. 1 / (real k)\<^sup>2) = - 1 / real n + pi\<^sup>2 / 6 + (1 / 2) *\<^sub>R (1 / (real n)\<^sup>2) + - (\<Sum>i = 1..N. bernoulli (2 * i) / real n ^ (2 * i + 1)) - EM_remainder (2 * N + 1) (fs (2 * N + 1)) (int n)

goal (1 subgoal):
 1. (\<Sum>k = 1..n. 1 / (real k)\<^sup>2) = pi\<^sup>2 / 6 - 1 / real n + 1 / (2 * (real n)\<^sup>2) - (\<Sum>i = 1..N. bernoulli (2 * i) / real (n ^ (2 * i + 1))) - EM_remainder (2 * N + 1) (\<lambda>x. - fact (2 * N + 2) / x ^ (2 * N + 3)) (int n)
[PROOF STEP]
unfolding fs_def
[PROOF STATE]
proof (prove)
using this:
(\<Sum>k = 1..n. 1 / (real k)\<^sup>2) = - 1 / real n + pi\<^sup>2 / 6 + (1 / 2) *\<^sub>R (1 / (real n)\<^sup>2) + - (\<Sum>i = 1..N. bernoulli (2 * i) / real n ^ (2 * i + 1)) - EM_remainder (2 * N + 1) (\<lambda>a. (- 1) ^ (2 * N + 1) * fact (Suc (2 * N + 1)) / a ^ (2 * N + 1 + 2)) (int n)

goal (1 subgoal):
 1. (\<Sum>k = 1..n. 1 / (real k)\<^sup>2) = pi\<^sup>2 / 6 - 1 / real n + 1 / (2 * (real n)\<^sup>2) - (\<Sum>i = 1..N. bernoulli (2 * i) / real (n ^ (2 * i + 1))) - EM_remainder (2 * N + 1) (\<lambda>x. - fact (2 * N + 2) / x ^ (2 * N + 3)) (int n)
[PROOF STEP]
by (simp add: fs_def 3)
[PROOF STATE]
proof (state)
this:
(\<Sum>k = 1..n. 1 / (real k)\<^sup>2) = pi\<^sup>2 / 6 - 1 / real n + 1 / (2 * (real n)\<^sup>2) - (\<Sum>i = 1..N. bernoulli (2 * i) / real (n ^ (2 * i + 1))) - EM_remainder (2 * N + 1) (\<lambda>x. - fact (2 * N + 2) / x ^ (2 * N + 3)) (int n)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ord_embed_alt: "ord_embed f = (mono f \<and> (\<forall>x y. f x \<le> f y \<longrightarrow> x \<le> y))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ord_embed f = (mono f \<and> (\<forall>x y. f x \<le> f y \<longrightarrow> x \<le> y))
[PROOF STEP]
using mono_def ord_embed_def
[PROOF STATE]
proof (prove)
using this:
mono ?f = (\<forall>x y. x \<le> y \<longrightarrow> ?f x \<le> ?f y)
ord_embed ?f = (\<forall>x y. (?f x \<le> ?f y) = (x \<le> y))

goal (1 subgoal):
 1. ord_embed f = (mono f \<and> (\<forall>x y. f x \<le> f y \<longrightarrow> x \<le> y))
[PROOF STEP]
by auto


[STATEMENT]
lemma Lim_component_ge:
  fixes f :: "'a \<Rightarrow> 'b::euclidean_space"
  assumes "(f \<longlongrightarrow> l) net"
    and "\<not> (trivial_limit net)"
    and "eventually (\<lambda>x. b \<le> (f x)\<bullet>i) net"
  shows "b \<le> l\<bullet>i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. b \<le> l \<bullet> i
[PROOF STEP]
by (rule tendsto_le[OF assms(2) tendsto_inner[OF assms(1) tendsto_const] tendsto_const assms(3)])


[STATEMENT]
lemma bound_deg_sum:
  assumes " f \<in> carrier P"
  assumes "g \<in> carrier P"
  assumes "degree f  \<le> n"
  assumes "degree g \<le> n"
  shows "degree (f \<oplus>\<^bsub>P\<^esub> g) \<le> n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. deg R (f \<oplus>\<^bsub>P\<^esub> g) \<le> n
[PROOF STEP]
using P_def UP_ring_axioms assms(1) assms(2) assms(3) assms(4)
[PROOF STATE]
proof (prove)
using this:
P \<equiv> UP R
UP_ring R
f \<in> carrier P
g \<in> carrier P
deg R f \<le> n
deg R g \<le> n

goal (1 subgoal):
 1. deg R (f \<oplus>\<^bsub>P\<^esub> g) \<le> n
[PROOF STEP]
by (meson deg_add max.boundedI order_trans)


[STATEMENT]
lemma iT_Mult_iprev_nth: "\<lbrakk> finite I; I \<noteq> {} \<rbrakk> \<Longrightarrow> (I \<otimes> k) \<leftarrow> n = (I \<leftarrow> n) * k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite I; I \<noteq> {}\<rbrakk> \<Longrightarrow> (I \<otimes> k) \<leftarrow> n = (I \<leftarrow> n) * k
[PROOF STEP]
apply (induct n)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>finite I; I \<noteq> {}\<rbrakk> \<Longrightarrow> (I \<otimes> k) \<leftarrow> 0 = (I \<leftarrow> 0) * k
 2. \<And>n. \<lbrakk>\<lbrakk>finite I; I \<noteq> {}\<rbrakk> \<Longrightarrow> (I \<otimes> k) \<leftarrow> n = (I \<leftarrow> n) * k; finite I; I \<noteq> {}\<rbrakk> \<Longrightarrow> (I \<otimes> k) \<leftarrow> Suc n = (I \<leftarrow> Suc n) * k
[PROOF STEP]
apply (simp add: iT_Mult_Max)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. \<lbrakk>\<lbrakk>finite I; I \<noteq> {}\<rbrakk> \<Longrightarrow> (I \<otimes> k) \<leftarrow> n = (I \<leftarrow> n) * k; finite I; I \<noteq> {}\<rbrakk> \<Longrightarrow> (I \<otimes> k) \<leftarrow> Suc n = (I \<leftarrow> Suc n) * k
[PROOF STEP]
apply (simp add: iT_Mult_iprev)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma nonempty:
  "{\<Sum>i = 0..<n. f (u i) (u (Suc i)) |u n. u 0 = x \<and> u n = y} \<noteq> {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {\<Sum>i = 0..<n. f (u i) (u (Suc i)) |u n. u 0 = x \<and> u n = y} \<noteq> {}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. {\<Sum>i = 0..<n. f (u i) (u (Suc i)) |u n. u 0 = x \<and> u n = y} \<noteq> {}
[PROOF STEP]
define u::"nat \<Rightarrow> 'a" where "u = (\<lambda>n. if n = 0 then x else y)"
[PROOF STATE]
proof (state)
this:
u = (\<lambda>n. if n = 0 then x else y)

goal (1 subgoal):
 1. {\<Sum>i = 0..<n. f (u i) (u (Suc i)) |u n. u 0 = x \<and> u n = y} \<noteq> {}
[PROOF STEP]
define n::nat where "n = 1"
[PROOF STATE]
proof (state)
this:
n = 1

goal (1 subgoal):
 1. {\<Sum>i = 0..<n. f (u i) (u (Suc i)) |u n. u 0 = x \<and> u n = y} \<noteq> {}
[PROOF STEP]
have "u 0 = x \<and> u n = y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. u 0 = x \<and> u n = y
[PROOF STEP]
unfolding u_def n_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if 0 = 0 then x else y) = x \<and> (if 1 = 0 then x else y) = y
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
u 0 = x \<and> u n = y

goal (1 subgoal):
 1. {\<Sum>i = 0..<n. f (u i) (u (Suc i)) |u n. u 0 = x \<and> u n = y} \<noteq> {}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
u 0 = x \<and> u n = y
[PROOF STEP]
have "(\<Sum>i = 0..<n. f (u i) (u (Suc i))) \<in> {\<Sum>i = 0..<n. f (u i) (u (Suc i)) |u n. u 0 = x \<and> u n = y}"
[PROOF STATE]
proof (prove)
using this:
u 0 = x \<and> u n = y

goal (1 subgoal):
 1. (\<Sum>i = 0..<n. f (u i) (u (Suc i))) \<in> {\<Sum>i = 0..<n. f (u i) (u (Suc i)) |u n. u 0 = x \<and> u n = y}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<Sum>i = 0..<n. f (u i) (u (Suc i))) \<in> {\<Sum>i = 0..<n. f (u i) (u (Suc i)) |u n. u 0 = x \<and> u n = y}

goal (1 subgoal):
 1. {\<Sum>i = 0..<n. f (u i) (u (Suc i)) |u n. u 0 = x \<and> u n = y} \<noteq> {}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<Sum>i = 0..<n. f (u i) (u (Suc i))) \<in> {\<Sum>i = 0..<n. f (u i) (u (Suc i)) |u n. u 0 = x \<and> u n = y}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<Sum>i = 0..<n. f (u i) (u (Suc i))) \<in> {\<Sum>i = 0..<n. f (u i) (u (Suc i)) |u n. u 0 = x \<and> u n = y}

goal (1 subgoal):
 1. {\<Sum>i = 0..<n. f (u i) (u (Suc i)) |u n. u 0 = x \<and> u n = y} \<noteq> {}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{\<Sum>i = 0..<n. f (u i) (u (Suc i)) |u n. u 0 = x \<and> u n = y} \<noteq> {}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ennreal_mult': "0 \<le> a \<Longrightarrow> ennreal (a * b) = ennreal a * ennreal b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> a \<Longrightarrow> ennreal (a * b) = ennreal a * ennreal b
[PROOF STEP]
by (cases "0 \<le> b") (auto simp: ennreal_mult ennreal_neg mult_nonneg_nonpos)


[STATEMENT]
lemma fine_Inter:
 "(\<lambda>x. \<Inter>{f d x | d.  d \<in> s}) fine p \<longleftrightarrow> (\<forall>d\<in>s. (f d) fine p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. \<Inter> {f d x |d. d \<in> s}) fine p) = (\<forall>d\<in>s. f d fine p)
[PROOF STEP]
unfolding fine_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>(x, k)\<in>p. k \<subseteq> \<Inter> {f d x |d. d \<in> s}) = (\<forall>d\<in>s. \<forall>(x, k)\<in>p. k \<subseteq> f d x)
[PROOF STEP]
by blast