[STATEMENT]
lemma list_of_refs_of_HOL:
  assumes "list_of h r xs"
  shows "\<exists>rs. refs_of h r rs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>rs. refs_of h r rs
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
list_of h r xs

goal (1 subgoal):
 1. \<exists>rs. refs_of h r rs
[PROOF STEP]
proof (induct xs arbitrary: r)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>r. list_of h r [] \<Longrightarrow> Ex (refs_of h r)
 2. \<And>a xs r. \<lbrakk>\<And>r. list_of h r xs \<Longrightarrow> Ex (refs_of h r); list_of h r (a # xs)\<rbrakk> \<Longrightarrow> Ex (refs_of h r)
[PROOF STEP]
case Nil
[PROOF STATE]
proof (state)
this:
list_of h r []

goal (2 subgoals):
 1. \<And>r. list_of h r [] \<Longrightarrow> Ex (refs_of h r)
 2. \<And>a xs r. \<lbrakk>\<And>r. list_of h r xs \<Longrightarrow> Ex (refs_of h r); list_of h r (a # xs)\<rbrakk> \<Longrightarrow> Ex (refs_of h r)
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
list_of h r []

goal (1 subgoal):
 1. \<exists>a. refs_of h r a
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>a. refs_of h r a

goal (1 subgoal):
 1. \<And>a xs r. \<lbrakk>\<And>r. list_of h r xs \<Longrightarrow> Ex (refs_of h r); list_of h r (a # xs)\<rbrakk> \<Longrightarrow> Ex (refs_of h r)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a xs r. \<lbrakk>\<And>r. list_of h r xs \<Longrightarrow> Ex (refs_of h r); list_of h r (a # xs)\<rbrakk> \<Longrightarrow> Ex (refs_of h r)
[PROOF STEP]
case (Cons x xs')
[PROOF STATE]
proof (state)
this:
list_of h ?r xs' \<Longrightarrow> \<exists>a. refs_of h ?r a
list_of h r (x # xs')

goal (1 subgoal):
 1. \<And>a xs r. \<lbrakk>\<And>r. list_of h r xs \<Longrightarrow> Ex (refs_of h r); list_of h r (a # xs)\<rbrakk> \<Longrightarrow> Ex (refs_of h r)
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
list_of h ?r xs' \<Longrightarrow> \<exists>a. refs_of h ?r a
list_of h r (x # xs')

goal (1 subgoal):
 1. \<exists>a. refs_of h r a
[PROOF STEP]
by (cases r, auto)
[PROOF STATE]
proof (state)
this:
\<exists>a. refs_of h r a

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma lcr_trans_l:
  assumes "locally_compatible_r R1 R2 (A + B) (C + D) (E + F)"
  shows "locally_compatible_r R1 R2 A C E"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. locally_compatible_r R1 R2 A C E
[PROOF STEP]
using assms[unfolded locally_compatible_r_def, rule_format]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?t \<in># A + B; ?u \<in># C + D; ?v \<in># E + F; (?t, ?u) \<in> R2; (?u, ?v) \<in> R1\<rbrakk> \<Longrightarrow> (?t, ?v) \<in> R2

goal (1 subgoal):
 1. locally_compatible_r R1 R2 A C E
[PROOF STEP]
unfolding locally_compatible_r_def
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?t \<in># A + B; ?u \<in># C + D; ?v \<in># E + F; (?t, ?u) \<in> R2; (?u, ?v) \<in> R1\<rbrakk> \<Longrightarrow> (?t, ?v) \<in> R2

goal (1 subgoal):
 1. \<forall>t u v. t \<in># A \<longrightarrow> u \<in># C \<longrightarrow> v \<in># E \<longrightarrow> (t, u) \<in> R2 \<longrightarrow> (u, v) \<in> R1 \<longrightarrow> (t, v) \<in> R2
[PROOF STEP]
by auto


[STATEMENT]
lemma sstart_eq: "x \<in> streams S \<Longrightarrow> x \<in> sstart S xs = (\<forall>i<length xs. x !! i = xs ! i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> streams S \<Longrightarrow> (x \<in> sstart S xs) = (\<forall>i<length xs. x !! i = xs ! i)
[PROOF STEP]
by (induction xs arbitrary: x) (auto simp: nth_Cons streams_stl split: nat.splits)


[STATEMENT]
lemma Sum_any_right_distrib:
  fixes r :: "'a :: semiring_0"
  assumes "finite {a. g a \<noteq> 0}"
  shows "r * Sum_any g = (\<Sum>n. r * g n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. r * Sum_any g = (\<Sum>n. r * g n)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. r * Sum_any g = (\<Sum>n. r * g n)
[PROOF STEP]
note assms
[PROOF STATE]
proof (state)
this:
finite {a. g a \<noteq> (0::'a)}

goal (1 subgoal):
 1. r * Sum_any g = (\<Sum>n. r * g n)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
finite {a. g a \<noteq> (0::'a)}

goal (1 subgoal):
 1. r * Sum_any g = (\<Sum>n. r * g n)
[PROOF STEP]
have "{a. r * g a \<noteq> 0} \<subseteq> {a. g a \<noteq> 0}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {a. r * g a \<noteq> (0::'a)} \<subseteq> {a. g a \<noteq> (0::'a)}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{a. r * g a \<noteq> (0::'a)} \<subseteq> {a. g a \<noteq> (0::'a)}

goal (1 subgoal):
 1. r * Sum_any g = (\<Sum>n. r * g n)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
finite {a. g a \<noteq> (0::'a)}
{a. r * g a \<noteq> (0::'a)} \<subseteq> {a. g a \<noteq> (0::'a)}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
finite {a. g a \<noteq> (0::'a)}
{a. r * g a \<noteq> (0::'a)} \<subseteq> {a. g a \<noteq> (0::'a)}

goal (1 subgoal):
 1. r * Sum_any g = (\<Sum>n. r * g n)
[PROOF STEP]
by (simp add: sum_distrib_left Sum_any.expand_superset [of "{a. g a \<noteq> 0}"])
[PROOF STATE]
proof (state)
this:
r * Sum_any g = (\<Sum>n. r * g n)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma measurable_INF[measurable]:
  fixes F :: "'i \<Rightarrow> 'a \<Rightarrow> 'b::{complete_lattice, countable}"
  assumes [simp]: "countable I"
  assumes [measurable]: "\<And>i. i \<in> I \<Longrightarrow> F i \<in> measurable M (count_space UNIV)"
  shows "(\<lambda>x. INF i\<in>I. F i x) \<in> measurable M (count_space UNIV)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. INF i\<in>I. F i x) \<in> M \<rightarrow>\<^sub>M count_space UNIV
[PROOF STEP]
unfolding measurable_count_space_eq2_countable
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. INF i\<in>I. F i x) \<in> space M \<rightarrow> UNIV \<and> (\<forall>a\<in>UNIV. (\<lambda>x. INF i\<in>I. F i x) -` {a} \<inter> space M \<in> sets M)
[PROOF STEP]
proof (safe intro!: UNIV_I)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a. a \<in> UNIV \<Longrightarrow> (\<lambda>x. INF i\<in>I. F i x) -` {a} \<inter> space M \<in> sets M
[PROOF STEP]
fix a
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a. a \<in> UNIV \<Longrightarrow> (\<lambda>x. INF i\<in>I. F i x) -` {a} \<inter> space M \<in> sets M
[PROOF STEP]
have "(\<lambda>x. INF i\<in>I. F i x) -` {a} \<inter> space M =
    {x\<in>space M. (\<forall>i\<in>I. a \<le> F i x) \<and> (\<forall>b. (\<forall>i\<in>I. b \<le> F i x) \<longrightarrow> b \<le> a)}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. INF i\<in>I. F i x) -` {a} \<inter> space M = {x \<in> space M. (\<forall>i\<in>I. a \<le> F i x) \<and> (\<forall>b. (\<forall>i\<in>I. b \<le> F i x) \<longrightarrow> b \<le> a)}
[PROOF STEP]
unfolding le_INF_iff[symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. INF i\<in>I. F i x) -` {a} \<inter> space M = {x \<in> space M. a \<le> (INF i\<in>I. F i x) \<and> (\<forall>b\<le>INF i\<in>I. F i x. b \<le> a)}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<lambda>x. INF i\<in>I. F i x) -` {a} \<inter> space M = {x \<in> space M. (\<forall>i\<in>I. a \<le> F i x) \<and> (\<forall>b. (\<forall>i\<in>I. b \<le> F i x) \<longrightarrow> b \<le> a)}

goal (1 subgoal):
 1. \<And>a. a \<in> UNIV \<Longrightarrow> (\<lambda>x. INF i\<in>I. F i x) -` {a} \<inter> space M \<in> sets M
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<lambda>x. INF i\<in>I. F i x) -` {a} \<inter> space M = {x \<in> space M. (\<forall>i\<in>I. a \<le> F i x) \<and> (\<forall>b. (\<forall>i\<in>I. b \<le> F i x) \<longrightarrow> b \<le> a)}

goal (1 subgoal):
 1. \<And>a. a \<in> UNIV \<Longrightarrow> (\<lambda>x. INF i\<in>I. F i x) -` {a} \<inter> space M \<in> sets M
[PROOF STEP]
have "\<dots> \<in> sets M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {x \<in> space M. (\<forall>i\<in>I. a \<le> F i x) \<and> (\<forall>b. (\<forall>i\<in>I. b \<le> F i x) \<longrightarrow> b \<le> a)} \<in> sets M
[PROOF STEP]
by measurable
[PROOF STATE]
proof (state)
this:
{x \<in> space M. (\<forall>i\<in>I. a \<le> F i x) \<and> (\<forall>b. (\<forall>i\<in>I. b \<le> F i x) \<longrightarrow> b \<le> a)} \<in> sets M

goal (1 subgoal):
 1. \<And>a. a \<in> UNIV \<Longrightarrow> (\<lambda>x. INF i\<in>I. F i x) -` {a} \<inter> space M \<in> sets M
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>x. INF i\<in>I. F i x) -` {a} \<inter> space M \<in> sets M
[PROOF STEP]
show "(\<lambda>x. INF i\<in>I. F i x) -` {a} \<inter> space M \<in> sets M"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. INF i\<in>I. F i x) -` {a} \<inter> space M \<in> sets M

goal (1 subgoal):
 1. (\<lambda>x. INF i\<in>I. F i x) -` {a} \<inter> space M \<in> sets M
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(\<lambda>x. INF i\<in>I. F i x) -` {a} \<inter> space M \<in> sets M

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma complex_cnj_of_int [simp]: "cnj (of_int z) = of_int z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cnj (of_int z) = of_int z
[PROOF STEP]
by (simp add: complex_eq_iff)


[STATEMENT]
lemma Sum_any_left_distrib:
  fixes r :: "'a :: semiring_0"
  assumes "finite {a. g a \<noteq> 0}"
  shows "Sum_any g * r = (\<Sum>n. g n * r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Sum_any g * r = (\<Sum>n. g n * r)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Sum_any g * r = (\<Sum>n. g n * r)
[PROOF STEP]
note assms
[PROOF STATE]
proof (state)
this:
finite {a. g a \<noteq> (0::'a)}

goal (1 subgoal):
 1. Sum_any g * r = (\<Sum>n. g n * r)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
finite {a. g a \<noteq> (0::'a)}

goal (1 subgoal):
 1. Sum_any g * r = (\<Sum>n. g n * r)
[PROOF STEP]
have "{a. g a * r \<noteq> 0} \<subseteq> {a. g a \<noteq> 0}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {a. g a * r \<noteq> (0::'a)} \<subseteq> {a. g a \<noteq> (0::'a)}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{a. g a * r \<noteq> (0::'a)} \<subseteq> {a. g a \<noteq> (0::'a)}

goal (1 subgoal):
 1. Sum_any g * r = (\<Sum>n. g n * r)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
finite {a. g a \<noteq> (0::'a)}
{a. g a * r \<noteq> (0::'a)} \<subseteq> {a. g a \<noteq> (0::'a)}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
finite {a. g a \<noteq> (0::'a)}
{a. g a * r \<noteq> (0::'a)} \<subseteq> {a. g a \<noteq> (0::'a)}

goal (1 subgoal):
 1. Sum_any g * r = (\<Sum>n. g n * r)
[PROOF STEP]
by (simp add: sum_distrib_right Sum_any.expand_superset [of "{a. g a \<noteq> 0}"])
[PROOF STATE]
proof (state)
this:
Sum_any g * r = (\<Sum>n. g n * r)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma absn_beta_equiv: "(Abs^^Suc n) s \<degree> t \<leftrightarrow> (Abs^^n) (s[liftn n t 0/n])"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (Abs ^^ Suc n) s \<degree> t \<leftrightarrow> (Abs ^^ n) (s[liftn n t 0/n])
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (Abs ^^ Suc n) s \<degree> t \<leftrightarrow> (Abs ^^ n) (s[liftn n t 0/n])
[PROOF STEP]
have "(Abs^^Suc n) s \<degree> t = Abs ((Abs^^n) s) \<degree> t"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (Abs ^^ Suc n) s \<degree> t = Abs ((Abs ^^ n) s) \<degree> t
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(Abs ^^ Suc n) s \<degree> t = Abs ((Abs ^^ n) s) \<degree> t

goal (1 subgoal):
 1. (Abs ^^ Suc n) s \<degree> t \<leftrightarrow> (Abs ^^ n) (s[liftn n t 0/n])
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(Abs ^^ Suc n) s \<degree> t = Abs ((Abs ^^ n) s) \<degree> t

goal (1 subgoal):
 1. (Abs ^^ Suc n) s \<degree> t \<leftrightarrow> (Abs ^^ n) (s[liftn n t 0/n])
[PROOF STEP]
have "... \<leftrightarrow> ((Abs^^n) s)[t/0]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Abs ((Abs ^^ n) s) \<degree> t \<leftrightarrow> (Abs ^^ n) s[t/0]
[PROOF STEP]
by (rule beta_into_equiv) (rule beta.beta)
[PROOF STATE]
proof (state)
this:
Abs ((Abs ^^ n) s) \<degree> t \<leftrightarrow> (Abs ^^ n) s[t/0]

goal (1 subgoal):
 1. (Abs ^^ Suc n) s \<degree> t \<leftrightarrow> (Abs ^^ n) (s[liftn n t 0/n])
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
Abs ((Abs ^^ n) s) \<degree> t \<leftrightarrow> (Abs ^^ n) s[t/0]

goal (1 subgoal):
 1. (Abs ^^ Suc n) s \<degree> t \<leftrightarrow> (Abs ^^ n) (s[liftn n t 0/n])
[PROOF STEP]
have "... = (Abs^^n) (s[liftn n t 0/n])"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (Abs ^^ n) s[t/0] = (Abs ^^ n) (s[liftn n t 0/n])
[PROOF STEP]
by (simp add: absn_subst)
[PROOF STATE]
proof (state)
this:
(Abs ^^ n) s[t/0] = (Abs ^^ n) (s[liftn n t 0/n])

goal (1 subgoal):
 1. (Abs ^^ Suc n) s \<degree> t \<leftrightarrow> (Abs ^^ n) (s[liftn n t 0/n])
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(Abs ^^ Suc n) s \<degree> t \<leftrightarrow> (Abs ^^ n) (s[liftn n t 0/n])
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(Abs ^^ Suc n) s \<degree> t \<leftrightarrow> (Abs ^^ n) (s[liftn n t 0/n])

goal (1 subgoal):
 1. (Abs ^^ Suc n) s \<degree> t \<leftrightarrow> (Abs ^^ n) (s[liftn n t 0/n])
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(Abs ^^ Suc n) s \<degree> t \<leftrightarrow> (Abs ^^ n) (s[liftn n t 0/n])

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma rel_bset_cong [fundef_cong]:
  "\<lbrakk> x=x'; y=y'; \<And>a b. a \<in> set_bset x' \<Longrightarrow> b \<in> set_bset y' \<Longrightarrow> R a b \<longleftrightarrow> R' a b \<rbrakk> \<Longrightarrow> rel_bset R x y \<longleftrightarrow> rel_bset R' x' y'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x = x'; y = y'; \<And>a b. \<lbrakk>a \<in> set_bset x'; b \<in> set_bset y'\<rbrakk> \<Longrightarrow> R a b = R' a b\<rbrakk> \<Longrightarrow> rel_bset R x y = rel_bset R' x' y'
[PROOF STEP]
by (simp add: rel_bset_def rel_set_def)


[STATEMENT]
lemma rtci_isPath: "(v, u) \<in> (E\<inverse>)\<^sup>* \<Longrightarrow> (\<exists>p. isPath u p v)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (v, u) \<in> (E\<inverse>)\<^sup>* \<Longrightarrow> \<exists>p. isPath u p v
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (v, u) \<in> (E\<inverse>)\<^sup>* \<Longrightarrow> \<exists>p. isPath u p v
[PROOF STEP]
assume "(v,u)\<in>(E\<inverse>)\<^sup>*"
[PROOF STATE]
proof (state)
this:
(v, u) \<in> (E\<inverse>)\<^sup>*

goal (1 subgoal):
 1. (v, u) \<in> (E\<inverse>)\<^sup>* \<Longrightarrow> \<exists>p. isPath u p v
[PROOF STEP]
hence "(u,v)\<in>E\<^sup>*"
[PROOF STATE]
proof (prove)
using this:
(v, u) \<in> (E\<inverse>)\<^sup>*

goal (1 subgoal):
 1. (u, v) \<in> E\<^sup>*
[PROOF STEP]
by (rule rtrancl_converseD)
[PROOF STATE]
proof (state)
this:
(u, v) \<in> E\<^sup>*

goal (1 subgoal):
 1. (v, u) \<in> (E\<inverse>)\<^sup>* \<Longrightarrow> \<exists>p. isPath u p v
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
(u, v) \<in> E\<^sup>*

goal (1 subgoal):
 1. \<exists>p. isPath u p v
[PROOF STEP]
by (rule rtc_isPath)
[PROOF STATE]
proof (state)
this:
\<exists>p. isPath u p v

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma continuous_mult_sgn [continuous_intros]:
  fixes f::"real \<Rightarrow> real"
  assumes "continuous_on UNIV f" "f 0 = 0"
  shows "continuous_on UNIV (\<lambda>x. sgn x * f x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on UNIV (\<lambda>x. sgn x * f x)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. continuous_on UNIV (\<lambda>x. sgn x * f x)
[PROOF STEP]
have *: "continuous_on {0..} (\<lambda>x. sgn x * f x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on {0..} (\<lambda>x. sgn x * f x)
[PROOF STEP]
apply (subst continuous_on_cong[of "{0..}" "{0..}" _ f], auto simp add: sgn_real_def assms(2))
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on {0..} f
[PROOF STEP]
by (rule continuous_on_subset[OF assms(1)], auto)
[PROOF STATE]
proof (state)
this:
continuous_on {0..} (\<lambda>x. sgn x * f x)

goal (1 subgoal):
 1. continuous_on UNIV (\<lambda>x. sgn x * f x)
[PROOF STEP]
have **: "continuous_on {..0} (\<lambda>x. sgn x * f x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on {..0} (\<lambda>x. sgn x * f x)
[PROOF STEP]
apply (subst continuous_on_cong[of "{..0}" "{..0}" _ "\<lambda>x. -f x"], auto simp add: sgn_real_def assms(2))
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on {..0} (\<lambda>x. - f x)
[PROOF STEP]
by (rule continuous_on_subset[of UNIV], auto simp add: assms intro!: continuous_intros)
[PROOF STATE]
proof (state)
this:
continuous_on {..0} (\<lambda>x. sgn x * f x)

goal (1 subgoal):
 1. continuous_on UNIV (\<lambda>x. sgn x * f x)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on UNIV (\<lambda>x. sgn x * f x)
[PROOF STEP]
using continuous_on_closed_Un[OF _ _ * **]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>closed {0..}; closed {..0}\<rbrakk> \<Longrightarrow> continuous_on ({0..} \<union> {..0}) (\<lambda>x. sgn x * f x)

goal (1 subgoal):
 1. continuous_on UNIV (\<lambda>x. sgn x * f x)
[PROOF STEP]
apply (auto intro: continuous_intros)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on ({0..} \<union> {..0}) (\<lambda>x. sgn x * f x) \<Longrightarrow> continuous_on UNIV (\<lambda>x. sgn x * f x)
[PROOF STEP]
using continuous_on_subset
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>continuous_on ?s ?f; ?t \<subseteq> ?s\<rbrakk> \<Longrightarrow> continuous_on ?t ?f

goal (1 subgoal):
 1. continuous_on ({0..} \<union> {..0}) (\<lambda>x. sgn x * f x) \<Longrightarrow> continuous_on UNIV (\<lambda>x. sgn x * f x)
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
continuous_on UNIV (\<lambda>x. sgn x * f x)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma suminf_real_offset_le:
  fixes f :: "nat \<Rightarrow> real"
  assumes f: "\<And>i. 0 \<le> f i" and "summable f"
  shows "(\<Sum>i. f (i + k)) \<le> suminf f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i. f (i + k)) \<le> suminf f
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<Sum>i. f (i + k)) \<le> suminf f
[PROOF STEP]
have "(\<lambda>n. \<Sum>i<n. f (i + k)) \<longlonglongrightarrow> (\<Sum>i. f (i + k))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. \<Sum>i<n. f (i + k)) \<longlonglongrightarrow> (\<Sum>i. f (i + k))
[PROOF STEP]
using summable_sums[OF \<open>summable f\<close>]
[PROOF STATE]
proof (prove)
using this:
f sums suminf f

goal (1 subgoal):
 1. (\<lambda>n. \<Sum>i<n. f (i + k)) \<longlonglongrightarrow> (\<Sum>i. f (i + k))
[PROOF STEP]
by (simp add: assms(2) summable_LIMSEQ summable_ignore_initial_segment)
[PROOF STATE]
proof (state)
this:
(\<lambda>n. \<Sum>i<n. f (i + k)) \<longlonglongrightarrow> (\<Sum>i. f (i + k))

goal (1 subgoal):
 1. (\<Sum>i. f (i + k)) \<le> suminf f
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(\<lambda>n. \<Sum>i<n. f (i + k)) \<longlonglongrightarrow> (\<Sum>i. f (i + k))

goal (1 subgoal):
 1. (\<Sum>i. f (i + k)) \<le> suminf f
[PROOF STEP]
have "(\<lambda>n. \<Sum>i<n. f i) \<longlonglongrightarrow> (\<Sum>i. f i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. sum f {..<n}) \<longlonglongrightarrow> (\<Sum>i. f i)
[PROOF STEP]
using summable_sums[OF \<open>summable f\<close>]
[PROOF STATE]
proof (prove)
using this:
f sums suminf f

goal (1 subgoal):
 1. (\<lambda>n. sum f {..<n}) \<longlonglongrightarrow> (\<Sum>i. f i)
[PROOF STEP]
by (simp add: sums_def atLeast0LessThan f)
[PROOF STATE]
proof (state)
this:
(\<lambda>n. sum f {..<n}) \<longlonglongrightarrow> (\<Sum>i. f i)

goal (1 subgoal):
 1. (\<Sum>i. f (i + k)) \<le> suminf f
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>n. sum f {..<n}) \<longlonglongrightarrow> (\<Sum>i. f i)
[PROOF STEP]
have "(\<lambda>n. \<Sum>i<n + k. f i) \<longlonglongrightarrow> (\<Sum>i. f i)"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. sum f {..<n}) \<longlonglongrightarrow> (\<Sum>i. f i)

goal (1 subgoal):
 1. (\<lambda>n. sum f {..<n + k}) \<longlonglongrightarrow> (\<Sum>i. f i)
[PROOF STEP]
by (rule LIMSEQ_ignore_initial_segment)
[PROOF STATE]
proof (state)
this:
(\<lambda>n. sum f {..<n + k}) \<longlonglongrightarrow> (\<Sum>i. f i)

goal (1 subgoal):
 1. (\<Sum>i. f (i + k)) \<le> suminf f
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>n. \<Sum>i<n. f (i + k)) \<longlonglongrightarrow> (\<Sum>i. f (i + k))
(\<lambda>n. sum f {..<n + k}) \<longlonglongrightarrow> (\<Sum>i. f i)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. \<Sum>i<n. f (i + k)) \<longlonglongrightarrow> (\<Sum>i. f (i + k))
(\<lambda>n. sum f {..<n + k}) \<longlonglongrightarrow> (\<Sum>i. f i)

goal (1 subgoal):
 1. (\<Sum>i. f (i + k)) \<le> suminf f
[PROOF STEP]
proof (rule LIMSEQ_le, safe intro!: exI[of _ k])
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. \<lbrakk>(\<lambda>n. \<Sum>i<n. f (i + k)) \<longlonglongrightarrow> (\<Sum>i. f (i + k)); (\<lambda>n. sum f {..<n + k}) \<longlonglongrightarrow> (\<Sum>i. f i); k \<le> n\<rbrakk> \<Longrightarrow> (\<Sum>i<n. f (i + k)) \<le> sum f {..<n + k}
[PROOF STEP]
fix n
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. \<lbrakk>(\<lambda>n. \<Sum>i<n. f (i + k)) \<longlonglongrightarrow> (\<Sum>i. f (i + k)); (\<lambda>n. sum f {..<n + k}) \<longlonglongrightarrow> (\<Sum>i. f i); k \<le> n\<rbrakk> \<Longrightarrow> (\<Sum>i<n. f (i + k)) \<le> sum f {..<n + k}
[PROOF STEP]
assume "k \<le> n"
[PROOF STATE]
proof (state)
this:
k \<le> n

goal (1 subgoal):
 1. \<And>n. \<lbrakk>(\<lambda>n. \<Sum>i<n. f (i + k)) \<longlonglongrightarrow> (\<Sum>i. f (i + k)); (\<lambda>n. sum f {..<n + k}) \<longlonglongrightarrow> (\<Sum>i. f i); k \<le> n\<rbrakk> \<Longrightarrow> (\<Sum>i<n. f (i + k)) \<le> sum f {..<n + k}
[PROOF STEP]
have "(\<Sum>i<n. f (i + k)) = (\<Sum>i<n. (f \<circ> (\<lambda>i. i + k)) i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i<n. f (i + k)) = sum (f \<circ> (\<lambda>i. i + k)) {..<n}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<Sum>i<n. f (i + k)) = sum (f \<circ> (\<lambda>i. i + k)) {..<n}

goal (1 subgoal):
 1. \<And>n. \<lbrakk>(\<lambda>n. \<Sum>i<n. f (i + k)) \<longlonglongrightarrow> (\<Sum>i. f (i + k)); (\<lambda>n. sum f {..<n + k}) \<longlonglongrightarrow> (\<Sum>i. f i); k \<le> n\<rbrakk> \<Longrightarrow> (\<Sum>i<n. f (i + k)) \<le> sum f {..<n + k}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>i<n. f (i + k)) = sum (f \<circ> (\<lambda>i. i + k)) {..<n}

goal (1 subgoal):
 1. \<And>n. \<lbrakk>(\<lambda>n. \<Sum>i<n. f (i + k)) \<longlonglongrightarrow> (\<Sum>i. f (i + k)); (\<lambda>n. sum f {..<n + k}) \<longlonglongrightarrow> (\<Sum>i. f i); k \<le> n\<rbrakk> \<Longrightarrow> (\<Sum>i<n. f (i + k)) \<le> sum f {..<n + k}
[PROOF STEP]
have "\<dots> = (\<Sum>i\<in>(\<lambda>i. i + k) ` {..<n}. f i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum (f \<circ> (\<lambda>i. i + k)) {..<n} = sum f ((\<lambda>i. i + k) ` {..<n})
[PROOF STEP]
by (subst sum.reindex) auto
[PROOF STATE]
proof (state)
this:
sum (f \<circ> (\<lambda>i. i + k)) {..<n} = sum f ((\<lambda>i. i + k) ` {..<n})

goal (1 subgoal):
 1. \<And>n. \<lbrakk>(\<lambda>n. \<Sum>i<n. f (i + k)) \<longlonglongrightarrow> (\<Sum>i. f (i + k)); (\<lambda>n. sum f {..<n + k}) \<longlonglongrightarrow> (\<Sum>i. f i); k \<le> n\<rbrakk> \<Longrightarrow> (\<Sum>i<n. f (i + k)) \<le> sum f {..<n + k}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
sum (f \<circ> (\<lambda>i. i + k)) {..<n} = sum f ((\<lambda>i. i + k) ` {..<n})

goal (1 subgoal):
 1. \<And>n. \<lbrakk>(\<lambda>n. \<Sum>i<n. f (i + k)) \<longlonglongrightarrow> (\<Sum>i. f (i + k)); (\<lambda>n. sum f {..<n + k}) \<longlonglongrightarrow> (\<Sum>i. f i); k \<le> n\<rbrakk> \<Longrightarrow> (\<Sum>i<n. f (i + k)) \<le> sum f {..<n + k}
[PROOF STEP]
have "\<dots> \<le> sum f {..<n + k}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum f ((\<lambda>i. i + k) ` {..<n}) \<le> sum f {..<n + k}
[PROOF STEP]
by (intro sum_mono2) (auto simp: f)
[PROOF STATE]
proof (state)
this:
sum f ((\<lambda>i. i + k) ` {..<n}) \<le> sum f {..<n + k}

goal (1 subgoal):
 1. \<And>n. \<lbrakk>(\<lambda>n. \<Sum>i<n. f (i + k)) \<longlonglongrightarrow> (\<Sum>i. f (i + k)); (\<lambda>n. sum f {..<n + k}) \<longlonglongrightarrow> (\<Sum>i. f i); k \<le> n\<rbrakk> \<Longrightarrow> (\<Sum>i<n. f (i + k)) \<le> sum f {..<n + k}
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<Sum>i<n. f (i + k)) \<le> sum f {..<n + k}
[PROOF STEP]
show "(\<Sum>i<n. f (i + k)) \<le> sum f {..<n + k}"
[PROOF STATE]
proof (prove)
using this:
(\<Sum>i<n. f (i + k)) \<le> sum f {..<n + k}

goal (1 subgoal):
 1. (\<Sum>i<n. f (i + k)) \<le> sum f {..<n + k}
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(\<Sum>i<n. f (i + k)) \<le> sum f {..<n + k}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<Sum>i. f (i + k)) \<le> suminf f

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma leq_add_left:
  shows "x \<le> y + x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<le> y + x
[PROOF STEP]
using add_right_mono[OF zero_min[of y], of x]
[PROOF STATE]
proof (prove)
using this:
(0::'a) + x \<le> y + x

goal (1 subgoal):
 1. x \<le> y + x
[PROOF STEP]
by simp


[STATEMENT]
lemma supp_DNil:
  shows "supp DNil = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. supp []\<^sub>\<Delta> = {}
[PROOF STEP]
by (simp add: supp_def)


[STATEMENT]
lemma irreducible_imp_primitive:
  fixes f :: "'a :: {idom,semiring_gcd} poly"
  assumes irr: "irreducible f" and deg: "degree f \<noteq> 0" shows "primitive f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. primitive f
[PROOF STEP]
proof (rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> primitive f \<Longrightarrow> False
[PROOF STEP]
assume not: "\<not> ?thesis"
[PROOF STATE]
proof (state)
this:
\<not> primitive f

goal (1 subgoal):
 1. \<not> primitive f \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> primitive f
[PROOF STEP]
have "\<not> [:content f:] dvd 1"
[PROOF STATE]
proof (prove)
using this:
\<not> primitive f

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

goal (1 subgoal):
 1. \<not> primitive f \<Longrightarrow> False
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<not> [:content f:] dvd 1

goal (1 subgoal):
 1. \<not> primitive f \<Longrightarrow> False
[PROOF STEP]
have "f = [:content f:] * primitive_part f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f = [:content f:] * primitive_part f
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
f = [:content f:] * primitive_part f

goal (1 subgoal):
 1. \<not> primitive f \<Longrightarrow> False
[PROOF STEP]
note Factorial_Ring.irreducibleD[OF irr this]
[PROOF STATE]
proof (state)
this:
[:content f:] dvd 1 \<or> primitive_part f dvd 1

goal (1 subgoal):
 1. \<not> primitive f \<Longrightarrow> False
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<not> [:content f:] dvd 1
[:content f:] dvd 1 \<or> primitive_part f dvd 1
[PROOF STEP]
have "primitive_part f dvd 1"
[PROOF STATE]
proof (prove)
using this:
\<not> [:content f:] dvd 1
[:content f:] dvd 1 \<or> primitive_part f dvd 1

goal (1 subgoal):
 1. primitive_part f dvd 1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
primitive_part f dvd 1

goal (1 subgoal):
 1. \<not> primitive f \<Longrightarrow> False
[PROOF STEP]
from this[unfolded poly_dvd_1]
[PROOF STATE]
proof (chain)
picking this:
degree (primitive_part f) = 0 \<and> is_unit (coeff (primitive_part f) 0)
[PROOF STEP]
have "degree f = 0"
[PROOF STATE]
proof (prove)
using this:
degree (primitive_part f) = 0 \<and> is_unit (coeff (primitive_part f) 0)

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

goal (1 subgoal):
 1. \<not> primitive f \<Longrightarrow> False
[PROOF STEP]
with deg
[PROOF STATE]
proof (chain)
picking this:
degree f \<noteq> 0
degree f = 0
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
degree f \<noteq> 0
degree f = 0

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma fds_ln_mult:
  assumes "fds_nth f 1 \<noteq> 0" "fds_nth g 1 \<noteq> 0" "l' + l'' = l"
  shows   "fds_ln l (f * g) = fds_ln l' f + fds_ln l'' g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fds_ln l (f * g) = fds_ln l' f + fds_ln l'' g
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. fds_ln l (f * g) = fds_ln l' f + fds_ln l'' g
[PROOF STEP]
have "fds_ln l (f * g) = fds_integral (l' + l'') ((fds_deriv f * g + f * fds_deriv g) / (f * g))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fds_ln l (f * g) = fds_integral (l' + l'') ((fds_deriv f * g + f * fds_deriv g) / (f * g))
[PROOF STEP]
by (simp add: fds_ln_def assms)
[PROOF STATE]
proof (state)
this:
fds_ln l (f * g) = fds_integral (l' + l'') ((fds_deriv f * g + f * fds_deriv g) / (f * g))

goal (1 subgoal):
 1. fds_ln l (f * g) = fds_ln l' f + fds_ln l'' g
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
fds_ln l (f * g) = fds_integral (l' + l'') ((fds_deriv f * g + f * fds_deriv g) / (f * g))

goal (1 subgoal):
 1. fds_ln l (f * g) = fds_ln l' f + fds_ln l'' g
[PROOF STEP]
have "(fds_deriv f * g + f * fds_deriv g) / (f * g) =
               fds_deriv f / f * (g * inverse g) + fds_deriv g / g * (f * inverse f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (fds_deriv f * g + f * fds_deriv g) / (f * g) = fds_deriv f / f * (g * inverse g) + fds_deriv g / g * (f * inverse f)
[PROOF STEP]
by (simp add: divide_fds_def algebra_simps inverse_mult_fds)
[PROOF STATE]
proof (state)
this:
(fds_deriv f * g + f * fds_deriv g) / (f * g) = fds_deriv f / f * (g * inverse g) + fds_deriv g / g * (f * inverse f)

goal (1 subgoal):
 1. fds_ln l (f * g) = fds_ln l' f + fds_ln l'' g
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(fds_deriv f * g + f * fds_deriv g) / (f * g) = fds_deriv f / f * (g * inverse g) + fds_deriv g / g * (f * inverse f)

goal (1 subgoal):
 1. fds_ln l (f * g) = fds_ln l' f + fds_ln l'' g
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
fds_nth f 1 \<noteq> (0::'a)
fds_nth g 1 \<noteq> (0::'a)
l' + l'' = l
[PROOF STEP]
have "f * inverse f = 1"
[PROOF STATE]
proof (prove)
using this:
fds_nth f 1 \<noteq> (0::'a)
fds_nth g 1 \<noteq> (0::'a)
l' + l'' = l

goal (1 subgoal):
 1. f * inverse f = 1
[PROOF STEP]
by (intro fds_right_inverse) auto
[PROOF STATE]
proof (state)
this:
f * inverse f = 1

goal (1 subgoal):
 1. fds_ln l (f * g) = fds_ln l' f + fds_ln l'' g
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
f * inverse f = 1

goal (1 subgoal):
 1. fds_ln l (f * g) = fds_ln l' f + fds_ln l'' g
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
fds_nth f 1 \<noteq> (0::'a)
fds_nth g 1 \<noteq> (0::'a)
l' + l'' = l
[PROOF STEP]
have "g * inverse g = 1"
[PROOF STATE]
proof (prove)
using this:
fds_nth f 1 \<noteq> (0::'a)
fds_nth g 1 \<noteq> (0::'a)
l' + l'' = l

goal (1 subgoal):
 1. g * inverse g = 1
[PROOF STEP]
by (intro fds_right_inverse) auto
[PROOF STATE]
proof (state)
this:
g * inverse g = 1

goal (1 subgoal):
 1. fds_ln l (f * g) = fds_ln l' f + fds_ln l'' g
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
fds_ln l (f * g) = fds_integral (l' + l'') (fds_deriv f / f * 1 + fds_deriv g / g * 1)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
fds_ln l (f * g) = fds_integral (l' + l'') (fds_deriv f / f * 1 + fds_deriv g / g * 1)

goal (1 subgoal):
 1. fds_ln l (f * g) = fds_ln l' f + fds_ln l'' g
[PROOF STEP]
by (simp add: fds_integral_add fds_ln_def)
[PROOF STATE]
proof (state)
this:
fds_ln l (f * g) = fds_ln l' f + fds_ln l'' g

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma nth_butlast:
  assumes "n < length (butlast xs)" shows "butlast xs ! n = xs ! n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. butlast xs ! n = xs ! n
[PROOF STEP]
proof (cases xs)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. xs = [] \<Longrightarrow> butlast xs ! n = xs ! n
 2. \<And>a list. xs = a # list \<Longrightarrow> butlast xs ! n = xs ! n
[PROOF STEP]
case (Cons y ys)
[PROOF STATE]
proof (state)
this:
xs = y # ys

goal (2 subgoals):
 1. xs = [] \<Longrightarrow> butlast xs ! n = xs ! n
 2. \<And>a list. xs = a # list \<Longrightarrow> butlast xs ! n = xs ! n
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
xs = y # ys

goal (2 subgoals):
 1. xs = [] \<Longrightarrow> butlast xs ! n = xs ! n
 2. \<And>a list. xs = a # list \<Longrightarrow> butlast xs ! n = xs ! n
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
n < length (butlast xs)
[PROOF STEP]
have "butlast xs ! n = (butlast xs @ [last xs]) ! n"
[PROOF STATE]
proof (prove)
using this:
n < length (butlast xs)

goal (1 subgoal):
 1. butlast xs ! n = (butlast xs @ [last xs]) ! n
[PROOF STEP]
by (simp add: nth_append)
[PROOF STATE]
proof (state)
this:
butlast xs ! n = (butlast xs @ [last xs]) ! n

goal (2 subgoals):
 1. xs = [] \<Longrightarrow> butlast xs ! n = xs ! n
 2. \<And>a list. xs = a # list \<Longrightarrow> butlast xs ! n = xs ! n
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
xs = y # ys
butlast xs ! n = (butlast xs @ [last xs]) ! n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
xs = y # ys
butlast xs ! n = (butlast xs @ [last xs]) ! n

goal (1 subgoal):
 1. butlast xs ! n = xs ! n
[PROOF STEP]
using append_butlast_last_id
[PROOF STATE]
proof (prove)
using this:
xs = y # ys
butlast xs ! n = (butlast xs @ [last xs]) ! n
?xs \<noteq> [] \<Longrightarrow> butlast ?xs @ [last ?xs] = ?xs

goal (1 subgoal):
 1. butlast xs ! n = xs ! n
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
butlast xs ! n = xs ! n

goal (1 subgoal):
 1. xs = [] \<Longrightarrow> butlast xs ! n = xs ! n
[PROOF STEP]
qed simp