[STATEMENT]
theorem pr_index_enumerator_inj2: "pr_index_enumerator n m1 = pr_index_enumerator n m2 \<Longrightarrow> m1 = m2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pr_index_enumerator n m1 = pr_index_enumerator n m2 \<Longrightarrow> m1 = m2
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. pr_index_enumerator n m1 = pr_index_enumerator n m2 \<Longrightarrow> m1 = m2
[PROOF STEP]
assume A: "pr_index_enumerator n m1 = pr_index_enumerator n m2"
[PROOF STATE]
proof (state)
this:
pr_index_enumerator n m1 = pr_index_enumerator n m2

goal (1 subgoal):
 1. pr_index_enumerator n m1 = pr_index_enumerator n m2 \<Longrightarrow> m1 = m2
[PROOF STEP]
define f where "f x = pr_index_enumerator n x" for x
[PROOF STATE]
proof (state)
this:
f ?x = pr_index_enumerator n ?x

goal (1 subgoal):
 1. pr_index_enumerator n m1 = pr_index_enumerator n m2 \<Longrightarrow> m1 = m2
[PROOF STEP]
have f_mono: "\<forall> x y. (x < y \<longrightarrow> f x < f y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x y. x < y \<longrightarrow> f x < f y
[PROOF STEP]
proof (rule allI, rule allI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x y. x < y \<longrightarrow> f x < f y
[PROOF STEP]
fix x y
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x y. x < y \<longrightarrow> f x < f y
[PROOF STEP]
show "x < y \<longrightarrow> f x < f y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x < y \<longrightarrow> f x < f y
[PROOF STEP]
by (unfold f_def, simp add: pr_index_enumerator_mono2)
[PROOF STATE]
proof (state)
this:
x < y \<longrightarrow> f x < f y

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>x y. x < y \<longrightarrow> f x < f y

goal (1 subgoal):
 1. pr_index_enumerator n m1 = pr_index_enumerator n m2 \<Longrightarrow> m1 = m2
[PROOF STEP]
from f_mono
[PROOF STATE]
proof (chain)
picking this:
\<forall>x y. x < y \<longrightarrow> f x < f y
[PROOF STEP]
have "\<forall> x y. (f x = f y \<longrightarrow> x = y)"
[PROOF STATE]
proof (prove)
using this:
\<forall>x y. x < y \<longrightarrow> f x < f y

goal (1 subgoal):
 1. \<forall>x y. f x = f y \<longrightarrow> x = y
[PROOF STEP]
by (rule f_mono_inj)
[PROOF STATE]
proof (state)
this:
\<forall>x y. f x = f y \<longrightarrow> x = y

goal (1 subgoal):
 1. pr_index_enumerator n m1 = pr_index_enumerator n m2 \<Longrightarrow> m1 = m2
[PROOF STEP]
with A f_def
[PROOF STATE]
proof (chain)
picking this:
pr_index_enumerator n m1 = pr_index_enumerator n m2
f ?x = pr_index_enumerator n ?x
\<forall>x y. f x = f y \<longrightarrow> x = y
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
pr_index_enumerator n m1 = pr_index_enumerator n m2
f ?x = pr_index_enumerator n ?x
\<forall>x y. f x = f y \<longrightarrow> x = y

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ideal_generated_pair_exists_pq1:
  assumes i: "ideal_generated {a,b} = (UNIV::'a set)"
  shows "\<exists>p q. p*a + q*b = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>p q. p * a + q * b = (1::'a)
[PROOF STEP]
using i
[PROOF STATE]
proof (prove)
using this:
ideal_generated {a, b} = UNIV

goal (1 subgoal):
 1. \<exists>p q. p * a + q * b = (1::'a)
[PROOF STEP]
unfolding ideal_generated_pair
[PROOF STATE]
proof (prove)
using this:
{p * a + q * b |p q. True} = UNIV

goal (1 subgoal):
 1. \<exists>p q. p * a + q * b = (1::'a)
[PROOF STEP]
by (smt iso_tuple_UNIV_I mem_Collect_eq)


[STATEMENT]
lemma vdw_imp_pos:
  assumes "vdw k l n"
          "l > 0"
  shows "n > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < n
[PROOF STEP]
proof (rule Nat.gr0I)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. n = 0 \<Longrightarrow> False
[PROOF STEP]
assume [simp]: "n = 0"
[PROOF STATE]
proof (state)
this:
n = 0

goal (1 subgoal):
 1. n = 0 \<Longrightarrow> False
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. False
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
vdw k l n
0 < l

goal (1 subgoal):
 1. False
[PROOF STEP]
by (elim vdwE[where a = 1 and b = 0 and col = "\<lambda>_. 0"])
       (auto simp: lessThan_empty_iff)
[PROOF STATE]
proof (state)
this:
False

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma SocratesMortal:
  assumes "Socrates \<in> Human " and "Mortal Q Human"
  shows "Socrates \<in> Mortal "
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Socrates \<in> Mortal
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
Socrates \<in> Human
Mortal Q Human

goal (1 subgoal):
 1. Socrates \<in> Mortal
[PROOF STEP]
by (simp add: universal_affirmation_def)


[STATEMENT]
lemma frontier_ic:
  assumes "a < (b::real)"
  shows "frontier {a<..b}  = {a,b}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. frontier {a<..b} = {a, b}
[PROOF STEP]
apply(simp add: frontier_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closure {a<..b} - {a<..<b} = {a, b}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
a < b

goal (1 subgoal):
 1. closure {a<..b} - {a<..<b} = {a, b}
[PROOF STEP]
by auto


[STATEMENT]
lemma iMODb_iff: "x \<in> [r, mod m, c] =
  (x mod m = r mod m \<and> r \<le> x \<and> x \<le> r + m * c)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<in> [ r, mod m, c ]) = (x mod m = r mod m \<and> r \<le> x \<and> x \<le> r + m * c)
[PROOF STEP]
by (simp add: iMODb_def)


[STATEMENT]
lemma frac_add_leIFF:
  fixes a d :: real
  assumes "0 \<le> d" "d < 1 - frac a" "d < 1 - frac b"
  shows "frac a \<le> frac b \<longleftrightarrow> frac (a + d) \<le> frac (b + d)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (frac a \<le> frac b) = (frac (a + d) \<le> frac (b + d))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (frac a \<le> frac b) = (frac (a + d) \<le> frac (b + d))
[PROOF STEP]
from floor_frac_add_preservation' assms
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>0 \<le> ?d; ?d < 1 - frac ?a\<rbrakk> \<Longrightarrow> \<lfloor>?a\<rfloor> = \<lfloor>?a + ?d\<rfloor>
0 \<le> d
d < 1 - frac a
d < 1 - frac b
[PROOF STEP]
have
    "floor a = floor (a + d)" "floor b = floor (b + d)"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>0 \<le> ?d; ?d < 1 - frac ?a\<rbrakk> \<Longrightarrow> \<lfloor>?a\<rfloor> = \<lfloor>?a + ?d\<rfloor>
0 \<le> d
d < 1 - frac a
d < 1 - frac b

goal (1 subgoal):
 1. \<lfloor>a\<rfloor> = \<lfloor>a + d\<rfloor> &&& \<lfloor>b\<rfloor> = \<lfloor>b + d\<rfloor>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<lfloor>a\<rfloor> = \<lfloor>a + d\<rfloor>
\<lfloor>b\<rfloor> = \<lfloor>b + d\<rfloor>

goal (1 subgoal):
 1. (frac a \<le> frac b) = (frac (a + d) \<le> frac (b + d))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<lfloor>a\<rfloor> = \<lfloor>a + d\<rfloor>
\<lfloor>b\<rfloor> = \<lfloor>b + d\<rfloor>
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<lfloor>a\<rfloor> = \<lfloor>a + d\<rfloor>
\<lfloor>b\<rfloor> = \<lfloor>b + d\<rfloor>

goal (1 subgoal):
 1. (frac a \<le> frac b) = (frac (a + d) \<le> frac (b + d))
[PROOF STEP]
unfolding frac_def
[PROOF STATE]
proof (prove)
using this:
\<lfloor>a\<rfloor> = \<lfloor>a + d\<rfloor>
\<lfloor>b\<rfloor> = \<lfloor>b + d\<rfloor>

goal (1 subgoal):
 1. (a - real_of_int \<lfloor>a\<rfloor> \<le> b - real_of_int \<lfloor>b\<rfloor>) = (a + d - real_of_int \<lfloor>a + d\<rfloor> \<le> b + d - real_of_int \<lfloor>b + d\<rfloor>)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(frac a \<le> frac b) = (frac (a + d) \<le> frac (b + d))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma piecewise_differentiable_add:
  assumes "f piecewise_differentiable_on i"
          "g piecewise_differentiable_on i"
    shows "(\<lambda>x. f x + g x) piecewise_differentiable_on i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. f x + g x) piecewise_differentiable_on i
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<lambda>x. f x + g x) piecewise_differentiable_on i
[PROOF STEP]
obtain S T where st: "finite S" "finite T"
                       "\<forall>x\<in>i - S. f differentiable at x within i"
                       "\<forall>x\<in>i - T. g differentiable at x within i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>S T. \<lbrakk>finite S; finite T; \<forall>x\<in>i - S. f differentiable at x within i; \<forall>x\<in>i - T. g differentiable at x within i\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
f piecewise_differentiable_on i
g piecewise_differentiable_on i

goal (1 subgoal):
 1. (\<And>S T. \<lbrakk>finite S; finite T; \<forall>x\<in>i - S. f differentiable at x within i; \<forall>x\<in>i - T. g differentiable at x within i\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp: piecewise_differentiable_on_def)
[PROOF STATE]
proof (state)
this:
finite S
finite T
\<forall>x\<in>i - S. f differentiable at x within i
\<forall>x\<in>i - T. g differentiable at x within i

goal (1 subgoal):
 1. (\<lambda>x. f x + g x) piecewise_differentiable_on i
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
finite S
finite T
\<forall>x\<in>i - S. f differentiable at x within i
\<forall>x\<in>i - T. g differentiable at x within i
[PROOF STEP]
have "finite (S \<union> T) \<and> (\<forall>x\<in>i - (S \<union> T). (\<lambda>x. f x + g x) differentiable at x within i)"
[PROOF STATE]
proof (prove)
using this:
finite S
finite T
\<forall>x\<in>i - S. f differentiable at x within i
\<forall>x\<in>i - T. g differentiable at x within i

goal (1 subgoal):
 1. finite (S \<union> T) \<and> (\<forall>x\<in>i - (S \<union> T). (\<lambda>x. f x + g x) differentiable at x within i)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
finite (S \<union> T) \<and> (\<forall>x\<in>i - (S \<union> T). (\<lambda>x. f x + g x) differentiable at x within i)

goal (1 subgoal):
 1. (\<lambda>x. f x + g x) piecewise_differentiable_on i
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
finite (S \<union> T) \<and> (\<forall>x\<in>i - (S \<union> T). (\<lambda>x. f x + g x) differentiable at x within i)

goal (1 subgoal):
 1. (\<lambda>x. f x + g x) piecewise_differentiable_on i
[PROOF STEP]
have "continuous_on i f" "continuous_on i g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on i f &&& continuous_on i g
[PROOF STEP]
using assms piecewise_differentiable_on_def
[PROOF STATE]
proof (prove)
using this:
f piecewise_differentiable_on i
g piecewise_differentiable_on i
?f piecewise_differentiable_on ?i \<equiv> continuous_on ?i ?f \<and> (\<exists>S. finite S \<and> (\<forall>x\<in>?i - S. ?f differentiable at x within ?i))

goal (1 subgoal):
 1. continuous_on i f &&& continuous_on i g
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
continuous_on i f
continuous_on i g

goal (1 subgoal):
 1. (\<lambda>x. f x + g x) piecewise_differentiable_on i
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
finite (S \<union> T) \<and> (\<forall>x\<in>i - (S \<union> T). (\<lambda>x. f x + g x) differentiable at x within i)
continuous_on i f
continuous_on i g
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
finite (S \<union> T) \<and> (\<forall>x\<in>i - (S \<union> T). (\<lambda>x. f x + g x) differentiable at x within i)
continuous_on i f
continuous_on i g

goal (1 subgoal):
 1. (\<lambda>x. f x + g x) piecewise_differentiable_on i
[PROOF STEP]
by (auto simp: piecewise_differentiable_on_def continuous_on_add)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. f x + g x) piecewise_differentiable_on i

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma even_sum_list: assumes "\<And> x. x \<in> set xs \<Longrightarrow> even (f x) = even (g x)"
  shows "even (sum_list (map f xs)) = even (sum_list (map g xs))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. even (sum_list (map f xs)) = even (sum_list (map g xs))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
?x \<in> set xs \<Longrightarrow> even (f ?x) = even (g ?x)

goal (1 subgoal):
 1. even (sum_list (map f xs)) = even (sum_list (map g xs))
[PROOF STEP]
by (induct xs, auto)


[STATEMENT]
lemma smult_eigen_vector: fixes a :: "'a :: field"
  assumes "eigen_vector A v x"
  shows "eigen_vector (a *k A) v (a * x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eigen_vector (a *k A) v (a * x)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. eigen_vector (a *k A) v (a * x)
[PROOF STEP]
from assms[unfolded eigen_vector_def]
[PROOF STATE]
proof (chain)
picking this:
v \<noteq> 0 \<and> A *v v = x *s v
[PROOF STEP]
have v: "v \<noteq> 0" and id: "A *v v = x *s v"
[PROOF STATE]
proof (prove)
using this:
v \<noteq> 0 \<and> A *v v = x *s v

goal (1 subgoal):
 1. v \<noteq> 0 &&& A *v v = x *s v
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
v \<noteq> 0
A *v v = x *s v

goal (1 subgoal):
 1. eigen_vector (a *k A) v (a * x)
[PROOF STEP]
from arg_cong[OF id, of "(*s) a"]
[PROOF STATE]
proof (chain)
picking this:
a *s (A *v v) = a *s (x *s v)
[PROOF STEP]
have id: "(a *k A) *v v = (a * x) *s v"
[PROOF STATE]
proof (prove)
using this:
a *s (A *v v) = a *s (x *s v)

goal (1 subgoal):
 1. a *k A *v v = a * x *s v
[PROOF STEP]
unfolding scalar_matrix_vector_assoc
[PROOF STATE]
proof (prove)
using this:
a *k A *v v = a *s (x *s v)

goal (1 subgoal):
 1. a *k A *v v = a * x *s v
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
a *k A *v v = a * x *s v

goal (1 subgoal):
 1. eigen_vector (a *k A) v (a * x)
[PROOF STEP]
thus "eigen_vector (a *k A) v (a * x)"
[PROOF STATE]
proof (prove)
using this:
a *k A *v v = a * x *s v

goal (1 subgoal):
 1. eigen_vector (a *k A) v (a * x)
[PROOF STEP]
using v
[PROOF STATE]
proof (prove)
using this:
a *k A *v v = a * x *s v
v \<noteq> 0

goal (1 subgoal):
 1. eigen_vector (a *k A) v (a * x)
[PROOF STEP]
unfolding eigen_vector_def
[PROOF STATE]
proof (prove)
using this:
a *k A *v v = a * x *s v
v \<noteq> 0

goal (1 subgoal):
 1. v \<noteq> 0 \<and> a *k A *v v = a * x *s v
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
eigen_vector (a *k A) v (a * x)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma fls_pow_subdegree_ge0:
  assumes "fls_subdegree f \<ge> 0"
  shows   "fls_subdegree (f^n) \<ge> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> fls_subdegree (f ^ n)
[PROOF STEP]
proof (cases "f^n = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. f ^ n = 0 \<Longrightarrow> 0 \<le> fls_subdegree (f ^ n)
 2. f ^ n \<noteq> 0 \<Longrightarrow> 0 \<le> fls_subdegree (f ^ n)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
f ^ n \<noteq> 0

goal (2 subgoals):
 1. f ^ n = 0 \<Longrightarrow> 0 \<le> fls_subdegree (f ^ n)
 2. f ^ n \<noteq> 0 \<Longrightarrow> 0 \<le> fls_subdegree (f ^ n)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
f ^ n \<noteq> 0

goal (2 subgoals):
 1. f ^ n = 0 \<Longrightarrow> 0 \<le> fls_subdegree (f ^ n)
 2. f ^ n \<noteq> 0 \<Longrightarrow> 0 \<le> fls_subdegree (f ^ n)
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
0 \<le> fls_subdegree f
[PROOF STEP]
have "int n * fls_subdegree f \<ge> 0"
[PROOF STATE]
proof (prove)
using this:
0 \<le> fls_subdegree f

goal (1 subgoal):
 1. 0 \<le> int n * fls_subdegree f
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
0 \<le> int n * fls_subdegree f

goal (2 subgoals):
 1. f ^ n = 0 \<Longrightarrow> 0 \<le> fls_subdegree (f ^ n)
 2. f ^ n \<noteq> 0 \<Longrightarrow> 0 \<le> fls_subdegree (f ^ n)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
f ^ n \<noteq> 0
0 \<le> int n * fls_subdegree f
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
f ^ n \<noteq> 0
0 \<le> int n * fls_subdegree f

goal (1 subgoal):
 1. 0 \<le> fls_subdegree (f ^ n)
[PROOF STEP]
using fls_pow_subdegree_ge
[PROOF STATE]
proof (prove)
using this:
f ^ n \<noteq> 0
0 \<le> int n * fls_subdegree f
?f ^ ?n \<noteq> 0 \<Longrightarrow> int ?n * fls_subdegree ?f \<le> fls_subdegree (?f ^ ?n)

goal (1 subgoal):
 1. 0 \<le> fls_subdegree (f ^ n)
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
0 \<le> fls_subdegree (f ^ n)

goal (1 subgoal):
 1. f ^ n = 0 \<Longrightarrow> 0 \<le> fls_subdegree (f ^ n)
[PROOF STEP]
qed simp


[STATEMENT]
lemma Fourier_offset_term:
  fixes f :: "real \<Rightarrow> real"
  assumes f: "f absolutely_integrable_on {-pi..pi}" and periodic: "\<And>x. f(x + 2*pi) = f x"
  shows  "Fourier_coefficient (\<lambda>x. f(x+t)) (2 * n + 2) * trigonometric_set (2 * n + 2) 0
        = Fourier_coefficient f(2 * n+1) * trigonometric_set (2 * n+1) t
        + Fourier_coefficient f(2 * n + 2) * trigonometric_set (2 * n + 2) t"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Fourier_coefficient (\<lambda>x. f (x + t)) (2 * n + 2) * trigonometric_set (2 * n + 2) 0 = Fourier_coefficient f (2 * n + 1) * trigonometric_set (2 * n + 1) t + Fourier_coefficient f (2 * n + 2) * trigonometric_set (2 * n + 2) t
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Fourier_coefficient (\<lambda>x. f (x + t)) (2 * n + 2) * trigonometric_set (2 * n + 2) 0 = Fourier_coefficient f (2 * n + 1) * trigonometric_set (2 * n + 1) t + Fourier_coefficient f (2 * n + 2) * trigonometric_set (2 * n + 2) t
[PROOF STEP]
have eq: "(2 + 2 * real n) * x / 2 = (1 + real n) * x" for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (2 + 2 * real n) * x / 2 = (1 + real n) * x
[PROOF STEP]
by (simp add: divide_simps)
[PROOF STATE]
proof (state)
this:
(2 + 2 * real n) * ?x / 2 = (1 + real n) * ?x

goal (1 subgoal):
 1. Fourier_coefficient (\<lambda>x. f (x + t)) (2 * n + 2) * trigonometric_set (2 * n + 2) 0 = Fourier_coefficient f (2 * n + 1) * trigonometric_set (2 * n + 1) t + Fourier_coefficient f (2 * n + 2) * trigonometric_set (2 * n + 2) t
[PROOF STEP]
have 1: "integrable (lebesgue_on {-pi..pi}) (\<lambda>x. f x * (cos (x + x * n) * cos (t + t * n)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integrable (lebesgue_on {- pi..pi}) (\<lambda>x. f x * (cos (x + x * real n) * cos (t + t * real n)))
[PROOF STEP]
using Fourier_products_integrable_cos [of f "Suc n"] f
[PROOF STATE]
proof (prove)
using this:
f absolutely_integrable_on {- pi..pi} \<Longrightarrow> integrable (lebesgue_on {- pi..pi}) (\<lambda>x. cos (real (Suc n) * x) * f x)
f absolutely_integrable_on {- pi..pi}

goal (1 subgoal):
 1. integrable (lebesgue_on {- pi..pi}) (\<lambda>x. f x * (cos (x + x * real n) * cos (t + t * real n)))
[PROOF STEP]
by (simp add: algebra_simps) (simp add: mult.assoc [symmetric])
[PROOF STATE]
proof (state)
this:
integrable (lebesgue_on {- pi..pi}) (\<lambda>x. f x * (cos (x + x * real n) * cos (t + t * real n)))

goal (1 subgoal):
 1. Fourier_coefficient (\<lambda>x. f (x + t)) (2 * n + 2) * trigonometric_set (2 * n + 2) 0 = Fourier_coefficient f (2 * n + 1) * trigonometric_set (2 * n + 1) t + Fourier_coefficient f (2 * n + 2) * trigonometric_set (2 * n + 2) t
[PROOF STEP]
have 2: "integrable (lebesgue_on {-pi..pi}) (\<lambda>x. f x * (sin (x + x * n) * sin (t + t * n)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integrable (lebesgue_on {- pi..pi}) (\<lambda>x. f x * (sin (x + x * real n) * sin (t + t * real n)))
[PROOF STEP]
using Fourier_products_integrable_sin [of f "Suc n"] f
[PROOF STATE]
proof (prove)
using this:
f absolutely_integrable_on {- pi..pi} \<Longrightarrow> integrable (lebesgue_on {- pi..pi}) (\<lambda>x. sin (real (Suc n) * x) * f x)
f absolutely_integrable_on {- pi..pi}

goal (1 subgoal):
 1. integrable (lebesgue_on {- pi..pi}) (\<lambda>x. f x * (sin (x + x * real n) * sin (t + t * real n)))
[PROOF STEP]
by (simp add: algebra_simps) (simp add: mult.assoc [symmetric])
[PROOF STATE]
proof (state)
this:
integrable (lebesgue_on {- pi..pi}) (\<lambda>x. f x * (sin (x + x * real n) * sin (t + t * real n)))

goal (1 subgoal):
 1. Fourier_coefficient (\<lambda>x. f (x + t)) (2 * n + 2) * trigonometric_set (2 * n + 2) 0 = Fourier_coefficient f (2 * n + 1) * trigonometric_set (2 * n + 1) t + Fourier_coefficient f (2 * n + 2) * trigonometric_set (2 * n + 2) t
[PROOF STEP]
have "has_bochner_integral (lebesgue_on {-pi..pi}) (\<lambda>x. cos (real (Suc n) * (x + t - t)) * f(x + t))
                 (LINT x|lebesgue_on {-pi..pi}. cos (real (Suc n) * (x - t)) * f x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. has_bochner_integral (lebesgue_on {- pi..pi}) (\<lambda>x. cos (real (Suc n) * (x + t - t)) * f (x + t)) (LINT x|lebesgue_on {- pi..pi}. cos (real (Suc n) * (x - t)) * f x)
[PROOF STEP]
proof (rule has_integral_periodic_offset)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. has_bochner_integral (lebesgue_on {- pi..pi}) (\<lambda>a. cos (real (Suc n) * (a - t)) * f a) (LINT x|lebesgue_on {- pi..pi}. cos (real (Suc n) * (x - t)) * f x)
 2. \<And>x. cos (real (Suc n) * (x + (pi - - pi) - t)) * f (x + (pi - - pi)) = cos (real (Suc n) * (x - t)) * f x
[PROOF STEP]
have "(\<lambda>x. cos (real (Suc n) * (x - t)) * f x) absolutely_integrable_on {-pi..pi}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. cos (real (Suc n) * (x - t)) * f x) absolutely_integrable_on {- pi..pi}
[PROOF STEP]
proof (rule absolutely_integrable_bounded_measurable_product_real)
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. (\<lambda>x. cos (real (Suc n) * (x - t))) \<in> borel_measurable (lebesgue_on {- pi..pi})
 2. {- pi..pi} \<in> sets lebesgue
 3. bounded ((\<lambda>x. cos (real (Suc n) * (x - t))) ` {- pi..pi})
 4. f absolutely_integrable_on {- pi..pi}
[PROOF STEP]
show "(\<lambda>x. cos (real (Suc n) * (x - t))) \<in> borel_measurable (lebesgue_on {-pi..pi})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. cos (real (Suc n) * (x - t))) \<in> borel_measurable (lebesgue_on {- pi..pi})
[PROOF STEP]
by (intro continuous_imp_measurable_on_sets_lebesgue continuous_intros) auto
[PROOF STATE]
proof (state)
this:
(\<lambda>x. cos (real (Suc n) * (x - t))) \<in> borel_measurable (lebesgue_on {- pi..pi})

goal (3 subgoals):
 1. {- pi..pi} \<in> sets lebesgue
 2. bounded ((\<lambda>x. cos (real (Suc n) * (x - t))) ` {- pi..pi})
 3. f absolutely_integrable_on {- pi..pi}
[PROOF STEP]
show "bounded ((\<lambda>x. cos (real (Suc n) * (x - t))) ` {-pi..pi})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bounded ((\<lambda>x. cos (real (Suc n) * (x - t))) ` {- pi..pi})
[PROOF STEP]
by (rule boundedI [where B=1]) auto
[PROOF STATE]
proof (state)
this:
bounded ((\<lambda>x. cos (real (Suc n) * (x - t))) ` {- pi..pi})

goal (2 subgoals):
 1. {- pi..pi} \<in> sets lebesgue
 2. f absolutely_integrable_on {- pi..pi}
[PROOF STEP]
qed (use f in auto)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. cos (real (Suc n) * (x - t)) * f x) absolutely_integrable_on {- pi..pi}

goal (2 subgoals):
 1. has_bochner_integral (lebesgue_on {- pi..pi}) (\<lambda>a. cos (real (Suc n) * (a - t)) * f a) (LINT x|lebesgue_on {- pi..pi}. cos (real (Suc n) * (x - t)) * f x)
 2. \<And>x. cos (real (Suc n) * (x + (pi - - pi) - t)) * f (x + (pi - - pi)) = cos (real (Suc n) * (x - t)) * f x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>x. cos (real (Suc n) * (x - t)) * f x) absolutely_integrable_on {- pi..pi}
[PROOF STEP]
show "has_bochner_integral (lebesgue_on {-pi..pi}) (\<lambda>x. cos ((Suc n) * (x - t)) * f x) (LINT x|lebesgue_on {-pi..pi}. cos (real (Suc n) * (x - t)) * f x)"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. cos (real (Suc n) * (x - t)) * f x) absolutely_integrable_on {- pi..pi}

goal (1 subgoal):
 1. has_bochner_integral (lebesgue_on {- pi..pi}) (\<lambda>x. cos (real (Suc n) * (x - t)) * f x) (LINT x|lebesgue_on {- pi..pi}. cos (real (Suc n) * (x - t)) * f x)
[PROOF STEP]
by (simp add: has_bochner_integral_integrable integrable_restrict_space set_integrable_def)
[PROOF STATE]
proof (state)
this:
has_bochner_integral (lebesgue_on {- pi..pi}) (\<lambda>x. cos (real (Suc n) * (x - t)) * f x) (LINT x|lebesgue_on {- pi..pi}. cos (real (Suc n) * (x - t)) * f x)

goal (1 subgoal):
 1. \<And>x. cos (real (Suc n) * (x + (pi - - pi) - t)) * f (x + (pi - - pi)) = cos (real (Suc n) * (x - t)) * f x
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. cos (real (Suc n) * (x + (pi - - pi) - t)) * f (x + (pi - - pi)) = cos (real (Suc n) * (x - t)) * f x
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. cos (real (Suc n) * (x + (pi - - pi) - t)) * f (x + (pi - - pi)) = cos (real (Suc n) * (x - t)) * f x
[PROOF STEP]
show "cos (real (Suc n) * (x + (pi - - pi) - t)) * f(x + (pi - - pi)) = cos (real (Suc n) * (x - t)) * f x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cos (real (Suc n) * (x + (pi - - pi) - t)) * f (x + (pi - - pi)) = cos (real (Suc n) * (x - t)) * f x
[PROOF STEP]
using periodic cos.plus_of_nat [of "(Suc n) * (x - t)" "Suc n"]
[PROOF STATE]
proof (prove)
using this:
f (?x + 2 * pi) = f ?x
cos (real (Suc n) * (x - t) + real (Suc n) * (2 * of_real pi)) = cos (real (Suc n) * (x - t))

goal (1 subgoal):
 1. cos (real (Suc n) * (x + (pi - - pi) - t)) * f (x + (pi - - pi)) = cos (real (Suc n) * (x - t)) * f x
[PROOF STEP]
by (simp add: algebra_simps)
[PROOF STATE]
proof (state)
this:
cos (real (Suc n) * (x + (pi - - pi) - t)) * f (x + (pi - - pi)) = cos (real (Suc n) * (x - t)) * f x

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
has_bochner_integral (lebesgue_on {- pi..pi}) (\<lambda>x. cos (real (Suc n) * (x + t - t)) * f (x + t)) (LINT x|lebesgue_on {- pi..pi}. cos (real (Suc n) * (x - t)) * f x)

goal (1 subgoal):
 1. Fourier_coefficient (\<lambda>x. f (x + t)) (2 * n + 2) * trigonometric_set (2 * n + 2) 0 = Fourier_coefficient f (2 * n + 1) * trigonometric_set (2 * n + 1) t + Fourier_coefficient f (2 * n + 2) * trigonometric_set (2 * n + 2) t
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
has_bochner_integral (lebesgue_on {- pi..pi}) (\<lambda>x. cos (real (Suc n) * (x + t - t)) * f (x + t)) (LINT x|lebesgue_on {- pi..pi}. cos (real (Suc n) * (x - t)) * f x)
[PROOF STEP]
have "has_bochner_integral (lebesgue_on {-pi..pi}) (\<lambda>x. cos (real (Suc n) * x) * f(x + t))
                 (LINT x|lebesgue_on {-pi..pi}. cos (real (Suc n) * (x - t)) * f x)"
[PROOF STATE]
proof (prove)
using this:
has_bochner_integral (lebesgue_on {- pi..pi}) (\<lambda>x. cos (real (Suc n) * (x + t - t)) * f (x + t)) (LINT x|lebesgue_on {- pi..pi}. cos (real (Suc n) * (x - t)) * f x)

goal (1 subgoal):
 1. has_bochner_integral (lebesgue_on {- pi..pi}) (\<lambda>x. cos (real (Suc n) * x) * f (x + t)) (LINT x|lebesgue_on {- pi..pi}. cos (real (Suc n) * (x - t)) * f x)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
has_bochner_integral (lebesgue_on {- pi..pi}) (\<lambda>x. cos (real (Suc n) * x) * f (x + t)) (LINT x|lebesgue_on {- pi..pi}. cos (real (Suc n) * (x - t)) * f x)

goal (1 subgoal):
 1. Fourier_coefficient (\<lambda>x. f (x + t)) (2 * n + 2) * trigonometric_set (2 * n + 2) 0 = Fourier_coefficient f (2 * n + 1) * trigonometric_set (2 * n + 1) t + Fourier_coefficient f (2 * n + 2) * trigonometric_set (2 * n + 2) t
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
has_bochner_integral (lebesgue_on {- pi..pi}) (\<lambda>x. cos (real (Suc n) * x) * f (x + t)) (LINT x|lebesgue_on {- pi..pi}. cos (real (Suc n) * (x - t)) * f x)
[PROOF STEP]
have "LINT x|lebesgue_on {-pi..pi}. cos ((Suc n) * x) * f(x+t)
           = LINT x|lebesgue_on {-pi..pi}. cos ((Suc n) * (x - t)) * f x"
[PROOF STATE]
proof (prove)
using this:
has_bochner_integral (lebesgue_on {- pi..pi}) (\<lambda>x. cos (real (Suc n) * x) * f (x + t)) (LINT x|lebesgue_on {- pi..pi}. cos (real (Suc n) * (x - t)) * f x)

goal (1 subgoal):
 1. LINT x|lebesgue_on {- pi..pi}. cos (real (Suc n) * x) * f (x + t) = LINT x|lebesgue_on {- pi..pi}. cos (real (Suc n) * (x - t)) * f x
[PROOF STEP]
using has_bochner_integral_integral_eq
[PROOF STATE]
proof (prove)
using this:
has_bochner_integral (lebesgue_on {- pi..pi}) (\<lambda>x. cos (real (Suc n) * x) * f (x + t)) (LINT x|lebesgue_on {- pi..pi}. cos (real (Suc n) * (x - t)) * f x)
has_bochner_integral ?M ?f ?x \<Longrightarrow> integral\<^sup>L ?M ?f = ?x

goal (1 subgoal):
 1. LINT x|lebesgue_on {- pi..pi}. cos (real (Suc n) * x) * f (x + t) = LINT x|lebesgue_on {- pi..pi}. cos (real (Suc n) * (x - t)) * f x
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
LINT x|lebesgue_on {- pi..pi}. cos (real (Suc n) * x) * f (x + t) = LINT x|lebesgue_on {- pi..pi}. cos (real (Suc n) * (x - t)) * f x

goal (1 subgoal):
 1. Fourier_coefficient (\<lambda>x. f (x + t)) (2 * n + 2) * trigonometric_set (2 * n + 2) 0 = Fourier_coefficient f (2 * n + 1) * trigonometric_set (2 * n + 1) t + Fourier_coefficient f (2 * n + 2) * trigonometric_set (2 * n + 2) t
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
LINT x|lebesgue_on {- pi..pi}. cos (real (Suc n) * x) * f (x + t) = LINT x|lebesgue_on {- pi..pi}. cos (real (Suc n) * (x - t)) * f x

goal (1 subgoal):
 1. Fourier_coefficient (\<lambda>x. f (x + t)) (2 * n + 2) * trigonometric_set (2 * n + 2) 0 = Fourier_coefficient f (2 * n + 1) * trigonometric_set (2 * n + 1) t + Fourier_coefficient f (2 * n + 2) * trigonometric_set (2 * n + 2) t
[PROOF STEP]
have "\<dots> = LINT x|lebesgue_on {-pi..pi}. cos ((Suc n) * x - ((Suc n) * t)) * f x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. LINT x|lebesgue_on {- pi..pi}. cos (real (Suc n) * (x - t)) * f x = LINT x|lebesgue_on {- pi..pi}. cos (real (Suc n) * x - real (Suc n) * t) * f x
[PROOF STEP]
by (simp add: algebra_simps)
[PROOF STATE]
proof (state)
this:
LINT x|lebesgue_on {- pi..pi}. cos (real (Suc n) * (x - t)) * f x = LINT x|lebesgue_on {- pi..pi}. cos (real (Suc n) * x - real (Suc n) * t) * f x

goal (1 subgoal):
 1. Fourier_coefficient (\<lambda>x. f (x + t)) (2 * n + 2) * trigonometric_set (2 * n + 2) 0 = Fourier_coefficient f (2 * n + 1) * trigonometric_set (2 * n + 1) t + Fourier_coefficient f (2 * n + 2) * trigonometric_set (2 * n + 2) t
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
LINT x|lebesgue_on {- pi..pi}. cos (real (Suc n) * (x - t)) * f x = LINT x|lebesgue_on {- pi..pi}. cos (real (Suc n) * x - real (Suc n) * t) * f x

goal (1 subgoal):
 1. Fourier_coefficient (\<lambda>x. f (x + t)) (2 * n + 2) * trigonometric_set (2 * n + 2) 0 = Fourier_coefficient f (2 * n + 1) * trigonometric_set (2 * n + 1) t + Fourier_coefficient f (2 * n + 2) * trigonometric_set (2 * n + 2) t
[PROOF STEP]
have "\<dots> = cos ((Suc n) * t) * (LINT x|lebesgue_on {-pi..pi}. cos ((Suc n) * x) * f x)
                 + sin ((Suc n) * t) * (LINT x|lebesgue_on {-pi..pi}. sin ((Suc n) * x) * f x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. LINT x|lebesgue_on {- pi..pi}. cos (real (Suc n) * x - real (Suc n) * t) * f x = cos (real (Suc n) * t) * (LINT x|lebesgue_on {- pi..pi}. cos (real (Suc n) * x) * f x) + sin (real (Suc n) * t) * (LINT x|lebesgue_on {- pi..pi}. sin (real (Suc n) * x) * f x)
[PROOF STEP]
by (simp add: cos_diff algebra_simps 1 2 flip: integral_mult_left_zero integral_mult_right_zero)
[PROOF STATE]
proof (state)
this:
LINT x|lebesgue_on {- pi..pi}. cos (real (Suc n) * x - real (Suc n) * t) * f x = cos (real (Suc n) * t) * (LINT x|lebesgue_on {- pi..pi}. cos (real (Suc n) * x) * f x) + sin (real (Suc n) * t) * (LINT x|lebesgue_on {- pi..pi}. sin (real (Suc n) * x) * f x)

goal (1 subgoal):
 1. Fourier_coefficient (\<lambda>x. f (x + t)) (2 * n + 2) * trigonometric_set (2 * n + 2) 0 = Fourier_coefficient f (2 * n + 1) * trigonometric_set (2 * n + 1) t + Fourier_coefficient f (2 * n + 2) * trigonometric_set (2 * n + 2) t
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
LINT x|lebesgue_on {- pi..pi}. cos (real (Suc n) * x) * f (x + t) = cos (real (Suc n) * t) * (LINT x|lebesgue_on {- pi..pi}. cos (real (Suc n) * x) * f x) + sin (real (Suc n) * t) * (LINT x|lebesgue_on {- pi..pi}. sin (real (Suc n) * x) * f x)
[PROOF STEP]
have "LINT x|lebesgue_on {-pi..pi}. cos ((Suc n) * x) * f(x+t)
        = cos ((Suc n) * t) * (LINT x|lebesgue_on {-pi..pi}. cos ((Suc n) * x) * f x)
        + sin ((Suc n) * t) * (LINT x|lebesgue_on {-pi..pi}. sin ((Suc n) * x) * f x)"
[PROOF STATE]
proof (prove)
using this:
LINT x|lebesgue_on {- pi..pi}. cos (real (Suc n) * x) * f (x + t) = cos (real (Suc n) * t) * (LINT x|lebesgue_on {- pi..pi}. cos (real (Suc n) * x) * f x) + sin (real (Suc n) * t) * (LINT x|lebesgue_on {- pi..pi}. sin (real (Suc n) * x) * f x)

goal (1 subgoal):
 1. LINT x|lebesgue_on {- pi..pi}. cos (real (Suc n) * x) * f (x + t) = cos (real (Suc n) * t) * (LINT x|lebesgue_on {- pi..pi}. cos (real (Suc n) * x) * f x) + sin (real (Suc n) * t) * (LINT x|lebesgue_on {- pi..pi}. sin (real (Suc n) * x) * f x)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
LINT x|lebesgue_on {- pi..pi}. cos (real (Suc n) * x) * f (x + t) = cos (real (Suc n) * t) * (LINT x|lebesgue_on {- pi..pi}. cos (real (Suc n) * x) * f x) + sin (real (Suc n) * t) * (LINT x|lebesgue_on {- pi..pi}. sin (real (Suc n) * x) * f x)

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

goal (1 subgoal):
 1. Fourier_coefficient (\<lambda>x. f (x + t)) (2 * n + 2) * trigonometric_set (2 * n + 2) 0 = Fourier_coefficient f (2 * n + 1) * trigonometric_set (2 * n + 1) t + Fourier_coefficient f (2 * n + 2) * trigonometric_set (2 * n + 2) t
[PROOF STEP]
unfolding Fourier_coefficient_def orthonormal_coeff_def trigonometric_set_def
[PROOF STATE]
proof (prove)
using this:
LINT x|lebesgue_on {- pi..pi}. cos (real (Suc n) * x) * f (x + t) = cos (real (Suc n) * t) * (LINT x|lebesgue_on {- pi..pi}. cos (real (Suc n) * x) * f x) + sin (real (Suc n) * t) * (LINT x|lebesgue_on {- pi..pi}. sin (real (Suc n) * x) * f x)

goal (1 subgoal):
 1. l2product {- pi..pi} (if 2 * n + 2 = 0 then \<lambda>x. 1 / sqrt (2 * pi) else if odd (2 * n + 2) then \<lambda>x. sin (real (Suc ((2 * n + 2) div 2)) * x) / sqrt pi else (\<lambda>x. cos (real (2 * n + 2) / 2 * x) / sqrt pi)) (\<lambda>x. f (x + t)) * (if 2 * n + 2 = 0 then \<lambda>x. 1 / sqrt (2 * pi) else if odd (2 * n + 2) then \<lambda>x. sin (real (Suc ((2 * n + 2) div 2)) * x) / sqrt pi else (\<lambda>x. cos (real (2 * n + 2) / 2 * x) / sqrt pi)) 0 = l2product {- pi..pi} (if 2 * n + 1 = 0 then \<lambda>x. 1 / sqrt (2 * pi) else if odd (2 * n + 1) then \<lambda>x. sin (real (Suc ((2 * n + 1) div 2)) * x) / sqrt pi else (\<lambda>x. cos (real (2 * n + 1) / 2 * x) / sqrt pi)) f * (if 2 * n + 1 = 0 then \<lambda>x. 1 / sqrt (2 * pi) else if odd (2 * n + 1) then \<lambda>x. sin (real (Suc ((2 * n + 1) div 2)) * x) / sqrt pi else (\<lambda>x. cos (real (2 * n + 1) / 2 * x) / sqrt pi)) t + l2product {- pi..pi} (if 2 * n + 2 = 0 then \<lambda>x. 1 / sqrt (2 * pi) else if odd (2 * n + 2) then \<lambda>x. sin (real (Suc ((2 * n + 2) div 2)) * x) / sqrt pi else (\<lambda>x. cos (real (2 * n + 2) / 2 * x) / sqrt pi)) f * (if 2 * n + 2 = 0 then \<lambda>x. 1 / sqrt (2 * pi) else if odd (2 * n + 2) then \<lambda>x. sin (real (Suc ((2 * n + 2) div 2)) * x) / sqrt pi else (\<lambda>x. cos (real (2 * n + 2) / 2 * x) / sqrt pi)) t
[PROOF STEP]
by (simp add: eq) (simp add: divide_simps algebra_simps l2product_def)
[PROOF STATE]
proof (state)
this:
Fourier_coefficient (\<lambda>x. f (x + t)) (2 * n + 2) * trigonometric_set (2 * n + 2) 0 = Fourier_coefficient f (2 * n + 1) * trigonometric_set (2 * n + 1) t + Fourier_coefficient f (2 * n + 2) * trigonometric_set (2 * n + 2) t

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma lim_1_over_complex_power:
  assumes "0 < Re s"
  shows "(\<lambda>n. 1 / of_nat n powr s) \<longlonglongrightarrow> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. 1 / of_nat n powr s) \<longlonglongrightarrow> 0
[PROOF STEP]
proof (rule Lim_null_comparison)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<forall>\<^sub>F x in sequentially. cmod (1 / of_nat x powr s) \<le> ?g x
 2. ?g \<longlonglongrightarrow> 0
[PROOF STEP]
have "\<forall>n>0. 3 \<le> n \<longrightarrow> 1 \<le> ln (real_of_nat n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>n>0. 3 \<le> n \<longrightarrow> 1 \<le> ln (real n)
[PROOF STEP]
using ln_272_gt_1
[PROOF STATE]
proof (prove)
using this:
1 < ln (272 / 100)

goal (1 subgoal):
 1. \<forall>n>0. 3 \<le> n \<longrightarrow> 1 \<le> ln (real n)
[PROOF STEP]
by (force intro: order_trans [of _ "ln (272/100)"])
[PROOF STATE]
proof (state)
this:
\<forall>n>0. 3 \<le> n \<longrightarrow> 1 \<le> ln (real n)

goal (2 subgoals):
 1. \<forall>\<^sub>F x in sequentially. cmod (1 / of_nat x powr s) \<le> ?g x
 2. ?g \<longlonglongrightarrow> 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>n>0. 3 \<le> n \<longrightarrow> 1 \<le> ln (real n)
[PROOF STEP]
show "\<forall>\<^sub>F x in sequentially. cmod (1 / of_nat x powr s) \<le> cmod (Ln (of_nat x) / of_nat x powr s)"
[PROOF STATE]
proof (prove)
using this:
\<forall>n>0. 3 \<le> n \<longrightarrow> 1 \<le> ln (real n)

goal (1 subgoal):
 1. \<forall>\<^sub>F x in sequentially. cmod (1 / of_nat x powr s) \<le> cmod (Ln (of_nat x) / of_nat x powr s)
[PROOF STEP]
by (auto simp: norm_divide field_split_simps eventually_sequentially)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in sequentially. cmod (1 / of_nat x powr s) \<le> cmod (Ln (of_nat x) / of_nat x powr s)

goal (1 subgoal):
 1. (\<lambda>x. cmod (Ln (of_nat x) / of_nat x powr s)) \<longlonglongrightarrow> 0
[PROOF STEP]
show "(\<lambda>n. cmod (Ln (of_nat n) / of_nat n powr s)) \<longlonglongrightarrow> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. cmod (Ln (of_nat n) / of_nat n powr s)) \<longlonglongrightarrow> 0
[PROOF STEP]
using lim_Ln_over_power [OF assms]
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. Ln (of_nat n) / of_nat n powr s) \<longlonglongrightarrow> 0

goal (1 subgoal):
 1. (\<lambda>n. cmod (Ln (of_nat n) / of_nat n powr s)) \<longlonglongrightarrow> 0
[PROOF STEP]
by (metis tendsto_norm_zero_iff)
[PROOF STATE]
proof (state)
this:
(\<lambda>n. cmod (Ln (of_nat n) / of_nat n powr s)) \<longlonglongrightarrow> 0

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma cdf_lim_infty:
  "((\<lambda>i. cdf M (real i)) \<longlonglongrightarrow> measure M (space M))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>i. cdf M (real i)) \<longlonglongrightarrow> Sigma_Algebra.measure M (space M)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<lambda>i. cdf M (real i)) \<longlonglongrightarrow> Sigma_Algebra.measure M (space M)
[PROOF STEP]
have "(\<lambda>i. cdf M (real i)) \<longlonglongrightarrow> measure M (\<Union> i::nat. {..real i})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>i. cdf M (real i)) \<longlonglongrightarrow> Sigma_Algebra.measure M (\<Union>i. {..real i})
[PROOF STEP]
unfolding cdf_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>i. Sigma_Algebra.measure M {..real i}) \<longlonglongrightarrow> Sigma_Algebra.measure M (\<Union>i. {..real i})
[PROOF STEP]
by (rule finite_Lim_measure_incseq) (auto simp: incseq_def)
[PROOF STATE]
proof (state)
this:
(\<lambda>i. cdf M (real i)) \<longlonglongrightarrow> Sigma_Algebra.measure M (\<Union>i. {..real i})

goal (1 subgoal):
 1. (\<lambda>i. cdf M (real i)) \<longlonglongrightarrow> Sigma_Algebra.measure M (space M)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<lambda>i. cdf M (real i)) \<longlonglongrightarrow> Sigma_Algebra.measure M (\<Union>i. {..real i})

goal (1 subgoal):
 1. (\<lambda>i. cdf M (real i)) \<longlonglongrightarrow> Sigma_Algebra.measure M (space M)
[PROOF STEP]
have "(\<Union> i::nat. {..real i}) = space M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Union>i. {..real i}) = space M
[PROOF STEP]
by (auto simp: borel_UNIV intro: real_arch_simple)
[PROOF STATE]
proof (state)
this:
(\<Union>i. {..real i}) = space M

goal (1 subgoal):
 1. (\<lambda>i. cdf M (real i)) \<longlonglongrightarrow> Sigma_Algebra.measure M (space M)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>i. cdf M (real i)) \<longlonglongrightarrow> Sigma_Algebra.measure M (space M)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<lambda>i. cdf M (real i)) \<longlonglongrightarrow> Sigma_Algebra.measure M (space M)

goal (1 subgoal):
 1. (\<lambda>i. cdf M (real i)) \<longlonglongrightarrow> Sigma_Algebra.measure M (space M)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(\<lambda>i. cdf M (real i)) \<longlonglongrightarrow> Sigma_Algebra.measure M (space M)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma emv_subst_imp_num_unique_vars_le:
  assumes "emv s t"
    and "s = t \<cdot> \<sigma>"
  shows "num_unique_vars s \<le> num_unique_vars t"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. num_unique_vars s \<le> num_unique_vars t
[PROOF STEP]
using emv_subst_vars_term [OF assms]
[PROOF STATE]
proof (prove)
using this:
vars_term s = (the_Var \<circ> \<sigma>) ` vars_term t

goal (1 subgoal):
 1. num_unique_vars s \<le> num_unique_vars t
[PROOF STEP]
apply (simp add: num_unique_vars_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vars_term s = (\<lambda>x. the_Var (\<sigma> x)) ` vars_term t \<Longrightarrow> card ((\<lambda>x. the_Var (\<sigma> x)) ` vars_term t) \<le> card (vars_term t)
[PROOF STEP]
by (metis card_image_le finite_vars_term)


[STATEMENT]
lemma is_cross_ratio_01inf:
  assumes "z1 \<noteq> z2" and "z1 \<noteq> z3" and "z2 \<noteq> z3" and "is_moebius f"
  assumes "f z1 = 0\<^sub>h" and "f z2 = 1\<^sub>h" and "f z3 = \<infinity>\<^sub>h"
  shows "f = (\<lambda> z. cross_ratio z z1 z2 z3)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f = (\<lambda>z. cross_ratio z z1 z2 z3)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
z1 \<noteq> z2
z1 \<noteq> z3
z2 \<noteq> z3
is_moebius f
f z1 = 0\<^sub>h
f z2 = 1\<^sub>h
f z3 = \<infinity>\<^sub>h

goal (1 subgoal):
 1. f = (\<lambda>z. cross_ratio z z1 z2 z3)
[PROOF STEP]
using cross_ratio_0[OF \<open>z1 \<noteq> z2\<close> \<open>z1 \<noteq> z3\<close>] cross_ratio_1[OF \<open>z1 \<noteq> z2\<close> \<open>z2 \<noteq> z3\<close>] cross_ratio_inf[OF \<open>z1 \<noteq> z3\<close> \<open>z2 \<noteq> z3\<close>]
[PROOF STATE]
proof (prove)
using this:
z1 \<noteq> z2
z1 \<noteq> z3
z2 \<noteq> z3
is_moebius f
f z1 = 0\<^sub>h
f z2 = 1\<^sub>h
f z3 = \<infinity>\<^sub>h
cross_ratio z1 z1 z2 z3 = 0\<^sub>h
cross_ratio z2 z1 z2 z3 = 1\<^sub>h
cross_ratio z3 z1 z2 z3 = \<infinity>\<^sub>h

goal (1 subgoal):
 1. f = (\<lambda>z. cross_ratio z z1 z2 z3)
[PROOF STEP]
using is_moebius_cross_ratio[OF \<open>z1 \<noteq> z2\<close> \<open>z2 \<noteq> z3\<close> \<open>z1 \<noteq> z3\<close>]
[PROOF STATE]
proof (prove)
using this:
z1 \<noteq> z2
z1 \<noteq> z3
z2 \<noteq> z3
is_moebius f
f z1 = 0\<^sub>h
f z2 = 1\<^sub>h
f z3 = \<infinity>\<^sub>h
cross_ratio z1 z1 z2 z3 = 0\<^sub>h
cross_ratio z2 z1 z2 z3 = 1\<^sub>h
cross_ratio z3 z1 z2 z3 = \<infinity>\<^sub>h
is_moebius (\<lambda>z. cross_ratio z z1 z2 z3)

goal (1 subgoal):
 1. f = (\<lambda>z. cross_ratio z z1 z2 z3)
[PROOF STEP]
using ex_unique_moebius_three_points_fun[OF \<open>z1 \<noteq> z2\<close> \<open>z1 \<noteq> z3\<close> \<open>z2 \<noteq> z3\<close>, of "0\<^sub>h" "1\<^sub>h" "\<infinity>\<^sub>h"]
[PROOF STATE]
proof (prove)
using this:
z1 \<noteq> z2
z1 \<noteq> z3
z2 \<noteq> z3
is_moebius f
f z1 = 0\<^sub>h
f z2 = 1\<^sub>h
f z3 = \<infinity>\<^sub>h
cross_ratio z1 z1 z2 z3 = 0\<^sub>h
cross_ratio z2 z1 z2 z3 = 1\<^sub>h
cross_ratio z3 z1 z2 z3 = \<infinity>\<^sub>h
is_moebius (\<lambda>z. cross_ratio z z1 z2 z3)
\<lbrakk>0\<^sub>h \<noteq> 1\<^sub>h; 0\<^sub>h \<noteq> \<infinity>\<^sub>h; 1\<^sub>h \<noteq> \<infinity>\<^sub>h\<rbrakk> \<Longrightarrow> \<exists>!f. is_moebius f \<and> f z1 = 0\<^sub>h \<and> f z2 = 1\<^sub>h \<and> f z3 = \<infinity>\<^sub>h

goal (1 subgoal):
 1. f = (\<lambda>z. cross_ratio z z1 z2 z3)
[PROOF STEP]
by auto


[STATEMENT]
lemma transpose_map_map:
  "transpose (map (map f) xs) = map (map f) (transpose xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. transpose (map (map f) xs) = map (map f) (transpose xs)
[PROOF STEP]
proof (rule nth_equalityI)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. length (transpose (map (map f) xs)) = length (map (map f) (transpose xs))
 2. \<And>i. i < length (transpose (map (map f) xs)) \<Longrightarrow> transpose (map (map f) xs) ! i = map (map f) (transpose xs) ! i
[PROOF STEP]
have [simp]: "length (transpose (map (map f) xs)) = length (transpose xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (transpose (map (map f) xs)) = length (transpose xs)
[PROOF STEP]
by (simp add: length_transpose foldr_map comp_def)
[PROOF STATE]
proof (state)
this:
length (transpose (map (map f) xs)) = length (transpose xs)

goal (2 subgoals):
 1. length (transpose (map (map f) xs)) = length (map (map f) (transpose xs))
 2. \<And>i. i < length (transpose (map (map f) xs)) \<Longrightarrow> transpose (map (map f) xs) ! i = map (map f) (transpose xs) ! i
[PROOF STEP]
show "length (transpose (map (map f) xs)) = length (map (map f) (transpose xs))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (transpose (map (map f) xs)) = length (map (map f) (transpose xs))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
length (transpose (map (map f) xs)) = length (map (map f) (transpose xs))

goal (1 subgoal):
 1. \<And>i. i < length (transpose (map (map f) xs)) \<Longrightarrow> transpose (map (map f) xs) ! i = map (map f) (transpose xs) ! i
[PROOF STEP]
fix i
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i. i < length (transpose (map (map f) xs)) \<Longrightarrow> transpose (map (map f) xs) ! i = map (map f) (transpose xs) ! i
[PROOF STEP]
assume "i < length (transpose (map (map f) xs))"
[PROOF STATE]
proof (state)
this:
i < length (transpose (map (map f) xs))

goal (1 subgoal):
 1. \<And>i. i < length (transpose (map (map f) xs)) \<Longrightarrow> transpose (map (map f) xs) ! i = map (map f) (transpose xs) ! i
[PROOF STEP]
thus "transpose (map (map f) xs) ! i = map (map f) (transpose xs) ! i"
[PROOF STATE]
proof (prove)
using this:
i < length (transpose (map (map f) xs))

goal (1 subgoal):
 1. transpose (map (map f) xs) ! i = map (map f) (transpose xs) ! i
[PROOF STEP]
by (simp add: nth_transpose filter_map comp_def)
[PROOF STATE]
proof (state)
this:
transpose (map (map f) xs) ! i = map (map f) (transpose xs) ! i

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma nextnat_empty_neq: assumes H: "\<not> emptyseq s" shows "s (nextnat s) \<noteq> s 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. s (nextnat s) \<noteq> s 0
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. s (nextnat s) \<noteq> s 0
[PROOF STEP]
from H
[PROOF STATE]
proof (chain)
picking this:
notemptyseq s
[PROOF STEP]
have a1: "nextnat s =  (LEAST i. s i \<noteq> s 0)"
[PROOF STATE]
proof (prove)
using this:
notemptyseq s

goal (1 subgoal):
 1. nextnat s = (LEAST i. s i \<noteq> s 0)
[PROOF STEP]
by (simp add: nextnat_def)
[PROOF STATE]
proof (state)
this:
nextnat s = (LEAST i. s i \<noteq> s 0)

goal (1 subgoal):
 1. s (nextnat s) \<noteq> s 0
[PROOF STEP]
from H
[PROOF STATE]
proof (chain)
picking this:
notemptyseq s
[PROOF STEP]
obtain i where "s i \<noteq> s 0"
[PROOF STATE]
proof (prove)
using this:
notemptyseq s

goal (1 subgoal):
 1. (\<And>i. s i \<noteq> s 0 \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp: emptyseq_def)
[PROOF STATE]
proof (state)
this:
s i \<noteq> s 0

goal (1 subgoal):
 1. s (nextnat s) \<noteq> s 0
[PROOF STEP]
hence "s (LEAST i. s i \<noteq> s 0) \<noteq> s 0"
[PROOF STATE]
proof (prove)
using this:
s i \<noteq> s 0

goal (1 subgoal):
 1. s (LEAST i. s i \<noteq> s 0) \<noteq> s 0
[PROOF STEP]
by (rule LeastI)
[PROOF STATE]
proof (state)
this:
s (LEAST i. s i \<noteq> s 0) \<noteq> s 0

goal (1 subgoal):
 1. s (nextnat s) \<noteq> s 0
[PROOF STEP]
with a1
[PROOF STATE]
proof (chain)
picking this:
nextnat s = (LEAST i. s i \<noteq> s 0)
s (LEAST i. s i \<noteq> s 0) \<noteq> s 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
nextnat s = (LEAST i. s i \<noteq> s 0)
s (LEAST i. s i \<noteq> s 0) \<noteq> s 0

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma prime_gt_1_nat: "prime p \<Longrightarrow> p > (1::nat)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prime p \<Longrightarrow> 1 < p
[PROOF STEP]
using prime_ge_2_nat [of p]
[PROOF STATE]
proof (prove)
using this:
prime p \<Longrightarrow> 2 \<le> p

goal (1 subgoal):
 1. prime p \<Longrightarrow> 1 < p
[PROOF STEP]
by simp


[STATEMENT]
lemma (in module) lincomb_sum:
  assumes A_fin: "finite A" and AinC: "A\<subseteq>carrier M" and a_fun: "a\<in>A\<rightarrow>carrier R" and
    b_fun: "b\<in>A\<rightarrow>carrier R"
  shows "lincomb (\<lambda>v. a v \<oplus>\<^bsub>R\<^esub> b v) A = lincomb a A \<oplus>\<^bsub>M\<^esub> lincomb b A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lincomb (\<lambda>v. a v \<oplus> b v) A = lincomb a A \<oplus>\<^bsub>M\<^esub> lincomb b A
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. lincomb (\<lambda>v. a v \<oplus> b v) A = lincomb a A \<oplus>\<^bsub>M\<^esub> lincomb b A
[PROOF STEP]
from A_fin AinC
[PROOF STATE]
proof (chain)
picking this:
finite A
A \<subseteq> carrier M
[PROOF STEP]
interpret mh: mod_hom R "func_space A" M  "(\<lambda>a. lincomb a A)"
[PROOF STATE]
proof (prove)
using this:
finite A
A \<subseteq> carrier M

goal (1 subgoal):
 1. mod_hom R (func_space A) M (\<lambda>a. lincomb a A)
[PROOF STEP]
by (rule
    lincomb_is_mod_hom)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. lincomb (\<lambda>v. a v \<oplus> b v) A = lincomb a A \<oplus>\<^bsub>M\<^esub> lincomb b A
[PROOF STEP]
let ?a="restrict a A"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. lincomb (\<lambda>v. a v \<oplus> b v) A = lincomb a A \<oplus>\<^bsub>M\<^esub> lincomb b A
[PROOF STEP]
let ?b="restrict b A"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. lincomb (\<lambda>v. a v \<oplus> b v) A = lincomb a A \<oplus>\<^bsub>M\<^esub> lincomb b A
[PROOF STEP]
from a_fun b_fun A_fin AinC
[PROOF STATE]
proof (chain)
picking this:
a \<in> A \<rightarrow> carrier R
b \<in> A \<rightarrow> carrier R
finite A
A \<subseteq> carrier M
[PROOF STEP]
have 1: "LinearCombinations.module.lincomb M (?a\<oplus>\<^bsub>(LinearCombinations.ring.func_space R A)\<^esub> ?b) A
    = LinearCombinations.module.lincomb M (\<lambda>x.  a x \<oplus>\<^bsub>R\<^esub> b x) A"
[PROOF STATE]
proof (prove)
using this:
a \<in> A \<rightarrow> carrier R
b \<in> A \<rightarrow> carrier R
finite A
A \<subseteq> carrier M

goal (1 subgoal):
 1. lincomb (restrict a A \<oplus>\<^bsub>func_space A\<^esub> restrict b A) A = lincomb (\<lambda>x. a x \<oplus> b x) A
[PROOF STEP]
by (auto simp add: func_space_def Pi_iff restrict_apply' cong: lincomb_cong)
[PROOF STATE]
proof (state)
this:
lincomb (restrict a A \<oplus>\<^bsub>func_space A\<^esub> restrict b A) A = lincomb (\<lambda>x. a x \<oplus> b x) A

goal (1 subgoal):
 1. lincomb (\<lambda>v. a v \<oplus> b v) A = lincomb a A \<oplus>\<^bsub>M\<^esub> lincomb b A
[PROOF STEP]
from a_fun b_fun A_fin AinC
[PROOF STATE]
proof (chain)
picking this:
a \<in> A \<rightarrow> carrier R
b \<in> A \<rightarrow> carrier R
finite A
A \<subseteq> carrier M
[PROOF STEP]
have 2: "LinearCombinations.module.lincomb M ?a A \<oplus>\<^bsub>M\<^esub>
      LinearCombinations.module.lincomb M ?b A = LinearCombinations.module.lincomb M a A \<oplus>\<^bsub>M\<^esub>
      LinearCombinations.module.lincomb M b A"
[PROOF STATE]
proof (prove)
using this:
a \<in> A \<rightarrow> carrier R
b \<in> A \<rightarrow> carrier R
finite A
A \<subseteq> carrier M

goal (1 subgoal):
 1. lincomb (restrict a A) A \<oplus>\<^bsub>M\<^esub> lincomb (restrict b A) A = lincomb a A \<oplus>\<^bsub>M\<^esub> lincomb b A
[PROOF STEP]
by (simp_all add: sum_simp cong: lincomb_cong)
[PROOF STATE]
proof (state)
this:
lincomb (restrict a A) A \<oplus>\<^bsub>M\<^esub> lincomb (restrict b A) A = lincomb a A \<oplus>\<^bsub>M\<^esub> lincomb b A

goal (1 subgoal):
 1. lincomb (\<lambda>v. a v \<oplus> b v) A = lincomb a A \<oplus>\<^bsub>M\<^esub> lincomb b A
[PROOF STEP]
from a_fun b_fun
[PROOF STATE]
proof (chain)
picking this:
a \<in> A \<rightarrow> carrier R
b \<in> A \<rightarrow> carrier R
[PROOF STEP]
have ainC: "?a\<in>carrier (LinearCombinations.ring.func_space R A)"
    and binC: "?b\<in>carrier (LinearCombinations.ring.func_space R A)"
[PROOF STATE]
proof (prove)
using this:
a \<in> A \<rightarrow> carrier R
b \<in> A \<rightarrow> carrier R

goal (1 subgoal):
 1. restrict a A \<in> carrier (func_space A) &&& restrict b A \<in> carrier (func_space A)
[PROOF STEP]
by (unfold func_space_def, auto)
[PROOF STATE]
proof (state)
this:
restrict a A \<in> carrier (func_space A)
restrict b A \<in> carrier (func_space A)

goal (1 subgoal):
 1. lincomb (\<lambda>v. a v \<oplus> b v) A = lincomb a A \<oplus>\<^bsub>M\<^esub> lincomb b A
[PROOF STEP]
from ainC binC
[PROOF STATE]
proof (chain)
picking this:
restrict a A \<in> carrier (func_space A)
restrict b A \<in> carrier (func_space A)
[PROOF STEP]
have "LinearCombinations.module.lincomb M (?a\<oplus>\<^bsub>(LinearCombinations.ring.func_space R A)\<^esub> ?b) A
    = LinearCombinations.module.lincomb M ?a A \<oplus>\<^bsub>M\<^esub>
      LinearCombinations.module.lincomb M ?b A"
[PROOF STATE]
proof (prove)
using this:
restrict a A \<in> carrier (func_space A)
restrict b A \<in> carrier (func_space A)

goal (1 subgoal):
 1. lincomb (restrict a A \<oplus>\<^bsub>func_space A\<^esub> restrict b A) A = lincomb (restrict a A) A \<oplus>\<^bsub>M\<^esub> lincomb (restrict b A) A
[PROOF STEP]
by (simp cong: lincomb_cong)
[PROOF STATE]
proof (state)
this:
lincomb (restrict a A \<oplus>\<^bsub>func_space A\<^esub> restrict b A) A = lincomb (restrict a A) A \<oplus>\<^bsub>M\<^esub> lincomb (restrict b A) A

goal (1 subgoal):
 1. lincomb (\<lambda>v. a v \<oplus> b v) A = lincomb a A \<oplus>\<^bsub>M\<^esub> lincomb b A
[PROOF STEP]
with 1 2
[PROOF STATE]
proof (chain)
picking this:
lincomb (restrict a A \<oplus>\<^bsub>func_space A\<^esub> restrict b A) A = lincomb (\<lambda>x. a x \<oplus> b x) A
lincomb (restrict a A) A \<oplus>\<^bsub>M\<^esub> lincomb (restrict b A) A = lincomb a A \<oplus>\<^bsub>M\<^esub> lincomb b A
lincomb (restrict a A \<oplus>\<^bsub>func_space A\<^esub> restrict b A) A = lincomb (restrict a A) A \<oplus>\<^bsub>M\<^esub> lincomb (restrict b A) A
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
lincomb (restrict a A \<oplus>\<^bsub>func_space A\<^esub> restrict b A) A = lincomb (\<lambda>x. a x \<oplus> b x) A
lincomb (restrict a A) A \<oplus>\<^bsub>M\<^esub> lincomb (restrict b A) A = lincomb a A \<oplus>\<^bsub>M\<^esub> lincomb b A
lincomb (restrict a A \<oplus>\<^bsub>func_space A\<^esub> restrict b A) A = lincomb (restrict a A) A \<oplus>\<^bsub>M\<^esub> lincomb (restrict b A) A

goal (1 subgoal):
 1. lincomb (\<lambda>v. a v \<oplus> b v) A = lincomb a A \<oplus>\<^bsub>M\<^esub> lincomb b A
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
lincomb (\<lambda>v. a v \<oplus> b v) A = lincomb a A \<oplus>\<^bsub>M\<^esub> lincomb b A

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma x_power_aq_minus_1_rw:
  fixes x::nat
  assumes x: "x > 1"
    and a: "a > 0"
    and b: "b > 0"
  shows "x ^ (a * q) - 1 = ((x^a) - 1) * sum ((^) (x^a)) {..<q}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x ^ (a * q) - 1 = (x ^ a - 1) * sum ((^) (x ^ a)) {..<q}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x ^ (a * q) - 1 = (x ^ a - 1) * sum ((^) (x ^ a)) {..<q}
[PROOF STEP]
have xa: "(x ^ a) > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < x ^ a
[PROOF STEP]
using x
[PROOF STATE]
proof (prove)
using this:
1 < x

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

goal (1 subgoal):
 1. x ^ (a * q) - 1 = (x ^ a - 1) * sum ((^) (x ^ a)) {..<q}
[PROOF STEP]
have int_rw1: "int (x ^ a) - 1 = int ((x ^ a) - 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. int (x ^ a) - 1 = int (x ^ a - 1)
[PROOF STEP]
using xa
[PROOF STATE]
proof (prove)
using this:
0 < x ^ a

goal (1 subgoal):
 1. int (x ^ a) - 1 = int (x ^ a - 1)
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
int (x ^ a) - 1 = int (x ^ a - 1)

goal (1 subgoal):
 1. x ^ (a * q) - 1 = (x ^ a - 1) * sum ((^) (x ^ a)) {..<q}
[PROOF STEP]
have int_rw2: "sum ((^) (int (x ^ a))) {..<q} = int (sum ((^) ((x ^ a))) {..<q})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum ((^) (int (x ^ a))) {..<q} = int (sum ((^) (x ^ a)) {..<q})
[PROOF STEP]
unfolding int_sum
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum ((^) (int (x ^ a))) {..<q} = (\<Sum>xa<q. int ((x ^ a) ^ xa))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
sum ((^) (int (x ^ a))) {..<q} = int (sum ((^) (x ^ a)) {..<q})

goal (1 subgoal):
 1. x ^ (a * q) - 1 = (x ^ a - 1) * sum ((^) (x ^ a)) {..<q}
[PROOF STEP]
have "int (x ^ a) ^ q = int (Suc ((x ^ a) ^ q - 1))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. int (x ^ a) ^ q = int (Suc ((x ^ a) ^ q - 1))
[PROOF STEP]
using xa
[PROOF STATE]
proof (prove)
using this:
0 < x ^ a

goal (1 subgoal):
 1. int (x ^ a) ^ q = int (Suc ((x ^ a) ^ q - 1))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
int (x ^ a) ^ q = int (Suc ((x ^ a) ^ q - 1))

goal (1 subgoal):
 1. x ^ (a * q) - 1 = (x ^ a - 1) * sum ((^) (x ^ a)) {..<q}
[PROOF STEP]
hence "int ((x ^ a) ^ q - 1) = int (x ^ a) ^ q - 1"
[PROOF STATE]
proof (prove)
using this:
int (x ^ a) ^ q = int (Suc ((x ^ a) ^ q - 1))

goal (1 subgoal):
 1. int ((x ^ a) ^ q - 1) = int (x ^ a) ^ q - 1
[PROOF STEP]
using xa
[PROOF STATE]
proof (prove)
using this:
int (x ^ a) ^ q = int (Suc ((x ^ a) ^ q - 1))
0 < x ^ a

goal (1 subgoal):
 1. int ((x ^ a) ^ q - 1) = int (x ^ a) ^ q - 1
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
int ((x ^ a) ^ q - 1) = int (x ^ a) ^ q - 1

goal (1 subgoal):
 1. x ^ (a * q) - 1 = (x ^ a - 1) * sum ((^) (x ^ a)) {..<q}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
int ((x ^ a) ^ q - 1) = int (x ^ a) ^ q - 1

goal (1 subgoal):
 1. x ^ (a * q) - 1 = (x ^ a - 1) * sum ((^) (x ^ a)) {..<q}
[PROOF STEP]
have "... = (int (x ^ a) - 1) * sum ((^) (int (x ^ a))) {..<q}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. int (x ^ a) ^ q - 1 = (int (x ^ a) - 1) * sum ((^) (int (x ^ a))) {..<q}
[PROOF STEP]
by (rule power_diff_1_eq)
[PROOF STATE]
proof (state)
this:
int (x ^ a) ^ q - 1 = (int (x ^ a) - 1) * sum ((^) (int (x ^ a))) {..<q}

goal (1 subgoal):
 1. x ^ (a * q) - 1 = (x ^ a - 1) * sum ((^) (x ^ a)) {..<q}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
int (x ^ a) ^ q - 1 = (int (x ^ a) - 1) * sum ((^) (int (x ^ a))) {..<q}

goal (1 subgoal):
 1. x ^ (a * q) - 1 = (x ^ a - 1) * sum ((^) (x ^ a)) {..<q}
[PROOF STEP]
have "... = (int ((x ^ a) - 1)) * int (sum ((^) ( (x ^ a))) {..<q})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (int (x ^ a) - 1) * sum ((^) (int (x ^ a))) {..<q} = int (x ^ a - 1) * int (sum ((^) (x ^ a)) {..<q})
[PROOF STEP]
unfolding int_rw1 int_rw2
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. int (x ^ a - 1) * int (sum ((^) (x ^ a)) {..<q}) = int (x ^ a - 1) * int (sum ((^) (x ^ a)) {..<q})
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(int (x ^ a) - 1) * sum ((^) (int (x ^ a))) {..<q} = int (x ^ a - 1) * int (sum ((^) (x ^ a)) {..<q})

goal (1 subgoal):
 1. x ^ (a * q) - 1 = (x ^ a - 1) * sum ((^) (x ^ a)) {..<q}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(int (x ^ a) - 1) * sum ((^) (int (x ^ a))) {..<q} = int (x ^ a - 1) * int (sum ((^) (x ^ a)) {..<q})

goal (1 subgoal):
 1. x ^ (a * q) - 1 = (x ^ a - 1) * sum ((^) (x ^ a)) {..<q}
[PROOF STEP]
have "... = int (((x ^ a) - 1) * (sum ((^) ( (x ^ a))) {..<q}))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. int (x ^ a - 1) * int (sum ((^) (x ^ a)) {..<q}) = int ((x ^ a - 1) * sum ((^) (x ^ a)) {..<q})
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
int (x ^ a - 1) * int (sum ((^) (x ^ a)) {..<q}) = int ((x ^ a - 1) * sum ((^) (x ^ a)) {..<q})

goal (1 subgoal):
 1. x ^ (a * q) - 1 = (x ^ a - 1) * sum ((^) (x ^ a)) {..<q}
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
int ((x ^ a) ^ q - 1) = int ((x ^ a - 1) * sum ((^) (x ^ a)) {..<q})
[PROOF STEP]
have aux: "int ((x ^ a) ^ q - 1) = int (((x ^ a) - 1) * sum ((^) (x ^ a)) {..<q})"
[PROOF STATE]
proof (prove)
using this:
int ((x ^ a) ^ q - 1) = int ((x ^ a - 1) * sum ((^) (x ^ a)) {..<q})

goal (1 subgoal):
 1. int ((x ^ a) ^ q - 1) = int ((x ^ a - 1) * sum ((^) (x ^ a)) {..<q})
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
int ((x ^ a) ^ q - 1) = int ((x ^ a - 1) * sum ((^) (x ^ a)) {..<q})

goal (1 subgoal):
 1. x ^ (a * q) - 1 = (x ^ a - 1) * sum ((^) (x ^ a)) {..<q}
[PROOF STEP]
have "x ^ (a * q) - 1 = (x^a)^q - 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x ^ (a * q) - 1 = (x ^ a) ^ q - 1
[PROOF STEP]
by (simp add: power_mult)
[PROOF STATE]
proof (state)
this:
x ^ (a * q) - 1 = (x ^ a) ^ q - 1

goal (1 subgoal):
 1. x ^ (a * q) - 1 = (x ^ a - 1) * sum ((^) (x ^ a)) {..<q}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
x ^ (a * q) - 1 = (x ^ a) ^ q - 1

goal (1 subgoal):
 1. x ^ (a * q) - 1 = (x ^ a - 1) * sum ((^) (x ^ a)) {..<q}
[PROOF STEP]
have "... = ((x^a) - 1) * sum ((^) (x^a)) {..<q}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x ^ a) ^ q - 1 = (x ^ a - 1) * sum ((^) (x ^ a)) {..<q}
[PROOF STEP]
using aux
[PROOF STATE]
proof (prove)
using this:
int ((x ^ a) ^ q - 1) = int ((x ^ a - 1) * sum ((^) (x ^ a)) {..<q})

goal (1 subgoal):
 1. (x ^ a) ^ q - 1 = (x ^ a - 1) * sum ((^) (x ^ a)) {..<q}
[PROOF STEP]
unfolding int_int_eq
[PROOF STATE]
proof (prove)
using this:
(x ^ a) ^ q - 1 = (x ^ a - 1) * sum ((^) (x ^ a)) {..<q}

goal (1 subgoal):
 1. (x ^ a) ^ q - 1 = (x ^ a - 1) * sum ((^) (x ^ a)) {..<q}
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(x ^ a) ^ q - 1 = (x ^ a - 1) * sum ((^) (x ^ a)) {..<q}

goal (1 subgoal):
 1. x ^ (a * q) - 1 = (x ^ a - 1) * sum ((^) (x ^ a)) {..<q}
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
x ^ (a * q) - 1 = (x ^ a - 1) * sum ((^) (x ^ a)) {..<q}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
x ^ (a * q) - 1 = (x ^ a - 1) * sum ((^) (x ^ a)) {..<q}

goal (1 subgoal):
 1. x ^ (a * q) - 1 = (x ^ a - 1) * sum ((^) (x ^ a)) {..<q}
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
x ^ (a * q) - 1 = (x ^ a - 1) * sum ((^) (x ^ a)) {..<q}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma rtrancl_on_mono:
  assumes "s \<subseteq> r" "F \<subseteq> G" "(a,b) \<in> rtrancl_on F s" shows "(a,b) \<in> rtrancl_on G r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a, b) \<in> rtrancl_on G r
[PROOF STEP]
using assms(3,1,2)
[PROOF STATE]
proof (prove)
using this:
(a, b) \<in> rtrancl_on F s
s \<subseteq> r
F \<subseteq> G

goal (1 subgoal):
 1. (a, b) \<in> rtrancl_on G r
[PROOF STEP]
proof induct
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>b \<in> F; s \<subseteq> r; F \<subseteq> G\<rbrakk> \<Longrightarrow> (b, b) \<in> rtrancl_on G r
 2. \<And>x y. \<lbrakk>(x, y) \<in> s; (y, b) \<in> rtrancl_on F s; x \<in> F; y \<in> F; \<lbrakk>s \<subseteq> r; F \<subseteq> G\<rbrakk> \<Longrightarrow> (y, b) \<in> rtrancl_on G r; s \<subseteq> r; F \<subseteq> G\<rbrakk> \<Longrightarrow> (x, b) \<in> rtrancl_on G r
[PROOF STEP]
case (step x y)
[PROOF STATE]
proof (state)
this:
(x, y) \<in> s
(y, b) \<in> rtrancl_on F s
x \<in> F
y \<in> F
\<lbrakk>s \<subseteq> r; F \<subseteq> G\<rbrakk> \<Longrightarrow> (y, b) \<in> rtrancl_on G r
s \<subseteq> r
F \<subseteq> G

goal (2 subgoals):
 1. \<lbrakk>b \<in> F; s \<subseteq> r; F \<subseteq> G\<rbrakk> \<Longrightarrow> (b, b) \<in> rtrancl_on G r
 2. \<And>x y. \<lbrakk>(x, y) \<in> s; (y, b) \<in> rtrancl_on F s; x \<in> F; y \<in> F; \<lbrakk>s \<subseteq> r; F \<subseteq> G\<rbrakk> \<Longrightarrow> (y, b) \<in> rtrancl_on G r; s \<subseteq> r; F \<subseteq> G\<rbrakk> \<Longrightarrow> (x, b) \<in> rtrancl_on G r
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x, b) \<in> rtrancl_on G r
[PROOF STEP]
using step assms
[PROOF STATE]
proof (prove)
using this:
(x, y) \<in> s
(y, b) \<in> rtrancl_on F s
x \<in> F
y \<in> F
\<lbrakk>s \<subseteq> r; F \<subseteq> G\<rbrakk> \<Longrightarrow> (y, b) \<in> rtrancl_on G r
s \<subseteq> r
F \<subseteq> G
s \<subseteq> r
F \<subseteq> G
(a, b) \<in> rtrancl_on F s

goal (1 subgoal):
 1. (x, b) \<in> rtrancl_on G r
[PROOF STEP]
by (intro converse_rtrancl_on_into_rtrancl_on[OF _ step(5)]) auto
[PROOF STATE]
proof (state)
this:
(x, b) \<in> rtrancl_on G r

goal (1 subgoal):
 1. \<lbrakk>b \<in> F; s \<subseteq> r; F \<subseteq> G\<rbrakk> \<Longrightarrow> (b, b) \<in> rtrancl_on G r
[PROOF STEP]
qed auto


[STATEMENT]
lemma det_row_add':
assumes i_not_j: "i \<noteq> j"
shows "det (row_add A i j q) = det A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. det (row_add A i j q) = det A
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. det (row_add A i j q) = det A
[PROOF STEP]
have "(row_add A i j q) = (\<chi> k. if k = i then row i A + q *s row j A else row k A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. row_add A i j q = (\<chi>k. if k = i then row i A + q *s row j A else row k A)
[PROOF STEP]
unfolding row_add_def row_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<chi>ia ja. if ia = i then A $ i $ ja + q * A $ j $ ja else A $ ia $ ja) = (\<chi>k. if k = i then vec_lambda (($) (A $ i)) + q *s vec_lambda (($) (A $ j)) else vec_lambda (($) (A $ k)))
[PROOF STEP]
by vector
[PROOF STATE]
proof (state)
this:
row_add A i j q = (\<chi>k. if k = i then row i A + q *s row j A else row k A)

goal (1 subgoal):
 1. det (row_add A i j q) = det A
[PROOF STEP]
hence "det(row_add A i j q) = det(\<chi> k. if k = i then row i A + q *s row j A else row k A)"
[PROOF STATE]
proof (prove)
using this:
row_add A i j q = (\<chi>k. if k = i then row i A + q *s row j A else row k A)

goal (1 subgoal):
 1. det (row_add A i j q) = det (\<chi>k. if k = i then row i A + q *s row j A else row k A)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
det (row_add A i j q) = det (\<chi>k. if k = i then row i A + q *s row j A else row k A)

goal (1 subgoal):
 1. det (row_add A i j q) = det A
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
det (row_add A i j q) = det (\<chi>k. if k = i then row i A + q *s row j A else row k A)

goal (1 subgoal):
 1. det (row_add A i j q) = det A
[PROOF STEP]
have "... = det A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. det (\<chi>k. if k = i then row i A + q *s row j A else row k A) = det A
[PROOF STEP]
unfolding det_row_operation[OF i_not_j]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. det A = det A
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
det (\<chi>k. if k = i then row i A + q *s row j A else row k A) = det A

goal (1 subgoal):
 1. det (row_add A i j q) = det A
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
det (row_add A i j q) = det A
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
det (row_add A i j q) = det A

goal (1 subgoal):
 1. det (row_add A i j q) = det A
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
det (row_add A i j q) = det A

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma rev_drop: "rev (drop i xs) = take (length xs - i) (rev xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rev (drop i xs) = take (length xs - i) (rev xs)
[PROOF STEP]
proof (induct xs arbitrary: i)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>i. rev (drop i []) = take (length [] - i) (rev [])
 2. \<And>a xs i. (\<And>i. rev (drop i xs) = take (length xs - i) (rev xs)) \<Longrightarrow> rev (drop i (a # xs)) = take (length (a # xs) - i) (rev (a # xs))
[PROOF STEP]
case Nil
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. \<And>i. rev (drop i []) = take (length [] - i) (rev [])
 2. \<And>a xs i. (\<And>i. rev (drop i xs) = take (length xs - i) (rev xs)) \<Longrightarrow> rev (drop i (a # xs)) = take (length (a # xs) - i) (rev (a # xs))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rev (drop i []) = take (length [] - i) (rev [])
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
rev (drop i []) = take (length [] - i) (rev [])

goal (1 subgoal):
 1. \<And>a xs i. (\<And>i. rev (drop i xs) = take (length xs - i) (rev xs)) \<Longrightarrow> rev (drop i (a # xs)) = take (length (a # xs) - i) (rev (a # xs))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a xs i. (\<And>i. rev (drop i xs) = take (length xs - i) (rev xs)) \<Longrightarrow> rev (drop i (a # xs)) = take (length (a # xs) - i) (rev (a # xs))
[PROOF STEP]
case Cons
[PROOF STATE]
proof (state)
this:
rev (drop ?i xs_) = take (length xs_ - ?i) (rev xs_)

goal (1 subgoal):
 1. \<And>a xs i. (\<And>i. rev (drop i xs) = take (length xs - i) (rev xs)) \<Longrightarrow> rev (drop i (a # xs)) = take (length (a # xs) - i) (rev (a # xs))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
rev (drop ?i xs_) = take (length xs_ - ?i) (rev xs_)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
rev (drop ?i xs_) = take (length xs_ - ?i) (rev xs_)

goal (1 subgoal):
 1. rev (drop i (a_ # xs_)) = take (length (a_ # xs_) - i) (rev (a_ # xs_))
[PROOF STEP]
by (cases i) auto
[PROOF STATE]
proof (state)
this:
rev (drop i (a_ # xs_)) = take (length (a_ # xs_) - i) (rev (a_ # xs_))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma nth_elem_Max:
  assumes "card S > 0"
  shows "nth_elem S (card S - 1) = Max S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nth_elem S (card S - 1) = Max S
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. nth_elem S (card S - 1) = Max S
[PROOF STEP]
have "last (set_to_list S) = set_to_list S ! (card S - 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. last (sorted_list_of_set S) = sorted_list_of_set S ! (card S - 1)
[PROOF STEP]
by (metis assms card_0_eq card_ge_0_finite last_conv_nth neq0_conv set_to_list_length sorted_list_of_set_eq_Nil_iff)
[PROOF STATE]
proof (state)
this:
last (sorted_list_of_set S) = sorted_list_of_set S ! (card S - 1)

goal (1 subgoal):
 1. nth_elem S (card S - 1) = Max S
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
last (sorted_list_of_set S) = sorted_list_of_set S ! (card S - 1)

goal (1 subgoal):
 1. nth_elem S (card S - 1) = Max S
[PROOF STEP]
using assms set_to_list_last set_to_list_length
[PROOF STATE]
proof (prove)
using this:
last (sorted_list_of_set S) = sorted_list_of_set S ! (card S - 1)
0 < card S
0 < card ?S \<Longrightarrow> Max ?S = last (sorted_list_of_set ?S)
finite ?S \<Longrightarrow> length (sorted_list_of_set ?S) = card ?S

goal (1 subgoal):
 1. nth_elem S (card S - 1) = Max S
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
nth_elem S (card S - 1) = Max S

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma div_ge: "(k::nat) \<le> m div n \<Longrightarrow> n*k \<le> m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. k \<le> m div n \<Longrightarrow> n * k \<le> m
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. k \<le> m div n \<Longrightarrow> n * k \<le> m
[PROOF STEP]
assume A: "k \<le> m div n"
[PROOF STATE]
proof (state)
this:
k \<le> m div n

goal (1 subgoal):
 1. k \<le> m div n \<Longrightarrow> n * k \<le> m
[PROOF STEP]
have S1: "n * (m div n) + m mod n = m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n * (m div n) + m mod n = m
[PROOF STEP]
by (rule mult_div_mod_eq)
[PROOF STATE]
proof (state)
this:
n * (m div n) + m mod n = m

goal (1 subgoal):
 1. k \<le> m div n \<Longrightarrow> n * k \<le> m
[PROOF STEP]
have S2: "0 \<le> m mod n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> m mod n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 \<le> m mod n

goal (1 subgoal):
 1. k \<le> m div n \<Longrightarrow> n * k \<le> m
[PROOF STEP]
from S1 S2
[PROOF STATE]
proof (chain)
picking this:
n * (m div n) + m mod n = m
0 \<le> m mod n
[PROOF STEP]
have S3: "n * (m div n) \<le> m"
[PROOF STATE]
proof (prove)
using this:
n * (m div n) + m mod n = m
0 \<le> m mod n

goal (1 subgoal):
 1. n * (m div n) \<le> m
[PROOF STEP]
by arith
[PROOF STATE]
proof (state)
this:
n * (m div n) \<le> m

goal (1 subgoal):
 1. k \<le> m div n \<Longrightarrow> n * k \<le> m
[PROOF STEP]
from A
[PROOF STATE]
proof (chain)
picking this:
k \<le> m div n
[PROOF STEP]
have S4: "n * k \<le>  n * (m div n)"
[PROOF STATE]
proof (prove)
using this:
k \<le> m div n

goal (1 subgoal):
 1. n * k \<le> n * (m div n)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
n * k \<le> n * (m div n)

goal (1 subgoal):
 1. k \<le> m div n \<Longrightarrow> n * k \<le> m
[PROOF STEP]
from S4 S3
[PROOF STATE]
proof (chain)
picking this:
n * k \<le> n * (m div n)
n * (m div n) \<le> m
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
n * k \<le> n * (m div n)
n * (m div n) \<le> m

goal (1 subgoal):
 1. n * k \<le> m
[PROOF STEP]
by (rule order_trans)
[PROOF STATE]
proof (state)
this:
n * k \<le> m

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma has_integral_component_neg:
  fixes f :: "'a::euclidean_space \<Rightarrow> 'b::euclidean_space"
  assumes "k \<in> Basis"
    and "(f has_integral i) S"
    and "\<And>x. x \<in> S \<Longrightarrow> (f x)\<bullet>k \<le> 0"
  shows "i\<bullet>k \<le> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i \<bullet> k \<le> 0
[PROOF STEP]
using has_integral_component_le[OF assms(1,2) has_integral_0] assms(2-)
[PROOF STATE]
proof (prove)
using this:
(\<And>x. x \<in> S \<Longrightarrow> f x \<bullet> k \<le> (0::'b) \<bullet> k) \<Longrightarrow> i \<bullet> k \<le> (0::'b) \<bullet> k
(f has_integral i) S
?x \<in> S \<Longrightarrow> f ?x \<bullet> k \<le> 0

goal (1 subgoal):
 1. i \<bullet> k \<le> 0
[PROOF STEP]
by auto


[STATEMENT]
lemma i_squared [simp]: "\<i> * \<i> = -1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<i> * \<i> = - 1
[PROOF STEP]
by (simp add: complex_eq_iff)


[STATEMENT]
lemma construct_lhs_matches_solve_for_lhs_R:
  fixes p:: "real poly"
  fixes qs :: "real poly list"
  fixes subsets :: "(nat list*nat list) list"
  fixes signs :: "rat list list"
  assumes match: "satisfy_equation_R p qs subsets signs"
  assumes invertible_mat: "invertible_mat (matrix_A_R signs subsets)"
  shows "(construct_lhs_vector_R p qs signs) = solve_for_lhs_R p qs subsets (matrix_A_R signs subsets)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. w_vec_R p qs signs = solve_for_lhs_R p qs subsets (M_mat_R signs subsets)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. w_vec_R p qs signs = solve_for_lhs_R p qs subsets (M_mat_R signs subsets)
[PROOF STEP]
have matrix_equation_hyp: "(mult_mat_vec (matrix_A_R signs subsets) (construct_lhs_vector_R p qs signs) = (construct_rhs_vector_R p qs subsets))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. M_mat_R signs subsets *\<^sub>v w_vec_R p qs signs = v_vec_R p qs subsets
[PROOF STEP]
using match
[PROOF STATE]
proof (prove)
using this:
satisfy_equation_R p qs subsets signs

goal (1 subgoal):
 1. M_mat_R signs subsets *\<^sub>v w_vec_R p qs signs = v_vec_R p qs subsets
[PROOF STEP]
unfolding satisfy_equation_R_def
[PROOF STATE]
proof (prove)
using this:
M_mat_R signs subsets *\<^sub>v w_vec_R p qs signs = v_vec_R p qs subsets

goal (1 subgoal):
 1. M_mat_R signs subsets *\<^sub>v w_vec_R p qs signs = v_vec_R p qs subsets
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
M_mat_R signs subsets *\<^sub>v w_vec_R p qs signs = v_vec_R p qs subsets

goal (1 subgoal):
 1. w_vec_R p qs signs = solve_for_lhs_R p qs subsets (M_mat_R signs subsets)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
M_mat_R signs subsets *\<^sub>v w_vec_R p qs signs = v_vec_R p qs subsets
[PROOF STEP]
have eqn_hyp: " ((matr_option (dim_row (matrix_A_R signs subsets))
     (mat_inverse (matrix_A_R signs subsets))) *\<^sub>v (mult_mat_vec (matrix_A_R signs subsets) (construct_lhs_vector_R p qs signs)) =
      mult_mat_vec (matr_option (dim_row (matrix_A_R signs subsets))
     (mat_inverse (matrix_A_R signs subsets))) (construct_rhs_vector_R p qs subsets))"
[PROOF STATE]
proof (prove)
using this:
M_mat_R signs subsets *\<^sub>v w_vec_R p qs signs = v_vec_R p qs subsets

goal (1 subgoal):
 1. matr_option (dim_row (M_mat_R signs subsets)) (mat_inverse (M_mat_R signs subsets)) *\<^sub>v (M_mat_R signs subsets *\<^sub>v w_vec_R p qs signs) = matr_option (dim_row (M_mat_R signs subsets)) (mat_inverse (M_mat_R signs subsets)) *\<^sub>v v_vec_R p qs subsets
[PROOF STEP]
using invertible_mat
[PROOF STATE]
proof (prove)
using this:
M_mat_R signs subsets *\<^sub>v w_vec_R p qs signs = v_vec_R p qs subsets
invertible_mat (M_mat_R signs subsets)

goal (1 subgoal):
 1. matr_option (dim_row (M_mat_R signs subsets)) (mat_inverse (M_mat_R signs subsets)) *\<^sub>v (M_mat_R signs subsets *\<^sub>v w_vec_R p qs signs) = matr_option (dim_row (M_mat_R signs subsets)) (mat_inverse (M_mat_R signs subsets)) *\<^sub>v v_vec_R p qs subsets
[PROOF STEP]
by (simp add: matrix_equation_hyp)
[PROOF STATE]
proof (state)
this:
matr_option (dim_row (M_mat_R signs subsets)) (mat_inverse (M_mat_R signs subsets)) *\<^sub>v (M_mat_R signs subsets *\<^sub>v w_vec_R p qs signs) = matr_option (dim_row (M_mat_R signs subsets)) (mat_inverse (M_mat_R signs subsets)) *\<^sub>v v_vec_R p qs subsets

goal (1 subgoal):
 1. w_vec_R p qs signs = solve_for_lhs_R p qs subsets (M_mat_R signs subsets)
[PROOF STEP]
have match_hyp: "length subsets = length signs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length subsets = length signs
[PROOF STEP]
using same_size_R invertible_mat
[PROOF STATE]
proof (prove)
using this:
invertible_mat (M_mat_R ?signs ?subsets) \<Longrightarrow> length ?subsets = length ?signs
invertible_mat (M_mat_R signs subsets)

goal (1 subgoal):
 1. length subsets = length signs
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
length subsets = length signs

goal (1 subgoal):
 1. w_vec_R p qs signs = solve_for_lhs_R p qs subsets (M_mat_R signs subsets)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
length subsets = length signs
[PROOF STEP]
have dim_hyp1: "matrix_A_R signs subsets \<in> carrier_mat (length signs) (length signs)"
[PROOF STATE]
proof (prove)
using this:
length subsets = length signs

goal (1 subgoal):
 1. M_mat_R signs subsets \<in> carrier_mat (length signs) (length signs)
[PROOF STEP]
using size_of_mat
[PROOF STATE]
proof (prove)
using this:
length subsets = length signs
M_mat ?signs ?subsets \<in> carrier_mat (length ?subsets) (length ?signs)

goal (1 subgoal):
 1. M_mat_R signs subsets \<in> carrier_mat (length signs) (length signs)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
M_mat_R signs subsets \<in> carrier_mat (length signs) (length signs)

goal (1 subgoal):
 1. w_vec_R p qs signs = solve_for_lhs_R p qs subsets (M_mat_R signs subsets)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
M_mat_R signs subsets \<in> carrier_mat (length signs) (length signs)
[PROOF STEP]
have dim_hyp2: "matr_option (dim_row (matrix_A_R signs subsets))
     (mat_inverse (matrix_A_R signs subsets)) \<in> carrier_mat (length signs) (length signs)"
[PROOF STATE]
proof (prove)
using this:
M_mat_R signs subsets \<in> carrier_mat (length signs) (length signs)

goal (1 subgoal):
 1. matr_option (dim_row (M_mat_R signs subsets)) (mat_inverse (M_mat_R signs subsets)) \<in> carrier_mat (length signs) (length signs)
[PROOF STEP]
using invertible_mat dim_invertible
[PROOF STATE]
proof (prove)
using this:
M_mat_R signs subsets \<in> carrier_mat (length signs) (length signs)
invertible_mat (M_mat_R signs subsets)
\<lbrakk>invertible_mat ?A; ?A \<in> carrier_mat ?n ?n\<rbrakk> \<Longrightarrow> matr_option (dim_row ?A) (mat_inverse ?A) \<in> carrier_mat ?n ?n

goal (1 subgoal):
 1. matr_option (dim_row (M_mat_R signs subsets)) (mat_inverse (M_mat_R signs subsets)) \<in> carrier_mat (length signs) (length signs)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
matr_option (dim_row (M_mat_R signs subsets)) (mat_inverse (M_mat_R signs subsets)) \<in> carrier_mat (length signs) (length signs)

goal (1 subgoal):
 1. w_vec_R p qs signs = solve_for_lhs_R p qs subsets (M_mat_R signs subsets)
[PROOF STEP]
have mult_assoc_hyp: "((matr_option (dim_row (matrix_A_R signs subsets))
     (mat_inverse (matrix_A_R signs subsets))) *\<^sub>v (mult_mat_vec (matrix_A_R signs subsets) (construct_lhs_vector_R p qs signs)))
    = (((matr_option (dim_row (matrix_A_R signs subsets))
     (mat_inverse (matrix_A_R signs subsets))) * (matrix_A_R signs subsets)) *\<^sub>v  (construct_lhs_vector_R p qs signs))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. matr_option (dim_row (M_mat_R signs subsets)) (mat_inverse (M_mat_R signs subsets)) *\<^sub>v (M_mat_R signs subsets *\<^sub>v w_vec_R p qs signs) = matr_option (dim_row (M_mat_R signs subsets)) (mat_inverse (M_mat_R signs subsets)) * M_mat_R signs subsets *\<^sub>v w_vec_R p qs signs
[PROOF STEP]
using mult_assoc dim_hyp1 dim_hyp2 size_of_lhs_R
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?A \<in> carrier_mat ?n ?n; ?B \<in> carrier_mat ?n ?n; dim_vec ?v = ?n\<rbrakk> \<Longrightarrow> ?A *\<^sub>v (?B *\<^sub>v ?v) = ?A * ?B *\<^sub>v ?v
M_mat_R signs subsets \<in> carrier_mat (length signs) (length signs)
matr_option (dim_row (M_mat_R signs subsets)) (mat_inverse (M_mat_R signs subsets)) \<in> carrier_mat (length signs) (length signs)
dim_vec (w_vec_R ?p ?qs ?signs) = length ?signs

goal (1 subgoal):
 1. matr_option (dim_row (M_mat_R signs subsets)) (mat_inverse (M_mat_R signs subsets)) *\<^sub>v (M_mat_R signs subsets *\<^sub>v w_vec_R p qs signs) = matr_option (dim_row (M_mat_R signs subsets)) (mat_inverse (M_mat_R signs subsets)) * M_mat_R signs subsets *\<^sub>v w_vec_R p qs signs
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
matr_option (dim_row (M_mat_R signs subsets)) (mat_inverse (M_mat_R signs subsets)) *\<^sub>v (M_mat_R signs subsets *\<^sub>v w_vec_R p qs signs) = matr_option (dim_row (M_mat_R signs subsets)) (mat_inverse (M_mat_R signs subsets)) * M_mat_R signs subsets *\<^sub>v w_vec_R p qs signs

goal (1 subgoal):
 1. w_vec_R p qs signs = solve_for_lhs_R p qs subsets (M_mat_R signs subsets)
[PROOF STEP]
have cancel_helper: "(((matr_option (dim_row (matrix_A_R signs subsets))
     (mat_inverse (matrix_A_R signs subsets))) * (matrix_A_R signs subsets)) *\<^sub>v  (construct_lhs_vector_R p qs signs))
  = (1\<^sub>m (length signs)) *\<^sub>v   (construct_lhs_vector_R p qs signs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. matr_option (dim_row (M_mat_R signs subsets)) (mat_inverse (M_mat_R signs subsets)) * M_mat_R signs subsets *\<^sub>v w_vec_R p qs signs = 1\<^sub>m (length signs) *\<^sub>v w_vec_R p qs signs
[PROOF STEP]
using invertible_means_mult_id[where A= "matrix_A_R signs subsets"] dim_hyp1
[PROOF STATE]
proof (prove)
using this:
invertible_mat (M_mat_R signs subsets) \<Longrightarrow> matr_option (dim_row (M_mat_R signs subsets)) (mat_inverse (M_mat_R signs subsets)) * M_mat_R signs subsets = 1\<^sub>m (dim_row (M_mat_R signs subsets))
M_mat_R signs subsets \<in> carrier_mat (length signs) (length signs)

goal (1 subgoal):
 1. matr_option (dim_row (M_mat_R signs subsets)) (mat_inverse (M_mat_R signs subsets)) * M_mat_R signs subsets *\<^sub>v w_vec_R p qs signs = 1\<^sub>m (length signs) *\<^sub>v w_vec_R p qs signs
[PROOF STEP]
by (simp add: invertible_mat match_hyp)
[PROOF STATE]
proof (state)
this:
matr_option (dim_row (M_mat_R signs subsets)) (mat_inverse (M_mat_R signs subsets)) * M_mat_R signs subsets *\<^sub>v w_vec_R p qs signs = 1\<^sub>m (length signs) *\<^sub>v w_vec_R p qs signs

goal (1 subgoal):
 1. w_vec_R p qs signs = solve_for_lhs_R p qs subsets (M_mat_R signs subsets)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
matr_option (dim_row (M_mat_R signs subsets)) (mat_inverse (M_mat_R signs subsets)) * M_mat_R signs subsets *\<^sub>v w_vec_R p qs signs = 1\<^sub>m (length signs) *\<^sub>v w_vec_R p qs signs
[PROOF STEP]
have cancel_hyp: "(((matr_option (dim_row (matrix_A_R signs subsets))
     (mat_inverse (matrix_A_R signs subsets))) * (matrix_A_R signs subsets)) *\<^sub>v  (construct_lhs_vector_R p qs signs))
  = (construct_lhs_vector_R p qs signs)"
[PROOF STATE]
proof (prove)
using this:
matr_option (dim_row (M_mat_R signs subsets)) (mat_inverse (M_mat_R signs subsets)) * M_mat_R signs subsets *\<^sub>v w_vec_R p qs signs = 1\<^sub>m (length signs) *\<^sub>v w_vec_R p qs signs

goal (1 subgoal):
 1. matr_option (dim_row (M_mat_R signs subsets)) (mat_inverse (M_mat_R signs subsets)) * M_mat_R signs subsets *\<^sub>v w_vec_R p qs signs = w_vec_R p qs signs
[PROOF STEP]
apply (auto)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. matr_option (length subsets) (mat_inverse (M_mat_R signs subsets)) * M_mat_R signs subsets *\<^sub>v w_vec_R p qs signs = 1\<^sub>m (length signs) *\<^sub>v w_vec_R p qs signs \<Longrightarrow> 1\<^sub>m (length signs) *\<^sub>v w_vec_R p qs signs = w_vec_R p qs signs
[PROOF STEP]
by (metis carrier_vec_dim_vec one_mult_mat_vec size_of_lhs_R)
[PROOF STATE]
proof (state)
this:
matr_option (dim_row (M_mat_R signs subsets)) (mat_inverse (M_mat_R signs subsets)) * M_mat_R signs subsets *\<^sub>v w_vec_R p qs signs = w_vec_R p qs signs

goal (1 subgoal):
 1. w_vec_R p qs signs = solve_for_lhs_R p qs subsets (M_mat_R signs subsets)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
matr_option (dim_row (M_mat_R signs subsets)) (mat_inverse (M_mat_R signs subsets)) * M_mat_R signs subsets *\<^sub>v w_vec_R p qs signs = w_vec_R p qs signs
[PROOF STEP]
have mult_hyp: "((matr_option (dim_row (matrix_A_R signs subsets))
     (mat_inverse (matrix_A_R signs subsets))) *\<^sub>v (mult_mat_vec (matrix_A_R signs subsets) (construct_lhs_vector_R p qs signs)))
    = (construct_lhs_vector_R p qs signs)"
[PROOF STATE]
proof (prove)
using this:
matr_option (dim_row (M_mat_R signs subsets)) (mat_inverse (M_mat_R signs subsets)) * M_mat_R signs subsets *\<^sub>v w_vec_R p qs signs = w_vec_R p qs signs

goal (1 subgoal):
 1. matr_option (dim_row (M_mat_R signs subsets)) (mat_inverse (M_mat_R signs subsets)) *\<^sub>v (M_mat_R signs subsets *\<^sub>v w_vec_R p qs signs) = w_vec_R p qs signs
[PROOF STEP]
using mult_assoc_hyp cancel_hyp
[PROOF STATE]
proof (prove)
using this:
matr_option (dim_row (M_mat_R signs subsets)) (mat_inverse (M_mat_R signs subsets)) * M_mat_R signs subsets *\<^sub>v w_vec_R p qs signs = w_vec_R p qs signs
matr_option (dim_row (M_mat_R signs subsets)) (mat_inverse (M_mat_R signs subsets)) *\<^sub>v (M_mat_R signs subsets *\<^sub>v w_vec_R p qs signs) = matr_option (dim_row (M_mat_R signs subsets)) (mat_inverse (M_mat_R signs subsets)) * M_mat_R signs subsets *\<^sub>v w_vec_R p qs signs
matr_option (dim_row (M_mat_R signs subsets)) (mat_inverse (M_mat_R signs subsets)) * M_mat_R signs subsets *\<^sub>v w_vec_R p qs signs = w_vec_R p qs signs

goal (1 subgoal):
 1. matr_option (dim_row (M_mat_R signs subsets)) (mat_inverse (M_mat_R signs subsets)) *\<^sub>v (M_mat_R signs subsets *\<^sub>v w_vec_R p qs signs) = w_vec_R p qs signs
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
matr_option (dim_row (M_mat_R signs subsets)) (mat_inverse (M_mat_R signs subsets)) *\<^sub>v (M_mat_R signs subsets *\<^sub>v w_vec_R p qs signs) = w_vec_R p qs signs

goal (1 subgoal):
 1. w_vec_R p qs signs = solve_for_lhs_R p qs subsets (M_mat_R signs subsets)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
matr_option (dim_row (M_mat_R signs subsets)) (mat_inverse (M_mat_R signs subsets)) *\<^sub>v (M_mat_R signs subsets *\<^sub>v w_vec_R p qs signs) = w_vec_R p qs signs
[PROOF STEP]
have "(construct_lhs_vector_R p qs signs) =  (mult_mat_vec (matr_option (dim_row (matrix_A_R signs subsets))
     (mat_inverse (matrix_A_R signs subsets))) (construct_rhs_vector_R p qs subsets)) "
[PROOF STATE]
proof (prove)
using this:
matr_option (dim_row (M_mat_R signs subsets)) (mat_inverse (M_mat_R signs subsets)) *\<^sub>v (M_mat_R signs subsets *\<^sub>v w_vec_R p qs signs) = w_vec_R p qs signs

goal (1 subgoal):
 1. w_vec_R p qs signs = matr_option (dim_row (M_mat_R signs subsets)) (mat_inverse (M_mat_R signs subsets)) *\<^sub>v v_vec_R p qs subsets
[PROOF STEP]
using eqn_hyp
[PROOF STATE]
proof (prove)
using this:
matr_option (dim_row (M_mat_R signs subsets)) (mat_inverse (M_mat_R signs subsets)) *\<^sub>v (M_mat_R signs subsets *\<^sub>v w_vec_R p qs signs) = w_vec_R p qs signs
matr_option (dim_row (M_mat_R signs subsets)) (mat_inverse (M_mat_R signs subsets)) *\<^sub>v (M_mat_R signs subsets *\<^sub>v w_vec_R p qs signs) = matr_option (dim_row (M_mat_R signs subsets)) (mat_inverse (M_mat_R signs subsets)) *\<^sub>v v_vec_R p qs subsets

goal (1 subgoal):
 1. w_vec_R p qs signs = matr_option (dim_row (M_mat_R signs subsets)) (mat_inverse (M_mat_R signs subsets)) *\<^sub>v v_vec_R p qs subsets
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
w_vec_R p qs signs = matr_option (dim_row (M_mat_R signs subsets)) (mat_inverse (M_mat_R signs subsets)) *\<^sub>v v_vec_R p qs subsets

goal (1 subgoal):
 1. w_vec_R p qs signs = solve_for_lhs_R p qs subsets (M_mat_R signs subsets)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
w_vec_R p qs signs = matr_option (dim_row (M_mat_R signs subsets)) (mat_inverse (M_mat_R signs subsets)) *\<^sub>v v_vec_R p qs subsets
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
w_vec_R p qs signs = matr_option (dim_row (M_mat_R signs subsets)) (mat_inverse (M_mat_R signs subsets)) *\<^sub>v v_vec_R p qs subsets

goal (1 subgoal):
 1. w_vec_R p qs signs = solve_for_lhs_R p qs subsets (M_mat_R signs subsets)
[PROOF STEP]
unfolding solve_for_lhs_R_def
[PROOF STATE]
proof (prove)
using this:
w_vec_R p qs signs = matr_option (dim_row (M_mat_R signs subsets)) (mat_inverse (M_mat_R signs subsets)) *\<^sub>v v_vec_R p qs subsets

goal (1 subgoal):
 1. w_vec_R p qs signs = matr_option (dim_row (M_mat_R signs subsets)) (mat_inverse_var (M_mat_R signs subsets)) *\<^sub>v v_vec_R p qs subsets
[PROOF STEP]
by (simp add: mat_inverse_same)
[PROOF STATE]
proof (state)
this:
w_vec_R p qs signs = solve_for_lhs_R p qs subsets (M_mat_R signs subsets)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma abs_sin_le_one [simp]: "\<bar>sin x\<bar> \<le> 1"
  for x :: real
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>sin x\<bar> \<le> 1
[PROOF STEP]
by (rule power2_le_imp_le) (simp_all add: sin_squared_eq)


[STATEMENT]
lemma lsorted_closure: "{xs. lsorted xs} = closure {xs. lfinite xs \<and> lsorted xs}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {xs. lsorted xs} = closure {xs. lfinite xs \<and> lsorted xs}
[PROOF STEP]
by (rule closure_eq_lfinite[OF closed_lsorted lsorted_lprefixD])


[STATEMENT]
lemma experiment0_7: "pmf twocoins True = 0.7"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pmf twocoins True = 7 / 10
[PROOF STEP]
unfolding twocoins_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pmf (bernoulli_pmf (4 / 10) \<bind> (\<lambda>x. bernoulli_pmf (5 / 10) \<bind> (\<lambda>y. return_pmf (x \<or> y)))) True = 7 / 10
[PROOF STEP]
unfolding pmf_bind pmf_return
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. measure_pmf.expectation (bernoulli_pmf (4 / 10)) (\<lambda>x. measure_pmf.expectation (bernoulli_pmf (5 / 10)) (\<lambda>xa. indicat_real {True} (x \<or> xa))) = 7 / 10
[PROOF STEP]
apply (subst integral_measure_pmf[where A="{True, False}"])
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. finite {True, False}
 2. \<And>a. \<lbrakk>a \<in> set_pmf (bernoulli_pmf (4 / 10)); measure_pmf.expectation (bernoulli_pmf (5 / 10)) (\<lambda>x. indicat_real {True} (a \<or> x)) \<noteq> 0\<rbrakk> \<Longrightarrow> a \<in> {True, False}
 3. (\<Sum>a\<in>{True, False}. pmf (bernoulli_pmf (4 / 10)) a *\<^sub>R measure_pmf.expectation (bernoulli_pmf (5 / 10)) (\<lambda>x. indicat_real {True} (a \<or> x))) = 7 / 10
[PROOF STEP]
by auto


[STATEMENT]
lemma upper_bounded_bigger:
  assumes "upper_bounded \<pi> a"
      and "pgte b a"
    shows "upper_bounded \<pi> b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. upper_bounded \<pi> b
[PROOF STEP]
by (meson assms(1) assms(2) order_trans pgte.rep_eq upper_bounded_def)


[STATEMENT]
lemma max_ipv4_addr_number: "max_ipv4_addr = 4294967295"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. max_ipv4_addr = 4294967295
[PROOF STEP]
unfolding max_ipv4_addr_def ipv4addr_of_nat_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. word_of_nat (2 ^ 32 - 1) = 4294967295
[PROOF STEP]
by(simp)


[STATEMENT]
lemma UNIV_3: "UNIV = {1::3, 2::3, 3::3}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. UNIV = {1, 2, 3}
[PROOF STEP]
using exhaust_3
[PROOF STATE]
proof (prove)
using this:
?x = 1 \<or> ?x = 2 \<or> ?x = 3

goal (1 subgoal):
 1. UNIV = {1, 2, 3}
[PROOF STEP]
by auto


[STATEMENT]
lemma finite_int_segment:
  fixes a :: "'a::floor_ceiling"
  shows "finite {x \<in> \<int>. a \<le> x \<and> x \<le> b}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {x \<in> \<int>. a \<le> x \<and> x \<le> b}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. finite {x \<in> \<int>. a \<le> x \<and> x \<le> b}
[PROOF STEP]
have "finite {ceiling a..floor b}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {\<lceil>a\<rceil>..\<lfloor>b\<rfloor>}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
finite {\<lceil>a\<rceil>..\<lfloor>b\<rfloor>}

goal (1 subgoal):
 1. finite {x \<in> \<int>. a \<le> x \<and> x \<le> b}
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
finite {\<lceil>a\<rceil>..\<lfloor>b\<rfloor>}

goal (1 subgoal):
 1. finite {x \<in> \<int>. a \<le> x \<and> x \<le> b}
[PROOF STEP]
have "{x \<in> \<int>. a \<le> x \<and> x \<le> b} = of_int ` {ceiling a..floor b}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {x \<in> \<int>. a \<le> x \<and> x \<le> b} = of_int ` {\<lceil>a\<rceil>..\<lfloor>b\<rfloor>}
[PROOF STEP]
by (auto simp: le_floor_iff ceiling_le_iff elim!: Ints_cases)
[PROOF STATE]
proof (state)
this:
{x \<in> \<int>. a \<le> x \<and> x \<le> b} = of_int ` {\<lceil>a\<rceil>..\<lfloor>b\<rfloor>}

goal (1 subgoal):
 1. finite {x \<in> \<int>. a \<le> x \<and> x \<le> b}
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
finite {\<lceil>a\<rceil>..\<lfloor>b\<rfloor>}
{x \<in> \<int>. a \<le> x \<and> x \<le> b} = of_int ` {\<lceil>a\<rceil>..\<lfloor>b\<rfloor>}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
finite {\<lceil>a\<rceil>..\<lfloor>b\<rfloor>}
{x \<in> \<int>. a \<le> x \<and> x \<le> b} = of_int ` {\<lceil>a\<rceil>..\<lfloor>b\<rfloor>}

goal (1 subgoal):
 1. finite {x \<in> \<int>. a \<le> x \<and> x \<le> b}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
finite {x \<in> \<int>. a \<le> x \<and> x \<le> b}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma card_vimage_inj_on:
  assumes "inj_on f B"
  assumes "A \<subseteq> f ` B"
  shows "card (f -` A \<inter> B) = card A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (f -` A \<inter> B) = card A
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. card (f -` A \<inter> B) = card A
[PROOF STEP]
have "A = f ` (f -` A \<inter> B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A = f ` (f -` A \<inter> B)
[PROOF STEP]
using assms(2)
[PROOF STATE]
proof (prove)
using this:
A \<subseteq> f ` B

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

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

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

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma fls_left_inverse_delta:
  fixes   b :: "'a::{ab_group_add,mult_zero}"
  assumes "b \<noteq> 0"
  shows   "fls_left_inverse (Abs_fls (\<lambda>n. if n=a then b else 0)) x =
            Abs_fls (\<lambda>n. if n=-a then x else 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fls_left_inverse (Abs_fls (\<lambda>n. if n = a then b else (0::'a))) x = Abs_fls (\<lambda>n. if n = - a then x else (0::'a))
[PROOF STEP]
proof (intro fls_eqI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>xa. fls_left_inverse (Abs_fls (\<lambda>n. if n = a then b else (0::'a))) x $$ xa = Abs_fls (\<lambda>n. if n = - a then x else (0::'a)) $$ xa
[PROOF STEP]
fix n
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>xa. fls_left_inverse (Abs_fls (\<lambda>n. if n = a then b else (0::'a))) x $$ xa = Abs_fls (\<lambda>n. if n = - a then x else (0::'a)) $$ xa
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
b \<noteq> (0::'a)
[PROOF STEP]
show
    "fls_left_inverse (Abs_fls (\<lambda>n. if n=a then b else 0)) x $$ n
      = Abs_fls (\<lambda>n. if n = - a then x else 0) $$ n"
[PROOF STATE]
proof (prove)
using this:
b \<noteq> (0::'a)

goal (1 subgoal):
 1. fls_left_inverse (Abs_fls (\<lambda>n. if n = a then b else (0::'a))) x $$ n = Abs_fls (\<lambda>n. if n = - a then x else (0::'a)) $$ n
[PROOF STEP]
using fls_base_factor_to_fps_delta[of a b]
          fls_lr_inverse_const(1)[of b]
          fls_shift_const
[PROOF STATE]
proof (prove)
using this:
b \<noteq> (0::'a)
fls_base_factor_to_fps (Abs_fls (\<lambda>n. if n = a then b else (0::'a))) = fps_const b
fls_left_inverse (fls_const b) ?x = fls_const ?x
fls_shift ?m (fls_const ?c) = Abs_fls (\<lambda>n. if n = - ?m then ?c else (0::?'a))

goal (1 subgoal):
 1. fls_left_inverse (Abs_fls (\<lambda>n. if n = a then b else (0::'a))) x $$ n = Abs_fls (\<lambda>n. if n = - a then x else (0::'a)) $$ n
[PROOF STEP]
by    simp
[PROOF STATE]
proof (state)
this:
fls_left_inverse (Abs_fls (\<lambda>n. if n = a then b else (0::'a))) x $$ n = Abs_fls (\<lambda>n. if n = - a then x else (0::'a)) $$ n

goal:
No subgoals!
[PROOF STEP]
qed