[STATEMENT]
lemma integral_has_vector_derivative_piecewise_continuous:
  fixes f :: "real \<Rightarrow> 'a::euclidean_space"\<comment>\<open>TODO: generalize?\<close>
  assumes "piecewise_continuous_on a b D f"
  shows "\<And>x. x \<in> {a .. b} - D \<Longrightarrow>
    ((\<lambda>u. integral {a..u} f) has_vector_derivative f(x)) (at x within {a..b} - D)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. x \<in> {a..b} - D \<Longrightarrow> ((\<lambda>u. integral {a..u} f) has_vector_derivative f x) (at x within {a..b} - D)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
piecewise_continuous_on a b D f

goal (1 subgoal):
 1. \<And>x. x \<in> {a..b} - D \<Longrightarrow> ((\<lambda>u. integral {a..u} f) has_vector_derivative f x) (at x within {a..b} - D)
[PROOF STEP]
proof (induction a b D f rule: piecewise_continuous_on_induct)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>a b f x. \<lbrakk>continuous_on {a..b} f; x \<in> {a..b} - {}\<rbrakk> \<Longrightarrow> ((\<lambda>u. integral {a..u} f) has_vector_derivative f x) (at x within {a..b} - {})
 2. \<And>a i b I f1 f2 f x. \<lbrakk>a \<le> i; i \<le> b; i \<notin> I; \<And>x. x \<in> {a..i} - I \<Longrightarrow> ((\<lambda>u. integral {a..u} f1) has_vector_derivative f1 x) (at x within {a..i} - I); \<And>x. x \<in> {i..b} - I \<Longrightarrow> ((\<lambda>u. integral {i..u} f2) has_vector_derivative f2 x) (at x within {i..b} - I); piecewise_continuous_on a i I f1; piecewise_continuous_on i b I f2; \<And>x. \<lbrakk>a \<le> x; x < i\<rbrakk> \<Longrightarrow> f1 x = f x; \<And>x. \<lbrakk>i < x; x \<le> b\<rbrakk> \<Longrightarrow> f2 x = f x; a < i \<Longrightarrow> (f \<longlongrightarrow> f1 i) (at_left i); i < b \<Longrightarrow> (f \<longlongrightarrow> f2 i) (at_right i); x \<in> {a..b} - insert i I\<rbrakk> \<Longrightarrow> ((\<lambda>u. integral {a..u} f) has_vector_derivative f x) (at x within {a..b} - insert i I)
 3. \<And>a b i I f x. \<lbrakk>\<And>x. x \<in> {a..b} - I \<Longrightarrow> ((\<lambda>u. integral {a..u} f) has_vector_derivative f x) (at x within {a..b} - I); finite I; i \<notin> I; x \<in> {a..b} - insert i I\<rbrakk> \<Longrightarrow> ((\<lambda>u. integral {a..u} f) has_vector_derivative f x) (at x within {a..b} - insert i I)
[PROOF STEP]
case (empty a b f)
[PROOF STATE]
proof (state)
this:
continuous_on {a..b} f
x \<in> {a..b} - {}

goal (3 subgoals):
 1. \<And>a b f x. \<lbrakk>continuous_on {a..b} f; x \<in> {a..b} - {}\<rbrakk> \<Longrightarrow> ((\<lambda>u. integral {a..u} f) has_vector_derivative f x) (at x within {a..b} - {})
 2. \<And>a i b I f1 f2 f x. \<lbrakk>a \<le> i; i \<le> b; i \<notin> I; \<And>x. x \<in> {a..i} - I \<Longrightarrow> ((\<lambda>u. integral {a..u} f1) has_vector_derivative f1 x) (at x within {a..i} - I); \<And>x. x \<in> {i..b} - I \<Longrightarrow> ((\<lambda>u. integral {i..u} f2) has_vector_derivative f2 x) (at x within {i..b} - I); piecewise_continuous_on a i I f1; piecewise_continuous_on i b I f2; \<And>x. \<lbrakk>a \<le> x; x < i\<rbrakk> \<Longrightarrow> f1 x = f x; \<And>x. \<lbrakk>i < x; x \<le> b\<rbrakk> \<Longrightarrow> f2 x = f x; a < i \<Longrightarrow> (f \<longlongrightarrow> f1 i) (at_left i); i < b \<Longrightarrow> (f \<longlongrightarrow> f2 i) (at_right i); x \<in> {a..b} - insert i I\<rbrakk> \<Longrightarrow> ((\<lambda>u. integral {a..u} f) has_vector_derivative f x) (at x within {a..b} - insert i I)
 3. \<And>a b i I f x. \<lbrakk>\<And>x. x \<in> {a..b} - I \<Longrightarrow> ((\<lambda>u. integral {a..u} f) has_vector_derivative f x) (at x within {a..b} - I); finite I; i \<notin> I; x \<in> {a..b} - insert i I\<rbrakk> \<Longrightarrow> ((\<lambda>u. integral {a..u} f) has_vector_derivative f x) (at x within {a..b} - insert i I)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
continuous_on {a..b} f
x \<in> {a..b} - {}
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
continuous_on {a..b} f
x \<in> {a..b} - {}

goal (1 subgoal):
 1. ((\<lambda>u. integral {a..u} f) has_vector_derivative f x) (at x within {a..b} - {})
[PROOF STEP]
by (auto intro: integral_has_vector_derivative)
[PROOF STATE]
proof (state)
this:
((\<lambda>u. integral {a..u} f) has_vector_derivative f x) (at x within {a..b} - {})

goal (2 subgoals):
 1. \<And>a i b I f1 f2 f x. \<lbrakk>a \<le> i; i \<le> b; i \<notin> I; \<And>x. x \<in> {a..i} - I \<Longrightarrow> ((\<lambda>u. integral {a..u} f1) has_vector_derivative f1 x) (at x within {a..i} - I); \<And>x. x \<in> {i..b} - I \<Longrightarrow> ((\<lambda>u. integral {i..u} f2) has_vector_derivative f2 x) (at x within {i..b} - I); piecewise_continuous_on a i I f1; piecewise_continuous_on i b I f2; \<And>x. \<lbrakk>a \<le> x; x < i\<rbrakk> \<Longrightarrow> f1 x = f x; \<And>x. \<lbrakk>i < x; x \<le> b\<rbrakk> \<Longrightarrow> f2 x = f x; a < i \<Longrightarrow> (f \<longlongrightarrow> f1 i) (at_left i); i < b \<Longrightarrow> (f \<longlongrightarrow> f2 i) (at_right i); x \<in> {a..b} - insert i I\<rbrakk> \<Longrightarrow> ((\<lambda>u. integral {a..u} f) has_vector_derivative f x) (at x within {a..b} - insert i I)
 2. \<And>a b i I f x. \<lbrakk>\<And>x. x \<in> {a..b} - I \<Longrightarrow> ((\<lambda>u. integral {a..u} f) has_vector_derivative f x) (at x within {a..b} - I); finite I; i \<notin> I; x \<in> {a..b} - insert i I\<rbrakk> \<Longrightarrow> ((\<lambda>u. integral {a..u} f) has_vector_derivative f x) (at x within {a..b} - insert i I)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>a i b I f1 f2 f x. \<lbrakk>a \<le> i; i \<le> b; i \<notin> I; \<And>x. x \<in> {a..i} - I \<Longrightarrow> ((\<lambda>u. integral {a..u} f1) has_vector_derivative f1 x) (at x within {a..i} - I); \<And>x. x \<in> {i..b} - I \<Longrightarrow> ((\<lambda>u. integral {i..u} f2) has_vector_derivative f2 x) (at x within {i..b} - I); piecewise_continuous_on a i I f1; piecewise_continuous_on i b I f2; \<And>x. \<lbrakk>a \<le> x; x < i\<rbrakk> \<Longrightarrow> f1 x = f x; \<And>x. \<lbrakk>i < x; x \<le> b\<rbrakk> \<Longrightarrow> f2 x = f x; a < i \<Longrightarrow> (f \<longlongrightarrow> f1 i) (at_left i); i < b \<Longrightarrow> (f \<longlongrightarrow> f2 i) (at_right i); x \<in> {a..b} - insert i I\<rbrakk> \<Longrightarrow> ((\<lambda>u. integral {a..u} f) has_vector_derivative f x) (at x within {a..b} - insert i I)
 2. \<And>a b i I f x. \<lbrakk>\<And>x. x \<in> {a..b} - I \<Longrightarrow> ((\<lambda>u. integral {a..u} f) has_vector_derivative f x) (at x within {a..b} - I); finite I; i \<notin> I; x \<in> {a..b} - insert i I\<rbrakk> \<Longrightarrow> ((\<lambda>u. integral {a..u} f) has_vector_derivative f x) (at x within {a..b} - insert i I)
[PROOF STEP]
case (combine a i b I f1 f2 f)
[PROOF STATE]
proof (state)
this:
a \<le> i
i \<le> b
i \<notin> I
piecewise_continuous_on a i I f1
piecewise_continuous_on i b I f2
\<lbrakk>a \<le> ?x; ?x < i\<rbrakk> \<Longrightarrow> f1 ?x = f ?x
\<lbrakk>i < ?x; ?x \<le> b\<rbrakk> \<Longrightarrow> f2 ?x = f ?x
a < i \<Longrightarrow> (f \<longlongrightarrow> f1 i) (at_left i)
i < b \<Longrightarrow> (f \<longlongrightarrow> f2 i) (at_right i)
?x \<in> {a..i} - I \<Longrightarrow> ((\<lambda>u. integral {a..u} f1) has_vector_derivative f1 ?x) (at ?x within {a..i} - I)
?x \<in> {i..b} - I \<Longrightarrow> ((\<lambda>u. integral {i..u} f2) has_vector_derivative f2 ?x) (at ?x within {i..b} - I)
x \<in> {a..b} - insert i I

goal (2 subgoals):
 1. \<And>a i b I f1 f2 f x. \<lbrakk>a \<le> i; i \<le> b; i \<notin> I; \<And>x. x \<in> {a..i} - I \<Longrightarrow> ((\<lambda>u. integral {a..u} f1) has_vector_derivative f1 x) (at x within {a..i} - I); \<And>x. x \<in> {i..b} - I \<Longrightarrow> ((\<lambda>u. integral {i..u} f2) has_vector_derivative f2 x) (at x within {i..b} - I); piecewise_continuous_on a i I f1; piecewise_continuous_on i b I f2; \<And>x. \<lbrakk>a \<le> x; x < i\<rbrakk> \<Longrightarrow> f1 x = f x; \<And>x. \<lbrakk>i < x; x \<le> b\<rbrakk> \<Longrightarrow> f2 x = f x; a < i \<Longrightarrow> (f \<longlongrightarrow> f1 i) (at_left i); i < b \<Longrightarrow> (f \<longlongrightarrow> f2 i) (at_right i); x \<in> {a..b} - insert i I\<rbrakk> \<Longrightarrow> ((\<lambda>u. integral {a..u} f) has_vector_derivative f x) (at x within {a..b} - insert i I)
 2. \<And>a b i I f x. \<lbrakk>\<And>x. x \<in> {a..b} - I \<Longrightarrow> ((\<lambda>u. integral {a..u} f) has_vector_derivative f x) (at x within {a..b} - I); finite I; i \<notin> I; x \<in> {a..b} - insert i I\<rbrakk> \<Longrightarrow> ((\<lambda>u. integral {a..u} f) has_vector_derivative f x) (at x within {a..b} - insert i I)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a \<le> i
i \<le> b
i \<notin> I
piecewise_continuous_on a i I f1
piecewise_continuous_on i b I f2
\<lbrakk>a \<le> ?x; ?x < i\<rbrakk> \<Longrightarrow> f1 ?x = f ?x
\<lbrakk>i < ?x; ?x \<le> b\<rbrakk> \<Longrightarrow> f2 ?x = f ?x
a < i \<Longrightarrow> (f \<longlongrightarrow> f1 i) (at_left i)
i < b \<Longrightarrow> (f \<longlongrightarrow> f2 i) (at_right i)
?x \<in> {a..i} - I \<Longrightarrow> ((\<lambda>u. integral {a..u} f1) has_vector_derivative f1 ?x) (at ?x within {a..i} - I)
?x \<in> {i..b} - I \<Longrightarrow> ((\<lambda>u. integral {i..u} f2) has_vector_derivative f2 ?x) (at ?x within {i..b} - I)
x \<in> {a..b} - insert i I
[PROOF STEP]
consider "x < i" | "i < x"
[PROOF STATE]
proof (prove)
using this:
a \<le> i
i \<le> b
i \<notin> I
piecewise_continuous_on a i I f1
piecewise_continuous_on i b I f2
\<lbrakk>a \<le> ?x; ?x < i\<rbrakk> \<Longrightarrow> f1 ?x = f ?x
\<lbrakk>i < ?x; ?x \<le> b\<rbrakk> \<Longrightarrow> f2 ?x = f ?x
a < i \<Longrightarrow> (f \<longlongrightarrow> f1 i) (at_left i)
i < b \<Longrightarrow> (f \<longlongrightarrow> f2 i) (at_right i)
?x \<in> {a..i} - I \<Longrightarrow> ((\<lambda>u. integral {a..u} f1) has_vector_derivative f1 ?x) (at ?x within {a..i} - I)
?x \<in> {i..b} - I \<Longrightarrow> ((\<lambda>u. integral {i..u} f2) has_vector_derivative f2 ?x) (at ?x within {i..b} - I)
x \<in> {a..b} - insert i I

goal (1 subgoal):
 1. \<lbrakk>x < i \<Longrightarrow> thesis; i < x \<Longrightarrow> thesis\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
by auto arith
[PROOF STATE]
proof (state)
this:
\<lbrakk>x < i \<Longrightarrow> ?thesis; i < x \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis

goal (2 subgoals):
 1. \<And>a i b I f1 f2 f x. \<lbrakk>a \<le> i; i \<le> b; i \<notin> I; \<And>x. x \<in> {a..i} - I \<Longrightarrow> ((\<lambda>u. integral {a..u} f1) has_vector_derivative f1 x) (at x within {a..i} - I); \<And>x. x \<in> {i..b} - I \<Longrightarrow> ((\<lambda>u. integral {i..u} f2) has_vector_derivative f2 x) (at x within {i..b} - I); piecewise_continuous_on a i I f1; piecewise_continuous_on i b I f2; \<And>x. \<lbrakk>a \<le> x; x < i\<rbrakk> \<Longrightarrow> f1 x = f x; \<And>x. \<lbrakk>i < x; x \<le> b\<rbrakk> \<Longrightarrow> f2 x = f x; a < i \<Longrightarrow> (f \<longlongrightarrow> f1 i) (at_left i); i < b \<Longrightarrow> (f \<longlongrightarrow> f2 i) (at_right i); x \<in> {a..b} - insert i I\<rbrakk> \<Longrightarrow> ((\<lambda>u. integral {a..u} f) has_vector_derivative f x) (at x within {a..b} - insert i I)
 2. \<And>a b i I f x. \<lbrakk>\<And>x. x \<in> {a..b} - I \<Longrightarrow> ((\<lambda>u. integral {a..u} f) has_vector_derivative f x) (at x within {a..b} - I); finite I; i \<notin> I; x \<in> {a..b} - insert i I\<rbrakk> \<Longrightarrow> ((\<lambda>u. integral {a..u} f) has_vector_derivative f x) (at x within {a..b} - insert i I)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>x < i \<Longrightarrow> ?thesis; i < x \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>x < i \<Longrightarrow> ?thesis; i < x \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. ((\<lambda>u. integral {a..u} f) has_vector_derivative f x) (at x within {a..b} - insert i I)
[PROOF STEP]
proof cases\<comment>\<open>TODO: this is very explicit...\<close>
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. x < i \<Longrightarrow> ((\<lambda>u. integral {a..u} f) has_vector_derivative f x) (at x within {a..b} - insert i I)
 2. i < x \<Longrightarrow> ((\<lambda>u. integral {a..u} f) has_vector_derivative f x) (at x within {a..b} - insert i I)
[PROOF STEP]
case 1
[PROOF STATE]
proof (state)
this:
x < i

goal (2 subgoals):
 1. x < i \<Longrightarrow> ((\<lambda>u. integral {a..u} f) has_vector_derivative f x) (at x within {a..b} - insert i I)
 2. i < x \<Longrightarrow> ((\<lambda>u. integral {a..u} f) has_vector_derivative f x) (at x within {a..b} - insert i I)
[PROOF STEP]
have evless: "\<forall>\<^sub>F xa in nhds x. xa < i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F xa in nhds x. xa < i
[PROOF STEP]
apply (rule order_tendstoD[OF _ \<open>x < i\<close>])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. x) \<longlongrightarrow> x) (nhds x)
[PROOF STEP]
by (simp add: filterlim_ident)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F xa in nhds x. xa < i

goal (2 subgoals):
 1. x < i \<Longrightarrow> ((\<lambda>u. integral {a..u} f) has_vector_derivative f x) (at x within {a..b} - insert i I)
 2. i < x \<Longrightarrow> ((\<lambda>u. integral {a..u} f) has_vector_derivative f x) (at x within {a..b} - insert i I)
[PROOF STEP]
have eq: "at x within {a..b} - insert i I = at x within {a .. i} - I"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. at x within {a..b} - insert i I = at x within {a..i} - I
[PROOF STEP]
unfolding filter_eq_iff
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>P. eventually P (at x within {a..b} - insert i I) = eventually P (at x within {a..i} - I)
[PROOF STEP]
proof safe
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>P. eventually P (at x within {a..b} - insert i I) \<Longrightarrow> eventually P (at x within {a..i} - I)
 2. \<And>P. eventually P (at x within {a..i} - I) \<Longrightarrow> eventually P (at x within {a..b} - insert i I)
[PROOF STEP]
fix P
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>P. eventually P (at x within {a..b} - insert i I) \<Longrightarrow> eventually P (at x within {a..i} - I)
 2. \<And>P. eventually P (at x within {a..i} - I) \<Longrightarrow> eventually P (at x within {a..b} - insert i I)
[PROOF STEP]
assume "eventually P (at x within {a..i} - I)"
[PROOF STATE]
proof (state)
this:
eventually P (at x within {a..i} - I)

goal (2 subgoals):
 1. \<And>P. eventually P (at x within {a..b} - insert i I) \<Longrightarrow> eventually P (at x within {a..i} - I)
 2. \<And>P. eventually P (at x within {a..i} - I) \<Longrightarrow> eventually P (at x within {a..b} - insert i I)
[PROOF STEP]
with evless
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F xa in nhds x. xa < i
eventually P (at x within {a..i} - I)
[PROOF STEP]
show "eventually P (at x within {a..b} - insert i I)"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F xa in nhds x. xa < i
eventually P (at x within {a..i} - I)

goal (1 subgoal):
 1. eventually P (at x within {a..b} - insert i I)
[PROOF STEP]
unfolding eventually_at_filter
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F xa in nhds x. xa < i
\<forall>\<^sub>F xa in nhds x. xa \<noteq> x \<longrightarrow> xa \<in> {a..i} - I \<longrightarrow> P xa

goal (1 subgoal):
 1. \<forall>\<^sub>F xa in nhds x. xa \<noteq> x \<longrightarrow> xa \<in> {a..b} - insert i I \<longrightarrow> P xa
[PROOF STEP]
by eventually_elim auto
[PROOF STATE]
proof (state)
this:
eventually P (at x within {a..b} - insert i I)

goal (1 subgoal):
 1. \<And>P. eventually P (at x within {a..b} - insert i I) \<Longrightarrow> eventually P (at x within {a..i} - I)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>P. eventually P (at x within {a..b} - insert i I) \<Longrightarrow> eventually P (at x within {a..i} - I)
[PROOF STEP]
fix P
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>P. eventually P (at x within {a..b} - insert i I) \<Longrightarrow> eventually P (at x within {a..i} - I)
[PROOF STEP]
assume "eventually P (at x within {a..b} - insert i I)"
[PROOF STATE]
proof (state)
this:
eventually P (at x within {a..b} - insert i I)

goal (1 subgoal):
 1. \<And>P. eventually P (at x within {a..b} - insert i I) \<Longrightarrow> eventually P (at x within {a..i} - I)
[PROOF STEP]
with evless
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F xa in nhds x. xa < i
eventually P (at x within {a..b} - insert i I)
[PROOF STEP]
show "eventually P (at x within {a..i} - I)"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F xa in nhds x. xa < i
eventually P (at x within {a..b} - insert i I)

goal (1 subgoal):
 1. eventually P (at x within {a..i} - I)
[PROOF STEP]
unfolding eventually_at_filter
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F xa in nhds x. xa < i
\<forall>\<^sub>F xa in nhds x. xa \<noteq> x \<longrightarrow> xa \<in> {a..b} - insert i I \<longrightarrow> P xa

goal (1 subgoal):
 1. \<forall>\<^sub>F xa in nhds x. xa \<noteq> x \<longrightarrow> xa \<in> {a..i} - I \<longrightarrow> P xa
[PROOF STEP]
apply eventually_elim
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>xa. \<lbrakk>xa < i; xa \<noteq> x \<longrightarrow> xa \<in> {a..b} - insert i I \<longrightarrow> P xa\<rbrakk> \<Longrightarrow> xa \<noteq> x \<longrightarrow> xa \<in> {a..i} - I \<longrightarrow> P xa
[PROOF STEP]
using 1 combine
[PROOF STATE]
proof (prove)
using this:
x < i
a \<le> i
i \<le> b
i \<notin> I
piecewise_continuous_on a i I f1
piecewise_continuous_on i b I f2
\<lbrakk>a \<le> ?x; ?x < i\<rbrakk> \<Longrightarrow> f1 ?x = f ?x
\<lbrakk>i < ?x; ?x \<le> b\<rbrakk> \<Longrightarrow> f2 ?x = f ?x
a < i \<Longrightarrow> (f \<longlongrightarrow> f1 i) (at_left i)
i < b \<Longrightarrow> (f \<longlongrightarrow> f2 i) (at_right i)
?x \<in> {a..i} - I \<Longrightarrow> ((\<lambda>u. integral {a..u} f1) has_vector_derivative f1 ?x) (at ?x within {a..i} - I)
?x \<in> {i..b} - I \<Longrightarrow> ((\<lambda>u. integral {i..u} f2) has_vector_derivative f2 ?x) (at ?x within {i..b} - I)
x \<in> {a..b} - insert i I

goal (1 subgoal):
 1. \<And>xa. \<lbrakk>xa < i; xa \<noteq> x \<longrightarrow> xa \<in> {a..b} - insert i I \<longrightarrow> P xa\<rbrakk> \<Longrightarrow> xa \<noteq> x \<longrightarrow> xa \<in> {a..i} - I \<longrightarrow> P xa
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
eventually P (at x within {a..i} - I)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
at x within {a..b} - insert i I = at x within {a..i} - I

goal (2 subgoals):
 1. x < i \<Longrightarrow> ((\<lambda>u. integral {a..u} f) has_vector_derivative f x) (at x within {a..b} - insert i I)
 2. i < x \<Longrightarrow> ((\<lambda>u. integral {a..u} f) has_vector_derivative f x) (at x within {a..b} - insert i I)
[PROOF STEP]
have "f x = f1 x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f x = f1 x
[PROOF STEP]
using combine 1
[PROOF STATE]
proof (prove)
using this:
a \<le> i
i \<le> b
i \<notin> I
piecewise_continuous_on a i I f1
piecewise_continuous_on i b I f2
\<lbrakk>a \<le> ?x; ?x < i\<rbrakk> \<Longrightarrow> f1 ?x = f ?x
\<lbrakk>i < ?x; ?x \<le> b\<rbrakk> \<Longrightarrow> f2 ?x = f ?x
a < i \<Longrightarrow> (f \<longlongrightarrow> f1 i) (at_left i)
i < b \<Longrightarrow> (f \<longlongrightarrow> f2 i) (at_right i)
?x \<in> {a..i} - I \<Longrightarrow> ((\<lambda>u. integral {a..u} f1) has_vector_derivative f1 ?x) (at ?x within {a..i} - I)
?x \<in> {i..b} - I \<Longrightarrow> ((\<lambda>u. integral {i..u} f2) has_vector_derivative f2 ?x) (at ?x within {i..b} - I)
x \<in> {a..b} - insert i I
x < i

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

goal (2 subgoals):
 1. x < i \<Longrightarrow> ((\<lambda>u. integral {a..u} f) has_vector_derivative f x) (at x within {a..b} - insert i I)
 2. i < x \<Longrightarrow> ((\<lambda>u. integral {a..u} f) has_vector_derivative f x) (at x within {a..b} - insert i I)
[PROOF STEP]
have i_eq: "integral {a..y} f = integral {a..y} f1" if "y < i" for y
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral {a..y} f = integral {a..y} f1
[PROOF STEP]
using negligible_empty
[PROOF STATE]
proof (prove)
using this:
negligible {}

goal (1 subgoal):
 1. integral {a..y} f = integral {a..y} f1
[PROOF STEP]
apply (rule integral_spike)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. x \<in> {a..y} - {} \<Longrightarrow> f1 x = f x
[PROOF STEP]
using combine 1 that
[PROOF STATE]
proof (prove)
using this:
a \<le> i
i \<le> b
i \<notin> I
piecewise_continuous_on a i I f1
piecewise_continuous_on i b I f2
\<lbrakk>a \<le> ?x; ?x < i\<rbrakk> \<Longrightarrow> f1 ?x = f ?x
\<lbrakk>i < ?x; ?x \<le> b\<rbrakk> \<Longrightarrow> f2 ?x = f ?x
a < i \<Longrightarrow> (f \<longlongrightarrow> f1 i) (at_left i)
i < b \<Longrightarrow> (f \<longlongrightarrow> f2 i) (at_right i)
?x \<in> {a..i} - I \<Longrightarrow> ((\<lambda>u. integral {a..u} f1) has_vector_derivative f1 ?x) (at ?x within {a..i} - I)
?x \<in> {i..b} - I \<Longrightarrow> ((\<lambda>u. integral {i..u} f2) has_vector_derivative f2 ?x) (at ?x within {i..b} - I)
x \<in> {a..b} - insert i I
x < i
y < i

goal (1 subgoal):
 1. \<And>x. x \<in> {a..y} - {} \<Longrightarrow> f1 x = f x
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
?y < i \<Longrightarrow> integral {a..?y} f = integral {a..?y} f1

goal (2 subgoals):
 1. x < i \<Longrightarrow> ((\<lambda>u. integral {a..u} f) has_vector_derivative f x) (at x within {a..b} - insert i I)
 2. i < x \<Longrightarrow> ((\<lambda>u. integral {a..u} f) has_vector_derivative f x) (at x within {a..b} - insert i I)
[PROOF STEP]
from evless
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F xa in nhds x. xa < i
[PROOF STEP]
have ev_eq: "\<forall>\<^sub>F x in nhds x. x \<in> {a..i} - I \<longrightarrow> integral {a..x} f = integral {a..x} f1"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F xa in nhds x. xa < i

goal (1 subgoal):
 1. \<forall>\<^sub>F x in nhds x. x \<in> {a..i} - I \<longrightarrow> integral {a..x} f = integral {a..x} f1
[PROOF STEP]
by eventually_elim (auto simp: i_eq)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in nhds x. x \<in> {a..i} - I \<longrightarrow> integral {a..x} f = integral {a..x} f1

goal (2 subgoals):
 1. x < i \<Longrightarrow> ((\<lambda>u. integral {a..u} f) has_vector_derivative f x) (at x within {a..b} - insert i I)
 2. i < x \<Longrightarrow> ((\<lambda>u. integral {a..u} f) has_vector_derivative f x) (at x within {a..b} - insert i I)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>u. integral {a..u} f) has_vector_derivative f x) (at x within {a..b} - insert i I)
[PROOF STEP]
unfolding eq \<open>f x = f1 x\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>u. integral {a..u} f) has_vector_derivative f1 x) (at x within {a..i} - I)
[PROOF STEP]
apply (subst has_vector_derivative_cong_ev[OF ev_eq])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. integral {a..x} f = integral {a..x} f1
 2. ((\<lambda>x. integral {a..x} f1) has_vector_derivative f1 x) (at x within {a..i} - I)
[PROOF STEP]
using combine.IH[of x]
[PROOF STATE]
proof (prove)
using this:
x \<in> {a..i} - I \<Longrightarrow> ((\<lambda>u. integral {a..u} f1) has_vector_derivative f1 x) (at x within {a..i} - I)
x \<in> {i..b} - I \<Longrightarrow> ((\<lambda>u. integral {i..u} f2) has_vector_derivative f2 x) (at x within {i..b} - I)

goal (2 subgoals):
 1. integral {a..x} f = integral {a..x} f1
 2. ((\<lambda>x. integral {a..x} f1) has_vector_derivative f1 x) (at x within {a..i} - I)
[PROOF STEP]
using combine.hyps combine.prems 1
[PROOF STATE]
proof (prove)
using this:
x \<in> {a..i} - I \<Longrightarrow> ((\<lambda>u. integral {a..u} f1) has_vector_derivative f1 x) (at x within {a..i} - I)
x \<in> {i..b} - I \<Longrightarrow> ((\<lambda>u. integral {i..u} f2) has_vector_derivative f2 x) (at x within {i..b} - I)
a \<le> i
i \<le> b
i \<notin> I
piecewise_continuous_on a i I f1
piecewise_continuous_on i b I f2
\<lbrakk>a \<le> ?x; ?x < i\<rbrakk> \<Longrightarrow> f1 ?x = f ?x
\<lbrakk>i < ?x; ?x \<le> b\<rbrakk> \<Longrightarrow> f2 ?x = f ?x
a < i \<Longrightarrow> (f \<longlongrightarrow> f1 i) (at_left i)
i < b \<Longrightarrow> (f \<longlongrightarrow> f2 i) (at_right i)
x \<in> {a..b} - insert i I
x < i

goal (2 subgoals):
 1. integral {a..x} f = integral {a..x} f1
 2. ((\<lambda>x. integral {a..x} f1) has_vector_derivative f1 x) (at x within {a..i} - I)
[PROOF STEP]
by (auto simp: i_eq)
[PROOF STATE]
proof (state)
this:
((\<lambda>u. integral {a..u} f) has_vector_derivative f x) (at x within {a..b} - insert i I)

goal (1 subgoal):
 1. i < x \<Longrightarrow> ((\<lambda>u. integral {a..u} f) has_vector_derivative f x) (at x within {a..b} - insert i I)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. i < x \<Longrightarrow> ((\<lambda>u. integral {a..u} f) has_vector_derivative f x) (at x within {a..b} - insert i I)
[PROOF STEP]
case 2
[PROOF STATE]
proof (state)
this:
i < x

goal (1 subgoal):
 1. i < x \<Longrightarrow> ((\<lambda>u. integral {a..u} f) has_vector_derivative f x) (at x within {a..b} - insert i I)
[PROOF STEP]
have evless: "\<forall>\<^sub>F xa in nhds x. xa > i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eventually ((<) i) (nhds x)
[PROOF STEP]
apply (rule order_tendstoD[OF _ \<open>x > i\<close>])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. x) \<longlongrightarrow> x) (nhds x)
[PROOF STEP]
by (simp add: filterlim_ident)
[PROOF STATE]
proof (state)
this:
eventually ((<) i) (nhds x)

goal (1 subgoal):
 1. i < x \<Longrightarrow> ((\<lambda>u. integral {a..u} f) has_vector_derivative f x) (at x within {a..b} - insert i I)
[PROOF STEP]
have eq: "at x within {a..b} - insert i I = at x within {i .. b} - I"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. at x within {a..b} - insert i I = at x within {i..b} - I
[PROOF STEP]
unfolding filter_eq_iff
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>P. eventually P (at x within {a..b} - insert i I) = eventually P (at x within {i..b} - I)
[PROOF STEP]
proof safe
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>P. eventually P (at x within {a..b} - insert i I) \<Longrightarrow> eventually P (at x within {i..b} - I)
 2. \<And>P. eventually P (at x within {i..b} - I) \<Longrightarrow> eventually P (at x within {a..b} - insert i I)
[PROOF STEP]
fix P
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>P. eventually P (at x within {a..b} - insert i I) \<Longrightarrow> eventually P (at x within {i..b} - I)
 2. \<And>P. eventually P (at x within {i..b} - I) \<Longrightarrow> eventually P (at x within {a..b} - insert i I)
[PROOF STEP]
assume "eventually P (at x within {i..b} - I)"
[PROOF STATE]
proof (state)
this:
eventually P (at x within {i..b} - I)

goal (2 subgoals):
 1. \<And>P. eventually P (at x within {a..b} - insert i I) \<Longrightarrow> eventually P (at x within {i..b} - I)
 2. \<And>P. eventually P (at x within {i..b} - I) \<Longrightarrow> eventually P (at x within {a..b} - insert i I)
[PROOF STEP]
with evless
[PROOF STATE]
proof (chain)
picking this:
eventually ((<) i) (nhds x)
eventually P (at x within {i..b} - I)
[PROOF STEP]
show "eventually P (at x within {a..b} - insert i I)"
[PROOF STATE]
proof (prove)
using this:
eventually ((<) i) (nhds x)
eventually P (at x within {i..b} - I)

goal (1 subgoal):
 1. eventually P (at x within {a..b} - insert i I)
[PROOF STEP]
unfolding eventually_at_filter
[PROOF STATE]
proof (prove)
using this:
eventually ((<) i) (nhds x)
\<forall>\<^sub>F xa in nhds x. xa \<noteq> x \<longrightarrow> xa \<in> {i..b} - I \<longrightarrow> P xa

goal (1 subgoal):
 1. \<forall>\<^sub>F xa in nhds x. xa \<noteq> x \<longrightarrow> xa \<in> {a..b} - insert i I \<longrightarrow> P xa
[PROOF STEP]
by eventually_elim auto
[PROOF STATE]
proof (state)
this:
eventually P (at x within {a..b} - insert i I)

goal (1 subgoal):
 1. \<And>P. eventually P (at x within {a..b} - insert i I) \<Longrightarrow> eventually P (at x within {i..b} - I)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>P. eventually P (at x within {a..b} - insert i I) \<Longrightarrow> eventually P (at x within {i..b} - I)
[PROOF STEP]
fix P
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>P. eventually P (at x within {a..b} - insert i I) \<Longrightarrow> eventually P (at x within {i..b} - I)
[PROOF STEP]
assume "eventually P (at x within {a..b} - insert i I)"
[PROOF STATE]
proof (state)
this:
eventually P (at x within {a..b} - insert i I)

goal (1 subgoal):
 1. \<And>P. eventually P (at x within {a..b} - insert i I) \<Longrightarrow> eventually P (at x within {i..b} - I)
[PROOF STEP]
with evless
[PROOF STATE]
proof (chain)
picking this:
eventually ((<) i) (nhds x)
eventually P (at x within {a..b} - insert i I)
[PROOF STEP]
show "eventually P (at x within {i..b} - I)"
[PROOF STATE]
proof (prove)
using this:
eventually ((<) i) (nhds x)
eventually P (at x within {a..b} - insert i I)

goal (1 subgoal):
 1. eventually P (at x within {i..b} - I)
[PROOF STEP]
unfolding eventually_at_filter
[PROOF STATE]
proof (prove)
using this:
eventually ((<) i) (nhds x)
\<forall>\<^sub>F xa in nhds x. xa \<noteq> x \<longrightarrow> xa \<in> {a..b} - insert i I \<longrightarrow> P xa

goal (1 subgoal):
 1. \<forall>\<^sub>F xa in nhds x. xa \<noteq> x \<longrightarrow> xa \<in> {i..b} - I \<longrightarrow> P xa
[PROOF STEP]
apply eventually_elim
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>xa. \<lbrakk>i < xa; xa \<noteq> x \<longrightarrow> xa \<in> {a..b} - insert i I \<longrightarrow> P xa\<rbrakk> \<Longrightarrow> xa \<noteq> x \<longrightarrow> xa \<in> {i..b} - I \<longrightarrow> P xa
[PROOF STEP]
using 2 combine
[PROOF STATE]
proof (prove)
using this:
i < x
a \<le> i
i \<le> b
i \<notin> I
piecewise_continuous_on a i I f1
piecewise_continuous_on i b I f2
\<lbrakk>a \<le> ?x; ?x < i\<rbrakk> \<Longrightarrow> f1 ?x = f ?x
\<lbrakk>i < ?x; ?x \<le> b\<rbrakk> \<Longrightarrow> f2 ?x = f ?x
a < i \<Longrightarrow> (f \<longlongrightarrow> f1 i) (at_left i)
i < b \<Longrightarrow> (f \<longlongrightarrow> f2 i) (at_right i)
?x \<in> {a..i} - I \<Longrightarrow> ((\<lambda>u. integral {a..u} f1) has_vector_derivative f1 ?x) (at ?x within {a..i} - I)
?x \<in> {i..b} - I \<Longrightarrow> ((\<lambda>u. integral {i..u} f2) has_vector_derivative f2 ?x) (at ?x within {i..b} - I)
x \<in> {a..b} - insert i I

goal (1 subgoal):
 1. \<And>xa. \<lbrakk>i < xa; xa \<noteq> x \<longrightarrow> xa \<in> {a..b} - insert i I \<longrightarrow> P xa\<rbrakk> \<Longrightarrow> xa \<noteq> x \<longrightarrow> xa \<in> {i..b} - I \<longrightarrow> P xa
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
eventually P (at x within {i..b} - I)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
at x within {a..b} - insert i I = at x within {i..b} - I

goal (1 subgoal):
 1. i < x \<Longrightarrow> ((\<lambda>u. integral {a..u} f) has_vector_derivative f x) (at x within {a..b} - insert i I)
[PROOF STEP]
have "f x = f2 x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f x = f2 x
[PROOF STEP]
using combine 2
[PROOF STATE]
proof (prove)
using this:
a \<le> i
i \<le> b
i \<notin> I
piecewise_continuous_on a i I f1
piecewise_continuous_on i b I f2
\<lbrakk>a \<le> ?x; ?x < i\<rbrakk> \<Longrightarrow> f1 ?x = f ?x
\<lbrakk>i < ?x; ?x \<le> b\<rbrakk> \<Longrightarrow> f2 ?x = f ?x
a < i \<Longrightarrow> (f \<longlongrightarrow> f1 i) (at_left i)
i < b \<Longrightarrow> (f \<longlongrightarrow> f2 i) (at_right i)
?x \<in> {a..i} - I \<Longrightarrow> ((\<lambda>u. integral {a..u} f1) has_vector_derivative f1 ?x) (at ?x within {a..i} - I)
?x \<in> {i..b} - I \<Longrightarrow> ((\<lambda>u. integral {i..u} f2) has_vector_derivative f2 ?x) (at ?x within {i..b} - I)
x \<in> {a..b} - insert i I
i < x

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

goal (1 subgoal):
 1. i < x \<Longrightarrow> ((\<lambda>u. integral {a..u} f) has_vector_derivative f x) (at x within {a..b} - insert i I)
[PROOF STEP]
have i_eq: "integral {a..y} f = integral {a..i} f + integral {i..y} f2" if "i < y" "y \<le> b" for y
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral {a..y} f = integral {a..i} f + integral {i..y} f2
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. integral {a..y} f = integral {a..i} f + integral {i..y} f2
[PROOF STEP]
have "integral {a..y} f = integral {a..i} f + integral {i..y} f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral {a..y} f = integral {a..i} f + integral {i..y} f
[PROOF STEP]
apply (cases "i = y")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. i = y \<Longrightarrow> integral {a..y} f = integral {a..i} f + integral {i..y} f
 2. i \<noteq> y \<Longrightarrow> integral {a..y} f = integral {a..i} f + integral {i..y} f
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i = y \<Longrightarrow> integral {a..y} f = integral {a..i} f + integral {i..y} f
[PROOF STEP]
by auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i \<noteq> y \<Longrightarrow> integral {a..y} f = integral {a..i} f + integral {i..y} f
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i \<noteq> y \<Longrightarrow> integral {a..y} f = integral {a..i} f + integral {i..y} f
[PROOF STEP]
apply (rule Henstock_Kurzweil_Integration.integral_combine[symmetric])
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. i \<noteq> y \<Longrightarrow> a \<le> i
 2. i \<noteq> y \<Longrightarrow> i \<le> y
 3. i \<noteq> y \<Longrightarrow> f integrable_on {a..y}
[PROOF STEP]
using combine that
[PROOF STATE]
proof (prove)
using this:
a \<le> i
i \<le> b
i \<notin> I
piecewise_continuous_on a i I f1
piecewise_continuous_on i b I f2
\<lbrakk>a \<le> ?x; ?x < i\<rbrakk> \<Longrightarrow> f1 ?x = f ?x
\<lbrakk>i < ?x; ?x \<le> b\<rbrakk> \<Longrightarrow> f2 ?x = f ?x
a < i \<Longrightarrow> (f \<longlongrightarrow> f1 i) (at_left i)
i < b \<Longrightarrow> (f \<longlongrightarrow> f2 i) (at_right i)
?x \<in> {a..i} - I \<Longrightarrow> ((\<lambda>u. integral {a..u} f1) has_vector_derivative f1 ?x) (at ?x within {a..i} - I)
?x \<in> {i..b} - I \<Longrightarrow> ((\<lambda>u. integral {i..u} f2) has_vector_derivative f2 ?x) (at ?x within {i..b} - I)
x \<in> {a..b} - insert i I
i < y
y \<le> b

goal (3 subgoals):
 1. i \<noteq> y \<Longrightarrow> a \<le> i
 2. i \<noteq> y \<Longrightarrow> i \<le> y
 3. i \<noteq> y \<Longrightarrow> f integrable_on {a..y}
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<le> i; i \<notin> I; piecewise_continuous_on a i I f1; piecewise_continuous_on i b I f2; \<And>x. \<lbrakk>a \<le> x; x < i\<rbrakk> \<Longrightarrow> f1 x = f x; \<And>x. \<lbrakk>i < x; x \<le> b\<rbrakk> \<Longrightarrow> f2 x = f x; a < i \<Longrightarrow> (f \<longlongrightarrow> f1 i) (at_left i); (f \<longlongrightarrow> f2 i) (at_right i); \<And>x. a \<le> x \<and> x \<le> i \<and> x \<notin> I \<Longrightarrow> ((\<lambda>u. integral {a..u} f1) has_vector_derivative f1 x) (at x within {a..i} - I); \<And>x. i \<le> x \<and> x \<le> b \<and> x \<notin> I \<Longrightarrow> ((\<lambda>u. integral {i..u} f2) has_vector_derivative f2 x) (at x within {i..b} - I); i < y; y \<le> b; a \<le> x; x \<le> b; x \<noteq> i; x \<notin> I\<rbrakk> \<Longrightarrow> f integrable_on {a..y}
[PROOF STEP]
apply (rule integrable_Un'[where A="{a .. i}" and B="{i..y}"])
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<lbrakk>a \<le> i; i \<notin> I; piecewise_continuous_on a i I f1; piecewise_continuous_on i b I f2; \<And>x. \<lbrakk>a \<le> x; x < i\<rbrakk> \<Longrightarrow> f1 x = f x; \<And>x. \<lbrakk>i < x; x \<le> b\<rbrakk> \<Longrightarrow> f2 x = f x; a < i \<Longrightarrow> (f \<longlongrightarrow> f1 i) (at_left i); (f \<longlongrightarrow> f2 i) (at_right i); \<And>x. a \<le> x \<and> x \<le> i \<and> x \<notin> I \<Longrightarrow> ((\<lambda>u. integral {a..u} f1) has_vector_derivative f1 x) (at x within {a..i} - I); \<And>x. i \<le> x \<and> x \<le> b \<and> x \<notin> I \<Longrightarrow> ((\<lambda>u. integral {i..u} f2) has_vector_derivative f2 x) (at x within {i..b} - I); i < y; y \<le> b; a \<le> x; x \<le> b; x \<noteq> i; x \<notin> I\<rbrakk> \<Longrightarrow> f integrable_on {a..i}
 2. \<lbrakk>a \<le> i; i \<notin> I; piecewise_continuous_on a i I f1; piecewise_continuous_on i b I f2; \<And>x. \<lbrakk>a \<le> x; x < i\<rbrakk> \<Longrightarrow> f1 x = f x; \<And>x. \<lbrakk>i < x; x \<le> b\<rbrakk> \<Longrightarrow> f2 x = f x; a < i \<Longrightarrow> (f \<longlongrightarrow> f1 i) (at_left i); (f \<longlongrightarrow> f2 i) (at_right i); \<And>x. a \<le> x \<and> x \<le> i \<and> x \<notin> I \<Longrightarrow> ((\<lambda>u. integral {a..u} f1) has_vector_derivative f1 x) (at x within {a..i} - I); \<And>x. i \<le> x \<and> x \<le> b \<and> x \<notin> I \<Longrightarrow> ((\<lambda>u. integral {i..u} f2) has_vector_derivative f2 x) (at x within {i..b} - I); i < y; y \<le> b; a \<le> x; x \<le> b; x \<noteq> i; x \<notin> I\<rbrakk> \<Longrightarrow> f integrable_on {i..y}
 3. \<lbrakk>a \<le> i; i \<notin> I; piecewise_continuous_on a i I f1; piecewise_continuous_on i b I f2; \<And>x. \<lbrakk>a \<le> x; x < i\<rbrakk> \<Longrightarrow> f1 x = f x; \<And>x. \<lbrakk>i < x; x \<le> b\<rbrakk> \<Longrightarrow> f2 x = f x; a < i \<Longrightarrow> (f \<longlongrightarrow> f1 i) (at_left i); (f \<longlongrightarrow> f2 i) (at_right i); \<And>x. a \<le> x \<and> x \<le> i \<and> x \<notin> I \<Longrightarrow> ((\<lambda>u. integral {a..u} f1) has_vector_derivative f1 x) (at x within {a..i} - I); \<And>x. i \<le> x \<and> x \<le> b \<and> x \<notin> I \<Longrightarrow> ((\<lambda>u. integral {i..u} f2) has_vector_derivative f2 x) (at x within {i..b} - I); i < y; y \<le> b; a \<le> x; x \<le> b; x \<noteq> i; x \<notin> I\<rbrakk> \<Longrightarrow> negligible ({a..i} \<inter> {i..y})
 4. \<lbrakk>a \<le> i; i \<notin> I; piecewise_continuous_on a i I f1; piecewise_continuous_on i b I f2; \<And>x. \<lbrakk>a \<le> x; x < i\<rbrakk> \<Longrightarrow> f1 x = f x; \<And>x. \<lbrakk>i < x; x \<le> b\<rbrakk> \<Longrightarrow> f2 x = f x; a < i \<Longrightarrow> (f \<longlongrightarrow> f1 i) (at_left i); (f \<longlongrightarrow> f2 i) (at_right i); \<And>x. a \<le> x \<and> x \<le> i \<and> x \<notin> I \<Longrightarrow> ((\<lambda>u. integral {a..u} f1) has_vector_derivative f1 x) (at x within {a..i} - I); \<And>x. i \<le> x \<and> x \<le> b \<and> x \<notin> I \<Longrightarrow> ((\<lambda>u. integral {i..u} f2) has_vector_derivative f2 x) (at x within {i..b} - I); i < y; y \<le> b; a \<le> x; x \<le> b; x \<noteq> i; x \<notin> I\<rbrakk> \<Longrightarrow> {a..y} = {a..i} \<union> {i..y}
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<le> i; i \<notin> I; piecewise_continuous_on a i I f1; piecewise_continuous_on i b I f2; \<And>x. \<lbrakk>a \<le> x; x < i\<rbrakk> \<Longrightarrow> f1 x = f x; \<And>x. \<lbrakk>i < x; x \<le> b\<rbrakk> \<Longrightarrow> f2 x = f x; a < i \<Longrightarrow> (f \<longlongrightarrow> f1 i) (at_left i); (f \<longlongrightarrow> f2 i) (at_right i); \<And>x. a \<le> x \<and> x \<le> i \<and> x \<notin> I \<Longrightarrow> ((\<lambda>u. integral {a..u} f1) has_vector_derivative f1 x) (at x within {a..i} - I); \<And>x. i \<le> x \<and> x \<le> b \<and> x \<notin> I \<Longrightarrow> ((\<lambda>u. integral {i..u} f2) has_vector_derivative f2 x) (at x within {i..b} - I); i < y; y \<le> b; a \<le> x; x \<le> b; x \<noteq> i; x \<notin> I\<rbrakk> \<Longrightarrow> f integrable_on {a..i}
[PROOF STEP]
by (rule integrable_spike[where S="{i}" and f="f1"])
              (auto intro: piecewise_continuous_on_integrable)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<lbrakk>a \<le> i; i \<notin> I; piecewise_continuous_on a i I f1; piecewise_continuous_on i b I f2; \<And>x. \<lbrakk>a \<le> x; x < i\<rbrakk> \<Longrightarrow> f1 x = f x; \<And>x. \<lbrakk>i < x; x \<le> b\<rbrakk> \<Longrightarrow> f2 x = f x; a < i \<Longrightarrow> (f \<longlongrightarrow> f1 i) (at_left i); (f \<longlongrightarrow> f2 i) (at_right i); \<And>x. a \<le> x \<and> x \<le> i \<and> x \<notin> I \<Longrightarrow> ((\<lambda>u. integral {a..u} f1) has_vector_derivative f1 x) (at x within {a..i} - I); \<And>x. i \<le> x \<and> x \<le> b \<and> x \<notin> I \<Longrightarrow> ((\<lambda>u. integral {i..u} f2) has_vector_derivative f2 x) (at x within {i..b} - I); i < y; y \<le> b; a \<le> x; x \<le> b; x \<noteq> i; x \<notin> I\<rbrakk> \<Longrightarrow> f integrable_on {i..y}
 2. \<lbrakk>a \<le> i; i \<notin> I; piecewise_continuous_on a i I f1; piecewise_continuous_on i b I f2; \<And>x. \<lbrakk>a \<le> x; x < i\<rbrakk> \<Longrightarrow> f1 x = f x; \<And>x. \<lbrakk>i < x; x \<le> b\<rbrakk> \<Longrightarrow> f2 x = f x; a < i \<Longrightarrow> (f \<longlongrightarrow> f1 i) (at_left i); (f \<longlongrightarrow> f2 i) (at_right i); \<And>x. a \<le> x \<and> x \<le> i \<and> x \<notin> I \<Longrightarrow> ((\<lambda>u. integral {a..u} f1) has_vector_derivative f1 x) (at x within {a..i} - I); \<And>x. i \<le> x \<and> x \<le> b \<and> x \<notin> I \<Longrightarrow> ((\<lambda>u. integral {i..u} f2) has_vector_derivative f2 x) (at x within {i..b} - I); i < y; y \<le> b; a \<le> x; x \<le> b; x \<noteq> i; x \<notin> I\<rbrakk> \<Longrightarrow> negligible ({a..i} \<inter> {i..y})
 3. \<lbrakk>a \<le> i; i \<notin> I; piecewise_continuous_on a i I f1; piecewise_continuous_on i b I f2; \<And>x. \<lbrakk>a \<le> x; x < i\<rbrakk> \<Longrightarrow> f1 x = f x; \<And>x. \<lbrakk>i < x; x \<le> b\<rbrakk> \<Longrightarrow> f2 x = f x; a < i \<Longrightarrow> (f \<longlongrightarrow> f1 i) (at_left i); (f \<longlongrightarrow> f2 i) (at_right i); \<And>x. a \<le> x \<and> x \<le> i \<and> x \<notin> I \<Longrightarrow> ((\<lambda>u. integral {a..u} f1) has_vector_derivative f1 x) (at x within {a..i} - I); \<And>x. i \<le> x \<and> x \<le> b \<and> x \<notin> I \<Longrightarrow> ((\<lambda>u. integral {i..u} f2) has_vector_derivative f2 x) (at x within {i..b} - I); i < y; y \<le> b; a \<le> x; x \<le> b; x \<noteq> i; x \<notin> I\<rbrakk> \<Longrightarrow> {a..y} = {a..i} \<union> {i..y}
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<le> i; i \<notin> I; piecewise_continuous_on a i I f1; piecewise_continuous_on i b I f2; \<And>x. \<lbrakk>a \<le> x; x < i\<rbrakk> \<Longrightarrow> f1 x = f x; \<And>x. \<lbrakk>i < x; x \<le> b\<rbrakk> \<Longrightarrow> f2 x = f x; a < i \<Longrightarrow> (f \<longlongrightarrow> f1 i) (at_left i); (f \<longlongrightarrow> f2 i) (at_right i); \<And>x. a \<le> x \<and> x \<le> i \<and> x \<notin> I \<Longrightarrow> ((\<lambda>u. integral {a..u} f1) has_vector_derivative f1 x) (at x within {a..i} - I); \<And>x. i \<le> x \<and> x \<le> b \<and> x \<notin> I \<Longrightarrow> ((\<lambda>u. integral {i..u} f2) has_vector_derivative f2 x) (at x within {i..b} - I); i < y; y \<le> b; a \<le> x; x \<le> b; x \<noteq> i; x \<notin> I\<rbrakk> \<Longrightarrow> f integrable_on {i..y}
[PROOF STEP]
apply (rule integrable_on_subinterval[where S="{i..b}"])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>a \<le> i; i \<notin> I; piecewise_continuous_on a i I f1; piecewise_continuous_on i b I f2; \<And>x. \<lbrakk>a \<le> x; x < i\<rbrakk> \<Longrightarrow> f1 x = f x; \<And>x. \<lbrakk>i < x; x \<le> b\<rbrakk> \<Longrightarrow> f2 x = f x; a < i \<Longrightarrow> (f \<longlongrightarrow> f1 i) (at_left i); (f \<longlongrightarrow> f2 i) (at_right i); \<And>x. a \<le> x \<and> x \<le> i \<and> x \<notin> I \<Longrightarrow> ((\<lambda>u. integral {a..u} f1) has_vector_derivative f1 x) (at x within {a..i} - I); \<And>x. i \<le> x \<and> x \<le> b \<and> x \<notin> I \<Longrightarrow> ((\<lambda>u. integral {i..u} f2) has_vector_derivative f2 x) (at x within {i..b} - I); i < y; y \<le> b; a \<le> x; x \<le> b; x \<noteq> i; x \<notin> I\<rbrakk> \<Longrightarrow> f integrable_on {i..b}
 2. \<lbrakk>a \<le> i; i \<notin> I; piecewise_continuous_on a i I f1; piecewise_continuous_on i b I f2; \<And>x. \<lbrakk>a \<le> x; x < i\<rbrakk> \<Longrightarrow> f1 x = f x; \<And>x. \<lbrakk>i < x; x \<le> b\<rbrakk> \<Longrightarrow> f2 x = f x; a < i \<Longrightarrow> (f \<longlongrightarrow> f1 i) (at_left i); (f \<longlongrightarrow> f2 i) (at_right i); \<And>x. a \<le> x \<and> x \<le> i \<and> x \<notin> I \<Longrightarrow> ((\<lambda>u. integral {a..u} f1) has_vector_derivative f1 x) (at x within {a..i} - I); \<And>x. i \<le> x \<and> x \<le> b \<and> x \<notin> I \<Longrightarrow> ((\<lambda>u. integral {i..u} f2) has_vector_derivative f2 x) (at x within {i..b} - I); i < y; y \<le> b; a \<le> x; x \<le> b; x \<noteq> i; x \<notin> I\<rbrakk> \<Longrightarrow> {i..y} \<subseteq> {i..b}
[PROOF STEP]
by (rule integrable_spike[where S="{i}" and f="f2"])
              (auto intro: piecewise_continuous_on_integrable)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>a \<le> i; i \<notin> I; piecewise_continuous_on a i I f1; piecewise_continuous_on i b I f2; \<And>x. \<lbrakk>a \<le> x; x < i\<rbrakk> \<Longrightarrow> f1 x = f x; \<And>x. \<lbrakk>i < x; x \<le> b\<rbrakk> \<Longrightarrow> f2 x = f x; a < i \<Longrightarrow> (f \<longlongrightarrow> f1 i) (at_left i); (f \<longlongrightarrow> f2 i) (at_right i); \<And>x. a \<le> x \<and> x \<le> i \<and> x \<notin> I \<Longrightarrow> ((\<lambda>u. integral {a..u} f1) has_vector_derivative f1 x) (at x within {a..i} - I); \<And>x. i \<le> x \<and> x \<le> b \<and> x \<notin> I \<Longrightarrow> ((\<lambda>u. integral {i..u} f2) has_vector_derivative f2 x) (at x within {i..b} - I); i < y; y \<le> b; a \<le> x; x \<le> b; x \<noteq> i; x \<notin> I\<rbrakk> \<Longrightarrow> negligible ({a..i} \<inter> {i..y})
 2. \<lbrakk>a \<le> i; i \<notin> I; piecewise_continuous_on a i I f1; piecewise_continuous_on i b I f2; \<And>x. \<lbrakk>a \<le> x; x < i\<rbrakk> \<Longrightarrow> f1 x = f x; \<And>x. \<lbrakk>i < x; x \<le> b\<rbrakk> \<Longrightarrow> f2 x = f x; a < i \<Longrightarrow> (f \<longlongrightarrow> f1 i) (at_left i); (f \<longlongrightarrow> f2 i) (at_right i); \<And>x. a \<le> x \<and> x \<le> i \<and> x \<notin> I \<Longrightarrow> ((\<lambda>u. integral {a..u} f1) has_vector_derivative f1 x) (at x within {a..i} - I); \<And>x. i \<le> x \<and> x \<le> b \<and> x \<notin> I \<Longrightarrow> ((\<lambda>u. integral {i..u} f2) has_vector_derivative f2 x) (at x within {i..b} - I); i < y; y \<le> b; a \<le> x; x \<le> b; x \<noteq> i; x \<notin> I\<rbrakk> \<Longrightarrow> {a..y} = {a..i} \<union> {i..y}
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<le> i; i \<notin> I; piecewise_continuous_on a i I f1; piecewise_continuous_on i b I f2; \<And>x. \<lbrakk>a \<le> x; x < i\<rbrakk> \<Longrightarrow> f1 x = f x; \<And>x. \<lbrakk>i < x; x \<le> b\<rbrakk> \<Longrightarrow> f2 x = f x; a < i \<Longrightarrow> (f \<longlongrightarrow> f1 i) (at_left i); (f \<longlongrightarrow> f2 i) (at_right i); \<And>x. a \<le> x \<and> x \<le> i \<and> x \<notin> I \<Longrightarrow> ((\<lambda>u. integral {a..u} f1) has_vector_derivative f1 x) (at x within {a..i} - I); \<And>x. i \<le> x \<and> x \<le> b \<and> x \<notin> I \<Longrightarrow> ((\<lambda>u. integral {i..u} f2) has_vector_derivative f2 x) (at x within {i..b} - I); i < y; y \<le> b; a \<le> x; x \<le> b; x \<noteq> i; x \<notin> I\<rbrakk> \<Longrightarrow> negligible ({a..i} \<inter> {i..y})
[PROOF STEP]
by (auto simp: max_def min_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<le> i; i \<notin> I; piecewise_continuous_on a i I f1; piecewise_continuous_on i b I f2; \<And>x. \<lbrakk>a \<le> x; x < i\<rbrakk> \<Longrightarrow> f1 x = f x; \<And>x. \<lbrakk>i < x; x \<le> b\<rbrakk> \<Longrightarrow> f2 x = f x; a < i \<Longrightarrow> (f \<longlongrightarrow> f1 i) (at_left i); (f \<longlongrightarrow> f2 i) (at_right i); \<And>x. a \<le> x \<and> x \<le> i \<and> x \<notin> I \<Longrightarrow> ((\<lambda>u. integral {a..u} f1) has_vector_derivative f1 x) (at x within {a..i} - I); \<And>x. i \<le> x \<and> x \<le> b \<and> x \<notin> I \<Longrightarrow> ((\<lambda>u. integral {i..u} f2) has_vector_derivative f2 x) (at x within {i..b} - I); i < y; y \<le> b; a \<le> x; x \<le> b; x \<noteq> i; x \<notin> I\<rbrakk> \<Longrightarrow> {a..y} = {a..i} \<union> {i..y}
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<le> i; i \<notin> I; piecewise_continuous_on a i I f1; piecewise_continuous_on i b I f2; \<And>x. \<lbrakk>a \<le> x; x < i\<rbrakk> \<Longrightarrow> f1 x = f x; \<And>x. \<lbrakk>i < x; x \<le> b\<rbrakk> \<Longrightarrow> f2 x = f x; a < i \<Longrightarrow> (f \<longlongrightarrow> f1 i) (at_left i); (f \<longlongrightarrow> f2 i) (at_right i); \<And>x. a \<le> x \<and> x \<le> i \<and> x \<notin> I \<Longrightarrow> ((\<lambda>u. integral {a..u} f1) has_vector_derivative f1 x) (at x within {a..i} - I); \<And>x. i \<le> x \<and> x \<le> b \<and> x \<notin> I \<Longrightarrow> ((\<lambda>u. integral {i..u} f2) has_vector_derivative f2 x) (at x within {i..b} - I); i < y; y \<le> b; a \<le> x; x \<le> b; x \<noteq> i; x \<notin> I\<rbrakk> \<Longrightarrow> {a..y} = {a..i} \<union> {i..y}
[PROOF STEP]
by auto
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
integral {a..y} f = integral {a..i} f + integral {i..y} f

goal (1 subgoal):
 1. integral {a..y} f = integral {a..i} f + integral {i..y} f2
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
integral {a..y} f = integral {a..i} f + integral {i..y} f

goal (1 subgoal):
 1. integral {a..y} f = integral {a..i} f + integral {i..y} f2
[PROOF STEP]
have "integral {i..y} f = integral {i..y} f2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral {i..y} f = integral {i..y} f2
[PROOF STEP]
apply (rule integral_spike[where S="{i}"])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. negligible {i}
 2. \<And>x. x \<in> {i..y} - {i} \<Longrightarrow> f2 x = f x
[PROOF STEP]
using combine 2 that
[PROOF STATE]
proof (prove)
using this:
a \<le> i
i \<le> b
i \<notin> I
piecewise_continuous_on a i I f1
piecewise_continuous_on i b I f2
\<lbrakk>a \<le> ?x; ?x < i\<rbrakk> \<Longrightarrow> f1 ?x = f ?x
\<lbrakk>i < ?x; ?x \<le> b\<rbrakk> \<Longrightarrow> f2 ?x = f ?x
a < i \<Longrightarrow> (f \<longlongrightarrow> f1 i) (at_left i)
i < b \<Longrightarrow> (f \<longlongrightarrow> f2 i) (at_right i)
?x \<in> {a..i} - I \<Longrightarrow> ((\<lambda>u. integral {a..u} f1) has_vector_derivative f1 ?x) (at ?x within {a..i} - I)
?x \<in> {i..b} - I \<Longrightarrow> ((\<lambda>u. integral {i..u} f2) has_vector_derivative f2 ?x) (at ?x within {i..b} - I)
x \<in> {a..b} - insert i I
i < x
i < y
y \<le> b

goal (2 subgoals):
 1. negligible {i}
 2. \<And>x. x \<in> {i..y} - {i} \<Longrightarrow> f2 x = f x
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
integral {i..y} f = integral {i..y} f2

goal (1 subgoal):
 1. integral {a..y} f = integral {a..i} f + integral {i..y} f2
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
integral {a..y} f = integral {a..i} f + integral {i..y} f2
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
integral {a..y} f = integral {a..i} f + integral {i..y} f2

goal (1 subgoal):
 1. integral {a..y} f = integral {a..i} f + integral {i..y} f2
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
integral {a..y} f = integral {a..i} f + integral {i..y} f2

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<lbrakk>i < ?y; ?y \<le> b\<rbrakk> \<Longrightarrow> integral {a..?y} f = integral {a..i} f + integral {i..?y} f2

goal (1 subgoal):
 1. i < x \<Longrightarrow> ((\<lambda>u. integral {a..u} f) has_vector_derivative f x) (at x within {a..b} - insert i I)
[PROOF STEP]
from evless
[PROOF STATE]
proof (chain)
picking this:
eventually ((<) i) (nhds x)
[PROOF STEP]
have ev_eq: "\<forall>\<^sub>F y in nhds x. y \<in> {i..b} - I \<longrightarrow> integral {a..y} f = integral {a..i} f + integral {i..y} f2"
[PROOF STATE]
proof (prove)
using this:
eventually ((<) i) (nhds x)

goal (1 subgoal):
 1. \<forall>\<^sub>F y in nhds x. y \<in> {i..b} - I \<longrightarrow> integral {a..y} f = integral {a..i} f + integral {i..y} f2
[PROOF STEP]
by eventually_elim (auto simp: i_eq)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F y in nhds x. y \<in> {i..b} - I \<longrightarrow> integral {a..y} f = integral {a..i} f + integral {i..y} f2

goal (1 subgoal):
 1. i < x \<Longrightarrow> ((\<lambda>u. integral {a..u} f) has_vector_derivative f x) (at x within {a..b} - insert i I)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>u. integral {a..u} f) has_vector_derivative f x) (at x within {a..b} - insert i I)
[PROOF STEP]
unfolding eq
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>u. integral {a..u} f) has_vector_derivative f x) (at x within {i..b} - I)
[PROOF STEP]
apply (subst has_vector_derivative_cong_ev[OF ev_eq])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. integral {a..x} f = integral {a..i} f + integral {i..x} f2
 2. ((\<lambda>y. integral {a..i} f + integral {i..y} f2) has_vector_derivative f x) (at x within {i..b} - I)
[PROOF STEP]
using combine.IH[of x] combine.prems combine.hyps 2
[PROOF STATE]
proof (prove)
using this:
x \<in> {a..i} - I \<Longrightarrow> ((\<lambda>u. integral {a..u} f1) has_vector_derivative f1 x) (at x within {a..i} - I)
x \<in> {i..b} - I \<Longrightarrow> ((\<lambda>u. integral {i..u} f2) has_vector_derivative f2 x) (at x within {i..b} - I)
x \<in> {a..b} - insert i I
a \<le> i
i \<le> b
i \<notin> I
piecewise_continuous_on a i I f1
piecewise_continuous_on i b I f2
\<lbrakk>a \<le> ?x; ?x < i\<rbrakk> \<Longrightarrow> f1 ?x = f ?x
\<lbrakk>i < ?x; ?x \<le> b\<rbrakk> \<Longrightarrow> f2 ?x = f ?x
a < i \<Longrightarrow> (f \<longlongrightarrow> f1 i) (at_left i)
i < b \<Longrightarrow> (f \<longlongrightarrow> f2 i) (at_right i)
i < x

goal (2 subgoals):
 1. integral {a..x} f = integral {a..i} f + integral {i..x} f2
 2. ((\<lambda>y. integral {a..i} f + integral {i..y} f2) has_vector_derivative f x) (at x within {i..b} - I)
[PROOF STEP]
by (auto simp: i_eq intro!: derivative_eq_intros)
[PROOF STATE]
proof (state)
this:
((\<lambda>u. integral {a..u} f) has_vector_derivative f x) (at x within {a..b} - insert i I)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
((\<lambda>u. integral {a..u} f) has_vector_derivative f x) (at x within {a..b} - insert i I)

goal (1 subgoal):
 1. \<And>a b i I f x. \<lbrakk>\<And>x. x \<in> {a..b} - I \<Longrightarrow> ((\<lambda>u. integral {a..u} f) has_vector_derivative f x) (at x within {a..b} - I); finite I; i \<notin> I; x \<in> {a..b} - insert i I\<rbrakk> \<Longrightarrow> ((\<lambda>u. integral {a..u} f) has_vector_derivative f x) (at x within {a..b} - insert i I)
[PROOF STEP]
qed (auto intro: has_vector_derivative_within_subset)


[STATEMENT]
lemma Infinitesimal_interval2:
  "e \<in> Infinitesimal \<Longrightarrow> e' \<in> Infinitesimal \<Longrightarrow> e' \<le> x \<Longrightarrow> x \<le> e \<Longrightarrow> x \<in> Infinitesimal"
  for x :: hypreal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>e \<in> Infinitesimal; e' \<in> Infinitesimal; e' \<le> x; x \<le> e\<rbrakk> \<Longrightarrow> x \<in> Infinitesimal
[PROOF STEP]
by (auto intro: Infinitesimal_interval simp add: order_le_less)


[STATEMENT]
lemma prog_instrs_append: "\<And>ys. prog_instrs (xs@ys) = prog_instrs xs @ prog_instrs ys"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>ys. prog_instrs (xs @ ys) = prog_instrs xs @ prog_instrs ys
[PROOF STEP]
by (induct xs) (auto split: memref.splits)


[STATEMENT]
lemma moebius_similarity_lines_to_lines':
  assumes "a \<noteq> 0"
  shows "on_circline (moebius_circline (moebius_similarity a b) H) \<infinity>\<^sub>h \<longleftrightarrow>
         \<infinity>\<^sub>h \<in> circline_set H"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. on_circline (moebius_circline (moebius_similarity a b) H) \<infinity>\<^sub>h = (\<infinity>\<^sub>h \<in> circline_set H)
[PROOF STEP]
using moebius_similarity_lines_to_lines assms
[PROOF STATE]
proof (prove)
using this:
?a \<noteq> 0 \<Longrightarrow> (\<infinity>\<^sub>h \<in> circline_set (moebius_circline (moebius_similarity ?a ?b) ?H)) = (\<infinity>\<^sub>h \<in> circline_set ?H)
a \<noteq> 0

goal (1 subgoal):
 1. on_circline (moebius_circline (moebius_similarity a b) H) \<infinity>\<^sub>h = (\<infinity>\<^sub>h \<in> circline_set H)
[PROOF STEP]
unfolding circline_set_def
[PROOF STATE]
proof (prove)
using this:
?a \<noteq> 0 \<Longrightarrow> (\<infinity>\<^sub>h \<in> Collect (on_circline (moebius_circline (moebius_similarity ?a ?b) ?H))) = (\<infinity>\<^sub>h \<in> Collect (on_circline ?H))
a \<noteq> 0

goal (1 subgoal):
 1. on_circline (moebius_circline (moebius_similarity a b) H) \<infinity>\<^sub>h = (\<infinity>\<^sub>h \<in> Collect (on_circline H))
[PROOF STEP]
by simp


[STATEMENT]
lemma compatible_setter:
  assumes [simp]: \<open>register F\<close> \<open>register G\<close>
  assumes compat: \<open>\<And>a b. F a \<circ>\<^sub>m G b = G b \<circ>\<^sub>m F a\<close>
  shows \<open>setter F x o setter G y = setter G y o setter F x\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. setter F x \<circ> setter G y = setter G y \<circ> setter F x
[PROOF STEP]
using compat
[PROOF STATE]
proof (prove)
using this:
F ?a \<circ>\<^sub>m G ?b = G ?b \<circ>\<^sub>m F ?a

goal (1 subgoal):
 1. setter F x \<circ> setter G y = setter G y \<circ> setter F x
[PROOF STEP]
apply (auto intro!: ext simp: setter_def register_apply_def o_def map_comp_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>xa. (\<And>a b. (\<lambda>k. case G b k of None \<Rightarrow> None | Some v \<Rightarrow> F a v) = (\<lambda>k. case F a k of None \<Rightarrow> None | Some v \<Rightarrow> G b v)) \<Longrightarrow> the (F (\<lambda>xa. Some x) (the (G (\<lambda>x. Some y) xa))) = the (G (\<lambda>x. Some y) (the (F (\<lambda>xa. Some x) xa)))
[PROOF STEP]
by (smt (verit, best) assms(1) assms(2) option.case_eq_if option.distinct(1) register_def register_from_getter_setter_def)


[STATEMENT]
lemma closedin_subtopology_alt:
     "closedin (subtopology X U) S \<longleftrightarrow> S \<in> (\<lambda>T. U \<inter> T) ` Collect (closedin X)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closedin (subtopology X U) S = (S \<in> (\<inter>) U ` Collect (closedin X))
[PROOF STEP]
by (simp add: image_iff inf_commute closedin_subtopology)


[STATEMENT]
lemma ereal_limsup_lim_mult:
  fixes u v::"nat \<Rightarrow> ereal"
  assumes "u \<longlonglongrightarrow> a" "a>0" "a \<noteq> \<infinity>"
  shows "limsup (\<lambda>n. u n * v n) = a * limsup v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. limsup (\<lambda>n. u n * v n) = a * limsup v
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. limsup (\<lambda>n. u n * v n) = a * limsup v
[PROOF STEP]
define w where "w = (\<lambda>n. u n * v n)"
[PROOF STATE]
proof (state)
this:
w = (\<lambda>n. u n * v n)

goal (1 subgoal):
 1. limsup (\<lambda>n. u n * v n) = a * limsup v
[PROOF STEP]
obtain r where r: "strict_mono r" "(v o r) \<longlonglongrightarrow> limsup v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>r. \<lbrakk>strict_mono r; (v \<circ> r) \<longlonglongrightarrow> limsup v\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using limsup_subseq_lim
[PROOF STATE]
proof (prove)
using this:
\<exists>r. strict_mono r \<and> (?u \<circ> r) \<longlonglongrightarrow> limsup ?u

goal (1 subgoal):
 1. (\<And>r. \<lbrakk>strict_mono r; (v \<circ> r) \<longlonglongrightarrow> limsup v\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
strict_mono r
(v \<circ> r) \<longlonglongrightarrow> limsup v

goal (1 subgoal):
 1. limsup (\<lambda>n. u n * v n) = a * limsup v
[PROOF STEP]
have "(u o r) \<longlonglongrightarrow> a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (u \<circ> r) \<longlonglongrightarrow> a
[PROOF STEP]
using assms(1) LIMSEQ_subseq_LIMSEQ r
[PROOF STATE]
proof (prove)
using this:
u \<longlonglongrightarrow> a
\<lbrakk>?X \<longlonglongrightarrow> ?L; strict_mono ?f\<rbrakk> \<Longrightarrow> (?X \<circ> ?f) \<longlonglongrightarrow> ?L
strict_mono r
(v \<circ> r) \<longlonglongrightarrow> limsup v

goal (1 subgoal):
 1. (u \<circ> r) \<longlonglongrightarrow> a
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(u \<circ> r) \<longlonglongrightarrow> a

goal (1 subgoal):
 1. limsup (\<lambda>n. u n * v n) = a * limsup v
[PROOF STEP]
with tendsto_mult_ereal[OF this r(2)]
[PROOF STATE]
proof (chain)
picking this:
\<not> (a = 0 \<and> \<bar>limsup v\<bar> = \<infinity> \<or> limsup v = 0 \<and> \<bar>a\<bar> = \<infinity>) \<Longrightarrow> (\<lambda>x. (u \<circ> r) x * (v \<circ> r) x) \<longlonglongrightarrow> a * limsup v
(u \<circ> r) \<longlonglongrightarrow> a
[PROOF STEP]
have "(\<lambda>n. (u o r) n * (v o r) n) \<longlonglongrightarrow> a * limsup v"
[PROOF STATE]
proof (prove)
using this:
\<not> (a = 0 \<and> \<bar>limsup v\<bar> = \<infinity> \<or> limsup v = 0 \<and> \<bar>a\<bar> = \<infinity>) \<Longrightarrow> (\<lambda>x. (u \<circ> r) x * (v \<circ> r) x) \<longlonglongrightarrow> a * limsup v
(u \<circ> r) \<longlonglongrightarrow> a

goal (1 subgoal):
 1. (\<lambda>n. (u \<circ> r) n * (v \<circ> r) n) \<longlonglongrightarrow> a * limsup v
[PROOF STEP]
using assms(2) assms(3)
[PROOF STATE]
proof (prove)
using this:
\<not> (a = 0 \<and> \<bar>limsup v\<bar> = \<infinity> \<or> limsup v = 0 \<and> \<bar>a\<bar> = \<infinity>) \<Longrightarrow> (\<lambda>x. (u \<circ> r) x * (v \<circ> r) x) \<longlonglongrightarrow> a * limsup v
(u \<circ> r) \<longlonglongrightarrow> a
0 < a
a \<noteq> \<infinity>

goal (1 subgoal):
 1. (\<lambda>n. (u \<circ> r) n * (v \<circ> r) n) \<longlonglongrightarrow> a * limsup v
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<lambda>n. (u \<circ> r) n * (v \<circ> r) n) \<longlonglongrightarrow> a * limsup v

goal (1 subgoal):
 1. limsup (\<lambda>n. u n * v n) = a * limsup v
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(\<lambda>n. (u \<circ> r) n * (v \<circ> r) n) \<longlonglongrightarrow> a * limsup v

goal (1 subgoal):
 1. limsup (\<lambda>n. u n * v n) = a * limsup v
[PROOF STEP]
have "\<And>n. (w o r) n = (u o r) n * (v o r) n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. (w \<circ> r) n = (u \<circ> r) n * (v \<circ> r) n
[PROOF STEP]
unfolding w_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. ((\<lambda>n. u n * v n) \<circ> r) n = (u \<circ> r) n * (v \<circ> r) n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(w \<circ> r) ?n = (u \<circ> r) ?n * (v \<circ> r) ?n

goal (1 subgoal):
 1. limsup (\<lambda>n. u n * v n) = a * limsup v
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>n. (u \<circ> r) n * (v \<circ> r) n) \<longlonglongrightarrow> a * limsup v
(w \<circ> r) ?n = (u \<circ> r) ?n * (v \<circ> r) ?n
[PROOF STEP]
have "(w o r) \<longlonglongrightarrow> a * limsup v"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. (u \<circ> r) n * (v \<circ> r) n) \<longlonglongrightarrow> a * limsup v
(w \<circ> r) ?n = (u \<circ> r) ?n * (v \<circ> r) ?n

goal (1 subgoal):
 1. (w \<circ> r) \<longlonglongrightarrow> a * limsup v
[PROOF STEP]
unfolding w_def
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. (u \<circ> r) n * (v \<circ> r) n) \<longlonglongrightarrow> a * limsup v
((\<lambda>n. u n * v n) \<circ> r) ?n = (u \<circ> r) ?n * (v \<circ> r) ?n

goal (1 subgoal):
 1. ((\<lambda>n. u n * v n) \<circ> r) \<longlonglongrightarrow> a * limsup v
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
(w \<circ> r) \<longlonglongrightarrow> a * limsup v

goal (1 subgoal):
 1. limsup (\<lambda>n. u n * v n) = a * limsup v
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(w \<circ> r) \<longlonglongrightarrow> a * limsup v
[PROOF STEP]
have "limsup (w o r) = a * limsup v"
[PROOF STATE]
proof (prove)
using this:
(w \<circ> r) \<longlonglongrightarrow> a * limsup v

goal (1 subgoal):
 1. limsup (w \<circ> r) = a * limsup v
[PROOF STEP]
by (simp add: tendsto_iff_Liminf_eq_Limsup)
[PROOF STATE]
proof (state)
this:
limsup (w \<circ> r) = a * limsup v

goal (1 subgoal):
 1. limsup (\<lambda>n. u n * v n) = a * limsup v
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
limsup (w \<circ> r) = a * limsup v
[PROOF STEP]
have I: "limsup w \<ge> a * limsup v"
[PROOF STATE]
proof (prove)
using this:
limsup (w \<circ> r) = a * limsup v

goal (1 subgoal):
 1. a * limsup v \<le> limsup w
[PROOF STEP]
by (metis limsup_subseq_mono r(1))
[PROOF STATE]
proof (state)
this:
a * limsup v \<le> limsup w

goal (1 subgoal):
 1. limsup (\<lambda>n. u n * v n) = a * limsup v
[PROOF STEP]
obtain s where s: "strict_mono s" "(w o s) \<longlonglongrightarrow> limsup w"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>s. \<lbrakk>strict_mono s; (w \<circ> s) \<longlonglongrightarrow> limsup w\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using limsup_subseq_lim
[PROOF STATE]
proof (prove)
using this:
\<exists>r. strict_mono r \<and> (?u \<circ> r) \<longlonglongrightarrow> limsup ?u

goal (1 subgoal):
 1. (\<And>s. \<lbrakk>strict_mono s; (w \<circ> s) \<longlonglongrightarrow> limsup w\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
strict_mono s
(w \<circ> s) \<longlonglongrightarrow> limsup w

goal (1 subgoal):
 1. limsup (\<lambda>n. u n * v n) = a * limsup v
[PROOF STEP]
have *: "(u o s) \<longlonglongrightarrow> a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (u \<circ> s) \<longlonglongrightarrow> a
[PROOF STEP]
using assms(1) LIMSEQ_subseq_LIMSEQ s
[PROOF STATE]
proof (prove)
using this:
u \<longlonglongrightarrow> a
\<lbrakk>?X \<longlonglongrightarrow> ?L; strict_mono ?f\<rbrakk> \<Longrightarrow> (?X \<circ> ?f) \<longlonglongrightarrow> ?L
strict_mono s
(w \<circ> s) \<longlonglongrightarrow> limsup w

goal (1 subgoal):
 1. (u \<circ> s) \<longlonglongrightarrow> a
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(u \<circ> s) \<longlonglongrightarrow> a

goal (1 subgoal):
 1. limsup (\<lambda>n. u n * v n) = a * limsup v
[PROOF STEP]
have "eventually (\<lambda>n. (u o s) n > 0) sequentially"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. 0 < (u \<circ> s) n
[PROOF STEP]
using assms(2) * order_tendsto_iff
[PROOF STATE]
proof (prove)
using this:
0 < a
(u \<circ> s) \<longlonglongrightarrow> a
(?f \<longlongrightarrow> ?x) ?F = ((\<forall>l<?x. \<forall>\<^sub>F x in ?F. l < ?f x) \<and> (\<forall>u>?x. \<forall>\<^sub>F x in ?F. ?f x < u))

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. 0 < (u \<circ> s) n
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in sequentially. 0 < (u \<circ> s) n

goal (1 subgoal):
 1. limsup (\<lambda>n. u n * v n) = a * limsup v
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in sequentially. 0 < (u \<circ> s) n

goal (1 subgoal):
 1. limsup (\<lambda>n. u n * v n) = a * limsup v
[PROOF STEP]
have "eventually (\<lambda>n. (u o s) n < \<infinity>) sequentially"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. (u \<circ> s) n < \<infinity>
[PROOF STEP]
using assms(3) * order_tendsto_iff
[PROOF STATE]
proof (prove)
using this:
a \<noteq> \<infinity>
(u \<circ> s) \<longlonglongrightarrow> a
(?f \<longlongrightarrow> ?x) ?F = ((\<forall>l<?x. \<forall>\<^sub>F x in ?F. l < ?f x) \<and> (\<forall>u>?x. \<forall>\<^sub>F x in ?F. ?f x < u))

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. (u \<circ> s) n < \<infinity>
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in sequentially. (u \<circ> s) n < \<infinity>

goal (1 subgoal):
 1. limsup (\<lambda>n. u n * v n) = a * limsup v
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in sequentially. (u \<circ> s) n < \<infinity>

goal (1 subgoal):
 1. limsup (\<lambda>n. u n * v n) = a * limsup v
[PROOF STEP]
have "(w o s) n / (u o s) n = (v o s) n" if "(u o s) n > 0" "(u o s) n < \<infinity>" for n
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (w \<circ> s) n / (u \<circ> s) n = (v \<circ> s) n
[PROOF STEP]
unfolding w_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>n. u n * v n) \<circ> s) n / (u \<circ> s) n = (v \<circ> s) n
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
0 < (u \<circ> s) n
(u \<circ> s) n < \<infinity>

goal (1 subgoal):
 1. ((\<lambda>n. u n * v n) \<circ> s) n / (u \<circ> s) n = (v \<circ> s) n
[PROOF STEP]
by (auto simp add: ereal_divide_eq)
[PROOF STATE]
proof (state)
this:
\<lbrakk>0 < (u \<circ> s) ?n; (u \<circ> s) ?n < \<infinity>\<rbrakk> \<Longrightarrow> (w \<circ> s) ?n / (u \<circ> s) ?n = (v \<circ> s) ?n

goal (1 subgoal):
 1. limsup (\<lambda>n. u n * v n) = a * limsup v
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F n in sequentially. 0 < (u \<circ> s) n
\<forall>\<^sub>F n in sequentially. (u \<circ> s) n < \<infinity>
\<lbrakk>0 < (u \<circ> s) ?n; (u \<circ> s) ?n < \<infinity>\<rbrakk> \<Longrightarrow> (w \<circ> s) ?n / (u \<circ> s) ?n = (v \<circ> s) ?n
[PROOF STEP]
have "eventually (\<lambda>n. (w o s) n / (u o s) n = (v o s) n) sequentially"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F n in sequentially. 0 < (u \<circ> s) n
\<forall>\<^sub>F n in sequentially. (u \<circ> s) n < \<infinity>
\<lbrakk>0 < (u \<circ> s) ?n; (u \<circ> s) ?n < \<infinity>\<rbrakk> \<Longrightarrow> (w \<circ> s) ?n / (u \<circ> s) ?n = (v \<circ> s) ?n

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. (w \<circ> s) n / (u \<circ> s) n = (v \<circ> s) n
[PROOF STEP]
using eventually_elim2
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F n in sequentially. 0 < (u \<circ> s) n
\<forall>\<^sub>F n in sequentially. (u \<circ> s) n < \<infinity>
\<lbrakk>0 < (u \<circ> s) ?n; (u \<circ> s) ?n < \<infinity>\<rbrakk> \<Longrightarrow> (w \<circ> s) ?n / (u \<circ> s) ?n = (v \<circ> s) ?n
\<lbrakk>eventually ?P ?F; eventually ?Q ?F; \<And>i. \<lbrakk>?P i; ?Q i\<rbrakk> \<Longrightarrow> ?R i\<rbrakk> \<Longrightarrow> eventually ?R ?F

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. (w \<circ> s) n / (u \<circ> s) n = (v \<circ> s) n
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in sequentially. (w \<circ> s) n / (u \<circ> s) n = (v \<circ> s) n

goal (1 subgoal):
 1. limsup (\<lambda>n. u n * v n) = a * limsup v
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in sequentially. (w \<circ> s) n / (u \<circ> s) n = (v \<circ> s) n

goal (1 subgoal):
 1. limsup (\<lambda>n. u n * v n) = a * limsup v
[PROOF STEP]
have "(\<lambda>n. (w o s) n / (u o s) n) \<longlonglongrightarrow> (limsup w) / a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. (w \<circ> s) n / (u \<circ> s) n) \<longlonglongrightarrow> limsup w / a
[PROOF STEP]
apply (rule tendsto_divide_ereal[OF s(2) *])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. a \<noteq> 0
 2. \<not> (\<bar>limsup w\<bar> = \<infinity> \<and> \<bar>a\<bar> = \<infinity>)
[PROOF STEP]
using assms(2) assms(3)
[PROOF STATE]
proof (prove)
using this:
0 < a
a \<noteq> \<infinity>

goal (2 subgoals):
 1. a \<noteq> 0
 2. \<not> (\<bar>limsup w\<bar> = \<infinity> \<and> \<bar>a\<bar> = \<infinity>)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<lambda>n. (w \<circ> s) n / (u \<circ> s) n) \<longlonglongrightarrow> limsup w / a

goal (1 subgoal):
 1. limsup (\<lambda>n. u n * v n) = a * limsup v
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F n in sequentially. (w \<circ> s) n / (u \<circ> s) n = (v \<circ> s) n
(\<lambda>n. (w \<circ> s) n / (u \<circ> s) n) \<longlonglongrightarrow> limsup w / a
[PROOF STEP]
have "(v o s) \<longlonglongrightarrow> (limsup w) / a"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F n in sequentially. (w \<circ> s) n / (u \<circ> s) n = (v \<circ> s) n
(\<lambda>n. (w \<circ> s) n / (u \<circ> s) n) \<longlonglongrightarrow> limsup w / a

goal (1 subgoal):
 1. (v \<circ> s) \<longlonglongrightarrow> limsup w / a
[PROOF STEP]
using Lim_transform_eventually
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F n in sequentially. (w \<circ> s) n / (u \<circ> s) n = (v \<circ> s) n
(\<lambda>n. (w \<circ> s) n / (u \<circ> s) n) \<longlonglongrightarrow> limsup w / a
\<lbrakk>(?f \<longlongrightarrow> ?l) ?F; \<forall>\<^sub>F x in ?F. ?f x = ?g x\<rbrakk> \<Longrightarrow> (?g \<longlongrightarrow> ?l) ?F

goal (1 subgoal):
 1. (v \<circ> s) \<longlonglongrightarrow> limsup w / a
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
(v \<circ> s) \<longlonglongrightarrow> limsup w / a

goal (1 subgoal):
 1. limsup (\<lambda>n. u n * v n) = a * limsup v
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(v \<circ> s) \<longlonglongrightarrow> limsup w / a
[PROOF STEP]
have "limsup (v o s) = (limsup w) / a"
[PROOF STATE]
proof (prove)
using this:
(v \<circ> s) \<longlonglongrightarrow> limsup w / a

goal (1 subgoal):
 1. limsup (v \<circ> s) = limsup w / a
[PROOF STEP]
by (simp add: tendsto_iff_Liminf_eq_Limsup)
[PROOF STATE]
proof (state)
this:
limsup (v \<circ> s) = limsup w / a

goal (1 subgoal):
 1. limsup (\<lambda>n. u n * v n) = a * limsup v
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
limsup (v \<circ> s) = limsup w / a
[PROOF STEP]
have "limsup v \<ge> (limsup w) / a"
[PROOF STATE]
proof (prove)
using this:
limsup (v \<circ> s) = limsup w / a

goal (1 subgoal):
 1. limsup w / a \<le> limsup v
[PROOF STEP]
by (metis limsup_subseq_mono s(1))
[PROOF STATE]
proof (state)
this:
limsup w / a \<le> limsup v

goal (1 subgoal):
 1. limsup (\<lambda>n. u n * v n) = a * limsup v
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
limsup w / a \<le> limsup v
[PROOF STEP]
have "a * limsup v \<ge> limsup w"
[PROOF STATE]
proof (prove)
using this:
limsup w / a \<le> limsup v

goal (1 subgoal):
 1. limsup w \<le> a * limsup v
[PROOF STEP]
using assms(2) assms(3)
[PROOF STATE]
proof (prove)
using this:
limsup w / a \<le> limsup v
0 < a
a \<noteq> \<infinity>

goal (1 subgoal):
 1. limsup w \<le> a * limsup v
[PROOF STEP]
by (simp add: ereal_divide_le_pos)
[PROOF STATE]
proof (state)
this:
limsup w \<le> a * limsup v

goal (1 subgoal):
 1. limsup (\<lambda>n. u n * v n) = a * limsup v
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
limsup w \<le> a * limsup v
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
limsup w \<le> a * limsup v

goal (1 subgoal):
 1. limsup (\<lambda>n. u n * v n) = a * limsup v
[PROOF STEP]
using I
[PROOF STATE]
proof (prove)
using this:
limsup w \<le> a * limsup v
a * limsup v \<le> limsup w

goal (1 subgoal):
 1. limsup (\<lambda>n. u n * v n) = a * limsup v
[PROOF STEP]
unfolding w_def
[PROOF STATE]
proof (prove)
using this:
limsup (\<lambda>n. u n * v n) \<le> a * limsup v
a * limsup v \<le> limsup (\<lambda>n. u n * v n)

goal (1 subgoal):
 1. limsup (\<lambda>n. u n * v n) = a * limsup v
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
limsup (\<lambda>n. u n * v n) = a * limsup v

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma mulextp_code[code]:
  "mulextp f (Bag xs) (Bag ys) = mul_ext f (ass_list_to_single_list (DAList.impl_of xs)) (ass_list_to_single_list (DAList.impl_of ys))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mulextp f (Bag xs) (Bag ys) = mul_ext f (ass_list_to_single_list (alist.impl_of xs)) (ass_list_to_single_list (alist.impl_of ys))
[PROOF STEP]
unfolding mulextp_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (smulextp f (Bag xs) (Bag ys), nsmulextp f (Bag xs) (Bag ys)) = mul_ext f (ass_list_to_single_list (alist.impl_of xs)) (ass_list_to_single_list (alist.impl_of ys))
[PROOF STEP]
by (simp add: nsmulextp_code smulextp_code)


[STATEMENT]
lemma transp_realrel: "transp realrel"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. transp realrel
[PROOF STEP]
unfolding realrel_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. transp (\<lambda>X Y. cauchy X \<and> cauchy Y \<and> vanishes (\<lambda>n. X n - Y n))
[PROOF STEP]
by (rule transpI) (force simp add: dest: vanishes_add)


[STATEMENT]
lemma imirror_imirror_ident: "finite I \<Longrightarrow> imirror (imirror I) = I"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite I \<Longrightarrow> imirror (imirror I) = I
[PROOF STEP]
apply (case_tac "I = {}", simp add: imirror_empty)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite I; I \<noteq> {}\<rbrakk> \<Longrightarrow> imirror (imirror I) = I
[PROOF STEP]
apply (simp add: imirror_eq_imirror_bounds imirror_bounds_iMin imirror_bounds_Max
  le_add1 trans_le_add2 imirror_bounds_imirror_bounds_ident)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma lookup_list_to_poly: "lookup (list_to_poly ts cs) = list_to_fun ts cs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lookup (list_to_poly ts cs) = list_to_fun ts cs
[PROOF STEP]
unfolding list_to_poly_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lookup (Abs_poly_mapping (list_to_fun ts cs)) = list_to_fun ts cs
[PROOF STEP]
proof (rule Abs_poly_mapping_inverse, rule, rule finite_subset)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. {x. list_to_fun ts cs x \<noteq> (0::'c)} \<subseteq> ?B4
 2. finite ?B4
[PROOF STEP]
show "{x. list_to_fun ts cs x \<noteq> 0} \<subseteq> set ts"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {x. list_to_fun ts cs x \<noteq> (0::'c)} \<subseteq> set ts
[PROOF STEP]
proof (rule, simp)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. list_to_fun ts cs x \<noteq> (0::'c) \<Longrightarrow> x \<in> set ts
[PROOF STEP]
fix t
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. list_to_fun ts cs x \<noteq> (0::'c) \<Longrightarrow> x \<in> set ts
[PROOF STEP]
assume "list_to_fun ts cs t \<noteq> 0"
[PROOF STATE]
proof (state)
this:
list_to_fun ts cs t \<noteq> (0::'c)

goal (1 subgoal):
 1. \<And>x. list_to_fun ts cs x \<noteq> (0::'c) \<Longrightarrow> x \<in> set ts
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
list_to_fun ts cs t \<noteq> (0::'c)
[PROOF STEP]
obtain c where "map_of (zip ts cs) t = Some c"
[PROOF STATE]
proof (prove)
using this:
list_to_fun ts cs t \<noteq> (0::'c)

goal (1 subgoal):
 1. (\<And>c. map_of (zip ts cs) t = Some c \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding list_to_fun_def
[PROOF STATE]
proof (prove)
using this:
(case map_of (zip ts cs) t of None \<Rightarrow> 0::'c | Some c \<Rightarrow> c) \<noteq> (0::'c)

goal (1 subgoal):
 1. (\<And>c. map_of (zip ts cs) t = Some c \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
map_of (zip ts cs) t = Some c

goal (1 subgoal):
 1. \<And>x. list_to_fun ts cs x \<noteq> (0::'c) \<Longrightarrow> x \<in> set ts
[PROOF STEP]
thus "t \<in> set ts"
[PROOF STATE]
proof (prove)
using this:
map_of (zip ts cs) t = Some c

goal (1 subgoal):
 1. t \<in> set ts
[PROOF STEP]
by (meson in_set_zipE map_of_SomeD)
[PROOF STATE]
proof (state)
this:
t \<in> set ts

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
{x. list_to_fun ts cs x \<noteq> (0::'c)} \<subseteq> set ts

goal (1 subgoal):
 1. finite (set ts)
[PROOF STEP]
qed simp


[STATEMENT]
lemma Gromov_converging_at_boundaryI:
  assumes "\<And>M. \<exists>N. \<forall>n \<ge> N. \<forall>m \<ge> N. Gromov_product_at a (u m) (u n) \<ge> M"
  shows "Gromov_converging_at_boundary u"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Gromov_converging_at_boundary u
[PROOF STEP]
unfolding Gromov_converging_at_boundary_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>a M. \<exists>N. \<forall>n\<ge>N. \<forall>m\<ge>N. M \<le> Gromov_product_at a (u m) (u n)
[PROOF STEP]
proof (auto)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a M. \<exists>N. \<forall>n\<ge>N. \<forall>m\<ge>N. M \<le> Gromov_product_at a (u m) (u n)
[PROOF STEP]
fix b::'a and M::real
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a M. \<exists>N. \<forall>n\<ge>N. \<forall>m\<ge>N. M \<le> Gromov_product_at a (u m) (u n)
[PROOF STEP]
obtain N where *: "\<And>m n. n \<ge> N \<Longrightarrow> m \<ge> N \<Longrightarrow> Gromov_product_at a (u m) (u n) \<ge> M + dist a b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>N. (\<And>m n. \<lbrakk>N \<le> n; N \<le> m\<rbrakk> \<Longrightarrow> M + dist a b \<le> Gromov_product_at a (u m) (u n)) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms[of "M + dist a b"]
[PROOF STATE]
proof (prove)
using this:
\<exists>N. \<forall>n\<ge>N. \<forall>m\<ge>N. M + dist a b \<le> Gromov_product_at a (u m) (u n)

goal (1 subgoal):
 1. (\<And>N. (\<And>m n. \<lbrakk>N \<le> n; N \<le> m\<rbrakk> \<Longrightarrow> M + dist a b \<le> Gromov_product_at a (u m) (u n)) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<lbrakk>N \<le> ?n; N \<le> ?m\<rbrakk> \<Longrightarrow> M + dist a b \<le> Gromov_product_at a (u ?m) (u ?n)

goal (1 subgoal):
 1. \<And>a M. \<exists>N. \<forall>n\<ge>N. \<forall>m\<ge>N. M \<le> Gromov_product_at a (u m) (u n)
[PROOF STEP]
have "Gromov_product_at b (u m) (u n) \<ge> M" if "m \<ge> N" "n \<ge> N" for m n
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. M \<le> Gromov_product_at b (u m) (u n)
[PROOF STEP]
using *[OF that] Gromov_product_at_diff1[of a "u m" "u n" b]
[PROOF STATE]
proof (prove)
using this:
M + dist a b \<le> Gromov_product_at a (u n) (u m)
\<bar>Gromov_product_at a (u m) (u n) - Gromov_product_at b (u m) (u n)\<bar> \<le> dist a b

goal (1 subgoal):
 1. M \<le> Gromov_product_at b (u m) (u n)
[PROOF STEP]
by (smt Gromov_product_commute)
[PROOF STATE]
proof (state)
this:
\<lbrakk>N \<le> ?m; N \<le> ?n\<rbrakk> \<Longrightarrow> M \<le> Gromov_product_at b (u ?m) (u ?n)

goal (1 subgoal):
 1. \<And>a M. \<exists>N. \<forall>n\<ge>N. \<forall>m\<ge>N. M \<le> Gromov_product_at a (u m) (u n)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>N \<le> ?m; N \<le> ?n\<rbrakk> \<Longrightarrow> M \<le> Gromov_product_at b (u ?m) (u ?n)
[PROOF STEP]
show "\<exists>N. \<forall>n \<ge> N. \<forall>m \<ge> N. M \<le> Gromov_product_at b (u m) (u n)"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>N \<le> ?m; N \<le> ?n\<rbrakk> \<Longrightarrow> M \<le> Gromov_product_at b (u ?m) (u ?n)

goal (1 subgoal):
 1. \<exists>N. \<forall>n\<ge>N. \<forall>m\<ge>N. M \<le> Gromov_product_at b (u m) (u n)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>N. \<forall>n\<ge>N. \<forall>m\<ge>N. M \<le> Gromov_product_at b (u m) (u n)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma edges_empty[simp]: "edges empty = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. edges FiniteGraph.empty = {}
[PROOF STEP]
unfolding empty_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. edges \<lparr>nodes = {}, edges = {}\<rparr> = {}
[PROOF STEP]
by simp

  \<comment> \<open>add node\<close>


[STATEMENT]
lemma ceiling_neg_numeral [simp]: "\<lceil>- numeral v\<rceil> = - numeral v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lceil>- numeral v\<rceil> = - numeral v
[PROOF STEP]
using ceiling_of_int [of "- numeral v"]
[PROOF STATE]
proof (prove)
using this:
\<lceil>of_int (- numeral v)\<rceil> = - numeral v

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


[STATEMENT]
lemma n_bool_lists_distinct: "distinct (n_bool_lists n x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distinct (n_bool_lists n x)
[PROOF STEP]
proof(induct x arbitrary: n)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>n. distinct (n_bool_lists n 0)
 2. \<And>x n. (\<And>n. distinct (n_bool_lists n x)) \<Longrightarrow> distinct (n_bool_lists n (Suc x))
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. \<And>n. distinct (n_bool_lists n 0)
 2. \<And>x n. (\<And>n. distinct (n_bool_lists n x)) \<Longrightarrow> distinct (n_bool_lists n (Suc x))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distinct (n_bool_lists n 0)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
distinct (n_bool_lists n 0)

goal (1 subgoal):
 1. \<And>x n. (\<And>n. distinct (n_bool_lists n x)) \<Longrightarrow> distinct (n_bool_lists n (Suc x))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x n. (\<And>n. distinct (n_bool_lists n x)) \<Longrightarrow> distinct (n_bool_lists n (Suc x))
[PROOF STEP]
case (Suc x)
[PROOF STATE]
proof (state)
this:
distinct (n_bool_lists ?n x)

goal (1 subgoal):
 1. \<And>x n. (\<And>n. distinct (n_bool_lists n x)) \<Longrightarrow> distinct (n_bool_lists n (Suc x))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
distinct (n_bool_lists ?n x)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
distinct (n_bool_lists ?n x)

goal (1 subgoal):
 1. distinct (n_bool_lists n (Suc x))
[PROOF STEP]
using distinct_map
[PROOF STATE]
proof (prove)
using this:
distinct (n_bool_lists ?n x)
distinct (map ?f ?xs) = (distinct ?xs \<and> inj_on ?f (set ?xs))

goal (1 subgoal):
 1. distinct (n_bool_lists n (Suc x))
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
distinct (n_bool_lists n (Suc x))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma n_leaves_reflect: "n_leaves (reflect t) = n_leaves t"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n_leaves (reflect t) = n_leaves t
[PROOF STEP]
proof (induct t)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. n_leaves (reflect Lf) = n_leaves Lf
 2. \<And>x1 t1 t2. \<lbrakk>n_leaves (reflect t1) = n_leaves t1; n_leaves (reflect t2) = n_leaves t2\<rbrakk> \<Longrightarrow> n_leaves (reflect (Br x1 t1 t2)) = n_leaves (Br x1 t1 t2)
[PROOF STEP]
case Lf
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. n_leaves (reflect Lf) = n_leaves Lf
 2. \<And>x1 t1 t2. \<lbrakk>n_leaves (reflect t1) = n_leaves t1; n_leaves (reflect t2) = n_leaves t2\<rbrakk> \<Longrightarrow> n_leaves (reflect (Br x1 t1 t2)) = n_leaves (Br x1 t1 t2)
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n_leaves (reflect Lf) = n_leaves Lf
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. n_leaves (reflect Lf) = n_leaves Lf
[PROOF STEP]
let "?p\<^sub>1 x\<^sub>1" = "x\<^sub>1 \<noteq> n_leaves (reflect (Lf::'a bt))"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. n_leaves (reflect Lf) = n_leaves Lf
[PROOF STEP]
have "\<not> ?p\<^sub>1 (Suc 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> Suc 0 \<noteq> n_leaves (reflect Lf)
[PROOF STEP]
by (metis reflect.simps(1) n_leaves.simps(1))
[PROOF STATE]
proof (state)
this:
\<not> Suc 0 \<noteq> n_leaves (reflect Lf)

goal (1 subgoal):
 1. n_leaves (reflect Lf) = n_leaves Lf
[PROOF STEP]
hence "\<not> ?p\<^sub>1 (n_leaves (Lf::'a bt))"
[PROOF STATE]
proof (prove)
using this:
\<not> Suc 0 \<noteq> n_leaves (reflect Lf)

goal (1 subgoal):
 1. \<not> n_leaves Lf \<noteq> n_leaves (reflect Lf)
[PROOF STEP]
by (metis n_leaves.simps(1))
[PROOF STATE]
proof (state)
this:
\<not> n_leaves Lf \<noteq> n_leaves (reflect Lf)

goal (1 subgoal):
 1. n_leaves (reflect Lf) = n_leaves Lf
[PROOF STEP]
thus "n_leaves (reflect (Lf::'a bt)) = n_leaves (Lf::'a bt)"
[PROOF STATE]
proof (prove)
using this:
\<not> n_leaves Lf \<noteq> n_leaves (reflect Lf)

goal (1 subgoal):
 1. n_leaves (reflect Lf) = n_leaves Lf
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
n_leaves (reflect Lf) = n_leaves Lf

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
n_leaves (reflect Lf) = n_leaves Lf

goal (1 subgoal):
 1. \<And>x1 t1 t2. \<lbrakk>n_leaves (reflect t1) = n_leaves t1; n_leaves (reflect t2) = n_leaves t2\<rbrakk> \<Longrightarrow> n_leaves (reflect (Br x1 t1 t2)) = n_leaves (Br x1 t1 t2)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x1 t1 t2. \<lbrakk>n_leaves (reflect t1) = n_leaves t1; n_leaves (reflect t2) = n_leaves t2\<rbrakk> \<Longrightarrow> n_leaves (reflect (Br x1 t1 t2)) = n_leaves (Br x1 t1 t2)
[PROOF STEP]
case (Br a t1 t2)
[PROOF STATE]
proof (state)
this:
n_leaves (reflect t1) = n_leaves t1
n_leaves (reflect t2) = n_leaves t2

goal (1 subgoal):
 1. \<And>x1 t1 t2. \<lbrakk>n_leaves (reflect t1) = n_leaves t1; n_leaves (reflect t2) = n_leaves t2\<rbrakk> \<Longrightarrow> n_leaves (reflect (Br x1 t1 t2)) = n_leaves (Br x1 t1 t2)
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
n_leaves (reflect t1) = n_leaves t1
n_leaves (reflect t2) = n_leaves t2

goal (1 subgoal):
 1. n_leaves (reflect (Br a t1 t2)) = n_leaves (Br a t1 t2)
[PROOF STEP]
by (metis n_leaves.simps(2) add.commute reflect.simps(2))
[PROOF STATE]
proof (state)
this:
n_leaves (reflect (Br a t1 t2)) = n_leaves (Br a t1 t2)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma push_push_map: "length ns = n \<Longrightarrow>
  list_eval (map (\<lambda>x. push_param x n) ls) (push_list a ns) = list_eval ls a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length ns = n \<Longrightarrow> list_eval (map (\<lambda>x. push_param x n) ls) (push_list a ns) = list_eval ls a
[PROOF STEP]
unfolding list_eval_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length ns = n \<Longrightarrow> (!) (map (\<lambda>x. peval x (push_list a ns)) (map (\<lambda>x. push_param x n) ls)) = (!) (map (\<lambda>x. peval x a) ls)
[PROOF STEP]
apply (induction ls, simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>aa ls. \<lbrakk>length ns = n \<Longrightarrow> (!) (map (\<lambda>x. peval x (push_list a ns)) (map (\<lambda>x. push_param x n) ls)) = (!) (map (\<lambda>x. peval x a) ls); length ns = n\<rbrakk> \<Longrightarrow> (!) (map (\<lambda>x. peval x (push_list a ns)) (map (\<lambda>x. push_param x n) (aa # ls))) = (!) (map (\<lambda>x. peval x a) (aa # ls))
[PROOF STEP]
apply (induction ns, auto)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>aa ls. \<lbrakk>(!) (map ((\<lambda>x. peval x (push_list a [])) \<circ> (\<lambda>x. push_param x 0)) ls) = (!) (map (\<lambda>x. peval x a) ls); n = 0\<rbrakk> \<Longrightarrow> (!) (peval (push_param aa 0) (push_list a []) # map ((\<lambda>x. peval x (push_list a [])) \<circ> (\<lambda>x. push_param x 0)) ls) = (!) (peval aa a # map (\<lambda>x. peval x a) ls)
 2. \<And>aa ns aaa ls. \<lbrakk>(!) (map ((\<lambda>x. peval x (push_list a (aa # ns))) \<circ> (\<lambda>x. push_param x (Suc (length ns)))) ls) = (!) (map (\<lambda>x. peval x a) ls); n = Suc (length ns)\<rbrakk> \<Longrightarrow> (!) (peval (push_param aaa (Suc (length ns))) (push_list a (aa # ns)) # map ((\<lambda>x. peval x (push_list a (aa # ns))) \<circ> (\<lambda>x. push_param x (Suc (length ns)))) ls) = (!) (peval aaa a # map (\<lambda>x. peval x a) ls)
[PROOF STEP]
apply (metis length_map list.size(3) nth_equalityI push_push)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>aa ns aaa ls. \<lbrakk>(!) (map ((\<lambda>x. peval x (push_list a (aa # ns))) \<circ> (\<lambda>x. push_param x (Suc (length ns)))) ls) = (!) (map (\<lambda>x. peval x a) ls); n = Suc (length ns)\<rbrakk> \<Longrightarrow> (!) (peval (push_param aaa (Suc (length ns))) (push_list a (aa # ns)) # map ((\<lambda>x. peval x (push_list a (aa # ns))) \<circ> (\<lambda>x. push_param x (Suc (length ns)))) ls) = (!) (peval aaa a # map (\<lambda>x. peval x a) ls)
[PROOF STEP]
by (metis length_Cons length_map map_nth push_push)


[STATEMENT]
lemma finite_Uses [simp, intro!]: "finite (Uses c n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (Uses c n)
[PROOF STEP]
unfolding Uses.simps
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {V. \<exists>l ca. n = (_ l _) \<and> labels c l ca \<and> V \<in> rhs ca}
[PROOF STEP]
apply clarsimp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {V. \<exists>l. n = (_ l _) \<and> (\<exists>ca. labels c l ca \<and> V \<in> rhs ca)}
[PROOF STEP]
apply (rule_tac B="\<Union>(rhs ` snd ` {(l,c'). labels c l c'})" in finite_subset)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. {V. \<exists>l. n = (_ l _) \<and> (\<exists>ca. labels c l ca \<and> V \<in> rhs ca)} \<subseteq> \<Union> (rhs ` snd ` {(l, c'). labels c l c'})
 2. finite (\<Union> (rhs ` snd ` {(l, c'). labels c l c'}))
[PROOF STEP]
apply fastforce
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (\<Union> (rhs ` snd ` {(l, c'). labels c l c'}))
[PROOF STEP]
apply (rule finite_Union)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. finite (rhs ` snd ` {(l, c'). labels c l c'})
 2. \<And>M. M \<in> rhs ` snd ` {(l, c'). labels c l c'} \<Longrightarrow> finite M
[PROOF STEP]
apply (rule finite_imageI)+
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. finite {(l, c'). labels c l c'}
 2. \<And>M. M \<in> rhs ` snd ` {(l, c'). labels c l c'} \<Longrightarrow> finite M
[PROOF STEP]
apply (rule finite_labels')
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>M. M \<in> rhs ` snd ` {(l, c'). labels c l c'} \<Longrightarrow> finite M
[PROOF STEP]
by (clarsimp simp: uses_cmd_finite)


[STATEMENT]
lemma union_of_subsets_by_singleton:
  assumes "Suc (card S') = card S" "Suc (card S'') = card S"
    and "S' \<noteq> S''" "S' \<subseteq> S" "S'' \<subseteq> S"
  shows "S' \<union> S'' = S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. S' \<union> S'' = S
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. S' \<union> S'' = S
[PROOF STEP]
obtain x y where x: "insert x S' = S" "x\<notin>S'" and y: "insert y S'' = S" "y\<notin>S''"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>x y. \<lbrakk>insert x S' = S; x \<notin> S'; insert y S'' = S; y \<notin> S''\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms(1,2,4,5)
[PROOF STATE]
proof (prove)
using this:
Suc (card S') = card S
Suc (card S'') = card S
S' \<subseteq> S
S'' \<subseteq> S

goal (1 subgoal):
 1. (\<And>x y. \<lbrakk>insert x S' = S; x \<notin> S'; insert y S'' = S; y \<notin> S''\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis card_Suc_ex)
[PROOF STATE]
proof (state)
this:
insert x S' = S
x \<notin> S'
insert y S'' = S
y \<notin> S''

goal (1 subgoal):
 1. S' \<union> S'' = S
[PROOF STEP]
have "x\<noteq>y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<noteq> y
[PROOF STEP]
using x y assms(3)
[PROOF STATE]
proof (prove)
using this:
insert x S' = S
x \<notin> S'
insert y S'' = S
y \<notin> S''
S' \<noteq> S''

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

goal (1 subgoal):
 1. S' \<union> S'' = S
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
x \<noteq> y

goal (1 subgoal):
 1. S' \<union> S'' = S
[PROOF STEP]
using x(1) y(1)
[PROOF STATE]
proof (prove)
using this:
x \<noteq> y
insert x S' = S
insert y S'' = S

goal (1 subgoal):
 1. S' \<union> S'' = S
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
S' \<union> S'' = S

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma num_of_bintr':
  "take_bit (LENGTH('a::len)) (numeral a :: int) = (numeral b) \<Longrightarrow>
    numeral a = (numeral b :: 'a word)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. take_bit LENGTH('a) (numeral a) = numeral b \<Longrightarrow> numeral a = numeral b
[PROOF STEP]
proof (transfer fixing: a b)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. take_bit LENGTH('a) (numeral a) = numeral b \<Longrightarrow> take_bit LENGTH('a) (numeral a) = take_bit LENGTH('a) (numeral b)
[PROOF STEP]
assume \<open>take_bit LENGTH('a) (numeral a :: int) = numeral b\<close>
[PROOF STATE]
proof (state)
this:
take_bit LENGTH('a) (numeral a) = numeral b

goal (1 subgoal):
 1. take_bit LENGTH('a) (numeral a) = numeral b \<Longrightarrow> take_bit LENGTH('a) (numeral a) = take_bit LENGTH('a) (numeral b)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
take_bit LENGTH('a) (numeral a) = numeral b
[PROOF STEP]
have \<open>take_bit LENGTH('a) (take_bit LENGTH('a) (numeral a :: int)) = take_bit LENGTH('a) (numeral b)\<close>
[PROOF STATE]
proof (prove)
using this:
take_bit LENGTH('a) (numeral a) = numeral b

goal (1 subgoal):
 1. take_bit LENGTH('a) (take_bit LENGTH('a) (numeral a)) = take_bit LENGTH('a) (numeral b)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
take_bit LENGTH('a) (take_bit LENGTH('a) (numeral a)) = take_bit LENGTH('a) (numeral b)

goal (1 subgoal):
 1. take_bit LENGTH('a) (numeral a) = numeral b \<Longrightarrow> take_bit LENGTH('a) (numeral a) = take_bit LENGTH('a) (numeral b)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
take_bit LENGTH('a) (take_bit LENGTH('a) (numeral a)) = take_bit LENGTH('a) (numeral b)
[PROOF STEP]
show \<open>take_bit LENGTH('a) (numeral a :: int) = take_bit LENGTH('a) (numeral b)\<close>
[PROOF STATE]
proof (prove)
using this:
take_bit LENGTH('a) (take_bit LENGTH('a) (numeral a)) = take_bit LENGTH('a) (numeral b)

goal (1 subgoal):
 1. take_bit LENGTH('a) (numeral a) = take_bit LENGTH('a) (numeral b)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
take_bit LENGTH('a) (numeral a) = take_bit LENGTH('a) (numeral b)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma proj_list_3_same:
  assumes "proj_list_3 xs (ys, z, zs) = (ys', z', zs')"
    "length xs = length ys + 1 + length zs"
  shows "xs = ys' @ z' # zs'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. xs = ys' @ z' # zs'
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
proj_list_3 xs (ys, z, zs) = (ys', z', zs')
length xs = length ys + 1 + length zs

goal (1 subgoal):
 1. xs = ys' @ z' # zs'
[PROOF STEP]
by (auto simp add: id_take_nth_drop)


[STATEMENT]
lemma complex_cnj_pochhammer [simp]: "cnj (pochhammer z n) = pochhammer (cnj z) n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cnj (pochhammer z n) = pochhammer (cnj z) n
[PROOF STEP]
by (induct n arbitrary: z) (simp_all add: pochhammer_rec)