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

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

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

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma trivial_limit_at_left_real [simp]: "\<not> trivial_limit (at_left x)"
  for x :: "'a::{no_bot,dense_order,linorder_topology}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. at_left x \<noteq> bot
[PROOF STEP]
using lt_ex [of x]
[PROOF STATE]
proof (prove)
using this:
\<exists>y. y < x

goal (1 subgoal):
 1. at_left x \<noteq> bot
[PROOF STEP]
by safe (auto simp add: trivial_limit_def eventually_at_left dest: dense)


[STATEMENT]
lemma round_altdef: "round x = (if frac x \<ge> 1/2 then \<lceil>x\<rceil> else \<lfloor>x\<rfloor>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. round x = (if (1::'a) / (2::'a) \<le> frac x then \<lceil>x\<rceil> else \<lfloor>x\<rfloor>)
[PROOF STEP]
by (cases "frac x \<ge> 1/2")
    (rule round_unique, ((simp add: frac_def field_simps ceiling_altdef; linarith)+)[2])+


[STATEMENT]
lemma bin_carry_bounded:
  shows "bin_carry a b k = bin_carry a b k mod 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bin_carry a b k = bin_carry a b k mod 2
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. bin_carry a b k = bin_carry a b k mod 2
[PROOF STEP]
have "a mod 2 ^ k <  2 ^k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a mod 2 ^ k < 2 ^ k
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
a mod 2 ^ k < 2 ^ k

goal (1 subgoal):
 1. bin_carry a b k = bin_carry a b k mod 2
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
a mod 2 ^ k < 2 ^ k

goal (1 subgoal):
 1. bin_carry a b k = bin_carry a b k mod 2
[PROOF STEP]
have "b mod 2 ^ k < 2 ^ k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. b mod 2 ^ k < 2 ^ k
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
b mod 2 ^ k < 2 ^ k

goal (1 subgoal):
 1. bin_carry a b k = bin_carry a b k mod 2
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
a mod 2 ^ k < 2 ^ k
b mod 2 ^ k < 2 ^ k
[PROOF STEP]
have "(a mod 2 ^ k + b mod 2 ^ k) <  2 ^(Suc k)"
[PROOF STATE]
proof (prove)
using this:
a mod 2 ^ k < 2 ^ k
b mod 2 ^ k < 2 ^ k

goal (1 subgoal):
 1. a mod 2 ^ k + b mod 2 ^ k < 2 ^ Suc k
[PROOF STEP]
by (simp add: mult_2 add_strict_mono)
[PROOF STATE]
proof (state)
this:
a mod 2 ^ k + b mod 2 ^ k < 2 ^ Suc k

goal (1 subgoal):
 1. bin_carry a b k = bin_carry a b k mod 2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a mod 2 ^ k + b mod 2 ^ k < 2 ^ Suc k
[PROOF STEP]
have "(a mod 2 ^ k + b mod 2 ^ k) div 2^k  \<le> 1"
[PROOF STATE]
proof (prove)
using this:
a mod 2 ^ k + b mod 2 ^ k < 2 ^ Suc k

goal (1 subgoal):
 1. (a mod 2 ^ k + b mod 2 ^ k) div 2 ^ k \<le> 1
[PROOF STEP]
using less_mult_imp_div_less
[PROOF STATE]
proof (prove)
using this:
a mod 2 ^ k + b mod 2 ^ k < 2 ^ Suc k
?m < ?i * ?n \<Longrightarrow> ?m div ?n < ?i

goal (1 subgoal):
 1. (a mod 2 ^ k + b mod 2 ^ k) div 2 ^ k \<le> 1
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
(a mod 2 ^ k + b mod 2 ^ k) div 2 ^ k \<le> 1

goal (1 subgoal):
 1. bin_carry a b k = bin_carry a b k mod 2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(a mod 2 ^ k + b mod 2 ^ k) div 2 ^ k \<le> 1
[PROOF STEP]
have "bin_carry a b k \<le> 1"
[PROOF STATE]
proof (prove)
using this:
(a mod 2 ^ k + b mod 2 ^ k) div 2 ^ k \<le> 1

goal (1 subgoal):
 1. bin_carry a b k \<le> 1
[PROOF STEP]
using div_le_mono bin_carry_def
[PROOF STATE]
proof (prove)
using this:
(a mod 2 ^ k + b mod 2 ^ k) div 2 ^ k \<le> 1
?m \<le> ?n \<Longrightarrow> ?m div ?k \<le> ?n div ?k
bin_carry ?a ?b ?k = (?a mod 2 ^ ?k + ?b mod 2 ^ ?k) div 2 ^ ?k

goal (1 subgoal):
 1. bin_carry a b k \<le> 1
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
bin_carry a b k \<le> 1

goal (1 subgoal):
 1. bin_carry a b k = bin_carry a b k mod 2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
bin_carry a b k \<le> 1
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
bin_carry a b k \<le> 1

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma SUP_is_Sup: "(SUP f\<in>F. f y) = \<Squnion>{(f::'a \<Rightarrow> 'b::proto_near_quantale) y |f. f \<in> F}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (SUP f\<in>F. f y) = \<Squnion>{f y |f. f \<in> F}
[PROOF STEP]
proof (rule antisym)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (SUP f\<in>F. f y) \<le> \<Squnion>{f y |f. f \<in> F}
 2. \<Squnion>{f y |f. f \<in> F} \<le> (SUP f\<in>F. f y)
[PROOF STEP]
fix f::"'a \<Rightarrow> 'b::proto_near_quantale"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (SUP f\<in>F. f y) \<le> \<Squnion>{f y |f. f \<in> F}
 2. \<Squnion>{f y |f. f \<in> F} \<le> (SUP f\<in>F. f y)
[PROOF STEP]
have "f \<in> F \<Longrightarrow> f y \<in> {f y |f. f \<in> F}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<in> F \<Longrightarrow> f y \<in> {f y |f. f \<in> F}
[PROOF STEP]
by (simp add: Setcompr_eq_image)
[PROOF STATE]
proof (state)
this:
f \<in> F \<Longrightarrow> f y \<in> {f y |f. f \<in> F}

goal (2 subgoals):
 1. (SUP f\<in>F. f y) \<le> \<Squnion>{f y |f. f \<in> F}
 2. \<Squnion>{f y |f. f \<in> F} \<le> (SUP f\<in>F. f y)
[PROOF STEP]
hence "f \<in> F \<Longrightarrow> f y \<le> \<Squnion>{f y |f. f \<in> F}"
[PROOF STATE]
proof (prove)
using this:
f \<in> F \<Longrightarrow> f y \<in> {f y |f. f \<in> F}

goal (1 subgoal):
 1. f \<in> F \<Longrightarrow> f y \<le> \<Squnion>{f y |f. f \<in> F}
[PROOF STEP]
by (simp add: Sup_upper)
[PROOF STATE]
proof (state)
this:
f \<in> F \<Longrightarrow> f y \<le> \<Squnion>{f y |f. f \<in> F}

goal (2 subgoals):
 1. (SUP f\<in>F. f y) \<le> \<Squnion>{f y |f. f \<in> F}
 2. \<Squnion>{f y |f. f \<in> F} \<le> (SUP f\<in>F. f y)
[PROOF STEP]
thus "(SUP f\<in>F. f y) \<le> \<Squnion>{(f::'a \<Rightarrow> 'b::proto_near_quantale) y |f. f \<in> F}"
[PROOF STATE]
proof (prove)
using this:
f \<in> F \<Longrightarrow> f y \<le> \<Squnion>{f y |f. f \<in> F}

goal (1 subgoal):
 1. (SUP f\<in>F. f y) \<le> \<Squnion>{f y |f. f \<in> F}
[PROOF STEP]
by (simp add: Setcompr_eq_image)
[PROOF STATE]
proof (state)
this:
(SUP f\<in>F. f y) \<le> \<Squnion>{f y |f. f \<in> F}

goal (1 subgoal):
 1. \<Squnion>{f y |f. f \<in> F} \<le> (SUP f\<in>F. f y)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<Squnion>{f y |f. f \<in> F} \<le> (SUP f\<in>F. f y)
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<Squnion>{f y |f. f \<in> F} \<le> (SUP f\<in>F. f y)
[PROOF STEP]
have "x \<in> {f y |f. f \<in> F} \<Longrightarrow> x \<le> (SUP f\<in>F. f y) "
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> {f y |f. f \<in> F} \<Longrightarrow> x \<le> (SUP f\<in>F. f y)
[PROOF STEP]
using mk_disjoint_insert
[PROOF STATE]
proof (prove)
using this:
?a \<in> ?A \<Longrightarrow> \<exists>B. ?A = insert ?a B \<and> ?a \<notin> B

goal (1 subgoal):
 1. x \<in> {f y |f. f \<in> F} \<Longrightarrow> x \<le> (SUP f\<in>F. f y)
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
x \<in> {f y |f. f \<in> F} \<Longrightarrow> x \<le> (SUP f\<in>F. f y)

goal (1 subgoal):
 1. \<Squnion>{f y |f. f \<in> F} \<le> (SUP f\<in>F. f y)
[PROOF STEP]
thus "Sup {(f::'a \<Rightarrow> 'b::proto_near_quantale) y |f. f \<in> F} \<le> (SUP f\<in>F. f y)"
[PROOF STATE]
proof (prove)
using this:
x \<in> {f y |f. f \<in> F} \<Longrightarrow> x \<le> (SUP f\<in>F. f y)

goal (1 subgoal):
 1. \<Squnion>{f y |f. f \<in> F} \<le> (SUP f\<in>F. f y)
[PROOF STEP]
by (simp add: Setcompr_eq_image)
[PROOF STATE]
proof (state)
this:
\<Squnion>{f y |f. f \<in> F} \<le> (SUP f\<in>F. f y)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma sums_minus: "f sums a \<Longrightarrow> (\<lambda>n. - f n) sums (- a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f sums a \<Longrightarrow> (\<lambda>n. - f n) sums - a
[PROOF STEP]
unfolding sums_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. sum f {..<n}) \<longlonglongrightarrow> a \<Longrightarrow> (\<lambda>n. \<Sum>n<n. - f n) \<longlonglongrightarrow> - a
[PROOF STEP]
by (simp add: sum_negf tendsto_minus)


[STATEMENT]
lemma shows_list_gen_map:
  "shows_list_gen f e l sep r (map g xs) = shows_list_gen (f o g) e l sep r xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. shows_list_gen f e l sep r (map g xs) = shows_list_gen (f \<circ> g) e l sep r xs
[PROOF STEP]
by (simp_all add: shows_list_gen_def shows_sep_map)


[STATEMENT]
lemma divisors_fun_int: "divisors_fun divisors_int"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. divisors_fun divisors_int
[PROOF STEP]
unfolding divisors_fun_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>x. x \<noteq> 0 \<longrightarrow> set (divisors_int x) = {d. d dvd x}) \<and> (\<forall>x. distinct (divisors_int x))
[PROOF STEP]
using divisors_int
[PROOF STATE]
proof (prove)
using this:
?x \<noteq> 0 \<Longrightarrow> set (divisors_int ?x) = {i. i dvd ?x}
distinct (divisors_int ?x)
divisors_int 0 = []

goal (1 subgoal):
 1. (\<forall>x. x \<noteq> 0 \<longrightarrow> set (divisors_int x) = {d. d dvd x}) \<and> (\<forall>x. distinct (divisors_int x))
[PROOF STEP]
by auto


[STATEMENT]
lemma list_all2_zip: "list_all2 (\<lambda>x y. triple_eq_pair x y f g) xs (zip ys zs) \<Longrightarrow>
  (\<And>y. y \<in> set ys \<Longrightarrow> Q y) \<Longrightarrow> x \<in> set xs \<Longrightarrow> Q (fst x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>list_all2 (\<lambda>x y. triple_eq_pair x y f g) xs (zip ys zs); \<And>y. y \<in> set ys \<Longrightarrow> Q y; x \<in> set xs\<rbrakk> \<Longrightarrow> Q (fst x)
[PROOF STEP]
by (auto simp: in_set_zip elim!: list_all2_in_setE triple_eq_pair.elims)


[STATEMENT]
lemma sigma_sets_empty_eq: "sigma_sets A {} = {{}, A}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sigma_sets A {} = {{}, A}
[PROOF STEP]
proof (intro set_eqI iffI)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x. x \<in> sigma_sets A {} \<Longrightarrow> x \<in> {{}, A}
 2. \<And>x. x \<in> {{}, A} \<Longrightarrow> x \<in> sigma_sets A {}
[PROOF STEP]
fix a
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x. x \<in> sigma_sets A {} \<Longrightarrow> x \<in> {{}, A}
 2. \<And>x. x \<in> {{}, A} \<Longrightarrow> x \<in> sigma_sets A {}
[PROOF STEP]
assume "a \<in> sigma_sets A {}"
[PROOF STATE]
proof (state)
this:
a \<in> sigma_sets A {}

goal (2 subgoals):
 1. \<And>x. x \<in> sigma_sets A {} \<Longrightarrow> x \<in> {{}, A}
 2. \<And>x. x \<in> {{}, A} \<Longrightarrow> x \<in> sigma_sets A {}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a \<in> sigma_sets A {}
[PROOF STEP]
show "a \<in> {{}, A}"
[PROOF STATE]
proof (prove)
using this:
a \<in> sigma_sets A {}

goal (1 subgoal):
 1. a \<in> {{}, A}
[PROOF STEP]
by induct blast+
[PROOF STATE]
proof (state)
this:
a \<in> {{}, A}

goal (1 subgoal):
 1. \<And>x. x \<in> {{}, A} \<Longrightarrow> x \<in> sigma_sets A {}
[PROOF STEP]
qed (auto intro: sigma_sets.Empty sigma_sets_top)


[STATEMENT]
lemma affected_fixate_binary_circle:
  assumes "order f a = 2"
  shows "affected (fixate a f) = affected f - {a, apply f a}" (is "?A = ?B")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. affected (fixate a f) = affected f - {a, f \<langle>$\<rangle> a}
[PROOF STEP]
proof (rule set_eqI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. (x \<in> affected (fixate a f)) = (x \<in> affected f - {a, f \<langle>$\<rangle> a})
[PROOF STEP]
interpret bijection "apply f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bijection ((\<langle>$\<rangle>) f)
[PROOF STEP]
by standard simp
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. (x \<in> affected (fixate a f)) = (x \<in> affected f - {a, f \<langle>$\<rangle> a})
[PROOF STEP]
fix b
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. (x \<in> affected (fixate a f)) = (x \<in> affected f - {a, f \<langle>$\<rangle> a})
[PROOF STEP]
from assms order_greater_eq_two_iff [of f a]
[PROOF STATE]
proof (chain)
picking this:
order f a = 2
(2 \<le> order f a) = (a \<in> affected f)
[PROOF STEP]
have "a \<in> affected f"
[PROOF STATE]
proof (prove)
using this:
order f a = 2
(2 \<le> order f a) = (a \<in> affected f)

goal (1 subgoal):
 1. a \<in> affected f
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
a \<in> affected f

goal (1 subgoal):
 1. \<And>x. (x \<in> affected (fixate a f)) = (x \<in> affected f - {a, f \<langle>$\<rangle> a})
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
a \<in> affected f

goal (1 subgoal):
 1. \<And>x. (x \<in> affected (fixate a f)) = (x \<in> affected f - {a, f \<langle>$\<rangle> a})
[PROOF STEP]
have "apply (f ^ 2) a = a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f\<^sup>2 \<langle>$\<rangle> a = a
[PROOF STEP]
by (simp add: assms [symmetric])
[PROOF STATE]
proof (state)
this:
f\<^sup>2 \<langle>$\<rangle> a = a

goal (1 subgoal):
 1. \<And>x. (x \<in> affected (fixate a f)) = (x \<in> affected f - {a, f \<langle>$\<rangle> a})
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
a \<in> affected f
f\<^sup>2 \<langle>$\<rangle> a = a
[PROOF STEP]
show "b \<in> ?A \<longleftrightarrow> b \<in> ?B"
[PROOF STATE]
proof (prove)
using this:
a \<in> affected f
f\<^sup>2 \<langle>$\<rangle> a = a

goal (1 subgoal):
 1. (b \<in> affected (fixate a f)) = (b \<in> affected f - {a, f \<langle>$\<rangle> a})
[PROOF STEP]
by (cases "b \<in> {a, apply (inverse f) a}")
      (auto simp add: in_affected power2_eq_square apply_inverse apply_times fixate_def)
[PROOF STATE]
proof (state)
this:
(b \<in> affected (fixate a f)) = (b \<in> affected f - {a, f \<langle>$\<rangle> a})

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Arg2pi_arctan_upperhalf:
  assumes "0 < Im z"
    shows "Arg2pi z = pi/2 - arctan(Re z / Im z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Arg2pi z = pi / 2 - arctan (Re z / Im z)
[PROOF STEP]
proof (cases "z = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. z = 0 \<Longrightarrow> Arg2pi z = pi / 2 - arctan (Re z / Im z)
 2. z \<noteq> 0 \<Longrightarrow> Arg2pi z = pi / 2 - arctan (Re z / Im z)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
z \<noteq> 0

goal (2 subgoals):
 1. z = 0 \<Longrightarrow> Arg2pi z = pi / 2 - arctan (Re z / Im z)
 2. z \<noteq> 0 \<Longrightarrow> Arg2pi z = pi / 2 - arctan (Re z / Im z)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Arg2pi z = pi / 2 - arctan (Re z / Im z)
[PROOF STEP]
proof (rule Arg2pi_unique [of "norm z"])
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. complex_of_real (cmod z) * exp (\<i> * complex_of_real (pi / 2 - arctan (Re z / Im z))) = z
 2. 0 < cmod z
 3. 0 \<le> pi / 2 - arctan (Re z / Im z)
 4. pi / 2 - arctan (Re z / Im z) < 2 * pi
[PROOF STEP]
show "(cmod z) * exp (\<i> * (pi / 2 - arctan (Re z / Im z))) = z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. complex_of_real (cmod z) * exp (\<i> * complex_of_real (pi / 2 - arctan (Re z / Im z))) = z
[PROOF STEP]
apply (rule complex_eqI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. Re (complex_of_real (cmod z) * exp (\<i> * complex_of_real (pi / 2 - arctan (Re z / Im z)))) = Re z
 2. Im (complex_of_real (cmod z) * exp (\<i> * complex_of_real (pi / 2 - arctan (Re z / Im z)))) = Im z
[PROOF STEP]
using assms norm_complex_def [of z, symmetric]
[PROOF STATE]
proof (prove)
using this:
0 < Im z
sqrt ((Re z)\<^sup>2 + (Im z)\<^sup>2) = cmod z

goal (2 subgoals):
 1. Re (complex_of_real (cmod z) * exp (\<i> * complex_of_real (pi / 2 - arctan (Re z / Im z)))) = Re z
 2. Im (complex_of_real (cmod z) * exp (\<i> * complex_of_real (pi / 2 - arctan (Re z / Im z)))) = Im z
[PROOF STEP]
unfolding exp_Euler cos_diff sin_diff sin_of_real cos_of_real
[PROOF STATE]
proof (prove)
using this:
0 < Im z
sqrt ((Re z)\<^sup>2 + (Im z)\<^sup>2) = cmod z

goal (2 subgoals):
 1. Re (complex_of_real (cmod z) * (complex_of_real (cos (pi / 2) * cos (arctan (Re z / Im z)) + sin (pi / 2) * sin (arctan (Re z / Im z))) + \<i> * complex_of_real (sin (pi / 2) * cos (arctan (Re z / Im z)) - cos (pi / 2) * sin (arctan (Re z / Im z))))) = Re z
 2. Im (complex_of_real (cmod z) * (complex_of_real (cos (pi / 2) * cos (arctan (Re z / Im z)) + sin (pi / 2) * sin (arctan (Re z / Im z))) + \<i> * complex_of_real (sin (pi / 2) * cos (arctan (Re z / Im z)) - cos (pi / 2) * sin (arctan (Re z / Im z))))) = Im z
[PROOF STEP]
by (simp_all add: field_simps real_sqrt_divide sin_arctan cos_arctan)
[PROOF STATE]
proof (state)
this:
complex_of_real (cmod z) * exp (\<i> * complex_of_real (pi / 2 - arctan (Re z / Im z))) = z

goal (3 subgoals):
 1. 0 < cmod z
 2. 0 \<le> pi / 2 - arctan (Re z / Im z)
 3. pi / 2 - arctan (Re z / Im z) < 2 * pi
[PROOF STEP]
qed (use False arctan [of "Re z / Im z"] in auto)
[PROOF STATE]
proof (state)
this:
Arg2pi z = pi / 2 - arctan (Re z / Im z)

goal (1 subgoal):
 1. z = 0 \<Longrightarrow> Arg2pi z = pi / 2 - arctan (Re z / Im z)
[PROOF STEP]
qed (use assms in auto)


[STATEMENT]
lemma fps_exp_neq_numeral_iff [simp]:
  "fps_exp (c :: 'a :: field_char_0) = numeral n \<longleftrightarrow> c = 0 \<and> n = Num.One"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (fps_exp c = numeral n) = (c = (0::'a) \<and> n = num.One)
[PROOF STEP]
unfolding numeral_fps_const fps_exp_eq_fps_const_iff
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (c = (0::'a) \<and> numeral n = (1::'a)) = (c = (0::'a) \<and> n = num.One)
[PROOF STEP]
by simp


[STATEMENT]
lemma aff_dim_unique:
  fixes B V :: "'n::euclidean_space set"
  assumes "affine hull B = affine hull V \<and> \<not> affine_dependent B"
  shows "of_nat (card B) = aff_dim V + 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. int (card B) = aff_dim V + 1
[PROOF STEP]
proof (cases "B = {}")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. B = {} \<Longrightarrow> int (card B) = aff_dim V + 1
 2. B \<noteq> {} \<Longrightarrow> int (card B) = aff_dim V + 1
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
B = {}

goal (2 subgoals):
 1. B = {} \<Longrightarrow> int (card B) = aff_dim V + 1
 2. B \<noteq> {} \<Longrightarrow> int (card B) = aff_dim V + 1
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
B = {}
[PROOF STEP]
have "V = {}"
[PROOF STATE]
proof (prove)
using this:
B = {}

goal (1 subgoal):
 1. V = {}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
B = {}
affine hull B = affine hull V \<and> \<not> affine_dependent B

goal (1 subgoal):
 1. V = {}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
V = {}

goal (2 subgoals):
 1. B = {} \<Longrightarrow> int (card B) = aff_dim V + 1
 2. B \<noteq> {} \<Longrightarrow> int (card B) = aff_dim V + 1
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
V = {}
[PROOF STEP]
have "aff_dim V = (-1::int)"
[PROOF STATE]
proof (prove)
using this:
V = {}

goal (1 subgoal):
 1. aff_dim V = - 1
[PROOF STEP]
using aff_dim_empty
[PROOF STATE]
proof (prove)
using this:
V = {}
(?S = {}) = (aff_dim ?S = - 1)

goal (1 subgoal):
 1. aff_dim V = - 1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
aff_dim V = - 1

goal (2 subgoals):
 1. B = {} \<Longrightarrow> int (card B) = aff_dim V + 1
 2. B \<noteq> {} \<Longrightarrow> int (card B) = aff_dim V + 1
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
aff_dim V = - 1
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
aff_dim V = - 1

goal (1 subgoal):
 1. int (card B) = aff_dim V + 1
[PROOF STEP]
using \<open>B = {}\<close>
[PROOF STATE]
proof (prove)
using this:
aff_dim V = - 1
B = {}

goal (1 subgoal):
 1. int (card B) = aff_dim V + 1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
int (card B) = aff_dim V + 1

goal (1 subgoal):
 1. B \<noteq> {} \<Longrightarrow> int (card B) = aff_dim V + 1
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. B \<noteq> {} \<Longrightarrow> int (card B) = aff_dim V + 1
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
B \<noteq> {}

goal (1 subgoal):
 1. B \<noteq> {} \<Longrightarrow> int (card B) = aff_dim V + 1
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
B \<noteq> {}
[PROOF STEP]
obtain a where a: "a \<in> B"
[PROOF STATE]
proof (prove)
using this:
B \<noteq> {}

goal (1 subgoal):
 1. (\<And>a. a \<in> B \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
a \<in> B

goal (1 subgoal):
 1. B \<noteq> {} \<Longrightarrow> int (card B) = aff_dim V + 1
[PROOF STEP]
define Lb where "Lb = span ((\<lambda>x. -a+x) ` (B-{a}))"
[PROOF STATE]
proof (state)
this:
Lb = span ((+) (- a) ` (B - {a}))

goal (1 subgoal):
 1. B \<noteq> {} \<Longrightarrow> int (card B) = aff_dim V + 1
[PROOF STEP]
have "affine_parallel (affine hull B) Lb"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. affine_parallel (affine hull B) Lb
[PROOF STEP]
using Lb_def affine_hull_span2[of a B] a
      affine_parallel_commut[of "Lb" "(affine hull B)"]
[PROOF STATE]
proof (prove)
using this:
Lb = span ((+) (- a) ` (B - {a}))
a \<in> B \<Longrightarrow> affine hull B = (+) a ` span ((+) (- a) ` (B - {a}))
a \<in> B
affine_parallel Lb (affine hull B) \<Longrightarrow> affine_parallel (affine hull B) Lb

goal (1 subgoal):
 1. affine_parallel (affine hull B) Lb
[PROOF STEP]
unfolding affine_parallel_def
[PROOF STATE]
proof (prove)
using this:
Lb = span ((+) (- a) ` (B - {a}))
a \<in> B \<Longrightarrow> affine hull B = (+) a ` span ((+) (- a) ` (B - {a}))
a \<in> B
\<exists>a. affine hull B = (+) a ` Lb \<Longrightarrow> \<exists>a. Lb = (+) a ` (affine hull B)

goal (1 subgoal):
 1. \<exists>a. Lb = (+) a ` (affine hull B)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
affine_parallel (affine hull B) Lb

goal (1 subgoal):
 1. B \<noteq> {} \<Longrightarrow> int (card B) = aff_dim V + 1
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
affine_parallel (affine hull B) Lb

goal (1 subgoal):
 1. B \<noteq> {} \<Longrightarrow> int (card B) = aff_dim V + 1
[PROOF STEP]
have "subspace Lb"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subspace Lb
[PROOF STEP]
using Lb_def subspace_span
[PROOF STATE]
proof (prove)
using this:
Lb = span ((+) (- a) ` (B - {a}))
subspace (span ?S)

goal (1 subgoal):
 1. subspace Lb
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
subspace Lb

goal (1 subgoal):
 1. B \<noteq> {} \<Longrightarrow> int (card B) = aff_dim V + 1
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
affine_parallel (affine hull B) Lb
subspace Lb
[PROOF STEP]
have "aff_dim B = int(dim Lb)"
[PROOF STATE]
proof (prove)
using this:
affine_parallel (affine hull B) Lb
subspace Lb

goal (1 subgoal):
 1. aff_dim B = int (dim Lb)
[PROOF STEP]
using aff_dim_parallel_subspace[of B Lb] \<open>B \<noteq> {}\<close>
[PROOF STATE]
proof (prove)
using this:
affine_parallel (affine hull B) Lb
subspace Lb
\<lbrakk>B \<noteq> {}; subspace Lb; affine_parallel (affine hull B) Lb\<rbrakk> \<Longrightarrow> aff_dim B = int (dim Lb)
B \<noteq> {}

goal (1 subgoal):
 1. aff_dim B = int (dim Lb)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
aff_dim B = int (dim Lb)

goal (1 subgoal):
 1. B \<noteq> {} \<Longrightarrow> int (card B) = aff_dim V + 1
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
aff_dim B = int (dim Lb)

goal (1 subgoal):
 1. B \<noteq> {} \<Longrightarrow> int (card B) = aff_dim V + 1
[PROOF STEP]
have "(card B) - 1 = dim Lb" "finite B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card B - 1 = dim Lb &&& finite B
[PROOF STEP]
using Lb_def aff_dim_parallel_subspace_aux a assms
[PROOF STATE]
proof (prove)
using this:
Lb = span ((+) (- a) ` (B - {a}))
\<lbrakk>\<not> affine_dependent ?B; ?a \<in> ?B\<rbrakk> \<Longrightarrow> finite ?B \<and> card ?B - 1 = dim (span ((+) (- ?a) ` (?B - {?a})))
a \<in> B
affine hull B = affine hull V \<and> \<not> affine_dependent B

goal (1 subgoal):
 1. card B - 1 = dim Lb &&& finite B
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
card B - 1 = dim Lb
finite B

goal (1 subgoal):
 1. B \<noteq> {} \<Longrightarrow> int (card B) = aff_dim V + 1
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
aff_dim B = int (dim Lb)
card B - 1 = dim Lb
finite B
[PROOF STEP]
have "of_nat (card B) = aff_dim B + 1"
[PROOF STATE]
proof (prove)
using this:
aff_dim B = int (dim Lb)
card B - 1 = dim Lb
finite B

goal (1 subgoal):
 1. int (card B) = aff_dim B + 1
[PROOF STEP]
using \<open>B \<noteq> {}\<close> card_gt_0_iff[of B]
[PROOF STATE]
proof (prove)
using this:
aff_dim B = int (dim Lb)
card B - 1 = dim Lb
finite B
B \<noteq> {}
(0 < card B) = (B \<noteq> {} \<and> finite B)

goal (1 subgoal):
 1. int (card B) = aff_dim B + 1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
int (card B) = aff_dim B + 1

goal (1 subgoal):
 1. B \<noteq> {} \<Longrightarrow> int (card B) = aff_dim V + 1
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
int (card B) = aff_dim B + 1
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
int (card B) = aff_dim B + 1

goal (1 subgoal):
 1. int (card B) = aff_dim V + 1
[PROOF STEP]
using aff_dim_affine_hull2 assms
[PROOF STATE]
proof (prove)
using this:
int (card B) = aff_dim B + 1
affine hull ?S = affine hull ?T \<Longrightarrow> aff_dim ?S = aff_dim ?T
affine hull B = affine hull V \<and> \<not> affine_dependent B

goal (1 subgoal):
 1. int (card B) = aff_dim V + 1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
int (card B) = aff_dim V + 1

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma foldseq_zero:
assumes fz: "f 0 0 = 0" and sz: "\<forall>i. i <= n \<longrightarrow> s i = 0"
shows "foldseq f s n = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. foldseq f s n = (0::'a)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. foldseq f s n = (0::'a)
[PROOF STEP]
have "\<And>n. \<forall>s. (\<forall>i. i <= n \<longrightarrow> s i = 0) \<longrightarrow> foldseq f s n = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. \<forall>s. (\<forall>i\<le>n. s i = (0::'a)) \<longrightarrow> foldseq f s n = (0::'a)
[PROOF STEP]
apply (induct_tac n)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>n. \<forall>s. (\<forall>i\<le>0. s i = (0::'a)) \<longrightarrow> foldseq f s 0 = (0::'a)
 2. \<And>n na. \<forall>s. (\<forall>i\<le>na. s i = (0::'a)) \<longrightarrow> foldseq f s na = (0::'a) \<Longrightarrow> \<forall>s. (\<forall>i\<le>Suc na. s i = (0::'a)) \<longrightarrow> foldseq f s (Suc na) = (0::'a)
[PROOF STEP]
apply (simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n na. \<forall>s. (\<forall>i\<le>na. s i = (0::'a)) \<longrightarrow> foldseq f s na = (0::'a) \<Longrightarrow> \<forall>s. (\<forall>i\<le>Suc na. s i = (0::'a)) \<longrightarrow> foldseq f s (Suc na) = (0::'a)
[PROOF STEP]
by (simp add: fz)
[PROOF STATE]
proof (state)
this:
\<forall>s. (\<forall>i\<le>?n. s i = (0::'a)) \<longrightarrow> foldseq f s ?n = (0::'a)

goal (1 subgoal):
 1. foldseq f s n = (0::'a)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>s. (\<forall>i\<le>?n. s i = (0::'a)) \<longrightarrow> foldseq f s ?n = (0::'a)
[PROOF STEP]
show "foldseq f s n = 0"
[PROOF STATE]
proof (prove)
using this:
\<forall>s. (\<forall>i\<le>?n. s i = (0::'a)) \<longrightarrow> foldseq f s ?n = (0::'a)

goal (1 subgoal):
 1. foldseq f s n = (0::'a)
[PROOF STEP]
by (simp add: sz)
[PROOF STATE]
proof (state)
this:
foldseq f s n = (0::'a)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma map_div_is_smult_inverse: "map_poly (\<lambda>x. x / (a :: 'a :: field)) p = smult (inverse a) p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map_poly (\<lambda>x. x / a) p = smult (inverse a) p
[PROOF STEP]
unfolding smult_conv_map_poly
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map_poly (\<lambda>x. x / a) p = map_poly ((*) (inverse a)) p
[PROOF STEP]
by (simp add: divide_inverse_commute)


[STATEMENT]
lemma det_four_block_mat_lower_left_zero_col: assumes A1: "A1 \<in> carrier_mat 1 1"
  and A2: "A2 \<in> carrier_mat 1 n"
  and A30: "A3 = (0\<^sub>m n 1)"
  and A4: "A4 \<in> carrier_mat n n"
  shows "det (four_block_mat A1 A2 A3 A4) = det A1 * det A4" (is "det ?A = _")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. det (four_block_mat A1 A2 A3 A4) = det A1 * det A4
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. det (four_block_mat A1 A2 A3 A4) = det A1 * det A4
[PROOF STEP]
from A30
[PROOF STATE]
proof (chain)
picking this:
A3 = 0\<^sub>m n 1
[PROOF STEP]
have A3: "A3 \<in> carrier_mat n 1"
[PROOF STATE]
proof (prove)
using this:
A3 = 0\<^sub>m n 1

goal (1 subgoal):
 1. A3 \<in> carrier_mat n 1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
A3 \<in> carrier_mat n 1

goal (1 subgoal):
 1. det (four_block_mat A1 A2 A3 A4) = det A1 * det A4
[PROOF STEP]
let ?B = "four_block_mat A2 A1 A4 A3"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. det (four_block_mat A1 A2 A3 A4) = det A1 * det A4
[PROOF STEP]
from four_block_carrier_mat[OF A2 A3]
[PROOF STATE]
proof (chain)
picking this:
four_block_mat A2 ?B ?C A3 \<in> carrier_mat (1 + n) (n + 1)
[PROOF STEP]
have B: "?B \<in> carrier_mat (Suc n) (Suc n)"
[PROOF STATE]
proof (prove)
using this:
four_block_mat A2 ?B ?C A3 \<in> carrier_mat (1 + n) (n + 1)

goal (1 subgoal):
 1. four_block_mat A2 A1 A4 A3 \<in> carrier_mat (Suc n) (Suc n)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
four_block_mat A2 A1 A4 A3 \<in> carrier_mat (Suc n) (Suc n)

goal (1 subgoal):
 1. det (four_block_mat A1 A2 A3 A4) = det A1 * det A4
[PROOF STEP]
from arg_cong[OF swap_col_to_front_four_block[OF A2 A1 A4 A3], of det]
    swap_col_to_front_det[OF B, of n]
[PROOF STATE]
proof (chain)
picking this:
det (swap_col_to_front (four_block_mat A2 A1 A4 A3) n) = det (four_block_mat A1 A2 A3 A4)
n < Suc n \<Longrightarrow> det (swap_col_to_front (four_block_mat A2 A1 A4 A3) n) = (- (1::'a)) ^ n * det (four_block_mat A2 A1 A4 A3)
[PROOF STEP]
have "det ?A = (-1)^n * det ?B"
[PROOF STATE]
proof (prove)
using this:
det (swap_col_to_front (four_block_mat A2 A1 A4 A3) n) = det (four_block_mat A1 A2 A3 A4)
n < Suc n \<Longrightarrow> det (swap_col_to_front (four_block_mat A2 A1 A4 A3) n) = (- (1::'a)) ^ n * det (four_block_mat A2 A1 A4 A3)

goal (1 subgoal):
 1. det (four_block_mat A1 A2 A3 A4) = (- (1::'a)) ^ n * det (four_block_mat A2 A1 A4 A3)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
det (four_block_mat A1 A2 A3 A4) = (- (1::'a)) ^ n * det (four_block_mat A2 A1 A4 A3)

goal (1 subgoal):
 1. det (four_block_mat A1 A2 A3 A4) = det A1 * det A4
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
det (four_block_mat A1 A2 A3 A4) = (- (1::'a)) ^ n * det (four_block_mat A2 A1 A4 A3)

goal (1 subgoal):
 1. det (four_block_mat A1 A2 A3 A4) = det A1 * det A4
[PROOF STEP]
have "det ?B = (- 1) ^ n * det A1 * det A4"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. det (four_block_mat A2 A1 A4 A3) = (- (1::'a)) ^ n * det A1 * det A4
[PROOF STEP]
by (rule det_four_block_mat_lower_right_zero_col[OF A2 A1 A4 A30])
[PROOF STATE]
proof (state)
this:
det (four_block_mat A2 A1 A4 A3) = (- (1::'a)) ^ n * det A1 * det A4

goal (1 subgoal):
 1. det (four_block_mat A1 A2 A3 A4) = det A1 * det A4
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
det (four_block_mat A2 A1 A4 A3) = (- (1::'a)) ^ n * det A1 * det A4

goal (1 subgoal):
 1. det (four_block_mat A1 A2 A3 A4) = det A1 * det A4
[PROOF STEP]
have "(-1)^n * \<dots> = (-1 * -1)^n * det A1 * det A4"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (- (1::'a)) ^ n * ((- (1::'a)) ^ n * det A1 * det A4) = (- (1::'a) * - (1::'a)) ^ n * det A1 * det A4
[PROOF STEP]
unfolding power_mult_distrib
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (- (1::'a)) ^ n * ((- (1::'a)) ^ n * det A1 * det A4) = (- (1::'a)) ^ n * (- (1::'a)) ^ n * det A1 * det A4
[PROOF STEP]
by (simp add: ac_simps)
[PROOF STATE]
proof (state)
this:
(- (1::'a)) ^ n * ((- (1::'a)) ^ n * det A1 * det A4) = (- (1::'a) * - (1::'a)) ^ n * det A1 * det A4

goal (1 subgoal):
 1. det (four_block_mat A1 A2 A3 A4) = det A1 * det A4
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
det (four_block_mat A1 A2 A3 A4) = (- (1::'a) * - (1::'a)) ^ n * det A1 * det A4
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
det (four_block_mat A1 A2 A3 A4) = (- (1::'a) * - (1::'a)) ^ n * det A1 * det A4

goal (1 subgoal):
 1. det (four_block_mat A1 A2 A3 A4) = det A1 * det A4
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
det (four_block_mat A1 A2 A3 A4) = det A1 * det A4

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma N_row_list_map_elem: "j < \<b> \<Longrightarrow> i < \<v> \<Longrightarrow>
    row N i $ j = map_vec (\<lambda> bl . if ((\<V>s ! i) \<in> bl) then 1 else 0) (vec_of_list \<B>s) $ j"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>j < \<b>; i < \<v>\<rbrakk> \<Longrightarrow> row N i $ j = map_vec (\<lambda>bl. if \<V>s ! i \<in> bl then 1 else 0) (vec_of_list \<B>s) $ j
[PROOF STEP]
by (metis inc_mat_row_list_map_elem points_list_length blocks_list_length)


[STATEMENT]
lemma pmf_of_set_pmf_of_mapping:
  assumes "A \<noteq> {}" "set xs = A" "distinct xs"
  shows   "pmf_of_set A = pmf_of_mapping (Mapping.tabulate xs (\<lambda>_. 1 / real (length xs)))"
           (is "?lhs = ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pmf_of_set A = pmf_of_mapping (Mapping.tabulate xs (\<lambda>_. 1 / real (length xs)))
[PROOF STEP]
by (rule pmf_eqI, subst pmf_of_mapping)
     (insert assms, auto intro!: All_mapping_tabulate
                         simp: Mapping.lookup_default_def lookup_tabulate distinct_card)


[STATEMENT]
lemma comp_ring_morphisms:
  assumes "ring_homomorphism \<eta> A addA multA zeroA oneA B addB multB zeroB oneB"
and "ring_homomorphism \<theta> B addB multB zeroB oneB C addC multC zeroC oneC"
shows "ring_homomorphism (compose A \<theta> \<eta>) A addA multA zeroA oneA C addC multC zeroC oneC"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ring_homomorphism (\<theta> \<circ> \<eta> \<down> A) A addA multA zeroA oneA C addC multC zeroC oneC
[PROOF STEP]
using comp_monoid_morphisms comp_group_morphisms assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>monoid_homomorphism ?\<eta> ?A ?multA ?oneA ?B ?multB ?oneB; monoid_homomorphism ?\<theta> ?B ?multB ?oneB ?C ?multC ?oneC\<rbrakk> \<Longrightarrow> monoid_homomorphism (?\<theta> \<circ> ?\<eta> \<down> ?A) ?A ?multA ?oneA ?C ?multC ?oneC
\<lbrakk>group_homomorphism ?\<eta> ?A ?multA ?oneA ?B ?multB ?oneB; group_homomorphism ?\<theta> ?B ?multB ?oneB ?C ?multC ?oneC\<rbrakk> \<Longrightarrow> group_homomorphism (?\<theta> \<circ> ?\<eta> \<down> ?A) ?A ?multA ?oneA ?C ?multC ?oneC
ring_homomorphism \<eta> A addA multA zeroA oneA B addB multB zeroB oneB
ring_homomorphism \<theta> B addB multB zeroB oneB C addC multC zeroC oneC

goal (1 subgoal):
 1. ring_homomorphism (\<theta> \<circ> \<eta> \<down> A) A addA multA zeroA oneA C addC multC zeroC oneC
[PROOF STEP]
by (metis monoid_homomorphism_def ring_homomorphism_def)


[STATEMENT]
lemma lemma_approx_less_zero: "x < 0 \<Longrightarrow> x \<notin> Infinitesimal \<Longrightarrow> x \<approx> y \<Longrightarrow> y < 0"
  for x y :: hypreal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x < 0; x \<notin> Infinitesimal; x \<approx> y\<rbrakk> \<Longrightarrow> y < 0
[PROOF STEP]
by (blast dest: Ball_mem_monad_less_zero approx_subset_monad)


[STATEMENT]
lemma subset_eq_diff_conv_zmset: "A - C \<subseteq>#\<^sub>z B \<longleftrightarrow> A \<subseteq>#\<^sub>z B + C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (A - C \<subseteq>#\<^sub>z B) = (A \<subseteq>#\<^sub>z B + C)
[PROOF STEP]
by (simp add: subseteq_zmset_def ordered_ab_group_add_class.diff_le_eq)


[STATEMENT]
lemma is_semialg_map_tupleE:
  assumes "is_semialg_map_tuple m fs"
  assumes "is_semialgebraic ((length fs) + l) S"
  shows " is_semialgebraic (m + l) (tuple_partial_pullback m fs l S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_semialgebraic (m + l) (tuple_partial_pullback m fs l S)
[PROOF STEP]
using is_semialg_map_tuple_def[of m fs] assms is_semialgebraicE[of "((length fs) + l)" S]
[PROOF STATE]
proof (prove)
using this:
is_semialg_map_tuple m fs = (is_function_tuple Q\<^sub>p m fs \<and> (\<forall>l\<ge>0. \<forall>S\<in>semialg_sets (length fs + l). is_semialgebraic (m + l) (tuple_partial_pullback m fs l S)))
is_semialg_map_tuple m fs
is_semialgebraic (length fs + l) S
is_semialgebraic (length fs + l) S \<Longrightarrow> S \<in> semialg_sets (length fs + l)

goal (1 subgoal):
 1. is_semialgebraic (m + l) (tuple_partial_pullback m fs l S)
[PROOF STEP]
by blast


[STATEMENT]
lemma Field_singleton[simp]: "Field {(z,z)} = {z}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Field {(z, z)} = {z}
[PROOF STEP]
by (metis well_order_on_Field well_order_on_singleton)


[STATEMENT]
lemma mult_mono_nonpos_nonneg:
  "a \<le> c \<Longrightarrow> d \<le> b \<Longrightarrow> a \<le> 0 \<Longrightarrow> d \<ge> 0 \<Longrightarrow> a * b \<le> c * (d :: 'a :: linordered_ring)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<le> c; d \<le> b; a \<le> (0::'a); (0::'a) \<le> d\<rbrakk> \<Longrightarrow> a * b \<le> c * d
[PROOF STEP]
using mult_mono[of "-c" "-a" d b]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>- c \<le> - a; d \<le> b; (0::'a) \<le> - a; (0::'a) \<le> d\<rbrakk> \<Longrightarrow> - c * d \<le> - a * b

goal (1 subgoal):
 1. \<lbrakk>a \<le> c; d \<le> b; a \<le> (0::'a); (0::'a) \<le> d\<rbrakk> \<Longrightarrow> a * b \<le> c * d
[PROOF STEP]
by simp


[STATEMENT]
lemma iTILL_subset_conv: "([\<dots>n'] \<subseteq> [\<dots>n]) = (n' \<le> n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ([\<dots>n'] \<subseteq> [\<dots>n]) = (n' \<le> n)
[PROOF STEP]
by (simp add: iTILL_def)


[STATEMENT]
lemma simple_integral_restrict_space:
  assumes \<Omega>: "\<Omega> \<inter> space M \<in> sets M" "simple_function (restrict_space M \<Omega>) f"
  shows "simple_integral (restrict_space M \<Omega>) f = simple_integral M (\<lambda>x. f x * indicator \<Omega> x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral\<^sup>S (restrict_space M \<Omega>) f = \<integral>\<^sup>S x. f x * indicator \<Omega> x \<partial>M
[PROOF STEP]
using simple_function_restrict_space_ennreal[THEN iffD1, OF \<Omega>, THEN simple_functionD(1)]
[PROOF STATE]
proof (prove)
using this:
finite ((\<lambda>x. f x * indicator \<Omega> x) ` space M)

goal (1 subgoal):
 1. integral\<^sup>S (restrict_space M \<Omega>) f = \<integral>\<^sup>S x. f x * indicator \<Omega> x \<partial>M
[PROOF STEP]
by (auto simp add: space_restrict_space emeasure_restrict_space[OF \<Omega>(1)] le_infI2 simple_integral_def
           split: split_indicator split_indicator_asm
           intro!: sum.mono_neutral_cong_left ennreal_mult_left_cong arg_cong2[where f=emeasure])


[STATEMENT]
lemma avl_split_max:
  "\<lbrakk> split_max t = (t',a); avl t; t \<noteq> Leaf \<rbrakk> \<Longrightarrow> case t' of
   Same t' \<Rightarrow> avl t' \<and> height t = height t' |
   Diff t' \<Rightarrow> avl t' \<and> height t = height t' + 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>split_max t = (t', a); avl t; t \<noteq> \<langle>\<rangle>\<rbrakk> \<Longrightarrow> case t' of Same t' \<Rightarrow> avl t' \<and> height t = height t' | Diff t' \<Rightarrow> avl t' \<and> height t = height t' + 1
[PROOF STEP]
apply(induction t arbitrary: t' a rule: split_max_induct)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>l a ba r t' aa. \<lbrakk>\<And>t' a. \<lbrakk>r \<noteq> \<langle>\<rangle>; split_max r = (t', a); avl r; r \<noteq> \<langle>\<rangle>\<rbrakk> \<Longrightarrow> case t' of Same t' \<Rightarrow> avl t' \<and> height r = height t' | Diff t' \<Rightarrow> avl t' \<and> height r = height t' + 1; split_max \<langle>l, (a, ba), r\<rangle> = (t', aa); avl \<langle>l, (a, ba), r\<rangle>; \<langle>l, (a, ba), r\<rangle> \<noteq> \<langle>\<rangle>\<rbrakk> \<Longrightarrow> case t' of Same t' \<Rightarrow> avl t' \<and> height \<langle>l, (a, ba), r\<rangle> = height t' | Diff t' \<Rightarrow> avl t' \<and> height \<langle>l, (a, ba), r\<rangle> = height t' + 1
 2. \<And>t' a. \<lbrakk>split_max \<langle>\<rangle> = (t', a); avl \<langle>\<rangle>; \<langle>\<rangle> \<noteq> \<langle>\<rangle>\<rbrakk> \<Longrightarrow> case t' of Same t' \<Rightarrow> avl t' \<and> height \<langle>\<rangle> = height t' | Diff t' \<Rightarrow> avl t' \<and> height \<langle>\<rangle> = height t' + 1
[PROOF STEP]
apply(fastforce simp: max_absorb1 max_absorb2 split!: splits prod.splits)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>t' a. \<lbrakk>split_max \<langle>\<rangle> = (t', a); avl \<langle>\<rangle>; \<langle>\<rangle> \<noteq> \<langle>\<rangle>\<rbrakk> \<Longrightarrow> case t' of Same t' \<Rightarrow> avl t' \<and> height \<langle>\<rangle> = height t' | Diff t' \<Rightarrow> avl t' \<and> height \<langle>\<rangle> = height t' + 1
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma mat_det_congruence [simp]:
  "mat_det (congruence M H) = (cor ((cmod (mat_det M))\<^sup>2)) * mat_det H"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat_det (congruence M H) = cor ((cmod (mat_det M))\<^sup>2) * mat_det H
[PROOF STEP]
using complex_mult_cnj_cmod[of "mat_det M"]
[PROOF STATE]
proof (prove)
using this:
mat_det M * cnj (mat_det M) = cor ((cmod (mat_det M))\<^sup>2)

goal (1 subgoal):
 1. mat_det (congruence M H) = cor ((cmod (mat_det M))\<^sup>2) * mat_det H
[PROOF STEP]
by (auto simp add: mat_det_adj field_simps)


[STATEMENT]
lemma eval_Pr_prim_Suc:
  assumes "h = Pr n f g" and "prim_recfn (Suc n) h" and "length xs = n"
  shows "eval h (Suc x # xs) = eval g (x # the (eval h (x # xs)) # xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eval h (Suc x # xs) = eval g (x # the (eval h (x # xs)) # xs)
[PROOF STEP]
using assms eval_Pr_converg_Suc prim_recfn_total
[PROOF STATE]
proof (prove)
using this:
h = Pr n f g
prim_recfn (Suc n) h
length xs = n
\<lbrakk>recfn (Suc ?n) (Pr ?n ?f ?g); ?n = length ?xs; eval (Pr ?n ?f ?g) (?x # ?xs) \<down>\<rbrakk> \<Longrightarrow> eval (Pr ?n ?f ?g) (Suc ?x # ?xs) = eval ?g (?x # the (eval (Pr ?n ?f ?g) (?x # ?xs)) # ?xs)
prim_recfn ?n ?f \<Longrightarrow> Partial_Recursive.total ?f

goal (1 subgoal):
 1. eval h (Suc x # xs) = eval g (x # the (eval h (x # xs)) # xs)
[PROOF STEP]
by simp


[STATEMENT]
lemma "check_no_overlap \<gamma> ft = (\<forall>a \<in> set ft. \<forall>b \<in> set ft. (a \<noteq> b \<and> ofe_prio a = ofe_prio b) \<longrightarrow> \<not>(\<exists>p. \<gamma> (ofe_fields a) p \<and> \<gamma> (ofe_fields b) p))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. check_no_overlap \<gamma> ft = (\<forall>a\<in>set ft. \<forall>b\<in>set ft. a \<noteq> b \<and> ofe_prio a = ofe_prio b \<longrightarrow> (\<nexists>p. \<gamma> (ofe_fields a) p \<and> \<gamma> (ofe_fields b) p))
[PROOF STEP]
unfolding check_no_overlap_alt check_no_overlap2_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>a\<in>set ft. \<forall>b\<in>set ft. a \<noteq> b \<and> ofe_prio a = ofe_prio b \<longrightarrow> \<not> (\<exists>p\<in>UNIV. \<gamma> (ofe_fields a) p \<and> \<gamma> (ofe_fields b) p)) = (\<forall>a\<in>set ft. \<forall>b\<in>set ft. a \<noteq> b \<and> ofe_prio a = ofe_prio b \<longrightarrow> (\<nexists>p. \<gamma> (ofe_fields a) p \<and> \<gamma> (ofe_fields b) p))
[PROOF STEP]
by force


[STATEMENT]
lemma list_all2_append:
  "length xs = length ys \<Longrightarrow>
  list_all2 P (xs@us) (ys@vs) = (list_all2 P xs ys \<and> list_all2 P us vs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length xs = length ys \<Longrightarrow> list_all2 P (xs @ us) (ys @ vs) = (list_all2 P xs ys \<and> list_all2 P us vs)
[PROOF STEP]
by (induct rule:list_induct2, simp_all)


[STATEMENT]
lemma single_leadsTo_I:
     "(!!x. x \<in> A ==> F \<in> {x} leadsTo B) ==> F \<in> A leadsTo B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>x. x \<in> A \<Longrightarrow> F \<in> {x} \<longmapsto> B) \<Longrightarrow> F \<in> A \<longmapsto> B
[PROOF STEP]
by (subst UN_singleton [symmetric], rule leadsTo_UN, blast)


[STATEMENT]
lemma mult_conj_real:
  fixes v::complex
  shows "v * (conjugate v) \<in> Reals"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. v * conjugate v \<in> \<real>
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. v * conjugate v \<in> \<real>
[PROOF STEP]
have "0 \<le> v * (conjugate v)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> v * conjugate v
[PROOF STEP]
using less_eq_complex_def
[PROOF STATE]
proof (prove)
using this:
(?x \<le> ?y) = (Re ?x \<le> Re ?y \<and> Im ?x = Im ?y)

goal (1 subgoal):
 1. 0 \<le> v * conjugate v
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
0 \<le> v * conjugate v

goal (1 subgoal):
 1. v * conjugate v \<in> \<real>
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
0 \<le> v * conjugate v

goal (1 subgoal):
 1. v * conjugate v \<in> \<real>
[PROOF STEP]
by (simp add: complex_is_Real_iff)
[PROOF STATE]
proof (state)
this:
v * conjugate v \<in> \<real>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem exActE: "\<turnstile> (\<exists>x. \<diamond>\<langle>F x\<rangle>_v) = \<diamond>\<langle>(\<exists>x. F x)\<rangle>_v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<turnstile> (\<exists>x. \<diamond>\<langle>F x\<rangle>_v) = \<diamond>\<langle>(\<exists>x. F x)\<rangle>_v
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<turnstile> (\<exists>x. \<diamond>\<langle>F x\<rangle>_v) = \<diamond>\<langle>(\<exists>x. F x)\<rangle>_v
[PROOF STEP]
have "\<turnstile> \<not>(\<exists>x. \<diamond>\<langle>F x\<rangle>_v) = \<not>\<diamond>\<langle>(\<exists>x. F x)\<rangle>_v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<turnstile> \<not> (\<exists>x. \<diamond>\<langle>F x\<rangle>_v) = \<not> \<diamond>\<langle>(\<exists>x. F x)\<rangle>_v
[PROOF STEP]
by (auto simp: angle_action_def Not_Rex[int_rewrite] allActBox)
[PROOF STATE]
proof (state)
this:
\<turnstile> \<not> (\<exists>x. \<diamond>\<langle>F x\<rangle>_v) = \<not> \<diamond>\<langle>(\<exists>x. F x)\<rangle>_v

goal (1 subgoal):
 1. \<turnstile> (\<exists>x. \<diamond>\<langle>F x\<rangle>_v) = \<diamond>\<langle>(\<exists>x. F x)\<rangle>_v
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<turnstile> \<not> (\<exists>x. \<diamond>\<langle>F x\<rangle>_v) = \<not> \<diamond>\<langle>(\<exists>x. F x)\<rangle>_v

goal (1 subgoal):
 1. \<turnstile> (\<exists>x. \<diamond>\<langle>F x\<rangle>_v) = \<diamond>\<langle>(\<exists>x. F x)\<rangle>_v
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
\<turnstile> (\<exists>x. \<diamond>\<langle>F x\<rangle>_v) = \<diamond>\<langle>(\<exists>x. F x)\<rangle>_v

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma tan_minus [simp]: "tan (- x) = - tan x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. tan (- x) = - tan x
[PROOF STEP]
by (simp add: tan_def)


[STATEMENT]
lemma LeadsTo_UN_distrib:
     "(F \<in> (\<Union>i \<in> I. A i) LeadsTo B)  =  (\<forall>i \<in> I. F \<in> (A i) LeadsTo B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (F \<in> \<Union> (A ` I) \<longmapsto>w B) = (\<forall>i\<in>I. F \<in> A i \<longmapsto>w B)
[PROOF STEP]
by (blast intro: LeadsTo_UN LeadsTo_weaken_L)


[STATEMENT]
lemma list_map_rel_sv[relator_props]:
    "single_valued Rk \<Longrightarrow> single_valued Rv \<Longrightarrow>
        single_valued (\<langle>Rk,Rv\<rangle>list_map_rel)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>single_valued Rk; single_valued Rv\<rbrakk> \<Longrightarrow> single_valued (\<langle>Rk, Rv\<rangle>list_map_rel)
[PROOF STEP]
unfolding list_map_rel_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>single_valued Rk; single_valued Rv\<rbrakk> \<Longrightarrow> single_valued (\<langle>Rk \<times>\<^sub>r Rv\<rangle>list_rel O br map_of list_map_invar)
[PROOF STEP]
by tagged_solver


[STATEMENT]
lemma choose_even_sum:
  assumes "n > 0"
  shows "2 * (\<Sum>i\<le>n. if even i then of_nat (n choose i) else 0) = (2 ^ n :: 'a::comm_ring_1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (2::'a) * (\<Sum>i\<le>n. if even i then of_nat (n choose i) else (0::'a)) = (2::'a) ^ n
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (2::'a) * (\<Sum>i\<le>n. if even i then of_nat (n choose i) else (0::'a)) = (2::'a) ^ n
[PROOF STEP]
have "2 ^ n = (\<Sum>i\<le>n. of_nat (n choose i)) + (\<Sum>i\<le>n. (-1) ^ i * of_nat (n choose i) :: 'a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (2::'a) ^ n = (\<Sum>i\<le>n. of_nat (n choose i)) + (\<Sum>i\<le>n. (- (1::'a)) ^ i * of_nat (n choose i))
[PROOF STEP]
using choose_row_sum[of n]
[PROOF STATE]
proof (prove)
using this:
sum ((choose) n) {..n} = 2 ^ n

goal (1 subgoal):
 1. (2::'a) ^ n = (\<Sum>i\<le>n. of_nat (n choose i)) + (\<Sum>i\<le>n. (- (1::'a)) ^ i * of_nat (n choose i))
[PROOF STEP]
by (simp add: choose_alternating_sum assms atLeast0AtMost of_nat_sum[symmetric])
[PROOF STATE]
proof (state)
this:
(2::'a) ^ n = (\<Sum>i\<le>n. of_nat (n choose i)) + (\<Sum>i\<le>n. (- (1::'a)) ^ i * of_nat (n choose i))

goal (1 subgoal):
 1. (2::'a) * (\<Sum>i\<le>n. if even i then of_nat (n choose i) else (0::'a)) = (2::'a) ^ n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(2::'a) ^ n = (\<Sum>i\<le>n. of_nat (n choose i)) + (\<Sum>i\<le>n. (- (1::'a)) ^ i * of_nat (n choose i))

goal (1 subgoal):
 1. (2::'a) * (\<Sum>i\<le>n. if even i then of_nat (n choose i) else (0::'a)) = (2::'a) ^ n
[PROOF STEP]
have "\<dots> = (\<Sum>i\<le>n. of_nat (n choose i) + (-1) ^ i * of_nat (n choose i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i\<le>n. of_nat (n choose i)) + (\<Sum>i\<le>n. (- (1::'a)) ^ i * of_nat (n choose i)) = (\<Sum>i\<le>n. of_nat (n choose i) + (- (1::'a)) ^ i * of_nat (n choose i))
[PROOF STEP]
by (simp add: sum.distrib)
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<le>n. of_nat (n choose i)) + (\<Sum>i\<le>n. (- (1::'a)) ^ i * of_nat (n choose i)) = (\<Sum>i\<le>n. of_nat (n choose i) + (- (1::'a)) ^ i * of_nat (n choose i))

goal (1 subgoal):
 1. (2::'a) * (\<Sum>i\<le>n. if even i then of_nat (n choose i) else (0::'a)) = (2::'a) ^ n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<le>n. of_nat (n choose i)) + (\<Sum>i\<le>n. (- (1::'a)) ^ i * of_nat (n choose i)) = (\<Sum>i\<le>n. of_nat (n choose i) + (- (1::'a)) ^ i * of_nat (n choose i))

goal (1 subgoal):
 1. (2::'a) * (\<Sum>i\<le>n. if even i then of_nat (n choose i) else (0::'a)) = (2::'a) ^ n
[PROOF STEP]
have "\<dots> = 2 * (\<Sum>i\<le>n. if even i then of_nat (n choose i) else 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i\<le>n. of_nat (n choose i) + (- (1::'a)) ^ i * of_nat (n choose i)) = (2::'a) * (\<Sum>i\<le>n. if even i then of_nat (n choose i) else (0::'a))
[PROOF STEP]
by (subst sum_distrib_left, intro sum.cong) simp_all
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<le>n. of_nat (n choose i) + (- (1::'a)) ^ i * of_nat (n choose i)) = (2::'a) * (\<Sum>i\<le>n. if even i then of_nat (n choose i) else (0::'a))

goal (1 subgoal):
 1. (2::'a) * (\<Sum>i\<le>n. if even i then of_nat (n choose i) else (0::'a)) = (2::'a) ^ n
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(2::'a) ^ n = (2::'a) * (\<Sum>i\<le>n. if even i then of_nat (n choose i) else (0::'a))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(2::'a) ^ n = (2::'a) * (\<Sum>i\<le>n. if even i then of_nat (n choose i) else (0::'a))

goal (1 subgoal):
 1. (2::'a) * (\<Sum>i\<le>n. if even i then of_nat (n choose i) else (0::'a)) = (2::'a) ^ n
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
(2::'a) * (\<Sum>i\<le>n. if even i then of_nat (n choose i) else (0::'a)) = (2::'a) ^ n

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma to_poly_mult:
  assumes "a \<in> carrier R"
  assumes "b \<in> carrier R"
  shows "to_poly (a \<otimes> b) = to_poly a \<otimes>\<^bsub>P\<^esub> to_poly b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. to_polynomial R (a \<otimes> b) = to_polynomial R a \<otimes>\<^bsub>P\<^esub> to_polynomial R b
[PROOF STEP]
by (simp add: assms(1) assms(2) ring_hom_mult to_poly_is_ring_hom)


[STATEMENT]
lemma "prefixBeforeElement e t = take (firstPos e (elements t)) t"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prefixBeforeElement e t = take (firstPos e (elements t)) t
[PROOF STEP]
by (induct t) auto


[STATEMENT]
lemma integer_division2:
  "PRE (\<lambda>s::nat store. x \<ge> 0)
    (''q'' ::= (\<lambda>s. 0));
    (''r'' ::= (\<lambda>s. x));
    (WHILE (\<lambda>s. y \<le> s ''r'') INV (\<lambda>s. x = s ''q'' * y + s ''r'' \<and> s ''r'' \<ge> 0)
     DO
      (''q'' ::= (\<lambda>s. s ''q'' + 1));
      (''r'' ::= (\<lambda>s. s ''r'' - y))
      OD)
   POST (\<lambda>s. x = s ''q'' * y + s ''r'' \<and> s ''r'' \<ge> 0 \<and> s ''r'' < y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rdom \<lceil>\<lambda>s. zero_class.zero \<le> x\<rceil> \<subseteq> wp ((''q'' ::= (\<lambda>s. zero_class.zero)) ; (''r'' ::= (\<lambda>s. x)) ; (WHILE (\<lambda>s. y \<le> s ''r'') INV (\<lambda>s. x = s ''q'' \<cdot> y + s ''r'' \<and> zero_class.zero \<le> s ''r'') DO (''q'' ::= (\<lambda>s. s ''q'' + 1)) ; (''r'' ::= (\<lambda>s. s ''r'' - y)) OD)) \<lceil>\<lambda>s. x = s ''q'' \<cdot> y + s ''r'' \<and> zero_class.zero \<le> s ''r'' \<and> s ''r'' < y\<rceil>
[PROOF STEP]
by hoare auto


[STATEMENT]
lemma zero_le_Fract_iff: "0 < b \<Longrightarrow> 0 \<le> Fract a b \<longleftrightarrow> 0 \<le> a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < b \<Longrightarrow> (0 \<le> Fract a b) = (0 \<le> a)
[PROOF STEP]
by (simp add: Zero_rat_def zero_le_mult_iff)


[STATEMENT]
lemma prop_abs_subst: assumes "f o f \<equiv> id" shows "(\<lambda>x. F (f x)) oo f \<equiv> (\<lambda>x. F x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. PROP F (f x)) oo f \<equiv> \<lambda>x. PROP F x
[PROOF STEP]
unfolding COMP_def o_apply[symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lambda>x. PROP F ((f \<circ> f) x) \<equiv> \<lambda>x. PROP F x
[PROOF STEP]
unfolding \<open>f o f \<equiv> id\<close> id_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lambda>x. PROP F x \<equiv> \<lambda>x. PROP F x
[PROOF STEP]
.


[STATEMENT]
lemma Liminf_add_const:
  fixes c :: "'a::{complete_linorder, linorder_topology, topological_monoid_add, ordered_ab_semigroup_add}"
  shows "F \<noteq> bot \<Longrightarrow> Liminf F (\<lambda>x. f x + c) = Liminf F f + c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. F \<noteq> bot \<Longrightarrow> Liminf F (\<lambda>x. f x + c) = Liminf F f + c
[PROOF STEP]
by (rule Liminf_compose_continuous_mono)
     (auto intro!: monoI add_mono continuous_on_add continuous_on_id continuous_on_const)


[STATEMENT]
lemma dghm_cn_cov_comp_ArrMap_vdomain[dg_cn_cs_simps]:
  assumes "\<GG> : \<BB> \<^sub>D\<^sub>G\<mapsto>\<mapsto>\<^bsub>\<alpha>\<^esub> \<CC>" and "\<FF> : \<AA> \<mapsto>\<mapsto>\<^sub>D\<^sub>G\<^bsub>\<alpha>\<^esub> \<BB>"
  shows "\<D>\<^sub>\<circ> ((\<GG> \<^sub>D\<^sub>G\<^sub>H\<^sub>M\<circ> \<FF>)\<lparr>ArrMap\<rparr>) = \<AA>\<lparr>Arr\<rparr>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<D>\<^sub>\<circ> ((\<GG> \<^sub>D\<^sub>G\<^sub>H\<^sub>M\<circ> \<FF>)\<lparr>ArrMap\<rparr>) = \<AA>\<lparr>Arr\<rparr>
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<GG> : op_dg \<BB> \<mapsto>\<mapsto>\<^sub>D\<^sub>G\<^bsub>\<alpha>\<^esub> \<CC>
\<FF> : \<AA> \<mapsto>\<mapsto>\<^sub>D\<^sub>G\<^bsub>\<alpha>\<^esub> \<BB>

goal (1 subgoal):
 1. \<D>\<^sub>\<circ> ((\<GG> \<^sub>D\<^sub>G\<^sub>H\<^sub>M\<circ> \<FF>)\<lparr>ArrMap\<rparr>) = \<AA>\<lparr>Arr\<rparr>
[PROOF STEP]
by
    (
      cs_concl
        cs_simp: dghm_cn_comp_components dg_cs_simps dg_op_simps V_cs_simps
        cs_intro: is_dghm.dghm_ArrMap_vrange
    )


[STATEMENT]
lemma transpose_one[simp]: "transpose_mat (1\<^sub>m n) = (1\<^sub>m n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. transpose_mat (1\<^sub>m n) = 1\<^sub>m n
[PROOF STEP]
by auto


[STATEMENT]
lemma right_unique_vec_rel: "right_unique R \<Longrightarrow> right_unique (vec_rel R)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. right_unique R \<Longrightarrow> right_unique (vec_rel R)
[PROOF STEP]
unfolding right_unique_def vec_rel_def vec_eq_iff
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x y z. R x y \<longrightarrow> R x z \<longrightarrow> y = z \<Longrightarrow> \<forall>x y z. dim_vec x = dim_vec y \<and> (\<forall>i<dim_vec y. R (x $ i) (y $ i)) \<longrightarrow> dim_vec x = dim_vec z \<and> (\<forall>i<dim_vec z. R (x $ i) (z $ i)) \<longrightarrow> dim_vec y = dim_vec z \<and> (\<forall>i<dim_vec z. y $ i = z $ i)
[PROOF STEP]
by auto


[STATEMENT]
lemma composition_assoc: "\<sigma>\<^sub>1 \<cdot> (\<sigma>\<^sub>2 \<cdot> \<sigma>\<^sub>3) = (\<sigma>\<^sub>1 \<cdot> \<sigma>\<^sub>2) \<cdot> \<sigma>\<^sub>3"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<sigma>\<^sub>1 \<cdot> (\<sigma>\<^sub>2 \<cdot> \<sigma>\<^sub>3) = \<sigma>\<^sub>1 \<cdot> \<sigma>\<^sub>2 \<cdot> \<sigma>\<^sub>3
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. (\<sigma>\<^sub>1 \<cdot> (\<sigma>\<^sub>2 \<cdot> \<sigma>\<^sub>3)) x = (\<sigma>\<^sub>1 \<cdot> \<sigma>\<^sub>2 \<cdot> \<sigma>\<^sub>3) x
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. (\<sigma>\<^sub>1 \<cdot> (\<sigma>\<^sub>2 \<cdot> \<sigma>\<^sub>3)) x = (\<sigma>\<^sub>1 \<cdot> \<sigma>\<^sub>2 \<cdot> \<sigma>\<^sub>3) x
[PROOF STEP]
show "(\<sigma>\<^sub>1 \<cdot> (\<sigma>\<^sub>2 \<cdot> \<sigma>\<^sub>3)) x = ((\<sigma>\<^sub>1 \<cdot> \<sigma>\<^sub>2) \<cdot> \<sigma>\<^sub>3) x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<sigma>\<^sub>1 \<cdot> (\<sigma>\<^sub>2 \<cdot> \<sigma>\<^sub>3)) x = (\<sigma>\<^sub>1 \<cdot> \<sigma>\<^sub>2 \<cdot> \<sigma>\<^sub>3) x
[PROOF STEP]
by (simp only: composition_def composition_conseq2t)
[PROOF STATE]
proof (state)
this:
(\<sigma>\<^sub>1 \<cdot> (\<sigma>\<^sub>2 \<cdot> \<sigma>\<^sub>3)) x = (\<sigma>\<^sub>1 \<cdot> \<sigma>\<^sub>2 \<cdot> \<sigma>\<^sub>3) x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma restrict_to_var_deg_var_deg:
  assumes "finite (monomials_of R P)"
  assumes "Q = restrict_to_var_deg P i n"
  assumes "monomials_of R Q \<noteq> {}"
  shows "n = degree_in_var R Q i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n = degree_in_var R Q i
[PROOF STEP]
apply(rule degree_in_varI)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. finite (monomials_of R Q)
 2. \<exists>m. m \<in> monomials_of R Q \<and> count m i = n
 3. \<And>c. c \<in> monomials_of R Q \<Longrightarrow> count c i \<le> n
[PROOF STEP]
apply (metis assms(1) assms(2) fixed_degree_in_varE(1) monomials_ofE restrict_poly_to_monom_set_def
      restrict_to_var_deg_def rev_finite_subset subsetI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<exists>m. m \<in> monomials_of R Q \<and> count m i = n
 2. \<And>c. c \<in> monomials_of R Q \<Longrightarrow> count c i \<le> n
[PROOF STEP]
apply (metis (full_types) assms(2) assms(3) equals0I fixed_degree_in_varE(2)
      monomials_ofE restrict_poly_to_monom_set_def restrict_to_var_deg_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>c. c \<in> monomials_of R Q \<Longrightarrow> count c i \<le> n
[PROOF STEP]
by (metis assms(2) eq_iff fixed_degree_in_varE(2) monomials_ofE restrict_poly_to_monom_set_def restrict_to_var_deg_def)


[STATEMENT]
lemma zmult_div_aux2:
  assumes b: "b \<noteq> 0"
  shows "((a::int) - a mod b) mod b = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a - a mod b) mod b = 0
[PROOF STEP]
using b minus_mod_eq_mult_div [symmetric, of b a, symmetric]
[PROOF STATE]
proof (prove)
using this:
b \<noteq> 0
a - a mod b = b * (a div b)

goal (1 subgoal):
 1. (a - a mod b) mod b = 0
[PROOF STEP]
by simp


[STATEMENT]
lemma has_integral_componentwise_iff:
  fixes f :: "'a :: euclidean_space \<Rightarrow> 'b :: euclidean_space"
  shows "(f has_integral y) A \<longleftrightarrow> (\<forall>b\<in>Basis. ((\<lambda>x. f x \<bullet> b) has_integral (y \<bullet> b)) A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f has_integral y) A = (\<forall>b\<in>Basis. ((\<lambda>x. f x \<bullet> b) has_integral y \<bullet> b) A)
[PROOF STEP]
proof safe
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>b. \<lbrakk>(f has_integral y) A; b \<in> Basis\<rbrakk> \<Longrightarrow> ((\<lambda>x. f x \<bullet> b) has_integral y \<bullet> b) A
 2. \<forall>b\<in>Basis. ((\<lambda>x. f x \<bullet> b) has_integral y \<bullet> b) A \<Longrightarrow> (f has_integral y) A
[PROOF STEP]
fix b :: 'b
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>b. \<lbrakk>(f has_integral y) A; b \<in> Basis\<rbrakk> \<Longrightarrow> ((\<lambda>x. f x \<bullet> b) has_integral y \<bullet> b) A
 2. \<forall>b\<in>Basis. ((\<lambda>x. f x \<bullet> b) has_integral y \<bullet> b) A \<Longrightarrow> (f has_integral y) A
[PROOF STEP]
assume "(f has_integral y) A"
[PROOF STATE]
proof (state)
this:
(f has_integral y) A

goal (2 subgoals):
 1. \<And>b. \<lbrakk>(f has_integral y) A; b \<in> Basis\<rbrakk> \<Longrightarrow> ((\<lambda>x. f x \<bullet> b) has_integral y \<bullet> b) A
 2. \<forall>b\<in>Basis. ((\<lambda>x. f x \<bullet> b) has_integral y \<bullet> b) A \<Longrightarrow> (f has_integral y) A
[PROOF STEP]
from has_integral_linear[OF this(1) bounded_linear_inner_left, of b]
[PROOF STATE]
proof (chain)
picking this:
((\<lambda>a. a \<bullet> b) \<circ> f has_integral y \<bullet> b) A
[PROOF STEP]
show "((\<lambda>x. f x \<bullet> b) has_integral (y \<bullet> b)) A"
[PROOF STATE]
proof (prove)
using this:
((\<lambda>a. a \<bullet> b) \<circ> f has_integral y \<bullet> b) A

goal (1 subgoal):
 1. ((\<lambda>x. f x \<bullet> b) has_integral y \<bullet> b) A
[PROOF STEP]
by (simp add: o_def)
[PROOF STATE]
proof (state)
this:
((\<lambda>x. f x \<bullet> b) has_integral y \<bullet> b) A

goal (1 subgoal):
 1. \<forall>b\<in>Basis. ((\<lambda>x. f x \<bullet> b) has_integral y \<bullet> b) A \<Longrightarrow> (f has_integral y) A
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<forall>b\<in>Basis. ((\<lambda>x. f x \<bullet> b) has_integral y \<bullet> b) A \<Longrightarrow> (f has_integral y) A
[PROOF STEP]
assume "(\<forall>b\<in>Basis. ((\<lambda>x. f x \<bullet> b) has_integral (y \<bullet> b)) A)"
[PROOF STATE]
proof (state)
this:
\<forall>b\<in>Basis. ((\<lambda>x. f x \<bullet> b) has_integral y \<bullet> b) A

goal (1 subgoal):
 1. \<forall>b\<in>Basis. ((\<lambda>x. f x \<bullet> b) has_integral y \<bullet> b) A \<Longrightarrow> (f has_integral y) A
[PROOF STEP]
hence "\<forall>b\<in>Basis. (((\<lambda>x. x *\<^sub>R b) \<circ> (\<lambda>x. f x \<bullet> b)) has_integral ((y \<bullet> b) *\<^sub>R b)) A"
[PROOF STATE]
proof (prove)
using this:
\<forall>b\<in>Basis. ((\<lambda>x. f x \<bullet> b) has_integral y \<bullet> b) A

goal (1 subgoal):
 1. \<forall>b\<in>Basis. ((\<lambda>x. x *\<^sub>R b) \<circ> (\<lambda>x. f x \<bullet> b) has_integral (y \<bullet> b) *\<^sub>R b) A
[PROOF STEP]
by (intro ballI has_integral_linear) (simp_all add: bounded_linear_scaleR_left)
[PROOF STATE]
proof (state)
this:
\<forall>b\<in>Basis. ((\<lambda>x. x *\<^sub>R b) \<circ> (\<lambda>x. f x \<bullet> b) has_integral (y \<bullet> b) *\<^sub>R b) A

goal (1 subgoal):
 1. \<forall>b\<in>Basis. ((\<lambda>x. f x \<bullet> b) has_integral y \<bullet> b) A \<Longrightarrow> (f has_integral y) A
[PROOF STEP]
hence "((\<lambda>x. \<Sum>b\<in>Basis. (f x \<bullet> b) *\<^sub>R b) has_integral (\<Sum>b\<in>Basis. (y \<bullet> b) *\<^sub>R b)) A"
[PROOF STATE]
proof (prove)
using this:
\<forall>b\<in>Basis. ((\<lambda>x. x *\<^sub>R b) \<circ> (\<lambda>x. f x \<bullet> b) has_integral (y \<bullet> b) *\<^sub>R b) A

goal (1 subgoal):
 1. ((\<lambda>x. \<Sum>b\<in>Basis. (f x \<bullet> b) *\<^sub>R b) has_integral (\<Sum>b\<in>Basis. (y \<bullet> b) *\<^sub>R b)) A
[PROOF STEP]
by (intro has_integral_sum) (simp_all add: o_def)
[PROOF STATE]
proof (state)
this:
((\<lambda>x. \<Sum>b\<in>Basis. (f x \<bullet> b) *\<^sub>R b) has_integral (\<Sum>b\<in>Basis. (y \<bullet> b) *\<^sub>R b)) A

goal (1 subgoal):
 1. \<forall>b\<in>Basis. ((\<lambda>x. f x \<bullet> b) has_integral y \<bullet> b) A \<Longrightarrow> (f has_integral y) A
[PROOF STEP]
thus "(f has_integral y) A"
[PROOF STATE]
proof (prove)
using this:
((\<lambda>x. \<Sum>b\<in>Basis. (f x \<bullet> b) *\<^sub>R b) has_integral (\<Sum>b\<in>Basis. (y \<bullet> b) *\<^sub>R b)) A

goal (1 subgoal):
 1. (f has_integral y) A
[PROOF STEP]
by (simp add: euclidean_representation)
[PROOF STATE]
proof (state)
this:
(f has_integral y) A

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma plays_are_positions_conv:
  shows "play (llist_of p) \<longleftrightarrow> position p \<and> length p = 2*N"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. play (llist_of p) = (position p \<and> enat (length p) = 2 * N)
[PROOF STEP]
unfolding play_def position_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (llength (llist_of p) = 2 * N) = (enat (length p) \<le> 2 * N \<and> enat (length p) = 2 * N)
[PROOF STEP]
by auto


[STATEMENT]
lemma cardeq_rcoset:
  assumes "finite (carrier G)"
  assumes "M \<subseteq> carrier G"
  assumes "g \<in> carrier G"
  shows "card (M #> g) = card  M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (M #> g) = card M
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. card (M #> g) = card M
[PROOF STEP]
have "M #> g \<in> rcosets M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. M #> g \<in> rcosets M
[PROOF STEP]
by (metis assms(2) assms(3) rcosetsI)
[PROOF STATE]
proof (state)
this:
M #> g \<in> rcosets M

goal (1 subgoal):
 1. card (M #> g) = card M
[PROOF STEP]
thus "card (M #> g) = card M"
[PROOF STATE]
proof (prove)
using this:
M #> g \<in> rcosets M

goal (1 subgoal):
 1. card (M #> g) = card M
[PROOF STEP]
using assms(2) card_rcosets_equal
[PROOF STATE]
proof (prove)
using this:
M #> g \<in> rcosets M
M \<subseteq> carrier G
\<lbrakk>?R \<in> rcosets ?H; ?H \<subseteq> carrier G\<rbrakk> \<Longrightarrow> card ?H = card ?R

goal (1 subgoal):
 1. card (M #> g) = card M
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
card (M #> g) = card M

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma add_mono_Fin_le:
  "\<lbrakk>Fin y1 \<le> x1; Fin y2 \<le> x2\<rbrakk> \<Longrightarrow> Fin(y1 + y2::'a::ordered_ab_group_add) \<le> x1 + x2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Fin y1 \<le> x1; Fin y2 \<le> x2\<rbrakk> \<Longrightarrow> Fin (y1 + y2) \<le> x1 + x2
[PROOF STEP]
by(drule (1) add_mono) simp


[STATEMENT]
lemma bij_betw_in_out_arcs: "bij_betw (\<lambda> (u, v) . (v, u)) ((arc_to_ends G) ` (in_arcs G v))
    ((arc_to_ends G) ` (out_arcs G v))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bij_betw (\<lambda>(u, v). (v, u)) (arc_to_ends G ` in_arcs G v) (arc_to_ends G ` out_arcs G v)
[PROOF STEP]
apply (auto simp add: bij_betw_def)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. inj_on (\<lambda>(u, v). (v, u)) (arc_to_ends G ` in_arcs G v)
 2. \<And>aa ba x. \<lbrakk>(aa, ba) = arc_to_ends G x; x \<in> arcs G; v = head G x\<rbrakk> \<Longrightarrow> (ba, aa) \<in> arc_to_ends G ` out_arcs G (head G x)
 3. \<And>a b x. \<lbrakk>(a, b) = arc_to_ends G x; x \<in> arcs G; v = tail G x\<rbrakk> \<Longrightarrow> arc_to_ends G x \<in> (\<lambda>x. case x of (u, v) \<Rightarrow> (v, u)) ` arc_to_ends G ` in_arcs G (tail G x)
[PROOF STEP]
apply (simp add: swap_inj_on)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>aa ba x. \<lbrakk>(aa, ba) = arc_to_ends G x; x \<in> arcs G; v = head G x\<rbrakk> \<Longrightarrow> (ba, aa) \<in> arc_to_ends G ` out_arcs G (head G x)
 2. \<And>a b x. \<lbrakk>(a, b) = arc_to_ends G x; x \<in> arcs G; v = tail G x\<rbrakk> \<Longrightarrow> arc_to_ends G x \<in> (\<lambda>x. case x of (u, v) \<Rightarrow> (v, u)) ` arc_to_ends G ` in_arcs G (tail G x)
[PROOF STEP]
apply (metis Pair_inject arc_to_ends_def image_eqI in_eq_out_arc_ends in_in_arcs_conv)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a b x. \<lbrakk>(a, b) = arc_to_ends G x; x \<in> arcs G; v = tail G x\<rbrakk> \<Longrightarrow> arc_to_ends G x \<in> (\<lambda>x. case x of (u, v) \<Rightarrow> (v, u)) ` arc_to_ends G ` in_arcs G (tail G x)
[PROOF STEP]
by (metis arc_to_ends_def imageI in_eq_out_arc_ends in_out_arcs_conv pair_imageI)


[STATEMENT]
lemma UNIV_convex:
"is_convex UNIV"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_convex UNIV
[PROOF STEP]
apply(rule is_convexI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x y c. \<lbrakk>x \<in> UNIV; y \<in> UNIV; x \<le> c \<and> c \<le> y\<rbrakk> \<Longrightarrow> c \<in> UNIV
[PROOF STEP]
by blast


[STATEMENT]
lemma cmod_less:
  fixes a n:: int
  assumes "a < n" and "a > -n"
  shows "cmod a < n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cmod (of_int a) < real_of_int n
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
a < n
- n < a

goal (1 subgoal):
 1. cmod (of_int a) < real_of_int n
[PROOF STEP]
by simp


[STATEMENT]
lemma span_insert_0[simp]: "span (insert 0 S) = span S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. span (insert (0::'b) S) = span S
[PROOF STEP]
by (metis span_zero span_redundant)


[STATEMENT]
lemma tendsto_zero_divide_iff [simp]:
  fixes c::"'a::{topological_semigroup_mult,field}" assumes "c \<noteq> 0" shows "(\<lambda>n. a n / c)\<longlonglongrightarrow> 0 \<longleftrightarrow> a \<longlonglongrightarrow> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. a n / c) \<longlonglongrightarrow> (0::'a) = a \<longlonglongrightarrow> (0::'a)
[PROOF STEP]
using tendsto_zero_mult_right_iff [of "1/c" a] assms
[PROOF STATE]
proof (prove)
using this:
(1::'a) / c \<noteq> (0::'a) \<Longrightarrow> (\<lambda>n. a n * ((1::'a) / c)) \<longlonglongrightarrow> (0::'a) = a \<longlonglongrightarrow> (0::'a)
c \<noteq> (0::'a)

goal (1 subgoal):
 1. (\<lambda>n. a n / c) \<longlonglongrightarrow> (0::'a) = a \<longlonglongrightarrow> (0::'a)
[PROOF STEP]
by (simp add: field_simps)


[STATEMENT]
theorem goedel_rosser_first_ex:
  assumes "consistent"
  shows "\<exists> \<phi>. \<phi> \<in> fmla \<and> \<not> prv \<phi> \<and> \<not> prv (neg \<phi>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>\<phi>. \<phi> \<in> fmla \<and> \<not> prv \<phi> \<and> \<not> prv (neg \<phi>)
[PROOF STEP]
using assms goedel_rosser_first
[PROOF STATE]
proof (prove)
using this:
consistent
consistent \<Longrightarrow> \<not> prv \<phi>R \<and> \<not> prv (neg \<phi>R)

goal (1 subgoal):
 1. \<exists>\<phi>. \<phi> \<in> fmla \<and> \<not> prv \<phi> \<and> \<not> prv (neg \<phi>)
[PROOF STEP]
by (intro exI[of _ \<phi>R]) blast


[STATEMENT]
lemma lemma_4_2_iv: "(c * a \<le> c * b) = (a \<le> b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (c * a \<le> c * b) = (a \<le> b)
[PROOF STEP]
by (simp add: right_lesseq lemma_4_2_ii [THEN sym])


[STATEMENT]
lemma pSum_below_nat:
  "nat_test t s \<Longrightarrow> (\<forall>m<k . t m * -p \<le> -q) \<Longrightarrow> pSum t k * -p \<le> -q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>nat_test t s; \<forall>m<k. t m * - p \<le> - q\<rbrakk> \<Longrightarrow> pSum t k * - p \<le> - q
[PROOF STEP]
by (simp add: nat_test_seq pSum_below)


[STATEMENT]
lemma F_strict_imp_F_inj:
  assumes f: "f \<in> F_strict"
  shows "f \<in> F_inj"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<in> F_inj
[PROOF STEP]
using f strict_mono_on_imp_inj_on
[PROOF STATE]
proof (prove)
using this:
f \<in> F_strict
strict_mono_on ?A ?f \<Longrightarrow> inj_on ?f ?A

goal (1 subgoal):
 1. f \<in> F_inj
[PROOF STEP]
unfolding F_strict_def F_inj_def
[PROOF STATE]
proof (prove)
using this:
f \<in> {f \<in> {0..<n} \<rightarrow> {0..<m}. (\<forall>i. i \<notin> {0..<n} \<longrightarrow> f i = i) \<and> strict_mono_on {0..<n} f}
strict_mono_on ?A ?f \<Longrightarrow> inj_on ?f ?A

goal (1 subgoal):
 1. f \<in> {f \<in> {0..<n} \<rightarrow> {0..<m}. (\<forall>i. i \<notin> {0..<n} \<longrightarrow> f i = i) \<and> inj_on f {0..<n}}
[PROOF STEP]
by auto


[STATEMENT]
lemma v_of_merge[simp]: "sem_env.v (extend_dec_env env2 env1) = nsAppend (sem_env.v env2) (sem_env.v env1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sem_env.v (extend_dec_env env2 env1) = nsAppend (sem_env.v env2) (sem_env.v env1)
[PROOF STEP]
by (cases env1; cases env2; simp add: extend_dec_env_def)


[STATEMENT]
lemma (in weak_partial_order) greatest_cong:
  "\<lbrakk>x .= x'; x \<in> carrier L; x' \<in> carrier L; is_closed A\<rbrakk> \<Longrightarrow>
  greatest L x A = greatest L x' A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x .= x'; x \<in> carrier L; x' \<in> carrier L; is_closed A\<rbrakk> \<Longrightarrow> greatest L x A = greatest L x' A
[PROOF STEP]
unfolding greatest_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x .= x'; x \<in> carrier L; x' \<in> carrier L; is_closed A\<rbrakk> \<Longrightarrow> (A \<subseteq> carrier L \<and> x \<in> A \<and> (\<forall>xa\<in>A. xa \<sqsubseteq> x)) = (A \<subseteq> carrier L \<and> x' \<in> A \<and> (\<forall>x\<in>A. x \<sqsubseteq> x'))
[PROOF STEP]
by (meson is_closed_eq_rev le_cong_r local.sym subset_eq)


[STATEMENT]
lemma path_component_of_nonoverlap:
   "Collect (path_component_of X x) \<inter> Collect (path_component_of X y) = {} \<longleftrightarrow>
    (x \<notin> topspace X) \<or> (y \<notin> topspace X) \<or>
    path_component_of X x \<noteq> path_component_of X y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (path_component_of_set X x \<inter> path_component_of_set X y = {}) = (x \<notin> topspace X \<or> y \<notin> topspace X \<or> path_component_of X x \<noteq> path_component_of X y)
[PROOF STEP]
by (metis inf.idem path_component_of_eq_empty path_component_of_eq_overlap)


[STATEMENT]
lemma classes_disjoint: "X \<in> classes Qeq \<Longrightarrow> Y \<in> classes Qeq \<Longrightarrow> X = Y \<or> X \<inter> Y = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>X \<in> classes Qeq; Y \<in> classes Qeq\<rbrakk> \<Longrightarrow> X = Y \<or> X \<inter> Y = {}
[PROOF STEP]
using quotient_disj[OF equiv_transymcl]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?X \<in> Field ?Qeq1 // transymcl ?Qeq1; ?Y \<in> Field ?Qeq1 // transymcl ?Qeq1\<rbrakk> \<Longrightarrow> ?X = ?Y \<or> ?X \<inter> ?Y = {}

goal (1 subgoal):
 1. \<lbrakk>X \<in> classes Qeq; Y \<in> classes Qeq\<rbrakk> \<Longrightarrow> X = Y \<or> X \<inter> Y = {}
[PROOF STEP]
by (auto simp: classes_def)


[STATEMENT]
lemma isCont_bernpoly [continuous_intros]:
  "isCont (bernpoly n :: 'a \<Rightarrow> 'a :: real_normed_algebra_1) x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. isCont (bernpoly n) x
[PROOF STEP]
unfolding bernpoly_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. isCont (\<lambda>x. \<Sum>k\<le>n. of_nat (n choose k) * of_real (bernoulli k) * x ^ (n - k)) x
[PROOF STEP]
by (auto intro!: continuous_intros)


[STATEMENT]
lemma pderiv_char_poly_erase_mat: fixes A :: "'a :: idom ^ 'n ^ 'n"
  shows "monom 1 1 * pderiv (charpoly A) = sum (\<lambda> i. charpoly (erase_mat A i i)) UNIV"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. monom (1::'a) 1 * pderiv (charpoly A) = (\<Sum>i\<in>UNIV. charpoly (erase_mat A i i))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. monom (1::'a) 1 * pderiv (charpoly A) = (\<Sum>i\<in>UNIV. charpoly (erase_mat A i i))
[PROOF STEP]
let ?A = "from_hma\<^sub>m A"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. monom (1::'a) 1 * pderiv (charpoly A) = (\<Sum>i\<in>UNIV. charpoly (erase_mat A i i))
[PROOF STEP]
let ?n = "CARD('n)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. monom (1::'a) 1 * pderiv (charpoly A) = (\<Sum>i\<in>UNIV. charpoly (erase_mat A i i))
[PROOF STEP]
have tA[transfer_rule]: "HMA_M ?A A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. HMA_M (from_hma\<^sub>m A) A
[PROOF STEP]
unfolding HMA_M_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. from_hma\<^sub>m A = from_hma\<^sub>m A
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
HMA_M (from_hma\<^sub>m A) A

goal (1 subgoal):
 1. monom (1::'a) 1 * pderiv (charpoly A) = (\<Sum>i\<in>UNIV. charpoly (erase_mat A i i))
[PROOF STEP]
have tN[transfer_rule]: "HMA_T ?n TYPE('n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. HMA_T CARD('n) TYPE('n)
[PROOF STEP]
unfolding HMA_T_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. CARD('n) = CARD('n)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
HMA_T CARD('n) TYPE('n)

goal (1 subgoal):
 1. monom (1::'a) 1 * pderiv (charpoly A) = (\<Sum>i\<in>UNIV. charpoly (erase_mat A i i))
[PROOF STEP]
have A: "?A \<in> carrier_mat ?n ?n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. from_hma\<^sub>m A \<in> carrier_mat CARD('n) CARD('n)
[PROOF STEP]
unfolding from_hma\<^sub>m_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Matrix.mat CARD('n) CARD('n) (\<lambda>(i, j). A $h Bij_Nat.from_nat i $h Bij_Nat.from_nat j) \<in> carrier_mat CARD('n) CARD('n)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
from_hma\<^sub>m A \<in> carrier_mat CARD('n) CARD('n)

goal (1 subgoal):
 1. monom (1::'a) 1 * pderiv (charpoly A) = (\<Sum>i\<in>UNIV. charpoly (erase_mat A i i))
[PROOF STEP]
have id: "sum (\<lambda> i. charpoly (erase_mat A i i)) UNIV =
    sum_UNIV_type (\<lambda> i. charpoly (erase_mat A i i)) TYPE('n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i\<in>UNIV. charpoly (erase_mat A i i)) = sum_UNIV_type (\<lambda>i. charpoly (erase_mat A i i)) TYPE('n)
[PROOF STEP]
unfolding sum_UNIV_type_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i\<in>UNIV. charpoly (erase_mat A i i)) = (\<Sum>i\<in>UNIV. charpoly (erase_mat A i i))
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<in>UNIV. charpoly (erase_mat A i i)) = sum_UNIV_type (\<lambda>i. charpoly (erase_mat A i i)) TYPE('n)

goal (1 subgoal):
 1. monom (1::'a) 1 * pderiv (charpoly A) = (\<Sum>i\<in>UNIV. charpoly (erase_mat A i i))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. monom (1::'a) 1 * pderiv (charpoly A) = (\<Sum>i\<in>UNIV. charpoly (erase_mat A i i))
[PROOF STEP]
unfolding id
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. monom (1::'a) 1 * pderiv (charpoly A) = sum_UNIV_type (\<lambda>i. charpoly (erase_mat A i i)) TYPE('n)
[PROOF STEP]
by (transfer, insert pderiv_char_poly_mat_erase[OF A], simp add: sum_UNIV_set_def)
[PROOF STATE]
proof (state)
this:
monom (1::'a) 1 * pderiv (charpoly A) = (\<Sum>i\<in>UNIV. charpoly (erase_mat A i i))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma tendsto_Limsup:
  fixes f :: "_ \<Rightarrow> 'a :: {complete_linorder,linorder_topology}"
  shows "F \<noteq> bot \<Longrightarrow> Limsup F f = Liminf F f \<Longrightarrow> (f \<longlongrightarrow> Limsup F f) F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>F \<noteq> bot; Limsup F f = Liminf F f\<rbrakk> \<Longrightarrow> (f \<longlongrightarrow> Limsup F f) F
[PROOF STEP]
by (subst tendsto_iff_Liminf_eq_Limsup) auto


[STATEMENT]
lemma LIMSEQ_inverse_zero:
  assumes "\<And>r::real. \<exists>N. \<forall>n\<ge>N. r < X n"
  shows "(\<lambda>n. inverse (X n)) \<longlonglongrightarrow> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. inverse (X n)) \<longlonglongrightarrow> 0
[PROOF STEP]
apply (rule filterlim_compose[OF tendsto_inverse_0])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. filterlim X at_infinity sequentially
[PROOF STEP]
by (metis assms eventually_at_top_linorderI filterlim_at_top_dense filterlim_at_top_imp_at_infinity)


[STATEMENT]
lemma Re_det_sgn_congruence [simp]:
  assumes "mat_det M \<noteq> 0"
  shows "sgn (Re (mat_det (congruence M H))) = sgn (Re (mat_det H))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sgn (Re (mat_det (congruence M H))) = sgn (Re (mat_det H))
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. sgn (Re (mat_det (congruence M H))) = sgn (Re (mat_det H))
[PROOF STEP]
have *: "Re (mat_det (congruence M H)) = (cmod (mat_det M))\<^sup>2 * Re (mat_det H)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Re (mat_det (congruence M H)) = (cmod (mat_det M))\<^sup>2 * Re (mat_det H)
[PROOF STEP]
by (subst mat_det_congruence, subst Re_mult_real, rule Im_complex_of_real) (subst Re_complex_of_real, simp)
[PROOF STATE]
proof (state)
this:
Re (mat_det (congruence M H)) = (cmod (mat_det M))\<^sup>2 * Re (mat_det H)

goal (1 subgoal):
 1. sgn (Re (mat_det (congruence M H))) = sgn (Re (mat_det H))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sgn (Re (mat_det (congruence M H))) = sgn (Re (mat_det H))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
mat_det M \<noteq> 0

goal (1 subgoal):
 1. sgn (Re (mat_det (congruence M H))) = sgn (Re (mat_det H))
[PROOF STEP]
by (subst *) (auto simp add: sgn_mult)
[PROOF STATE]
proof (state)
this:
sgn (Re (mat_det (congruence M H))) = sgn (Re (mat_det H))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma compactI:
  assumes "\<And>C. \<forall>t\<in>C. open t \<Longrightarrow> s \<subseteq> \<Union>C \<Longrightarrow> \<exists>C'. C' \<subseteq> C \<and> finite C' \<and> s \<subseteq> \<Union>C'"
  shows "compact s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. compact s
[PROOF STEP]
unfolding compact_eq_Heine_Borel
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>C. Ball C open \<and> s \<subseteq> \<Union> C \<longrightarrow> (\<exists>D\<subseteq>C. finite D \<and> s \<subseteq> \<Union> D)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>Ball ?C open; s \<subseteq> \<Union> ?C\<rbrakk> \<Longrightarrow> \<exists>C'\<subseteq>?C. finite C' \<and> s \<subseteq> \<Union> C'

goal (1 subgoal):
 1. \<forall>C. Ball C open \<and> s \<subseteq> \<Union> C \<longrightarrow> (\<exists>D\<subseteq>C. finite D \<and> s \<subseteq> \<Union> D)
[PROOF STEP]
by metis


[STATEMENT]
lemma int_Idl_subset_ideal: "Idl\<^bsub>\<Z>\<^esub> {k} \<subseteq> Idl\<^bsub>\<Z>\<^esub> {l} = (k \<in> Idl\<^bsub>\<Z>\<^esub> {l})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (Idl\<^bsub>\<Z>\<^esub> {k} \<subseteq> Idl\<^bsub>\<Z>\<^esub> {l}) = (k \<in> Idl\<^bsub>\<Z>\<^esub> {l})
[PROOF STEP]
by (rule int.Idl_subset_ideal') simp_all


[STATEMENT]
lemma mod_lemma: "\<lbrakk> (0::nat) < c; r < b \<rbrakk> \<Longrightarrow> b * (q mod c) + r < b * c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < c; r < b\<rbrakk> \<Longrightarrow> b * (q mod c) + r < b * c
[PROOF STEP]
by (metis add_gr_0 div_le_mono div_mult_self1_is_m less_imp_add_positive mod_less_divisor not_less split_div)


[STATEMENT]
lemma sum_msets_chop: "n > 0 \<Longrightarrow> (\<Sum>ys\<leftarrow>chop n xs. mset ys) = mset xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < n \<Longrightarrow> sum_list (map mset (chop n xs)) = mset xs
[PROOF STEP]
by (subst mset_concat [symmetric]) simp_all


[STATEMENT]
lemma sup_ivl_nice: "[l1,h1] \<squnion> [l2,h2] =
  (if [l1,h1] = \<bottom> then [l2,h2] else
   if [l2,h2] = \<bottom> then [l1,h1] else [min l1 l2,max h1 h2])"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [l1, h1] \<squnion> [l2, h2] = (if [l1, h1] = \<bottom> then [l2, h2] else if [l2, h2] = \<bottom> then [l1, h1] else [min l1 l2, max h1 h2])
[PROOF STEP]
unfolding bot_ivl_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [l1, h1] \<squnion> [l2, h2] = (if [l1, h1] = empty_ivl then [l2, h2] else if [l2, h2] = empty_ivl then [l1, h1] else [min l1 l2, max h1 h2])
[PROOF STEP]
by transfer (simp add: sup_rep_def eq_ivl_empty)


[STATEMENT]
lemma gauss_sum_periodic:
  "periodic_arithmetic (\<lambda>n. gauss_sum n) n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. periodic_arithmetic gauss_sum n
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. periodic_arithmetic gauss_sum n
[PROOF STEP]
have "periodic_arithmetic \<chi> n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. periodic_arithmetic \<chi> n
[PROOF STEP]
using dir_periodic_arithmetic
[PROOF STATE]
proof (prove)
using this:
periodic_arithmetic \<chi> n

goal (1 subgoal):
 1. periodic_arithmetic \<chi> n
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
periodic_arithmetic \<chi> n

goal (1 subgoal):
 1. periodic_arithmetic gauss_sum n
[PROOF STEP]
let ?h = "\<lambda>m k. \<chi>(m) * unity_root n (m*k)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. periodic_arithmetic gauss_sum n
[PROOF STEP]
{
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. periodic_arithmetic gauss_sum n
[PROOF STEP]
fix m :: nat
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. periodic_arithmetic gauss_sum n
[PROOF STEP]
have "periodic_arithmetic (\<lambda>k. unity_root n (m*k)) n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. periodic_arithmetic (\<lambda>k. unity_root n (int (m * k))) n
[PROOF STEP]
using unity_periodic_arithmetic_mult[of n m]
[PROOF STATE]
proof (prove)
using this:
periodic_arithmetic (\<lambda>n. unity_root n (int m * int n)) n

goal (1 subgoal):
 1. periodic_arithmetic (\<lambda>k. unity_root n (int (m * k))) n
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
periodic_arithmetic (\<lambda>k. unity_root n (int (m * k))) n

goal (1 subgoal):
 1. periodic_arithmetic gauss_sum n
[PROOF STEP]
have "periodic_arithmetic (?h m) n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. periodic_arithmetic (\<lambda>k. \<chi> m * unity_root n (int (m * k))) n
[PROOF STEP]
using scalar_mult_periodic_arithmetic[OF \<open>periodic_arithmetic (\<lambda>k. unity_root n (m*k)) n\<close>]
[PROOF STATE]
proof (prove)
using this:
periodic_arithmetic (\<lambda>n. ?a * unity_root n (int (m * n))) n

goal (1 subgoal):
 1. periodic_arithmetic (\<lambda>k. \<chi> m * unity_root n (int (m * k))) n
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
periodic_arithmetic (\<lambda>k. \<chi> m * unity_root n (int (m * k))) n

goal (1 subgoal):
 1. periodic_arithmetic gauss_sum n
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
periodic_arithmetic (\<lambda>k. \<chi> ?m3 * unity_root n (int (?m3 * k))) n

goal (1 subgoal):
 1. periodic_arithmetic gauss_sum n
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
periodic_arithmetic (\<lambda>k. \<chi> ?m3 * unity_root n (int (?m3 * k))) n
[PROOF STEP]
have per_all: "\<forall>m \<in> {1..n}. periodic_arithmetic (?h m) n"
[PROOF STATE]
proof (prove)
using this:
periodic_arithmetic (\<lambda>k. \<chi> ?m3 * unity_root n (int (?m3 * k))) n

goal (1 subgoal):
 1. \<forall>m\<in>{1..n}. periodic_arithmetic (\<lambda>k. \<chi> m * unity_root n (int (m * k))) n
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<forall>m\<in>{1..n}. periodic_arithmetic (\<lambda>k. \<chi> m * unity_root n (int (m * k))) n

goal (1 subgoal):
 1. periodic_arithmetic gauss_sum n
[PROOF STEP]
have "periodic_arithmetic (\<lambda>k. (\<Sum>m = 1..n . \<chi>(m) * unity_root n (m*k))) n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. periodic_arithmetic (\<lambda>k. \<Sum>m = 1..n. \<chi> m * unity_root n (int (m * k))) n
[PROOF STEP]
using fin_sum_periodic_arithmetic_set[OF per_all]
[PROOF STATE]
proof (prove)
using this:
periodic_arithmetic (\<lambda>n. \<Sum>i = 1..n. \<chi> i * unity_root n (int (i * n))) n

goal (1 subgoal):
 1. periodic_arithmetic (\<lambda>k. \<Sum>m = 1..n. \<chi> m * unity_root n (int (m * k))) n
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
periodic_arithmetic (\<lambda>k. \<Sum>m = 1..n. \<chi> m * unity_root n (int (m * k))) n

goal (1 subgoal):
 1. periodic_arithmetic gauss_sum n
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
periodic_arithmetic (\<lambda>k. \<Sum>m = 1..n. \<chi> m * unity_root n (int (m * k))) n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
periodic_arithmetic (\<lambda>k. \<Sum>m = 1..n. \<chi> m * unity_root n (int (m * k))) n

goal (1 subgoal):
 1. periodic_arithmetic gauss_sum n
[PROOF STEP]
unfolding gauss_sum_def
[PROOF STATE]
proof (prove)
using this:
periodic_arithmetic (\<lambda>k. \<Sum>m = 1..n. \<chi> m * unity_root n (int (m * k))) n

goal (1 subgoal):
 1. periodic_arithmetic (\<lambda>n. \<Sum>m = 1..n. \<chi> m * unity_root n (int (m * n))) n
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
periodic_arithmetic gauss_sum n

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma sin_periodic [simp]: "sin (x + 2 * pi) = sin x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sin (x + 2 * pi) = sin x
[PROOF STEP]
by (simp add: sin_add sin_double cos_double)


[STATEMENT]
lemma card_spEdges_less:
  shows "card spEdges < card uE + 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card spEdges < card uE + 1
[PROOF STEP]
using card_spEdges_le
[PROOF STATE]
proof (prove)
using this:
card spEdges \<le> card uE

goal (1 subgoal):
 1. card spEdges < card uE + 1
[PROOF STEP]
by auto


[STATEMENT]
lemma bernoulli'_in_Rats: "bernoulli' n \<in> \<rat>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bernoulli' n \<in> \<rat>
[PROOF STEP]
by (simp add: bernoulli'_def bernoulli_in_Rats)


[STATEMENT]
lemma prime_dvd_power_iff:
  "prime p \<Longrightarrow> n > 0 \<Longrightarrow> p dvd x ^ n \<longleftrightarrow> p dvd x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>prime p; 0 < n\<rbrakk> \<Longrightarrow> (p dvd x ^ n) = (p dvd x)
[PROOF STEP]
by (subst prime_elem_dvd_power_iff) simp_all


[STATEMENT]
lemma list_app_eq_cases:
  assumes "xs\<^sub>1 @ xs\<^sub>2 = ys\<^sub>1 @ ys\<^sub>2"
  obtains (longer)  "xs\<^sub>1 = take (length xs\<^sub>1) ys\<^sub>1" "xs\<^sub>2 = drop (length xs\<^sub>1) ys\<^sub>1 @ ys\<^sub>2"
        | (shorter) "ys\<^sub>1 = take (length ys\<^sub>1) xs\<^sub>1" "ys\<^sub>2 = drop (length ys\<^sub>1) xs\<^sub>1 @ xs\<^sub>2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<lbrakk>xs\<^sub>1 = take (length xs\<^sub>1) ys\<^sub>1; xs\<^sub>2 = drop (length xs\<^sub>1) ys\<^sub>1 @ ys\<^sub>2\<rbrakk> \<Longrightarrow> thesis; \<lbrakk>ys\<^sub>1 = take (length ys\<^sub>1) xs\<^sub>1; ys\<^sub>2 = drop (length ys\<^sub>1) xs\<^sub>1 @ xs\<^sub>2\<rbrakk> \<Longrightarrow> thesis\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
xs\<^sub>1 @ xs\<^sub>2 = ys\<^sub>1 @ ys\<^sub>2

goal (1 subgoal):
 1. \<lbrakk>\<lbrakk>xs\<^sub>1 = take (length xs\<^sub>1) ys\<^sub>1; xs\<^sub>2 = drop (length xs\<^sub>1) ys\<^sub>1 @ ys\<^sub>2\<rbrakk> \<Longrightarrow> thesis; \<lbrakk>ys\<^sub>1 = take (length ys\<^sub>1) xs\<^sub>1; ys\<^sub>2 = drop (length ys\<^sub>1) xs\<^sub>1 @ xs\<^sub>2\<rbrakk> \<Longrightarrow> thesis\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
by (cases "length xs\<^sub>1 \<le> length ys\<^sub>1") (metis append_eq_append_conv_if)+