[STATEMENT]
theorem wls_vsubstAbs_commute:
assumes "wlsAbs (us,s) A"
and "xs \<noteq> xs' \<or> {x,y} \<inter> {x',y'} = {}" and "freshAbs xs x A" and "freshAbs xs' x' A"
shows "((A $[x // y]_xs) $[x' // y']_xs') = ((A $[x' // y']_xs') $[x // y]_xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A $[x // y]_xs $[x' // y']_xs' = A $[x' // y']_xs' $[x // y]_xs
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. A $[x // y]_xs $[x' // y']_xs' = A $[x' // y']_xs' $[x // y]_xs
[PROOF STEP]
have "freshAbs xs' x' (A $[x // y]_xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. freshAbs xs' x' (A $[x // y]_xs)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
wlsAbs (us, s) A
xs \<noteq> xs' \<or> {x, y} \<inter> {x', y'} = {}
freshAbs xs x A
freshAbs xs' x' A

goal (1 subgoal):
 1. freshAbs xs' x' (A $[x // y]_xs)
[PROOF STEP]
by(auto simp: vsubstAbs_preserves_freshAbs)
[PROOF STATE]
proof (state)
this:
freshAbs xs' x' (A $[x // y]_xs)

goal (1 subgoal):
 1. A $[x // y]_xs $[x' // y']_xs' = A $[x' // y']_xs' $[x // y]_xs
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
freshAbs xs' x' (A $[x // y]_xs)

goal (1 subgoal):
 1. A $[x // y]_xs $[x' // y']_xs' = A $[x' // y']_xs' $[x // y]_xs
[PROOF STEP]
have "freshAbs xs x (A $[x' // y']_xs')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. freshAbs xs x (A $[x' // y']_xs')
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
wlsAbs (us, s) A
xs \<noteq> xs' \<or> {x, y} \<inter> {x', y'} = {}
freshAbs xs x A
freshAbs xs' x' A

goal (1 subgoal):
 1. freshAbs xs x (A $[x' // y']_xs')
[PROOF STEP]
by(auto simp: vsubstAbs_preserves_freshAbs)
[PROOF STATE]
proof (state)
this:
freshAbs xs x (A $[x' // y']_xs')

goal (1 subgoal):
 1. A $[x // y]_xs $[x' // y']_xs' = A $[x' // y']_xs' $[x // y]_xs
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
freshAbs xs' x' (A $[x // y]_xs)
freshAbs xs x (A $[x' // y']_xs')
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
freshAbs xs' x' (A $[x // y]_xs)
freshAbs xs x (A $[x' // y']_xs')

goal (1 subgoal):
 1. A $[x // y]_xs $[x' // y']_xs' = A $[x' // y']_xs' $[x // y]_xs
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
freshAbs xs' x' (A $[x // y]_xs)
freshAbs xs x (A $[x' // y']_xs')
wlsAbs (us, s) A
xs \<noteq> xs' \<or> {x, y} \<inter> {x', y'} = {}
freshAbs xs x A
freshAbs xs' x' A

goal (1 subgoal):
 1. A $[x // y]_xs $[x' // y']_xs' = A $[x' // y']_xs' $[x // y]_xs
[PROOF STEP]
by (auto simp: vsubstAbs_eq_swapAbs intro!: wls_swapAbs_commute)
[PROOF STATE]
proof (state)
this:
A $[x // y]_xs $[x' // y']_xs' = A $[x' // y']_xs' $[x // y]_xs

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma multiplicity_eq_Max: "multiplicity p x = Max {n. p ^ n dvd x}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. multiplicity p x = Max {n. p ^ n dvd x}
[PROOF STEP]
using finite_divisor_powers[OF xp]
[PROOF STATE]
proof (prove)
using this:
finite {n. p ^ n dvd x}

goal (1 subgoal):
 1. multiplicity p x = Max {n. p ^ n dvd x}
[PROOF STEP]
by (simp add: multiplicity_def)


[STATEMENT]
lemma measure_preserving_composition:
  assumes "f \<in> measure_preserving M N"
          "g \<in> measure_preserving N P"
  shows "(\<lambda>x. g(f x)) \<in> measure_preserving M P"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. g (f x)) \<in> measure_preserving M P
[PROOF STEP]
proof (rule measure_preservingI)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (\<lambda>x. g (f x)) \<in> M \<rightarrow>\<^sub>M P
 2. \<And>A. A \<in> sets P \<Longrightarrow> emeasure M ((\<lambda>x. g (f x)) -` A \<inter> space M) = emeasure P A
[PROOF STEP]
have f [measurable]: "f \<in> measurable M N"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<in> M \<rightarrow>\<^sub>M N
[PROOF STEP]
by (rule measure_preservingE(1)[OF assms(1)])
[PROOF STATE]
proof (state)
this:
f \<in> M \<rightarrow>\<^sub>M N

goal (2 subgoals):
 1. (\<lambda>x. g (f x)) \<in> M \<rightarrow>\<^sub>M P
 2. \<And>A. A \<in> sets P \<Longrightarrow> emeasure M ((\<lambda>x. g (f x)) -` A \<inter> space M) = emeasure P A
[PROOF STEP]
have g [measurable]: "g \<in> measurable N P"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. g \<in> N \<rightarrow>\<^sub>M P
[PROOF STEP]
by (rule measure_preservingE(1)[OF assms(2)])
[PROOF STATE]
proof (state)
this:
g \<in> N \<rightarrow>\<^sub>M P

goal (2 subgoals):
 1. (\<lambda>x. g (f x)) \<in> M \<rightarrow>\<^sub>M P
 2. \<And>A. A \<in> sets P \<Longrightarrow> emeasure M ((\<lambda>x. g (f x)) -` A \<inter> space M) = emeasure P A
[PROOF STEP]
show [measurable]: "(\<lambda>x. g (f x)) \<in> measurable M P"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. g (f x)) \<in> M \<rightarrow>\<^sub>M P
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<lambda>x. g (f x)) \<in> M \<rightarrow>\<^sub>M P

goal (1 subgoal):
 1. \<And>A. A \<in> sets P \<Longrightarrow> emeasure M ((\<lambda>x. g (f x)) -` A \<inter> space M) = emeasure P A
[PROOF STEP]
fix C
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>A. A \<in> sets P \<Longrightarrow> emeasure M ((\<lambda>x. g (f x)) -` A \<inter> space M) = emeasure P A
[PROOF STEP]
assume [measurable]: "C \<in> sets P"
[PROOF STATE]
proof (state)
this:
C \<in> sets P

goal (1 subgoal):
 1. \<And>A. A \<in> sets P \<Longrightarrow> emeasure M ((\<lambda>x. g (f x)) -` A \<inter> space M) = emeasure P A
[PROOF STEP]
define B where "B = g-`C \<inter> space N"
[PROOF STATE]
proof (state)
this:
B = g -` C \<inter> space N

goal (1 subgoal):
 1. \<And>A. A \<in> sets P \<Longrightarrow> emeasure M ((\<lambda>x. g (f x)) -` A \<inter> space M) = emeasure P A
[PROOF STEP]
have [measurable]: "B \<in> sets N"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. B \<in> sets N
[PROOF STEP]
unfolding B_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. g -` C \<inter> space N \<in> sets N
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
B \<in> sets N

goal (1 subgoal):
 1. \<And>A. A \<in> sets P \<Longrightarrow> emeasure M ((\<lambda>x. g (f x)) -` A \<inter> space M) = emeasure P A
[PROOF STEP]
have *: "emeasure N B = emeasure P C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. emeasure N B = emeasure P C
[PROOF STEP]
unfolding B_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. emeasure N (g -` C \<inter> space N) = emeasure P C
[PROOF STEP]
using measure_preservingE(2)[OF assms(2)]
[PROOF STATE]
proof (prove)
using this:
?A \<in> sets P \<Longrightarrow> emeasure N (g -` ?A \<inter> space N) = emeasure P ?A

goal (1 subgoal):
 1. emeasure N (g -` C \<inter> space N) = emeasure P C
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
emeasure N B = emeasure P C

goal (1 subgoal):
 1. \<And>A. A \<in> sets P \<Longrightarrow> emeasure M ((\<lambda>x. g (f x)) -` A \<inter> space M) = emeasure P A
[PROOF STEP]
define A where "A = f-`B \<inter> space M"
[PROOF STATE]
proof (state)
this:
A = f -` B \<inter> space M

goal (1 subgoal):
 1. \<And>A. A \<in> sets P \<Longrightarrow> emeasure M ((\<lambda>x. g (f x)) -` A \<inter> space M) = emeasure P A
[PROOF STEP]
have [measurable]: "A \<in> sets M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<in> sets M
[PROOF STEP]
unfolding A_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f -` B \<inter> space M \<in> sets M
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
A \<in> sets M

goal (1 subgoal):
 1. \<And>A. A \<in> sets P \<Longrightarrow> emeasure M ((\<lambda>x. g (f x)) -` A \<inter> space M) = emeasure P A
[PROOF STEP]
have "emeasure M A = emeasure N B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. emeasure M A = emeasure N B
[PROOF STEP]
unfolding A_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. emeasure M (f -` B \<inter> space M) = emeasure N B
[PROOF STEP]
using measure_preservingE(2)[OF assms(1)]
[PROOF STATE]
proof (prove)
using this:
?A \<in> sets N \<Longrightarrow> emeasure M (f -` ?A \<inter> space M) = emeasure N ?A

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

goal (1 subgoal):
 1. \<And>A. A \<in> sets P \<Longrightarrow> emeasure M ((\<lambda>x. g (f x)) -` A \<inter> space M) = emeasure P A
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
emeasure M A = emeasure N B
[PROOF STEP]
have "emeasure M A = emeasure P C"
[PROOF STATE]
proof (prove)
using this:
emeasure M A = emeasure N B

goal (1 subgoal):
 1. emeasure M A = emeasure P C
[PROOF STEP]
using *
[PROOF STATE]
proof (prove)
using this:
emeasure M A = emeasure N B
emeasure N B = emeasure P C

goal (1 subgoal):
 1. emeasure M A = emeasure P C
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
emeasure M A = emeasure P C

goal (1 subgoal):
 1. \<And>A. A \<in> sets P \<Longrightarrow> emeasure M ((\<lambda>x. g (f x)) -` A \<inter> space M) = emeasure P A
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
emeasure M A = emeasure P C

goal (1 subgoal):
 1. \<And>A. A \<in> sets P \<Longrightarrow> emeasure M ((\<lambda>x. g (f x)) -` A \<inter> space M) = emeasure P A
[PROOF STEP]
have "A = (\<lambda>x. g(f x))-`C \<inter> space M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A = (\<lambda>x. g (f x)) -` C \<inter> space M
[PROOF STEP]
by (auto simp add: A_def B_def) (meson f measurable_space)
[PROOF STATE]
proof (state)
this:
A = (\<lambda>x. g (f x)) -` C \<inter> space M

goal (1 subgoal):
 1. \<And>A. A \<in> sets P \<Longrightarrow> emeasure M ((\<lambda>x. g (f x)) -` A \<inter> space M) = emeasure P A
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
emeasure M A = emeasure P C
A = (\<lambda>x. g (f x)) -` C \<inter> space M
[PROOF STEP]
show "emeasure M ((\<lambda>x. g(f x))-`C \<inter> space M) = emeasure P C"
[PROOF STATE]
proof (prove)
using this:
emeasure M A = emeasure P C
A = (\<lambda>x. g (f x)) -` C \<inter> space M

goal (1 subgoal):
 1. emeasure M ((\<lambda>x. g (f x)) -` C \<inter> space M) = emeasure P C
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
emeasure M ((\<lambda>x. g (f x)) -` C \<inter> space M) = emeasure P C

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma cospoly_ub_imp_sinpoly_ub:
  assumes x0: "0 \<le> x" and k0: "k>0" and "\<And>x. 0 \<le> x \<Longrightarrow> cos x \<le> cospoly (k - 1) x"
    shows "sin x \<le> sinpoly k x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sin x \<le> sinpoly k x
[PROOF STEP]
apply (rule gen_lower_bound_increasing [OF x0])
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>y. \<lbrakk>0 \<le> y; y \<le> x\<rbrakk> \<Longrightarrow> ((\<lambda>x. sin x - sinpoly k x) has_real_derivative ?g y) (at y)
 2. \<And>y. \<lbrakk>0 \<le> y; y \<le> x\<rbrakk> \<Longrightarrow> ?g y \<le> 0
 3. sin 0 = sinpoly k 0
[PROOF STEP]
apply (intro derivative_eq_intros | simp)+
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<And>y. \<lbrakk>0 \<le> y; y \<le> x\<rbrakk> \<Longrightarrow> (sinpoly k has_real_derivative ?g'5 y) (at y)
 2. \<And>y. \<lbrakk>0 \<le> y; y \<le> x\<rbrakk> \<Longrightarrow> cos y - ?g'5 y = ?g y
 3. \<And>y. \<lbrakk>0 \<le> y; y \<le> x\<rbrakk> \<Longrightarrow> ?g y \<le> 0
 4. sin 0 = sinpoly k 0
[PROOF STEP]
using d_sinpoly_cospoly [of "k - 1"] assms
[PROOF STATE]
proof (prove)
using this:
(sinpoly (Suc (k - 1)) has_real_derivative cospoly (k - 1) ?x) (at ?x)
0 \<le> x
0 < k
0 \<le> ?x \<Longrightarrow> cos ?x \<le> cospoly (k - 1) ?x

goal (4 subgoals):
 1. \<And>y. \<lbrakk>0 \<le> y; y \<le> x\<rbrakk> \<Longrightarrow> (sinpoly k has_real_derivative ?g'5 y) (at y)
 2. \<And>y. \<lbrakk>0 \<le> y; y \<le> x\<rbrakk> \<Longrightarrow> cos y - ?g'5 y = ?g y
 3. \<And>y. \<lbrakk>0 \<le> y; y \<le> x\<rbrakk> \<Longrightarrow> ?g y \<le> 0
 4. sin 0 = sinpoly k 0
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<And>x. (sinpoly k has_real_derivative cospoly (k - Suc 0) x) (at x); 0 \<le> x; 0 < k; \<And>x. 0 \<le> x \<Longrightarrow> cos x \<le> cospoly (k - Suc 0) x\<rbrakk> \<Longrightarrow> sinpoly k 0 = 0
[PROOF STEP]
apply (simp add: sinpoly_def)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma floor_diff_numeral [simp]: "\<lfloor>x - numeral v\<rfloor> = \<lfloor>x\<rfloor> - numeral v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lfloor>x - numeral v\<rfloor> = \<lfloor>x\<rfloor> - numeral v
[PROOF STEP]
using floor_diff_of_int [of x "numeral v"]
[PROOF STATE]
proof (prove)
using this:
\<lfloor>x - of_int (numeral v)\<rfloor> = \<lfloor>x\<rfloor> - numeral v

goal (1 subgoal):
 1. \<lfloor>x - numeral v\<rfloor> = \<lfloor>x\<rfloor> - numeral v
[PROOF STEP]
by simp


[STATEMENT]
lemma [code]:
  "Gcd\<^sub>f\<^sub>i\<^sub>n (Set t) = fold_keys gcd t (0::'a::{semiring_gcd, linorder})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Gcd\<^sub>f\<^sub>i\<^sub>n (Set t) = fold_keys gcd t (0::'a)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Gcd\<^sub>f\<^sub>i\<^sub>n (Set t) = fold_keys gcd t (0::'a)
[PROOF STEP]
have "comp_fun_commute (gcd :: 'a \<Rightarrow> _)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. comp_fun_commute gcd
[PROOF STEP]
by standard (simp add: fun_eq_iff ac_simps)
[PROOF STATE]
proof (state)
this:
comp_fun_commute gcd

goal (1 subgoal):
 1. Gcd\<^sub>f\<^sub>i\<^sub>n (Set t) = fold_keys gcd t (0::'a)
[PROOF STEP]
with finite_fold_fold_keys [of _ 0 t]
[PROOF STATE]
proof (chain)
picking this:
comp_fun_commute ?f \<Longrightarrow> Finite_Set.fold ?f (0::?'b1) (Set t) = fold_keys ?f t (0::?'b1)
comp_fun_commute gcd
[PROOF STEP]
have "Finite_Set.fold gcd 0 (Set t) = fold_keys gcd t 0"
[PROOF STATE]
proof (prove)
using this:
comp_fun_commute ?f \<Longrightarrow> Finite_Set.fold ?f (0::?'b1) (Set t) = fold_keys ?f t (0::?'b1)
comp_fun_commute gcd

goal (1 subgoal):
 1. Finite_Set.fold gcd (0::'a) (Set t) = fold_keys gcd t (0::'a)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
Finite_Set.fold gcd (0::'a) (Set t) = fold_keys gcd t (0::'a)

goal (1 subgoal):
 1. Gcd\<^sub>f\<^sub>i\<^sub>n (Set t) = fold_keys gcd t (0::'a)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
Finite_Set.fold gcd (0::'a) (Set t) = fold_keys gcd t (0::'a)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
Finite_Set.fold gcd (0::'a) (Set t) = fold_keys gcd t (0::'a)

goal (1 subgoal):
 1. Gcd\<^sub>f\<^sub>i\<^sub>n (Set t) = fold_keys gcd t (0::'a)
[PROOF STEP]
by (simp add: Gcd_fin.eq_fold)
[PROOF STATE]
proof (state)
this:
Gcd\<^sub>f\<^sub>i\<^sub>n (Set t) = fold_keys gcd t (0::'a)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma perm_vars_inj_on_nth:
  assumes "perm_vars n vs"
    shows "inj_on (nth vs) {0..<n}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on ((!) vs) {0..<n}
[PROOF STEP]
proof (rule inj_onI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> {0..<n}; y \<in> {0..<n}; vs ! x = vs ! y\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
fix i j
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> {0..<n}; y \<in> {0..<n}; vs ! x = vs ! y\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
assume "i \<in> {0..<n}" and "j \<in> {0..<n}"
[PROOF STATE]
proof (state)
this:
i \<in> {0..<n}
j \<in> {0..<n}

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> {0..<n}; y \<in> {0..<n}; vs ! x = vs ! y\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
perm_vars n vs
i \<in> {0..<n}
j \<in> {0..<n}
[PROOF STEP]
have "i < length vs" and "j < length vs"
[PROOF STATE]
proof (prove)
using this:
perm_vars n vs
i \<in> {0..<n}
j \<in> {0..<n}

goal (1 subgoal):
 1. i < length vs &&& j < length vs
[PROOF STEP]
using perm_vars_length
[PROOF STATE]
proof (prove)
using this:
perm_vars n vs
i \<in> {0..<n}
j \<in> {0..<n}
perm_vars ?n ?vs \<Longrightarrow> length ?vs = ?n

goal (1 subgoal):
 1. i < length vs &&& j < length vs
[PROOF STEP]
by simp+
[PROOF STATE]
proof (state)
this:
i < length vs
j < length vs

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> {0..<n}; y \<in> {0..<n}; vs ! x = vs ! y\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
i < length vs
j < length vs

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> {0..<n}; y \<in> {0..<n}; vs ! x = vs ! y\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
perm_vars n vs
[PROOF STEP]
have "distinct vs"
[PROOF STATE]
proof (prove)
using this:
perm_vars n vs

goal (1 subgoal):
 1. distinct vs
[PROOF STEP]
by (rule perm_vars_distinct)
[PROOF STATE]
proof (state)
this:
distinct vs

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> {0..<n}; y \<in> {0..<n}; vs ! x = vs ! y\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
distinct vs

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> {0..<n}; y \<in> {0..<n}; vs ! x = vs ! y\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
assume "vs ! i = vs ! j"
[PROOF STATE]
proof (state)
this:
vs ! i = vs ! j

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> {0..<n}; y \<in> {0..<n}; vs ! x = vs ! y\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
i < length vs
j < length vs
distinct vs
vs ! i = vs ! j
[PROOF STEP]
show "i = j"
[PROOF STATE]
proof (prove)
using this:
i < length vs
j < length vs
distinct vs
vs ! i = vs ! j

goal (1 subgoal):
 1. i = j
[PROOF STEP]
using nth_eq_iff_index_eq
[PROOF STATE]
proof (prove)
using this:
i < length vs
j < length vs
distinct vs
vs ! i = vs ! j
\<lbrakk>distinct ?xs; ?i < length ?xs; ?j < length ?xs\<rbrakk> \<Longrightarrow> (?xs ! ?i = ?xs ! ?j) = (?i = ?j)

goal (1 subgoal):
 1. i = j
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
i = j

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ereal_eq_1[simp]:
  "ereal r = 1 \<longleftrightarrow> r = 1"
  "1 = ereal r \<longleftrightarrow> r = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (ereal r = 1) = (r = 1) &&& (1 = ereal r) = (r = 1)
[PROOF STEP]
unfolding one_ereal_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (ereal r = ereal 1) = (r = 1) &&& (ereal 1 = ereal r) = (r = 1)
[PROOF STEP]
by simp_all


[STATEMENT]
lemma SAT_UN[simp]: "SAT (\<Union> i \<in> I. \<Phi> i) \<longleftrightarrow> (\<forall> i \<in> I. SAT (\<Phi> i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. SAT (\<Union> (\<Phi> ` I)) = (\<forall>i\<in>I. SAT (\<Phi> i))
[PROOF STEP]
unfolding SAT_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>\<xi>. wtE \<xi> \<longrightarrow> satPB \<xi> (\<Union> (\<Phi> ` I))) = (\<forall>i\<in>I. \<forall>\<xi>. wtE \<xi> \<longrightarrow> satPB \<xi> (\<Phi> i))
[PROOF STEP]
by auto


[STATEMENT]
theorem levy_continuity1:
  fixes M :: "nat \<Rightarrow> real measure" and M' :: "real measure"
  assumes "\<And>n. real_distribution (M n)" "real_distribution M'" "weak_conv_m M M'"
  shows "(\<lambda>n. char (M n) t) \<longlonglongrightarrow> char M' t"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. char (M n) t) \<longlonglongrightarrow> char M' t
[PROOF STEP]
unfolding char_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. CLINT x|M n. iexp (t * x)) \<longlonglongrightarrow> CLINT x|M'. iexp (t * x)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
real_distribution (M ?n)
real_distribution M'
weak_conv_m M M'

goal (1 subgoal):
 1. (\<lambda>n. CLINT x|M n. iexp (t * x)) \<longlonglongrightarrow> CLINT x|M'. iexp (t * x)
[PROOF STEP]
by (rule weak_conv_imp_integral_bdd_continuous_conv) auto


[STATEMENT]
lemma of_nat_rat: "of_nat k = Fract (of_nat k) 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. of_nat k = Fract (int k) 1
[PROOF STEP]
by (induct k) (simp_all add: Zero_rat_def One_rat_def)


[STATEMENT]
lemma Kleene_iter_gpfp:
  assumes "mono f" and "p \<le> f p" shows "p \<le> (f^^k) (top::'a::order_top)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p \<le> (f ^^ k) top
[PROOF STEP]
proof(induction k)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. p \<le> (f ^^ 0) top
 2. \<And>k. p \<le> (f ^^ k) top \<Longrightarrow> p \<le> (f ^^ Suc k) top
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. p \<le> (f ^^ 0) top
 2. \<And>k. p \<le> (f ^^ k) top \<Longrightarrow> p \<le> (f ^^ Suc k) top
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p \<le> (f ^^ 0) top
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
p \<le> (f ^^ 0) top

goal (1 subgoal):
 1. \<And>k. p \<le> (f ^^ k) top \<Longrightarrow> p \<le> (f ^^ Suc k) top
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>k. p \<le> (f ^^ k) top \<Longrightarrow> p \<le> (f ^^ Suc k) top
[PROOF STEP]
case Suc
[PROOF STATE]
proof (state)
this:
p \<le> (f ^^ k_) top

goal (1 subgoal):
 1. \<And>k. p \<le> (f ^^ k) top \<Longrightarrow> p \<le> (f ^^ Suc k) top
[PROOF STEP]
from monoD[OF assms(1) Suc] assms(2)
[PROOF STATE]
proof (chain)
picking this:
f p \<le> f ((f ^^ k_) top)
p \<le> f p
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
f p \<le> f ((f ^^ k_) top)
p \<le> f p

goal (1 subgoal):
 1. p \<le> (f ^^ Suc k_) top
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
p \<le> (f ^^ Suc k_) top

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma map_eq_conv':
  "map f xs = map g ys \<longleftrightarrow> length xs = length ys \<and> (\<forall>i < length xs. f (xs ! i) = g (ys ! i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (map f xs = map g ys) = (length xs = length ys \<and> (\<forall>i<length xs. f (xs ! i) = g (ys ! i)))
[PROOF STEP]
by (auto dest: map_eq_imp_length_eq map_nth_conv simp: nth_map_conv)


[STATEMENT]
theorem join_related [elim?]: "x \<sqsubseteq> y \<Longrightarrow> x \<squnion> y = y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<sqsubseteq> y \<Longrightarrow> x \<squnion> y = y
[PROOF STEP]
proof (rule joinI)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. x \<sqsubseteq> y \<Longrightarrow> x \<sqsubseteq> y
 2. x \<sqsubseteq> y \<Longrightarrow> y \<sqsubseteq> y
 3. \<And>z. \<lbrakk>x \<sqsubseteq> y; x \<sqsubseteq> z; y \<sqsubseteq> z\<rbrakk> \<Longrightarrow> y \<sqsubseteq> z
[PROOF STEP]
assume "x \<sqsubseteq> y"
[PROOF STATE]
proof (state)
this:
x \<sqsubseteq> y

goal (3 subgoals):
 1. x \<sqsubseteq> y \<Longrightarrow> x \<sqsubseteq> y
 2. x \<sqsubseteq> y \<Longrightarrow> y \<sqsubseteq> y
 3. \<And>z. \<lbrakk>x \<sqsubseteq> y; x \<sqsubseteq> z; y \<sqsubseteq> z\<rbrakk> \<Longrightarrow> y \<sqsubseteq> z
[PROOF STEP]
show "y \<sqsubseteq> y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y \<sqsubseteq> y
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
y \<sqsubseteq> y

goal (2 subgoals):
 1. x \<sqsubseteq> y \<Longrightarrow> x \<sqsubseteq> y
 2. \<And>z. \<lbrakk>x \<sqsubseteq> y; x \<sqsubseteq> z; y \<sqsubseteq> z\<rbrakk> \<Longrightarrow> y \<sqsubseteq> z
[PROOF STEP]
show "x \<sqsubseteq> y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<sqsubseteq> y
[PROOF STEP]
by fact
[PROOF STATE]
proof (state)
this:
x \<sqsubseteq> y

goal (1 subgoal):
 1. \<And>z. \<lbrakk>x \<sqsubseteq> y; x \<sqsubseteq> z; y \<sqsubseteq> z\<rbrakk> \<Longrightarrow> y \<sqsubseteq> z
[PROOF STEP]
fix z
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>z. \<lbrakk>x \<sqsubseteq> y; x \<sqsubseteq> z; y \<sqsubseteq> z\<rbrakk> \<Longrightarrow> y \<sqsubseteq> z
[PROOF STEP]
assume "x \<sqsubseteq> z" and "y \<sqsubseteq> z"
[PROOF STATE]
proof (state)
this:
x \<sqsubseteq> z
y \<sqsubseteq> z

goal (1 subgoal):
 1. \<And>z. \<lbrakk>x \<sqsubseteq> y; x \<sqsubseteq> z; y \<sqsubseteq> z\<rbrakk> \<Longrightarrow> y \<sqsubseteq> z
[PROOF STEP]
show "y \<sqsubseteq> z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y \<sqsubseteq> z
[PROOF STEP]
by fact
[PROOF STATE]
proof (state)
this:
y \<sqsubseteq> z

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma of_complex_eq_minus_of_complex_iff [simp]: "of_complex x = -of_complex y \<longleftrightarrow> x = -y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (of_complex x = - of_complex y) = (x = - y)
[PROOF STEP]
using of_complex_eq_iff[of x "-y"]
[PROOF STATE]
proof (prove)
using this:
(of_complex x = of_complex (- y)) = (x = - y)

goal (1 subgoal):
 1. (of_complex x = - of_complex y) = (x = - y)
[PROOF STEP]
by (simp only: of_complex_minus)


[STATEMENT]
lemma lemma_tan_total1: "\<exists>x. -(pi/2) < x \<and> x < (pi/2) \<and> tan x = y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>x>- (pi / 2). x < pi / 2 \<and> tan x = y
[PROOF STEP]
proof (cases "0::real" y rule: le_cases)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. 0 \<le> y \<Longrightarrow> \<exists>x>- (pi / 2). x < pi / 2 \<and> tan x = y
 2. y \<le> 0 \<Longrightarrow> \<exists>x>- (pi / 2). x < pi / 2 \<and> tan x = y
[PROOF STEP]
case le
[PROOF STATE]
proof (state)
this:
0 \<le> y

goal (2 subgoals):
 1. 0 \<le> y \<Longrightarrow> \<exists>x>- (pi / 2). x < pi / 2 \<and> tan x = y
 2. y \<le> 0 \<Longrightarrow> \<exists>x>- (pi / 2). x < pi / 2 \<and> tan x = y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 \<le> y
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
0 \<le> y

goal (1 subgoal):
 1. \<exists>x>- (pi / 2). x < pi / 2 \<and> tan x = y
[PROOF STEP]
by (meson less_le_trans minus_pi_half_less_zero tan_total_pos)
[PROOF STATE]
proof (state)
this:
\<exists>x>- (pi / 2). x < pi / 2 \<and> tan x = y

goal (1 subgoal):
 1. y \<le> 0 \<Longrightarrow> \<exists>x>- (pi / 2). x < pi / 2 \<and> tan x = y
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. y \<le> 0 \<Longrightarrow> \<exists>x>- (pi / 2). x < pi / 2 \<and> tan x = y
[PROOF STEP]
case ge
[PROOF STATE]
proof (state)
this:
y \<le> 0

goal (1 subgoal):
 1. y \<le> 0 \<Longrightarrow> \<exists>x>- (pi / 2). x < pi / 2 \<and> tan x = y
[PROOF STEP]
with tan_total_pos [of "-y"]
[PROOF STATE]
proof (chain)
picking this:
0 \<le> - y \<Longrightarrow> \<exists>x\<ge>0. x < pi / 2 \<and> tan x = - y
y \<le> 0
[PROOF STEP]
obtain x where "0 \<le> x" "x < pi / 2" "tan x = - y"
[PROOF STATE]
proof (prove)
using this:
0 \<le> - y \<Longrightarrow> \<exists>x\<ge>0. x < pi / 2 \<and> tan x = - y
y \<le> 0

goal (1 subgoal):
 1. (\<And>x. \<lbrakk>0 \<le> x; x < pi / 2; tan x = - y\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
0 \<le> x
x < pi / 2
tan x = - y

goal (1 subgoal):
 1. y \<le> 0 \<Longrightarrow> \<exists>x>- (pi / 2). x < pi / 2 \<and> tan x = y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 \<le> x
x < pi / 2
tan x = - y
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
0 \<le> x
x < pi / 2
tan x = - y

goal (1 subgoal):
 1. \<exists>x>- (pi / 2). x < pi / 2 \<and> tan x = y
[PROOF STEP]
by (rule_tac x="-x" in exI) auto
[PROOF STATE]
proof (state)
this:
\<exists>x>- (pi / 2). x < pi / 2 \<and> tan x = y

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma cos_diff: "cos (x - y) = cos x * cos y + sin x * sin y"
  for x :: "'a::{real_normed_field,banach}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cos (x - y) = cos x * cos y + sin x * sin y
[PROOF STEP]
using cos_add [of x "- y"]
[PROOF STATE]
proof (prove)
using this:
cos (x + - y) = cos x * cos (- y) - sin x * sin (- y)

goal (1 subgoal):
 1. cos (x - y) = cos x * cos y + sin x * sin y
[PROOF STEP]
by simp


[STATEMENT]
lemma sublist_length:
  fixes l l'
  assumes "subseq l l'"
  shows "length l \<le> length l'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length l \<le> length l'
[PROOF STEP]
using assms list_emb_length
[PROOF STATE]
proof (prove)
using this:
subseq l l'
list_emb ?P ?xs ?ys \<Longrightarrow> length ?xs \<le> length ?ys

goal (1 subgoal):
 1. length l \<le> length l'
[PROOF STEP]
by blast

\<comment> \<open>NOTE can be solved directly with subseq\_Cons'.\<close>


[STATEMENT]
lemma insort_map_mono: assumes mono: \<open>\<forall> n m. n < m \<longrightarrow> f n < f m\<close> shows \<open>map f (insort n ns) = insort (f n) (map f ns)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map f (insort n ns) = insort (f n) (map f ns)
[PROOF STEP]
apply (induction \<open>ns\<close>)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. map f (insort n []) = insort (f n) (map f [])
 2. \<And>a ns. map f (insort n ns) = insort (f n) (map f ns) \<Longrightarrow> map f (insort n (a # ns)) = insort (f n) (map f (a # ns))
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<And>a ns. \<lbrakk>map f (insort n ns) = insort (f n) (map f ns); n \<le> a; \<not> f n \<le> f a\<rbrakk> \<Longrightarrow> f n = f a
 2. \<And>a ns. \<lbrakk>map f (insort n ns) = insort (f n) (map f ns); n \<le> a; \<not> f n \<le> f a\<rbrakk> \<Longrightarrow> f a # map f ns = insort (f n) (map f ns)
 3. \<And>a ns. \<lbrakk>map f (insort n ns) = insort (f n) (map f ns); \<not> n \<le> a; f n \<le> f a\<rbrakk> \<Longrightarrow> f a = f n
 4. \<And>a ns. \<lbrakk>map f (insort n ns) = insort (f n) (map f ns); \<not> n \<le> a; f n \<le> f a\<rbrakk> \<Longrightarrow> insort (f n) (map f ns) = f a # map f ns
[PROOF STEP]
apply (metis not_less not_less_iff_gr_or_eq mono)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>a ns. \<lbrakk>map f (insort n ns) = insort (f n) (map f ns); n \<le> a; \<not> f n \<le> f a\<rbrakk> \<Longrightarrow> f a # map f ns = insort (f n) (map f ns)
 2. \<And>a ns. \<lbrakk>map f (insort n ns) = insort (f n) (map f ns); \<not> n \<le> a; f n \<le> f a\<rbrakk> \<Longrightarrow> f a = f n
 3. \<And>a ns. \<lbrakk>map f (insort n ns) = insort (f n) (map f ns); \<not> n \<le> a; f n \<le> f a\<rbrakk> \<Longrightarrow> insort (f n) (map f ns) = f a # map f ns
[PROOF STEP]
apply (metis antisym_conv1 less_imp_le mono)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>a ns. \<lbrakk>map f (insort n ns) = insort (f n) (map f ns); \<not> n \<le> a; f n \<le> f a\<rbrakk> \<Longrightarrow> f a = f n
 2. \<And>a ns. \<lbrakk>map f (insort n ns) = insort (f n) (map f ns); \<not> n \<le> a; f n \<le> f a\<rbrakk> \<Longrightarrow> insort (f n) (map f ns) = f a # map f ns
[PROOF STEP]
apply (metis mono not_less)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a ns. \<lbrakk>map f (insort n ns) = insort (f n) (map f ns); \<not> n \<le> a; f n \<le> f a\<rbrakk> \<Longrightarrow> insort (f n) (map f ns) = f a # map f ns
[PROOF STEP]
by (metis mono not_less)


[STATEMENT]
lemma Bseq_eventually_mono:
  assumes "eventually (\<lambda>n. norm (f n) \<le> norm (g n)) sequentially" "Bseq g"
  shows "Bseq f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Bseq f
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Bseq f
[PROOF STEP]
from assms(2)
[PROOF STATE]
proof (chain)
picking this:
Bseq g
[PROOF STEP]
obtain K where "0 < K" and "eventually (\<lambda>n. norm (g n) \<le> K) sequentially"
[PROOF STATE]
proof (prove)
using this:
Bseq g

goal (1 subgoal):
 1. (\<And>K. \<lbrakk>0 < K; \<forall>\<^sub>F n in sequentially. norm (g n) \<le> K\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding Bfun_def
[PROOF STATE]
proof (prove)
using this:
\<exists>K>0. \<forall>\<^sub>F x in sequentially. norm (g x) \<le> K

goal (1 subgoal):
 1. (\<And>K. \<lbrakk>0 < K; \<forall>\<^sub>F n in sequentially. norm (g n) \<le> K\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
0 < K
\<forall>\<^sub>F n in sequentially. norm (g n) \<le> K

goal (1 subgoal):
 1. Bseq f
[PROOF STEP]
with assms(1)
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F n in sequentially. norm (f n) \<le> norm (g n)
0 < K
\<forall>\<^sub>F n in sequentially. norm (g n) \<le> K
[PROOF STEP]
have "eventually (\<lambda>n. norm (f n) \<le> K) sequentially"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F n in sequentially. norm (f n) \<le> norm (g n)
0 < K
\<forall>\<^sub>F n in sequentially. norm (g n) \<le> K

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. norm (f n) \<le> K
[PROOF STEP]
by (fast elim: eventually_elim2 order_trans)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in sequentially. norm (f n) \<le> K

goal (1 subgoal):
 1. Bseq f
[PROOF STEP]
with \<open>0 < K\<close>
[PROOF STATE]
proof (chain)
picking this:
0 < K
\<forall>\<^sub>F n in sequentially. norm (f n) \<le> K
[PROOF STEP]
show "Bseq f"
[PROOF STATE]
proof (prove)
using this:
0 < K
\<forall>\<^sub>F n in sequentially. norm (f n) \<le> K

goal (1 subgoal):
 1. Bseq f
[PROOF STEP]
unfolding Bfun_def
[PROOF STATE]
proof (prove)
using this:
0 < K
\<forall>\<^sub>F n in sequentially. norm (f n) \<le> K

goal (1 subgoal):
 1. \<exists>K>0. \<forall>\<^sub>F x in sequentially. norm (f x) \<le> K
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
Bseq f

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma divide_less_0_1_iff [simp]:
  "1 / a < 0 \<longleftrightarrow> a < 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((1::'a) / a < (0::'a)) = (a < (0::'a))
[PROOF STEP]
using local.dual_order.strict_iff_order
[PROOF STATE]
proof (prove)
using this:
(?b < ?a) = (?b \<le> ?a \<and> ?a \<noteq> ?b)

goal (1 subgoal):
 1. ((1::'a) / a < (0::'a)) = (a < (0::'a))
[PROOF STEP]
by auto


[STATEMENT]
lemma continuous_on_sq_mtx_vec_multl:
  fixes A :: "real \<Rightarrow> ('n::finite) sq_mtx"
  assumes "continuous_on T A"
  shows "continuous_on T (\<lambda>t. A t *\<^sub>V s)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on T (\<lambda>t. A t *\<^sub>V s)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. continuous_on T (\<lambda>t. A t *\<^sub>V s)
[PROOF STEP]
have "matrix_continuous_on T (\<lambda>t. to_vec (A t))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. matrix_continuous_on T (\<lambda>t. to_vec (A t))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
continuous_on T A

goal (1 subgoal):
 1. matrix_continuous_on T (\<lambda>t. to_vec (A t))
[PROOF STEP]
by (force simp: continuous_on_iff dist_norm norm_sq_mtx_def matrix_continuous_on_def)
[PROOF STATE]
proof (state)
this:
matrix_continuous_on T (\<lambda>t. to_vec (A t))

goal (1 subgoal):
 1. continuous_on T (\<lambda>t. A t *\<^sub>V s)
[PROOF STEP]
hence "continuous_on T (\<lambda>t. to_vec (A t) *v s)"
[PROOF STATE]
proof (prove)
using this:
matrix_continuous_on T (\<lambda>t. to_vec (A t))

goal (1 subgoal):
 1. continuous_on T (\<lambda>t. to_vec (A t) *v s)
[PROOF STEP]
by (rule continuous_on_matrix_vector_multl)
[PROOF STATE]
proof (state)
this:
continuous_on T (\<lambda>t. to_vec (A t) *v s)

goal (1 subgoal):
 1. continuous_on T (\<lambda>t. A t *\<^sub>V s)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
continuous_on T (\<lambda>t. to_vec (A t) *v s)

goal (1 subgoal):
 1. continuous_on T (\<lambda>t. A t *\<^sub>V s)
[PROOF STEP]
by transfer
[PROOF STATE]
proof (state)
this:
continuous_on T (\<lambda>t. A t *\<^sub>V s)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma succ_finite[simp, intro]: "finite (edges G) \<Longrightarrow> finite (succ G v)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (edges G) \<Longrightarrow> finite (succ G v)
[PROOF STEP]
unfolding succ_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (edges G) \<Longrightarrow> finite {(w, v'). (v, w, v') \<in> edges G}
[PROOF STEP]
by (rule finite_subset[where B="snd`edges G"]) force+


[STATEMENT]
lemma sum_over_fun_eq:
  assumes "\<And> x . x \<in># A \<Longrightarrow> f x = g x"
  shows "(\<Sum>x \<in># A . f(x)) = (\<Sum> x \<in># A . g (x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Sum>\<^sub># (image_mset f A) = \<Sum>\<^sub># (image_mset g A)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
?x \<in># A \<Longrightarrow> f ?x = g ?x

goal (1 subgoal):
 1. \<Sum>\<^sub># (image_mset f A) = \<Sum>\<^sub># (image_mset g A)
[PROOF STEP]
by auto


[STATEMENT]
lemma compow_similar_diag_mat:
  assumes "A \<sim> (diag_mat f)"
  shows "((**) A ^^ n) (mat 1) \<sim> diag_mat (\<lambda>i. f i^n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((**) A ^^ n) (mat (1::'a)) \<sim> diag_mat (\<lambda>i. f i ^ n)
[PROOF STEP]
proof(unfold similar_matrix_def)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>P. invertible P \<and> ((**) A ^^ n) (mat (1::'a)) = P\<^sup>-\<^sup>1 ** diag_mat (\<lambda>i. f i ^ n) ** P
[PROOF STEP]
obtain P where "invertible P" and "A = P\<^sup>-\<^sup>1 ** (diag_mat f) ** P"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>P. \<lbrakk>invertible P; A = P\<^sup>-\<^sup>1 ** diag_mat f ** P\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
A \<sim> diag_mat f

goal (1 subgoal):
 1. (\<And>P. \<lbrakk>invertible P; A = P\<^sup>-\<^sup>1 ** diag_mat f ** P\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding similar_matrix_def
[PROOF STATE]
proof (prove)
using this:
\<exists>P. invertible P \<and> A = P\<^sup>-\<^sup>1 ** diag_mat f ** P

goal (1 subgoal):
 1. (\<And>P. \<lbrakk>invertible P; A = P\<^sup>-\<^sup>1 ** diag_mat f ** P\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
invertible P
A = P\<^sup>-\<^sup>1 ** diag_mat f ** P

goal (1 subgoal):
 1. \<exists>P. invertible P \<and> ((**) A ^^ n) (mat (1::'a)) = P\<^sup>-\<^sup>1 ** diag_mat (\<lambda>i. f i ^ n) ** P
[PROOF STEP]
thus "\<exists>P. invertible P \<and> ((**) A ^^ n) (mat 1) = P\<^sup>-\<^sup>1 ** diag_mat (\<lambda>i. f i ^ n) ** P"
[PROOF STATE]
proof (prove)
using this:
invertible P
A = P\<^sup>-\<^sup>1 ** diag_mat f ** P

goal (1 subgoal):
 1. \<exists>P. invertible P \<and> ((**) A ^^ n) (mat (1::'a)) = P\<^sup>-\<^sup>1 ** diag_mat (\<lambda>i. f i ^ n) ** P
[PROOF STEP]
using compow_similar_diag_mat_eq
[PROOF STATE]
proof (prove)
using this:
invertible P
A = P\<^sup>-\<^sup>1 ** diag_mat f ** P
\<lbrakk>invertible ?P; ?A = ?P\<^sup>-\<^sup>1 ** diag_mat ?f ** ?P\<rbrakk> \<Longrightarrow> ((**) ?A ^^ ?n) (mat (1::?'a)) = ?P\<^sup>-\<^sup>1 ** diag_mat (\<lambda>i. ?f i ^ ?n) ** ?P

goal (1 subgoal):
 1. \<exists>P. invertible P \<and> ((**) A ^^ n) (mat (1::'a)) = P\<^sup>-\<^sup>1 ** diag_mat (\<lambda>i. f i ^ n) ** P
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>P. invertible P \<and> ((**) A ^^ n) (mat (1::'a)) = P\<^sup>-\<^sup>1 ** diag_mat (\<lambda>i. f i ^ n) ** P

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma zero_projector[simp]:
  shows "projector (0\<^sub>m n n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. projector (0\<^sub>m n n)
[PROOF STEP]
unfolding projector_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. hermitian (0\<^sub>m n n) \<and> 0\<^sub>m n n * 0\<^sub>m n n = 0\<^sub>m n n
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. hermitian (0\<^sub>m n n)
 2. 0\<^sub>m n n * 0\<^sub>m n n = 0\<^sub>m n n
[PROOF STEP]
show "hermitian (0\<^sub>m n n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. hermitian (0\<^sub>m n n)
[PROOF STEP]
using zero_hermitian[of n]
[PROOF STATE]
proof (prove)
using this:
hermitian (0\<^sub>m n n)

goal (1 subgoal):
 1. hermitian (0\<^sub>m n n)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
hermitian (0\<^sub>m n n)

goal (1 subgoal):
 1. 0\<^sub>m n n * 0\<^sub>m n n = 0\<^sub>m n n
[PROOF STEP]
show "0\<^sub>m n n * 0\<^sub>m n n = 0\<^sub>m n n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0\<^sub>m n n * 0\<^sub>m n n = 0\<^sub>m n n
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
0\<^sub>m n n * 0\<^sub>m n n = 0\<^sub>m n n

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma simple_integral_const[simp]:
  "(\<integral>\<^sup>Sx. c \<partial>M) = c * (emeasure M) (space M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>S x. c \<partial>M = c * emeasure M (space M)
[PROOF STEP]
proof (cases "space M = {}")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. space M = {} \<Longrightarrow> \<integral>\<^sup>S x. c \<partial>M = c * emeasure M (space M)
 2. space M \<noteq> {} \<Longrightarrow> \<integral>\<^sup>S x. c \<partial>M = c * emeasure M (space M)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
space M = {}

goal (2 subgoals):
 1. space M = {} \<Longrightarrow> \<integral>\<^sup>S x. c \<partial>M = c * emeasure M (space M)
 2. space M \<noteq> {} \<Longrightarrow> \<integral>\<^sup>S x. c \<partial>M = c * emeasure M (space M)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
space M = {}

goal (1 subgoal):
 1. \<integral>\<^sup>S x. c \<partial>M = c * emeasure M (space M)
[PROOF STEP]
unfolding simple_integral_def
[PROOF STATE]
proof (prove)
using this:
space M = {}

goal (1 subgoal):
 1. (\<Sum>x\<in>(\<lambda>x. c) ` space M. x * emeasure M ((\<lambda>x. c) -` {x} \<inter> space M)) = c * emeasure M (space M)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>S x. c \<partial>M = c * emeasure M (space M)

goal (1 subgoal):
 1. space M \<noteq> {} \<Longrightarrow> \<integral>\<^sup>S x. c \<partial>M = c * emeasure M (space M)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. space M \<noteq> {} \<Longrightarrow> \<integral>\<^sup>S x. c \<partial>M = c * emeasure M (space M)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
space M \<noteq> {}

goal (1 subgoal):
 1. space M \<noteq> {} \<Longrightarrow> \<integral>\<^sup>S x. c \<partial>M = c * emeasure M (space M)
[PROOF STEP]
hence "(\<lambda>x. c) ` space M = {c}"
[PROOF STATE]
proof (prove)
using this:
space M \<noteq> {}

goal (1 subgoal):
 1. (\<lambda>x. c) ` space M = {c}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<lambda>x. c) ` space M = {c}

goal (1 subgoal):
 1. space M \<noteq> {} \<Longrightarrow> \<integral>\<^sup>S x. c \<partial>M = c * emeasure M (space M)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. c) ` space M = {c}

goal (1 subgoal):
 1. \<integral>\<^sup>S x. c \<partial>M = c * emeasure M (space M)
[PROOF STEP]
unfolding simple_integral_def
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. c) ` space M = {c}

goal (1 subgoal):
 1. (\<Sum>x\<in>(\<lambda>x. c) ` space M. x * emeasure M ((\<lambda>x. c) -` {x} \<inter> space M)) = c * emeasure M (space M)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>S x. c \<partial>M = c * emeasure M (space M)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma card_suc:
  \<open>card {i. i \<le> (Suc n) \<and> P i} = card {i. i \<le> n \<and> P i} + card {i. i = (Suc n) \<and> P i}\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card {i. i \<le> Suc n \<and> P i} = card {i. i \<le> n \<and> P i} + card {i. i = Suc n \<and> P i}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. card {i. i \<le> Suc n \<and> P i} = card {i. i \<le> n \<and> P i} + card {i. i = Suc n \<and> P i}
[PROOF STEP]
have \<open>{i. i \<le> n \<and> P i} \<inter> {i. i = (Suc n) \<and> P i} = {}\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {i. i \<le> n \<and> P i} \<inter> {i. i = Suc n \<and> P i} = {}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{i. i \<le> n \<and> P i} \<inter> {i. i = Suc n \<and> P i} = {}

goal (1 subgoal):
 1. card {i. i \<le> Suc n \<and> P i} = card {i. i \<le> n \<and> P i} + card {i. i = Suc n \<and> P i}
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
{i. i \<le> n \<and> P i} \<inter> {i. i = Suc n \<and> P i} = {}

goal (1 subgoal):
 1. card {i. i \<le> Suc n \<and> P i} = card {i. i \<le> n \<and> P i} + card {i. i = Suc n \<and> P i}
[PROOF STEP]
have \<open>{i. i \<le> n \<and> P i} \<union> {i. i = (Suc n) \<and> P i}
               = {i. i \<le> (Suc n) \<and> P i}\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {i. i \<le> n \<and> P i} \<union> {i. i = Suc n \<and> P i} = {i. i \<le> Suc n \<and> P i}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{i. i \<le> n \<and> P i} \<union> {i. i = Suc n \<and> P i} = {i. i \<le> Suc n \<and> P i}

goal (1 subgoal):
 1. card {i. i \<le> Suc n \<and> P i} = card {i. i \<le> n \<and> P i} + card {i. i = Suc n \<and> P i}
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
{i. i \<le> n \<and> P i} \<union> {i. i = Suc n \<and> P i} = {i. i \<le> Suc n \<and> P i}

goal (1 subgoal):
 1. card {i. i \<le> Suc n \<and> P i} = card {i. i \<le> n \<and> P i} + card {i. i = Suc n \<and> P i}
[PROOF STEP]
have \<open>finite {i. i \<le> n \<and> P i}\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {i. i \<le> n \<and> P i}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
finite {i. i \<le> n \<and> P i}

goal (1 subgoal):
 1. card {i. i \<le> Suc n \<and> P i} = card {i. i \<le> n \<and> P i} + card {i. i = Suc n \<and> P i}
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
finite {i. i \<le> n \<and> P i}

goal (1 subgoal):
 1. card {i. i \<le> Suc n \<and> P i} = card {i. i \<le> n \<and> P i} + card {i. i = Suc n \<and> P i}
[PROOF STEP]
have \<open>finite {i. i = (Suc n) \<and> P i}\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {i. i = Suc n \<and> P i}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
finite {i. i = Suc n \<and> P i}

goal (1 subgoal):
 1. card {i. i \<le> Suc n \<and> P i} = card {i. i \<le> n \<and> P i} + card {i. i = Suc n \<and> P i}
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
{i. i \<le> n \<and> P i} \<inter> {i. i = Suc n \<and> P i} = {}
{i. i \<le> n \<and> P i} \<union> {i. i = Suc n \<and> P i} = {i. i \<le> Suc n \<and> P i}
finite {i. i \<le> n \<and> P i}
finite {i. i = Suc n \<and> P i}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
{i. i \<le> n \<and> P i} \<inter> {i. i = Suc n \<and> P i} = {}
{i. i \<le> n \<and> P i} \<union> {i. i = Suc n \<and> P i} = {i. i \<le> Suc n \<and> P i}
finite {i. i \<le> n \<and> P i}
finite {i. i = Suc n \<and> P i}

goal (1 subgoal):
 1. card {i. i \<le> Suc n \<and> P i} = card {i. i \<le> n \<and> P i} + card {i. i = Suc n \<and> P i}
[PROOF STEP]
using card_Un_disjoint[of \<open>{i. i \<le> n \<and> P i}\<close> \<open>{i. i = Suc n \<and> P i}\<close>]
[PROOF STATE]
proof (prove)
using this:
{i. i \<le> n \<and> P i} \<inter> {i. i = Suc n \<and> P i} = {}
{i. i \<le> n \<and> P i} \<union> {i. i = Suc n \<and> P i} = {i. i \<le> Suc n \<and> P i}
finite {i. i \<le> n \<and> P i}
finite {i. i = Suc n \<and> P i}
\<lbrakk>finite {i. i \<le> n \<and> P i}; finite {i. i = Suc n \<and> P i}; {i. i \<le> n \<and> P i} \<inter> {i. i = Suc n \<and> P i} = {}\<rbrakk> \<Longrightarrow> card ({i. i \<le> n \<and> P i} \<union> {i. i = Suc n \<and> P i}) = card {i. i \<le> n \<and> P i} + card {i. i = Suc n \<and> P i}

goal (1 subgoal):
 1. card {i. i \<le> Suc n \<and> P i} = card {i. i \<le> n \<and> P i} + card {i. i = Suc n \<and> P i}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
card {i. i \<le> Suc n \<and> P i} = card {i. i \<le> n \<and> P i} + card {i. i = Suc n \<and> P i}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma prefix_antisym: "!!xs::'a list. [| xs <= ys; ys <= xs |] ==> xs = ys"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>xs. \<lbrakk>xs \<le> ys; ys \<le> xs\<rbrakk> \<Longrightarrow> xs = ys
[PROOF STEP]
apply (unfold prefix_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>xs. \<lbrakk>(xs, ys) \<in> genPrefix Id; (ys, xs) \<in> genPrefix Id\<rbrakk> \<Longrightarrow> xs = ys
[PROOF STEP]
apply (blast intro: genPrefix_antisym)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma arccos_unique:
  assumes "0 \<le> x"
    and "x \<le> pi"
    and "cos x = y"
  shows "arccos y = x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. arccos y = x
[PROOF STEP]
using arccos_cos assms(1) assms(2) assms(3)
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>0 \<le> ?x; ?x \<le> pi\<rbrakk> \<Longrightarrow> arccos (cos ?x) = ?x
0 \<le> x
x \<le> pi
cos x = y

goal (1 subgoal):
 1. arccos y = x
[PROOF STEP]
by blast


[STATEMENT]
lemma central_binomial_lower_bound:
  assumes "n > 0"
  shows   "4^n / (2*real n) \<le> real ((2*n) choose n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 4 ^ n / (2 * real n) \<le> real (2 * n choose n)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 4 ^ n / (2 * real n) \<le> real (2 * n choose n)
[PROOF STEP]
from binomial[of 1 1 "2*n"]
[PROOF STATE]
proof (chain)
picking this:
(1 + 1) ^ (2 * n) = (\<Sum>k\<le>2 * n. of_nat (2 * n choose k) * 1 ^ k * 1 ^ (2 * n - k))
[PROOF STEP]
have "4 ^ n = (\<Sum>k\<le>2*n. (2*n) choose k)"
[PROOF STATE]
proof (prove)
using this:
(1 + 1) ^ (2 * n) = (\<Sum>k\<le>2 * n. of_nat (2 * n choose k) * 1 ^ k * 1 ^ (2 * n - k))

goal (1 subgoal):
 1. 4 ^ n = sum ((choose) (2 * n)) {..2 * n}
[PROOF STEP]
by (simp add: power_mult power2_eq_square One_nat_def [symmetric] del: One_nat_def)
[PROOF STATE]
proof (state)
this:
4 ^ n = sum ((choose) (2 * n)) {..2 * n}

goal (1 subgoal):
 1. 4 ^ n / (2 * real n) \<le> real (2 * n choose n)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
4 ^ n = sum ((choose) (2 * n)) {..2 * n}

goal (1 subgoal):
 1. 4 ^ n / (2 * real n) \<le> real (2 * n choose n)
[PROOF STEP]
have "{..2*n} = {0<..<2*n} \<union> {0,2*n}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {..2 * n} = {0<..<2 * n} \<union> {0, 2 * n}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{..2 * n} = {0<..<2 * n} \<union> {0, 2 * n}

goal (1 subgoal):
 1. 4 ^ n / (2 * real n) \<le> real (2 * n choose n)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
{..2 * n} = {0<..<2 * n} \<union> {0, 2 * n}

goal (1 subgoal):
 1. 4 ^ n / (2 * real n) \<le> real (2 * n choose n)
[PROOF STEP]
have "(\<Sum>k\<in>\<dots>. (2*n) choose k) =
             (\<Sum>k\<in>{0<..<2*n}. (2*n) choose k) + (\<Sum>k\<in>{0,2*n}. (2*n) choose k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum ((choose) (2 * n)) ({0<..<2 * n} \<union> {0, 2 * n}) = sum ((choose) (2 * n)) {0<..<2 * n} + sum ((choose) (2 * n)) {0, 2 * n}
[PROOF STEP]
by (subst sum.union_disjoint) auto
[PROOF STATE]
proof (state)
this:
sum ((choose) (2 * n)) ({0<..<2 * n} \<union> {0, 2 * n}) = sum ((choose) (2 * n)) {0<..<2 * n} + sum ((choose) (2 * n)) {0, 2 * n}

goal (1 subgoal):
 1. 4 ^ n / (2 * real n) \<le> real (2 * n choose n)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
sum ((choose) (2 * n)) ({0<..<2 * n} \<union> {0, 2 * n}) = sum ((choose) (2 * n)) {0<..<2 * n} + sum ((choose) (2 * n)) {0, 2 * n}

goal (1 subgoal):
 1. 4 ^ n / (2 * real n) \<le> real (2 * n choose n)
[PROOF STEP]
have "(\<Sum>k\<in>{0,2*n}. (2*n) choose k) \<le> (\<Sum>k\<le>1. (n choose k)\<^sup>2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum ((choose) (2 * n)) {0, 2 * n} \<le> (\<Sum>k\<le>1. (n choose k)\<^sup>2)
[PROOF STEP]
by (cases n) simp_all
[PROOF STATE]
proof (state)
this:
sum ((choose) (2 * n)) {0, 2 * n} \<le> (\<Sum>k\<le>1. (n choose k)\<^sup>2)

goal (1 subgoal):
 1. 4 ^ n / (2 * real n) \<le> real (2 * n choose n)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
sum ((choose) (2 * n)) {0, 2 * n} \<le> (\<Sum>k\<le>1. (n choose k)\<^sup>2)

goal (1 subgoal):
 1. 4 ^ n / (2 * real n) \<le> real (2 * n choose n)
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
0 < n
[PROOF STEP]
have "\<dots> \<le> (\<Sum>k\<le>n. (n choose k)\<^sup>2)"
[PROOF STATE]
proof (prove)
using this:
0 < n

goal (1 subgoal):
 1. (\<Sum>k\<le>1. (n choose k)\<^sup>2) \<le> (\<Sum>k\<le>n. (n choose k)\<^sup>2)
[PROOF STEP]
by (intro sum_mono2) auto
[PROOF STATE]
proof (state)
this:
(\<Sum>k\<le>1. (n choose k)\<^sup>2) \<le> (\<Sum>k\<le>n. (n choose k)\<^sup>2)

goal (1 subgoal):
 1. 4 ^ n / (2 * real n) \<le> real (2 * n choose n)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>k\<le>1. (n choose k)\<^sup>2) \<le> (\<Sum>k\<le>n. (n choose k)\<^sup>2)

goal (1 subgoal):
 1. 4 ^ n / (2 * real n) \<le> real (2 * n choose n)
[PROOF STEP]
have "\<dots> = (2*n) choose n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>k\<le>n. (n choose k)\<^sup>2) = 2 * n choose n
[PROOF STEP]
by (rule choose_square_sum)
[PROOF STATE]
proof (state)
this:
(\<Sum>k\<le>n. (n choose k)\<^sup>2) = 2 * n choose n

goal (1 subgoal):
 1. 4 ^ n / (2 * real n) \<le> real (2 * n choose n)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>k\<le>n. (n choose k)\<^sup>2) = 2 * n choose n

goal (1 subgoal):
 1. 4 ^ n / (2 * real n) \<le> real (2 * n choose n)
[PROOF STEP]
have "(\<Sum>k\<in>{0<..<2*n}. (2*n) choose k) \<le> (\<Sum>k\<in>{0<..<2*n}. (2*n) choose n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum ((choose) (2 * n)) {0<..<2 * n} \<le> (\<Sum>k\<in>{0<..<2 * n}. 2 * n choose n)
[PROOF STEP]
by (intro sum_mono binomial_maximum')
[PROOF STATE]
proof (state)
this:
sum ((choose) (2 * n)) {0<..<2 * n} \<le> (\<Sum>k\<in>{0<..<2 * n}. 2 * n choose n)

goal (1 subgoal):
 1. 4 ^ n / (2 * real n) \<le> real (2 * n choose n)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
sum ((choose) (2 * n)) {0<..<2 * n} \<le> (\<Sum>k\<in>{0<..<2 * n}. 2 * n choose n)

goal (1 subgoal):
 1. 4 ^ n / (2 * real n) \<le> real (2 * n choose n)
[PROOF STEP]
have "\<dots> = card {0<..<2*n} * ((2*n) choose n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>k\<in>{0<..<2 * n}. 2 * n choose n) = card {0<..<2 * n} * (2 * n choose n)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<Sum>k\<in>{0<..<2 * n}. 2 * n choose n) = card {0<..<2 * n} * (2 * n choose n)

goal (1 subgoal):
 1. 4 ^ n / (2 * real n) \<le> real (2 * n choose n)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>k\<in>{0<..<2 * n}. 2 * n choose n) = card {0<..<2 * n} * (2 * n choose n)

goal (1 subgoal):
 1. 4 ^ n / (2 * real n) \<le> real (2 * n choose n)
[PROOF STEP]
have "card {0<..<2*n} \<le> 2*n - 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card {0<..<2 * n} \<le> 2 * n - 1
[PROOF STEP]
by (cases n) simp_all
[PROOF STATE]
proof (state)
this:
card {0<..<2 * n} \<le> 2 * n - 1

goal (1 subgoal):
 1. 4 ^ n / (2 * real n) \<le> real (2 * n choose n)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
card {0<..<2 * n} \<le> 2 * n - 1

goal (1 subgoal):
 1. 4 ^ n / (2 * real n) \<le> real (2 * n choose n)
[PROOF STEP]
have "(2 * n - 1) * (2 * n choose n) + (2 * n choose n) = ((2*n) choose n) * (2*n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (2 * n - 1) * (2 * n choose n) + (2 * n choose n) = (2 * n choose n) * (2 * n)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
0 < n

goal (1 subgoal):
 1. (2 * n - 1) * (2 * n choose n) + (2 * n choose n) = (2 * n choose n) * (2 * n)
[PROOF STEP]
by (simp add: algebra_simps)
[PROOF STATE]
proof (state)
this:
(2 * n - 1) * (2 * n choose n) + (2 * n choose n) = (2 * n choose n) * (2 * n)

goal (1 subgoal):
 1. 4 ^ n / (2 * real n) \<le> real (2 * n choose n)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>\<And>x y. x \<le> y \<Longrightarrow> sum ((choose) (2 * n)) {0<..<2 * n} + x \<le> sum ((choose) (2 * n)) {0<..<2 * n} + y; \<And>x y. x \<le> y \<Longrightarrow> sum ((choose) (2 * n)) {0<..<2 * n} + x \<le> sum ((choose) (2 * n)) {0<..<2 * n} + y; \<And>x y. x \<le> y \<Longrightarrow> x + (2 * n choose n) \<le> y + (2 * n choose n); \<And>x y. x \<le> y \<Longrightarrow> x * (2 * n choose n) + (2 * n choose n) \<le> y * (2 * n choose n) + (2 * n choose n)\<rbrakk> \<Longrightarrow> 4 ^ n \<le> (2 * n choose n) * (2 * n)
[PROOF STEP]
have "4 ^ n \<le> (2 * n choose n) * (2 * n)"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<And>x y. x \<le> y \<Longrightarrow> sum ((choose) (2 * n)) {0<..<2 * n} + x \<le> sum ((choose) (2 * n)) {0<..<2 * n} + y; \<And>x y. x \<le> y \<Longrightarrow> sum ((choose) (2 * n)) {0<..<2 * n} + x \<le> sum ((choose) (2 * n)) {0<..<2 * n} + y; \<And>x y. x \<le> y \<Longrightarrow> x + (2 * n choose n) \<le> y + (2 * n choose n); \<And>x y. x \<le> y \<Longrightarrow> x * (2 * n choose n) + (2 * n choose n) \<le> y * (2 * n choose n) + (2 * n choose n)\<rbrakk> \<Longrightarrow> 4 ^ n \<le> (2 * n choose n) * (2 * n)

goal (1 subgoal):
 1. 4 ^ n \<le> (2 * n choose n) * (2 * n)
[PROOF STEP]
by simp_all
[PROOF STATE]
proof (state)
this:
4 ^ n \<le> (2 * n choose n) * (2 * n)

goal (1 subgoal):
 1. 4 ^ n / (2 * real n) \<le> real (2 * n choose n)
[PROOF STEP]
hence "real (4 ^ n) \<le> real ((2 * n choose n) * (2 * n))"
[PROOF STATE]
proof (prove)
using this:
4 ^ n \<le> (2 * n choose n) * (2 * n)

goal (1 subgoal):
 1. real (4 ^ n) \<le> real ((2 * n choose n) * (2 * n))
[PROOF STEP]
by (subst of_nat_le_iff)
[PROOF STATE]
proof (state)
this:
real (4 ^ n) \<le> real ((2 * n choose n) * (2 * n))

goal (1 subgoal):
 1. 4 ^ n / (2 * real n) \<le> real (2 * n choose n)
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
0 < n
real (4 ^ n) \<le> real ((2 * n choose n) * (2 * n))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
0 < n
real (4 ^ n) \<le> real ((2 * n choose n) * (2 * n))

goal (1 subgoal):
 1. 4 ^ n / (2 * real n) \<le> real (2 * n choose n)
[PROOF STEP]
by (simp add: field_simps)
[PROOF STATE]
proof (state)
this:
4 ^ n / (2 * real n) \<le> real (2 * n choose n)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma norm_bidual_embedding[simp]: \<open>norm (bidual_embedding :: 'a::{complex_inner, not_singleton} \<Rightarrow>\<^sub>C\<^sub>L _) = 1\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm bidual_embedding = 1
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. norm bidual_embedding = 1
[PROOF STEP]
obtain x :: 'a where [simp]: \<open>norm x = 1\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>x. norm x = 1 \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (meson UNIV_not_singleton ex_norm1)
[PROOF STATE]
proof (state)
this:
norm x = 1

goal (1 subgoal):
 1. norm bidual_embedding = 1
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm bidual_embedding = 1
[PROOF STEP]
by (auto intro!: norm_cblinfun_eqI[where x=x])
[PROOF STATE]
proof (state)
this:
norm bidual_embedding = 1

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma locally_connected_3:
  assumes "\<And>t x. \<lbrakk>openin (top_of_set S) t; x \<in> t\<rbrakk>
              \<Longrightarrow> openin (top_of_set S)
                          (connected_component_set t x)"
          "openin (top_of_set S) v" "x \<in> v"
   shows  "\<exists>u. openin (top_of_set S) u \<and> connected u \<and> x \<in> u \<and> u \<subseteq> v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>u. openin (top_of_set S) u \<and> connected u \<and> x \<in> u \<and> u \<subseteq> v
[PROOF STEP]
using assms connected_component_subset
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>openin (top_of_set S) ?t; ?x \<in> ?t\<rbrakk> \<Longrightarrow> openin (top_of_set S) (connected_component_set ?t ?x)
openin (top_of_set S) v
x \<in> v
connected_component_set ?S ?x \<subseteq> ?S

goal (1 subgoal):
 1. \<exists>u. openin (top_of_set S) u \<and> connected u \<and> x \<in> u \<and> u \<subseteq> v
[PROOF STEP]
by fastforce


[STATEMENT]
lemma fps_binomial_minus_of_nat:
  "fps_binomial (- of_nat n) = inverse ((1 + fps_X :: 'a :: field_char_0 fps) ^ n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fps_binomial (- of_nat n) = inverse ((1 + fps_X) ^ n)
[PROOF STEP]
by (rule sym, rule fps_inverse_unique)
     (simp add: fps_binomial_of_nat [symmetric] fps_binomial_add_mult [symmetric])


[STATEMENT]
lemma cis_minus_pi2 [simp]:
  shows "cis (-pi/2) = -\<i>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cis (- pi / 2) = - \<i>
[PROOF STEP]
by (simp add: cis_inverse[symmetric])


[STATEMENT]
lemma norm_le_l1: "norm x \<le> (\<Sum>b\<in>Basis. \<bar>inner x b\<bar>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm x \<le> (\<Sum>b\<in>Basis. \<bar>inner x b\<bar>)
[PROOF STEP]
apply (subst euclidean_representation[of x, symmetric])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (\<Sum>b\<in>Basis. inner x b *\<^sub>R b) \<le> (\<Sum>b\<in>Basis. \<bar>inner x b\<bar>)
[PROOF STEP]
apply (rule order_trans[OF norm_sum])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i\<in>Basis. norm (inner x i *\<^sub>R i)) \<le> (\<Sum>b\<in>Basis. \<bar>inner x b\<bar>)
[PROOF STEP]
apply (auto intro!: sum_mono)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma abs_diff_triangle_ineq2: "\<bar>a - b :: _ :: ordered_ab_group_add_abs\<bar> \<le> \<bar>a - c\<bar> + \<bar>c - b\<bar>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>a - b\<bar> \<le> \<bar>a - c\<bar> + \<bar>c - b\<bar>
[PROOF STEP]
by(rule order_trans[OF _ abs_diff_triangle_ineq]) simp


[STATEMENT]
lemma dim_vec_of_list_h:
assumes "degree h < degree u"
shows "dim_vec (vec_of_list ((coeffs h) @ replicate (degree u - length (coeffs h)) 0)) = degree u"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_vec (vec_of_list (coeffs h @ replicate (degree u - length (coeffs h)) (0::'b))) = degree u
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. dim_vec (vec_of_list (coeffs h @ replicate (degree u - length (coeffs h)) (0::'b))) = degree u
[PROOF STEP]
have "length (coeffs h) \<le> degree u"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (coeffs h) \<le> degree u
[PROOF STEP]
by (metis Suc_leI assms coeffs_0_eq_Nil degree_0 length_coeffs_degree
        list.size(3) not_le_imp_less order.asym)
[PROOF STATE]
proof (state)
this:
length (coeffs h) \<le> degree u

goal (1 subgoal):
 1. dim_vec (vec_of_list (coeffs h @ replicate (degree u - length (coeffs h)) (0::'b))) = degree u
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
length (coeffs h) \<le> degree u

goal (1 subgoal):
 1. dim_vec (vec_of_list (coeffs h @ replicate (degree u - length (coeffs h)) (0::'b))) = degree u
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
dim_vec (vec_of_list (coeffs h @ replicate (degree u - length (coeffs h)) (0::'b))) = degree u

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma is_sound_HNF_conv:
  assumes s: "is_sound_HNF' algorithm associates res"
  shows "is_sound_HNF (\<lambda>A. let H = algorithm A in (SOME P. P \<in> carrier_mat (dim_row A) (dim_row A)
    \<and> invertible_mat P \<and> A = P * H, H)) associates res"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_sound_HNF (\<lambda>A. let H = algorithm A in (SOME P. P \<in> carrier_mat (dim_row A) (dim_row A) \<and> invertible_mat P \<and> A = P * H, H)) associates res
[PROOF STEP]
proof (unfold is_sound_HNF_def Let_def prod.case, rule allI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>A. (SOME P. P \<in> carrier_mat (dim_row A) (dim_row A) \<and> invertible_mat P \<and> A = P * algorithm A) \<in> carrier_mat (dim_row A) (dim_row A) \<and> algorithm A \<in> carrier_mat (dim_row A) (dim_col A) \<and> invertible_mat (SOME P. P \<in> carrier_mat (dim_row A) (dim_row A) \<and> invertible_mat P \<and> A = P * algorithm A) \<and> A = (SOME P. P \<in> carrier_mat (dim_row A) (dim_row A) \<and> invertible_mat P \<and> A = P * algorithm A) * algorithm A \<and> Hermite_JNF associates res (algorithm A)
[PROOF STEP]
fix A::"'a mat"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>A. (SOME P. P \<in> carrier_mat (dim_row A) (dim_row A) \<and> invertible_mat P \<and> A = P * algorithm A) \<in> carrier_mat (dim_row A) (dim_row A) \<and> algorithm A \<in> carrier_mat (dim_row A) (dim_col A) \<and> invertible_mat (SOME P. P \<in> carrier_mat (dim_row A) (dim_row A) \<and> invertible_mat P \<and> A = P * algorithm A) \<and> A = (SOME P. P \<in> carrier_mat (dim_row A) (dim_row A) \<and> invertible_mat P \<and> A = P * algorithm A) * algorithm A \<and> Hermite_JNF associates res (algorithm A)
[PROOF STEP]
define m where "m = dim_row A"
[PROOF STATE]
proof (state)
this:
m = dim_row A

goal (1 subgoal):
 1. \<And>A. (SOME P. P \<in> carrier_mat (dim_row A) (dim_row A) \<and> invertible_mat P \<and> A = P * algorithm A) \<in> carrier_mat (dim_row A) (dim_row A) \<and> algorithm A \<in> carrier_mat (dim_row A) (dim_col A) \<and> invertible_mat (SOME P. P \<in> carrier_mat (dim_row A) (dim_row A) \<and> invertible_mat P \<and> A = P * algorithm A) \<and> A = (SOME P. P \<in> carrier_mat (dim_row A) (dim_row A) \<and> invertible_mat P \<and> A = P * algorithm A) * algorithm A \<and> Hermite_JNF associates res (algorithm A)
[PROOF STEP]
obtain P where P: "P \<in> carrier_mat m m \<and> invertible_mat P \<and> A = P * (algorithm A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>P. P \<in> carrier_mat m m \<and> invertible_mat P \<and> A = P * algorithm A \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using s
[PROOF STATE]
proof (prove)
using this:
is_sound_HNF' algorithm associates res

goal (1 subgoal):
 1. (\<And>P. P \<in> carrier_mat m m \<and> invertible_mat P \<and> A = P * algorithm A \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding is_sound_HNF'_def Let_def m_def
[PROOF STATE]
proof (prove)
using this:
\<forall>A. Hermite_JNF associates res (algorithm A) \<and> algorithm A \<in> carrier_mat (dim_row A) (dim_col A) \<and> (\<exists>P. P \<in> carrier_mat (dim_row A) (dim_row A) \<and> invertible_mat P \<and> A = P * algorithm A)

goal (1 subgoal):
 1. (\<And>P. P \<in> carrier_mat (dim_row A) (dim_row A) \<and> invertible_mat P \<and> A = P * algorithm A \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
P \<in> carrier_mat m m \<and> invertible_mat P \<and> A = P * algorithm A

goal (1 subgoal):
 1. \<And>A. (SOME P. P \<in> carrier_mat (dim_row A) (dim_row A) \<and> invertible_mat P \<and> A = P * algorithm A) \<in> carrier_mat (dim_row A) (dim_row A) \<and> algorithm A \<in> carrier_mat (dim_row A) (dim_col A) \<and> invertible_mat (SOME P. P \<in> carrier_mat (dim_row A) (dim_row A) \<and> invertible_mat P \<and> A = P * algorithm A) \<and> A = (SOME P. P \<in> carrier_mat (dim_row A) (dim_row A) \<and> invertible_mat P \<and> A = P * algorithm A) * algorithm A \<and> Hermite_JNF associates res (algorithm A)
[PROOF STEP]
let ?some_P = "(SOME P. P \<in> carrier_mat m m \<and> invertible_mat P \<and> A = P * algorithm A)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>A. (SOME P. P \<in> carrier_mat (dim_row A) (dim_row A) \<and> invertible_mat P \<and> A = P * algorithm A) \<in> carrier_mat (dim_row A) (dim_row A) \<and> algorithm A \<in> carrier_mat (dim_row A) (dim_col A) \<and> invertible_mat (SOME P. P \<in> carrier_mat (dim_row A) (dim_row A) \<and> invertible_mat P \<and> A = P * algorithm A) \<and> A = (SOME P. P \<in> carrier_mat (dim_row A) (dim_row A) \<and> invertible_mat P \<and> A = P * algorithm A) * algorithm A \<and> Hermite_JNF associates res (algorithm A)
[PROOF STEP]
have some_P: "?some_P \<in> carrier_mat m m \<and> invertible_mat ?some_P \<and> A = ?some_P * algorithm A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (SOME P. P \<in> carrier_mat m m \<and> invertible_mat P \<and> A = P * algorithm A) \<in> carrier_mat m m \<and> invertible_mat (SOME P. P \<in> carrier_mat m m \<and> invertible_mat P \<and> A = P * algorithm A) \<and> A = (SOME P. P \<in> carrier_mat m m \<and> invertible_mat P \<and> A = P * algorithm A) * algorithm A
[PROOF STEP]
by (smt P verit_sko_ex_indirect)
[PROOF STATE]
proof (state)
this:
(SOME P. P \<in> carrier_mat m m \<and> invertible_mat P \<and> A = P * algorithm A) \<in> carrier_mat m m \<and> invertible_mat (SOME P. P \<in> carrier_mat m m \<and> invertible_mat P \<and> A = P * algorithm A) \<and> A = (SOME P. P \<in> carrier_mat m m \<and> invertible_mat P \<and> A = P * algorithm A) * algorithm A

goal (1 subgoal):
 1. \<And>A. (SOME P. P \<in> carrier_mat (dim_row A) (dim_row A) \<and> invertible_mat P \<and> A = P * algorithm A) \<in> carrier_mat (dim_row A) (dim_row A) \<and> algorithm A \<in> carrier_mat (dim_row A) (dim_col A) \<and> invertible_mat (SOME P. P \<in> carrier_mat (dim_row A) (dim_row A) \<and> invertible_mat P \<and> A = P * algorithm A) \<and> A = (SOME P. P \<in> carrier_mat (dim_row A) (dim_row A) \<and> invertible_mat P \<and> A = P * algorithm A) * algorithm A \<and> Hermite_JNF associates res (algorithm A)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(SOME P. P \<in> carrier_mat m m \<and> invertible_mat P \<and> A = P * algorithm A) \<in> carrier_mat m m \<and> invertible_mat (SOME P. P \<in> carrier_mat m m \<and> invertible_mat P \<and> A = P * algorithm A) \<and> A = (SOME P. P \<in> carrier_mat m m \<and> invertible_mat P \<and> A = P * algorithm A) * algorithm A

goal (1 subgoal):
 1. \<And>A. (SOME P. P \<in> carrier_mat (dim_row A) (dim_row A) \<and> invertible_mat P \<and> A = P * algorithm A) \<in> carrier_mat (dim_row A) (dim_row A) \<and> algorithm A \<in> carrier_mat (dim_row A) (dim_col A) \<and> invertible_mat (SOME P. P \<in> carrier_mat (dim_row A) (dim_row A) \<and> invertible_mat P \<and> A = P * algorithm A) \<and> A = (SOME P. P \<in> carrier_mat (dim_row A) (dim_row A) \<and> invertible_mat P \<and> A = P * algorithm A) * algorithm A \<and> Hermite_JNF associates res (algorithm A)
[PROOF STEP]
have "algorithm A \<in> carrier_mat (dim_row A) (dim_col A)"
    and  "Hermite_JNF associates res (algorithm A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. algorithm A \<in> carrier_mat (dim_row A) (dim_col A) &&& Hermite_JNF associates res (algorithm A)
[PROOF STEP]
using s
[PROOF STATE]
proof (prove)
using this:
is_sound_HNF' algorithm associates res

goal (1 subgoal):
 1. algorithm A \<in> carrier_mat (dim_row A) (dim_col A) &&& Hermite_JNF associates res (algorithm A)
[PROOF STEP]
unfolding is_sound_HNF'_def Let_def
[PROOF STATE]
proof (prove)
using this:
\<forall>A. Hermite_JNF associates res (algorithm A) \<and> algorithm A \<in> carrier_mat (dim_row A) (dim_col A) \<and> (\<exists>P. P \<in> carrier_mat (dim_row A) (dim_row A) \<and> invertible_mat P \<and> A = P * algorithm A)

goal (1 subgoal):
 1. algorithm A \<in> carrier_mat (dim_row A) (dim_col A) &&& Hermite_JNF associates res (algorithm A)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
algorithm A \<in> carrier_mat (dim_row A) (dim_col A)
Hermite_JNF associates res (algorithm A)

goal (1 subgoal):
 1. \<And>A. (SOME P. P \<in> carrier_mat (dim_row A) (dim_row A) \<and> invertible_mat P \<and> A = P * algorithm A) \<in> carrier_mat (dim_row A) (dim_row A) \<and> algorithm A \<in> carrier_mat (dim_row A) (dim_col A) \<and> invertible_mat (SOME P. P \<in> carrier_mat (dim_row A) (dim_row A) \<and> invertible_mat P \<and> A = P * algorithm A) \<and> A = (SOME P. P \<in> carrier_mat (dim_row A) (dim_row A) \<and> invertible_mat P \<and> A = P * algorithm A) * algorithm A \<and> Hermite_JNF associates res (algorithm A)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
(SOME P. P \<in> carrier_mat m m \<and> invertible_mat P \<and> A = P * algorithm A) \<in> carrier_mat m m \<and> invertible_mat (SOME P. P \<in> carrier_mat m m \<and> invertible_mat P \<and> A = P * algorithm A) \<and> A = (SOME P. P \<in> carrier_mat m m \<and> invertible_mat P \<and> A = P * algorithm A) * algorithm A
algorithm A \<in> carrier_mat (dim_row A) (dim_col A)
Hermite_JNF associates res (algorithm A)
[PROOF STEP]
show "?some_P \<in> carrier_mat m m \<and> algorithm A \<in> carrier_mat m (dim_col A)
    \<and> invertible_mat ?some_P \<and> A = ?some_P * algorithm A \<and> Hermite_JNF associates res (algorithm A)"
[PROOF STATE]
proof (prove)
using this:
(SOME P. P \<in> carrier_mat m m \<and> invertible_mat P \<and> A = P * algorithm A) \<in> carrier_mat m m \<and> invertible_mat (SOME P. P \<in> carrier_mat m m \<and> invertible_mat P \<and> A = P * algorithm A) \<and> A = (SOME P. P \<in> carrier_mat m m \<and> invertible_mat P \<and> A = P * algorithm A) * algorithm A
algorithm A \<in> carrier_mat (dim_row A) (dim_col A)
Hermite_JNF associates res (algorithm A)

goal (1 subgoal):
 1. (SOME P. P \<in> carrier_mat m m \<and> invertible_mat P \<and> A = P * algorithm A) \<in> carrier_mat m m \<and> algorithm A \<in> carrier_mat m (dim_col A) \<and> invertible_mat (SOME P. P \<in> carrier_mat m m \<and> invertible_mat P \<and> A = P * algorithm A) \<and> A = (SOME P. P \<in> carrier_mat m m \<and> invertible_mat P \<and> A = P * algorithm A) * algorithm A \<and> Hermite_JNF associates res (algorithm A)
[PROOF STEP]
unfolding is_sound_HNF_def Let_def m_def
[PROOF STATE]
proof (prove)
using this:
(SOME P. P \<in> carrier_mat (dim_row A) (dim_row A) \<and> invertible_mat P \<and> A = P * algorithm A) \<in> carrier_mat (dim_row A) (dim_row A) \<and> invertible_mat (SOME P. P \<in> carrier_mat (dim_row A) (dim_row A) \<and> invertible_mat P \<and> A = P * algorithm A) \<and> A = (SOME P. P \<in> carrier_mat (dim_row A) (dim_row A) \<and> invertible_mat P \<and> A = P * algorithm A) * algorithm A
algorithm A \<in> carrier_mat (dim_row A) (dim_col A)
Hermite_JNF associates res (algorithm A)

goal (1 subgoal):
 1. (SOME P. P \<in> carrier_mat (dim_row A) (dim_row A) \<and> invertible_mat P \<and> A = P * algorithm A) \<in> carrier_mat (dim_row A) (dim_row A) \<and> algorithm A \<in> carrier_mat (dim_row A) (dim_col A) \<and> invertible_mat (SOME P. P \<in> carrier_mat (dim_row A) (dim_row A) \<and> invertible_mat P \<and> A = P * algorithm A) \<and> A = (SOME P. P \<in> carrier_mat (dim_row A) (dim_row A) \<and> invertible_mat P \<and> A = P * algorithm A) * algorithm A \<and> Hermite_JNF associates res (algorithm A)
[PROOF STEP]
by (auto split: prod.split)
[PROOF STATE]
proof (state)
this:
(SOME P. P \<in> carrier_mat m m \<and> invertible_mat P \<and> A = P * algorithm A) \<in> carrier_mat m m \<and> algorithm A \<in> carrier_mat m (dim_col A) \<and> invertible_mat (SOME P. P \<in> carrier_mat m m \<and> invertible_mat P \<and> A = P * algorithm A) \<and> A = (SOME P. P \<in> carrier_mat m m \<and> invertible_mat P \<and> A = P * algorithm A) * algorithm A \<and> Hermite_JNF associates res (algorithm A)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma vint_distributive_law:
  assumes "x \<in>\<^sub>\<circ> \<int>\<^sub>\<circ>" and "y \<in>\<^sub>\<circ> \<int>\<^sub>\<circ>" and "z \<in>\<^sub>\<circ> \<int>\<^sub>\<circ>"
  shows "x *\<^sub>\<int> (y +\<^sub>\<int> z) = (x *\<^sub>\<int> y) +\<^sub>\<int> (x *\<^sub>\<int> z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x *\<^sub>\<int> (y +\<^sub>\<int> z) = x *\<^sub>\<int> y +\<^sub>\<int> (x *\<^sub>\<int> z)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x *\<^sub>\<int> (y +\<^sub>\<int> z) = x *\<^sub>\<int> y +\<^sub>\<int> (x *\<^sub>\<int> z)
[PROOF STEP]
have "x' * (y' + z') = (x' * y') + (x' * z')" for x' y' z' :: int
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x' * (y' + z') = x' * y' + x' * z'
[PROOF STEP]
by (simp add: algebra_simps)
[PROOF STATE]
proof (state)
this:
?x' * (?y' + ?z') = ?x' * ?y' + ?x' * ?z'

goal (1 subgoal):
 1. x *\<^sub>\<int> (y +\<^sub>\<int> z) = x *\<^sub>\<int> y +\<^sub>\<int> (x *\<^sub>\<int> z)
[PROOF STEP]
from this[untransferred, OF assms]
[PROOF STATE]
proof (chain)
picking this:
x *\<^sub>\<int> (y +\<^sub>\<int> z) = x *\<^sub>\<int> y +\<^sub>\<int> (x *\<^sub>\<int> z)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
x *\<^sub>\<int> (y +\<^sub>\<int> z) = x *\<^sub>\<int> y +\<^sub>\<int> (x *\<^sub>\<int> z)

goal (1 subgoal):
 1. x *\<^sub>\<int> (y +\<^sub>\<int> z) = x *\<^sub>\<int> y +\<^sub>\<int> (x *\<^sub>\<int> z)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
x *\<^sub>\<int> (y +\<^sub>\<int> z) = x *\<^sub>\<int> y +\<^sub>\<int> (x *\<^sub>\<int> z)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma  trace_sub: "trace ((A::'a::comm_ring_1^'n^'n) - B) = trace A - trace B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. trace (A - B) = trace A - trace B
[PROOF STEP]
by (simp add: trace_def sum_subtractf)


[STATEMENT]
lemma integral_normal_moment_odd:
  "integral\<^sup>L lborel (\<lambda>x. normal_density \<mu> \<sigma> x * (x - \<mu>)^(2 * k + 1)) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. LBINT x. normal_density \<mu> \<sigma> x * (x - \<mu>) ^ (2 * k + 1) = 0
[PROOF STEP]
using normal_moment_odd
[PROOF STATE]
proof (prove)
using this:
has_bochner_integral lborel (\<lambda>x. normal_density \<mu> \<sigma> x * (x - \<mu>) ^ (2 * k + 1)) 0

goal (1 subgoal):
 1. LBINT x. normal_density \<mu> \<sigma> x * (x - \<mu>) ^ (2 * k + 1) = 0
[PROOF STEP]
by (rule has_bochner_integral_integral_eq)


[STATEMENT]
lemma is_zariski_open_Union [intro]:
  "(\<And>x. x \<in> F \<Longrightarrow> is_zariski_open x) \<Longrightarrow> is_zariski_open (\<Union> F)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>x. x \<in> F \<Longrightarrow> is_zariski_open x) \<Longrightarrow> is_zariski_open (\<Union> F)
[PROOF STEP]
by (simp add: UN is_zariski_open_def)


[STATEMENT]
lemma lossless_sample_set_excl:
  assumes "finite Q"
    and "card Q > 2"
  shows "lossless_spmf (sample_set_excl Q {P})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lossless_spmf (sample_set_excl Q {P})
[PROOF STEP]
unfolding sample_set_excl_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lossless_spmf (spmf_of_set (Q - {P}))
[PROOF STEP]
using assms subset_singletonD
[PROOF STATE]
proof (prove)
using this:
finite Q
2 < card Q
?A \<subseteq> {?x} \<Longrightarrow> ?A = {} \<or> ?A = {?x}

goal (1 subgoal):
 1. lossless_spmf (spmf_of_set (Q - {P}))
[PROOF STEP]
by fastforce


[STATEMENT]
lemma am_is_in_V_correct[THEN order_trans, refine_vcg]:
    assumes "(am,adjacent_nodes) \<in> nat_rel \<rightarrow> \<langle>nat_rel\<rangle>list_set_rel"
    shows "am_is_in_V am u \<le> (spec x. x \<longleftrightarrow> u\<in>V)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. am_is_in_V am u \<le> (spec x. x = (u \<in> V))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. am_is_in_V am u \<le> (spec x. x = (u \<in> V))
[PROOF STEP]
have "u\<in>V \<longleftrightarrow> adjacent_nodes u \<noteq> {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (u \<in> V) = (adjacent_nodes u \<noteq> {})
[PROOF STEP]
unfolding V_def adjacent_nodes_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (u \<in> {u. \<exists>v. (u, v) \<in> E \<or> (v, u) \<in> E}) = (E `` {u} \<union> E\<inverse> `` {u} \<noteq> {})
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(u \<in> V) = (adjacent_nodes u \<noteq> {})

goal (1 subgoal):
 1. am_is_in_V am u \<le> (spec x. x = (u \<in> V))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(u \<in> V) = (adjacent_nodes u \<noteq> {})

goal (1 subgoal):
 1. am_is_in_V am u \<le> (spec x. x = (u \<in> V))
[PROOF STEP]
have "\<dots> \<longleftrightarrow> am u \<noteq> []"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (adjacent_nodes u \<noteq> {}) = (am u \<noteq> [])
[PROOF STEP]
using fun_relD[OF assms IdI[of u]]
[PROOF STATE]
proof (prove)
using this:
(am u, adjacent_nodes u) \<in> \<langle>nat_rel\<rangle>list_set_rel

goal (1 subgoal):
 1. (adjacent_nodes u \<noteq> {}) = (am u \<noteq> [])
[PROOF STEP]
by (auto simp: list_set_rel_def in_br_conv)
[PROOF STATE]
proof (state)
this:
(adjacent_nodes u \<noteq> {}) = (am u \<noteq> [])

goal (1 subgoal):
 1. am_is_in_V am u \<le> (spec x. x = (u \<in> V))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(u \<in> V) = (am u \<noteq> [])
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(u \<in> V) = (am u \<noteq> [])

goal (1 subgoal):
 1. am_is_in_V am u \<le> (spec x. x = (u \<in> V))
[PROOF STEP]
unfolding am_is_in_V_def
[PROOF STATE]
proof (prove)
using this:
(u \<in> V) = (am u \<noteq> [])

goal (1 subgoal):
 1. return (am u \<noteq> []) \<le> (spec x. x = (u \<in> V))
[PROOF STEP]
by refine_vcg auto
[PROOF STATE]
proof (state)
this:
am_is_in_V am u \<le> (spec x. x = (u \<in> V))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma prv_softSubst_imp_subst:
  assumes [simp,intro!]: "x \<in> var" "t \<in> trm" "\<phi> \<in> fmla" "x \<notin> FvarsT t"
  shows "prv (imp (softSubst \<phi> t x) (subst \<phi> t x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prv (imp (softSubst \<phi> t x) (subst \<phi> t x))
[PROOF STEP]
unfolding softSubst_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prv (imp (exi x (cnj (eql (Var x) t) \<phi>)) (subst \<phi> t x))
[PROOF STEP]
apply(rule prv_exi_imp_gen)
[PROOF STATE]
proof (prove)
goal (5 subgoals):
 1. x \<in> var
 2. cnj (eql (Var x) t) \<phi> \<in> fmla
 3. subst \<phi> t x \<in> fmla
 4. x \<notin> Fvars (subst \<phi> t x)
 5. prv (imp (cnj (eql (Var x) t) \<phi>) (subst \<phi> t x))
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> var
[PROOF STEP]
by auto
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. cnj (eql (Var x) t) \<phi> \<in> fmla
 2. subst \<phi> t x \<in> fmla
 3. x \<notin> Fvars (subst \<phi> t x)
 4. prv (imp (cnj (eql (Var x) t) \<phi>) (subst \<phi> t x))
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cnj (eql (Var x) t) \<phi> \<in> fmla
[PROOF STEP]
by auto
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. subst \<phi> t x \<in> fmla
 2. x \<notin> Fvars (subst \<phi> t x)
 3. prv (imp (cnj (eql (Var x) t) \<phi>) (subst \<phi> t x))
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subst \<phi> t x \<in> fmla
[PROOF STEP]
by auto
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. x \<notin> Fvars (subst \<phi> t x)
 2. prv (imp (cnj (eql (Var x) t) \<phi>) (subst \<phi> t x))
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<notin> Fvars (subst \<phi> t x)
[PROOF STEP]
by auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prv (imp (cnj (eql (Var x) t) \<phi>) (subst \<phi> t x))
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prv (imp (cnj (eql (Var x) t) \<phi>) (subst \<phi> t x))
[PROOF STEP]
by (metis Var assms(1-3) eql subst prv_cnj_imp_monoR2 prv_eql_subst_trm subst_same_Var)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
.


[STATEMENT]
lemma bmod_assoc_aux2:
  "\<Squnion>{\<Squnion>{(f::'a \<Rightarrow> 'b::proto_near_quantale) u \<cdot> g v \<cdot> h w |v w. R y v w} |u y. R x u y}
     = \<Squnion>{f u \<cdot> g v \<cdot> h w |u v w y. R y v w \<and> R x u y}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Squnion>{\<Squnion>{f u \<cdot> g v \<cdot> h w |v w. R y v w} |u y. R x u y} = \<Squnion>{uu_. \<exists>u v w y. uu_ = f u \<cdot> g v \<cdot> h w \<and> R y v w \<and> R x u y}
[PROOF STEP]
apply (rule antisym)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<Squnion>{\<Squnion>{f u \<cdot> g v \<cdot> h w |v w. R y v w} |u y. R x u y} \<le> \<Squnion>{uu_. \<exists>u v w y. uu_ = f u \<cdot> g v \<cdot> h w \<and> R y v w \<and> R x u y}
 2. \<Squnion>{uu_. \<exists>u v w y. uu_ = f u \<cdot> g v \<cdot> h w \<and> R y v w \<and> R x u y} \<le> \<Squnion>{\<Squnion>{f u \<cdot> g v \<cdot> h w |v w. R y v w} |u y. R x u y}
[PROOF STEP]
apply (rule Sup_least, safe)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>xa u y. R x u y \<Longrightarrow> \<Squnion>{f u \<cdot> g v \<cdot> h w |v w. R y v w} \<le> \<Squnion>{uu_. \<exists>u v w y. uu_ = f u \<cdot> g v \<cdot> h w \<and> R y v w \<and> R x u y}
 2. \<Squnion>{uu_. \<exists>u v w y. uu_ = f u \<cdot> g v \<cdot> h w \<and> R y v w \<and> R x u y} \<le> \<Squnion>{\<Squnion>{f u \<cdot> g v \<cdot> h w |v w. R y v w} |u y. R x u y}
[PROOF STEP]
apply (intro Sup_least Sup_upper, force)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Squnion>{uu_. \<exists>u v w y. uu_ = f u \<cdot> g v \<cdot> h w \<and> R y v w \<and> R x u y} \<le> \<Squnion>{\<Squnion>{f u \<cdot> g v \<cdot> h w |v w. R y v w} |u y. R x u y}
[PROOF STEP]
apply (rule Sup_least, safe)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>xa u v w y. \<lbrakk>R y v w; R x u y\<rbrakk> \<Longrightarrow> f u \<cdot> g v \<cdot> h w \<le> \<Squnion>{\<Squnion>{f u \<cdot> g v \<cdot> h w |v w. R y v w} |u y. R x u y}
[PROOF STEP]
by (rule Sup_upper2, auto)+


[STATEMENT]
lemma homeomorphic_convex_compact_sets:
  fixes S :: "'a::euclidean_space set" and T :: "'b::euclidean_space set"
  assumes "convex S" "compact S" "convex T" "compact T"
      and affeq: "aff_dim S = aff_dim T"
    shows "S homeomorphic T"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. S homeomorphic T
[PROOF STEP]
using homeomorphic_convex_lemma [OF assms] assms
[PROOF STATE]
proof (prove)
using this:
S - rel_interior S homeomorphic T - rel_interior T \<and> S homeomorphic T
convex S
compact S
convex T
compact T
aff_dim S = aff_dim T

goal (1 subgoal):
 1. S homeomorphic T
[PROOF STEP]
by (auto simp: rel_frontier_def)


[STATEMENT]
lemma s'_calc: "$s'_n = ((1+i).^n - 1) / $\<delta>" if "i \<noteq> 0" "n \<ge> 0" for n::real
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. $s'_n = ((1 + i) .^ n - 1) / $\<delta>
[PROOF STEP]
unfolding acc_cont_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral {0..n} ((.^) (1 + i)) = ((1 + i) .^ n - 1) / $\<delta>
[PROOF STEP]
apply (rule integral_unique)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((.^) (1 + i) has_integral ((1 + i) .^ n - 1) / $\<delta>) {0..n}
[PROOF STEP]
using has_integral_powr2_from_0[OF v_futr_pos _ that(2)] i_force_def that
[PROOF STATE]
proof (prove)
using this:
1 + i \<noteq> 1 \<Longrightarrow> ((.^) (1 + i) has_integral ((1 + i) .^ n - 1) / ln (1 + i)) {0..n}
$\<delta>[?i] \<equiv> ln (1 + ?i)
i \<noteq> 0
0 \<le> n

goal (1 subgoal):
 1. ((.^) (1 + i) has_integral ((1 + i) .^ n - 1) / $\<delta>) {0..n}
[PROOF STEP]
by simp


[STATEMENT]
lemma n_leaves_nodes: "n_leaves t = Suc (n_nodes t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n_leaves t = Suc (n_nodes t)
[PROOF STEP]
apply (induct t)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. n_leaves Lf = Suc (n_nodes Lf)
 2. \<And>x1 t1 t2. \<lbrakk>n_leaves t1 = Suc (n_nodes t1); n_leaves t2 = Suc (n_nodes t2)\<rbrakk> \<Longrightarrow> n_leaves (Br x1 t1 t2) = Suc (n_nodes (Br x1 t1 t2))
[PROOF STEP]
apply (metis n_leaves.simps(1) n_nodes.simps(1))
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x1 t1 t2. \<lbrakk>n_leaves t1 = Suc (n_nodes t1); n_leaves t2 = Suc (n_nodes t2)\<rbrakk> \<Longrightarrow> n_leaves (Br x1 t1 t2) = Suc (n_nodes (Br x1 t1 t2))
[PROOF STEP]
by auto


[STATEMENT]
lemma \<P>\<^sub>1_sum_ge:
  assumes "0 \<le> u"
  shows "u \<le> (\<Sum>t\<le>n. l^t *\<^sub>R \<P>\<^sub>1 ^^t) u"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. u \<le> blinfun_apply (\<Sum>t\<le>n. l ^ t *\<^sub>R \<P>\<^sub>1 ^^ t) u
[PROOF STEP]
using \<P>\<^sub>1_n_disc_pos[OF assms, of "Suc _"]
[PROOF STATE]
proof (prove)
using this:
0 \<le> blinfun_apply (l ^ Suc ?uu6 *\<^sub>R \<P>\<^sub>1 ^^ Suc ?uu6) u

goal (1 subgoal):
 1. u \<le> blinfun_apply (\<Sum>t\<le>n. l ^ t *\<^sub>R \<P>\<^sub>1 ^^ t) u
[PROOF STEP]
by (induction n) (auto intro: add_increasing2 simp add: blinfun.add_left)


[STATEMENT]
lemma LeadsTo_Diff:
     "[| F \<in> (A-B) LeadsTo C;  F \<in> (A \<inter> B) LeadsTo C |]
      ==> F \<in> A LeadsTo C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>F \<in> A - B \<longmapsto>w C; F \<in> A \<inter> B \<longmapsto>w C\<rbrakk> \<Longrightarrow> F \<in> A \<longmapsto>w C
[PROOF STEP]
by (blast intro: LeadsTo_Un LeadsTo_weaken)


[STATEMENT]
lemma tendsto_Pair [tendsto_intros]:
  assumes "(f \<longlongrightarrow> a) F" and "(g \<longlongrightarrow> b) F"
  shows "((\<lambda>x. (f x, g x)) \<longlongrightarrow> (a, b)) F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. (f x, g x)) \<longlongrightarrow> (a, b)) F
[PROOF STEP]
unfolding nhds_prod
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. LIM x F. (f x, g x) :> nhds a \<times>\<^sub>F nhds b
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
(f \<longlongrightarrow> a) F
(g \<longlongrightarrow> b) F

goal (1 subgoal):
 1. LIM x F. (f x, g x) :> nhds a \<times>\<^sub>F nhds b
[PROOF STEP]
by (rule filterlim_Pair)


[STATEMENT]
lemma SUP_is_arg_max:
  assumes "x \<in> X" "bdd_above (f ` X)" "(f :: 'c \<Rightarrow> real) x = \<Squnion>(f ` X)"
  shows "is_arg_max f (\<lambda>x. x \<in> X) x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_arg_max f (\<lambda>x. x \<in> X) x
[PROOF STEP]
unfolding is_arg_max_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> X \<and> (\<nexists>y. y \<in> X \<and> f x < f y)
[PROOF STEP]
using not_less assms cSUP_upper[of _ X f]
[PROOF STATE]
proof (prove)
using this:
(\<not> ?x < ?y) = (?y \<le> ?x)
x \<in> X
bdd_above (f ` X)
f x = \<Squnion> (f ` X)
\<lbrakk>?x \<in> X; bdd_above (f ` X)\<rbrakk> \<Longrightarrow> f ?x \<le> \<Squnion> (f ` X)

goal (1 subgoal):
 1. x \<in> X \<and> (\<nexists>y. y \<in> X \<and> f x < f y)
[PROOF STEP]
by auto


[STATEMENT]
lemma scalar_prod_smult_right[simp]:
  "dim_vec w = dim_vec v \<Longrightarrow> w \<bullet> (k \<cdot>\<^sub>v v) = (k :: 'a :: comm_semiring_0) * (w \<bullet> v)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_vec w = dim_vec v \<Longrightarrow> w \<bullet> (k \<cdot>\<^sub>v v) = k * (w \<bullet> v)
[PROOF STEP]
unfolding scalar_prod_def sum_distrib_left
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_vec w = dim_vec v \<Longrightarrow> (\<Sum>i = 0..<dim_vec (k \<cdot>\<^sub>v v). w $ i * (k \<cdot>\<^sub>v v) $ i) = (\<Sum>n = 0..<dim_vec v. k * (w $ n * v $ n))
[PROOF STEP]
by (auto intro: sum.cong simp: ac_simps)


[STATEMENT]
lemma rotater_map2:
  "length xs = length ys \<Longrightarrow>
    rotater n (map2 f xs ys) = map2 f (rotater n xs) (rotater n ys)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length xs = length ys \<Longrightarrow> rotater n (map2 f xs ys) = map2 f (rotater n xs) (rotater n ys)
[PROOF STEP]
by (induct n) (auto intro!: lrth)


[STATEMENT]
lemma lcm_0_right [simp]: "lcm a 0 = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lcm a (0::'a) = (0::'a)
[PROOF STEP]
by (simp add: lcm_gcd)


[STATEMENT]
lemma cor_cmod_real:
  assumes "is_real a"
  shows "cor (cmod a) = a \<or> cor (cmod a) = -a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cor (cmod a) = a \<or> cor (cmod a) = - a
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
is_real a

goal (1 subgoal):
 1. cor (cmod a) = a \<or> cor (cmod a) = - a
[PROOF STEP]
unfolding cmod_def
[PROOF STATE]
proof (prove)
using this:
is_real a

goal (1 subgoal):
 1. cor (sqrt ((Re a)\<^sup>2 + (Im a)\<^sup>2)) = a \<or> cor (sqrt ((Re a)\<^sup>2 + (Im a)\<^sup>2)) = - a
[PROOF STEP]
by (cases "Re a > 0") auto


[STATEMENT]
lemma inj_segment:
  fixes a :: "'a :: real_vector"
  assumes "a \<noteq> b"
    shows "inj_on (\<lambda>u. (1 - u) *\<^sub>R a + u *\<^sub>R b) I"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on (\<lambda>u. (1 - u) *\<^sub>R a + u *\<^sub>R b) I
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> I; y \<in> I; (1 - x) *\<^sub>R a + x *\<^sub>R b = (1 - y) *\<^sub>R a + y *\<^sub>R b\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
fix x y
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> I; y \<in> I; (1 - x) *\<^sub>R a + x *\<^sub>R b = (1 - y) *\<^sub>R a + y *\<^sub>R b\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
assume "(1 - x) *\<^sub>R a + x *\<^sub>R b = (1 - y) *\<^sub>R a + y *\<^sub>R b"
[PROOF STATE]
proof (state)
this:
(1 - x) *\<^sub>R a + x *\<^sub>R b = (1 - y) *\<^sub>R a + y *\<^sub>R b

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> I; y \<in> I; (1 - x) *\<^sub>R a + x *\<^sub>R b = (1 - y) *\<^sub>R a + y *\<^sub>R b\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(1 - x) *\<^sub>R a + x *\<^sub>R b = (1 - y) *\<^sub>R a + y *\<^sub>R b
[PROOF STEP]
have "x *\<^sub>R (b - a) = y *\<^sub>R (b - a)"
[PROOF STATE]
proof (prove)
using this:
(1 - x) *\<^sub>R a + x *\<^sub>R b = (1 - y) *\<^sub>R a + y *\<^sub>R b

goal (1 subgoal):
 1. x *\<^sub>R (b - a) = y *\<^sub>R (b - a)
[PROOF STEP]
by (simp add: algebra_simps)
[PROOF STATE]
proof (state)
this:
x *\<^sub>R (b - a) = y *\<^sub>R (b - a)

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> I; y \<in> I; (1 - x) *\<^sub>R a + x *\<^sub>R b = (1 - y) *\<^sub>R a + y *\<^sub>R b\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
a \<noteq> b
x *\<^sub>R (b - a) = y *\<^sub>R (b - a)
[PROOF STEP]
show "x = y"
[PROOF STATE]
proof (prove)
using this:
a \<noteq> b
x *\<^sub>R (b - a) = y *\<^sub>R (b - a)

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem n_subsets:
  assumes "finite A"
  shows "card {B. B \<subseteq> A \<and> card B = k} = card A choose k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card {B. B \<subseteq> A \<and> card B = k} = card A choose k
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. card {B. B \<subseteq> A \<and> card B = k} = card A choose k
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
finite A
[PROOF STEP]
obtain f where bij: "bij_betw f {0..<card A} A"
[PROOF STATE]
proof (prove)
using this:
finite A

goal (1 subgoal):
 1. (\<And>f. bij_betw f {0..<card A} A \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (blast dest: ex_bij_betw_nat_finite)
[PROOF STATE]
proof (state)
this:
bij_betw f {0..<card A} A

goal (1 subgoal):
 1. card {B. B \<subseteq> A \<and> card B = k} = card A choose k
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
bij_betw f {0..<card A} A
[PROOF STEP]
have [simp]: "card (f ` C) = card C" if "C \<subseteq> {0..<card A}" for C
[PROOF STATE]
proof (prove)
using this:
bij_betw f {0..<card A} A

goal (1 subgoal):
 1. card (f ` C) = card C
[PROOF STEP]
by (meson bij_betw_imp_inj_on bij_betw_subset card_image that)
[PROOF STATE]
proof (state)
this:
?C \<subseteq> {0..<card A} \<Longrightarrow> card (f ` ?C) = card ?C

goal (1 subgoal):
 1. card {B. B \<subseteq> A \<and> card B = k} = card A choose k
[PROOF STEP]
from bij
[PROOF STATE]
proof (chain)
picking this:
bij_betw f {0..<card A} A
[PROOF STEP]
have "bij_betw (image f) (Pow {0..<card A}) (Pow A)"
[PROOF STATE]
proof (prove)
using this:
bij_betw f {0..<card A} A

goal (1 subgoal):
 1. bij_betw ((`) f) (Pow {0..<card A}) (Pow A)
[PROOF STEP]
by (rule bij_betw_Pow)
[PROOF STATE]
proof (state)
this:
bij_betw ((`) f) (Pow {0..<card A}) (Pow A)

goal (1 subgoal):
 1. card {B. B \<subseteq> A \<and> card B = k} = card A choose k
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
bij_betw ((`) f) (Pow {0..<card A}) (Pow A)
[PROOF STEP]
have "inj_on (image f) (Pow {0..<card A})"
[PROOF STATE]
proof (prove)
using this:
bij_betw ((`) f) (Pow {0..<card A}) (Pow A)

goal (1 subgoal):
 1. inj_on ((`) f) (Pow {0..<card A})
[PROOF STEP]
by (rule bij_betw_imp_inj_on)
[PROOF STATE]
proof (state)
this:
inj_on ((`) f) (Pow {0..<card A})

goal (1 subgoal):
 1. card {B. B \<subseteq> A \<and> card B = k} = card A choose k
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
inj_on ((`) f) (Pow {0..<card A})

goal (1 subgoal):
 1. card {B. B \<subseteq> A \<and> card B = k} = card A choose k
[PROOF STEP]
have "{K. K \<subseteq> {0..<card A} \<and> card K = k} \<subseteq> Pow {0..<card A}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {K. K \<subseteq> {0..<card A} \<and> card K = k} \<subseteq> Pow {0..<card A}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{K. K \<subseteq> {0..<card A} \<and> card K = k} \<subseteq> Pow {0..<card A}

goal (1 subgoal):
 1. card {B. B \<subseteq> A \<and> card B = k} = card A choose k
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
inj_on ((`) f) (Pow {0..<card A})
{K. K \<subseteq> {0..<card A} \<and> card K = k} \<subseteq> Pow {0..<card A}
[PROOF STEP]
have "inj_on (image f) {K. K \<subseteq> {0..<card A} \<and> card K = k}"
[PROOF STATE]
proof (prove)
using this:
inj_on ((`) f) (Pow {0..<card A})
{K. K \<subseteq> {0..<card A} \<and> card K = k} \<subseteq> Pow {0..<card A}

goal (1 subgoal):
 1. inj_on ((`) f) {K. K \<subseteq> {0..<card A} \<and> card K = k}
[PROOF STEP]
by (rule inj_on_subset)
[PROOF STATE]
proof (state)
this:
inj_on ((`) f) {K. K \<subseteq> {0..<card A} \<and> card K = k}

goal (1 subgoal):
 1. card {B. B \<subseteq> A \<and> card B = k} = card A choose k
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
inj_on ((`) f) {K. K \<subseteq> {0..<card A} \<and> card K = k}
[PROOF STEP]
have "card {K. K \<subseteq> {0..<card A} \<and> card K = k} =
      card (image f ` {K. K \<subseteq> {0..<card A} \<and> card K = k})" (is "_ = card ?C")
[PROOF STATE]
proof (prove)
using this:
inj_on ((`) f) {K. K \<subseteq> {0..<card A} \<and> card K = k}

goal (1 subgoal):
 1. card {K. K \<subseteq> {0..<card A} \<and> card K = k} = card ((`) f ` {K. K \<subseteq> {0..<card A} \<and> card K = k})
[PROOF STEP]
by (simp add: card_image)
[PROOF STATE]
proof (state)
this:
card {K. K \<subseteq> {0..<card A} \<and> card K = k} = card ((`) f ` {K. K \<subseteq> {0..<card A} \<and> card K = k})

goal (1 subgoal):
 1. card {B. B \<subseteq> A \<and> card B = k} = card A choose k
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
card {K. K \<subseteq> {0..<card A} \<and> card K = k} = card ((`) f ` {K. K \<subseteq> {0..<card A} \<and> card K = k})

goal (1 subgoal):
 1. card {B. B \<subseteq> A \<and> card B = k} = card A choose k
[PROOF STEP]
have "?C = {K. K \<subseteq> f ` {0..<card A} \<and> card K = k}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (`) f ` {K. K \<subseteq> {0..<card A} \<and> card K = k} = {K. K \<subseteq> f ` {0..<card A} \<and> card K = k}
[PROOF STEP]
by (auto elim!: subset_imageE)
[PROOF STATE]
proof (state)
this:
(`) f ` {K. K \<subseteq> {0..<card A} \<and> card K = k} = {K. K \<subseteq> f ` {0..<card A} \<and> card K = k}

goal (1 subgoal):
 1. card {B. B \<subseteq> A \<and> card B = k} = card A choose k
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(`) f ` {K. K \<subseteq> {0..<card A} \<and> card K = k} = {K. K \<subseteq> f ` {0..<card A} \<and> card K = k}

goal (1 subgoal):
 1. card {B. B \<subseteq> A \<and> card B = k} = card A choose k
[PROOF STEP]
have "f ` {0..<card A} = A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f ` {0..<card A} = A
[PROOF STEP]
by (meson bij bij_betw_def)
[PROOF STATE]
proof (state)
this:
f ` {0..<card A} = A

goal (1 subgoal):
 1. card {B. B \<subseteq> A \<and> card B = k} = card A choose k
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
card {K. K \<subseteq> {0..<card A} \<and> card K = k} = card {K. K \<subseteq> A \<and> card K = k}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
card {K. K \<subseteq> {0..<card A} \<and> card K = k} = card {K. K \<subseteq> A \<and> card K = k}

goal (1 subgoal):
 1. card {B. B \<subseteq> A \<and> card B = k} = card A choose k
[PROOF STEP]
by (simp add: binomial_def)
[PROOF STATE]
proof (state)
this:
card {B. B \<subseteq> A \<and> card B = k} = card A choose k

goal:
No subgoals!
[PROOF STEP]
qed