[STATEMENT]
lemma Moebius_function_norm_lt_1:
  assumes w1: "norm w < 1" and z1: "norm z < 1"
  shows "norm (Moebius_function t w z) < 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cmod (Moebius_function t w z) < 1
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. cmod (Moebius_function t w z) < 1
[PROOF STEP]
have "1 - cnj w * z \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 - cnj w * z \<noteq> 0
[PROOF STEP]
by (metis complex_cnj_cnj complex_mod_sqrt_Re_mult_cnj mult.commute mult_less_cancel_right1 norm_ge_zero norm_mult norm_one order.asym right_minus_eq w1 z1)
[PROOF STATE]
proof (state)
this:
1 - cnj w * z \<noteq> 0

goal (1 subgoal):
 1. cmod (Moebius_function t w z) < 1
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
1 - cnj w * z \<noteq> 0
[PROOF STEP]
have VV: "1 - w * cnj z \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
1 - cnj w * z \<noteq> 0

goal (1 subgoal):
 1. 1 - w * cnj z \<noteq> 0
[PROOF STEP]
by (metis complex_cnj_cnj complex_cnj_mult complex_cnj_one right_minus_eq)
[PROOF STATE]
proof (state)
this:
1 - w * cnj z \<noteq> 0

goal (1 subgoal):
 1. cmod (Moebius_function t w z) < 1
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
1 - w * cnj z \<noteq> 0
[PROOF STEP]
have "1 - norm (Moebius_function t w z) ^ 2 =
         ((1 - norm w ^ 2) / (norm (1 - cnj w * z) ^ 2)) * (1 - norm z ^ 2)"
[PROOF STATE]
proof (prove)
using this:
1 - w * cnj z \<noteq> 0

goal (1 subgoal):
 1. 1 - (cmod (Moebius_function t w z))\<^sup>2 = (1 - (cmod w)\<^sup>2) / (cmod (1 - cnj w * z))\<^sup>2 * (1 - (cmod z)\<^sup>2)
[PROOF STEP]
apply (cases w)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x1 x2. \<lbrakk>1 - w * cnj z \<noteq> 0; w = Complex x1 x2\<rbrakk> \<Longrightarrow> 1 - (cmod (Moebius_function t w z))\<^sup>2 = (1 - (cmod w)\<^sup>2) / (cmod (1 - cnj w * z))\<^sup>2 * (1 - (cmod z)\<^sup>2)
[PROOF STEP]
apply (cases z)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x1 x2 x1a x2a. \<lbrakk>1 - w * cnj z \<noteq> 0; w = Complex x1 x2; z = Complex x1a x2a\<rbrakk> \<Longrightarrow> 1 - (cmod (Moebius_function t w z))\<^sup>2 = (1 - (cmod w)\<^sup>2) / (cmod (1 - cnj w * z))\<^sup>2 * (1 - (cmod z)\<^sup>2)
[PROOF STEP]
apply (simp add: Moebius_function_def divide_simps norm_divide norm_mult)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x1 x2 x1a x2a. \<lbrakk>Complex x1 x2 * cnj (Complex x1a x2a) \<noteq> 1; w = Complex x1 x2; z = Complex x1a x2a\<rbrakk> \<Longrightarrow> (cnj (Complex x1 x2) * Complex x1a x2a \<noteq> 1 \<longrightarrow> (cmod (1 - cnj (Complex x1 x2) * Complex x1a x2a))\<^sup>2 - (cmod (Complex x1a x2a - Complex x1 x2))\<^sup>2 = (1 - (cmod (Complex x1 x2))\<^sup>2) * (1 - (cmod (Complex x1a x2a))\<^sup>2)) \<and> cnj (Complex x1 x2) * Complex x1a x2a \<noteq> 1
[PROOF STEP]
apply (simp add: complex_norm complex_diff complex_mult one_complex.code complex_cnj)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x1 x2 x1a x2a. \<lbrakk>x1 * x1a + x2 * x2a = 1 \<longrightarrow> x2 * x1a \<noteq> x1 * x2a; w = Complex x1 x2; z = Complex x1a x2a\<rbrakk> \<Longrightarrow> ((x1 * x1a + x2 * x2a = 1 \<longrightarrow> x1 * x2a \<noteq> x2 * x1a) \<longrightarrow> (1 - (x1 * x1a + x2 * x2a))\<^sup>2 + (x2 * x1a - x1 * x2a)\<^sup>2 - ((x1a - x1)\<^sup>2 + (x2a - x2)\<^sup>2) = (1 - (x1\<^sup>2 + x2\<^sup>2)) * (1 - (x1a\<^sup>2 + x2a\<^sup>2))) \<and> (x1 * x1a + x2 * x2a = 1 \<longrightarrow> x1 * x2a \<noteq> x2 * x1a)
[PROOF STEP]
apply (auto simp: algebra_simps power2_eq_square)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
1 - (cmod (Moebius_function t w z))\<^sup>2 = (1 - (cmod w)\<^sup>2) / (cmod (1 - cnj w * z))\<^sup>2 * (1 - (cmod z)\<^sup>2)

goal (1 subgoal):
 1. cmod (Moebius_function t w z) < 1
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
1 - (cmod (Moebius_function t w z))\<^sup>2 = (1 - (cmod w)\<^sup>2) / (cmod (1 - cnj w * z))\<^sup>2 * (1 - (cmod z)\<^sup>2)
[PROOF STEP]
have "1 - (cmod (Moebius_function t w z))\<^sup>2 = (1 - cmod (w * w)) / (cmod (1 - cnj w * z))\<^sup>2 * (1 - cmod (z * z))"
[PROOF STATE]
proof (prove)
using this:
1 - (cmod (Moebius_function t w z))\<^sup>2 = (1 - (cmod w)\<^sup>2) / (cmod (1 - cnj w * z))\<^sup>2 * (1 - (cmod z)\<^sup>2)

goal (1 subgoal):
 1. 1 - (cmod (Moebius_function t w z))\<^sup>2 = (1 - cmod (w * w)) / (cmod (1 - cnj w * z))\<^sup>2 * (1 - cmod (z * z))
[PROOF STEP]
by (simp add: norm_mult power2_eq_square)
[PROOF STATE]
proof (state)
this:
1 - (cmod (Moebius_function t w z))\<^sup>2 = (1 - cmod (w * w)) / (cmod (1 - cnj w * z))\<^sup>2 * (1 - cmod (z * z))

goal (1 subgoal):
 1. cmod (Moebius_function t w z) < 1
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
1 - (cmod (Moebius_function t w z))\<^sup>2 = (1 - cmod (w * w)) / (cmod (1 - cnj w * z))\<^sup>2 * (1 - cmod (z * z))

goal (1 subgoal):
 1. cmod (Moebius_function t w z) < 1
[PROOF STEP]
have "0 < 1 - cmod (z * z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < 1 - cmod (z * z)
[PROOF STEP]
by (metis (no_types) z1 diff_gt_0_iff_gt mult.left_neutral norm_mult_less)
[PROOF STATE]
proof (state)
this:
0 < 1 - cmod (z * z)

goal (1 subgoal):
 1. cmod (Moebius_function t w z) < 1
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
1 - (cmod (Moebius_function t w z))\<^sup>2 = (1 - cmod (w * w)) / (cmod (1 - cnj w * z))\<^sup>2 * (1 - cmod (z * z))
0 < 1 - cmod (z * z)
[PROOF STEP]
have "0 < 1 - norm (Moebius_function t w z) ^ 2"
[PROOF STATE]
proof (prove)
using this:
1 - (cmod (Moebius_function t w z))\<^sup>2 = (1 - cmod (w * w)) / (cmod (1 - cnj w * z))\<^sup>2 * (1 - cmod (z * z))
0 < 1 - cmod (z * z)

goal (1 subgoal):
 1. 0 < 1 - (cmod (Moebius_function t w z))\<^sup>2
[PROOF STEP]
using \<open>1 - cnj w * z \<noteq> 0\<close> w1 norm_mult_less
[PROOF STATE]
proof (prove)
using this:
1 - (cmod (Moebius_function t w z))\<^sup>2 = (1 - cmod (w * w)) / (cmod (1 - cnj w * z))\<^sup>2 * (1 - cmod (z * z))
0 < 1 - cmod (z * z)
1 - cnj w * z \<noteq> 0
cmod w < 1
\<lbrakk>norm ?x < ?r; norm ?y < ?s\<rbrakk> \<Longrightarrow> norm (?x * ?y) < ?r * ?s

goal (1 subgoal):
 1. 0 < 1 - (cmod (Moebius_function t w z))\<^sup>2
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
0 < 1 - (cmod (Moebius_function t w z))\<^sup>2

goal (1 subgoal):
 1. cmod (Moebius_function t w z) < 1
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 < 1 - (cmod (Moebius_function t w z))\<^sup>2
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
0 < 1 - (cmod (Moebius_function t w z))\<^sup>2

goal (1 subgoal):
 1. cmod (Moebius_function t w z) < 1
[PROOF STEP]
using linorder_not_less
[PROOF STATE]
proof (prove)
using this:
0 < 1 - (cmod (Moebius_function t w z))\<^sup>2
(\<not> ?x < ?y) = (?y \<le> ?x)

goal (1 subgoal):
 1. cmod (Moebius_function t w z) < 1
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
cmod (Moebius_function t w z) < 1

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Nset_injTr2:"\<lbrakk>\<forall>l\<le> (Suc n). f l \<le> (Suc n); inj_on f {i. i \<le> (Suc n)};
                    f (Suc n) = Suc n\<rbrakk> \<Longrightarrow> \<forall>l \<le> n. f l \<le> n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>l\<le>Suc n. f l \<le> Suc n; inj_on f {i. i \<le> Suc n}; f (Suc n) = Suc n\<rbrakk> \<Longrightarrow> \<forall>l\<le>n. f l \<le> n
[PROOF STEP]
apply (rule allI, rule impI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>l. \<lbrakk>\<forall>l\<le>Suc n. f l \<le> Suc n; inj_on f {i. i \<le> Suc n}; f (Suc n) = Suc n; l \<le> n\<rbrakk> \<Longrightarrow> f l \<le> n
[PROOF STEP]
apply (cut_tac k = l in Nset_pre_mem[of f n])
[PROOF STATE]
proof (prove)
goal (5 subgoals):
 1. \<And>l. \<lbrakk>\<forall>l\<le>Suc n. f l \<le> Suc n; inj_on f {i. i \<le> Suc n}; f (Suc n) = Suc n; l \<le> n\<rbrakk> \<Longrightarrow> f \<in> {i. i \<le> Suc n} \<rightarrow> {i. i \<le> Suc n}
 2. \<And>l. \<lbrakk>\<forall>l\<le>Suc n. f l \<le> Suc n; inj_on f {i. i \<le> Suc n}; f (Suc n) = Suc n; l \<le> n\<rbrakk> \<Longrightarrow> inj_on f {i. i \<le> Suc n}
 3. \<And>l. \<lbrakk>\<forall>l\<le>Suc n. f l \<le> Suc n; inj_on f {i. i \<le> Suc n}; f (Suc n) = Suc n; l \<le> n\<rbrakk> \<Longrightarrow> f (Suc n) = Suc n
 4. \<And>l. \<lbrakk>\<forall>l\<le>Suc n. f l \<le> Suc n; inj_on f {i. i \<le> Suc n}; f (Suc n) = Suc n; l \<le> n\<rbrakk> \<Longrightarrow> l \<le> n
 5. \<And>l. \<lbrakk>\<forall>l\<le>Suc n. f l \<le> Suc n; inj_on f {i. i \<le> Suc n}; f (Suc n) = Suc n; l \<le> n; f l \<in> {i. i \<le> n}\<rbrakk> \<Longrightarrow> f l \<le> n
[PROOF STEP]
apply (simp+)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma nrows_eq_card_rows:
  fixes A::"'a^'columns::{mod_type}^'rows::{mod_type}"
  shows "nrows_iarray (matrix_to_iarray A) = CARD('rows)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nrows_iarray (matrix_to_iarray A) = CARD('rows)
[PROOF STEP]
unfolding nrows_iarray_def length_eq_card_rows
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. CARD('rows) = CARD('rows)
[PROOF STEP]
..


[STATEMENT]
lemma le_imp_bigo_real:
  assumes "c \<ge> 0" "eventually (\<lambda>x. f x \<le> c * (g x :: real)) F" "eventually (\<lambda>x. 0 \<le> f x) F"
  shows   "f \<in> O[F](g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<in> O[F](g)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. f \<in> O[F](g)
[PROOF STEP]
have "eventually (\<lambda>x. norm (f x) \<le> c * norm (g x)) F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F x in F. norm (f x) \<le> c * norm (g x)
[PROOF STEP]
using assms(2,3)
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in F. f x \<le> c * g x
\<forall>\<^sub>F x in F. 0 \<le> f x

goal (1 subgoal):
 1. \<forall>\<^sub>F x in F. norm (f x) \<le> c * norm (g x)
[PROOF STEP]
proof eventually_elim
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>f x \<le> c * g x; 0 \<le> f x\<rbrakk> \<Longrightarrow> norm (f x) \<le> c * norm (g x)
[PROOF STEP]
case (elim x)
[PROOF STATE]
proof (state)
this:
f x \<le> c * g x
0 \<le> f x

goal (1 subgoal):
 1. \<And>x. \<lbrakk>f x \<le> c * g x; 0 \<le> f x\<rbrakk> \<Longrightarrow> norm (f x) \<le> c * norm (g x)
[PROOF STEP]
have "norm (f x) \<le> c * g x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (f x) \<le> c * g x
[PROOF STEP]
using elim
[PROOF STATE]
proof (prove)
using this:
f x \<le> c * g x
0 \<le> f x

goal (1 subgoal):
 1. norm (f x) \<le> c * g x
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
norm (f x) \<le> c * g x

goal (1 subgoal):
 1. \<And>x. \<lbrakk>f x \<le> c * g x; 0 \<le> f x\<rbrakk> \<Longrightarrow> norm (f x) \<le> c * norm (g x)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
norm (f x) \<le> c * g x

goal (1 subgoal):
 1. \<And>x. \<lbrakk>f x \<le> c * g x; 0 \<le> f x\<rbrakk> \<Longrightarrow> norm (f x) \<le> c * norm (g x)
[PROOF STEP]
have "\<dots> \<le> c * norm (g x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c * g x \<le> c * norm (g x)
[PROOF STEP]
by (intro mult_left_mono assms) auto
[PROOF STATE]
proof (state)
this:
c * g x \<le> c * norm (g x)

goal (1 subgoal):
 1. \<And>x. \<lbrakk>f x \<le> c * g x; 0 \<le> f x\<rbrakk> \<Longrightarrow> norm (f x) \<le> c * norm (g x)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
norm (f x) \<le> c * norm (g x)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
norm (f x) \<le> c * norm (g x)

goal (1 subgoal):
 1. norm (f x) \<le> c * norm (g x)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
norm (f x) \<le> c * norm (g x)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in F. norm (f x) \<le> c * norm (g x)

goal (1 subgoal):
 1. f \<in> O[F](g)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in F. norm (f x) \<le> c * norm (g x)

goal (1 subgoal):
 1. f \<in> O[F](g)
[PROOF STEP]
by (intro bigoI[of _ c]) auto
[PROOF STATE]
proof (state)
this:
f \<in> O[F](g)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma convex_hull_eq_real_cbox:
  fixes x y :: real assumes "x \<le> y"
  shows "convex hull {x, y} = cbox x y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. convex hull {x, y} = cbox x y
[PROOF STEP]
proof (rule hull_unique)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. {x, y} \<subseteq> cbox x y
 2. convex (cbox x y)
 3. \<And>t'. \<lbrakk>{x, y} \<subseteq> t'; convex t'\<rbrakk> \<Longrightarrow> cbox x y \<subseteq> t'
[PROOF STEP]
show "{x, y} \<subseteq> cbox x y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {x, y} \<subseteq> cbox x y
[PROOF STEP]
using \<open>x \<le> y\<close>
[PROOF STATE]
proof (prove)
using this:
x \<le> y

goal (1 subgoal):
 1. {x, y} \<subseteq> cbox x y
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{x, y} \<subseteq> cbox x y

goal (2 subgoals):
 1. convex (cbox x y)
 2. \<And>t'. \<lbrakk>{x, y} \<subseteq> t'; convex t'\<rbrakk> \<Longrightarrow> cbox x y \<subseteq> t'
[PROOF STEP]
show "convex (cbox x y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. convex (cbox x y)
[PROOF STEP]
by (rule convex_box)
[PROOF STATE]
proof (state)
this:
convex (cbox x y)

goal (1 subgoal):
 1. \<And>t'. \<lbrakk>{x, y} \<subseteq> t'; convex t'\<rbrakk> \<Longrightarrow> cbox x y \<subseteq> t'
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>t'. \<lbrakk>{x, y} \<subseteq> t'; convex t'\<rbrakk> \<Longrightarrow> cbox x y \<subseteq> t'
[PROOF STEP]
fix S
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>t'. \<lbrakk>{x, y} \<subseteq> t'; convex t'\<rbrakk> \<Longrightarrow> cbox x y \<subseteq> t'
[PROOF STEP]
assume "{x, y} \<subseteq> S" and "convex S"
[PROOF STATE]
proof (state)
this:
{x, y} \<subseteq> S
convex S

goal (1 subgoal):
 1. \<And>t'. \<lbrakk>{x, y} \<subseteq> t'; convex t'\<rbrakk> \<Longrightarrow> cbox x y \<subseteq> t'
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
{x, y} \<subseteq> S
convex S
[PROOF STEP]
show "cbox x y \<subseteq> S"
[PROOF STATE]
proof (prove)
using this:
{x, y} \<subseteq> S
convex S

goal (1 subgoal):
 1. cbox x y \<subseteq> S
[PROOF STEP]
unfolding is_interval_convex_1 [symmetric] is_interval_def Basis_real_def
[PROOF STATE]
proof (prove)
using this:
{x, y} \<subseteq> S
\<forall>a\<in>S. \<forall>b\<in>S. \<forall>x. (\<forall>i\<in>{1}. a \<bullet> i \<le> x \<bullet> i \<and> x \<bullet> i \<le> b \<bullet> i \<or> b \<bullet> i \<le> x \<bullet> i \<and> x \<bullet> i \<le> a \<bullet> i) \<longrightarrow> x \<in> S

goal (1 subgoal):
 1. cbox x y \<subseteq> S
[PROOF STEP]
by - (clarify, simp (no_asm_use), fast)
[PROOF STATE]
proof (state)
this:
cbox x y \<subseteq> S

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma univ_for_pr_lm_6_1: "\<lbrakk>c_fst (c_fst key) mod 7 = 6; c_fst (c_snd key) = 0\<rbrakk> \<Longrightarrow> univ_for_pr key = univ_for_pr (c_pair (c_fst (c_snd (c_fst key))) (c_snd (c_snd key)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>c_fst (c_fst key) mod 7 = 6; c_fst (c_snd key) = 0\<rbrakk> \<Longrightarrow> univ_for_pr key = univ_for_pr (c_pair (c_fst (c_snd (c_fst key))) (c_snd (c_snd key)))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>c_fst (c_fst key) mod 7 = 6; c_fst (c_snd key) = 0\<rbrakk> \<Longrightarrow> univ_for_pr key = univ_for_pr (c_pair (c_fst (c_snd (c_fst key))) (c_snd (c_snd key)))
[PROOF STEP]
assume A1: "c_fst (c_fst key) mod 7 = 6"
[PROOF STATE]
proof (state)
this:
c_fst (c_fst key) mod 7 = 6

goal (1 subgoal):
 1. \<lbrakk>c_fst (c_fst key) mod 7 = 6; c_fst (c_snd key) = 0\<rbrakk> \<Longrightarrow> univ_for_pr key = univ_for_pr (c_pair (c_fst (c_snd (c_fst key))) (c_snd (c_snd key)))
[PROOF STEP]
assume A2: "c_fst (c_snd key) = 0"
[PROOF STATE]
proof (state)
this:
c_fst (c_snd key) = 0

goal (1 subgoal):
 1. \<lbrakk>c_fst (c_fst key) mod 7 = 6; c_fst (c_snd key) = 0\<rbrakk> \<Longrightarrow> univ_for_pr key = univ_for_pr (c_pair (c_fst (c_snd (c_fst key))) (c_snd (c_snd key)))
[PROOF STEP]
have S1: "univ_for_pr key = nat_to_pr (c_fst key) (c_snd key)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. univ_for_pr key = nat_to_pr (c_fst key) (c_snd key)
[PROOF STEP]
by (simp add: univ_for_pr_def pr_conv_2_to_1_def)
[PROOF STATE]
proof (state)
this:
univ_for_pr key = nat_to_pr (c_fst key) (c_snd key)

goal (1 subgoal):
 1. \<lbrakk>c_fst (c_fst key) mod 7 = 6; c_fst (c_snd key) = 0\<rbrakk> \<Longrightarrow> univ_for_pr key = univ_for_pr (c_pair (c_fst (c_snd (c_fst key))) (c_snd (c_snd key)))
[PROOF STEP]
with A1 A2
[PROOF STATE]
proof (chain)
picking this:
c_fst (c_fst key) mod 7 = 6
c_fst (c_snd key) = 0
univ_for_pr key = nat_to_pr (c_fst key) (c_snd key)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
c_fst (c_fst key) mod 7 = 6
c_fst (c_snd key) = 0
univ_for_pr key = nat_to_pr (c_fst key) (c_snd key)

goal (1 subgoal):
 1. univ_for_pr key = univ_for_pr (c_pair (c_fst (c_snd (c_fst key))) (c_snd (c_snd key)))
[PROOF STEP]
by (simp add: nat_to_pr_lm_6 UnaryRecOp_def univ_for_pr_def pr_conv_2_to_1_def)
[PROOF STATE]
proof (state)
this:
univ_for_pr key = univ_for_pr (c_pair (c_fst (c_snd (c_fst key))) (c_snd (c_snd key)))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma split_block4_decreases_dim_row:
  assumes E: "(A,B,C,D) = split_block E 1 1"
    and E1: "dim_row E > 1" and E2: "dim_col E > 1"
  shows "dim_row D < dim_row E"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_row D < dim_row E
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. dim_row D < dim_row E
[PROOF STEP]
have "D \<in> carrier_mat (1 + (dim_row E - 2)) (1 + (dim_col E - 2))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. D \<in> carrier_mat (1 + (dim_row E - 2)) (1 + (dim_col E - 2))
[PROOF STEP]
by (rule split_block(4)[OF E[symmetric]], insert E1 E2, auto)
[PROOF STATE]
proof (state)
this:
D \<in> carrier_mat (1 + (dim_row E - 2)) (1 + (dim_col E - 2))

goal (1 subgoal):
 1. dim_row D < dim_row E
[PROOF STEP]
hence "D \<in> carrier_mat (dim_row E - 1) (dim_col E - 1)"
[PROOF STATE]
proof (prove)
using this:
D \<in> carrier_mat (1 + (dim_row E - 2)) (1 + (dim_col E - 2))

goal (1 subgoal):
 1. D \<in> carrier_mat (dim_row E - 1) (dim_col E - 1)
[PROOF STEP]
using E1 E2
[PROOF STATE]
proof (prove)
using this:
D \<in> carrier_mat (1 + (dim_row E - 2)) (1 + (dim_col E - 2))
1 < dim_row E
1 < dim_col E

goal (1 subgoal):
 1. D \<in> carrier_mat (dim_row E - 1) (dim_col E - 1)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
D \<in> carrier_mat (dim_row E - 1) (dim_col E - 1)

goal (1 subgoal):
 1. dim_row D < dim_row E
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
D \<in> carrier_mat (dim_row E - 1) (dim_col E - 1)

goal (1 subgoal):
 1. dim_row D < dim_row E
[PROOF STEP]
using E1
[PROOF STATE]
proof (prove)
using this:
D \<in> carrier_mat (dim_row E - 1) (dim_col E - 1)
1 < dim_row E

goal (1 subgoal):
 1. dim_row D < dim_row E
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
dim_row D < dim_row E

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma vimage_sets_compl_iff:
  "f -` A \<inter> space M \<in> sets M \<longleftrightarrow> f -` (- A) \<inter> space M \<in> sets M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f -` A \<inter> space M \<in> sets M) = (f -` (- A) \<inter> space M \<in> sets M)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (f -` A \<inter> space M \<in> sets M) = (f -` (- A) \<inter> space M \<in> sets M)
[PROOF STEP]
{
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (f -` A \<inter> space M \<in> sets M) = (f -` (- A) \<inter> space M \<in> sets M)
[PROOF STEP]
fix A
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (f -` A \<inter> space M \<in> sets M) = (f -` (- A) \<inter> space M \<in> sets M)
[PROOF STEP]
assume "f -` A \<inter> space M \<in> sets M"
[PROOF STATE]
proof (state)
this:
f -` A \<inter> space M \<in> sets M

goal (1 subgoal):
 1. (f -` A \<inter> space M \<in> sets M) = (f -` (- A) \<inter> space M \<in> sets M)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
f -` A \<inter> space M \<in> sets M

goal (1 subgoal):
 1. (f -` A \<inter> space M \<in> sets M) = (f -` (- A) \<inter> space M \<in> sets M)
[PROOF STEP]
have "f -` (- A) \<inter> space M = space M - f -` A \<inter> space M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f -` (- A) \<inter> space M = space M - f -` A \<inter> space M
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
f -` (- A) \<inter> space M = space M - f -` A \<inter> space M

goal (1 subgoal):
 1. (f -` A \<inter> space M \<in> sets M) = (f -` (- A) \<inter> space M \<in> sets M)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
f -` A \<inter> space M \<in> sets M
f -` (- A) \<inter> space M = space M - f -` A \<inter> space M
[PROOF STEP]
have "f -` (- A) \<inter> space M \<in> sets M"
[PROOF STATE]
proof (prove)
using this:
f -` A \<inter> space M \<in> sets M
f -` (- A) \<inter> space M = space M - f -` A \<inter> space M

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

goal (1 subgoal):
 1. (f -` A \<inter> space M \<in> sets M) = (f -` (- A) \<inter> space M \<in> sets M)
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
f -` ?Aa2 \<inter> space M \<in> sets M \<Longrightarrow> f -` (- ?Aa2) \<inter> space M \<in> sets M

goal (1 subgoal):
 1. (f -` A \<inter> space M \<in> sets M) = (f -` (- A) \<inter> space M \<in> sets M)
[PROOF STEP]
from this[of A] this[of "-A"]
[PROOF STATE]
proof (chain)
picking this:
f -` A \<inter> space M \<in> sets M \<Longrightarrow> f -` (- A) \<inter> space M \<in> sets M
f -` (- A) \<inter> space M \<in> sets M \<Longrightarrow> f -` (- (- A)) \<inter> space M \<in> sets M
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
f -` A \<inter> space M \<in> sets M \<Longrightarrow> f -` (- A) \<inter> space M \<in> sets M
f -` (- A) \<inter> space M \<in> sets M \<Longrightarrow> f -` (- (- A)) \<inter> space M \<in> sets M

goal (1 subgoal):
 1. (f -` A \<inter> space M \<in> sets M) = (f -` (- A) \<inter> space M \<in> sets M)
[PROOF STEP]
by (metis double_complement)
[PROOF STATE]
proof (state)
this:
(f -` A \<inter> space M \<in> sets M) = (f -` (- A) \<inter> space M \<in> sets M)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma is_poincare_line_0_real_is_x_axis:
  assumes "is_poincare_line l" "0\<^sub>h \<in> circline_set l"
    "x \<in> circline_set l \<inter> circline_set x_axis" "x \<noteq> 0\<^sub>h" "x \<noteq> \<infinity>\<^sub>h"
  shows "l = x_axis"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. l = x_axis
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
is_poincare_line l
0\<^sub>h \<in> circline_set l
x \<in> circline_set l \<inter> circline_set x_axis
x \<noteq> 0\<^sub>h
x \<noteq> \<infinity>\<^sub>h

goal (1 subgoal):
 1. l = x_axis
[PROOF STEP]
using is_poincare_line_trough_zero_trough_infty[OF assms(1-2)]
[PROOF STATE]
proof (prove)
using this:
is_poincare_line l
0\<^sub>h \<in> circline_set l
x \<in> circline_set l \<inter> circline_set x_axis
x \<noteq> 0\<^sub>h
x \<noteq> \<infinity>\<^sub>h
\<infinity>\<^sub>h \<in> circline_set l

goal (1 subgoal):
 1. l = x_axis
[PROOF STEP]
using unique_circline_set[of x "0\<^sub>h" "\<infinity>\<^sub>h"]
[PROOF STATE]
proof (prove)
using this:
is_poincare_line l
0\<^sub>h \<in> circline_set l
x \<in> circline_set l \<inter> circline_set x_axis
x \<noteq> 0\<^sub>h
x \<noteq> \<infinity>\<^sub>h
\<infinity>\<^sub>h \<in> circline_set l
\<lbrakk>x \<noteq> 0\<^sub>h; x \<noteq> \<infinity>\<^sub>h; 0\<^sub>h \<noteq> \<infinity>\<^sub>h\<rbrakk> \<Longrightarrow> \<exists>!H. x \<in> circline_set H \<and> 0\<^sub>h \<in> circline_set H \<and> \<infinity>\<^sub>h \<in> circline_set H

goal (1 subgoal):
 1. l = x_axis
[PROOF STEP]
by auto


[STATEMENT]
lemma linear_injective_isomorphism:
  assumes lf: "linear s1 s2 f"
    and fi: "inj f"
    and dims: "vs2.dim UNIV = vs1.dim UNIV"
  shows "\<exists>f'. linear s2 s1 f' \<and> (\<forall>x. f' (f x) = x) \<and> (\<forall>x. f (f' x) = x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>f'. linear (*b) (*a) f' \<and> (\<forall>x. f' (f x) = x) \<and> (\<forall>x. f (f' x) = x)
[PROOF STEP]
unfolding isomorphism_expand[symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>f'. linear (*b) (*a) f' \<and> f' \<circ> f = id \<and> f \<circ> f' = id
[PROOF STEP]
using linear_injective_imp_surjective[OF lf fi dims]
[PROOF STATE]
proof (prove)
using this:
surj f

goal (1 subgoal):
 1. \<exists>f'. linear (*b) (*a) f' \<and> f' \<circ> f = id \<and> f \<circ> f' = id
[PROOF STEP]
using fi left_right_inverse_eq lf linear_injective_left_inverse linear_surjective_right_inverse
[PROOF STATE]
proof (prove)
using this:
surj f
inj f
\<lbrakk>?f \<circ> ?g = id; ?g \<circ> ?h = id\<rbrakk> \<Longrightarrow> ?f = ?h
linear (*a) (*b) f
\<lbrakk>linear (*a) (*b) ?f; inj ?f\<rbrakk> \<Longrightarrow> \<exists>g. linear (*b) (*a) g \<and> g \<circ> ?f = id
\<lbrakk>linear (*a) (*b) ?f; surj ?f\<rbrakk> \<Longrightarrow> \<exists>g. linear (*b) (*a) g \<and> ?f \<circ> g = id

goal (1 subgoal):
 1. \<exists>f'. linear (*b) (*a) f' \<and> f' \<circ> f = id \<and> f \<circ> f' = id
[PROOF STEP]
by blast


[STATEMENT]
lemma replace_comp_support_set:
  shows "support_set (qty_replace_comp pf1 x pf2) \<subseteq> (support_set pf1 - {x}) \<union> support_set pf2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. support_set (qty_replace_comp pf1 x pf2) \<subseteq> support_set pf1 - {x} \<union> support_set pf2
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. support_set (qty_replace_comp pf1 x pf2) \<subseteq> support_set pf1 - {x} \<union> support_set pf2
[PROOF STEP]
have "support_set (qty_replace_comp pf1 x pf2) \<subseteq> support_set (qty_rem_comp pf1 x) \<union> support_set (qty_mult_comp pf2 (pf1 x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. support_set (qty_replace_comp pf1 x pf2) \<subseteq> support_set (qty_rem_comp pf1 x) \<union> support_set (qty_mult_comp pf2 (pf1 x))
[PROOF STEP]
unfolding qty_replace_comp_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. support_set (qty_sum (qty_rem_comp pf1 x) (qty_mult_comp pf2 (pf1 x))) \<subseteq> support_set (qty_rem_comp pf1 x) \<union> support_set (qty_mult_comp pf2 (pf1 x))
[PROOF STEP]
by (simp add:sum_support_set)
[PROOF STATE]
proof (state)
this:
support_set (qty_replace_comp pf1 x pf2) \<subseteq> support_set (qty_rem_comp pf1 x) \<union> support_set (qty_mult_comp pf2 (pf1 x))

goal (1 subgoal):
 1. support_set (qty_replace_comp pf1 x pf2) \<subseteq> support_set pf1 - {x} \<union> support_set pf2
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
support_set (qty_replace_comp pf1 x pf2) \<subseteq> support_set (qty_rem_comp pf1 x) \<union> support_set (qty_mult_comp pf2 (pf1 x))

goal (1 subgoal):
 1. support_set (qty_replace_comp pf1 x pf2) \<subseteq> support_set pf1 - {x} \<union> support_set pf2
[PROOF STEP]
have "... \<subseteq> (support_set pf1 - {x}) \<union> support_set pf2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. support_set (qty_rem_comp pf1 x) \<union> support_set (qty_mult_comp pf2 (pf1 x)) \<subseteq> support_set pf1 - {x} \<union> support_set pf2
[PROOF STEP]
using remove_comp_support_set mult_comp_support_set
[PROOF STATE]
proof (prove)
using this:
support_set (qty_rem_comp ?pf1.0 ?x) \<subseteq> support_set ?pf1.0 - {?x}
support_set (qty_mult_comp ?pf1.0 ?qty) \<subseteq> support_set ?pf1.0

goal (1 subgoal):
 1. support_set (qty_rem_comp pf1 x) \<union> support_set (qty_mult_comp pf2 (pf1 x)) \<subseteq> support_set pf1 - {x} \<union> support_set pf2
[PROOF STEP]
by (metis sup.mono)
[PROOF STATE]
proof (state)
this:
support_set (qty_rem_comp pf1 x) \<union> support_set (qty_mult_comp pf2 (pf1 x)) \<subseteq> support_set pf1 - {x} \<union> support_set pf2

goal (1 subgoal):
 1. support_set (qty_replace_comp pf1 x pf2) \<subseteq> support_set pf1 - {x} \<union> support_set pf2
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
support_set (qty_replace_comp pf1 x pf2) \<subseteq> support_set pf1 - {x} \<union> support_set pf2
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
support_set (qty_replace_comp pf1 x pf2) \<subseteq> support_set pf1 - {x} \<union> support_set pf2

goal (1 subgoal):
 1. support_set (qty_replace_comp pf1 x pf2) \<subseteq> support_set pf1 - {x} \<union> support_set pf2
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
support_set (qty_replace_comp pf1 x pf2) \<subseteq> support_set pf1 - {x} \<union> support_set pf2

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in vars)
  "\<Gamma>\<turnstile>\<^sub>t \<lbrace>\<acute>M = 0 \<and> \<acute>S = 0\<rbrace>
       WHILE \<acute>M \<noteq> a
       INV \<lbrace>\<acute>S = \<acute>M * b \<and> \<acute>M \<le> a\<rbrace>
       VAR MEASURE a - \<acute>M
       DO \<acute>S :== \<acute>S + b;; \<acute>M :== \<acute>M + 1 OD
       \<lbrace>\<acute>S = a * b\<rbrace>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Gamma>\<turnstile>\<^sub>t \<lbrace>\<acute>M = 0 \<and> \<acute>S = 0\<rbrace> WHILE \<acute>M \<noteq> a INV \<lbrace>\<acute>S = \<acute>M * b \<and> \<acute>M \<le> a\<rbrace> VAR measure (\<lambda>s. a - (locals s\<cdot>M_')) DO \<acute>S :== \<acute>S + b;; \<acute>M :== \<acute>M + 1 OD \<lbrace>\<acute>S = a * b\<rbrace>
[PROOF STEP]
apply vcg
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>M S. \<lbrakk>M = 0; S = 0\<rbrakk> \<Longrightarrow> S = M * b \<and> M \<le> a
 2. \<And>M S. \<lbrakk>S = M * b; M \<le> a; M \<noteq> a\<rbrakk> \<Longrightarrow> a - (M + 1) < a - M \<and> S + b = (M + 1) * b \<and> M + 1 \<le> a
 3. \<And>M S. \<lbrakk>S = M * b; M \<le> a; \<not> M \<noteq> a\<rbrakk> \<Longrightarrow> S = a * b
[PROOF STEP]
txt \<open>@{subgoals [display]}
The first conjunct of the second subgoal is the proof obligation that the
variant decreases in the loop body.
\<close>
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>M S. \<lbrakk>M = 0; S = 0\<rbrakk> \<Longrightarrow> S = M * b \<and> M \<le> a
 2. \<And>M S. \<lbrakk>S = M * b; M \<le> a; M \<noteq> a\<rbrakk> \<Longrightarrow> a - (M + 1) < a - M \<and> S + b = (M + 1) * b \<and> M + 1 \<le> a
 3. \<And>M S. \<lbrakk>S = M * b; M \<le> a; \<not> M \<noteq> a\<rbrakk> \<Longrightarrow> S = a * b
[PROOF STEP]
by auto


[STATEMENT]
lemma qbs_morphism_comp:
  assumes "f \<in> X \<rightarrow>\<^sub>Q Y" "g \<in> Y \<rightarrow>\<^sub>Q Z"
  shows "g \<circ> f \<in> X \<rightarrow>\<^sub>Q Z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. g \<circ> f \<in> X \<rightarrow>\<^sub>Q Z
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
f \<in> X \<rightarrow>\<^sub>Q Y
g \<in> Y \<rightarrow>\<^sub>Q Z

goal (1 subgoal):
 1. g \<circ> f \<in> X \<rightarrow>\<^sub>Q Z
[PROOF STEP]
by (simp add: comp_assoc Pi_def qbs_morphism_def)


[STATEMENT]
lemma iterated_serial_on_in_power:
  assumes "serial_on A r" "a \<in> A"
  shows "(a,iterated_serial_on A r a n) \<in> r ^^ n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a, iterated_serial_on A r a n) \<in> r ^^ n
[PROOF STEP]
proof (induct n)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (a, iterated_serial_on A r a 0) \<in> r ^^ 0
 2. \<And>n. (a, iterated_serial_on A r a n) \<in> r ^^ n \<Longrightarrow> (a, iterated_serial_on A r a (Suc n)) \<in> r ^^ Suc n
[PROOF STEP]
case (Suc n)
[PROOF STATE]
proof (state)
this:
(a, iterated_serial_on A r a n) \<in> r ^^ n

goal (2 subgoals):
 1. (a, iterated_serial_on A r a 0) \<in> r ^^ 0
 2. \<And>n. (a, iterated_serial_on A r a n) \<in> r ^^ n \<Longrightarrow> (a, iterated_serial_on A r a (Suc n)) \<in> r ^^ Suc n
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(a, iterated_serial_on A r a n) \<in> r ^^ n

goal (2 subgoals):
 1. (a, iterated_serial_on A r a 0) \<in> r ^^ 0
 2. \<And>n. (a, iterated_serial_on A r a n) \<in> r ^^ n \<Longrightarrow> (a, iterated_serial_on A r a (Suc n)) \<in> r ^^ Suc n
[PROOF STEP]
obtain b where "(iterated_serial_on A r a n,b) \<in> r" "b \<in> A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>b. \<lbrakk>(iterated_serial_on A r a n, b) \<in> r; b \<in> A\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using iterated_serial_on_in_A[OF assms, of n] assms(1)
[PROOF STATE]
proof (prove)
using this:
iterated_serial_on A r a n \<in> A
serial_on A r

goal (1 subgoal):
 1. (\<And>b. \<lbrakk>(iterated_serial_on A r a n, b) \<in> r; b \<in> A\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by - (rule serial_onE)
[PROOF STATE]
proof (state)
this:
(iterated_serial_on A r a n, b) \<in> r
b \<in> A

goal (2 subgoals):
 1. (a, iterated_serial_on A r a 0) \<in> r ^^ 0
 2. \<And>n. (a, iterated_serial_on A r a n) \<in> r ^^ n \<Longrightarrow> (a, iterated_serial_on A r a (Suc n)) \<in> r ^^ Suc n
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
(a, iterated_serial_on A r a n) \<in> r ^^ n
(iterated_serial_on A r a n, b) \<in> r
b \<in> A
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
(a, iterated_serial_on A r a n) \<in> r ^^ n
(iterated_serial_on A r a n, b) \<in> r
b \<in> A

goal (1 subgoal):
 1. (a, iterated_serial_on A r a (Suc n)) \<in> r ^^ Suc n
[PROOF STEP]
by (subst iterated_serial_on.simps(2)) (rule someI2_ex, auto)
[PROOF STATE]
proof (state)
this:
(a, iterated_serial_on A r a (Suc n)) \<in> r ^^ Suc n

goal (1 subgoal):
 1. (a, iterated_serial_on A r a 0) \<in> r ^^ 0
[PROOF STEP]
qed simp


[STATEMENT]
lemma fps_of_poly_smult:
  "fps_of_poly (smult c p) = fps_const c * fps_of_poly p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fps_of_poly (smult c p) = fps_const c * fps_of_poly p
[PROOF STEP]
using fps_of_poly_mult[of "[:c:]" p]
[PROOF STATE]
proof (prove)
using this:
fps_of_poly ([:c:] * p) = fps_of_poly [:c:] * fps_of_poly p

goal (1 subgoal):
 1. fps_of_poly (smult c p) = fps_const c * fps_of_poly p
[PROOF STEP]
by (simp add: fps_of_poly_mult fps_of_poly_const)


[STATEMENT]
lemma finprod_Suc3:
  assumes "f \<in> {..n :: nat} \<rightarrow> carrier G"
  shows "finprod G f {.. n} = (f n) \<otimes> finprod G f {..< n}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finprod G f {..n} = f n \<otimes> finprod G f {..<n}
[PROOF STEP]
proof (cases "n = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. n = 0 \<Longrightarrow> finprod G f {..n} = f n \<otimes> finprod G f {..<n}
 2. n \<noteq> 0 \<Longrightarrow> finprod G f {..n} = f n \<otimes> finprod G f {..<n}
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
n = 0

goal (2 subgoals):
 1. n = 0 \<Longrightarrow> finprod G f {..n} = f n \<otimes> finprod G f {..<n}
 2. n \<noteq> 0 \<Longrightarrow> finprod G f {..n} = f n \<otimes> finprod G f {..<n}
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
n = 0

goal (1 subgoal):
 1. finprod G f {..n} = f n \<otimes> finprod G f {..<n}
[PROOF STEP]
using assms atMost_Suc
[PROOF STATE]
proof (prove)
using this:
n = 0
f \<in> {..n} \<rightarrow> carrier G
{..Suc ?k} = insert (Suc ?k) {..?k}

goal (1 subgoal):
 1. finprod G f {..n} = f n \<otimes> finprod G f {..<n}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
finprod G f {..n} = f n \<otimes> finprod G f {..<n}

goal (1 subgoal):
 1. n \<noteq> 0 \<Longrightarrow> finprod G f {..n} = f n \<otimes> finprod G f {..<n}
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. n \<noteq> 0 \<Longrightarrow> finprod G f {..n} = f n \<otimes> finprod G f {..<n}
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
n \<noteq> 0

goal (1 subgoal):
 1. n \<noteq> 0 \<Longrightarrow> finprod G f {..n} = f n \<otimes> finprod G f {..<n}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
n \<noteq> 0
[PROOF STEP]
obtain k where "n = Suc k"
[PROOF STATE]
proof (prove)
using this:
n \<noteq> 0

goal (1 subgoal):
 1. (\<And>k. n = Suc k \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using not0_implies_Suc
[PROOF STATE]
proof (prove)
using this:
n \<noteq> 0
?n \<noteq> 0 \<Longrightarrow> \<exists>m. ?n = Suc m

goal (1 subgoal):
 1. (\<And>k. n = Suc k \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
n = Suc k

goal (1 subgoal):
 1. n \<noteq> 0 \<Longrightarrow> finprod G f {..n} = f n \<otimes> finprod G f {..<n}
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
n = Suc k

goal (1 subgoal):
 1. finprod G f {..n} = f n \<otimes> finprod G f {..<n}
[PROOF STEP]
using finprod_Suc[of f k] assms atMost_Suc lessThan_Suc_atMost
[PROOF STATE]
proof (prove)
using this:
n = Suc k
f \<in> {..Suc k} \<rightarrow> carrier G \<Longrightarrow> finprod G f {..Suc k} = f (Suc k) \<otimes> finprod G f {..k}
f \<in> {..n} \<rightarrow> carrier G
{..Suc ?k} = insert (Suc ?k) {..?k}
{..<Suc ?k} = {..?k}

goal (1 subgoal):
 1. finprod G f {..n} = f n \<otimes> finprod G f {..<n}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
finprod G f {..n} = f n \<otimes> finprod G f {..<n}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma analz_insert_Number [simp]:
     "analz (insert (Number N) H) = insert (Number N) (analz H)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. analz (insert (Number N) H) = insert (Number N) (analz H)
[PROOF STEP]
apply (rule analz_insert_eq_I)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. x \<in> analz (insert (Number N) H) \<Longrightarrow> x \<in> insert (Number N) (analz H)
[PROOF STEP]
apply (erule analz.induct, auto)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma n_multiset_permutation_enum_correct:
  "set (n_multiset_permutation_enum xs n) = n_multiset_permutations (mset xs) n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (n_multiset_permutation_enum xs n) = n_multiset_permutations (mset xs) n
[PROOF STEP]
unfolding n_multiset_permutations_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (n_multiset_permutation_enum xs n) = {xsa. mset xsa \<subseteq># mset xs \<and> length xsa = n}
[PROOF STEP]
proof(standard)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. set (n_multiset_permutation_enum xs n) \<subseteq> {xsa. mset xsa \<subseteq># mset xs \<and> length xsa = n}
 2. {xsa. mset xsa \<subseteq># mset xs \<and> length xsa = n} \<subseteq> set (n_multiset_permutation_enum xs n)
[PROOF STEP]
show "set (n_multiset_permutation_enum xs n) \<subseteq> {xsa. mset xsa \<subseteq># mset xs \<and> length xsa = n}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (n_multiset_permutation_enum xs n) \<subseteq> {xsa. mset xsa \<subseteq># mset xs \<and> length xsa = n}
[PROOF STEP]
by (simp add: n_multiset_permutation_enum_correct2 n_permutation_enum_length subsetI)
[PROOF STATE]
proof (state)
this:
set (n_multiset_permutation_enum xs n) \<subseteq> {xsa. mset xsa \<subseteq># mset xs \<and> length xsa = n}

goal (1 subgoal):
 1. {xsa. mset xsa \<subseteq># mset xs \<and> length xsa = n} \<subseteq> set (n_multiset_permutation_enum xs n)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. {xsa. mset xsa \<subseteq># mset xs \<and> length xsa = n} \<subseteq> set (n_multiset_permutation_enum xs n)
[PROOF STEP]
show "{xsa. mset xsa \<subseteq># mset xs \<and> length xsa = n} \<subseteq> set (n_multiset_permutation_enum xs n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {xsa. mset xsa \<subseteq># mset xs \<and> length xsa = n} \<subseteq> set (n_multiset_permutation_enum xs n)
[PROOF STEP]
using n_multiset_permutation_enum_correct1
[PROOF STATE]
proof (prove)
using this:
mset ?ys \<subseteq># mset ?xs \<Longrightarrow> ?ys \<in> set (n_permutation_enum ?xs (length ?ys))

goal (1 subgoal):
 1. {xsa. mset xsa \<subseteq># mset xs \<and> length xsa = n} \<subseteq> set (n_multiset_permutation_enum xs n)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{xsa. mset xsa \<subseteq># mset xs \<and> length xsa = n} \<subseteq> set (n_multiset_permutation_enum xs n)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma map_of_zip_submap: "\<lbrakk> length xs = length ys; distinct xs \<rbrakk> \<Longrightarrow>
 (map_of (zip xs ys) \<subseteq>\<^sub>m Some \<circ> f) = (map f xs = ys)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>length xs = length ys; distinct xs\<rbrakk> \<Longrightarrow> (map_of (zip xs ys) \<subseteq>\<^sub>m Some \<circ> f) = (map f xs = ys)
[PROOF STEP]
apply(induct rule: list_induct2)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. distinct [] \<Longrightarrow> (map_of (zip [] []) \<subseteq>\<^sub>m Some \<circ> f) = (map f [] = [])
 2. \<And>x xs y ys. \<lbrakk>length xs = length ys; distinct xs \<Longrightarrow> (map_of (zip xs ys) \<subseteq>\<^sub>m Some \<circ> f) = (map f xs = ys); distinct (x # xs)\<rbrakk> \<Longrightarrow> (map_of (zip (x # xs) (y # ys)) \<subseteq>\<^sub>m Some \<circ> f) = (map f (x # xs) = y # ys)
[PROOF STEP]
apply(simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x xs y ys. \<lbrakk>length xs = length ys; distinct xs \<Longrightarrow> (map_of (zip xs ys) \<subseteq>\<^sub>m Some \<circ> f) = (map f xs = ys); distinct (x # xs)\<rbrakk> \<Longrightarrow> (map_of (zip (x # xs) (y # ys)) \<subseteq>\<^sub>m Some \<circ> f) = (map f (x # xs) = y # ys)
[PROOF STEP]
apply (clarsimp simp: map_upd_submap simp del:o_apply fun_upd_apply)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x xs y ys. \<lbrakk>length xs = length ys; (map_of (zip xs ys) \<subseteq>\<^sub>m Some \<circ> f) = (map f xs = ys); x \<notin> set xs; distinct xs\<rbrakk> \<Longrightarrow> ((Some \<circ> f) x = Some y \<and> map f xs = ys) = (f x = y \<and> map f xs = ys)
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma cospoly_upper_nonneg:
  assumes "0 \<le> x"
    shows "cos x \<le> cospoly (Suc (4*n)) x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cos x \<le> cospoly (Suc (4 * n)) x
[PROOF STEP]
proof (cases n)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. n = 0 \<Longrightarrow> cos x \<le> cospoly (Suc (4 * n)) x
 2. \<And>nat. n = Suc nat \<Longrightarrow> cos x \<le> cospoly (Suc (4 * n)) x
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:
n = 0

goal (2 subgoals):
 1. n = 0 \<Longrightarrow> cos x \<le> cospoly (Suc (4 * n)) x
 2. \<And>nat. n = Suc nat \<Longrightarrow> cos x \<le> cospoly (Suc (4 * n)) x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
n = 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
n = 0

goal (1 subgoal):
 1. cos x \<le> cospoly (Suc (4 * n)) x
[PROOF STEP]
by (simp add: cospoly_def)
[PROOF STATE]
proof (state)
this:
cos x \<le> cospoly (Suc (4 * n)) x

goal (1 subgoal):
 1. \<And>nat. n = Suc nat \<Longrightarrow> cos x \<le> cospoly (Suc (4 * n)) x
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>nat. n = Suc nat \<Longrightarrow> cos x \<le> cospoly (Suc (4 * n)) x
[PROOF STEP]
case (Suc m)
[PROOF STATE]
proof (state)
this:
n = Suc m

goal (1 subgoal):
 1. \<And>nat. n = Suc nat \<Longrightarrow> cos x \<le> cospoly (Suc (4 * n)) x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
n = Suc m
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
n = Suc m

goal (1 subgoal):
 1. cos x \<le> cospoly (Suc (4 * n)) x
[PROOF STEP]
using sinpoly_lower_nonneg [of _ m] assms
[PROOF STATE]
proof (prove)
using this:
n = Suc m
0 \<le> ?x \<Longrightarrow> sinpoly (4 * Suc m) ?x \<le> sin ?x
0 \<le> x

goal (1 subgoal):
 1. cos x \<le> cospoly (Suc (4 * n)) x
[PROOF STEP]
by (auto simp: sinpoly_lb_imp_cospoly_ub)
[PROOF STATE]
proof (state)
this:
cos x \<le> cospoly (Suc (4 * n)) x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma proj2_intersection_unique:
  assumes "l \<noteq> m" and "proj2_incident p l" and "proj2_incident p m"
  shows "p = proj2_intersection l m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p = proj2_intersection l m
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. p = proj2_intersection l m
[PROOF STEP]
from \<open>l \<noteq> m\<close>
[PROOF STATE]
proof (chain)
picking this:
l \<noteq> m
[PROOF STEP]
have "L2P l \<noteq> L2P m"
[PROOF STATE]
proof (prove)
using this:
l \<noteq> m

goal (1 subgoal):
 1. L2P l \<noteq> L2P m
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
L2P l \<noteq> L2P m

goal (1 subgoal):
 1. p = proj2_intersection l m
[PROOF STEP]
from \<open>proj2_incident p l\<close> and \<open>proj2_incident p m\<close>
    and proj2_incident_switch
[PROOF STATE]
proof (chain)
picking this:
proj2_incident p l
proj2_incident p m
proj2_incident ?p ?l \<Longrightarrow> proj2_incident (L2P ?l) (P2L ?p)
[PROOF STEP]
have "proj2_incident (L2P l) (P2L p)" and "proj2_incident (L2P m) (P2L p)"
[PROOF STATE]
proof (prove)
using this:
proj2_incident p l
proj2_incident p m
proj2_incident ?p ?l \<Longrightarrow> proj2_incident (L2P ?l) (P2L ?p)

goal (1 subgoal):
 1. proj2_incident (L2P l) (P2L p) &&& proj2_incident (L2P m) (P2L p)
[PROOF STEP]
by simp_all
[PROOF STATE]
proof (state)
this:
proj2_incident (L2P l) (P2L p)
proj2_incident (L2P m) (P2L p)

goal (1 subgoal):
 1. p = proj2_intersection l m
[PROOF STEP]
with \<open>L2P l \<noteq> L2P m\<close> and proj2_line_through_unique
[PROOF STATE]
proof (chain)
picking this:
L2P l \<noteq> L2P m
\<lbrakk>?p \<noteq> ?q; proj2_incident ?p ?l; proj2_incident ?q ?l\<rbrakk> \<Longrightarrow> ?l = proj2_line_through ?p ?q
proj2_incident (L2P l) (P2L p)
proj2_incident (L2P m) (P2L p)
[PROOF STEP]
have "P2L p = proj2_line_through (L2P l) (L2P m)"
[PROOF STATE]
proof (prove)
using this:
L2P l \<noteq> L2P m
\<lbrakk>?p \<noteq> ?q; proj2_incident ?p ?l; proj2_incident ?q ?l\<rbrakk> \<Longrightarrow> ?l = proj2_line_through ?p ?q
proj2_incident (L2P l) (P2L p)
proj2_incident (L2P m) (P2L p)

goal (1 subgoal):
 1. P2L p = proj2_line_through (L2P l) (L2P m)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
P2L p = proj2_line_through (L2P l) (L2P m)

goal (1 subgoal):
 1. p = proj2_intersection l m
[PROOF STEP]
thus "p = proj2_intersection l m"
[PROOF STATE]
proof (prove)
using this:
P2L p = proj2_line_through (L2P l) (L2P m)

goal (1 subgoal):
 1. p = proj2_intersection l m
[PROOF STEP]
unfolding proj2_intersection_def
[PROOF STATE]
proof (prove)
using this:
P2L p = proj2_line_through (L2P l) (L2P m)

goal (1 subgoal):
 1. p = L2P (proj2_line_through (L2P l) (L2P m))
[PROOF STEP]
by (simp add: P2L_to_L2P)
[PROOF STATE]
proof (state)
this:
p = proj2_intersection l m

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma powr_less_inverse_iff:
  fixes x y z::real
  assumes "x>0" "y>0" "z>0"
  shows "x powr y < z \<longleftrightarrow> x < z powr (inverse y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x powr y < z) = (x < z powr inverse y)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. x powr y < z \<Longrightarrow> x < z powr inverse y
 2. x < z powr inverse y \<Longrightarrow> x powr y < z
[PROOF STEP]
assume "x powr y < z"
[PROOF STATE]
proof (state)
this:
x powr y < z

goal (2 subgoals):
 1. x powr y < z \<Longrightarrow> x < z powr inverse y
 2. x < z powr inverse y \<Longrightarrow> x powr y < z
[PROOF STEP]
from powr_less_mono2[OF _ _ this,of "inverse y"]
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>0 < inverse y; 0 \<le> x powr y\<rbrakk> \<Longrightarrow> (x powr y) powr inverse y < z powr inverse y
[PROOF STEP]
show "x < z powr inverse y"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>0 < inverse y; 0 \<le> x powr y\<rbrakk> \<Longrightarrow> (x powr y) powr inverse y < z powr inverse y

goal (1 subgoal):
 1. x < z powr inverse y
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>0 < inverse y; 0 \<le> x powr y\<rbrakk> \<Longrightarrow> (x powr y) powr inverse y < z powr inverse y
0 < x
0 < y
0 < z

goal (1 subgoal):
 1. x < z powr inverse y
[PROOF STEP]
by (auto simp:powr_powr)
[PROOF STATE]
proof (state)
this:
x < z powr inverse y

goal (1 subgoal):
 1. x < z powr inverse y \<Longrightarrow> x powr y < z
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x < z powr inverse y \<Longrightarrow> x powr y < z
[PROOF STEP]
assume *:"x < z powr inverse y"
[PROOF STATE]
proof (state)
this:
x < z powr inverse y

goal (1 subgoal):
 1. x < z powr inverse y \<Longrightarrow> x powr y < z
[PROOF STEP]
from powr_less_mono2[OF _ _ *,of y]
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>0 < y; 0 \<le> x\<rbrakk> \<Longrightarrow> x powr y < (z powr inverse y) powr y
[PROOF STEP]
show "x powr y < z"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>0 < y; 0 \<le> x\<rbrakk> \<Longrightarrow> x powr y < (z powr inverse y) powr y

goal (1 subgoal):
 1. x powr y < z
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>0 < y; 0 \<le> x\<rbrakk> \<Longrightarrow> x powr y < (z powr inverse y) powr y
0 < x
0 < y
0 < z

goal (1 subgoal):
 1. x powr y < z
[PROOF STEP]
by (auto simp:powr_powr)
[PROOF STATE]
proof (state)
this:
x powr y < z

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma allzero_eval :
  assumes lLength : "var < length L"
  shows"(\<exists>x. \<forall>y<x. aEval (Eq p) (list_update L var y) ) = (\<forall>x. eval (allZero p var) (list_update L var x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>x. \<forall>y<x. aEval (Eq p) (L[var := y])) = (\<forall>x. eval (allZero p var) (L[var := x]))
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<exists>x. \<forall>y<x. aEval (Eq p) (L[var := y])) = (\<forall>x. eval (allZero p var) (L[var := x]))
[PROOF STEP]
define n where "n = MPoly_Type.degree p var"
[PROOF STATE]
proof (state)
this:
n = MPoly_Type.degree p var

goal (1 subgoal):
 1. (\<exists>x. \<forall>y<x. aEval (Eq p) (L[var := y])) = (\<forall>x. eval (allZero p var) (L[var := x]))
[PROOF STEP]
define k where "k i x =((insertion (nth_default 0(list_update L var x)) (isolate_variable_sparse p var i)))" for i x
[PROOF STATE]
proof (state)
this:
k ?i ?x = insertion (nth_default 0 (L[var := ?x])) (isolate_variable_sparse p var ?i)

goal (1 subgoal):
 1. (\<exists>x. \<forall>y<x. aEval (Eq p) (L[var := y])) = (\<forall>x. eval (allZero p var) (L[var := x]))
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
k ?i ?x = insertion (nth_default 0 (L[var := ?x])) (isolate_variable_sparse p var ?i)

goal (1 subgoal):
 1. (\<exists>x. \<forall>y<x. aEval (Eq p) (L[var := y])) = (\<forall>x. eval (allZero p var) (L[var := x]))
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<exists>x. \<forall>y<x. aEval (Eq p) (L[var := y])) = (\<forall>x. eval (allZero p var) (L[var := x]))
[PROOF STEP]
have "(eval (allZero p var) (list_update L var x)) =
        (\<forall>i\<in>{0..<(MPoly_Type.degree p var)+1}. aEval (Eq(isolate_variable_sparse p var i)) (list_update L var x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eval (allZero p var) (L[var := x]) = (\<forall>i\<in>{0..<MPoly_Type.degree p var + 1}. aEval (Eq (isolate_variable_sparse p var i)) (L[var := x]))
[PROOF STEP]
by (simp add: eval_list_conj atLeast0_lessThan_Suc)
[PROOF STATE]
proof (state)
this:
eval (allZero p var) (L[var := x]) = (\<forall>i\<in>{0..<MPoly_Type.degree p var + 1}. aEval (Eq (isolate_variable_sparse p var i)) (L[var := x]))

goal (1 subgoal):
 1. (\<exists>x. \<forall>y<x. aEval (Eq p) (L[var := y])) = (\<forall>x. eval (allZero p var) (L[var := x]))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
eval (allZero p var) (L[var := x]) = (\<forall>i\<in>{0..<MPoly_Type.degree p var + 1}. aEval (Eq (isolate_variable_sparse p var i)) (L[var := x]))

goal (1 subgoal):
 1. (\<exists>x. \<forall>y<x. aEval (Eq p) (L[var := y])) = (\<forall>x. eval (allZero p var) (L[var := x]))
[PROOF STEP]
have "... = (\<forall>i\<in>{0..<(MPoly_Type.degree p var)+1}. (insertion (nth_default 0(list_update L var x)) (isolate_variable_sparse p var i))=0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>i\<in>{0..<MPoly_Type.degree p var + 1}. aEval (Eq (isolate_variable_sparse p var i)) (L[var := x])) = (\<forall>i\<in>{0..<MPoly_Type.degree p var + 1}. insertion (nth_default 0 (L[var := x])) (isolate_variable_sparse p var i) = 0)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<forall>i\<in>{0..<MPoly_Type.degree p var + 1}. aEval (Eq (isolate_variable_sparse p var i)) (L[var := x])) = (\<forall>i\<in>{0..<MPoly_Type.degree p var + 1}. insertion (nth_default 0 (L[var := x])) (isolate_variable_sparse p var i) = 0)

goal (1 subgoal):
 1. (\<exists>x. \<forall>y<x. aEval (Eq p) (L[var := y])) = (\<forall>x. eval (allZero p var) (L[var := x]))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<forall>i\<in>{0..<MPoly_Type.degree p var + 1}. aEval (Eq (isolate_variable_sparse p var i)) (L[var := x])) = (\<forall>i\<in>{0..<MPoly_Type.degree p var + 1}. insertion (nth_default 0 (L[var := x])) (isolate_variable_sparse p var i) = 0)

goal (1 subgoal):
 1. (\<exists>x. \<forall>y<x. aEval (Eq p) (L[var := y])) = (\<forall>x. eval (allZero p var) (L[var := x]))
[PROOF STEP]
have "... = (\<forall>i\<le>(MPoly_Type.degree p var). (insertion (nth_default 0(list_update L var x)) (isolate_variable_sparse p var i))=0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>i\<in>{0..<MPoly_Type.degree p var + 1}. insertion (nth_default 0 (L[var := x])) (isolate_variable_sparse p var i) = 0) = (\<forall>i\<le>MPoly_Type.degree p var. insertion (nth_default 0 (L[var := x])) (isolate_variable_sparse p var i) = 0)
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
(\<forall>i\<in>{0..<MPoly_Type.degree p var + 1}. insertion (nth_default 0 (L[var := x])) (isolate_variable_sparse p var i) = 0) = (\<forall>i\<le>MPoly_Type.degree p var. insertion (nth_default 0 (L[var := x])) (isolate_variable_sparse p var i) = 0)

goal (1 subgoal):
 1. (\<exists>x. \<forall>y<x. aEval (Eq p) (L[var := y])) = (\<forall>x. eval (allZero p var) (L[var := x]))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<forall>i\<in>{0..<MPoly_Type.degree p var + 1}. insertion (nth_default 0 (L[var := x])) (isolate_variable_sparse p var i) = 0) = (\<forall>i\<le>MPoly_Type.degree p var. insertion (nth_default 0 (L[var := x])) (isolate_variable_sparse p var i) = 0)

goal (1 subgoal):
 1. (\<exists>x. \<forall>y<x. aEval (Eq p) (L[var := y])) = (\<forall>x. eval (allZero p var) (L[var := x]))
[PROOF STEP]
have "... = (\<forall>y. (\<Sum>i\<le>(MPoly_Type.degree p var). ((insertion (nth_default 0(list_update L var x)) (isolate_variable_sparse p var i)) * y ^ i))=0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>i\<le>MPoly_Type.degree p var. insertion (nth_default 0 (L[var := x])) (isolate_variable_sparse p var i) = 0) = (\<forall>y. (\<Sum>i\<le>MPoly_Type.degree p var. insertion (nth_default 0 (L[var := x])) (isolate_variable_sparse p var i) * y ^ i) = 0)
[PROOF STEP]
using polyfun_eq_const[where n="MPoly_Type.degree p var", where k="0", where c="\<lambda>i. (insertion (nth_default 0(list_update L var x)) (isolate_variable_sparse p var i))"]
[PROOF STATE]
proof (prove)
using this:
(\<forall>z. (\<Sum>i\<le>MPoly_Type.degree p var. insertion (nth_default 0 (L[var := x])) (isolate_variable_sparse p var i) * z ^ i) = 0) = (insertion (nth_default 0 (L[var := x])) (isolate_variable_sparse p var 0) = 0 \<and> (\<forall>k. k \<noteq> 0 \<and> k \<le> MPoly_Type.degree p var \<longrightarrow> insertion (nth_default 0 (L[var := x])) (isolate_variable_sparse p var k) = 0))

goal (1 subgoal):
 1. (\<forall>i\<le>MPoly_Type.degree p var. insertion (nth_default 0 (L[var := x])) (isolate_variable_sparse p var i) = 0) = (\<forall>y. (\<Sum>i\<le>MPoly_Type.degree p var. insertion (nth_default 0 (L[var := x])) (isolate_variable_sparse p var i) * y ^ i) = 0)
[PROOF STEP]
by (metis (no_types, lifting) le_add2 le_add_same_cancel2)
[PROOF STATE]
proof (state)
this:
(\<forall>i\<le>MPoly_Type.degree p var. insertion (nth_default 0 (L[var := x])) (isolate_variable_sparse p var i) = 0) = (\<forall>y. (\<Sum>i\<le>MPoly_Type.degree p var. insertion (nth_default 0 (L[var := x])) (isolate_variable_sparse p var i) * y ^ i) = 0)

goal (1 subgoal):
 1. (\<exists>x. \<forall>y<x. aEval (Eq p) (L[var := y])) = (\<forall>x. eval (allZero p var) (L[var := x]))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<forall>i\<le>MPoly_Type.degree p var. insertion (nth_default 0 (L[var := x])) (isolate_variable_sparse p var i) = 0) = (\<forall>y. (\<Sum>i\<le>MPoly_Type.degree p var. insertion (nth_default 0 (L[var := x])) (isolate_variable_sparse p var i) * y ^ i) = 0)

goal (1 subgoal):
 1. (\<exists>x. \<forall>y<x. aEval (Eq p) (L[var := y])) = (\<forall>x. eval (allZero p var) (L[var := x]))
[PROOF STEP]
have "... = (\<forall>y. (\<Sum>i\<le>n. (k i x) * y ^ i)=0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>y. (\<Sum>i\<le>MPoly_Type.degree p var. insertion (nth_default 0 (L[var := x])) (isolate_variable_sparse p var i) * y ^ i) = 0) = (\<forall>y. (\<Sum>i\<le>n. k i x * y ^ i) = 0)
[PROOF STEP]
using k_def n_def
[PROOF STATE]
proof (prove)
using this:
k ?i ?x = insertion (nth_default 0 (L[var := ?x])) (isolate_variable_sparse p var ?i)
n = MPoly_Type.degree p var

goal (1 subgoal):
 1. (\<forall>y. (\<Sum>i\<le>MPoly_Type.degree p var. insertion (nth_default 0 (L[var := x])) (isolate_variable_sparse p var i) * y ^ i) = 0) = (\<forall>y. (\<Sum>i\<le>n. k i x * y ^ i) = 0)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<forall>y. (\<Sum>i\<le>MPoly_Type.degree p var. insertion (nth_default 0 (L[var := x])) (isolate_variable_sparse p var i) * y ^ i) = 0) = (\<forall>y. (\<Sum>i\<le>n. k i x * y ^ i) = 0)

goal (1 subgoal):
 1. (\<exists>x. \<forall>y<x. aEval (Eq p) (L[var := y])) = (\<forall>x. eval (allZero p var) (L[var := x]))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
eval (allZero p var) (L[var := x]) = (\<forall>y. (\<Sum>i\<le>n. k i x * y ^ i) = 0)
[PROOF STEP]
have  "(eval (allZero p var) (list_update L var x)) = (\<forall>y. (\<Sum>i\<le>n. (k i x) * y ^ i)=0)"
[PROOF STATE]
proof (prove)
using this:
eval (allZero p var) (L[var := x]) = (\<forall>y. (\<Sum>i\<le>n. k i x * y ^ i) = 0)

goal (1 subgoal):
 1. eval (allZero p var) (L[var := x]) = (\<forall>y. (\<Sum>i\<le>n. k i x * y ^ i) = 0)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
eval (allZero p var) (L[var := x]) = (\<forall>y. (\<Sum>i\<le>n. k i x * y ^ i) = 0)

goal (1 subgoal):
 1. (\<exists>x. \<forall>y<x. aEval (Eq p) (L[var := y])) = (\<forall>x. eval (allZero p var) (L[var := x]))
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
eval (allZero p var) (L[var := ?x2]) = (\<forall>y. (\<Sum>i\<le>n. k i ?x2 * y ^ i) = 0)

goal (1 subgoal):
 1. (\<exists>x. \<forall>y<x. aEval (Eq p) (L[var := y])) = (\<forall>x. eval (allZero p var) (L[var := x]))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
eval (allZero p var) (L[var := ?x2]) = (\<forall>y. (\<Sum>i\<le>n. k i ?x2 * y ^ i) = 0)
[PROOF STEP]
have h1 : "(\<forall>x. (eval (allZero p var) (list_update L var x))) = (\<forall>x.(\<forall>y. (\<Sum>i\<le>n. (k i x) * y ^ i)=0))"
[PROOF STATE]
proof (prove)
using this:
eval (allZero p var) (L[var := ?x2]) = (\<forall>y. (\<Sum>i\<le>n. k i ?x2 * y ^ i) = 0)

goal (1 subgoal):
 1. (\<forall>x. eval (allZero p var) (L[var := x])) = (\<forall>x y. (\<Sum>i\<le>n. k i x * y ^ i) = 0)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<forall>x. eval (allZero p var) (L[var := x])) = (\<forall>x y. (\<Sum>i\<le>n. k i x * y ^ i) = 0)

goal (1 subgoal):
 1. (\<exists>x. \<forall>y<x. aEval (Eq p) (L[var := y])) = (\<forall>x. eval (allZero p var) (L[var := x]))
[PROOF STEP]
have "(\<exists>y. \<forall>x<y. (\<Sum>i\<le>n. (k i x)* x^i)= 0) = (\<exists>y. \<forall>x<y. (\<Sum>i\<le>(MPoly_Type.degree p var). (insertion (nth_default 0 (list_update L var x))(isolate_variable_sparse p var i))* x^i)= 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>y. \<forall>x<y. (\<Sum>i\<le>n. k i x * x ^ i) = 0) = (\<exists>y. \<forall>x<y. (\<Sum>i\<le>MPoly_Type.degree p var. insertion (nth_default 0 (L[var := x])) (isolate_variable_sparse p var i) * x ^ i) = 0)
[PROOF STEP]
using k_def n_def
[PROOF STATE]
proof (prove)
using this:
k ?i ?x = insertion (nth_default 0 (L[var := ?x])) (isolate_variable_sparse p var ?i)
n = MPoly_Type.degree p var

goal (1 subgoal):
 1. (\<exists>y. \<forall>x<y. (\<Sum>i\<le>n. k i x * x ^ i) = 0) = (\<exists>y. \<forall>x<y. (\<Sum>i\<le>MPoly_Type.degree p var. insertion (nth_default 0 (L[var := x])) (isolate_variable_sparse p var i) * x ^ i) = 0)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<exists>y. \<forall>x<y. (\<Sum>i\<le>n. k i x * x ^ i) = 0) = (\<exists>y. \<forall>x<y. (\<Sum>i\<le>MPoly_Type.degree p var. insertion (nth_default 0 (L[var := x])) (isolate_variable_sparse p var i) * x ^ i) = 0)

goal (1 subgoal):
 1. (\<exists>x. \<forall>y<x. aEval (Eq p) (L[var := y])) = (\<forall>x. eval (allZero p var) (L[var := x]))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<exists>y. \<forall>x<y. (\<Sum>i\<le>n. k i x * x ^ i) = 0) = (\<exists>y. \<forall>x<y. (\<Sum>i\<le>MPoly_Type.degree p var. insertion (nth_default 0 (L[var := x])) (isolate_variable_sparse p var i) * x ^ i) = 0)

goal (1 subgoal):
 1. (\<exists>x. \<forall>y<x. aEval (Eq p) (L[var := y])) = (\<forall>x. eval (allZero p var) (L[var := x]))
[PROOF STEP]
have "... = (\<exists>y. \<forall>x<y. insertion (nth_default 0 (list_update L var x)) (\<Sum>i\<le>(MPoly_Type.degree p var). (isolate_variable_sparse p var i)* Var var^i)= 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>y. \<forall>x<y. (\<Sum>i\<le>MPoly_Type.degree p var. insertion (nth_default 0 (L[var := x])) (isolate_variable_sparse p var i) * x ^ i) = 0) = (\<exists>y. \<forall>x<y. insertion (nth_default 0 (L[var := x])) (\<Sum>i\<le>MPoly_Type.degree p var. isolate_variable_sparse p var i * Var var ^ i) = 0)
[PROOF STEP]
by(simp add: insertion_sum' insertion_mult insertion_pow insertion_var lLength)
[PROOF STATE]
proof (state)
this:
(\<exists>y. \<forall>x<y. (\<Sum>i\<le>MPoly_Type.degree p var. insertion (nth_default 0 (L[var := x])) (isolate_variable_sparse p var i) * x ^ i) = 0) = (\<exists>y. \<forall>x<y. insertion (nth_default 0 (L[var := x])) (\<Sum>i\<le>MPoly_Type.degree p var. isolate_variable_sparse p var i * Var var ^ i) = 0)

goal (1 subgoal):
 1. (\<exists>x. \<forall>y<x. aEval (Eq p) (L[var := y])) = (\<forall>x. eval (allZero p var) (L[var := x]))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<exists>y. \<forall>x<y. (\<Sum>i\<le>MPoly_Type.degree p var. insertion (nth_default 0 (L[var := x])) (isolate_variable_sparse p var i) * x ^ i) = 0) = (\<exists>y. \<forall>x<y. insertion (nth_default 0 (L[var := x])) (\<Sum>i\<le>MPoly_Type.degree p var. isolate_variable_sparse p var i * Var var ^ i) = 0)

goal (1 subgoal):
 1. (\<exists>x. \<forall>y<x. aEval (Eq p) (L[var := y])) = (\<forall>x. eval (allZero p var) (L[var := x]))
[PROOF STEP]
have "... = (\<exists>y. \<forall>x<y. insertion (nth_default 0 (list_update L var x)) p = 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>y. \<forall>x<y. insertion (nth_default 0 (L[var := x])) (\<Sum>i\<le>MPoly_Type.degree p var. isolate_variable_sparse p var i * Var var ^ i) = 0) = (\<exists>y. \<forall>x<y. insertion (nth_default 0 (L[var := x])) p = 0)
[PROOF STEP]
using sum_over_zero
[PROOF STATE]
proof (prove)
using this:
?mp = (\<Sum>i\<le>MPoly_Type.degree ?mp ?x. isolate_variable_sparse ?mp ?x i * Var ?x ^ i)

goal (1 subgoal):
 1. (\<exists>y. \<forall>x<y. insertion (nth_default 0 (L[var := x])) (\<Sum>i\<le>MPoly_Type.degree p var. isolate_variable_sparse p var i * Var var ^ i) = 0) = (\<exists>y. \<forall>x<y. insertion (nth_default 0 (L[var := x])) p = 0)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<exists>y. \<forall>x<y. insertion (nth_default 0 (L[var := x])) (\<Sum>i\<le>MPoly_Type.degree p var. isolate_variable_sparse p var i * Var var ^ i) = 0) = (\<exists>y. \<forall>x<y. insertion (nth_default 0 (L[var := x])) p = 0)

goal (1 subgoal):
 1. (\<exists>x. \<forall>y<x. aEval (Eq p) (L[var := y])) = (\<forall>x. eval (allZero p var) (L[var := x]))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<exists>y. \<forall>x<y. insertion (nth_default 0 (L[var := x])) (\<Sum>i\<le>MPoly_Type.degree p var. isolate_variable_sparse p var i * Var var ^ i) = 0) = (\<exists>y. \<forall>x<y. insertion (nth_default 0 (L[var := x])) p = 0)

goal (1 subgoal):
 1. (\<exists>x. \<forall>y<x. aEval (Eq p) (L[var := y])) = (\<forall>x. eval (allZero p var) (L[var := x]))
[PROOF STEP]
have "... = (\<exists>y. \<forall>x<y. aEval (Eq p) (list_update L var x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>y. \<forall>x<y. insertion (nth_default 0 (L[var := x])) p = 0) = (\<exists>y. \<forall>x<y. aEval (Eq p) (L[var := x]))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<exists>y. \<forall>x<y. insertion (nth_default 0 (L[var := x])) p = 0) = (\<exists>y. \<forall>x<y. aEval (Eq p) (L[var := x]))

goal (1 subgoal):
 1. (\<exists>x. \<forall>y<x. aEval (Eq p) (L[var := y])) = (\<forall>x. eval (allZero p var) (L[var := x]))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<exists>y. \<forall>x<y. (\<Sum>i\<le>n. k i x * x ^ i) = 0) = (\<exists>y. \<forall>x<y. aEval (Eq p) (L[var := x]))
[PROOF STEP]
have h2 : "(\<exists>y. \<forall>x<y. aEval (Eq p) (list_update L var x)) = (\<exists>y. \<forall>x<y. (\<Sum>i\<le>n. (k i x)* x^i)= 0)"
[PROOF STATE]
proof (prove)
using this:
(\<exists>y. \<forall>x<y. (\<Sum>i\<le>n. k i x * x ^ i) = 0) = (\<exists>y. \<forall>x<y. aEval (Eq p) (L[var := x]))

goal (1 subgoal):
 1. (\<exists>y. \<forall>x<y. aEval (Eq p) (L[var := x])) = (\<exists>y. \<forall>x<y. (\<Sum>i\<le>n. k i x * x ^ i) = 0)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<exists>y. \<forall>x<y. aEval (Eq p) (L[var := x])) = (\<exists>y. \<forall>x<y. (\<Sum>i\<le>n. k i x * x ^ i) = 0)

goal (1 subgoal):
 1. (\<exists>x. \<forall>y<x. aEval (Eq p) (L[var := y])) = (\<forall>x. eval (allZero p var) (L[var := x]))
[PROOF STEP]
have k_all : "\<forall>x y i. k i x = k i y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x y i. k i x = k i y
[PROOF STEP]
unfolding k_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x y i. insertion (nth_default 0 (L[var := x])) (isolate_variable_sparse p var i) = insertion (nth_default 0 (L[var := y])) (isolate_variable_sparse p var i)
[PROOF STEP]
by (simp add: insertion_isovarspars_free)
[PROOF STATE]
proof (state)
this:
\<forall>x y i. k i x = k i y

goal (1 subgoal):
 1. (\<exists>x. \<forall>y<x. aEval (Eq p) (L[var := y])) = (\<forall>x. eval (allZero p var) (L[var := x]))
[PROOF STEP]
have h3a : "(\<exists>y. \<forall>x<y. (\<Sum>i\<le>n. (k i x)* x^i)= 0) \<Longrightarrow> (\<forall>x.(\<forall>y. (\<Sum>i\<le>n. (k i x) * y ^ i)=0))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>y. \<forall>x<y. (\<Sum>i\<le>n. k i x * x ^ i) = 0 \<Longrightarrow> \<forall>x y. (\<Sum>i\<le>n. k i x * y ^ i) = 0
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>y. \<forall>x<y. (\<Sum>i\<le>n. k i x * x ^ i) = 0 \<Longrightarrow> \<forall>x y. (\<Sum>i\<le>n. k i x * y ^ i) = 0
[PROOF STEP]
assume h : "(\<exists>y. \<forall>x<y. (\<Sum>i\<le>n. (k i x)* x^i)= 0)"
[PROOF STATE]
proof (state)
this:
\<exists>y. \<forall>x<y. (\<Sum>i\<le>n. k i x * x ^ i) = 0

goal (1 subgoal):
 1. \<exists>y. \<forall>x<y. (\<Sum>i\<le>n. k i x * x ^ i) = 0 \<Longrightarrow> \<forall>x y. (\<Sum>i\<le>n. k i x * y ^ i) = 0
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
\<exists>y. \<forall>x<y. (\<Sum>i\<le>n. k i x * x ^ i) = 0

goal (1 subgoal):
 1. \<exists>y. \<forall>x<y. (\<Sum>i\<le>n. k i x * x ^ i) = 0 \<Longrightarrow> \<forall>x y. (\<Sum>i\<le>n. k i x * y ^ i) = 0
[PROOF STEP]
fix z y
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>y. \<forall>x<y. (\<Sum>i\<le>n. k i x * x ^ i) = 0 \<Longrightarrow> \<forall>x y. (\<Sum>i\<le>n. k i x * y ^ i) = 0
[PROOF STEP]
assume h : "(\<forall>x<y. (\<Sum>i\<le>n. (k i x)* x^i)= 0)"
[PROOF STATE]
proof (state)
this:
\<forall>x<y. (\<Sum>i\<le>n. k i x * x ^ i) = 0

goal (1 subgoal):
 1. \<exists>y. \<forall>x<y. (\<Sum>i\<le>n. k i x * x ^ i) = 0 \<Longrightarrow> \<forall>x y. (\<Sum>i\<le>n. k i x * y ^ i) = 0
[PROOF STEP]
have "\<forall>x<y.\<forall>i\<le>n. k i x = k i z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x<y. \<forall>i\<le>n. k i x = k i z
[PROOF STEP]
unfolding k_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x<y. \<forall>i\<le>n. insertion (nth_default 0 (L[var := x])) (isolate_variable_sparse p var i) = insertion (nth_default 0 (L[var := z])) (isolate_variable_sparse p var i)
[PROOF STEP]
using insertion_isovarspars_free
[PROOF STATE]
proof (prove)
using this:
insertion (nth_default 0 (?L[?var := ?x])) (isolate_variable_sparse ?p ?var ?i) = insertion (nth_default 0 (?L[?var := ?y])) (isolate_variable_sparse ?p ?var ?i)

goal (1 subgoal):
 1. \<forall>x<y. \<forall>i\<le>n. insertion (nth_default 0 (L[var := x])) (isolate_variable_sparse p var i) = insertion (nth_default 0 (L[var := z])) (isolate_variable_sparse p var i)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<forall>x<y. \<forall>i\<le>n. k i x = k i z

goal (1 subgoal):
 1. \<exists>y. \<forall>x<y. (\<Sum>i\<le>n. k i x * x ^ i) = 0 \<Longrightarrow> \<forall>x y. (\<Sum>i\<le>n. k i x * y ^ i) = 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>x<y. \<forall>i\<le>n. k i x = k i z
[PROOF STEP]
have * : "\<forall>x<y.\<forall>i\<le>n. k i x * x ^ i = k i z * x^i"
[PROOF STATE]
proof (prove)
using this:
\<forall>x<y. \<forall>i\<le>n. k i x = k i z

goal (1 subgoal):
 1. \<forall>x<y. \<forall>i\<le>n. k i x * x ^ i = k i z * x ^ i
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>x<y. \<forall>i\<le>n. k i x * x ^ i = k i z * x ^ i

goal (1 subgoal):
 1. \<exists>y. \<forall>x<y. (\<Sum>i\<le>n. k i x * x ^ i) = 0 \<Longrightarrow> \<forall>x y. (\<Sum>i\<le>n. k i x * y ^ i) = 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>x<y. \<forall>i\<le>n. k i x * x ^ i = k i z * x ^ i
[PROOF STEP]
have "\<forall>x<y. (\<Sum>i\<le>n. k i x * x ^ i) = (\<Sum>i\<le>n. k i z * x ^ i)"
[PROOF STATE]
proof (prove)
using this:
\<forall>x<y. \<forall>i\<le>n. k i x * x ^ i = k i z * x ^ i

goal (1 subgoal):
 1. \<forall>x<y. (\<Sum>i\<le>n. k i x * x ^ i) = (\<Sum>i\<le>n. k i z * x ^ i)
[PROOF STEP]
by (metis (no_types, lifting) k_all sum.cong)
[PROOF STATE]
proof (state)
this:
\<forall>x<y. (\<Sum>i\<le>n. k i x * x ^ i) = (\<Sum>i\<le>n. k i z * x ^ i)

goal (1 subgoal):
 1. \<exists>y. \<forall>x<y. (\<Sum>i\<le>n. k i x * x ^ i) = 0 \<Longrightarrow> \<forall>x y. (\<Sum>i\<le>n. k i x * y ^ i) = 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>x<y. (\<Sum>i\<le>n. k i x * x ^ i) = (\<Sum>i\<le>n. k i z * x ^ i)
[PROOF STEP]
have "\<forall>x<y. (\<Sum>i\<le>n. (k i z)* x^i)= 0"
[PROOF STATE]
proof (prove)
using this:
\<forall>x<y. (\<Sum>i\<le>n. k i x * x ^ i) = (\<Sum>i\<le>n. k i z * x ^ i)

goal (1 subgoal):
 1. \<forall>x<y. (\<Sum>i\<le>n. k i z * x ^ i) = 0
[PROOF STEP]
using h
[PROOF STATE]
proof (prove)
using this:
\<forall>x<y. (\<Sum>i\<le>n. k i x * x ^ i) = (\<Sum>i\<le>n. k i z * x ^ i)
\<forall>x<y. (\<Sum>i\<le>n. k i x * x ^ i) = 0

goal (1 subgoal):
 1. \<forall>x<y. (\<Sum>i\<le>n. k i z * x ^ i) = 0
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<forall>x<y. (\<Sum>i\<le>n. k i z * x ^ i) = 0

goal (1 subgoal):
 1. \<exists>y. \<forall>x<y. (\<Sum>i\<le>n. k i x * x ^ i) = 0 \<Longrightarrow> \<forall>x y. (\<Sum>i\<le>n. k i x * y ^ i) = 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>x<y. (\<Sum>i\<le>n. k i z * x ^ i) = 0
[PROOF STEP]
have "\<not>(finite {x. (\<Sum>i\<le>n. k i z * x ^ i) = 0})"
[PROOF STATE]
proof (prove)
using this:
\<forall>x<y. (\<Sum>i\<le>n. k i z * x ^ i) = 0

goal (1 subgoal):
 1. infinite {x. (\<Sum>i\<le>n. k i z * x ^ i) = 0}
[PROOF STEP]
using infinite_Iio[where a="y"]  Inf_many_def[where P="\<lambda>x. (\<Sum>i\<le>n. k i z * x ^ i) = 0"]
[PROOF STATE]
proof (prove)
using this:
\<forall>x<y. (\<Sum>i\<le>n. k i z * x ^ i) = 0
infinite {..<y}
(\<exists>\<^sub>\<infinity>x. (\<Sum>i\<le>n. k i z * x ^ i) = 0) = infinite {x. (\<Sum>i\<le>n. k i z * x ^ i) = 0}

goal (1 subgoal):
 1. infinite {x. (\<Sum>i\<le>n. k i z * x ^ i) = 0}
[PROOF STEP]
by (smt INFM_iff_infinite frequently_mono lessThan_def)
[PROOF STATE]
proof (state)
this:
infinite {x. (\<Sum>i\<le>n. k i z * x ^ i) = 0}

goal (1 subgoal):
 1. \<exists>y. \<forall>x<y. (\<Sum>i\<le>n. k i x * x ^ i) = 0 \<Longrightarrow> \<forall>x y. (\<Sum>i\<le>n. k i x * y ^ i) = 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
infinite {x. (\<Sum>i\<le>n. k i z * x ^ i) = 0}
[PROOF STEP]
have "\<forall>i\<le>n. k i z = 0"
[PROOF STATE]
proof (prove)
using this:
infinite {x. (\<Sum>i\<le>n. k i z * x ^ i) = 0}

goal (1 subgoal):
 1. \<forall>i\<le>n. k i z = 0
[PROOF STEP]
using  polyfun_rootbound[where n="n",  where c = "\<lambda>i. k i z" ]
[PROOF STATE]
proof (prove)
using this:
infinite {x. (\<Sum>i\<le>n. k i z * x ^ i) = 0}
\<exists>ka\<le>n. k ka z \<noteq> 0 \<Longrightarrow> finite {za. (\<Sum>i\<le>n. k i z * za ^ i) = 0} \<and> card {za. (\<Sum>i\<le>n. k i z * za ^ i) = 0} \<le> n

goal (1 subgoal):
 1. \<forall>i\<le>n. k i z = 0
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<forall>i\<le>n. k i z = 0

goal (1 subgoal):
 1. \<exists>y. \<forall>x<y. (\<Sum>i\<le>n. k i x * x ^ i) = 0 \<Longrightarrow> \<forall>x y. (\<Sum>i\<le>n. k i x * y ^ i) = 0
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
\<forall>x<?y2. (\<Sum>i\<le>n. k i x * x ^ i) = 0 \<Longrightarrow> \<forall>i\<le>n. k i ?z2 = 0

goal (1 subgoal):
 1. \<exists>y. \<forall>x<y. (\<Sum>i\<le>n. k i x * x ^ i) = 0 \<Longrightarrow> \<forall>x y. (\<Sum>i\<le>n. k i x * y ^ i) = 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>x<?y2. (\<Sum>i\<le>n. k i x * x ^ i) = 0 \<Longrightarrow> \<forall>i\<le>n. k i ?z2 = 0
[PROOF STEP]
have "\<forall>x.\<forall>i\<le>n. k i x = 0"
[PROOF STATE]
proof (prove)
using this:
\<forall>x<?y2. (\<Sum>i\<le>n. k i x * x ^ i) = 0 \<Longrightarrow> \<forall>i\<le>n. k i ?z2 = 0

goal (1 subgoal):
 1. \<forall>x i. i \<le> n \<longrightarrow> k i x = 0
[PROOF STEP]
using h
[PROOF STATE]
proof (prove)
using this:
\<forall>x<?y2. (\<Sum>i\<le>n. k i x * x ^ i) = 0 \<Longrightarrow> \<forall>i\<le>n. k i ?z2 = 0
\<exists>y. \<forall>x<y. (\<Sum>i\<le>n. k i x * x ^ i) = 0

goal (1 subgoal):
 1. \<forall>x i. i \<le> n \<longrightarrow> k i x = 0
[PROOF STEP]
by (meson gt_ex)
[PROOF STATE]
proof (state)
this:
\<forall>x i. i \<le> n \<longrightarrow> k i x = 0

goal (1 subgoal):
 1. \<exists>y. \<forall>x<y. (\<Sum>i\<le>n. k i x * x ^ i) = 0 \<Longrightarrow> \<forall>x y. (\<Sum>i\<le>n. k i x * y ^ i) = 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>x i. i \<le> n \<longrightarrow> k i x = 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<forall>x i. i \<le> n \<longrightarrow> k i x = 0

goal (1 subgoal):
 1. \<forall>x y. (\<Sum>i\<le>n. k i x * y ^ i) = 0
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<forall>x y. (\<Sum>i\<le>n. k i x * y ^ i) = 0

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<exists>y. \<forall>x<y. (\<Sum>i\<le>n. k i x * x ^ i) = 0 \<Longrightarrow> \<forall>x y. (\<Sum>i\<le>n. k i x * y ^ i) = 0

goal (1 subgoal):
 1. (\<exists>x. \<forall>y<x. aEval (Eq p) (L[var := y])) = (\<forall>x. eval (allZero p var) (L[var := x]))
[PROOF STEP]
have h3b : "(\<forall>x.(\<forall>y. (\<Sum>i\<le>n. (k i x) * y ^ i)=0)) \<Longrightarrow> (\<exists>y. \<forall>x<y. (\<Sum>i\<le>n. (k i x)* x^i)= 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x y. (\<Sum>i\<le>n. k i x * y ^ i) = 0 \<Longrightarrow> \<exists>y. \<forall>x<y. (\<Sum>i\<le>n. k i x * x ^ i) = 0
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<forall>x y. (\<Sum>i\<le>n. k i x * y ^ i) = 0 \<Longrightarrow> \<exists>y. \<forall>x<y. (\<Sum>i\<le>n. k i x * x ^ i) = 0
[PROOF STEP]
assume h : "(\<forall>x.(\<forall>y. (\<Sum>i\<le>n. (k i x) * y ^ i)=0))"
[PROOF STATE]
proof (state)
this:
\<forall>x y. (\<Sum>i\<le>n. k i x * y ^ i) = 0

goal (1 subgoal):
 1. \<forall>x y. (\<Sum>i\<le>n. k i x * y ^ i) = 0 \<Longrightarrow> \<exists>y. \<forall>x<y. (\<Sum>i\<le>n. k i x * x ^ i) = 0
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
\<forall>x y. (\<Sum>i\<le>n. k i x * y ^ i) = 0

goal (1 subgoal):
 1. \<forall>x y. (\<Sum>i\<le>n. k i x * y ^ i) = 0 \<Longrightarrow> \<exists>y. \<forall>x<y. (\<Sum>i\<le>n. k i x * x ^ i) = 0
[PROOF STEP]
fix z y x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<forall>x y. (\<Sum>i\<le>n. k i x * y ^ i) = 0 \<Longrightarrow> \<exists>y. \<forall>x<y. (\<Sum>i\<le>n. k i x * x ^ i) = 0
[PROOF STEP]
have "(\<Sum>i\<le>n. (k i z)* x^i)= 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i\<le>n. k i z * x ^ i) = 0
[PROOF STEP]
using h k_all
[PROOF STATE]
proof (prove)
using this:
\<forall>x y. (\<Sum>i\<le>n. k i x * y ^ i) = 0
\<forall>x y i. k i x = k i y

goal (1 subgoal):
 1. (\<Sum>i\<le>n. k i z * x ^ i) = 0
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<le>n. k i z * x ^ i) = 0

goal (1 subgoal):
 1. \<forall>x y. (\<Sum>i\<le>n. k i x * y ^ i) = 0 \<Longrightarrow> \<exists>y. \<forall>x<y. (\<Sum>i\<le>n. k i x * x ^ i) = 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<Sum>i\<le>n. k i z * x ^ i) = 0
[PROOF STEP]
have "\<forall>i\<le>n. k i z = 0"
[PROOF STATE]
proof (prove)
using this:
(\<Sum>i\<le>n. k i z * x ^ i) = 0

goal (1 subgoal):
 1. \<forall>i\<le>n. k i z = 0
[PROOF STEP]
using polyfun_eq_const[where k="0", where c = "\<lambda>i. k i z", where n="n"]
[PROOF STATE]
proof (prove)
using this:
(\<Sum>i\<le>n. k i z * x ^ i) = 0
(\<forall>za. (\<Sum>i\<le>n. k i z * za ^ i) = 0) = (k 0 z = 0 \<and> (\<forall>ka. ka \<noteq> 0 \<and> ka \<le> n \<longrightarrow> k ka z = 0))

goal (1 subgoal):
 1. \<forall>i\<le>n. k i z = 0
[PROOF STEP]
by (metis h)
[PROOF STATE]
proof (state)
this:
\<forall>i\<le>n. k i z = 0

goal (1 subgoal):
 1. \<forall>x y. (\<Sum>i\<le>n. k i x * y ^ i) = 0 \<Longrightarrow> \<exists>y. \<forall>x<y. (\<Sum>i\<le>n. k i x * x ^ i) = 0
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
\<forall>i\<le>n. k i ?z2 = 0

goal (1 subgoal):
 1. \<forall>x y. (\<Sum>i\<le>n. k i x * y ^ i) = 0 \<Longrightarrow> \<exists>y. \<forall>x<y. (\<Sum>i\<le>n. k i x * x ^ i) = 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>i\<le>n. k i ?z2 = 0
[PROOF STEP]
have "\<forall>x.\<forall>i\<le>n. k i x = 0"
[PROOF STATE]
proof (prove)
using this:
\<forall>i\<le>n. k i ?z2 = 0

goal (1 subgoal):
 1. \<forall>x i. i \<le> n \<longrightarrow> k i x = 0
[PROOF STEP]
by (meson gt_ex)
[PROOF STATE]
proof (state)
this:
\<forall>x i. i \<le> n \<longrightarrow> k i x = 0

goal (1 subgoal):
 1. \<forall>x y. (\<Sum>i\<le>n. k i x * y ^ i) = 0 \<Longrightarrow> \<exists>y. \<forall>x<y. (\<Sum>i\<le>n. k i x * x ^ i) = 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>x i. i \<le> n \<longrightarrow> k i x = 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<forall>x i. i \<le> n \<longrightarrow> k i x = 0

goal (1 subgoal):
 1. \<exists>y. \<forall>x<y. (\<Sum>i\<le>n. k i x * x ^ i) = 0
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<exists>y. \<forall>x<y. (\<Sum>i\<le>n. k i x * x ^ i) = 0

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>x y. (\<Sum>i\<le>n. k i x * y ^ i) = 0 \<Longrightarrow> \<exists>y. \<forall>x<y. (\<Sum>i\<le>n. k i x * x ^ i) = 0

goal (1 subgoal):
 1. (\<exists>x. \<forall>y<x. aEval (Eq p) (L[var := y])) = (\<forall>x. eval (allZero p var) (L[var := x]))
[PROOF STEP]
have h3 : "(\<exists>y. \<forall>x<y. (\<Sum>i\<le>n. (k i x)* x^i)= 0) = (\<forall>x.(\<forall>y. (\<Sum>i\<le>n. (k i x) * y ^ i)=0))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>y. \<forall>x<y. (\<Sum>i\<le>n. k i x * x ^ i) = 0) = (\<forall>x y. (\<Sum>i\<le>n. k i x * y ^ i) = 0)
[PROOF STEP]
using h3a h3b
[PROOF STATE]
proof (prove)
using this:
\<exists>y. \<forall>x<y. (\<Sum>i\<le>n. k i x * x ^ i) = 0 \<Longrightarrow> \<forall>x y. (\<Sum>i\<le>n. k i x * y ^ i) = 0
\<forall>x y. (\<Sum>i\<le>n. k i x * y ^ i) = 0 \<Longrightarrow> \<exists>y. \<forall>x<y. (\<Sum>i\<le>n. k i x * x ^ i) = 0

goal (1 subgoal):
 1. (\<exists>y. \<forall>x<y. (\<Sum>i\<le>n. k i x * x ^ i) = 0) = (\<forall>x y. (\<Sum>i\<le>n. k i x * y ^ i) = 0)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<exists>y. \<forall>x<y. (\<Sum>i\<le>n. k i x * x ^ i) = 0) = (\<forall>x y. (\<Sum>i\<le>n. k i x * y ^ i) = 0)

goal (1 subgoal):
 1. (\<exists>x. \<forall>y<x. aEval (Eq p) (L[var := y])) = (\<forall>x. eval (allZero p var) (L[var := x]))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>x. \<forall>y<x. aEval (Eq p) (L[var := y])) = (\<forall>x. eval (allZero p var) (L[var := x]))
[PROOF STEP]
using h1 h2 h3
[PROOF STATE]
proof (prove)
using this:
(\<forall>x. eval (allZero p var) (L[var := x])) = (\<forall>x y. (\<Sum>i\<le>n. k i x * y ^ i) = 0)
(\<exists>y. \<forall>x<y. aEval (Eq p) (L[var := x])) = (\<exists>y. \<forall>x<y. (\<Sum>i\<le>n. k i x * x ^ i) = 0)
(\<exists>y. \<forall>x<y. (\<Sum>i\<le>n. k i x * x ^ i) = 0) = (\<forall>x y. (\<Sum>i\<le>n. k i x * y ^ i) = 0)

goal (1 subgoal):
 1. (\<exists>x. \<forall>y<x. aEval (Eq p) (L[var := y])) = (\<forall>x. eval (allZero p var) (L[var := x]))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<exists>x. \<forall>y<x. aEval (Eq p) (L[var := y])) = (\<forall>x. eval (allZero p var) (L[var := x]))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Fvars_lcnj[simp]:
  "set \<phi>s \<subseteq> fmla \<Longrightarrow> finite F \<Longrightarrow> Fvars (lcnj \<phi>s) = \<Union> (set (map Fvars \<phi>s))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>set \<phi>s \<subseteq> fmla; finite F\<rbrakk> \<Longrightarrow> Fvars (lcnj \<phi>s) = \<Union> (set (map Fvars \<phi>s))
[PROOF STEP]
by(induct \<phi>s) auto


[STATEMENT]
lemma pos_part_meas_nul_neg_set :
  assumes "pos_meas_set M1"
    and "neg_meas_set M2"
    and "m1 = (\<lambda>A. \<mu> (A \<inter> M1))"
    and "E \<in> sets M"
    and "E \<subseteq> M2"
  shows "m1 E = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. m1 E = 0
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. m1 E = 0
[PROOF STEP]
have "m1 E \<ge> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> m1 E
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
pos_meas_set M1
neg_meas_set M2
m1 = (\<lambda>A. \<mu> (A \<inter> M1))
E \<in> sets M
E \<subseteq> M2

goal (1 subgoal):
 1. 0 \<le> m1 E
[PROOF STEP]
unfolding pos_meas_set_def
[PROOF STATE]
proof (prove)
using this:
M1 \<in> sets M \<and> (\<forall>A\<in>sets M. A \<subseteq> M1 \<longrightarrow> 0 \<le> \<mu> A)
neg_meas_set M2
m1 = (\<lambda>A. \<mu> (A \<inter> M1))
E \<in> sets M
E \<subseteq> M2

goal (1 subgoal):
 1. 0 \<le> m1 E
[PROOF STEP]
by (simp add: \<open>E \<in> sets M\<close> sets.Int)
[PROOF STATE]
proof (state)
this:
0 \<le> m1 E

goal (1 subgoal):
 1. m1 E = 0
[PROOF STEP]
have "\<mu> E \<le> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<mu> E \<le> 0
[PROOF STEP]
using \<open>E \<subseteq> M2\<close> assms
[PROOF STATE]
proof (prove)
using this:
E \<subseteq> M2
pos_meas_set M1
neg_meas_set M2
m1 = (\<lambda>A. \<mu> (A \<inter> M1))
E \<in> sets M
E \<subseteq> M2

goal (1 subgoal):
 1. \<mu> E \<le> 0
[PROOF STEP]
unfolding neg_meas_set_def
[PROOF STATE]
proof (prove)
using this:
E \<subseteq> M2
pos_meas_set M1
M2 \<in> sets M \<and> (\<forall>A\<in>sets M. A \<subseteq> M2 \<longrightarrow> \<mu> A \<le> 0)
m1 = (\<lambda>A. \<mu> (A \<inter> M1))
E \<in> sets M
E \<subseteq> M2

goal (1 subgoal):
 1. \<mu> E \<le> 0
[PROOF STEP]
using \<open>E \<in> sets M\<close>
[PROOF STATE]
proof (prove)
using this:
E \<subseteq> M2
pos_meas_set M1
M2 \<in> sets M \<and> (\<forall>A\<in>sets M. A \<subseteq> M2 \<longrightarrow> \<mu> A \<le> 0)
m1 = (\<lambda>A. \<mu> (A \<inter> M1))
E \<in> sets M
E \<subseteq> M2
E \<in> sets M

goal (1 subgoal):
 1. \<mu> E \<le> 0
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<mu> E \<le> 0

goal (1 subgoal):
 1. m1 E = 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<mu> E \<le> 0
[PROOF STEP]
have "m1 E \<le> 0"
[PROOF STATE]
proof (prove)
using this:
\<mu> E \<le> 0

goal (1 subgoal):
 1. m1 E \<le> 0
[PROOF STEP]
using \<open>\<mu> E \<le> 0\<close> assms
[PROOF STATE]
proof (prove)
using this:
\<mu> E \<le> 0
\<mu> E \<le> 0
pos_meas_set M1
neg_meas_set M2
m1 = (\<lambda>A. \<mu> (A \<inter> M1))
E \<in> sets M
E \<subseteq> M2

goal (1 subgoal):
 1. m1 E \<le> 0
[PROOF STEP]
by (metis Int_Un_eq(1) Un_subset_iff \<open>E \<in> sets M\<close> \<open>E \<subseteq> M2\<close> pos_meas_setD1
        sets.Int signed_measure_space.neg_meas_set_def
        signed_measure_space_axioms)
[PROOF STATE]
proof (state)
this:
m1 E \<le> 0

goal (1 subgoal):
 1. m1 E = 0
[PROOF STEP]
thus "m1 E = 0"
[PROOF STATE]
proof (prove)
using this:
m1 E \<le> 0

goal (1 subgoal):
 1. m1 E = 0
[PROOF STEP]
using \<open>m1 E \<ge> 0\<close> \<open>m1 E \<le> 0\<close>
[PROOF STATE]
proof (prove)
using this:
m1 E \<le> 0
0 \<le> m1 E
m1 E \<le> 0

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma measurement_dim:
  assumes "measurement d n M"
  shows "\<And>k. k < n \<Longrightarrow> (M k) \<in> carrier_mat d d"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>k. k < n \<Longrightarrow> M k \<in> carrier_mat d d
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
measurement d n M

goal (1 subgoal):
 1. \<And>k. k < n \<Longrightarrow> M k \<in> carrier_mat d d
[PROOF STEP]
unfolding measurement_def
[PROOF STATE]
proof (prove)
using this:
(\<forall>j<n. M j \<in> carrier_mat d d) \<and> matrix_sum d (\<lambda>j. adjoint (M j) * M j) n = 1\<^sub>m d

goal (1 subgoal):
 1. \<And>k. k < n \<Longrightarrow> M k \<in> carrier_mat d d
[PROOF STEP]
by auto


[STATEMENT]
lemma variants_iff_subsumes: "variants C D \<longleftrightarrow> subsumes C D \<and> subsumes D C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. variants C D = (subsumes C D \<and> subsumes D C)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. variants C D \<Longrightarrow> subsumes C D \<and> subsumes D C
 2. subsumes C D \<and> subsumes D C \<Longrightarrow> variants C D
[PROOF STEP]
assume "variants C D"
[PROOF STATE]
proof (state)
this:
variants C D

goal (2 subgoals):
 1. variants C D \<Longrightarrow> subsumes C D \<and> subsumes D C
 2. subsumes C D \<and> subsumes D C \<Longrightarrow> variants C D
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
variants C D
[PROOF STEP]
show "subsumes C D \<and> subsumes D C"
[PROOF STATE]
proof (prove)
using this:
variants C D

goal (1 subgoal):
 1. subsumes C D \<and> subsumes D C
[PROOF STEP]
unfolding variants_def generalizes_def subsumes_def
[PROOF STATE]
proof (prove)
using this:
(\<exists>\<sigma>. C \<cdot> \<sigma> = D) \<and> (\<exists>\<sigma>. D \<cdot> \<sigma> = C)

goal (1 subgoal):
 1. (\<exists>\<sigma>. C \<cdot> \<sigma> \<subseteq># D) \<and> (\<exists>\<sigma>. D \<cdot> \<sigma> \<subseteq># C)
[PROOF STEP]
by (metis subset_mset.refl)
[PROOF STATE]
proof (state)
this:
subsumes C D \<and> subsumes D C

goal (1 subgoal):
 1. subsumes C D \<and> subsumes D C \<Longrightarrow> variants C D
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. subsumes C D \<and> subsumes D C \<Longrightarrow> variants C D
[PROOF STEP]
assume sub: "subsumes C D \<and> subsumes D C"
[PROOF STATE]
proof (state)
this:
subsumes C D \<and> subsumes D C

goal (1 subgoal):
 1. subsumes C D \<and> subsumes D C \<Longrightarrow> variants C D
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
subsumes C D \<and> subsumes D C
[PROOF STEP]
have "size C = size D"
[PROOF STATE]
proof (prove)
using this:
subsumes C D \<and> subsumes D C

goal (1 subgoal):
 1. size C = size D
[PROOF STEP]
unfolding subsumes_def
[PROOF STATE]
proof (prove)
using this:
(\<exists>\<sigma>. C \<cdot> \<sigma> \<subseteq># D) \<and> (\<exists>\<sigma>. D \<cdot> \<sigma> \<subseteq># C)

goal (1 subgoal):
 1. size C = size D
[PROOF STEP]
by (metis antisym size_mset_mono size_subst)
[PROOF STATE]
proof (state)
this:
size C = size D

goal (1 subgoal):
 1. subsumes C D \<and> subsumes D C \<Longrightarrow> variants C D
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
size C = size D
[PROOF STEP]
show "variants C D"
[PROOF STATE]
proof (prove)
using this:
size C = size D

goal (1 subgoal):
 1. variants C D
[PROOF STEP]
using sub
[PROOF STATE]
proof (prove)
using this:
size C = size D
subsumes C D \<and> subsumes D C

goal (1 subgoal):
 1. variants C D
[PROOF STEP]
unfolding subsumes_def variants_def generalizes_def
[PROOF STATE]
proof (prove)
using this:
size C = size D
(\<exists>\<sigma>. C \<cdot> \<sigma> \<subseteq># D) \<and> (\<exists>\<sigma>. D \<cdot> \<sigma> \<subseteq># C)

goal (1 subgoal):
 1. (\<exists>\<sigma>. C \<cdot> \<sigma> = D) \<and> (\<exists>\<sigma>. D \<cdot> \<sigma> = C)
[PROOF STEP]
by (metis leD mset_subset_size size_mset_mono size_subst
        subset_mset.not_eq_order_implies_strict)
[PROOF STATE]
proof (state)
this:
variants C D

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ln_Gamma_real_converges:
  assumes "(x::real) > 0"
  shows   "convergent (ln_Gamma_series x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. convergent (ln_Gamma_series x)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. convergent (ln_Gamma_series x)
[PROOF STEP]
have "(\<lambda>n. ln_Gamma_series (complex_of_real x) n) \<longlonglongrightarrow> ln_Gamma (of_real x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ln_Gamma_series (complex_of_real x) \<longlonglongrightarrow> ln_Gamma (complex_of_real x)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
0 < x

goal (1 subgoal):
 1. ln_Gamma_series (complex_of_real x) \<longlonglongrightarrow> ln_Gamma (complex_of_real x)
[PROOF STEP]
by (intro ln_Gamma_complex_LIMSEQ) (auto simp: of_real_in_nonpos_Ints_iff)
[PROOF STATE]
proof (state)
this:
ln_Gamma_series (complex_of_real x) \<longlonglongrightarrow> ln_Gamma (complex_of_real x)

goal (1 subgoal):
 1. convergent (ln_Gamma_series x)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
ln_Gamma_series (complex_of_real x) \<longlonglongrightarrow> ln_Gamma (complex_of_real x)

goal (1 subgoal):
 1. convergent (ln_Gamma_series x)
[PROOF STEP]
from eventually_gt_at_top[of "0::nat"]
[PROOF STATE]
proof (chain)
picking this:
eventually ((<) 0) sequentially
[PROOF STEP]
have "eventually (\<lambda>n. complex_of_real (ln_Gamma_series x n) =
            ln_Gamma_series (complex_of_real x) n) sequentially"
[PROOF STATE]
proof (prove)
using this:
eventually ((<) 0) sequentially

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. complex_of_real (ln_Gamma_series x n) = ln_Gamma_series (complex_of_real x) n
[PROOF STEP]
by eventually_elim (simp add: ln_Gamma_series_complex_of_real assms)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in sequentially. complex_of_real (ln_Gamma_series x n) = ln_Gamma_series (complex_of_real x) n

goal (1 subgoal):
 1. convergent (ln_Gamma_series x)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
ln_Gamma_series (complex_of_real x) \<longlonglongrightarrow> ln_Gamma (complex_of_real x)
\<forall>\<^sub>F n in sequentially. complex_of_real (ln_Gamma_series x n) = ln_Gamma_series (complex_of_real x) n
[PROOF STEP]
have "(\<lambda>n. complex_of_real (ln_Gamma_series x n)) \<longlonglongrightarrow> ln_Gamma (of_real x)"
[PROOF STATE]
proof (prove)
using this:
ln_Gamma_series (complex_of_real x) \<longlonglongrightarrow> ln_Gamma (complex_of_real x)
\<forall>\<^sub>F n in sequentially. complex_of_real (ln_Gamma_series x n) = ln_Gamma_series (complex_of_real x) n

goal (1 subgoal):
 1. (\<lambda>n. complex_of_real (ln_Gamma_series x n)) \<longlonglongrightarrow> ln_Gamma (complex_of_real x)
[PROOF STEP]
by (subst tendsto_cong) assumption+
[PROOF STATE]
proof (state)
this:
(\<lambda>n. complex_of_real (ln_Gamma_series x n)) \<longlonglongrightarrow> ln_Gamma (complex_of_real x)

goal (1 subgoal):
 1. convergent (ln_Gamma_series x)
[PROOF STEP]
from tendsto_Re[OF this]
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>xa. Re (complex_of_real (ln_Gamma_series x xa))) \<longlonglongrightarrow> Re (ln_Gamma (complex_of_real x))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<lambda>xa. Re (complex_of_real (ln_Gamma_series x xa))) \<longlonglongrightarrow> Re (ln_Gamma (complex_of_real x))

goal (1 subgoal):
 1. convergent (ln_Gamma_series x)
[PROOF STEP]
by (auto simp: convergent_def)
[PROOF STATE]
proof (state)
this:
convergent (ln_Gamma_series x)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma affine_hull_UNIV:
  fixes S :: "'n::euclidean_space set"
  assumes "aff_dim S = int(DIM('n))"
  shows "affine hull S = (UNIV :: ('n::euclidean_space) set)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. affine hull S = UNIV
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. affine hull S = UNIV
[PROOF STEP]
have "S \<noteq> {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. S \<noteq> {}
[PROOF STEP]
using assms aff_dim_empty[of S]
[PROOF STATE]
proof (prove)
using this:
aff_dim S = int DIM('n)
(S = {}) = (aff_dim S = - 1)

goal (1 subgoal):
 1. S \<noteq> {}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
S \<noteq> {}

goal (1 subgoal):
 1. affine hull S = UNIV
[PROOF STEP]
have h0: "S \<subseteq> affine hull S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. S \<subseteq> affine hull S
[PROOF STEP]
using hull_subset[of S _]
[PROOF STATE]
proof (prove)
using this:
S \<subseteq> ?S hull S

goal (1 subgoal):
 1. S \<subseteq> affine hull S
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
S \<subseteq> affine hull S

goal (1 subgoal):
 1. affine hull S = UNIV
[PROOF STEP]
have h1: "aff_dim (UNIV :: ('n::euclidean_space) set) = aff_dim S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. aff_dim UNIV = aff_dim S
[PROOF STEP]
using aff_dim_UNIV assms
[PROOF STATE]
proof (prove)
using this:
aff_dim UNIV = int DIM(?'n)
aff_dim S = int DIM('n)

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

goal (1 subgoal):
 1. affine hull S = UNIV
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
aff_dim UNIV = aff_dim S
[PROOF STEP]
have h2: "aff_dim (affine hull S) \<le> aff_dim (UNIV :: ('n::euclidean_space) set)"
[PROOF STATE]
proof (prove)
using this:
aff_dim UNIV = aff_dim S

goal (1 subgoal):
 1. aff_dim (affine hull S) \<le> aff_dim UNIV
[PROOF STEP]
using aff_dim_le_DIM[of "affine hull S"] assms h0
[PROOF STATE]
proof (prove)
using this:
aff_dim UNIV = aff_dim S
aff_dim (affine hull S) \<le> int DIM('n)
aff_dim S = int DIM('n)
S \<subseteq> affine hull S

goal (1 subgoal):
 1. aff_dim (affine hull S) \<le> aff_dim UNIV
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
aff_dim (affine hull S) \<le> aff_dim UNIV

goal (1 subgoal):
 1. affine hull S = UNIV
[PROOF STEP]
have h3: "aff_dim S \<le> aff_dim (affine hull S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. aff_dim S \<le> aff_dim (affine hull S)
[PROOF STEP]
using h0 aff_dim_subset[of S "affine hull S"] assms
[PROOF STATE]
proof (prove)
using this:
S \<subseteq> affine hull S
S \<subseteq> affine hull S \<Longrightarrow> aff_dim S \<le> aff_dim (affine hull S)
aff_dim S = int DIM('n)

goal (1 subgoal):
 1. aff_dim S \<le> aff_dim (affine hull S)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
aff_dim S \<le> aff_dim (affine hull S)

goal (1 subgoal):
 1. affine hull S = UNIV
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
aff_dim S \<le> aff_dim (affine hull S)
[PROOF STEP]
have h4: "aff_dim (affine hull S) = aff_dim (UNIV :: ('n::euclidean_space) set)"
[PROOF STATE]
proof (prove)
using this:
aff_dim S \<le> aff_dim (affine hull S)

goal (1 subgoal):
 1. aff_dim (affine hull S) = aff_dim UNIV
[PROOF STEP]
using h0 h1 h2
[PROOF STATE]
proof (prove)
using this:
aff_dim S \<le> aff_dim (affine hull S)
S \<subseteq> affine hull S
aff_dim UNIV = aff_dim S
aff_dim (affine hull S) \<le> aff_dim UNIV

goal (1 subgoal):
 1. aff_dim (affine hull S) = aff_dim UNIV
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
aff_dim (affine hull S) = aff_dim UNIV

goal (1 subgoal):
 1. affine hull S = UNIV
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
aff_dim (affine hull S) = aff_dim UNIV
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
aff_dim (affine hull S) = aff_dim UNIV

goal (1 subgoal):
 1. affine hull S = UNIV
[PROOF STEP]
using affine_dim_equal[of "affine hull S" "(UNIV :: ('n::euclidean_space) set)"]
      affine_affine_hull[of S] affine_UNIV assms h4 h0 \<open>S \<noteq> {}\<close>
[PROOF STATE]
proof (prove)
using this:
aff_dim (affine hull S) = aff_dim UNIV
\<lbrakk>affine (affine hull S); affine UNIV; affine hull S \<noteq> {}; affine hull S \<subseteq> UNIV; aff_dim (affine hull S) = aff_dim UNIV\<rbrakk> \<Longrightarrow> affine hull S = UNIV
affine (affine hull S)
affine UNIV
aff_dim S = int DIM('n)
aff_dim (affine hull S) = aff_dim UNIV
S \<subseteq> affine hull S
S \<noteq> {}

goal (1 subgoal):
 1. affine hull S = UNIV
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
affine hull S = UNIV

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma coeff_mpoly_to_mpoly_poly:
  "Polynomial.coeff (mpoly_to_mpoly_poly x p) n =
     Sum_any (\<lambda>m. MPoly_Type.monom (remove_key x m) (MPoly_Type.coeff p m) when Poly_Mapping.lookup m x = n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly.coeff (mpoly_to_mpoly_poly x p) n = (\<Sum>m. MPoly_Type.monom (remove_key x m) (MPoly_Type.coeff p m) when lookup m x = n)
[PROOF STEP]
unfolding mpoly_to_mpoly_poly_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly.coeff (\<Sum>m. Polynomial.monom (MPoly_Type.monom (remove_key x m) (MPoly_Type.coeff p m)) (lookup m x)) n = (\<Sum>m. MPoly_Type.monom (remove_key x m) (MPoly_Type.coeff p m) when lookup m x = n)
[PROOF STEP]
by (subst poly_coeff_Sum_any) (auto simp: when_def)


[STATEMENT]
lemma ln_2_64:
  "\<bar>ln 2 - 12786308645202655660 / 2 ^ 64\<bar> \<le> inverse (2 ^ 64 :: real)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>ln 2 - 12786308645202655660 / 2 ^ 64\<bar> \<le> inverse (2 ^ 64)
[PROOF STEP]
by (rule approx_coarsen[OF ln_2_128]) simp_all