[STATEMENT]
lemma translation_inverse_subset:
  assumes "((\<lambda>x. - a + x) ` V) \<le> (S :: 'n::ab_group_add set)"
  shows "V \<le> ((\<lambda>x. a + x) ` S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. V \<subseteq> (+) a ` S
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. V \<subseteq> (+) a ` S
[PROOF STEP]
{
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. V \<subseteq> (+) a ` S
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. V \<subseteq> (+) a ` S
[PROOF STEP]
assume "x \<in> V"
[PROOF STATE]
proof (state)
this:
x \<in> V

goal (1 subgoal):
 1. V \<subseteq> (+) a ` S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<in> V
[PROOF STEP]
have "x-a \<in> S"
[PROOF STATE]
proof (prove)
using this:
x \<in> V

goal (1 subgoal):
 1. x - a \<in> S
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
x \<in> V
(+) (- a) ` V \<subseteq> S

goal (1 subgoal):
 1. x - a \<in> S
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x - a \<in> S

goal (1 subgoal):
 1. V \<subseteq> (+) a ` S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x - a \<in> S
[PROOF STEP]
have "x \<in> {a + v |v. v \<in> S}"
[PROOF STATE]
proof (prove)
using this:
x - a \<in> S

goal (1 subgoal):
 1. x \<in> {a + v |v. v \<in> S}
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x - a \<in> S \<Longrightarrow> \<exists>v. x = a + v \<and> v \<in> S
[PROOF STEP]
apply (rule exI[of _ "x-a"], simp)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
x \<in> {a + v |v. v \<in> S}

goal (1 subgoal):
 1. V \<subseteq> (+) a ` S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<in> {a + v |v. v \<in> S}
[PROOF STEP]
have "x \<in> ((\<lambda>x. a+x) ` S)"
[PROOF STATE]
proof (prove)
using this:
x \<in> {a + v |v. v \<in> S}

goal (1 subgoal):
 1. x \<in> (+) a ` S
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x \<in> (+) a ` S

goal (1 subgoal):
 1. V \<subseteq> (+) a ` S
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
?x2 \<in> V \<Longrightarrow> ?x2 \<in> (+) a ` S

goal (1 subgoal):
 1. V \<subseteq> (+) a ` S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
?x2 \<in> V \<Longrightarrow> ?x2 \<in> (+) a ` S
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
?x2 \<in> V \<Longrightarrow> ?x2 \<in> (+) a ` S

goal (1 subgoal):
 1. V \<subseteq> (+) a ` S
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
V \<subseteq> (+) a ` S

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma permutes_inverses:
  shows "p (inv p x) = x"
    and "inv p (p x) = x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p (inv p x) = x &&& inv p (p x) = x
[PROOF STEP]
using permutes_inv_o [unfolded fun_eq_iff o_def]
[PROOF STATE]
proof (prove)
using this:
\<forall>x. p (inv p x) = id x
\<forall>x. inv p (p x) = id x

goal (1 subgoal):
 1. p (inv p x) = x &&& inv p (p x) = x
[PROOF STEP]
by auto


[STATEMENT]
lemma O_subset_trans:
assumes "r O r \<subseteq> r"
shows "trans r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. trans r
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
r O r \<subseteq> r

goal (1 subgoal):
 1. trans r
[PROOF STEP]
unfolding trans_def
[PROOF STATE]
proof (prove)
using this:
r O r \<subseteq> r

goal (1 subgoal):
 1. \<forall>x y z. (x, y) \<in> r \<longrightarrow> (y, z) \<in> r \<longrightarrow> (x, z) \<in> r
[PROOF STEP]
by blast


[STATEMENT]
lemma clinear_times: "clinear (\<lambda>x. c * x)"
  for c :: "'a::complex_algebra"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. clinear ((*) c)
[PROOF STEP]
by (auto simp: clinearI distrib_left)


[STATEMENT]
lemma strict_mono_o: "strict_mono r \<Longrightarrow> strict_mono s \<Longrightarrow> strict_mono (r \<circ> s)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>strict_mono r; strict_mono s\<rbrakk> \<Longrightarrow> strict_mono (r \<circ> s)
[PROOF STEP]
unfolding strict_mono_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>x y. x < y \<longrightarrow> r x < r y; \<forall>x y. x < y \<longrightarrow> s x < s y\<rbrakk> \<Longrightarrow> \<forall>x y. x < y \<longrightarrow> (r \<circ> s) x < (r \<circ> s) y
[PROOF STEP]
by simp


[STATEMENT]
lemma convolution_symm :
  fixes f g :: "'a::group_add \<Rightarrow> 'b::{comm_monoid_add,times}"
  shows "convolution f g
              = (\<lambda>x. \<Sum>y|y \<in> supp f \<and> -y + x \<in> supp g. (f y) * g (-y + x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. convolution f g = (\<lambda>x. \<Sum>y | y \<in> supp f \<and> - y + x \<in> supp g. f y * g (- y + x))
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. convolution f g x = (\<Sum>y | y \<in> supp f \<and> - y + x \<in> supp g. f y * g (- y + x))
[PROOF STEP]
fix x::'a
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. convolution f g x = (\<Sum>y | y \<in> supp f \<and> - y + x \<in> supp g. f y * g (- y + x))
[PROOF STEP]
define c1 c2 i S1 S2
    where "c1 y = (f (x - y)) * g y"
      and "c2 y = (f y) * g (-y + x)"
      and "i y = -y + x"
      and "S1 = {y. x - y \<in> supp f \<and> y \<in> supp g}"
      and "S2 = {y. y \<in> supp f \<and> -y + x \<in> supp g}"
    for y
[PROOF STATE]
proof (state)
this:
c1 ?y = f (x - ?y) * g ?y
c2 ?y = f ?y * g (- ?y + x)
i ?y = - ?y + x
S1 = {y. x - y \<in> supp f \<and> y \<in> supp g}
S2 = {y \<in> supp f. - y + x \<in> supp g}

goal (1 subgoal):
 1. \<And>x. convolution f g x = (\<Sum>y | y \<in> supp f \<and> - y + x \<in> supp g. f y * g (- y + x))
[PROOF STEP]
have "inj_on i S2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on i S2
[PROOF STEP]
unfolding inj_on_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>S2. \<forall>y\<in>S2. i x = i y \<longrightarrow> x = y
[PROOF STEP]
using i_def
[PROOF STATE]
proof (prove)
using this:
i ?y = - ?y + x

goal (1 subgoal):
 1. \<forall>x\<in>S2. \<forall>y\<in>S2. i x = i y \<longrightarrow> x = y
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
inj_on i S2

goal (1 subgoal):
 1. \<And>x. convolution f g x = (\<Sum>y | y \<in> supp f \<and> - y + x \<in> supp g. f y * g (- y + x))
[PROOF STEP]
hence "(\<Sum>y\<in>(i ` S2). c1 y) = (\<Sum>y\<in>S2. (c1 \<circ> i) y)"
[PROOF STATE]
proof (prove)
using this:
inj_on i S2

goal (1 subgoal):
 1. sum c1 (i ` S2) = sum (c1 \<circ> i) S2
[PROOF STEP]
using sum.reindex
[PROOF STATE]
proof (prove)
using this:
inj_on i S2
inj_on ?h ?A \<Longrightarrow> sum ?g (?h ` ?A) = sum (?g \<circ> ?h) ?A

goal (1 subgoal):
 1. sum c1 (i ` S2) = sum (c1 \<circ> i) S2
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
sum c1 (i ` S2) = sum (c1 \<circ> i) S2

goal (1 subgoal):
 1. \<And>x. convolution f g x = (\<Sum>y | y \<in> supp f \<and> - y + x \<in> supp g. f y * g (- y + x))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
sum c1 (i ` S2) = sum (c1 \<circ> i) S2

goal (1 subgoal):
 1. \<And>x. convolution f g x = (\<Sum>y | y \<in> supp f \<and> - y + x \<in> supp g. f y * g (- y + x))
[PROOF STEP]
have S1_iS2: "S1 = i ` S2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. S1 = i ` S2
[PROOF STEP]
proof (rule seteqI)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>a. a \<in> S1 \<Longrightarrow> a \<in> i ` S2
 2. \<And>b. b \<in> i ` S2 \<Longrightarrow> b \<in> S1
[PROOF STEP]
fix y
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>a. a \<in> S1 \<Longrightarrow> a \<in> i ` S2
 2. \<And>b. b \<in> i ` S2 \<Longrightarrow> b \<in> S1
[PROOF STEP]
assume y_S1: "y \<in> S1"
[PROOF STATE]
proof (state)
this:
y \<in> S1

goal (2 subgoals):
 1. \<And>a. a \<in> S1 \<Longrightarrow> a \<in> i ` S2
 2. \<And>b. b \<in> i ` S2 \<Longrightarrow> b \<in> S1
[PROOF STEP]
define z where "z = x - y"
[PROOF STATE]
proof (state)
this:
z = x - y

goal (2 subgoals):
 1. \<And>a. a \<in> S1 \<Longrightarrow> a \<in> i ` S2
 2. \<And>b. b \<in> i ` S2 \<Longrightarrow> b \<in> S1
[PROOF STEP]
hence y_eq: "-z + x = y"
[PROOF STATE]
proof (prove)
using this:
z = x - y

goal (1 subgoal):
 1. - z + x = y
[PROOF STEP]
by (auto simp add: algebra_simps)
[PROOF STATE]
proof (state)
this:
- z + x = y

goal (2 subgoals):
 1. \<And>a. a \<in> S1 \<Longrightarrow> a \<in> i ` S2
 2. \<And>b. b \<in> i ` S2 \<Longrightarrow> b \<in> S1
[PROOF STEP]
hence "-z + x \<in> supp g"
[PROOF STATE]
proof (prove)
using this:
- z + x = y

goal (1 subgoal):
 1. - z + x \<in> supp g
[PROOF STEP]
using y_S1 S1_def
[PROOF STATE]
proof (prove)
using this:
- z + x = y
y \<in> S1
S1 = {y. x - y \<in> supp f \<and> y \<in> supp g}

goal (1 subgoal):
 1. - z + x \<in> supp g
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
- z + x \<in> supp g

goal (2 subgoals):
 1. \<And>a. a \<in> S1 \<Longrightarrow> a \<in> i ` S2
 2. \<And>b. b \<in> i ` S2 \<Longrightarrow> b \<in> S1
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
- z + x \<in> supp g

goal (2 subgoals):
 1. \<And>a. a \<in> S1 \<Longrightarrow> a \<in> i ` S2
 2. \<And>b. b \<in> i ` S2 \<Longrightarrow> b \<in> S1
[PROOF STEP]
have "z \<in> supp f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. z \<in> supp f
[PROOF STEP]
using z_def y_S1 S1_def
[PROOF STATE]
proof (prove)
using this:
z = x - y
y \<in> S1
S1 = {y. x - y \<in> supp f \<and> y \<in> supp g}

goal (1 subgoal):
 1. z \<in> supp f
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
z \<in> supp f

goal (2 subgoals):
 1. \<And>a. a \<in> S1 \<Longrightarrow> a \<in> i ` S2
 2. \<And>b. b \<in> i ` S2 \<Longrightarrow> b \<in> S1
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
- z + x \<in> supp g
z \<in> supp f
[PROOF STEP]
have "z \<in> S2"
[PROOF STATE]
proof (prove)
using this:
- z + x \<in> supp g
z \<in> supp f

goal (1 subgoal):
 1. z \<in> S2
[PROOF STEP]
using S2_def
[PROOF STATE]
proof (prove)
using this:
- z + x \<in> supp g
z \<in> supp f
S2 = {y \<in> supp f. - y + x \<in> supp g}

goal (1 subgoal):
 1. z \<in> S2
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
z \<in> S2

goal (2 subgoals):
 1. \<And>a. a \<in> S1 \<Longrightarrow> a \<in> i ` S2
 2. \<And>b. b \<in> i ` S2 \<Longrightarrow> b \<in> S1
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
z \<in> S2

goal (2 subgoals):
 1. \<And>a. a \<in> S1 \<Longrightarrow> a \<in> i ` S2
 2. \<And>b. b \<in> i ` S2 \<Longrightarrow> b \<in> S1
[PROOF STEP]
have "y = i z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y = i z
[PROOF STEP]
using i_def [abs_def] y_eq
[PROOF STATE]
proof (prove)
using this:
i \<equiv> \<lambda>y. - y + x
- z + x = y

goal (1 subgoal):
 1. y = i z
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
y = i z

goal (2 subgoals):
 1. \<And>a. a \<in> S1 \<Longrightarrow> a \<in> i ` S2
 2. \<And>b. b \<in> i ` S2 \<Longrightarrow> b \<in> S1
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
z \<in> S2
y = i z
[PROOF STEP]
show "y \<in> i ` S2"
[PROOF STATE]
proof (prove)
using this:
z \<in> S2
y = i z

goal (1 subgoal):
 1. y \<in> i ` S2
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
y \<in> i ` S2

goal (1 subgoal):
 1. \<And>b. b \<in> i ` S2 \<Longrightarrow> b \<in> S1
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>b. b \<in> i ` S2 \<Longrightarrow> b \<in> S1
[PROOF STEP]
fix y
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>b. b \<in> i ` S2 \<Longrightarrow> b \<in> S1
[PROOF STEP]
assume "y \<in> i ` S2"
[PROOF STATE]
proof (state)
this:
y \<in> i ` S2

goal (1 subgoal):
 1. \<And>b. b \<in> i ` S2 \<Longrightarrow> b \<in> S1
[PROOF STEP]
from this
[PROOF STATE]
proof (chain)
picking this:
y \<in> i ` S2
[PROOF STEP]
obtain z where z_S2: "z \<in> S2" and y_eq: "y = -z + x"
[PROOF STATE]
proof (prove)
using this:
y \<in> i ` S2

goal (1 subgoal):
 1. (\<And>z. \<lbrakk>z \<in> S2; y = - z + x\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using i_def
[PROOF STATE]
proof (prove)
using this:
y \<in> i ` S2
i ?y = - ?y + x

goal (1 subgoal):
 1. (\<And>z. \<lbrakk>z \<in> S2; y = - z + x\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
z \<in> S2
y = - z + x

goal (1 subgoal):
 1. \<And>b. b \<in> i ` S2 \<Longrightarrow> b \<in> S1
[PROOF STEP]
from y_eq
[PROOF STATE]
proof (chain)
picking this:
y = - z + x
[PROOF STEP]
have "x - y = z"
[PROOF STATE]
proof (prove)
using this:
y = - z + x

goal (1 subgoal):
 1. x - y = z
[PROOF STEP]
by (auto simp add: algebra_simps)
[PROOF STATE]
proof (state)
this:
x - y = z

goal (1 subgoal):
 1. \<And>b. b \<in> i ` S2 \<Longrightarrow> b \<in> S1
[PROOF STEP]
hence "x - y \<in> supp f \<and> y \<in> supp g"
[PROOF STATE]
proof (prove)
using this:
x - y = z

goal (1 subgoal):
 1. x - y \<in> supp f \<and> y \<in> supp g
[PROOF STEP]
using y_eq z_S2 S2_def
[PROOF STATE]
proof (prove)
using this:
x - y = z
y = - z + x
z \<in> S2
S2 = {y \<in> supp f. - y + x \<in> supp g}

goal (1 subgoal):
 1. x - y \<in> supp f \<and> y \<in> supp g
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
x - y \<in> supp f \<and> y \<in> supp g

goal (1 subgoal):
 1. \<And>b. b \<in> i ` S2 \<Longrightarrow> b \<in> S1
[PROOF STEP]
thus "y \<in> S1"
[PROOF STATE]
proof (prove)
using this:
x - y \<in> supp f \<and> y \<in> supp g

goal (1 subgoal):
 1. y \<in> S1
[PROOF STEP]
using S1_def
[PROOF STATE]
proof (prove)
using this:
x - y \<in> supp f \<and> y \<in> supp g
S1 = {y. x - y \<in> supp f \<and> y \<in> supp g}

goal (1 subgoal):
 1. y \<in> S1
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
y \<in> S1

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
S1 = i ` S2

goal (1 subgoal):
 1. \<And>x. convolution f g x = (\<Sum>y | y \<in> supp f \<and> - y + x \<in> supp g. f y * g (- y + x))
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
sum c1 (i ` S2) = sum (c1 \<circ> i) S2
S1 = i ` S2
[PROOF STEP]
have "(\<Sum>y\<in>S1. c1 y) = (\<Sum>y\<in>S2. (c1 \<circ> i) y)"
[PROOF STATE]
proof (prove)
using this:
sum c1 (i ` S2) = sum (c1 \<circ> i) S2
S1 = i ` S2

goal (1 subgoal):
 1. sum c1 S1 = sum (c1 \<circ> i) S2
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
sum c1 S1 = sum (c1 \<circ> i) S2

goal (1 subgoal):
 1. \<And>x. convolution f g x = (\<Sum>y | y \<in> supp f \<and> - y + x \<in> supp g. f y * g (- y + x))
[PROOF STEP]
with i_def c1_def c2_def
[PROOF STATE]
proof (chain)
picking this:
i ?y = - ?y + x
c1 ?y = f (x - ?y) * g ?y
c2 ?y = f ?y * g (- ?y + x)
sum c1 S1 = sum (c1 \<circ> i) S2
[PROOF STEP]
have "(\<Sum>y\<in>S1. c1 y) = (\<Sum>y\<in>S2. c2 y)"
[PROOF STATE]
proof (prove)
using this:
i ?y = - ?y + x
c1 ?y = f (x - ?y) * g ?y
c2 ?y = f ?y * g (- ?y + x)
sum c1 S1 = sum (c1 \<circ> i) S2

goal (1 subgoal):
 1. sum c1 S1 = sum c2 S2
[PROOF STEP]
using diff_add_eq_diff_diff_swap[of x _ x]
[PROOF STATE]
proof (prove)
using this:
i ?y = - ?y + x
c1 ?y = f (x - ?y) * g ?y
c2 ?y = f ?y * g (- ?y + x)
sum c1 S1 = sum (c1 \<circ> i) S2
x - (?b + x) = x - x - ?b

goal (1 subgoal):
 1. sum c1 S1 = sum c2 S2
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
sum c1 S1 = sum c2 S2

goal (1 subgoal):
 1. \<And>x. convolution f g x = (\<Sum>y | y \<in> supp f \<and> - y + x \<in> supp g. f y * g (- y + x))
[PROOF STEP]
thus "convolution f g x
              = (\<Sum>y|y \<in> supp f \<and> -y + x \<in> supp g. (f y) * g (-y + x))"
[PROOF STATE]
proof (prove)
using this:
sum c1 S1 = sum c2 S2

goal (1 subgoal):
 1. convolution f g x = (\<Sum>y | y \<in> supp f \<and> - y + x \<in> supp g. f y * g (- y + x))
[PROOF STEP]
unfolding S1_def c1_def S2_def c2_def convolution_def
[PROOF STATE]
proof (prove)
using this:
(\<Sum>y | x - y \<in> supp f \<and> y \<in> supp g. f (x - y) * g y) = (\<Sum>y | y \<in> supp f \<and> - y + x \<in> supp g. f y * g (- y + x))

goal (1 subgoal):
 1. (\<Sum>y | x - y \<in> supp f \<and> y \<in> supp g. f (x - y) * g y) = (\<Sum>y | y \<in> supp f \<and> - y + x \<in> supp g. f y * g (- y + x))
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
convolution f g x = (\<Sum>y | y \<in> supp f \<and> - y + x \<in> supp g. f y * g (- y + x))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in ab_semigroup_add_0) sum_image_gen_0:
  assumes fin: "finite S"
  shows "sum_0 g S = sum_0 (\<lambda>y. sum_0 g {x. x \<in> S \<and> f x = y}) (f ` S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum_0 g S = (\<Sum>y\<in>f ` S. sum_0 g {x \<in> S. f x = y})
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. sum_0 g S = (\<Sum>y\<in>f ` S. sum_0 g {x \<in> S. f x = y})
[PROOF STEP]
have "{y. y\<in> f`S \<and> f x = y} = {f x}" if "x \<in> S" for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {y \<in> f ` S. f x = y} = {f x}
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
x \<in> S

goal (1 subgoal):
 1. {y \<in> f ` S. f x = y} = {f x}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
?x1 \<in> S \<Longrightarrow> {y \<in> f ` S. f ?x1 = y} = {f ?x1}

goal (1 subgoal):
 1. sum_0 g S = (\<Sum>y\<in>f ` S. sum_0 g {x \<in> S. f x = y})
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
?x1 \<in> S \<Longrightarrow> {y \<in> f ` S. f ?x1 = y} = {f ?x1}
[PROOF STEP]
have "sum_0 g S = sum_0 (\<lambda>x. sum_0 (\<lambda>y. g x) {y. y\<in> f`S \<and> f x = y}) S"
[PROOF STATE]
proof (prove)
using this:
?x1 \<in> S \<Longrightarrow> {y \<in> f ` S. f ?x1 = y} = {f ?x1}

goal (1 subgoal):
 1. sum_0 g S = (\<Sum>x\<in>S. \<Sum>y | y \<in> f ` S \<and> f x = y. g x)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
sum_0 g S = (\<Sum>x\<in>S. \<Sum>y | y \<in> f ` S \<and> f x = y. g x)

goal (1 subgoal):
 1. sum_0 g S = (\<Sum>y\<in>f ` S. sum_0 g {x \<in> S. f x = y})
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
sum_0 g S = (\<Sum>x\<in>S. \<Sum>y | y \<in> f ` S \<and> f x = y. g x)

goal (1 subgoal):
 1. sum_0 g S = (\<Sum>y\<in>f ` S. sum_0 g {x \<in> S. f x = y})
[PROOF STEP]
have "\<dots> = sum_0 (\<lambda>y. sum_0 g {x. x \<in> S \<and> f x = y}) (f ` S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>x\<in>S. \<Sum>y | y \<in> f ` S \<and> f x = y. g x) = (\<Sum>y\<in>f ` S. sum_0 g {x \<in> S. f x = y})
[PROOF STEP]
by (rule sum_0.swap_restrict [OF fin finite_imageI [OF fin]])
[PROOF STATE]
proof (state)
this:
(\<Sum>x\<in>S. \<Sum>y | y \<in> f ` S \<and> f x = y. g x) = (\<Sum>y\<in>f ` S. sum_0 g {x \<in> S. f x = y})

goal (1 subgoal):
 1. sum_0 g S = (\<Sum>y\<in>f ` S. sum_0 g {x \<in> S. f x = y})
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
sum_0 g S = (\<Sum>y\<in>f ` S. sum_0 g {x \<in> S. f x = y})
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
sum_0 g S = (\<Sum>y\<in>f ` S. sum_0 g {x \<in> S. f x = y})

goal (1 subgoal):
 1. sum_0 g S = (\<Sum>y\<in>f ` S. sum_0 g {x \<in> S. f x = y})
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
sum_0 g S = (\<Sum>y\<in>f ` S. sum_0 g {x \<in> S. f x = y})

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma dvdnumcoeff_trans:
  assumes gdg: "g dvd g'" and dgt':"dvdnumcoeff t g'"
  shows "dvdnumcoeff t g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dvdnumcoeff t g
[PROOF STEP]
using dgt' gdg
[PROOF STATE]
proof (prove)
using this:
dvdnumcoeff t g'
g dvd g'

goal (1 subgoal):
 1. dvdnumcoeff t g
[PROOF STEP]
by (induct t rule: dvdnumcoeff.induct) (simp_all add: gdg dvd_trans[OF gdg])


[STATEMENT]
lemma (in idom) idom_finite_lemma:
  assumes "\<forall>x. P x \<longrightarrow> (\<exists>n. n < length j \<and> x = j!n)"
  shows "finite {x. P x}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {x. P x}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. finite {x. P x}
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
\<forall>x. P x \<longrightarrow> (\<exists>n<length j. x = j ! n)
[PROOF STEP]
have "{x. P x} \<subseteq> set j"
[PROOF STATE]
proof (prove)
using this:
\<forall>x. P x \<longrightarrow> (\<exists>n<length j. x = j ! n)

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

goal (1 subgoal):
 1. finite {x. P x}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
{x. P x} \<subseteq> set j
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
{x. P x} \<subseteq> set j

goal (1 subgoal):
 1. finite {x. P x}
[PROOF STEP]
using finite_subset
[PROOF STATE]
proof (prove)
using this:
{x. P x} \<subseteq> set j
\<lbrakk>?A \<subseteq> ?B; finite ?B\<rbrakk> \<Longrightarrow> finite ?A

goal (1 subgoal):
 1. finite {x. P x}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
finite {x. P x}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma reduced_GB_D3:
  assumes "is_reduced_GB G"
  shows "is_monic_set G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_monic_set G
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
is_reduced_GB G

goal (1 subgoal):
 1. is_monic_set G
[PROOF STEP]
unfolding is_reduced_GB_def
[PROOF STATE]
proof (prove)
using this:
is_Groebner_basis G \<and> is_auto_reduced G \<and> is_monic_set G \<and> 0 \<notin> G

goal (1 subgoal):
 1. is_monic_set G
[PROOF STEP]
by simp


[STATEMENT]
lemma asymptotics6: "eventually (\<lambda>x. hb / ln x powr (1 + e) < b/2) at_top"
  and asymptotics7: "eventually (\<lambda>x. hb / ln x powr (1 + e) < (1 - b) / 2) at_top"
  and asymptotics8: "eventually (\<lambda>x. x*(1 - b - hb / ln x powr (1 + e)) > 1) at_top"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. hb / ln x powr (1 + e) < b / 2 &&& \<forall>\<^sub>F x in at_top. hb / ln x powr (1 + e) < (1 - b) / 2 &&& \<forall>\<^sub>F x in at_top. 1 < x * (1 - b - hb / ln x powr (1 + e))
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<forall>\<^sub>F x in at_top. hb / ln x powr (1 + e) < b / 2
 2. \<forall>\<^sub>F x in at_top. hb / ln x powr (1 + e) < (1 - b) / 2
 3. \<forall>\<^sub>F x in at_top. 1 < x * (1 - b - hb / ln x powr (1 + e))
[PROOF STEP]
from bep
[PROOF STATE]
proof (chain)
picking this:
0 < b
b < 1
0 < e
0 < hb
[PROOF STEP]
have A: "(\<lambda>x. hb / ln x powr (1 + e)) \<in> o(\<lambda>_. 1)"
[PROOF STATE]
proof (prove)
using this:
0 < b
b < 1
0 < e
0 < hb

goal (1 subgoal):
 1. (\<lambda>x. hb / ln x powr (1 + e)) \<in> o(\<lambda>_. 1)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<lambda>x. hb / ln x powr (1 + e)) \<in> o(\<lambda>_. 1)

goal (3 subgoals):
 1. \<forall>\<^sub>F x in at_top. hb / ln x powr (1 + e) < b / 2
 2. \<forall>\<^sub>F x in at_top. hb / ln x powr (1 + e) < (1 - b) / 2
 3. \<forall>\<^sub>F x in at_top. 1 < x * (1 - b - hb / ln x powr (1 + e))
[PROOF STEP]
from bep
[PROOF STATE]
proof (chain)
picking this:
0 < b
b < 1
0 < e
0 < hb
[PROOF STEP]
have B: "b/3 > 0" and C: "(1 - b)/3 > 0"
[PROOF STATE]
proof (prove)
using this:
0 < b
b < 1
0 < e
0 < hb

goal (1 subgoal):
 1. 0 < b / 3 &&& 0 < (1 - b) / 3
[PROOF STEP]
by simp_all
[PROOF STATE]
proof (state)
this:
0 < b / 3
0 < (1 - b) / 3

goal (3 subgoals):
 1. \<forall>\<^sub>F x in at_top. hb / ln x powr (1 + e) < b / 2
 2. \<forall>\<^sub>F x in at_top. hb / ln x powr (1 + e) < (1 - b) / 2
 3. \<forall>\<^sub>F x in at_top. 1 < x * (1 - b - hb / ln x powr (1 + e))
[PROOF STEP]
from landau_o.smallD[OF A B]
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F x in at_top. norm (hb / ln x powr (1 + e)) \<le> b / 3 * norm 1
[PROOF STEP]
show "eventually (\<lambda>x. hb / ln x powr (1+e) < b/2) at_top"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in at_top. norm (hb / ln x powr (1 + e)) \<le> b / 3 * norm 1

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. hb / ln x powr (1 + e) < b / 2
[PROOF STEP]
by eventually_elim (insert bep, simp)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in at_top. hb / ln x powr (1 + e) < b / 2

goal (2 subgoals):
 1. \<forall>\<^sub>F x in at_top. hb / ln x powr (1 + e) < (1 - b) / 2
 2. \<forall>\<^sub>F x in at_top. 1 < x * (1 - b - hb / ln x powr (1 + e))
[PROOF STEP]
from landau_o.smallD[OF A C]
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F x in at_top. norm (hb / ln x powr (1 + e)) \<le> (1 - b) / 3 * norm 1
[PROOF STEP]
show "eventually (\<lambda>x. hb / ln x powr (1 + e) < (1 - b)/2) at_top"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in at_top. norm (hb / ln x powr (1 + e)) \<le> (1 - b) / 3 * norm 1

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. hb / ln x powr (1 + e) < (1 - b) / 2
[PROOF STEP]
by eventually_elim (insert bep, simp)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in at_top. hb / ln x powr (1 + e) < (1 - b) / 2

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. 1 < x * (1 - b - hb / ln x powr (1 + e))
[PROOF STEP]
from bep
[PROOF STATE]
proof (chain)
picking this:
0 < b
b < 1
0 < e
0 < hb
[PROOF STEP]
have "(\<lambda>x. hb / ln x powr (1 + e)) \<in> o(\<lambda>_. 1)" "(1 - b) / 2 > 0"
[PROOF STATE]
proof (prove)
using this:
0 < b
b < 1
0 < e
0 < hb

goal (1 subgoal):
 1. (\<lambda>x. hb / ln x powr (1 + e)) \<in> o(\<lambda>_. 1) &&& 0 < (1 - b) / 2
[PROOF STEP]
by simp_all
[PROOF STATE]
proof (state)
this:
(\<lambda>x. hb / ln x powr (1 + e)) \<in> o(\<lambda>_. 1)
0 < (1 - b) / 2

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. 1 < x * (1 - b - hb / ln x powr (1 + e))
[PROOF STEP]
from landau_o.smallD[OF this] eventually_gt_at_top[of "1::real"]
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F x in at_top. norm (hb / ln x powr (1 + e)) \<le> (1 - b) / 2 * norm 1
eventually ((<) 1) at_top
[PROOF STEP]
have A: "eventually (\<lambda>x. 1 - b - hb / ln x powr (1 + e) > 0) at_top"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in at_top. norm (hb / ln x powr (1 + e)) \<le> (1 - b) / 2 * norm 1
eventually ((<) 1) at_top

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. 0 < 1 - b - hb / ln x powr (1 + e)
[PROOF STEP]
by eventually_elim (insert bep, simp add: field_simps)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in at_top. 0 < 1 - b - hb / ln x powr (1 + e)

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. 1 < x * (1 - b - hb / ln x powr (1 + e))
[PROOF STEP]
from bep
[PROOF STATE]
proof (chain)
picking this:
0 < b
b < 1
0 < e
0 < hb
[PROOF STEP]
have "(\<lambda>x. x * (1 - b - hb / ln x powr (1+e))) \<in> \<omega>(\<lambda>_. 1)" "(0::real) < 2"
[PROOF STATE]
proof (prove)
using this:
0 < b
b < 1
0 < e
0 < hb

goal (1 subgoal):
 1. (\<lambda>x. x * (1 - b - hb / ln x powr (1 + e))) \<in> \<omega>(\<lambda>_. 1) &&& 0 < 2
[PROOF STEP]
by simp_all
[PROOF STATE]
proof (state)
this:
(\<lambda>x. x * (1 - b - hb / ln x powr (1 + e))) \<in> \<omega>(\<lambda>_. 1)
0 < 2

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. 1 < x * (1 - b - hb / ln x powr (1 + e))
[PROOF STEP]
from landau_omega.smallD[OF this] A eventually_gt_at_top[of "0::real"]
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F x in at_top. 2 * norm 1 \<le> norm (x * (1 - b - hb / ln x powr (1 + e)))
\<forall>\<^sub>F x in at_top. 0 < 1 - b - hb / ln x powr (1 + e)
eventually ((<) 0) at_top
[PROOF STEP]
show "eventually (\<lambda>x. x*(1 - b - hb / ln x powr (1 + e)) > 1) at_top"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in at_top. 2 * norm 1 \<le> norm (x * (1 - b - hb / ln x powr (1 + e)))
\<forall>\<^sub>F x in at_top. 0 < 1 - b - hb / ln x powr (1 + e)
eventually ((<) 0) at_top

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. 1 < x * (1 - b - hb / ln x powr (1 + e))
[PROOF STEP]
by eventually_elim (simp_all add: abs_mult)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in at_top. 1 < x * (1 - b - hb / ln x powr (1 + e))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma pell_square_solution_nat_aux:
  fixes x y :: nat
  assumes "D > 0" and "x ^ 2 = 1 + D * y ^ 2"
  shows "(x, y) = (1, 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x, y) = (1, 0)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (x, y) = (1, 0)
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
0 < D
x\<^sup>2 = 1 + D * y\<^sup>2
[PROOF STEP]
have x_nz: "x > 0"
[PROOF STATE]
proof (prove)
using this:
0 < D
x\<^sup>2 = 1 + D * y\<^sup>2

goal (1 subgoal):
 1. 0 < x
[PROOF STEP]
by (auto intro!: Nat.gr0I)
[PROOF STATE]
proof (state)
this:
0 < x

goal (1 subgoal):
 1. (x, y) = (1, 0)
[PROOF STEP]
from square_D
[PROOF STATE]
proof (chain)
picking this:
is_square D
[PROOF STEP]
obtain d where [simp]: "D = d\<^sup>2"
[PROOF STATE]
proof (prove)
using this:
is_square D

goal (1 subgoal):
 1. (\<And>d. D = d\<^sup>2 \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto elim: is_nth_powerE)
[PROOF STATE]
proof (state)
this:
D = d\<^sup>2

goal (1 subgoal):
 1. (x, y) = (1, 0)
[PROOF STEP]
have "int x ^ 2 = int (x ^ 2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (int x)\<^sup>2 = int (x\<^sup>2)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(int x)\<^sup>2 = int (x\<^sup>2)

goal (1 subgoal):
 1. (x, y) = (1, 0)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(int x)\<^sup>2 = int (x\<^sup>2)

goal (1 subgoal):
 1. (x, y) = (1, 0)
[PROOF STEP]
note assms(2)
[PROOF STATE]
proof (state)
this:
x\<^sup>2 = 1 + D * y\<^sup>2

goal (1 subgoal):
 1. (x, y) = (1, 0)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
x\<^sup>2 = 1 + D * y\<^sup>2

goal (1 subgoal):
 1. (x, y) = (1, 0)
[PROOF STEP]
have "int (1 + D * y ^ 2) = 1 + int D * int y ^ 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. int (1 + D * y\<^sup>2) = 1 + int D * (int y)\<^sup>2
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
int (1 + D * y\<^sup>2) = 1 + int D * (int y)\<^sup>2

goal (1 subgoal):
 1. (x, y) = (1, 0)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(int x)\<^sup>2 = 1 + int D * (int y)\<^sup>2
[PROOF STEP]
have "(int x + int d * int y) * (int x - int d * int y) = 1"
[PROOF STATE]
proof (prove)
using this:
(int x)\<^sup>2 = 1 + int D * (int y)\<^sup>2

goal (1 subgoal):
 1. (int x + int d * int y) * (int x - int d * int y) = 1
[PROOF STEP]
by (simp add: algebra_simps power2_eq_square)
[PROOF STATE]
proof (state)
this:
(int x + int d * int y) * (int x - int d * int y) = 1

goal (1 subgoal):
 1. (x, y) = (1, 0)
[PROOF STEP]
hence *: "int x + int d * int y = 1 \<and> int x - int d * int y = 1"
[PROOF STATE]
proof (prove)
using this:
(int x + int d * int y) * (int x - int d * int y) = 1

goal (1 subgoal):
 1. int x + int d * int y = 1 \<and> int x - int d * int y = 1
[PROOF STEP]
using x_nz
[PROOF STATE]
proof (prove)
using this:
(int x + int d * int y) * (int x - int d * int y) = 1
0 < x

goal (1 subgoal):
 1. int x + int d * int y = 1 \<and> int x - int d * int y = 1
[PROOF STEP]
by (subst (asm) pos_zmult_eq_1_iff) (auto intro: add_pos_nonneg)
[PROOF STATE]
proof (state)
this:
int x + int d * int y = 1 \<and> int x - int d * int y = 1

goal (1 subgoal):
 1. (x, y) = (1, 0)
[PROOF STEP]
from *
[PROOF STATE]
proof (chain)
picking this:
int x + int d * int y = 1 \<and> int x - int d * int y = 1
[PROOF STEP]
have [simp]: "x = 1"
[PROOF STATE]
proof (prove)
using this:
int x + int d * int y = 1 \<and> int x - int d * int y = 1

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

goal (1 subgoal):
 1. (x, y) = (1, 0)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
x = 1

goal (1 subgoal):
 1. (x, y) = (1, 0)
[PROOF STEP]
from * and assms(1)
[PROOF STATE]
proof (chain)
picking this:
int x + int d * int y = 1 \<and> int x - int d * int y = 1
0 < D
[PROOF STEP]
have "y = 0"
[PROOF STATE]
proof (prove)
using this:
int x + int d * int y = 1 \<and> int x - int d * int y = 1
0 < D

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

goal (1 subgoal):
 1. (x, y) = (1, 0)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
x = 1
y = 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
x = 1
y = 0

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma poly_weak_mono_all: fixes p :: "('v :: linorder,'a :: poly_carrier)poly"
  assumes p: "poly_weak_mono_all p"
  shows "poly_weak_mono p v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly_weak_mono p v
[PROOF STEP]
unfolding poly_weak_mono_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<alpha> \<beta>. (\<forall>x. v \<noteq> x \<longrightarrow> \<alpha> x = \<beta> x) \<longrightarrow> pos_assign \<beta> \<longrightarrow> \<beta> v \<le> \<alpha> v \<longrightarrow> eval_poly \<beta> p \<le> eval_poly \<alpha> p
[PROOF STEP]
proof (intro allI impI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>\<alpha> \<beta>. \<lbrakk>\<forall>x. v \<noteq> x \<longrightarrow> \<alpha> x = \<beta> x; pos_assign \<beta>; \<beta> v \<le> \<alpha> v\<rbrakk> \<Longrightarrow> eval_poly \<beta> p \<le> eval_poly \<alpha> p
[PROOF STEP]
fix \<alpha> \<beta> :: "('v,'a)assign"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>\<alpha> \<beta>. \<lbrakk>\<forall>x. v \<noteq> x \<longrightarrow> \<alpha> x = \<beta> x; pos_assign \<beta>; \<beta> v \<le> \<alpha> v\<rbrakk> \<Longrightarrow> eval_poly \<beta> p \<le> eval_poly \<alpha> p
[PROOF STEP]
assume all: "\<forall>x. v \<noteq> x \<longrightarrow> \<alpha> x = \<beta> x"
[PROOF STATE]
proof (state)
this:
\<forall>x. v \<noteq> x \<longrightarrow> \<alpha> x = \<beta> x

goal (1 subgoal):
 1. \<And>\<alpha> \<beta>. \<lbrakk>\<forall>x. v \<noteq> x \<longrightarrow> \<alpha> x = \<beta> x; pos_assign \<beta>; \<beta> v \<le> \<alpha> v\<rbrakk> \<Longrightarrow> eval_poly \<beta> p \<le> eval_poly \<alpha> p
[PROOF STEP]
assume pos: "pos_assign \<beta>"
[PROOF STATE]
proof (state)
this:
pos_assign \<beta>

goal (1 subgoal):
 1. \<And>\<alpha> \<beta>. \<lbrakk>\<forall>x. v \<noteq> x \<longrightarrow> \<alpha> x = \<beta> x; pos_assign \<beta>; \<beta> v \<le> \<alpha> v\<rbrakk> \<Longrightarrow> eval_poly \<beta> p \<le> eval_poly \<alpha> p
[PROOF STEP]
assume v: "\<alpha> v \<ge> \<beta> v"
[PROOF STATE]
proof (state)
this:
\<beta> v \<le> \<alpha> v

goal (1 subgoal):
 1. \<And>\<alpha> \<beta>. \<lbrakk>\<forall>x. v \<noteq> x \<longrightarrow> \<alpha> x = \<beta> x; pos_assign \<beta>; \<beta> v \<le> \<alpha> v\<rbrakk> \<Longrightarrow> eval_poly \<beta> p \<le> eval_poly \<alpha> p
[PROOF STEP]
show "eval_poly \<alpha> p \<ge> eval_poly \<beta> p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eval_poly \<beta> p \<le> eval_poly \<alpha> p
[PROOF STEP]
proof (rule p[unfolded poly_weak_mono_all_def, rule_format, OF _ pos])
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. \<beta> x \<le> \<alpha> x
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. \<beta> x \<le> \<alpha> x
[PROOF STEP]
show "\<alpha> x \<ge> \<beta> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<beta> x \<le> \<alpha> x
[PROOF STEP]
using v all ge_refl[of "\<beta> x"]
[PROOF STATE]
proof (prove)
using this:
\<beta> v \<le> \<alpha> v
\<forall>x. v \<noteq> x \<longrightarrow> \<alpha> x = \<beta> x
\<beta> x \<le> \<beta> x

goal (1 subgoal):
 1. \<beta> x \<le> \<alpha> x
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<beta> x \<le> \<alpha> x

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
eval_poly \<beta> p \<le> eval_poly \<alpha> p

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma irreducible_hom_imp_irreducible:
    assumes irr: "irreducible (hom a)" shows "irreducible a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. irreducible a
[PROOF STEP]
proof (intro irreducibleI)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. a \<noteq> (0::'a)
 2. \<not> a dvd (1::'a)
 3. \<And>aa b. a = aa * b \<Longrightarrow> aa dvd (1::'a) \<or> b dvd (1::'a)
[PROOF STEP]
from irr
[PROOF STATE]
proof (chain)
picking this:
irreducible (hom a)
[PROOF STEP]
show "a \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
irreducible (hom a)

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

goal (2 subgoals):
 1. \<not> a dvd (1::'a)
 2. \<And>aa b. a = aa * b \<Longrightarrow> aa dvd (1::'a) \<or> b dvd (1::'a)
[PROOF STEP]
from irr
[PROOF STATE]
proof (chain)
picking this:
irreducible (hom a)
[PROOF STEP]
show "\<not> a dvd 1"
[PROOF STATE]
proof (prove)
using this:
irreducible (hom a)

goal (1 subgoal):
 1. \<not> a dvd (1::'a)
[PROOF STEP]
by (auto dest: irreducible_not_unit)
[PROOF STATE]
proof (state)
this:
\<not> a dvd (1::'a)

goal (1 subgoal):
 1. \<And>aa b. a = aa * b \<Longrightarrow> aa dvd (1::'a) \<or> b dvd (1::'a)
[PROOF STEP]
fix b c
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>aa b. a = aa * b \<Longrightarrow> aa dvd (1::'a) \<or> b dvd (1::'a)
[PROOF STEP]
assume "a = b * c"
[PROOF STATE]
proof (state)
this:
a = b * c

goal (1 subgoal):
 1. \<And>aa b. a = aa * b \<Longrightarrow> aa dvd (1::'a) \<or> b dvd (1::'a)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a = b * c
[PROOF STEP]
have "hom a = hom b * hom c"
[PROOF STATE]
proof (prove)
using this:
a = b * c

goal (1 subgoal):
 1. hom a = hom b * hom c
[PROOF STEP]
by (simp add: hom_distribs)
[PROOF STATE]
proof (state)
this:
hom a = hom b * hom c

goal (1 subgoal):
 1. \<And>aa b. a = aa * b \<Longrightarrow> aa dvd (1::'a) \<or> b dvd (1::'a)
[PROOF STEP]
with irr
[PROOF STATE]
proof (chain)
picking this:
irreducible (hom a)
hom a = hom b * hom c
[PROOF STEP]
have "hom b dvd 1 \<or> hom c dvd 1"
[PROOF STATE]
proof (prove)
using this:
irreducible (hom a)
hom a = hom b * hom c

goal (1 subgoal):
 1. hom b dvd (1::'b) \<or> hom c dvd (1::'b)
[PROOF STEP]
by (auto dest: irreducibleD)
[PROOF STATE]
proof (state)
this:
hom b dvd (1::'b) \<or> hom c dvd (1::'b)

goal (1 subgoal):
 1. \<And>aa b. a = aa * b \<Longrightarrow> aa dvd (1::'a) \<or> b dvd (1::'a)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
hom b dvd (1::'b) \<or> hom c dvd (1::'b)
[PROOF STEP]
show "b dvd 1 \<or> c dvd 1"
[PROOF STATE]
proof (prove)
using this:
hom b dvd (1::'b) \<or> hom c dvd (1::'b)

goal (1 subgoal):
 1. b dvd (1::'a) \<or> c dvd (1::'a)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
b dvd (1::'a) \<or> c dvd (1::'a)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma summable_LIMSEQ': "summable f \<Longrightarrow> (\<lambda>n. \<Sum>i\<le>n. f i) \<longlonglongrightarrow> suminf f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. summable f \<Longrightarrow> (\<lambda>n. sum f {..n}) \<longlonglongrightarrow> suminf f
[PROOF STEP]
using sums_def_le
[PROOF STATE]
proof (prove)
using this:
?f sums ?s = (\<lambda>n. sum ?f {..n}) \<longlonglongrightarrow> ?s

goal (1 subgoal):
 1. summable f \<Longrightarrow> (\<lambda>n. sum f {..n}) \<longlonglongrightarrow> suminf f
[PROOF STEP]
by blast


[STATEMENT]
lemma sequentially_even_odd:
  assumes E: "eventually (\<lambda>n. P (2 * n)) sequentially" and O: "eventually (\<lambda>n. P (2 * n + 1)) sequentially"
  shows "eventually P sequentially"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eventually P sequentially
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. eventually P sequentially
[PROOF STEP]
from E
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F n in sequentially. P (2 * n)
[PROOF STEP]
obtain n_e where [intro]: "\<And>n. n \<ge> n_e \<Longrightarrow> P (2 * n)"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F n in sequentially. P (2 * n)

goal (1 subgoal):
 1. (\<And>n_e. (\<And>n. n_e \<le> n \<Longrightarrow> P (2 * n)) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp: eventually_sequentially)
[PROOF STATE]
proof (state)
this:
n_e \<le> ?n \<Longrightarrow> P (2 * ?n)

goal (1 subgoal):
 1. eventually P sequentially
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
n_e \<le> ?n \<Longrightarrow> P (2 * ?n)

goal (1 subgoal):
 1. eventually P sequentially
[PROOF STEP]
from O
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F n in sequentially. P (2 * n + 1)
[PROOF STEP]
obtain n_o where [intro]: "\<And>n. n \<ge> n_o \<Longrightarrow> P (Suc (2 * n))"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F n in sequentially. P (2 * n + 1)

goal (1 subgoal):
 1. (\<And>n_o. (\<And>n. n_o \<le> n \<Longrightarrow> P (Suc (2 * n))) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp: eventually_sequentially)
[PROOF STATE]
proof (state)
this:
n_o \<le> ?n \<Longrightarrow> P (Suc (2 * ?n))

goal (1 subgoal):
 1. eventually P sequentially
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eventually P sequentially
[PROOF STEP]
unfolding eventually_sequentially
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>N. \<forall>n\<ge>N. P n
[PROOF STEP]
proof (intro exI allI impI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. ?N \<le> n \<Longrightarrow> P n
[PROOF STEP]
fix n
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. ?N \<le> n \<Longrightarrow> P n
[PROOF STEP]
assume "max (2 * n_e) (2 * n_o + 1) \<le> n"
[PROOF STATE]
proof (state)
this:
max (2 * n_e) (2 * n_o + 1) \<le> n

goal (1 subgoal):
 1. \<And>n. ?N \<le> n \<Longrightarrow> P n
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
max (2 * n_e) (2 * n_o + 1) \<le> n
[PROOF STEP]
show "P n"
[PROOF STATE]
proof (prove)
using this:
max (2 * n_e) (2 * n_o + 1) \<le> n

goal (1 subgoal):
 1. P n
[PROOF STEP]
by (cases "even n") (auto elim!: evenE oddE )
[PROOF STATE]
proof (state)
this:
P n

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
eventually P sequentially

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma foldr_elem_check:
  assumes "list.set xs \<subseteq> A"
  shows "foldr (\<lambda> x y . if x \<notin> A then y else f x y) xs v = foldr f xs v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. foldr (\<lambda>x y. if x \<notin> A then y else f x y) xs v = foldr f xs v
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
set xs \<subseteq> A

goal (1 subgoal):
 1. foldr (\<lambda>x y. if x \<notin> A then y else f x y) xs v = foldr f xs v
[PROOF STEP]
by (induction xs; auto)


[STATEMENT]
lemma set_sublist_list_eq_set_sublist: "
  list_all (\<lambda>i. i < length xs) ys \<Longrightarrow>
  set (sublist_list xs ys) = set (nths xs (set ys))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. list_all (\<lambda>i. i < length xs) ys \<Longrightarrow> set (sublist_list xs ys) = set (nths xs (set ys))
[PROOF STEP]
by (simp add: sublist_list_if_sublist_list_eq[symmetric] set_sublist_list_if_eq_set_sublist)


[STATEMENT]
lemma geodesic_subsetI:
  assumes "\<And>x y. x \<in> S \<Longrightarrow> y \<in> S \<Longrightarrow> \<exists>G. geodesic_segment_between G x y \<and> G \<subseteq> S"
  shows "geodesic_subset S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. geodesic_subset S
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?x \<in> S; ?y \<in> S\<rbrakk> \<Longrightarrow> \<exists>G. geodesic_segment_between G ?x ?y \<and> G \<subseteq> S

goal (1 subgoal):
 1. geodesic_subset S
[PROOF STEP]
unfolding geodesic_subset_def
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?x \<in> S; ?y \<in> S\<rbrakk> \<Longrightarrow> \<exists>G. geodesic_segment_between G ?x ?y \<and> G \<subseteq> S

goal (1 subgoal):
 1. \<forall>x\<in>S. \<forall>y\<in>S. \<exists>G. geodesic_segment_between G x y \<and> G \<subseteq> S
[PROOF STEP]
by auto


[STATEMENT]
lemma sum_indicator_disjoint_family:
  fixes f :: "'d \<Rightarrow> 'e::semiring_1"
  assumes d: "disjoint_family_on A P" and "x \<in> A j" and "finite P" and "j \<in> P"
  shows "(\<Sum>i\<in>P. f i * indicator (A i) x) = f j"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i\<in>P. f i * indicator (A i) x) = f j
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<Sum>i\<in>P. f i * indicator (A i) x) = f j
[PROOF STEP]
have "P \<inter> {i. x \<in> A i} = {j}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P \<inter> {i. x \<in> A i} = {j}
[PROOF STEP]
using d \<open>x \<in> A j\<close> \<open>j \<in> P\<close>
[PROOF STATE]
proof (prove)
using this:
disjoint_family_on A P
x \<in> A j
j \<in> P

goal (1 subgoal):
 1. P \<inter> {i. x \<in> A i} = {j}
[PROOF STEP]
unfolding disjoint_family_on_def
[PROOF STATE]
proof (prove)
using this:
\<forall>m\<in>P. \<forall>n\<in>P. m \<noteq> n \<longrightarrow> A m \<inter> A n = {}
x \<in> A j
j \<in> P

goal (1 subgoal):
 1. P \<inter> {i. x \<in> A i} = {j}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
P \<inter> {i. x \<in> A i} = {j}

goal (1 subgoal):
 1. (\<Sum>i\<in>P. f i * indicator (A i) x) = f j
[PROOF STEP]
with \<open>finite P\<close>
[PROOF STATE]
proof (chain)
picking this:
finite P
P \<inter> {i. x \<in> A i} = {j}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
finite P
P \<inter> {i. x \<in> A i} = {j}

goal (1 subgoal):
 1. (\<Sum>i\<in>P. f i * indicator (A i) x) = f j
[PROOF STEP]
by (simp add: indicator_def)
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<in>P. f i * indicator (A i) x) = f j

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma unstream_tl_trans_True: "unstream (tl_trans g) (True, s) = unstream g s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. unstream (tl_trans g) (True, s) = unstream g s
[PROOF STEP]
proof(induction s taking: g rule: unstream.induct)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>s. \<lbrakk>\<And>x2. generator g s = Skip x2 \<Longrightarrow> unstream (tl_trans g) (True, x2) = unstream g x2; \<And>x31 x32. generator g s = Yield x31 x32 \<Longrightarrow> unstream (tl_trans g) (True, x32) = unstream g x32\<rbrakk> \<Longrightarrow> unstream (tl_trans g) (True, s) = unstream g s
[PROOF STEP]
case (1 s)
[PROOF STATE]
proof (state)
this:
generator g s = Skip ?x2.0 \<Longrightarrow> unstream (tl_trans g) (True, ?x2.0) = unstream g ?x2.0
generator g s = Yield ?x31.0 ?x32.0 \<Longrightarrow> unstream (tl_trans g) (True, ?x32.0) = unstream g ?x32.0

goal (1 subgoal):
 1. \<And>s. \<lbrakk>\<And>x2. generator g s = Skip x2 \<Longrightarrow> unstream (tl_trans g) (True, x2) = unstream g x2; \<And>x31 x32. generator g s = Yield x31 x32 \<Longrightarrow> unstream (tl_trans g) (True, x32) = unstream g x32\<rbrakk> \<Longrightarrow> unstream (tl_trans g) (True, s) = unstream g s
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. unstream (tl_trans g) (True, s) = unstream g s
[PROOF STEP]
using "1.IH"
[PROOF STATE]
proof (prove)
using this:
generator g s = Skip ?x2.0 \<Longrightarrow> unstream (tl_trans g) (True, ?x2.0) = unstream g ?x2.0
generator g s = Yield ?x31.0 ?x32.0 \<Longrightarrow> unstream (tl_trans g) (True, ?x32.0) = unstream g ?x32.0

goal (1 subgoal):
 1. unstream (tl_trans g) (True, s) = unstream g s
[PROOF STEP]
by (cases "generator g s")(simp_all add: tl_trans.rep_eq)
[PROOF STATE]
proof (state)
this:
unstream (tl_trans g) (True, s) = unstream g s

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma deg_fun_plus:
  assumes "finite (supp_fun s)" and "finite (supp_fun t)"
  shows "deg_fun (s + t) = deg_fun s + deg_fun (t::'a \<Rightarrow> 'b::comm_monoid_add)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. deg_fun (s + t) = deg_fun s + deg_fun t
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. deg_fun (s + t) = deg_fun s + deg_fun t
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
finite (supp_fun s)
finite (supp_fun t)
[PROOF STEP]
have fin: "finite (supp_fun s \<union> supp_fun t)"
[PROOF STATE]
proof (prove)
using this:
finite (supp_fun s)
finite (supp_fun t)

goal (1 subgoal):
 1. finite (supp_fun s \<union> supp_fun t)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
finite (supp_fun s \<union> supp_fun t)

goal (1 subgoal):
 1. deg_fun (s + t) = deg_fun s + deg_fun t
[PROOF STEP]
have "deg_fun (s + t) = (\<Sum>x\<in>(supp_fun (s + t)). s x + t x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. deg_fun (s + t) = (\<Sum>x\<in>supp_fun (s + t). s x + t x)
[PROOF STEP]
by (simp add: deg_fun_def)
[PROOF STATE]
proof (state)
this:
deg_fun (s + t) = (\<Sum>x\<in>supp_fun (s + t). s x + t x)

goal (1 subgoal):
 1. deg_fun (s + t) = deg_fun s + deg_fun t
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
deg_fun (s + t) = (\<Sum>x\<in>supp_fun (s + t). s x + t x)

goal (1 subgoal):
 1. deg_fun (s + t) = deg_fun s + deg_fun t
[PROOF STEP]
from fin
[PROOF STATE]
proof (chain)
picking this:
finite (supp_fun s \<union> supp_fun t)
[PROOF STEP]
have "... = (\<Sum>x\<in>(supp_fun s \<union> supp_fun t). s x + t x)"
[PROOF STATE]
proof (prove)
using this:
finite (supp_fun s \<union> supp_fun t)

goal (1 subgoal):
 1. (\<Sum>x\<in>supp_fun (s + t). s x + t x) = (\<Sum>x\<in>supp_fun s \<union> supp_fun t. s x + t x)
[PROOF STEP]
proof (rule sum.mono_neutral_cong_left)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. supp_fun (s + t) \<subseteq> supp_fun s \<union> supp_fun t
 2. \<forall>i\<in>supp_fun s \<union> supp_fun t - supp_fun (s + t). s i + t i = (0::'b)
 3. \<And>x. x \<in> supp_fun (s + t) \<Longrightarrow> s x + t x = s x + t x
[PROOF STEP]
show "\<forall>x\<in>supp_fun s \<union> supp_fun t - supp_fun (s + t). s x + t x = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>supp_fun s \<union> supp_fun t - supp_fun (s + t). s x + t x = (0::'b)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> supp_fun s \<union> supp_fun t - supp_fun (s + t) \<Longrightarrow> s x + t x = (0::'b)
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> supp_fun s \<union> supp_fun t - supp_fun (s + t) \<Longrightarrow> s x + t x = (0::'b)
[PROOF STEP]
assume "x \<in> supp_fun s \<union> supp_fun t - supp_fun (s + t)"
[PROOF STATE]
proof (state)
this:
x \<in> supp_fun s \<union> supp_fun t - supp_fun (s + t)

goal (1 subgoal):
 1. \<And>x. x \<in> supp_fun s \<union> supp_fun t - supp_fun (s + t) \<Longrightarrow> s x + t x = (0::'b)
[PROOF STEP]
hence "x \<notin> supp_fun (s + t)"
[PROOF STATE]
proof (prove)
using this:
x \<in> supp_fun s \<union> supp_fun t - supp_fun (s + t)

goal (1 subgoal):
 1. x \<notin> supp_fun (s + t)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
x \<notin> supp_fun (s + t)

goal (1 subgoal):
 1. \<And>x. x \<in> supp_fun s \<union> supp_fun t - supp_fun (s + t) \<Longrightarrow> s x + t x = (0::'b)
[PROOF STEP]
thus "s x + t x = 0"
[PROOF STATE]
proof (prove)
using this:
x \<notin> supp_fun (s + t)

goal (1 subgoal):
 1. s x + t x = (0::'b)
[PROOF STEP]
by (simp add: supp_fun_def)
[PROOF STATE]
proof (state)
this:
s x + t x = (0::'b)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>x\<in>supp_fun s \<union> supp_fun t - supp_fun (s + t). s x + t x = (0::'b)

goal (2 subgoals):
 1. supp_fun (s + t) \<subseteq> supp_fun s \<union> supp_fun t
 2. \<And>x. x \<in> supp_fun (s + t) \<Longrightarrow> s x + t x = s x + t x
[PROOF STEP]
qed (rule supp_fun_plus_subset, rule)
[PROOF STATE]
proof (state)
this:
(\<Sum>x\<in>supp_fun (s + t). s x + t x) = (\<Sum>x\<in>supp_fun s \<union> supp_fun t. s x + t x)

goal (1 subgoal):
 1. deg_fun (s + t) = deg_fun s + deg_fun t
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>x\<in>supp_fun (s + t). s x + t x) = (\<Sum>x\<in>supp_fun s \<union> supp_fun t. s x + t x)

goal (1 subgoal):
 1. deg_fun (s + t) = deg_fun s + deg_fun t
[PROOF STEP]
have "\<dots> = (\<Sum>x\<in>(supp_fun s \<union> supp_fun t). s x) + (\<Sum>x\<in>(supp_fun s \<union> supp_fun t). t x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>x\<in>supp_fun s \<union> supp_fun t. s x + t x) = sum s (supp_fun s \<union> supp_fun t) + sum t (supp_fun s \<union> supp_fun t)
[PROOF STEP]
by (rule sum.distrib)
[PROOF STATE]
proof (state)
this:
(\<Sum>x\<in>supp_fun s \<union> supp_fun t. s x + t x) = sum s (supp_fun s \<union> supp_fun t) + sum t (supp_fun s \<union> supp_fun t)

goal (1 subgoal):
 1. deg_fun (s + t) = deg_fun s + deg_fun t
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>x\<in>supp_fun s \<union> supp_fun t. s x + t x) = sum s (supp_fun s \<union> supp_fun t) + sum t (supp_fun s \<union> supp_fun t)

goal (1 subgoal):
 1. deg_fun (s + t) = deg_fun s + deg_fun t
[PROOF STEP]
from fin
[PROOF STATE]
proof (chain)
picking this:
finite (supp_fun s \<union> supp_fun t)
[PROOF STEP]
have "(\<Sum>x\<in>(supp_fun s \<union> supp_fun t). s x) = deg_fun s"
[PROOF STATE]
proof (prove)
using this:
finite (supp_fun s \<union> supp_fun t)

goal (1 subgoal):
 1. sum s (supp_fun s \<union> supp_fun t) = deg_fun s
[PROOF STEP]
unfolding deg_fun_def
[PROOF STATE]
proof (prove)
using this:
finite (supp_fun s \<union> supp_fun t)

goal (1 subgoal):
 1. sum s (supp_fun s \<union> supp_fun t) = sum s (supp_fun s)
[PROOF STEP]
proof (rule sum.mono_neutral_cong_right)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. supp_fun s \<subseteq> supp_fun s \<union> supp_fun t
 2. \<forall>i\<in>supp_fun s \<union> supp_fun t - supp_fun s. s i = (0::'b)
 3. \<And>x. x \<in> supp_fun s \<Longrightarrow> s x = s x
[PROOF STEP]
show "\<forall>x\<in>supp_fun s \<union> supp_fun t - supp_fun s. s x = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>supp_fun s \<union> supp_fun t - supp_fun s. s x = (0::'b)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> supp_fun s \<union> supp_fun t - supp_fun s \<Longrightarrow> s x = (0::'b)
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> supp_fun s \<union> supp_fun t - supp_fun s \<Longrightarrow> s x = (0::'b)
[PROOF STEP]
assume "x \<in> supp_fun s \<union> supp_fun t - supp_fun s"
[PROOF STATE]
proof (state)
this:
x \<in> supp_fun s \<union> supp_fun t - supp_fun s

goal (1 subgoal):
 1. \<And>x. x \<in> supp_fun s \<union> supp_fun t - supp_fun s \<Longrightarrow> s x = (0::'b)
[PROOF STEP]
hence "x \<notin> supp_fun s"
[PROOF STATE]
proof (prove)
using this:
x \<in> supp_fun s \<union> supp_fun t - supp_fun s

goal (1 subgoal):
 1. x \<notin> supp_fun s
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
x \<notin> supp_fun s

goal (1 subgoal):
 1. \<And>x. x \<in> supp_fun s \<union> supp_fun t - supp_fun s \<Longrightarrow> s x = (0::'b)
[PROOF STEP]
thus "s x = 0"
[PROOF STATE]
proof (prove)
using this:
x \<notin> supp_fun s

goal (1 subgoal):
 1. s x = (0::'b)
[PROOF STEP]
by (simp add: supp_fun_def)
[PROOF STATE]
proof (state)
this:
s x = (0::'b)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>x\<in>supp_fun s \<union> supp_fun t - supp_fun s. s x = (0::'b)

goal (2 subgoals):
 1. supp_fun s \<subseteq> supp_fun s \<union> supp_fun t
 2. \<And>x. x \<in> supp_fun s \<Longrightarrow> s x = s x
[PROOF STEP]
qed simp_all
[PROOF STATE]
proof (state)
this:
sum s (supp_fun s \<union> supp_fun t) = deg_fun s

goal (1 subgoal):
 1. deg_fun (s + t) = deg_fun s + deg_fun t
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
sum s (supp_fun s \<union> supp_fun t) = deg_fun s

goal (1 subgoal):
 1. deg_fun (s + t) = deg_fun s + deg_fun t
[PROOF STEP]
from fin
[PROOF STATE]
proof (chain)
picking this:
finite (supp_fun s \<union> supp_fun t)
[PROOF STEP]
have "(\<Sum>x\<in>(supp_fun s \<union> supp_fun t). t x) = deg_fun t"
[PROOF STATE]
proof (prove)
using this:
finite (supp_fun s \<union> supp_fun t)

goal (1 subgoal):
 1. sum t (supp_fun s \<union> supp_fun t) = deg_fun t
[PROOF STEP]
unfolding deg_fun_def
[PROOF STATE]
proof (prove)
using this:
finite (supp_fun s \<union> supp_fun t)

goal (1 subgoal):
 1. sum t (supp_fun s \<union> supp_fun t) = sum t (supp_fun t)
[PROOF STEP]
proof (rule sum.mono_neutral_cong_right)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. supp_fun t \<subseteq> supp_fun s \<union> supp_fun t
 2. \<forall>i\<in>supp_fun s \<union> supp_fun t - supp_fun t. t i = (0::'b)
 3. \<And>x. x \<in> supp_fun t \<Longrightarrow> t x = t x
[PROOF STEP]
show "\<forall>x\<in>supp_fun s \<union> supp_fun t - supp_fun t. t x = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>supp_fun s \<union> supp_fun t - supp_fun t. t x = (0::'b)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> supp_fun s \<union> supp_fun t - supp_fun t \<Longrightarrow> t x = (0::'b)
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> supp_fun s \<union> supp_fun t - supp_fun t \<Longrightarrow> t x = (0::'b)
[PROOF STEP]
assume "x \<in> supp_fun s \<union> supp_fun t - supp_fun t"
[PROOF STATE]
proof (state)
this:
x \<in> supp_fun s \<union> supp_fun t - supp_fun t

goal (1 subgoal):
 1. \<And>x. x \<in> supp_fun s \<union> supp_fun t - supp_fun t \<Longrightarrow> t x = (0::'b)
[PROOF STEP]
hence "x \<notin> supp_fun t"
[PROOF STATE]
proof (prove)
using this:
x \<in> supp_fun s \<union> supp_fun t - supp_fun t

goal (1 subgoal):
 1. x \<notin> supp_fun t
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
x \<notin> supp_fun t

goal (1 subgoal):
 1. \<And>x. x \<in> supp_fun s \<union> supp_fun t - supp_fun t \<Longrightarrow> t x = (0::'b)
[PROOF STEP]
thus "t x = 0"
[PROOF STATE]
proof (prove)
using this:
x \<notin> supp_fun t

goal (1 subgoal):
 1. t x = (0::'b)
[PROOF STEP]
by (simp add: supp_fun_def)
[PROOF STATE]
proof (state)
this:
t x = (0::'b)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>x\<in>supp_fun s \<union> supp_fun t - supp_fun t. t x = (0::'b)

goal (2 subgoals):
 1. supp_fun t \<subseteq> supp_fun s \<union> supp_fun t
 2. \<And>x. x \<in> supp_fun t \<Longrightarrow> t x = t x
[PROOF STEP]
qed simp_all
[PROOF STATE]
proof (state)
this:
sum t (supp_fun s \<union> supp_fun t) = deg_fun t

goal (1 subgoal):
 1. deg_fun (s + t) = deg_fun s + deg_fun t
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
deg_fun (s + t) = deg_fun s + deg_fun t
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
deg_fun (s + t) = deg_fun s + deg_fun t

goal (1 subgoal):
 1. deg_fun (s + t) = deg_fun s + deg_fun t
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
deg_fun (s + t) = deg_fun s + deg_fun t

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma conv_radius_norm [simp]: "conv_radius (\<lambda>x. norm (f x)) = conv_radius f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. conv_radius (\<lambda>x. norm (f x)) = conv_radius f
[PROOF STEP]
by (simp add: conv_radius_def)


[STATEMENT]
lemma image_sequence_of_inj:
  assumes "bij_betw enum {0..<card A} A"
  shows "sequence_of A enum ` {f \<in> A \<rightarrow>\<^sub>E B. inj_on f A} \<subseteq> {xs. set xs \<subseteq> B \<and> length xs = card A \<and> distinct xs}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sequence_of A enum ` {f \<in> A \<rightarrow>\<^sub>E B. inj_on f A} \<subseteq> {xs. set xs \<subseteq> B \<and> length xs = card A \<and> distinct xs}
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> sequence_of A enum ` {f \<in> A \<rightarrow>\<^sub>E B. inj_on f A} \<Longrightarrow> x \<in> {xs. set xs \<subseteq> B \<and> length xs = card A \<and> distinct xs}
[PROOF STEP]
fix xs
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> sequence_of A enum ` {f \<in> A \<rightarrow>\<^sub>E B. inj_on f A} \<Longrightarrow> x \<in> {xs. set xs \<subseteq> B \<and> length xs = card A \<and> distinct xs}
[PROOF STEP]
assume "xs \<in> sequence_of A enum ` {f \<in> A \<rightarrow>\<^sub>E B. inj_on f A}"
[PROOF STATE]
proof (state)
this:
xs \<in> sequence_of A enum ` {f \<in> A \<rightarrow>\<^sub>E B. inj_on f A}

goal (1 subgoal):
 1. \<And>x. x \<in> sequence_of A enum ` {f \<in> A \<rightarrow>\<^sub>E B. inj_on f A} \<Longrightarrow> x \<in> {xs. set xs \<subseteq> B \<and> length xs = card A \<and> distinct xs}
[PROOF STEP]
from this
[PROOF STATE]
proof (chain)
picking this:
xs \<in> sequence_of A enum ` {f \<in> A \<rightarrow>\<^sub>E B. inj_on f A}
[PROOF STEP]
obtain f where xs: "xs = sequence_of A enum f" and f: "f \<in> A \<rightarrow>\<^sub>E B" "inj_on f A"
[PROOF STATE]
proof (prove)
using this:
xs \<in> sequence_of A enum ` {f \<in> A \<rightarrow>\<^sub>E B. inj_on f A}

goal (1 subgoal):
 1. (\<And>f. \<lbrakk>xs = sequence_of A enum f; f \<in> A \<rightarrow>\<^sub>E B; inj_on f A\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
xs = sequence_of A enum f
f \<in> A \<rightarrow>\<^sub>E B
inj_on f A

goal (1 subgoal):
 1. \<And>x. x \<in> sequence_of A enum ` {f \<in> A \<rightarrow>\<^sub>E B. inj_on f A} \<Longrightarrow> x \<in> {xs. set xs \<subseteq> B \<and> length xs = card A \<and> distinct xs}
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
xs = sequence_of A enum f
f \<in> A \<rightarrow>\<^sub>E B
inj_on f A

goal (1 subgoal):
 1. \<And>x. x \<in> sequence_of A enum ` {f \<in> A \<rightarrow>\<^sub>E B. inj_on f A} \<Longrightarrow> x \<in> {xs. set xs \<subseteq> B \<and> length xs = card A \<and> distinct xs}
[PROOF STEP]
from xs f \<open>bij_betw _ _ _\<close>
[PROOF STATE]
proof (chain)
picking this:
xs = sequence_of A enum f
f \<in> A \<rightarrow>\<^sub>E B
inj_on f A
bij_betw enum {0..<card A} A
[PROOF STEP]
have "set xs \<subseteq> B"
[PROOF STATE]
proof (prove)
using this:
xs = sequence_of A enum f
f \<in> A \<rightarrow>\<^sub>E B
inj_on f A
bij_betw enum {0..<card A} A

goal (1 subgoal):
 1. set xs \<subseteq> B
[PROOF STEP]
using set_sequence_of subsetCE
[PROOF STATE]
proof (prove)
using this:
xs = sequence_of A enum f
f \<in> A \<rightarrow>\<^sub>E B
inj_on f A
bij_betw enum {0..<card A} A
\<lbrakk>bij_betw ?enum {0..<card ?A} ?A; ?f \<in> ?A \<rightarrow>\<^sub>E ?B\<rbrakk> \<Longrightarrow> set (sequence_of ?A ?enum ?f) \<subseteq> ?B
\<lbrakk>?A \<subseteq> ?B; ?c \<notin> ?A \<Longrightarrow> ?P; ?c \<in> ?B \<Longrightarrow> ?P\<rbrakk> \<Longrightarrow> ?P

goal (1 subgoal):
 1. set xs \<subseteq> B
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
set xs \<subseteq> B

goal (1 subgoal):
 1. \<And>x. x \<in> sequence_of A enum ` {f \<in> A \<rightarrow>\<^sub>E B. inj_on f A} \<Longrightarrow> x \<in> {xs. set xs \<subseteq> B \<and> length xs = card A \<and> distinct xs}
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
set xs \<subseteq> B

goal (1 subgoal):
 1. \<And>x. x \<in> sequence_of A enum ` {f \<in> A \<rightarrow>\<^sub>E B. inj_on f A} \<Longrightarrow> x \<in> {xs. set xs \<subseteq> B \<and> length xs = card A \<and> distinct xs}
[PROOF STEP]
from xs f \<open>bij_betw _ _ _\<close>
[PROOF STATE]
proof (chain)
picking this:
xs = sequence_of A enum f
f \<in> A \<rightarrow>\<^sub>E B
inj_on f A
bij_betw enum {0..<card A} A
[PROOF STEP]
have "length xs = card A"
[PROOF STATE]
proof (prove)
using this:
xs = sequence_of A enum f
f \<in> A \<rightarrow>\<^sub>E B
inj_on f A
bij_betw enum {0..<card A} A

goal (1 subgoal):
 1. length xs = card A
[PROOF STEP]
using length_sequence_of
[PROOF STATE]
proof (prove)
using this:
xs = sequence_of A enum f
f \<in> A \<rightarrow>\<^sub>E B
inj_on f A
bij_betw enum {0..<card A} A
\<lbrakk>bij_betw ?enum {0..<card ?A} ?A; ?f \<in> ?A \<rightarrow>\<^sub>E ?B\<rbrakk> \<Longrightarrow> length (sequence_of ?A ?enum ?f) = card ?A

goal (1 subgoal):
 1. length xs = card A
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
length xs = card A

goal (1 subgoal):
 1. \<And>x. x \<in> sequence_of A enum ` {f \<in> A \<rightarrow>\<^sub>E B. inj_on f A} \<Longrightarrow> x \<in> {xs. set xs \<subseteq> B \<and> length xs = card A \<and> distinct xs}
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
length xs = card A

goal (1 subgoal):
 1. \<And>x. x \<in> sequence_of A enum ` {f \<in> A \<rightarrow>\<^sub>E B. inj_on f A} \<Longrightarrow> x \<in> {xs. set xs \<subseteq> B \<and> length xs = card A \<and> distinct xs}
[PROOF STEP]
from xs f \<open>bij_betw _ _ _\<close>
[PROOF STATE]
proof (chain)
picking this:
xs = sequence_of A enum f
f \<in> A \<rightarrow>\<^sub>E B
inj_on f A
bij_betw enum {0..<card A} A
[PROOF STEP]
have "distinct xs"
[PROOF STATE]
proof (prove)
using this:
xs = sequence_of A enum f
f \<in> A \<rightarrow>\<^sub>E B
inj_on f A
bij_betw enum {0..<card A} A

goal (1 subgoal):
 1. distinct xs
[PROOF STEP]
using inj_on_implies_distinct
[PROOF STATE]
proof (prove)
using this:
xs = sequence_of A enum f
f \<in> A \<rightarrow>\<^sub>E B
inj_on f A
bij_betw enum {0..<card A} A
\<lbrakk>bij_betw ?enum {0..<card ?A} ?A; ?f \<in> ?A \<rightarrow>\<^sub>E ?B; inj_on ?f ?A\<rbrakk> \<Longrightarrow> distinct (sequence_of ?A ?enum ?f)

goal (1 subgoal):
 1. distinct xs
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
distinct xs

goal (1 subgoal):
 1. \<And>x. x \<in> sequence_of A enum ` {f \<in> A \<rightarrow>\<^sub>E B. inj_on f A} \<Longrightarrow> x \<in> {xs. set xs \<subseteq> B \<and> length xs = card A \<and> distinct xs}
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
xs = sequence_of A enum f
f \<in> A \<rightarrow>\<^sub>E B
inj_on f A
set xs \<subseteq> B
length xs = card A
distinct xs
[PROOF STEP]
show "xs \<in> {xs. set xs \<subseteq> B \<and> length xs = card A \<and> distinct xs}"
[PROOF STATE]
proof (prove)
using this:
xs = sequence_of A enum f
f \<in> A \<rightarrow>\<^sub>E B
inj_on f A
set xs \<subseteq> B
length xs = card A
distinct xs

goal (1 subgoal):
 1. xs \<in> {xs. set xs \<subseteq> B \<and> length xs = card A \<and> distinct xs}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
xs \<in> {xs. set xs \<subseteq> B \<and> length xs = card A \<and> distinct xs}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma liftablepE[elim]:
    assumes "liftablep r f"
    assumes "r x y"
    obtains "r (f x) (f y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (r (f x) (f y) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
liftablep r f
r x y

goal (1 subgoal):
 1. (r (f x) (f y) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding liftablep_def
[PROOF STATE]
proof (prove)
using this:
\<forall>x y. r x y \<longrightarrow> r (f x) (f y)
r x y

goal (1 subgoal):
 1. (r (f x) (f y) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by simp


[STATEMENT]
lemma pullback_by_permutation_of_poly_list:
  assumes "\<sigma> permutes {..< n}"
  assumes "S \<subseteq> carrier (R\<^bsup>n\<^esup>)"
  shows "poly_tuple_pullback n S (permute_list \<sigma> (pvar_list R n)) =
          permute_list (fun_inv \<sigma>) ` S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly_tuple_pullback n S (permute_list \<sigma> (pvar_list R n)) = permute_list (fun_inv \<sigma>) ` S
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. poly_tuple_pullback n S (permute_list \<sigma> (pvar_list R n)) \<subseteq> permute_list (fun_inv \<sigma>) ` S
 2. permute_list (fun_inv \<sigma>) ` S \<subseteq> poly_tuple_pullback n S (permute_list \<sigma> (pvar_list R n))
[PROOF STEP]
show "poly_tuple_pullback n S (permute_list \<sigma> (pvar_list R n)) \<subseteq> permute_list (fun_inv \<sigma>) ` S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly_tuple_pullback n S (permute_list \<sigma> (pvar_list R n)) \<subseteq> permute_list (fun_inv \<sigma>) ` S
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> poly_tuple_pullback n S (permute_list \<sigma> (pvar_list R n)) \<Longrightarrow> x \<in> permute_list (fun_inv \<sigma>) ` S
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> poly_tuple_pullback n S (permute_list \<sigma> (pvar_list R n)) \<Longrightarrow> x \<in> permute_list (fun_inv \<sigma>) ` S
[PROOF STEP]
assume A: " x \<in> poly_tuple_pullback n S (permute_list \<sigma> (pvar_list R n))"
[PROOF STATE]
proof (state)
this:
x \<in> poly_tuple_pullback n S (permute_list \<sigma> (pvar_list R n))

goal (1 subgoal):
 1. \<And>x. x \<in> poly_tuple_pullback n S (permute_list \<sigma> (pvar_list R n)) \<Longrightarrow> x \<in> permute_list (fun_inv \<sigma>) ` S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<in> poly_tuple_pullback n S (permute_list \<sigma> (pvar_list R n))
[PROOF STEP]
obtain y where y_def: "y \<in> S \<and> poly_tuple_eval (permute_list \<sigma> (pvar_list R n)) x = y"
[PROOF STATE]
proof (prove)
using this:
x \<in> poly_tuple_pullback n S (permute_list \<sigma> (pvar_list R n))

goal (1 subgoal):
 1. (\<And>y. y \<in> S \<and> poly_tuple_eval (permute_list \<sigma> (pvar_list R n)) x = y \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis assms length_permute_list
           permutation_of_poly_list_is_poly_list poly_pullbackE'(2) pvar_list_is_poly_tuple
           pvar_list_length)
[PROOF STATE]
proof (state)
this:
y \<in> S \<and> poly_tuple_eval (permute_list \<sigma> (pvar_list R n)) x = y

goal (1 subgoal):
 1. \<And>x. x \<in> poly_tuple_pullback n S (permute_list \<sigma> (pvar_list R n)) \<Longrightarrow> x \<in> permute_list (fun_inv \<sigma>) ` S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
y \<in> S \<and> poly_tuple_eval (permute_list \<sigma> (pvar_list R n)) x = y
[PROOF STEP]
have 0: "y = permute_list \<sigma> x"
[PROOF STATE]
proof (prove)
using this:
y \<in> S \<and> poly_tuple_eval (permute_list \<sigma> (pvar_list R n)) x = y

goal (1 subgoal):
 1. y = permute_list \<sigma> x
[PROOF STEP]
by (metis A assms length_permute_list
           permutation_of_poly_list_is_poly_list poly_pullbackE'(1) pushforward_by_permuted_pvar_list pvar_list_is_poly_tuple pvar_list_length)
[PROOF STATE]
proof (state)
this:
y = permute_list \<sigma> x

goal (1 subgoal):
 1. \<And>x. x \<in> poly_tuple_pullback n S (permute_list \<sigma> (pvar_list R n)) \<Longrightarrow> x \<in> permute_list (fun_inv \<sigma>) ` S
[PROOF STEP]
have 1: "length x = n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length x = n
[PROOF STEP]
using A
[PROOF STATE]
proof (prove)
using this:
x \<in> poly_tuple_pullback n S (permute_list \<sigma> (pvar_list R n))

goal (1 subgoal):
 1. length x = n
[PROOF STEP]
by (metis "0" length_permute_list poly_tuple_evalE' pvar_list_length y_def)
[PROOF STATE]
proof (state)
this:
length x = n

goal (1 subgoal):
 1. \<And>x. x \<in> poly_tuple_pullback n S (permute_list \<sigma> (pvar_list R n)) \<Longrightarrow> x \<in> permute_list (fun_inv \<sigma>) ` S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
length x = n
[PROOF STEP]
have "{..<length x} = {..<n}"
[PROOF STATE]
proof (prove)
using this:
length x = n

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

goal (1 subgoal):
 1. \<And>x. x \<in> poly_tuple_pullback n S (permute_list \<sigma> (pvar_list R n)) \<Longrightarrow> x \<in> permute_list (fun_inv \<sigma>) ` S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
{..<length x} = {..<n}
[PROOF STEP]
have "permute_list (fun_inv \<sigma>) y = x"
[PROOF STATE]
proof (prove)
using this:
{..<length x} = {..<n}

goal (1 subgoal):
 1. permute_list (fun_inv \<sigma>) y = x
[PROOF STEP]
using 0 permutes_inv_o(1)[of \<sigma> "{..< n}"] permute_list_id[of x] permutes_inv[of \<sigma> "{..<n}"]
            assms permute_list_compose[of "(fun_inv \<sigma>)" x \<sigma> ]
[PROOF STATE]
proof (prove)
using this:
{..<length x} = {..<n}
y = permute_list \<sigma> x
\<sigma> permutes {..<n} \<Longrightarrow> \<sigma> \<circ> inv \<sigma> = id
permute_list id x = x
\<sigma> permutes {..<n} \<Longrightarrow> inv \<sigma> permutes {..<n}
\<sigma> permutes {..<n}
S \<subseteq> carrier (R\<^bsup>n\<^esup>)
fun_inv \<sigma> permutes {..<length x} \<Longrightarrow> permute_list (\<sigma> \<circ> fun_inv \<sigma>) x = permute_list (fun_inv \<sigma>) (permute_list \<sigma> x)

goal (1 subgoal):
 1. permute_list (fun_inv \<sigma>) y = x
[PROOF STEP]
unfolding fun_inv_def
[PROOF STATE]
proof (prove)
using this:
{..<length x} = {..<n}
y = permute_list \<sigma> x
\<sigma> permutes {..<n} \<Longrightarrow> \<sigma> \<circ> inv \<sigma> = id
permute_list id x = x
\<sigma> permutes {..<n} \<Longrightarrow> inv \<sigma> permutes {..<n}
\<sigma> permutes {..<n}
S \<subseteq> carrier (R\<^bsup>n\<^esup>)
inv \<sigma> permutes {..<length x} \<Longrightarrow> permute_list (\<sigma> \<circ> inv \<sigma>) x = permute_list (inv \<sigma>) (permute_list \<sigma> x)

goal (1 subgoal):
 1. permute_list (inv \<sigma>) y = x
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
permute_list (fun_inv \<sigma>) y = x

goal (1 subgoal):
 1. \<And>x. x \<in> poly_tuple_pullback n S (permute_list \<sigma> (pvar_list R n)) \<Longrightarrow> x \<in> permute_list (fun_inv \<sigma>) ` S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
permute_list (fun_inv \<sigma>) y = x
[PROOF STEP]
show " x \<in> permute_list (fun_inv \<sigma>) ` S"
[PROOF STATE]
proof (prove)
using this:
permute_list (fun_inv \<sigma>) y = x

goal (1 subgoal):
 1. x \<in> permute_list (fun_inv \<sigma>) ` S
[PROOF STEP]
using y_def
[PROOF STATE]
proof (prove)
using this:
permute_list (fun_inv \<sigma>) y = x
y \<in> S \<and> poly_tuple_eval (permute_list \<sigma> (pvar_list R n)) x = y

goal (1 subgoal):
 1. x \<in> permute_list (fun_inv \<sigma>) ` S
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
x \<in> permute_list (fun_inv \<sigma>) ` S

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
poly_tuple_pullback n S (permute_list \<sigma> (pvar_list R n)) \<subseteq> permute_list (fun_inv \<sigma>) ` S

goal (1 subgoal):
 1. permute_list (fun_inv \<sigma>) ` S \<subseteq> poly_tuple_pullback n S (permute_list \<sigma> (pvar_list R n))
[PROOF STEP]
show "permute_list (fun_inv \<sigma>) ` S \<subseteq> poly_tuple_pullback n S (permute_list \<sigma> (pvar_list R n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. permute_list (fun_inv \<sigma>) ` S \<subseteq> poly_tuple_pullback n S (permute_list \<sigma> (pvar_list R n))
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> permute_list (fun_inv \<sigma>) ` S \<Longrightarrow> x \<in> poly_tuple_pullback n S (permute_list \<sigma> (pvar_list R n))
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> permute_list (fun_inv \<sigma>) ` S \<Longrightarrow> x \<in> poly_tuple_pullback n S (permute_list \<sigma> (pvar_list R n))
[PROOF STEP]
assume A: "x \<in> permute_list (fun_inv \<sigma>) ` S"
[PROOF STATE]
proof (state)
this:
x \<in> permute_list (fun_inv \<sigma>) ` S

goal (1 subgoal):
 1. \<And>x. x \<in> permute_list (fun_inv \<sigma>) ` S \<Longrightarrow> x \<in> poly_tuple_pullback n S (permute_list \<sigma> (pvar_list R n))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<in> permute_list (fun_inv \<sigma>) ` S
[PROOF STEP]
obtain y where y_def: "y \<in> S \<and> x = permute_list (fun_inv \<sigma>) y"
[PROOF STATE]
proof (prove)
using this:
x \<in> permute_list (fun_inv \<sigma>) ` S

goal (1 subgoal):
 1. (\<And>y. y \<in> S \<and> x = permute_list (fun_inv \<sigma>) y \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
y \<in> S \<and> x = permute_list (fun_inv \<sigma>) y

goal (1 subgoal):
 1. \<And>x. x \<in> permute_list (fun_inv \<sigma>) ` S \<Longrightarrow> x \<in> poly_tuple_pullback n S (permute_list \<sigma> (pvar_list R n))
[PROOF STEP]
have 0: "(fun_inv \<sigma>) permutes {..<n}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fun_inv \<sigma> permutes {..<n}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<sigma> permutes {..<n}
S \<subseteq> carrier (R\<^bsup>n\<^esup>)

goal (1 subgoal):
 1. fun_inv \<sigma> permutes {..<n}
[PROOF STEP]
unfolding fun_inv_def
[PROOF STATE]
proof (prove)
using this:
\<sigma> permutes {..<n}
S \<subseteq> carrier (R\<^bsup>n\<^esup>)

goal (1 subgoal):
 1. inv \<sigma> permutes {..<n}
[PROOF STEP]
by (simp add: permutes_inv)
[PROOF STATE]
proof (state)
this:
fun_inv \<sigma> permutes {..<n}

goal (1 subgoal):
 1. \<And>x. x \<in> permute_list (fun_inv \<sigma>) ` S \<Longrightarrow> x \<in> poly_tuple_pullback n S (permute_list \<sigma> (pvar_list R n))
[PROOF STEP]
have 1: "permute_list \<sigma> x = permute_list \<sigma> (permute_list (fun_inv \<sigma>) y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. permute_list \<sigma> x = permute_list \<sigma> (permute_list (fun_inv \<sigma>) y)
[PROOF STEP]
by (simp add: y_def)
[PROOF STATE]
proof (state)
this:
permute_list \<sigma> x = permute_list \<sigma> (permute_list (fun_inv \<sigma>) y)

goal (1 subgoal):
 1. \<And>x. x \<in> permute_list (fun_inv \<sigma>) ` S \<Longrightarrow> x \<in> poly_tuple_pullback n S (permute_list \<sigma> (pvar_list R n))
[PROOF STEP]
have 2: "length y = n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length y = n
[PROOF STEP]
using y_def A assms cartesian_power_car_memE
[PROOF STATE]
proof (prove)
using this:
y \<in> S \<and> x = permute_list (fun_inv \<sigma>) y
x \<in> permute_list (fun_inv \<sigma>) ` S
\<sigma> permutes {..<n}
S \<subseteq> carrier (R\<^bsup>n\<^esup>)
?as \<in> carrier (?R\<^bsup>?n\<^esup>) \<Longrightarrow> length ?as = ?n

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

goal (1 subgoal):
 1. \<And>x. x \<in> permute_list (fun_inv \<sigma>) ` S \<Longrightarrow> x \<in> poly_tuple_pullback n S (permute_list \<sigma> (pvar_list R n))
[PROOF STEP]
have 3: "\<sigma> permutes {..<length y}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<sigma> permutes {..<length y}
[PROOF STEP]
by (simp add: "2" assms)
[PROOF STATE]
proof (state)
this:
\<sigma> permutes {..<length y}

goal (1 subgoal):
 1. \<And>x. x \<in> permute_list (fun_inv \<sigma>) ` S \<Longrightarrow> x \<in> poly_tuple_pullback n S (permute_list \<sigma> (pvar_list R n))
[PROOF STEP]
have 4: "permute_list \<sigma> x = y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. permute_list \<sigma> x = y
[PROOF STEP]
using assms(2) permute_list_id[of y]  permute_list_compose[of \<sigma> y "(fun_inv \<sigma>)" ]
              3 2 1 0 permutes_inv_o(2)[of \<sigma> "{..< n}"]
[PROOF STATE]
proof (prove)
using this:
S \<subseteq> carrier (R\<^bsup>n\<^esup>)
permute_list id y = y
\<sigma> permutes {..<length y} \<Longrightarrow> permute_list (fun_inv \<sigma> \<circ> \<sigma>) y = permute_list \<sigma> (permute_list (fun_inv \<sigma>) y)
\<sigma> permutes {..<length y}
length y = n
permute_list \<sigma> x = permute_list \<sigma> (permute_list (fun_inv \<sigma>) y)
fun_inv \<sigma> permutes {..<n}
\<sigma> permutes {..<n} \<Longrightarrow> inv \<sigma> \<circ> \<sigma> = id

goal (1 subgoal):
 1. permute_list \<sigma> x = y
[PROOF STEP]
unfolding fun_inv_def
[PROOF STATE]
proof (prove)
using this:
S \<subseteq> carrier (R\<^bsup>n\<^esup>)
permute_list id y = y
\<sigma> permutes {..<length y} \<Longrightarrow> permute_list (inv \<sigma> \<circ> \<sigma>) y = permute_list \<sigma> (permute_list (inv \<sigma>) y)
\<sigma> permutes {..<length y}
length y = n
permute_list \<sigma> x = permute_list \<sigma> (permute_list (inv \<sigma>) y)
inv \<sigma> permutes {..<n}
\<sigma> permutes {..<n} \<Longrightarrow> inv \<sigma> \<circ> \<sigma> = id

goal (1 subgoal):
 1. permute_list \<sigma> x = y
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
permute_list \<sigma> x = y

goal (1 subgoal):
 1. \<And>x. x \<in> permute_list (fun_inv \<sigma>) ` S \<Longrightarrow> x \<in> poly_tuple_pullback n S (permute_list \<sigma> (pvar_list R n))
[PROOF STEP]
have 5: "x \<in> carrier (R\<^bsup>n\<^esup>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> carrier (R\<^bsup>n\<^esup>)
[PROOF STEP]
apply(rule cartesian_power_car_memI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. length x = n
 2. set x \<subseteq> carrier R
[PROOF STEP]
using A 0 assms
[PROOF STATE]
proof (prove)
using this:
x \<in> permute_list (fun_inv \<sigma>) ` S
fun_inv \<sigma> permutes {..<n}
\<sigma> permutes {..<n}
S \<subseteq> carrier (R\<^bsup>n\<^esup>)

goal (2 subgoals):
 1. length x = n
 2. set x \<subseteq> carrier R
[PROOF STEP]
apply (metis "2" "4" length_permute_list)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set x \<subseteq> carrier R
[PROOF STEP]
using A 0 assms
[PROOF STATE]
proof (prove)
using this:
x \<in> permute_list (fun_inv \<sigma>) ` S
fun_inv \<sigma> permutes {..<n}
\<sigma> permutes {..<n}
S \<subseteq> carrier (R\<^bsup>n\<^esup>)

goal (1 subgoal):
 1. set x \<subseteq> carrier R
[PROOF STEP]
by (smt "2" in_set_conv_nth neq0_conv poly_tuple_evalE pushforward_by_pvar_list
           pvar_list_is_poly_tuple pvar_list_length set_permute_list subset_iff y_def)
[PROOF STATE]
proof (state)
this:
x \<in> carrier (R\<^bsup>n\<^esup>)

goal (1 subgoal):
 1. \<And>x. x \<in> permute_list (fun_inv \<sigma>) ` S \<Longrightarrow> x \<in> poly_tuple_pullback n S (permute_list \<sigma> (pvar_list R n))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<in> carrier (R\<^bsup>n\<^esup>)
[PROOF STEP]
have 6: "poly_tuple_eval (permute_list \<sigma> (pvar_list R n)) x = y"
[PROOF STATE]
proof (prove)
using this:
x \<in> carrier (R\<^bsup>n\<^esup>)

goal (1 subgoal):
 1. poly_tuple_eval (permute_list \<sigma> (pvar_list R n)) x = y
[PROOF STEP]
using 4  assms pushforward_by_permuted_pvar_list[of \<sigma> n x]
[PROOF STATE]
proof (prove)
using this:
x \<in> carrier (R\<^bsup>n\<^esup>)
permute_list \<sigma> x = y
\<sigma> permutes {..<n}
S \<subseteq> carrier (R\<^bsup>n\<^esup>)
\<lbrakk>\<sigma> permutes {..<n}; x \<in> carrier (R\<^bsup>n\<^esup>)\<rbrakk> \<Longrightarrow> poly_tuple_eval (permute_list \<sigma> (pvar_list R n)) x = permute_list \<sigma> x

goal (1 subgoal):
 1. poly_tuple_eval (permute_list \<sigma> (pvar_list R n)) x = y
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
poly_tuple_eval (permute_list \<sigma> (pvar_list R n)) x = y

goal (1 subgoal):
 1. \<And>x. x \<in> permute_list (fun_inv \<sigma>) ` S \<Longrightarrow> x \<in> poly_tuple_pullback n S (permute_list \<sigma> (pvar_list R n))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
poly_tuple_eval (permute_list \<sigma> (pvar_list R n)) x = y
[PROOF STEP]
show "x \<in> poly_tuple_pullback n S (permute_list \<sigma> (pvar_list R n))"
[PROOF STATE]
proof (prove)
using this:
poly_tuple_eval (permute_list \<sigma> (pvar_list R n)) x = y

goal (1 subgoal):
 1. x \<in> poly_tuple_pullback n S (permute_list \<sigma> (pvar_list R n))
[PROOF STEP]
using 5 y_def
[PROOF STATE]
proof (prove)
using this:
poly_tuple_eval (permute_list \<sigma> (pvar_list R n)) x = y
x \<in> carrier (R\<^bsup>n\<^esup>)
y \<in> S \<and> x = permute_list (fun_inv \<sigma>) y

goal (1 subgoal):
 1. x \<in> poly_tuple_pullback n S (permute_list \<sigma> (pvar_list R n))
[PROOF STEP]
unfolding poly_tuple_pullback_def
[PROOF STATE]
proof (prove)
using this:
poly_tuple_eval (permute_list \<sigma> (pvar_list R n)) x = y
x \<in> carrier (R\<^bsup>n\<^esup>)
y \<in> S \<and> x = permute_list (fun_inv \<sigma>) y

goal (1 subgoal):
 1. x \<in> poly_tuple_eval (permute_list \<sigma> (pvar_list R n)) -` S \<inter> carrier (R\<^bsup>n\<^esup>)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
x \<in> poly_tuple_pullback n S (permute_list \<sigma> (pvar_list R n))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
permute_list (fun_inv \<sigma>) ` S \<subseteq> poly_tuple_pullback n S (permute_list \<sigma> (pvar_list R n))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma chain_subdiv_chain_pathimg_subset':
  assumes "chain_subdiv_chain one_chain subdiv"
  assumes "(k,\<gamma>)\<in> subdiv"
  shows " \<exists>k' \<gamma>'. (k',\<gamma>')\<in> one_chain \<and> path_image \<gamma> \<subseteq> path_image \<gamma>'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>k' \<gamma>'. (k', \<gamma>') \<in> one_chain \<and> path_image \<gamma> \<subseteq> path_image \<gamma>'
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
chain_subdiv_chain one_chain subdiv
(k, \<gamma>) \<in> subdiv

goal (1 subgoal):
 1. \<exists>k' \<gamma>'. (k', \<gamma>') \<in> one_chain \<and> path_image \<gamma> \<subseteq> path_image \<gamma>'
[PROOF STEP]
unfolding chain_subdiv_chain_def  pairwise_def
[PROOF STATE]
proof (prove)
using this:
\<exists>f. \<Union> (f ` one_chain) = subdiv \<and> (\<forall>c\<in>one_chain. chain_subdiv_path (coeff_cube_to_path c) (f c)) \<and> (\<forall>x\<in>one_chain. \<forall>y\<in>one_chain. x \<noteq> y \<longrightarrow> f x \<inter> f y = {}) \<and> (\<forall>x\<in>one_chain. finite (f x))
(k, \<gamma>) \<in> subdiv

goal (1 subgoal):
 1. \<exists>k' \<gamma>'. (k', \<gamma>') \<in> one_chain \<and> path_image \<gamma> \<subseteq> path_image \<gamma>'
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>f a b. \<lbrakk>subdiv = \<Union> (f ` one_chain); (a, b) \<in> one_chain; (k, \<gamma>) \<in> f (a, b); \<forall>c\<in>one_chain. chain_subdiv_path (coeff_cube_to_path c) (f c); \<forall>x\<in>one_chain. \<forall>y\<in>one_chain. x \<noteq> y \<longrightarrow> f x \<inter> f y = {}; \<forall>x\<in>one_chain. finite (f x)\<rbrakk> \<Longrightarrow> \<exists>k' \<gamma>'. (k', \<gamma>') \<in> one_chain \<and> path_image \<gamma> \<subseteq> path_image \<gamma>'
[PROOF STEP]
by (metis chain_subdiv_path.cases coeff_cube_to_path.simps path_image_rec_join path_image_reversepath)


[STATEMENT]
lemma sorted_list_of_set_eq_nil2[simp]:
    assumes "finite A"
    shows "[] = sorted_list_of_set A \<longleftrightarrow> A={}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ([] = sorted_list_of_set A) = (A = {})
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
finite A

goal (1 subgoal):
 1. ([] = sorted_list_of_set A) = (A = {})
[PROOF STEP]
by (auto dest: sym)


[STATEMENT]
lemma prefix_dropWhile:
  assumes "prefix xs ys"
  shows   "prefix (dropWhile P xs) (dropWhile P ys)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prefix (dropWhile P xs) (dropWhile P ys)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. prefix (dropWhile P xs) (dropWhile P ys)
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
prefix xs ys
[PROOF STEP]
obtain zs where ys: "ys = xs @ zs"
[PROOF STATE]
proof (prove)
using this:
prefix xs ys

goal (1 subgoal):
 1. (\<And>zs. ys = xs @ zs \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp: prefix_def)
[PROOF STATE]
proof (state)
this:
ys = xs @ zs

goal (1 subgoal):
 1. prefix (dropWhile P xs) (dropWhile P ys)
[PROOF STEP]
have "prefix (dropWhile P xs) (dropWhile P (xs @ zs))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prefix (dropWhile P xs) (dropWhile P (xs @ zs))
[PROOF STEP]
by (induction xs) auto
[PROOF STATE]
proof (state)
this:
prefix (dropWhile P xs) (dropWhile P (xs @ zs))

goal (1 subgoal):
 1. prefix (dropWhile P xs) (dropWhile P ys)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
prefix (dropWhile P xs) (dropWhile P (xs @ zs))

goal (1 subgoal):
 1. prefix (dropWhile P xs) (dropWhile P ys)
[PROOF STEP]
by (simp add: ys)
[PROOF STATE]
proof (state)
this:
prefix (dropWhile P xs) (dropWhile P ys)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma cong_le_per2__le:
  assumes "Per A B C" and
    "Per A' B' C'" and
    "Cong A B A' B'" and
    "B C Le B' C'"
  shows "A C Le A' C'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A C Le A' C'
[PROOF STEP]
proof cases
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. ?P \<Longrightarrow> A C Le A' C'
 2. \<not> ?P \<Longrightarrow> A C Le A' C'
[PROOF STEP]
assume "Cong B C B' C'"
[PROOF STATE]
proof (state)
this:
Cong B C B' C'

goal (2 subgoals):
 1. ?P \<Longrightarrow> A C Le A' C'
 2. \<not> ?P \<Longrightarrow> A C Le A' C'
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
Cong B C B' C'

goal (1 subgoal):
 1. A C Le A' C'
[PROOF STEP]
using assms(1) assms(2) assms(3) cong__le l10_12
[PROOF STATE]
proof (prove)
using this:
Cong B C B' C'
Per A B C
Per A' B' C'
Cong A B A' B'
Cong ?A ?B ?C ?D \<Longrightarrow> ?A ?B Le ?C ?D
\<lbrakk>Per ?A ?B ?C; Per ?A' ?B' ?C'; Cong ?A ?B ?A' ?B'; Cong ?B ?C ?B' ?C'\<rbrakk> \<Longrightarrow> Cong ?A ?C ?A' ?C'

goal (1 subgoal):
 1. A C Le A' C'
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
A C Le A' C'

goal (1 subgoal):
 1. \<not> Cong B C B' C' \<Longrightarrow> A C Le A' C'
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> Cong B C B' C' \<Longrightarrow> A C Le A' C'
[PROOF STEP]
assume "\<not> Cong B C B' C'"
[PROOF STATE]
proof (state)
this:
\<not> Cong B C B' C'

goal (1 subgoal):
 1. \<not> Cong B C B' C' \<Longrightarrow> A C Le A' C'
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> Cong B C B' C'
[PROOF STEP]
have "B C Lt B' C'"
[PROOF STATE]
proof (prove)
using this:
\<not> Cong B C B' C'

goal (1 subgoal):
 1. B C Lt B' C'
[PROOF STEP]
using Lt_def assms(4)
[PROOF STATE]
proof (prove)
using this:
\<not> Cong B C B' C'
?A ?B Lt ?C ?D \<equiv> ?A ?B Le ?C ?D \<and> \<not> Cong ?A ?B ?C ?D
B C Le B' C'

goal (1 subgoal):
 1. B C Lt B' C'
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
B C Lt B' C'

goal (1 subgoal):
 1. \<not> Cong B C B' C' \<Longrightarrow> A C Le A' C'
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
B C Lt B' C'

goal (1 subgoal):
 1. A C Le A' C'
[PROOF STEP]
using assms(1) assms(2) assms(3) cong_lt_per2__lt lt__le
[PROOF STATE]
proof (prove)
using this:
B C Lt B' C'
Per A B C
Per A' B' C'
Cong A B A' B'
\<lbrakk>Per ?A ?B ?C; Per ?A' ?B' ?C'; Cong ?A ?B ?A' ?B'; ?B ?C Lt ?B' ?C'\<rbrakk> \<Longrightarrow> ?A ?C Lt ?A' ?C'
?A ?B Lt ?C ?D \<Longrightarrow> ?A ?B Le ?C ?D

goal (1 subgoal):
 1. A C Le A' C'
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
A C Le A' C'

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma row_to_poly_smult:
  assumes "distinct ts" and "dim_vec r = length ts"
  shows "row_to_poly ts (c \<cdot>\<^sub>v r) = c \<cdot> (row_to_poly ts r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. row_to_poly ts (c \<cdot>\<^sub>v r) = c \<cdot> row_to_poly ts r
[PROOF STEP]
proof (rule poly_mapping_eqI, simp only: lookup_map_scale)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>k. lookup (row_to_poly ts (c \<cdot>\<^sub>v r)) k = c * lookup (row_to_poly ts r) k
[PROOF STEP]
fix t
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>k. lookup (row_to_poly ts (c \<cdot>\<^sub>v r)) k = c * lookup (row_to_poly ts r) k
[PROOF STEP]
show "lookup (row_to_poly ts (c \<cdot>\<^sub>v r)) t = c * lookup (row_to_poly ts r) t" (is "lookup ?l t = c * lookup ?r t")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lookup (row_to_poly ts (c \<cdot>\<^sub>v r)) t = c * lookup (row_to_poly ts r) t
[PROOF STEP]
proof (cases "t \<in> set ts")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. t \<in> set ts \<Longrightarrow> lookup (row_to_poly ts (c \<cdot>\<^sub>v r)) t = c * lookup (row_to_poly ts r) t
 2. t \<notin> set ts \<Longrightarrow> lookup (row_to_poly ts (c \<cdot>\<^sub>v r)) t = c * lookup (row_to_poly ts r) t
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
t \<in> set ts

goal (2 subgoals):
 1. t \<in> set ts \<Longrightarrow> lookup (row_to_poly ts (c \<cdot>\<^sub>v r)) t = c * lookup (row_to_poly ts r) t
 2. t \<notin> set ts \<Longrightarrow> lookup (row_to_poly ts (c \<cdot>\<^sub>v r)) t = c * lookup (row_to_poly ts r) t
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
t \<in> set ts
[PROOF STEP]
obtain j where j: "j < length ts" and t: "t = ts ! j"
[PROOF STATE]
proof (prove)
using this:
t \<in> set ts

goal (1 subgoal):
 1. (\<And>j. \<lbrakk>j < length ts; t = ts ! j\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis in_set_conv_nth)
[PROOF STATE]
proof (state)
this:
j < length ts
t = ts ! j

goal (2 subgoals):
 1. t \<in> set ts \<Longrightarrow> lookup (row_to_poly ts (c \<cdot>\<^sub>v r)) t = c * lookup (row_to_poly ts r) t
 2. t \<notin> set ts \<Longrightarrow> lookup (row_to_poly ts (c \<cdot>\<^sub>v r)) t = c * lookup (row_to_poly ts r) t
[PROOF STEP]
from assms(2)
[PROOF STATE]
proof (chain)
picking this:
dim_vec r = length ts
[PROOF STEP]
have dm: "dim_vec (c \<cdot>\<^sub>v r) = length ts"
[PROOF STATE]
proof (prove)
using this:
dim_vec r = length ts

goal (1 subgoal):
 1. dim_vec (c \<cdot>\<^sub>v r) = length ts
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
dim_vec (c \<cdot>\<^sub>v r) = length ts

goal (2 subgoals):
 1. t \<in> set ts \<Longrightarrow> lookup (row_to_poly ts (c \<cdot>\<^sub>v r)) t = c * lookup (row_to_poly ts r) t
 2. t \<notin> set ts \<Longrightarrow> lookup (row_to_poly ts (c \<cdot>\<^sub>v r)) t = c * lookup (row_to_poly ts r) t
[PROOF STEP]
from j
[PROOF STATE]
proof (chain)
picking this:
j < length ts
[PROOF STEP]
have j': "j < dim_vec r"
[PROOF STATE]
proof (prove)
using this:
j < length ts

goal (1 subgoal):
 1. j < dim_vec r
[PROOF STEP]
by (simp only: assms(2))
[PROOF STATE]
proof (state)
this:
j < dim_vec r

goal (2 subgoals):
 1. t \<in> set ts \<Longrightarrow> lookup (row_to_poly ts (c \<cdot>\<^sub>v r)) t = c * lookup (row_to_poly ts r) t
 2. t \<notin> set ts \<Longrightarrow> lookup (row_to_poly ts (c \<cdot>\<^sub>v r)) t = c * lookup (row_to_poly ts r) t
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lookup (row_to_poly ts (c \<cdot>\<^sub>v r)) t = c * lookup (row_to_poly ts r) t
[PROOF STEP]
by (simp add: t lookup_row_to_poly[OF assms j] lookup_row_to_poly[OF assms(1) dm j] index_smult_vec(1)[OF j'])
[PROOF STATE]
proof (state)
this:
lookup (row_to_poly ts (c \<cdot>\<^sub>v r)) t = c * lookup (row_to_poly ts r) t

goal (1 subgoal):
 1. t \<notin> set ts \<Longrightarrow> lookup (row_to_poly ts (c \<cdot>\<^sub>v r)) t = c * lookup (row_to_poly ts r) t
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. t \<notin> set ts \<Longrightarrow> lookup (row_to_poly ts (c \<cdot>\<^sub>v r)) t = c * lookup (row_to_poly ts r) t
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
t \<notin> set ts

goal (1 subgoal):
 1. t \<notin> set ts \<Longrightarrow> lookup (row_to_poly ts (c \<cdot>\<^sub>v r)) t = c * lookup (row_to_poly ts r) t
[PROOF STEP]
with keys_row_to_poly[of ts "c \<cdot>\<^sub>v r"] keys_row_to_poly[of ts r]
[PROOF STATE]
proof (chain)
picking this:
keys (row_to_poly ts (c \<cdot>\<^sub>v r)) \<subseteq> set ts
keys (row_to_poly ts r) \<subseteq> set ts
t \<notin> set ts
[PROOF STEP]
have
      "t \<notin> keys ?l" and "t \<notin> keys ?r"
[PROOF STATE]
proof (prove)
using this:
keys (row_to_poly ts (c \<cdot>\<^sub>v r)) \<subseteq> set ts
keys (row_to_poly ts r) \<subseteq> set ts
t \<notin> set ts

goal (1 subgoal):
 1. t \<notin> keys (row_to_poly ts (c \<cdot>\<^sub>v r)) &&& t \<notin> keys (row_to_poly ts r)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
t \<notin> keys (row_to_poly ts (c \<cdot>\<^sub>v r))
t \<notin> keys (row_to_poly ts r)

goal (1 subgoal):
 1. t \<notin> set ts \<Longrightarrow> lookup (row_to_poly ts (c \<cdot>\<^sub>v r)) t = c * lookup (row_to_poly ts r) t
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
t \<notin> keys (row_to_poly ts (c \<cdot>\<^sub>v r))
t \<notin> keys (row_to_poly ts r)

goal (1 subgoal):
 1. lookup (row_to_poly ts (c \<cdot>\<^sub>v r)) t = c * lookup (row_to_poly ts r) t
[PROOF STEP]
by (simp add: in_keys_iff)
[PROOF STATE]
proof (state)
this:
lookup (row_to_poly ts (c \<cdot>\<^sub>v r)) t = c * lookup (row_to_poly ts r) t

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
lookup (row_to_poly ts (c \<cdot>\<^sub>v r)) t = c * lookup (row_to_poly ts r) t

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma c_f_list_f_is_pr: "c_f_list f \<in> PrimRec2 \<Longrightarrow> f \<in> PrimRec2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c_f_list f \<in> PrimRec2 \<Longrightarrow> f \<in> PrimRec2
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. c_f_list f \<in> PrimRec2 \<Longrightarrow> f \<in> PrimRec2
[PROOF STEP]
assume A1: "c_f_list f \<in> PrimRec2"
[PROOF STATE]
proof (state)
this:
c_f_list f \<in> PrimRec2

goal (1 subgoal):
 1. c_f_list f \<in> PrimRec2 \<Longrightarrow> f \<in> PrimRec2
[PROOF STEP]
have S1: "f = (\<lambda> y x. c_hd (c_f_list f y x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f = (\<lambda>y x. c_hd (c_f_list f y x))
[PROOF STEP]
by (rule c_f_list_to_f)
[PROOF STATE]
proof (state)
this:
f = (\<lambda>y x. c_hd (c_f_list f y x))

goal (1 subgoal):
 1. c_f_list f \<in> PrimRec2 \<Longrightarrow> f \<in> PrimRec2
[PROOF STEP]
from A1 c_hd_is_pr
[PROOF STATE]
proof (chain)
picking this:
c_f_list f \<in> PrimRec2
c_hd \<in> PrimRec1
[PROOF STEP]
have S2: "(\<lambda> y x. c_hd (c_f_list f y x)) \<in> PrimRec2"
[PROOF STATE]
proof (prove)
using this:
c_f_list f \<in> PrimRec2
c_hd \<in> PrimRec1

goal (1 subgoal):
 1. (\<lambda>y x. c_hd (c_f_list f y x)) \<in> PrimRec2
[PROOF STEP]
by prec
[PROOF STATE]
proof (state)
this:
(\<lambda>y x. c_hd (c_f_list f y x)) \<in> PrimRec2

goal (1 subgoal):
 1. c_f_list f \<in> PrimRec2 \<Longrightarrow> f \<in> PrimRec2
[PROOF STEP]
with S1
[PROOF STATE]
proof (chain)
picking this:
f = (\<lambda>y x. c_hd (c_f_list f y x))
(\<lambda>y x. c_hd (c_f_list f y x)) \<in> PrimRec2
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
f = (\<lambda>y x. c_hd (c_f_list f y x))
(\<lambda>y x. c_hd (c_f_list f y x)) \<in> PrimRec2

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma LLL_measure_approx_fs_init:
  "LLL_invariant upw i fs_init \<Longrightarrow> 4 / 3 < \<alpha> \<Longrightarrow> m \<noteq> 0 \<Longrightarrow>
  real (LLL_measure i fs_init) \<le> real m + real (2 * m * m) * log base (real N)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>LLL_invariant upw i fs_init; 4 / 3 < \<alpha>; m \<noteq> 0\<rbrakk> \<Longrightarrow> real (LLL_measure i fs_init) \<le> real m + real (2 * m * m) * log base (real N)
[PROOF STEP]
using LLL_measure_approx[OF LLL_inv_imp_w g_bound_fs_init]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>LLL_invariant ?upw1 ?i1 fs_init; 4 / 3 < \<alpha>; m \<noteq> 0\<rbrakk> \<Longrightarrow> real (LLL_measure ?i fs_init) \<le> real m + real (2 * m * m) * log base (real N)

goal (1 subgoal):
 1. \<lbrakk>LLL_invariant upw i fs_init; 4 / 3 < \<alpha>; m \<noteq> 0\<rbrakk> \<Longrightarrow> real (LLL_measure i fs_init) \<le> real m + real (2 * m * m) * log base (real N)
[PROOF STEP]
.


[STATEMENT]
lemma "(x::nat) ~= 0 ==> 0 < x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<noteq> 0 \<Longrightarrow> 0 < x
[PROOF STEP]
by linarith


[STATEMENT]
lemma nat_le_eq_or_lt: \<open>(a :: nat) \<le> b = (a = b \<or> a < b)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a \<le> b) = (a = b \<or> a < b)
[PROOF STEP]
by linarith


[STATEMENT]
lemma [code]: "m \<le> n \<longleftrightarrow> integer_of_natural m \<le> integer_of_natural n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (m \<le> n) = (integer_of_natural m \<le> integer_of_natural n)
[PROOF STEP]
by transfer simp