[STATEMENT]
theorem 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" "a < b"
  shows
    "(\<forall>x. a < x \<longrightarrow> x < b \<longrightarrow> x \<notin> D \<longrightarrow> (\<lambda>u. integral {a..u} f) differentiable at x) \<and>
    (\<forall>x. a \<le> x \<longrightarrow> x < b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_right x) \<and>
    (\<forall>x. a < x \<longrightarrow> x \<le> b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_left x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>x>a. x < b \<longrightarrow> x \<notin> D \<longrightarrow> (\<lambda>u. integral {a..u} f) differentiable at x) \<and> (\<forall>x\<ge>a. x < b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_right x) \<and> (\<forall>x>a. x \<le> b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_left x)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
piecewise_continuous_on a b D f
a < b

goal (1 subgoal):
 1. (\<forall>x>a. x < b \<longrightarrow> x \<notin> D \<longrightarrow> (\<lambda>u. integral {a..u} f) differentiable at x) \<and> (\<forall>x\<ge>a. x < b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_right x) \<and> (\<forall>x>a. x \<le> b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_left x)
[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. \<lbrakk>continuous_on {a..b} f; a < b\<rbrakk> \<Longrightarrow> (\<forall>x>a. x < b \<longrightarrow> x \<notin> {} \<longrightarrow> (\<lambda>u. integral {a..u} f) differentiable at x) \<and> (\<forall>x\<ge>a. x < b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_right x) \<and> (\<forall>x>a. x \<le> b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_left x)
 2. \<And>a i b I f1 f2 f. \<lbrakk>a \<le> i; i \<le> b; i \<notin> I; a < i \<Longrightarrow> (\<forall>x>a. x < i \<longrightarrow> x \<notin> I \<longrightarrow> (\<lambda>u. integral {a..u} f1) differentiable at x) \<and> (\<forall>x\<ge>a. x < i \<longrightarrow> (\<lambda>t. integral {a..t} f1) differentiable at_right x) \<and> (\<forall>x>a. x \<le> i \<longrightarrow> (\<lambda>t. integral {a..t} f1) differentiable at_left x); i < b \<Longrightarrow> (\<forall>x>i. x < b \<longrightarrow> x \<notin> I \<longrightarrow> (\<lambda>u. integral {i..u} f2) differentiable at x) \<and> (\<forall>x\<ge>i. x < b \<longrightarrow> (\<lambda>t. integral {i..t} f2) differentiable at_right x) \<and> (\<forall>x>i. x \<le> b \<longrightarrow> (\<lambda>t. integral {i..t} f2) differentiable at_left x); 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); a < b\<rbrakk> \<Longrightarrow> (\<forall>x>a. x < b \<longrightarrow> x \<notin> insert i I \<longrightarrow> (\<lambda>u. integral {a..u} f) differentiable at x) \<and> (\<forall>x\<ge>a. x < b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_right x) \<and> (\<forall>x>a. x \<le> b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_left x)
 3. \<And>a b i I f. \<lbrakk>a < b \<Longrightarrow> (\<forall>x>a. x < b \<longrightarrow> x \<notin> I \<longrightarrow> (\<lambda>u. integral {a..u} f) differentiable at x) \<and> (\<forall>x\<ge>a. x < b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_right x) \<and> (\<forall>x>a. x \<le> b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_left x); finite I; i \<notin> I; a < b\<rbrakk> \<Longrightarrow> (\<forall>x>a. x < b \<longrightarrow> x \<notin> insert i I \<longrightarrow> (\<lambda>u. integral {a..u} f) differentiable at x) \<and> (\<forall>x\<ge>a. x < b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_right x) \<and> (\<forall>x>a. x \<le> b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_left x)
[PROOF STEP]
case (empty a b f)
[PROOF STATE]
proof (state)
this:
continuous_on {a..b} f
a < b

goal (3 subgoals):
 1. \<And>a b f. \<lbrakk>continuous_on {a..b} f; a < b\<rbrakk> \<Longrightarrow> (\<forall>x>a. x < b \<longrightarrow> x \<notin> {} \<longrightarrow> (\<lambda>u. integral {a..u} f) differentiable at x) \<and> (\<forall>x\<ge>a. x < b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_right x) \<and> (\<forall>x>a. x \<le> b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_left x)
 2. \<And>a i b I f1 f2 f. \<lbrakk>a \<le> i; i \<le> b; i \<notin> I; a < i \<Longrightarrow> (\<forall>x>a. x < i \<longrightarrow> x \<notin> I \<longrightarrow> (\<lambda>u. integral {a..u} f1) differentiable at x) \<and> (\<forall>x\<ge>a. x < i \<longrightarrow> (\<lambda>t. integral {a..t} f1) differentiable at_right x) \<and> (\<forall>x>a. x \<le> i \<longrightarrow> (\<lambda>t. integral {a..t} f1) differentiable at_left x); i < b \<Longrightarrow> (\<forall>x>i. x < b \<longrightarrow> x \<notin> I \<longrightarrow> (\<lambda>u. integral {i..u} f2) differentiable at x) \<and> (\<forall>x\<ge>i. x < b \<longrightarrow> (\<lambda>t. integral {i..t} f2) differentiable at_right x) \<and> (\<forall>x>i. x \<le> b \<longrightarrow> (\<lambda>t. integral {i..t} f2) differentiable at_left x); 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); a < b\<rbrakk> \<Longrightarrow> (\<forall>x>a. x < b \<longrightarrow> x \<notin> insert i I \<longrightarrow> (\<lambda>u. integral {a..u} f) differentiable at x) \<and> (\<forall>x\<ge>a. x < b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_right x) \<and> (\<forall>x>a. x \<le> b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_left x)
 3. \<And>a b i I f. \<lbrakk>a < b \<Longrightarrow> (\<forall>x>a. x < b \<longrightarrow> x \<notin> I \<longrightarrow> (\<lambda>u. integral {a..u} f) differentiable at x) \<and> (\<forall>x\<ge>a. x < b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_right x) \<and> (\<forall>x>a. x \<le> b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_left x); finite I; i \<notin> I; a < b\<rbrakk> \<Longrightarrow> (\<forall>x>a. x < b \<longrightarrow> x \<notin> insert i I \<longrightarrow> (\<lambda>u. integral {a..u} f) differentiable at x) \<and> (\<forall>x\<ge>a. x < b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_right x) \<and> (\<forall>x>a. x \<le> b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_left x)
[PROOF STEP]
have "a < x \<Longrightarrow> x < b \<Longrightarrow> (\<lambda>u. integral {a..u} f) differentiable (at x)" for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a < x; x < b\<rbrakk> \<Longrightarrow> (\<lambda>u. integral {a..u} f) differentiable at x
[PROOF STEP]
using integral_differentiable[OF empty(1), of x]
[PROOF STATE]
proof (prove)
using this:
x \<in> {a..b} \<Longrightarrow> (\<lambda>u. integral {a..u} f) differentiable at x within {a..b}

goal (1 subgoal):
 1. \<lbrakk>a < x; x < b\<rbrakk> \<Longrightarrow> (\<lambda>u. integral {a..u} f) differentiable at x
[PROOF STEP]
by (auto simp: at_within_interior)
[PROOF STATE]
proof (state)
this:
\<lbrakk>a < ?x; ?x < b\<rbrakk> \<Longrightarrow> (\<lambda>u. integral {a..u} f) differentiable at ?x

goal (3 subgoals):
 1. \<And>a b f. \<lbrakk>continuous_on {a..b} f; a < b\<rbrakk> \<Longrightarrow> (\<forall>x>a. x < b \<longrightarrow> x \<notin> {} \<longrightarrow> (\<lambda>u. integral {a..u} f) differentiable at x) \<and> (\<forall>x\<ge>a. x < b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_right x) \<and> (\<forall>x>a. x \<le> b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_left x)
 2. \<And>a i b I f1 f2 f. \<lbrakk>a \<le> i; i \<le> b; i \<notin> I; a < i \<Longrightarrow> (\<forall>x>a. x < i \<longrightarrow> x \<notin> I \<longrightarrow> (\<lambda>u. integral {a..u} f1) differentiable at x) \<and> (\<forall>x\<ge>a. x < i \<longrightarrow> (\<lambda>t. integral {a..t} f1) differentiable at_right x) \<and> (\<forall>x>a. x \<le> i \<longrightarrow> (\<lambda>t. integral {a..t} f1) differentiable at_left x); i < b \<Longrightarrow> (\<forall>x>i. x < b \<longrightarrow> x \<notin> I \<longrightarrow> (\<lambda>u. integral {i..u} f2) differentiable at x) \<and> (\<forall>x\<ge>i. x < b \<longrightarrow> (\<lambda>t. integral {i..t} f2) differentiable at_right x) \<and> (\<forall>x>i. x \<le> b \<longrightarrow> (\<lambda>t. integral {i..t} f2) differentiable at_left x); 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); a < b\<rbrakk> \<Longrightarrow> (\<forall>x>a. x < b \<longrightarrow> x \<notin> insert i I \<longrightarrow> (\<lambda>u. integral {a..u} f) differentiable at x) \<and> (\<forall>x\<ge>a. x < b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_right x) \<and> (\<forall>x>a. x \<le> b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_left x)
 3. \<And>a b i I f. \<lbrakk>a < b \<Longrightarrow> (\<forall>x>a. x < b \<longrightarrow> x \<notin> I \<longrightarrow> (\<lambda>u. integral {a..u} f) differentiable at x) \<and> (\<forall>x\<ge>a. x < b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_right x) \<and> (\<forall>x>a. x \<le> b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_left x); finite I; i \<notin> I; a < b\<rbrakk> \<Longrightarrow> (\<forall>x>a. x < b \<longrightarrow> x \<notin> insert i I \<longrightarrow> (\<lambda>u. integral {a..u} f) differentiable at x) \<and> (\<forall>x\<ge>a. x < b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_right x) \<and> (\<forall>x>a. x \<le> b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_left x)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>a < ?x; ?x < b\<rbrakk> \<Longrightarrow> (\<lambda>u. integral {a..u} f) differentiable at ?x
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>a < ?x; ?x < b\<rbrakk> \<Longrightarrow> (\<lambda>u. integral {a..u} f) differentiable at ?x

goal (1 subgoal):
 1. (\<forall>x>a. x < b \<longrightarrow> x \<notin> {} \<longrightarrow> (\<lambda>u. integral {a..u} f) differentiable at x) \<and> (\<forall>x\<ge>a. x < b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_right x) \<and> (\<forall>x>a. x \<le> b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_left x)
[PROOF STEP]
using integral_differentiable[OF empty(1), of a]
      integral_differentiable[OF empty(1), of b]
      \<open>a < b\<close>
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>a < ?x; ?x < b\<rbrakk> \<Longrightarrow> (\<lambda>u. integral {a..u} f) differentiable at ?x
a \<in> {a..b} \<Longrightarrow> (\<lambda>u. integral {a..u} f) differentiable at a within {a..b}
b \<in> {a..b} \<Longrightarrow> (\<lambda>u. integral {a..u} f) differentiable at b within {a..b}
a < b

goal (1 subgoal):
 1. (\<forall>x>a. x < b \<longrightarrow> x \<notin> {} \<longrightarrow> (\<lambda>u. integral {a..u} f) differentiable at x) \<and> (\<forall>x\<ge>a. x < b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_right x) \<and> (\<forall>x>a. x \<le> b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_left x)
[PROOF STEP]
by (auto simp: at_within_Icc_at_right at_within_Icc_at_left le_less
        intro: differentiable_at_withinI)
[PROOF STATE]
proof (state)
this:
(\<forall>x>a. x < b \<longrightarrow> x \<notin> {} \<longrightarrow> (\<lambda>u. integral {a..u} f) differentiable at x) \<and> (\<forall>x\<ge>a. x < b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_right x) \<and> (\<forall>x>a. x \<le> b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_left x)

goal (2 subgoals):
 1. \<And>a i b I f1 f2 f. \<lbrakk>a \<le> i; i \<le> b; i \<notin> I; a < i \<Longrightarrow> (\<forall>x>a. x < i \<longrightarrow> x \<notin> I \<longrightarrow> (\<lambda>u. integral {a..u} f1) differentiable at x) \<and> (\<forall>x\<ge>a. x < i \<longrightarrow> (\<lambda>t. integral {a..t} f1) differentiable at_right x) \<and> (\<forall>x>a. x \<le> i \<longrightarrow> (\<lambda>t. integral {a..t} f1) differentiable at_left x); i < b \<Longrightarrow> (\<forall>x>i. x < b \<longrightarrow> x \<notin> I \<longrightarrow> (\<lambda>u. integral {i..u} f2) differentiable at x) \<and> (\<forall>x\<ge>i. x < b \<longrightarrow> (\<lambda>t. integral {i..t} f2) differentiable at_right x) \<and> (\<forall>x>i. x \<le> b \<longrightarrow> (\<lambda>t. integral {i..t} f2) differentiable at_left x); 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); a < b\<rbrakk> \<Longrightarrow> (\<forall>x>a. x < b \<longrightarrow> x \<notin> insert i I \<longrightarrow> (\<lambda>u. integral {a..u} f) differentiable at x) \<and> (\<forall>x\<ge>a. x < b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_right x) \<and> (\<forall>x>a. x \<le> b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_left x)
 2. \<And>a b i I f. \<lbrakk>a < b \<Longrightarrow> (\<forall>x>a. x < b \<longrightarrow> x \<notin> I \<longrightarrow> (\<lambda>u. integral {a..u} f) differentiable at x) \<and> (\<forall>x\<ge>a. x < b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_right x) \<and> (\<forall>x>a. x \<le> b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_left x); finite I; i \<notin> I; a < b\<rbrakk> \<Longrightarrow> (\<forall>x>a. x < b \<longrightarrow> x \<notin> insert i I \<longrightarrow> (\<lambda>u. integral {a..u} f) differentiable at x) \<and> (\<forall>x\<ge>a. x < b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_right x) \<and> (\<forall>x>a. x \<le> b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_left x)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>a i b I f1 f2 f. \<lbrakk>a \<le> i; i \<le> b; i \<notin> I; a < i \<Longrightarrow> (\<forall>x>a. x < i \<longrightarrow> x \<notin> I \<longrightarrow> (\<lambda>u. integral {a..u} f1) differentiable at x) \<and> (\<forall>x\<ge>a. x < i \<longrightarrow> (\<lambda>t. integral {a..t} f1) differentiable at_right x) \<and> (\<forall>x>a. x \<le> i \<longrightarrow> (\<lambda>t. integral {a..t} f1) differentiable at_left x); i < b \<Longrightarrow> (\<forall>x>i. x < b \<longrightarrow> x \<notin> I \<longrightarrow> (\<lambda>u. integral {i..u} f2) differentiable at x) \<and> (\<forall>x\<ge>i. x < b \<longrightarrow> (\<lambda>t. integral {i..t} f2) differentiable at_right x) \<and> (\<forall>x>i. x \<le> b \<longrightarrow> (\<lambda>t. integral {i..t} f2) differentiable at_left x); 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); a < b\<rbrakk> \<Longrightarrow> (\<forall>x>a. x < b \<longrightarrow> x \<notin> insert i I \<longrightarrow> (\<lambda>u. integral {a..u} f) differentiable at x) \<and> (\<forall>x\<ge>a. x < b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_right x) \<and> (\<forall>x>a. x \<le> b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_left x)
 2. \<And>a b i I f. \<lbrakk>a < b \<Longrightarrow> (\<forall>x>a. x < b \<longrightarrow> x \<notin> I \<longrightarrow> (\<lambda>u. integral {a..u} f) differentiable at x) \<and> (\<forall>x\<ge>a. x < b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_right x) \<and> (\<forall>x>a. x \<le> b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_left x); finite I; i \<notin> I; a < b\<rbrakk> \<Longrightarrow> (\<forall>x>a. x < b \<longrightarrow> x \<notin> insert i I \<longrightarrow> (\<lambda>u. integral {a..u} f) differentiable at x) \<and> (\<forall>x\<ge>a. x < b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_right x) \<and> (\<forall>x>a. x \<le> b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_left x)
[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)
a < i \<Longrightarrow> (\<forall>x>a. x < i \<longrightarrow> x \<notin> I \<longrightarrow> (\<lambda>u. integral {a..u} f1) differentiable at x) \<and> (\<forall>x\<ge>a. x < i \<longrightarrow> (\<lambda>t. integral {a..t} f1) differentiable at_right x) \<and> (\<forall>x>a. x \<le> i \<longrightarrow> (\<lambda>t. integral {a..t} f1) differentiable at_left x)
i < b \<Longrightarrow> (\<forall>x>i. x < b \<longrightarrow> x \<notin> I \<longrightarrow> (\<lambda>u. integral {i..u} f2) differentiable at x) \<and> (\<forall>x\<ge>i. x < b \<longrightarrow> (\<lambda>t. integral {i..t} f2) differentiable at_right x) \<and> (\<forall>x>i. x \<le> b \<longrightarrow> (\<lambda>t. integral {i..t} f2) differentiable at_left x)
a < b

goal (2 subgoals):
 1. \<And>a i b I f1 f2 f. \<lbrakk>a \<le> i; i \<le> b; i \<notin> I; a < i \<Longrightarrow> (\<forall>x>a. x < i \<longrightarrow> x \<notin> I \<longrightarrow> (\<lambda>u. integral {a..u} f1) differentiable at x) \<and> (\<forall>x\<ge>a. x < i \<longrightarrow> (\<lambda>t. integral {a..t} f1) differentiable at_right x) \<and> (\<forall>x>a. x \<le> i \<longrightarrow> (\<lambda>t. integral {a..t} f1) differentiable at_left x); i < b \<Longrightarrow> (\<forall>x>i. x < b \<longrightarrow> x \<notin> I \<longrightarrow> (\<lambda>u. integral {i..u} f2) differentiable at x) \<and> (\<forall>x\<ge>i. x < b \<longrightarrow> (\<lambda>t. integral {i..t} f2) differentiable at_right x) \<and> (\<forall>x>i. x \<le> b \<longrightarrow> (\<lambda>t. integral {i..t} f2) differentiable at_left x); 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); a < b\<rbrakk> \<Longrightarrow> (\<forall>x>a. x < b \<longrightarrow> x \<notin> insert i I \<longrightarrow> (\<lambda>u. integral {a..u} f) differentiable at x) \<and> (\<forall>x\<ge>a. x < b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_right x) \<and> (\<forall>x>a. x \<le> b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_left x)
 2. \<And>a b i I f. \<lbrakk>a < b \<Longrightarrow> (\<forall>x>a. x < b \<longrightarrow> x \<notin> I \<longrightarrow> (\<lambda>u. integral {a..u} f) differentiable at x) \<and> (\<forall>x\<ge>a. x < b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_right x) \<and> (\<forall>x>a. x \<le> b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_left x); finite I; i \<notin> I; a < b\<rbrakk> \<Longrightarrow> (\<forall>x>a. x < b \<longrightarrow> x \<notin> insert i I \<longrightarrow> (\<lambda>u. integral {a..u} f) differentiable at x) \<and> (\<forall>x\<ge>a. x < b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_right x) \<and> (\<forall>x>a. x \<le> b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_left x)
[PROOF STEP]
from \<open>piecewise_continuous_on a i I f1\<close>
[PROOF STATE]
proof (chain)
picking this:
piecewise_continuous_on a i I f1
[PROOF STEP]
have "finite I"
[PROOF STATE]
proof (prove)
using this:
piecewise_continuous_on a i I f1

goal (1 subgoal):
 1. finite I
[PROOF STEP]
by (auto elim!: piecewise_continuous_onE)
[PROOF STATE]
proof (state)
this:
finite I

goal (2 subgoals):
 1. \<And>a i b I f1 f2 f. \<lbrakk>a \<le> i; i \<le> b; i \<notin> I; a < i \<Longrightarrow> (\<forall>x>a. x < i \<longrightarrow> x \<notin> I \<longrightarrow> (\<lambda>u. integral {a..u} f1) differentiable at x) \<and> (\<forall>x\<ge>a. x < i \<longrightarrow> (\<lambda>t. integral {a..t} f1) differentiable at_right x) \<and> (\<forall>x>a. x \<le> i \<longrightarrow> (\<lambda>t. integral {a..t} f1) differentiable at_left x); i < b \<Longrightarrow> (\<forall>x>i. x < b \<longrightarrow> x \<notin> I \<longrightarrow> (\<lambda>u. integral {i..u} f2) differentiable at x) \<and> (\<forall>x\<ge>i. x < b \<longrightarrow> (\<lambda>t. integral {i..t} f2) differentiable at_right x) \<and> (\<forall>x>i. x \<le> b \<longrightarrow> (\<lambda>t. integral {i..t} f2) differentiable at_left x); 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); a < b\<rbrakk> \<Longrightarrow> (\<forall>x>a. x < b \<longrightarrow> x \<notin> insert i I \<longrightarrow> (\<lambda>u. integral {a..u} f) differentiable at x) \<and> (\<forall>x\<ge>a. x < b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_right x) \<and> (\<forall>x>a. x \<le> b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_left x)
 2. \<And>a b i I f. \<lbrakk>a < b \<Longrightarrow> (\<forall>x>a. x < b \<longrightarrow> x \<notin> I \<longrightarrow> (\<lambda>u. integral {a..u} f) differentiable at x) \<and> (\<forall>x\<ge>a. x < b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_right x) \<and> (\<forall>x>a. x \<le> b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_left x); finite I; i \<notin> I; a < b\<rbrakk> \<Longrightarrow> (\<forall>x>a. x < b \<longrightarrow> x \<notin> insert i I \<longrightarrow> (\<lambda>u. integral {a..u} f) differentiable at x) \<and> (\<forall>x\<ge>a. x < b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_right x) \<and> (\<forall>x>a. x \<le> b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_left x)
[PROOF STEP]
from combine(4)
[PROOF STATE]
proof (chain)
picking this:
piecewise_continuous_on a i I f1
[PROOF STEP]
have "piecewise_continuous_on a i (insert i I) f1"
[PROOF STATE]
proof (prove)
using this:
piecewise_continuous_on a i I f1

goal (1 subgoal):
 1. piecewise_continuous_on a i (insert i I) f1
[PROOF STEP]
by (rule piecewise_continuous_on_insert_rightI)
[PROOF STATE]
proof (state)
this:
piecewise_continuous_on a i (insert i I) f1

goal (2 subgoals):
 1. \<And>a i b I f1 f2 f. \<lbrakk>a \<le> i; i \<le> b; i \<notin> I; a < i \<Longrightarrow> (\<forall>x>a. x < i \<longrightarrow> x \<notin> I \<longrightarrow> (\<lambda>u. integral {a..u} f1) differentiable at x) \<and> (\<forall>x\<ge>a. x < i \<longrightarrow> (\<lambda>t. integral {a..t} f1) differentiable at_right x) \<and> (\<forall>x>a. x \<le> i \<longrightarrow> (\<lambda>t. integral {a..t} f1) differentiable at_left x); i < b \<Longrightarrow> (\<forall>x>i. x < b \<longrightarrow> x \<notin> I \<longrightarrow> (\<lambda>u. integral {i..u} f2) differentiable at x) \<and> (\<forall>x\<ge>i. x < b \<longrightarrow> (\<lambda>t. integral {i..t} f2) differentiable at_right x) \<and> (\<forall>x>i. x \<le> b \<longrightarrow> (\<lambda>t. integral {i..t} f2) differentiable at_left x); 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); a < b\<rbrakk> \<Longrightarrow> (\<forall>x>a. x < b \<longrightarrow> x \<notin> insert i I \<longrightarrow> (\<lambda>u. integral {a..u} f) differentiable at x) \<and> (\<forall>x\<ge>a. x < b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_right x) \<and> (\<forall>x>a. x \<le> b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_left x)
 2. \<And>a b i I f. \<lbrakk>a < b \<Longrightarrow> (\<forall>x>a. x < b \<longrightarrow> x \<notin> I \<longrightarrow> (\<lambda>u. integral {a..u} f) differentiable at x) \<and> (\<forall>x\<ge>a. x < b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_right x) \<and> (\<forall>x>a. x \<le> b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_left x); finite I; i \<notin> I; a < b\<rbrakk> \<Longrightarrow> (\<forall>x>a. x < b \<longrightarrow> x \<notin> insert i I \<longrightarrow> (\<lambda>u. integral {a..u} f) differentiable at x) \<and> (\<forall>x\<ge>a. x < b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_right x) \<and> (\<forall>x>a. x \<le> b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_left x)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
piecewise_continuous_on a i (insert i I) f1
[PROOF STEP]
have "piecewise_continuous_on a i (insert i I) f"
[PROOF STATE]
proof (prove)
using this:
piecewise_continuous_on a i (insert i I) f1

goal (1 subgoal):
 1. piecewise_continuous_on a i (insert i I) f
[PROOF STEP]
by (rule piecewise_continuous_on_congI) (auto simp: combine)
[PROOF STATE]
proof (state)
this:
piecewise_continuous_on a i (insert i I) f

goal (2 subgoals):
 1. \<And>a i b I f1 f2 f. \<lbrakk>a \<le> i; i \<le> b; i \<notin> I; a < i \<Longrightarrow> (\<forall>x>a. x < i \<longrightarrow> x \<notin> I \<longrightarrow> (\<lambda>u. integral {a..u} f1) differentiable at x) \<and> (\<forall>x\<ge>a. x < i \<longrightarrow> (\<lambda>t. integral {a..t} f1) differentiable at_right x) \<and> (\<forall>x>a. x \<le> i \<longrightarrow> (\<lambda>t. integral {a..t} f1) differentiable at_left x); i < b \<Longrightarrow> (\<forall>x>i. x < b \<longrightarrow> x \<notin> I \<longrightarrow> (\<lambda>u. integral {i..u} f2) differentiable at x) \<and> (\<forall>x\<ge>i. x < b \<longrightarrow> (\<lambda>t. integral {i..t} f2) differentiable at_right x) \<and> (\<forall>x>i. x \<le> b \<longrightarrow> (\<lambda>t. integral {i..t} f2) differentiable at_left x); 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); a < b\<rbrakk> \<Longrightarrow> (\<forall>x>a. x < b \<longrightarrow> x \<notin> insert i I \<longrightarrow> (\<lambda>u. integral {a..u} f) differentiable at x) \<and> (\<forall>x\<ge>a. x < b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_right x) \<and> (\<forall>x>a. x \<le> b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_left x)
 2. \<And>a b i I f. \<lbrakk>a < b \<Longrightarrow> (\<forall>x>a. x < b \<longrightarrow> x \<notin> I \<longrightarrow> (\<lambda>u. integral {a..u} f) differentiable at x) \<and> (\<forall>x\<ge>a. x < b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_right x) \<and> (\<forall>x>a. x \<le> b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_left x); finite I; i \<notin> I; a < b\<rbrakk> \<Longrightarrow> (\<forall>x>a. x < b \<longrightarrow> x \<notin> insert i I \<longrightarrow> (\<lambda>u. integral {a..u} f) differentiable at x) \<and> (\<forall>x\<ge>a. x < b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_right x) \<and> (\<forall>x>a. x \<le> b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_left x)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
piecewise_continuous_on a i (insert i I) f

goal (2 subgoals):
 1. \<And>a i b I f1 f2 f. \<lbrakk>a \<le> i; i \<le> b; i \<notin> I; a < i \<Longrightarrow> (\<forall>x>a. x < i \<longrightarrow> x \<notin> I \<longrightarrow> (\<lambda>u. integral {a..u} f1) differentiable at x) \<and> (\<forall>x\<ge>a. x < i \<longrightarrow> (\<lambda>t. integral {a..t} f1) differentiable at_right x) \<and> (\<forall>x>a. x \<le> i \<longrightarrow> (\<lambda>t. integral {a..t} f1) differentiable at_left x); i < b \<Longrightarrow> (\<forall>x>i. x < b \<longrightarrow> x \<notin> I \<longrightarrow> (\<lambda>u. integral {i..u} f2) differentiable at x) \<and> (\<forall>x\<ge>i. x < b \<longrightarrow> (\<lambda>t. integral {i..t} f2) differentiable at_right x) \<and> (\<forall>x>i. x \<le> b \<longrightarrow> (\<lambda>t. integral {i..t} f2) differentiable at_left x); 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); a < b\<rbrakk> \<Longrightarrow> (\<forall>x>a. x < b \<longrightarrow> x \<notin> insert i I \<longrightarrow> (\<lambda>u. integral {a..u} f) differentiable at x) \<and> (\<forall>x\<ge>a. x < b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_right x) \<and> (\<forall>x>a. x \<le> b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_left x)
 2. \<And>a b i I f. \<lbrakk>a < b \<Longrightarrow> (\<forall>x>a. x < b \<longrightarrow> x \<notin> I \<longrightarrow> (\<lambda>u. integral {a..u} f) differentiable at x) \<and> (\<forall>x\<ge>a. x < b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_right x) \<and> (\<forall>x>a. x \<le> b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_left x); finite I; i \<notin> I; a < b\<rbrakk> \<Longrightarrow> (\<forall>x>a. x < b \<longrightarrow> x \<notin> insert i I \<longrightarrow> (\<lambda>u. integral {a..u} f) differentiable at x) \<and> (\<forall>x\<ge>a. x < b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_right x) \<and> (\<forall>x>a. x \<le> b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_left x)
[PROOF STEP]
from combine(5)
[PROOF STATE]
proof (chain)
picking this:
piecewise_continuous_on i b I f2
[PROOF STEP]
have "piecewise_continuous_on i b (insert i I) f2"
[PROOF STATE]
proof (prove)
using this:
piecewise_continuous_on i b I f2

goal (1 subgoal):
 1. piecewise_continuous_on i b (insert i I) f2
[PROOF STEP]
by (rule piecewise_continuous_on_insert_leftI)
[PROOF STATE]
proof (state)
this:
piecewise_continuous_on i b (insert i I) f2

goal (2 subgoals):
 1. \<And>a i b I f1 f2 f. \<lbrakk>a \<le> i; i \<le> b; i \<notin> I; a < i \<Longrightarrow> (\<forall>x>a. x < i \<longrightarrow> x \<notin> I \<longrightarrow> (\<lambda>u. integral {a..u} f1) differentiable at x) \<and> (\<forall>x\<ge>a. x < i \<longrightarrow> (\<lambda>t. integral {a..t} f1) differentiable at_right x) \<and> (\<forall>x>a. x \<le> i \<longrightarrow> (\<lambda>t. integral {a..t} f1) differentiable at_left x); i < b \<Longrightarrow> (\<forall>x>i. x < b \<longrightarrow> x \<notin> I \<longrightarrow> (\<lambda>u. integral {i..u} f2) differentiable at x) \<and> (\<forall>x\<ge>i. x < b \<longrightarrow> (\<lambda>t. integral {i..t} f2) differentiable at_right x) \<and> (\<forall>x>i. x \<le> b \<longrightarrow> (\<lambda>t. integral {i..t} f2) differentiable at_left x); 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); a < b\<rbrakk> \<Longrightarrow> (\<forall>x>a. x < b \<longrightarrow> x \<notin> insert i I \<longrightarrow> (\<lambda>u. integral {a..u} f) differentiable at x) \<and> (\<forall>x\<ge>a. x < b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_right x) \<and> (\<forall>x>a. x \<le> b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_left x)
 2. \<And>a b i I f. \<lbrakk>a < b \<Longrightarrow> (\<forall>x>a. x < b \<longrightarrow> x \<notin> I \<longrightarrow> (\<lambda>u. integral {a..u} f) differentiable at x) \<and> (\<forall>x\<ge>a. x < b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_right x) \<and> (\<forall>x>a. x \<le> b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_left x); finite I; i \<notin> I; a < b\<rbrakk> \<Longrightarrow> (\<forall>x>a. x < b \<longrightarrow> x \<notin> insert i I \<longrightarrow> (\<lambda>u. integral {a..u} f) differentiable at x) \<and> (\<forall>x\<ge>a. x < b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_right x) \<and> (\<forall>x>a. x \<le> b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_left x)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
piecewise_continuous_on i b (insert i I) f2
[PROOF STEP]
have "piecewise_continuous_on i b (insert i I) f"
[PROOF STATE]
proof (prove)
using this:
piecewise_continuous_on i b (insert i I) f2

goal (1 subgoal):
 1. piecewise_continuous_on i b (insert i I) f
[PROOF STEP]
by (rule piecewise_continuous_on_congI) (auto simp: combine)
[PROOF STATE]
proof (state)
this:
piecewise_continuous_on i b (insert i I) f

goal (2 subgoals):
 1. \<And>a i b I f1 f2 f. \<lbrakk>a \<le> i; i \<le> b; i \<notin> I; a < i \<Longrightarrow> (\<forall>x>a. x < i \<longrightarrow> x \<notin> I \<longrightarrow> (\<lambda>u. integral {a..u} f1) differentiable at x) \<and> (\<forall>x\<ge>a. x < i \<longrightarrow> (\<lambda>t. integral {a..t} f1) differentiable at_right x) \<and> (\<forall>x>a. x \<le> i \<longrightarrow> (\<lambda>t. integral {a..t} f1) differentiable at_left x); i < b \<Longrightarrow> (\<forall>x>i. x < b \<longrightarrow> x \<notin> I \<longrightarrow> (\<lambda>u. integral {i..u} f2) differentiable at x) \<and> (\<forall>x\<ge>i. x < b \<longrightarrow> (\<lambda>t. integral {i..t} f2) differentiable at_right x) \<and> (\<forall>x>i. x \<le> b \<longrightarrow> (\<lambda>t. integral {i..t} f2) differentiable at_left x); 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); a < b\<rbrakk> \<Longrightarrow> (\<forall>x>a. x < b \<longrightarrow> x \<notin> insert i I \<longrightarrow> (\<lambda>u. integral {a..u} f) differentiable at x) \<and> (\<forall>x\<ge>a. x < b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_right x) \<and> (\<forall>x>a. x \<le> b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_left x)
 2. \<And>a b i I f. \<lbrakk>a < b \<Longrightarrow> (\<forall>x>a. x < b \<longrightarrow> x \<notin> I \<longrightarrow> (\<lambda>u. integral {a..u} f) differentiable at x) \<and> (\<forall>x\<ge>a. x < b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_right x) \<and> (\<forall>x>a. x \<le> b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_left x); finite I; i \<notin> I; a < b\<rbrakk> \<Longrightarrow> (\<forall>x>a. x < b \<longrightarrow> x \<notin> insert i I \<longrightarrow> (\<lambda>u. integral {a..u} f) differentiable at x) \<and> (\<forall>x\<ge>a. x < b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_right x) \<and> (\<forall>x>a. x \<le> b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_left x)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
piecewise_continuous_on a i (insert i I) f
piecewise_continuous_on i b (insert i I) f
[PROOF STEP]
have "piecewise_continuous_on a b (insert i I) f"
[PROOF STATE]
proof (prove)
using this:
piecewise_continuous_on a i (insert i I) f
piecewise_continuous_on i b (insert i I) f

goal (1 subgoal):
 1. piecewise_continuous_on a b (insert i I) f
[PROOF STEP]
by (rule piecewise_continuous_on_combine)
[PROOF STATE]
proof (state)
this:
piecewise_continuous_on a b (insert i I) f

goal (2 subgoals):
 1. \<And>a i b I f1 f2 f. \<lbrakk>a \<le> i; i \<le> b; i \<notin> I; a < i \<Longrightarrow> (\<forall>x>a. x < i \<longrightarrow> x \<notin> I \<longrightarrow> (\<lambda>u. integral {a..u} f1) differentiable at x) \<and> (\<forall>x\<ge>a. x < i \<longrightarrow> (\<lambda>t. integral {a..t} f1) differentiable at_right x) \<and> (\<forall>x>a. x \<le> i \<longrightarrow> (\<lambda>t. integral {a..t} f1) differentiable at_left x); i < b \<Longrightarrow> (\<forall>x>i. x < b \<longrightarrow> x \<notin> I \<longrightarrow> (\<lambda>u. integral {i..u} f2) differentiable at x) \<and> (\<forall>x\<ge>i. x < b \<longrightarrow> (\<lambda>t. integral {i..t} f2) differentiable at_right x) \<and> (\<forall>x>i. x \<le> b \<longrightarrow> (\<lambda>t. integral {i..t} f2) differentiable at_left x); 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); a < b\<rbrakk> \<Longrightarrow> (\<forall>x>a. x < b \<longrightarrow> x \<notin> insert i I \<longrightarrow> (\<lambda>u. integral {a..u} f) differentiable at x) \<and> (\<forall>x\<ge>a. x < b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_right x) \<and> (\<forall>x>a. x \<le> b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_left x)
 2. \<And>a b i I f. \<lbrakk>a < b \<Longrightarrow> (\<forall>x>a. x < b \<longrightarrow> x \<notin> I \<longrightarrow> (\<lambda>u. integral {a..u} f) differentiable at x) \<and> (\<forall>x\<ge>a. x < b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_right x) \<and> (\<forall>x>a. x \<le> b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_left x); finite I; i \<notin> I; a < b\<rbrakk> \<Longrightarrow> (\<forall>x>a. x < b \<longrightarrow> x \<notin> insert i I \<longrightarrow> (\<lambda>u. integral {a..u} f) differentiable at x) \<and> (\<forall>x\<ge>a. x < b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_right x) \<and> (\<forall>x>a. x \<le> b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_left x)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
piecewise_continuous_on a b (insert i I) f
[PROOF STEP]
have f_int: "f integrable_on {a .. b}"
[PROOF STATE]
proof (prove)
using this:
piecewise_continuous_on a b (insert i I) f

goal (1 subgoal):
 1. f integrable_on {a..b}
[PROOF STEP]
by (rule piecewise_continuous_on_integrable)
[PROOF STATE]
proof (state)
this:
f integrable_on {a..b}

goal (2 subgoals):
 1. \<And>a i b I f1 f2 f. \<lbrakk>a \<le> i; i \<le> b; i \<notin> I; a < i \<Longrightarrow> (\<forall>x>a. x < i \<longrightarrow> x \<notin> I \<longrightarrow> (\<lambda>u. integral {a..u} f1) differentiable at x) \<and> (\<forall>x\<ge>a. x < i \<longrightarrow> (\<lambda>t. integral {a..t} f1) differentiable at_right x) \<and> (\<forall>x>a. x \<le> i \<longrightarrow> (\<lambda>t. integral {a..t} f1) differentiable at_left x); i < b \<Longrightarrow> (\<forall>x>i. x < b \<longrightarrow> x \<notin> I \<longrightarrow> (\<lambda>u. integral {i..u} f2) differentiable at x) \<and> (\<forall>x\<ge>i. x < b \<longrightarrow> (\<lambda>t. integral {i..t} f2) differentiable at_right x) \<and> (\<forall>x>i. x \<le> b \<longrightarrow> (\<lambda>t. integral {i..t} f2) differentiable at_left x); 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); a < b\<rbrakk> \<Longrightarrow> (\<forall>x>a. x < b \<longrightarrow> x \<notin> insert i I \<longrightarrow> (\<lambda>u. integral {a..u} f) differentiable at x) \<and> (\<forall>x\<ge>a. x < b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_right x) \<and> (\<forall>x>a. x \<le> b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_left x)
 2. \<And>a b i I f. \<lbrakk>a < b \<Longrightarrow> (\<forall>x>a. x < b \<longrightarrow> x \<notin> I \<longrightarrow> (\<lambda>u. integral {a..u} f) differentiable at x) \<and> (\<forall>x\<ge>a. x < b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_right x) \<and> (\<forall>x>a. x \<le> b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_left x); finite I; i \<notin> I; a < b\<rbrakk> \<Longrightarrow> (\<forall>x>a. x < b \<longrightarrow> x \<notin> insert i I \<longrightarrow> (\<lambda>u. integral {a..u} f) differentiable at x) \<and> (\<forall>x\<ge>a. x < b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_right x) \<and> (\<forall>x>a. x \<le> b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_left x)
[PROOF STEP]
from combine.IH
[PROOF STATE]
proof (chain)
picking this:
a < i \<Longrightarrow> (\<forall>x>a. x < i \<longrightarrow> x \<notin> I \<longrightarrow> (\<lambda>u. integral {a..u} f1) differentiable at x) \<and> (\<forall>x\<ge>a. x < i \<longrightarrow> (\<lambda>t. integral {a..t} f1) differentiable at_right x) \<and> (\<forall>x>a. x \<le> i \<longrightarrow> (\<lambda>t. integral {a..t} f1) differentiable at_left x)
i < b \<Longrightarrow> (\<forall>x>i. x < b \<longrightarrow> x \<notin> I \<longrightarrow> (\<lambda>u. integral {i..u} f2) differentiable at x) \<and> (\<forall>x\<ge>i. x < b \<longrightarrow> (\<lambda>t. integral {i..t} f2) differentiable at_right x) \<and> (\<forall>x>i. x \<le> b \<longrightarrow> (\<lambda>t. integral {i..t} f2) differentiable at_left x)
[PROOF STEP]
have f1: "x>a \<Longrightarrow> x < i \<Longrightarrow> x \<notin> I \<Longrightarrow> (\<lambda>u. integral {a..u} f1) differentiable (at x)"
    "x\<ge>a \<Longrightarrow> x < i \<Longrightarrow> (\<lambda>t. integral {a..t} f1) differentiable (at_right x)"
    "x>a \<Longrightarrow> x \<le> i \<Longrightarrow> (\<lambda>t. integral {a..t} f1) differentiable (at_left x)"
   and f2: "x>i \<Longrightarrow> x < b \<Longrightarrow> x \<notin> I \<Longrightarrow> (\<lambda>u. integral {i..u} f2) differentiable (at x)"
    "x\<ge>i \<Longrightarrow> x < b \<Longrightarrow> (\<lambda>t. integral {i..t} f2) differentiable (at_right x)"
    "x>i \<Longrightarrow> x \<le> b \<Longrightarrow> (\<lambda>t. integral {i..t} f2) differentiable (at_left x)"
    for x
[PROOF STATE]
proof (prove)
using this:
a < i \<Longrightarrow> (\<forall>x>a. x < i \<longrightarrow> x \<notin> I \<longrightarrow> (\<lambda>u. integral {a..u} f1) differentiable at x) \<and> (\<forall>x\<ge>a. x < i \<longrightarrow> (\<lambda>t. integral {a..t} f1) differentiable at_right x) \<and> (\<forall>x>a. x \<le> i \<longrightarrow> (\<lambda>t. integral {a..t} f1) differentiable at_left x)
i < b \<Longrightarrow> (\<forall>x>i. x < b \<longrightarrow> x \<notin> I \<longrightarrow> (\<lambda>u. integral {i..u} f2) differentiable at x) \<and> (\<forall>x\<ge>i. x < b \<longrightarrow> (\<lambda>t. integral {i..t} f2) differentiable at_right x) \<and> (\<forall>x>i. x \<le> b \<longrightarrow> (\<lambda>t. integral {i..t} f2) differentiable at_left x)

goal (1 subgoal):
 1. ((\<lbrakk>a < x; x < i; x \<notin> I\<rbrakk> \<Longrightarrow> (\<lambda>u. integral {a..u} f1) differentiable at x) &&& (\<lbrakk>a \<le> x; x < i\<rbrakk> \<Longrightarrow> (\<lambda>t. integral {a..t} f1) differentiable at_right x) &&& (\<lbrakk>a < x; x \<le> i\<rbrakk> \<Longrightarrow> (\<lambda>t. integral {a..t} f1) differentiable at_left x)) &&& (\<lbrakk>i < x; x < b; x \<notin> I\<rbrakk> \<Longrightarrow> (\<lambda>u. integral {i..u} f2) differentiable at x) &&& (\<lbrakk>i \<le> x; x < b\<rbrakk> \<Longrightarrow> (\<lambda>t. integral {i..t} f2) differentiable at_right x) &&& (\<lbrakk>i < x; x \<le> b\<rbrakk> \<Longrightarrow> (\<lambda>t. integral {i..t} f2) differentiable at_left x)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<lbrakk>a < ?x; ?x < i; ?x \<notin> I\<rbrakk> \<Longrightarrow> (\<lambda>u. integral {a..u} f1) differentiable at ?x
\<lbrakk>a \<le> ?x; ?x < i\<rbrakk> \<Longrightarrow> (\<lambda>t. integral {a..t} f1) differentiable at_right ?x
\<lbrakk>a < ?x; ?x \<le> i\<rbrakk> \<Longrightarrow> (\<lambda>t. integral {a..t} f1) differentiable at_left ?x
\<lbrakk>i < ?x; ?x < b; ?x \<notin> I\<rbrakk> \<Longrightarrow> (\<lambda>u. integral {i..u} f2) differentiable at ?x
\<lbrakk>i \<le> ?x; ?x < b\<rbrakk> \<Longrightarrow> (\<lambda>t. integral {i..t} f2) differentiable at_right ?x
\<lbrakk>i < ?x; ?x \<le> b\<rbrakk> \<Longrightarrow> (\<lambda>t. integral {i..t} f2) differentiable at_left ?x

goal (2 subgoals):
 1. \<And>a i b I f1 f2 f. \<lbrakk>a \<le> i; i \<le> b; i \<notin> I; a < i \<Longrightarrow> (\<forall>x>a. x < i \<longrightarrow> x \<notin> I \<longrightarrow> (\<lambda>u. integral {a..u} f1) differentiable at x) \<and> (\<forall>x\<ge>a. x < i \<longrightarrow> (\<lambda>t. integral {a..t} f1) differentiable at_right x) \<and> (\<forall>x>a. x \<le> i \<longrightarrow> (\<lambda>t. integral {a..t} f1) differentiable at_left x); i < b \<Longrightarrow> (\<forall>x>i. x < b \<longrightarrow> x \<notin> I \<longrightarrow> (\<lambda>u. integral {i..u} f2) differentiable at x) \<and> (\<forall>x\<ge>i. x < b \<longrightarrow> (\<lambda>t. integral {i..t} f2) differentiable at_right x) \<and> (\<forall>x>i. x \<le> b \<longrightarrow> (\<lambda>t. integral {i..t} f2) differentiable at_left x); 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); a < b\<rbrakk> \<Longrightarrow> (\<forall>x>a. x < b \<longrightarrow> x \<notin> insert i I \<longrightarrow> (\<lambda>u. integral {a..u} f) differentiable at x) \<and> (\<forall>x\<ge>a. x < b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_right x) \<and> (\<forall>x>a. x \<le> b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_left x)
 2. \<And>a b i I f. \<lbrakk>a < b \<Longrightarrow> (\<forall>x>a. x < b \<longrightarrow> x \<notin> I \<longrightarrow> (\<lambda>u. integral {a..u} f) differentiable at x) \<and> (\<forall>x\<ge>a. x < b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_right x) \<and> (\<forall>x>a. x \<le> b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_left x); finite I; i \<notin> I; a < b\<rbrakk> \<Longrightarrow> (\<forall>x>a. x < b \<longrightarrow> x \<notin> insert i I \<longrightarrow> (\<lambda>u. integral {a..u} f) differentiable at x) \<and> (\<forall>x\<ge>a. x < b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_right x) \<and> (\<forall>x>a. x \<le> b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_left x)
[PROOF STEP]
have "(\<lambda>u. integral {a..u} f) differentiable at x" if "a < x" "x < b" "x \<noteq> i" "x \<notin> I" for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>u. integral {a..u} f) differentiable at x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<lambda>u. integral {a..u} f) differentiable at x
[PROOF STEP]
from that
[PROOF STATE]
proof (chain)
picking this:
a < x
x < b
x \<noteq> i
x \<notin> I
[PROOF STEP]
consider "x < i" |"i < x"
[PROOF STATE]
proof (prove)
using this:
a < x
x < b
x \<noteq> i
x \<notin> I

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

goal (1 subgoal):
 1. (\<lambda>u. integral {a..u} f) differentiable at x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>x < i \<Longrightarrow> ?thesis; i < x \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis
[PROOF STEP]
show ?thesis
[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) differentiable at x
[PROOF STEP]
proof cases
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. x < i \<Longrightarrow> (\<lambda>u. integral {a..u} f) differentiable at x
 2. i < x \<Longrightarrow> (\<lambda>u. integral {a..u} f) differentiable at x
[PROOF STEP]
case 1
[PROOF STATE]
proof (state)
this:
x < i

goal (2 subgoals):
 1. x < i \<Longrightarrow> (\<lambda>u. integral {a..u} f) differentiable at x
 2. i < x \<Longrightarrow> (\<lambda>u. integral {a..u} f) differentiable at x
[PROOF STEP]
have at: "at x within {a<..<i} - I = at x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. at x within {a<..<i} - I = at x
[PROOF STEP]
using that 1
[PROOF STATE]
proof (prove)
using this:
a < x
x < b
x \<noteq> i
x \<notin> I
x < i

goal (1 subgoal):
 1. at x within {a<..<i} - I = at x
[PROOF STEP]
by (intro at_within_open) (auto intro!: open_Diff finite_imp_closed \<open>finite I\<close>)
[PROOF STATE]
proof (state)
this:
at x within {a<..<i} - I = at x

goal (2 subgoals):
 1. x < i \<Longrightarrow> (\<lambda>u. integral {a..u} f) differentiable at x
 2. i < x \<Longrightarrow> (\<lambda>u. integral {a..u} f) differentiable at x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
at x within {a<..<i} - I = at x
[PROOF STEP]
have "(\<lambda>u. integral {a..u} f1) differentiable at x within {a<..<i} - I"
[PROOF STATE]
proof (prove)
using this:
at x within {a<..<i} - I = at x

goal (1 subgoal):
 1. (\<lambda>u. integral {a..u} f1) differentiable at x within {a<..<i} - I
[PROOF STEP]
using that 1 f1
[PROOF STATE]
proof (prove)
using this:
at x within {a<..<i} - I = at x
a < x
x < b
x \<noteq> i
x \<notin> I
x < i
\<lbrakk>a < ?x; ?x < i; ?x \<notin> I\<rbrakk> \<Longrightarrow> (\<lambda>u. integral {a..u} f1) differentiable at ?x
\<lbrakk>a \<le> ?x; ?x < i\<rbrakk> \<Longrightarrow> (\<lambda>t. integral {a..t} f1) differentiable at_right ?x
\<lbrakk>a < ?x; ?x \<le> i\<rbrakk> \<Longrightarrow> (\<lambda>t. integral {a..t} f1) differentiable at_left ?x

goal (1 subgoal):
 1. (\<lambda>u. integral {a..u} f1) differentiable at x within {a<..<i} - I
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<lambda>u. integral {a..u} f1) differentiable at x within {a<..<i} - I

goal (2 subgoals):
 1. x < i \<Longrightarrow> (\<lambda>u. integral {a..u} f) differentiable at x
 2. i < x \<Longrightarrow> (\<lambda>u. integral {a..u} f) differentiable at x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>u. integral {a..u} f1) differentiable at x within {a<..<i} - I
[PROOF STEP]
have "(\<lambda>u. integral {a..u} f) differentiable at x within {a<..<i} - I"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>u. integral {a..u} f1) differentiable at x within {a<..<i} - I

goal (1 subgoal):
 1. (\<lambda>u. integral {a..u} f) differentiable at x within {a<..<i} - I
[PROOF STEP]
apply (rule differentiable_transform_within[OF _ zero_less_one])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. x \<in> {a<..<i} - I
 2. \<And>x'. \<lbrakk>x' \<in> {a<..<i} - I; dist x' x < 1\<rbrakk> \<Longrightarrow> integral {a..x'} f1 = integral {a..x'} f
[PROOF STEP]
using that combine.hyps 1
[PROOF STATE]
proof (prove)
using this:
a < x
x < b
x \<noteq> i
x \<notin> 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 < i

goal (2 subgoals):
 1. x \<in> {a<..<i} - I
 2. \<And>x'. \<lbrakk>x' \<in> {a<..<i} - I; dist x' x < 1\<rbrakk> \<Longrightarrow> integral {a..x'} f1 = integral {a..x'} f
[PROOF STEP]
by (auto intro!: integral_cong)
[PROOF STATE]
proof (state)
this:
(\<lambda>u. integral {a..u} f) differentiable at x within {a<..<i} - I

goal (2 subgoals):
 1. x < i \<Longrightarrow> (\<lambda>u. integral {a..u} f) differentiable at x
 2. i < x \<Longrightarrow> (\<lambda>u. integral {a..u} f) differentiable at x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>u. integral {a..u} f) differentiable at x within {a<..<i} - I
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<lambda>u. integral {a..u} f) differentiable at x within {a<..<i} - I

goal (1 subgoal):
 1. (\<lambda>u. integral {a..u} f) differentiable at x
[PROOF STEP]
by (simp add: at)
[PROOF STATE]
proof (state)
this:
(\<lambda>u. integral {a..u} f) differentiable at x

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

goal (1 subgoal):
 1. i < x \<Longrightarrow> (\<lambda>u. integral {a..u} f) differentiable at x
[PROOF STEP]
have at: "at x within {i<..<b} - I = at x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. at x within {i<..<b} - I = at x
[PROOF STEP]
using that 2
[PROOF STATE]
proof (prove)
using this:
a < x
x < b
x \<noteq> i
x \<notin> I
i < x

goal (1 subgoal):
 1. at x within {i<..<b} - I = at x
[PROOF STEP]
by (intro at_within_open) (auto intro!: open_Diff finite_imp_closed \<open>finite I\<close>)
[PROOF STATE]
proof (state)
this:
at x within {i<..<b} - I = at x

goal (1 subgoal):
 1. i < x \<Longrightarrow> (\<lambda>u. integral {a..u} f) differentiable at x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
at x within {i<..<b} - I = at x
[PROOF STEP]
have "(\<lambda>u. integral {a..i} f + integral {i..u} f2) differentiable at x within {i<..<b} - I"
[PROOF STATE]
proof (prove)
using this:
at x within {i<..<b} - I = at x

goal (1 subgoal):
 1. (\<lambda>u. integral {a..i} f + integral {i..u} f2) differentiable at x within {i<..<b} - I
[PROOF STEP]
using that 2 f2
[PROOF STATE]
proof (prove)
using this:
at x within {i<..<b} - I = at x
a < x
x < b
x \<noteq> i
x \<notin> I
i < x
\<lbrakk>i < ?x; ?x < b; ?x \<notin> I\<rbrakk> \<Longrightarrow> (\<lambda>u. integral {i..u} f2) differentiable at ?x
\<lbrakk>i \<le> ?x; ?x < b\<rbrakk> \<Longrightarrow> (\<lambda>t. integral {i..t} f2) differentiable at_right ?x
\<lbrakk>i < ?x; ?x \<le> b\<rbrakk> \<Longrightarrow> (\<lambda>t. integral {i..t} f2) differentiable at_left ?x

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

goal (1 subgoal):
 1. i < x \<Longrightarrow> (\<lambda>u. integral {a..u} f) differentiable at x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>u. integral {a..i} f + integral {i..u} f2) differentiable at x within {i<..<b} - I
[PROOF STEP]
have "(\<lambda>u. integral {a..i} f + integral {i..u} f) differentiable at x within {i<..<b} - I"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>u. integral {a..i} f + integral {i..u} f2) differentiable at x within {i<..<b} - I

goal (1 subgoal):
 1. (\<lambda>u. integral {a..i} f + integral {i..u} f) differentiable at x within {i<..<b} - I
[PROOF STEP]
apply (rule differentiable_transform_within[OF _ zero_less_one])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. x \<in> {i<..<b} - I
 2. \<And>x'. \<lbrakk>x' \<in> {i<..<b} - I; dist x' x < 1\<rbrakk> \<Longrightarrow> integral {a..i} f + integral {i..x'} f2 = integral {a..i} f + integral {i..x'} f
[PROOF STEP]
using that combine.hyps 2
[PROOF STATE]
proof (prove)
using this:
a < x
x < b
x \<noteq> i
x \<notin> 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. x \<in> {i<..<b} - I
 2. \<And>x'. \<lbrakk>x' \<in> {i<..<b} - I; dist x' x < 1\<rbrakk> \<Longrightarrow> integral {a..i} f + integral {i..x'} f2 = integral {a..i} f + integral {i..x'} f
[PROOF STEP]
by (auto intro!: integral_spike[where S="{i,x}"])
[PROOF STATE]
proof (state)
this:
(\<lambda>u. integral {a..i} f + integral {i..u} f) differentiable at x within {i<..<b} - I

goal (1 subgoal):
 1. i < x \<Longrightarrow> (\<lambda>u. integral {a..u} f) differentiable at x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>u. integral {a..i} f + integral {i..u} f) differentiable at x within {i<..<b} - I
[PROOF STEP]
have "(\<lambda>u. integral {a..u} f) differentiable at x within {i<..<b} - I"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>u. integral {a..i} f + integral {i..u} f) differentiable at x within {i<..<b} - I

goal (1 subgoal):
 1. (\<lambda>u. integral {a..u} f) differentiable at x within {i<..<b} - I
[PROOF STEP]
apply (rule differentiable_transform_within[OF _ zero_less_one])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. x \<in> {i<..<b} - I
 2. \<And>x'. \<lbrakk>x' \<in> {i<..<b} - I; dist x' x < 1\<rbrakk> \<Longrightarrow> integral {a..i} f + integral {i..x'} f = integral {a..x'} f
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> {i<..<b} - I
[PROOF STEP]
using that 2
[PROOF STATE]
proof (prove)
using this:
a < x
x < b
x \<noteq> i
x \<notin> I
i < x

goal (1 subgoal):
 1. x \<in> {i<..<b} - I
[PROOF STEP]
by auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x'. \<lbrakk>x' \<in> {i<..<b} - I; dist x' x < 1\<rbrakk> \<Longrightarrow> integral {a..i} f + integral {i..x'} f = integral {a..x'} f
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x'. \<lbrakk>dist x' x < 1; i < x'; x' < b; x' \<notin> I\<rbrakk> \<Longrightarrow> integral {a..i} f + integral {i..x'} f = integral {a..x'} f
[PROOF STEP]
apply (subst Henstock_Kurzweil_Integration.integral_combine)
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<And>x'. \<lbrakk>dist x' x < 1; i < x'; x' < b; x' \<notin> I\<rbrakk> \<Longrightarrow> a \<le> i
 2. \<And>x'. \<lbrakk>dist x' x < 1; i < x'; x' < b; x' \<notin> I\<rbrakk> \<Longrightarrow> i \<le> x'
 3. \<And>x'. \<lbrakk>dist x' x < 1; i < x'; x' < b; x' \<notin> I\<rbrakk> \<Longrightarrow> f integrable_on {a..x'}
 4. \<And>x'. \<lbrakk>dist x' x < 1; i < x'; x' < b; x' \<notin> I\<rbrakk> \<Longrightarrow> integral {a..x'} f = integral {a..x'} f
[PROOF STEP]
using that 2 \<open>a \<le> i\<close>
[PROOF STATE]
proof (prove)
using this:
a < x
x < b
x \<noteq> i
x \<notin> I
i < x
a \<le> i

goal (4 subgoals):
 1. \<And>x'. \<lbrakk>dist x' x < 1; i < x'; x' < b; x' \<notin> I\<rbrakk> \<Longrightarrow> a \<le> i
 2. \<And>x'. \<lbrakk>dist x' x < 1; i < x'; x' < b; x' \<notin> I\<rbrakk> \<Longrightarrow> i \<le> x'
 3. \<And>x'. \<lbrakk>dist x' x < 1; i < x'; x' < b; x' \<notin> I\<rbrakk> \<Longrightarrow> f integrable_on {a..x'}
 4. \<And>x'. \<lbrakk>dist x' x < 1; i < x'; x' < b; x' \<notin> I\<rbrakk> \<Longrightarrow> integral {a..x'} f = integral {a..x'} f
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x'. \<lbrakk>dist x' x < 1; i < x'; x' < b; x' \<notin> I; x < b; x \<notin> I; i < x; a \<le> i\<rbrakk> \<Longrightarrow> f integrable_on {a..x'}
[PROOF STEP]
by (auto intro: integrable_on_subinterval f_int)
[PROOF STATE]
proof (state)
this:
(\<lambda>u. integral {a..u} f) differentiable at x within {i<..<b} - I

goal (1 subgoal):
 1. i < x \<Longrightarrow> (\<lambda>u. integral {a..u} f) differentiable at x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>u. integral {a..u} f) differentiable at x within {i<..<b} - I
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<lambda>u. integral {a..u} f) differentiable at x within {i<..<b} - I

goal (1 subgoal):
 1. (\<lambda>u. integral {a..u} f) differentiable at x
[PROOF STEP]
by (simp add: at)
[PROOF STATE]
proof (state)
this:
(\<lambda>u. integral {a..u} f) differentiable at x

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<lambda>u. integral {a..u} f) differentiable at x

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<lbrakk>a < ?x; ?x < b; ?x \<noteq> i; ?x \<notin> I\<rbrakk> \<Longrightarrow> (\<lambda>u. integral {a..u} f) differentiable at ?x

goal (2 subgoals):
 1. \<And>a i b I f1 f2 f. \<lbrakk>a \<le> i; i \<le> b; i \<notin> I; a < i \<Longrightarrow> (\<forall>x>a. x < i \<longrightarrow> x \<notin> I \<longrightarrow> (\<lambda>u. integral {a..u} f1) differentiable at x) \<and> (\<forall>x\<ge>a. x < i \<longrightarrow> (\<lambda>t. integral {a..t} f1) differentiable at_right x) \<and> (\<forall>x>a. x \<le> i \<longrightarrow> (\<lambda>t. integral {a..t} f1) differentiable at_left x); i < b \<Longrightarrow> (\<forall>x>i. x < b \<longrightarrow> x \<notin> I \<longrightarrow> (\<lambda>u. integral {i..u} f2) differentiable at x) \<and> (\<forall>x\<ge>i. x < b \<longrightarrow> (\<lambda>t. integral {i..t} f2) differentiable at_right x) \<and> (\<forall>x>i. x \<le> b \<longrightarrow> (\<lambda>t. integral {i..t} f2) differentiable at_left x); 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); a < b\<rbrakk> \<Longrightarrow> (\<forall>x>a. x < b \<longrightarrow> x \<notin> insert i I \<longrightarrow> (\<lambda>u. integral {a..u} f) differentiable at x) \<and> (\<forall>x\<ge>a. x < b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_right x) \<and> (\<forall>x>a. x \<le> b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_left x)
 2. \<And>a b i I f. \<lbrakk>a < b \<Longrightarrow> (\<forall>x>a. x < b \<longrightarrow> x \<notin> I \<longrightarrow> (\<lambda>u. integral {a..u} f) differentiable at x) \<and> (\<forall>x\<ge>a. x < b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_right x) \<and> (\<forall>x>a. x \<le> b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_left x); finite I; i \<notin> I; a < b\<rbrakk> \<Longrightarrow> (\<forall>x>a. x < b \<longrightarrow> x \<notin> insert i I \<longrightarrow> (\<lambda>u. integral {a..u} f) differentiable at x) \<and> (\<forall>x\<ge>a. x < b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_right x) \<and> (\<forall>x>a. x \<le> b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_left x)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<lbrakk>a < ?x; ?x < b; ?x \<noteq> i; ?x \<notin> I\<rbrakk> \<Longrightarrow> (\<lambda>u. integral {a..u} f) differentiable at ?x

goal (2 subgoals):
 1. \<And>a i b I f1 f2 f. \<lbrakk>a \<le> i; i \<le> b; i \<notin> I; a < i \<Longrightarrow> (\<forall>x>a. x < i \<longrightarrow> x \<notin> I \<longrightarrow> (\<lambda>u. integral {a..u} f1) differentiable at x) \<and> (\<forall>x\<ge>a. x < i \<longrightarrow> (\<lambda>t. integral {a..t} f1) differentiable at_right x) \<and> (\<forall>x>a. x \<le> i \<longrightarrow> (\<lambda>t. integral {a..t} f1) differentiable at_left x); i < b \<Longrightarrow> (\<forall>x>i. x < b \<longrightarrow> x \<notin> I \<longrightarrow> (\<lambda>u. integral {i..u} f2) differentiable at x) \<and> (\<forall>x\<ge>i. x < b \<longrightarrow> (\<lambda>t. integral {i..t} f2) differentiable at_right x) \<and> (\<forall>x>i. x \<le> b \<longrightarrow> (\<lambda>t. integral {i..t} f2) differentiable at_left x); 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); a < b\<rbrakk> \<Longrightarrow> (\<forall>x>a. x < b \<longrightarrow> x \<notin> insert i I \<longrightarrow> (\<lambda>u. integral {a..u} f) differentiable at x) \<and> (\<forall>x\<ge>a. x < b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_right x) \<and> (\<forall>x>a. x \<le> b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_left x)
 2. \<And>a b i I f. \<lbrakk>a < b \<Longrightarrow> (\<forall>x>a. x < b \<longrightarrow> x \<notin> I \<longrightarrow> (\<lambda>u. integral {a..u} f) differentiable at x) \<and> (\<forall>x\<ge>a. x < b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_right x) \<and> (\<forall>x>a. x \<le> b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_left x); finite I; i \<notin> I; a < b\<rbrakk> \<Longrightarrow> (\<forall>x>a. x < b \<longrightarrow> x \<notin> insert i I \<longrightarrow> (\<lambda>u. integral {a..u} f) differentiable at x) \<and> (\<forall>x\<ge>a. x < b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_right x) \<and> (\<forall>x>a. x \<le> b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_left x)
[PROOF STEP]
have "(\<lambda>t. integral {a..t} f) differentiable at_right x" if "a \<le> x" "x < b" for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>t. integral {a..t} f) differentiable at_right x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<lambda>t. integral {a..t} f) differentiable at_right x
[PROOF STEP]
from that
[PROOF STATE]
proof (chain)
picking this:
a \<le> x
x < b
[PROOF STEP]
consider "x < i" |"i \<le> x"
[PROOF STATE]
proof (prove)
using this:
a \<le> x
x < b

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

goal (1 subgoal):
 1. (\<lambda>t. integral {a..t} f) differentiable at_right x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>x < i \<Longrightarrow> ?thesis; i \<le> x \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>x < i \<Longrightarrow> ?thesis; i \<le> x \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. (\<lambda>t. integral {a..t} f) differentiable at_right x
[PROOF STEP]
proof cases
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. x < i \<Longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_right x
 2. i \<le> x \<Longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_right x
[PROOF STEP]
case 1
[PROOF STATE]
proof (state)
this:
x < i

goal (2 subgoals):
 1. x < i \<Longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_right x
 2. i \<le> x \<Longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_right x
[PROOF STEP]
have at: "at x within {x..i} = at_right x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. at x within {x..i} = at_right x
[PROOF STEP]
using \<open>x < i\<close>
[PROOF STATE]
proof (prove)
using this:
x < i

goal (1 subgoal):
 1. at x within {x..i} = at_right x
[PROOF STEP]
by (rule at_within_Icc_at_right)
[PROOF STATE]
proof (state)
this:
at x within {x..i} = at_right x

goal (2 subgoals):
 1. x < i \<Longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_right x
 2. i \<le> x \<Longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_right x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
at x within {x..i} = at_right x
[PROOF STEP]
have "(\<lambda>u. integral {a..u} f1) differentiable at x within {x..i}"
[PROOF STATE]
proof (prove)
using this:
at x within {x..i} = at_right x

goal (1 subgoal):
 1. (\<lambda>u. integral {a..u} f1) differentiable at x within {x..i}
[PROOF STEP]
using that 1 f1
[PROOF STATE]
proof (prove)
using this:
at x within {x..i} = at_right x
a \<le> x
x < b
x < i
\<lbrakk>a < ?x; ?x < i; ?x \<notin> I\<rbrakk> \<Longrightarrow> (\<lambda>u. integral {a..u} f1) differentiable at ?x
\<lbrakk>a \<le> ?x; ?x < i\<rbrakk> \<Longrightarrow> (\<lambda>t. integral {a..t} f1) differentiable at_right ?x
\<lbrakk>a < ?x; ?x \<le> i\<rbrakk> \<Longrightarrow> (\<lambda>t. integral {a..t} f1) differentiable at_left ?x

goal (1 subgoal):
 1. (\<lambda>u. integral {a..u} f1) differentiable at x within {x..i}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<lambda>u. integral {a..u} f1) differentiable at x within {x..i}

goal (2 subgoals):
 1. x < i \<Longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_right x
 2. i \<le> x \<Longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_right x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>u. integral {a..u} f1) differentiable at x within {x..i}
[PROOF STEP]
have "(\<lambda>u. integral {a..u} f) differentiable at x within {x..i}"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>u. integral {a..u} f1) differentiable at x within {x..i}

goal (1 subgoal):
 1. (\<lambda>u. integral {a..u} f) differentiable at x within {x..i}
[PROOF STEP]
apply (rule differentiable_transform_within[OF _ zero_less_one])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. x \<in> {x..i}
 2. \<And>x'. \<lbrakk>x' \<in> {x..i}; dist x' x < 1\<rbrakk> \<Longrightarrow> integral {a..x'} f1 = integral {a..x'} f
[PROOF STEP]
using that combine.hyps 1
[PROOF STATE]
proof (prove)
using this:
a \<le> x
x < b
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 < i

goal (2 subgoals):
 1. x \<in> {x..i}
 2. \<And>x'. \<lbrakk>x' \<in> {x..i}; dist x' x < 1\<rbrakk> \<Longrightarrow> integral {a..x'} f1 = integral {a..x'} f
[PROOF STEP]
by (auto intro!: integral_spike[where S="{i,x}"])
[PROOF STATE]
proof (state)
this:
(\<lambda>u. integral {a..u} f) differentiable at x within {x..i}

goal (2 subgoals):
 1. x < i \<Longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_right x
 2. i \<le> x \<Longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_right x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>u. integral {a..u} f) differentiable at x within {x..i}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<lambda>u. integral {a..u} f) differentiable at x within {x..i}

goal (1 subgoal):
 1. (\<lambda>t. integral {a..t} f) differentiable at_right x
[PROOF STEP]
by (simp add: at)
[PROOF STATE]
proof (state)
this:
(\<lambda>t. integral {a..t} f) differentiable at_right x

goal (1 subgoal):
 1. i \<le> x \<Longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_right x
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. i \<le> x \<Longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_right x
[PROOF STEP]
case 2
[PROOF STATE]
proof (state)
this:
i \<le> x

goal (1 subgoal):
 1. i \<le> x \<Longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_right x
[PROOF STEP]
have at: "at x within {x..b} = at_right x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. at x within {x..b} = at_right x
[PROOF STEP]
using \<open>x < b\<close>
[PROOF STATE]
proof (prove)
using this:
x < b

goal (1 subgoal):
 1. at x within {x..b} = at_right x
[PROOF STEP]
by (rule at_within_Icc_at_right)
[PROOF STATE]
proof (state)
this:
at x within {x..b} = at_right x

goal (1 subgoal):
 1. i \<le> x \<Longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_right x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
at x within {x..b} = at_right x
[PROOF STEP]
have "(\<lambda>u. integral {a..i} f + integral {i..u} f2) differentiable at x within {x..b}"
[PROOF STATE]
proof (prove)
using this:
at x within {x..b} = at_right x

goal (1 subgoal):
 1. (\<lambda>u. integral {a..i} f + integral {i..u} f2) differentiable at x within {x..b}
[PROOF STEP]
using that 2 f2
[PROOF STATE]
proof (prove)
using this:
at x within {x..b} = at_right x
a \<le> x
x < b
i \<le> x
\<lbrakk>i < ?x; ?x < b; ?x \<notin> I\<rbrakk> \<Longrightarrow> (\<lambda>u. integral {i..u} f2) differentiable at ?x
\<lbrakk>i \<le> ?x; ?x < b\<rbrakk> \<Longrightarrow> (\<lambda>t. integral {i..t} f2) differentiable at_right ?x
\<lbrakk>i < ?x; ?x \<le> b\<rbrakk> \<Longrightarrow> (\<lambda>t. integral {i..t} f2) differentiable at_left ?x

goal (1 subgoal):
 1. (\<lambda>u. integral {a..i} f + integral {i..u} f2) differentiable at x within {x..b}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<lambda>u. integral {a..i} f + integral {i..u} f2) differentiable at x within {x..b}

goal (1 subgoal):
 1. i \<le> x \<Longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_right x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>u. integral {a..i} f + integral {i..u} f2) differentiable at x within {x..b}
[PROOF STEP]
have "(\<lambda>u. integral {a..i} f + integral {i..u} f) differentiable at x within {x..b}"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>u. integral {a..i} f + integral {i..u} f2) differentiable at x within {x..b}

goal (1 subgoal):
 1. (\<lambda>u. integral {a..i} f + integral {i..u} f) differentiable at x within {x..b}
[PROOF STEP]
apply (rule differentiable_transform_within[OF _ zero_less_one])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. x \<in> {x..b}
 2. \<And>x'. \<lbrakk>x' \<in> {x..b}; dist x' x < 1\<rbrakk> \<Longrightarrow> integral {a..i} f + integral {i..x'} f2 = integral {a..i} f + integral {i..x'} f
[PROOF STEP]
using that combine.hyps 2
[PROOF STATE]
proof (prove)
using this:
a \<le> x
x < b
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 \<le> x

goal (2 subgoals):
 1. x \<in> {x..b}
 2. \<And>x'. \<lbrakk>x' \<in> {x..b}; dist x' x < 1\<rbrakk> \<Longrightarrow> integral {a..i} f + integral {i..x'} f2 = integral {a..i} f + integral {i..x'} f
[PROOF STEP]
by (auto intro!: integral_spike[where S="{i,x}"])
[PROOF STATE]
proof (state)
this:
(\<lambda>u. integral {a..i} f + integral {i..u} f) differentiable at x within {x..b}

goal (1 subgoal):
 1. i \<le> x \<Longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_right x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>u. integral {a..i} f + integral {i..u} f) differentiable at x within {x..b}
[PROOF STEP]
have "(\<lambda>u. integral {a..u} f) differentiable at x within {x..b}"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>u. integral {a..i} f + integral {i..u} f) differentiable at x within {x..b}

goal (1 subgoal):
 1. (\<lambda>u. integral {a..u} f) differentiable at x within {x..b}
[PROOF STEP]
apply (rule differentiable_transform_within[OF _ zero_less_one])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. x \<in> {x..b}
 2. \<And>x'. \<lbrakk>x' \<in> {x..b}; dist x' x < 1\<rbrakk> \<Longrightarrow> integral {a..i} f + integral {i..x'} f = integral {a..x'} f
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> {x..b}
[PROOF STEP]
using that 2
[PROOF STATE]
proof (prove)
using this:
a \<le> x
x < b
i \<le> x

goal (1 subgoal):
 1. x \<in> {x..b}
[PROOF STEP]
by auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x'. \<lbrakk>x' \<in> {x..b}; dist x' x < 1\<rbrakk> \<Longrightarrow> integral {a..i} f + integral {i..x'} f = integral {a..x'} f
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x'. \<lbrakk>dist x' x < 1; x \<le> x'; x' \<le> b\<rbrakk> \<Longrightarrow> integral {a..i} f + integral {i..x'} f = integral {a..x'} f
[PROOF STEP]
apply (subst Henstock_Kurzweil_Integration.integral_combine)
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<And>x'. \<lbrakk>dist x' x < 1; x \<le> x'; x' \<le> b\<rbrakk> \<Longrightarrow> a \<le> i
 2. \<And>x'. \<lbrakk>dist x' x < 1; x \<le> x'; x' \<le> b\<rbrakk> \<Longrightarrow> i \<le> x'
 3. \<And>x'. \<lbrakk>dist x' x < 1; x \<le> x'; x' \<le> b\<rbrakk> \<Longrightarrow> f integrable_on {a..x'}
 4. \<And>x'. \<lbrakk>dist x' x < 1; x \<le> x'; x' \<le> b\<rbrakk> \<Longrightarrow> integral {a..x'} f = integral {a..x'} f
[PROOF STEP]
using that 2 \<open>a \<le> i\<close>
[PROOF STATE]
proof (prove)
using this:
a \<le> x
x < b
i \<le> x
a \<le> i

goal (4 subgoals):
 1. \<And>x'. \<lbrakk>dist x' x < 1; x \<le> x'; x' \<le> b\<rbrakk> \<Longrightarrow> a \<le> i
 2. \<And>x'. \<lbrakk>dist x' x < 1; x \<le> x'; x' \<le> b\<rbrakk> \<Longrightarrow> i \<le> x'
 3. \<And>x'. \<lbrakk>dist x' x < 1; x \<le> x'; x' \<le> b\<rbrakk> \<Longrightarrow> f integrable_on {a..x'}
 4. \<And>x'. \<lbrakk>dist x' x < 1; x \<le> x'; x' \<le> b\<rbrakk> \<Longrightarrow> integral {a..x'} f = integral {a..x'} f
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x'. \<lbrakk>dist x' x < 1; x \<le> x'; x' \<le> b; x < b; i \<le> x; a \<le> i\<rbrakk> \<Longrightarrow> f integrable_on {a..x'}
[PROOF STEP]
by (auto intro: integrable_on_subinterval f_int)
[PROOF STATE]
proof (state)
this:
(\<lambda>u. integral {a..u} f) differentiable at x within {x..b}

goal (1 subgoal):
 1. i \<le> x \<Longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_right x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>u. integral {a..u} f) differentiable at x within {x..b}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<lambda>u. integral {a..u} f) differentiable at x within {x..b}

goal (1 subgoal):
 1. (\<lambda>t. integral {a..t} f) differentiable at_right x
[PROOF STEP]
by (simp add: at)
[PROOF STATE]
proof (state)
this:
(\<lambda>t. integral {a..t} f) differentiable at_right x

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<lambda>t. integral {a..t} f) differentiable at_right x

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<lbrakk>a \<le> ?x; ?x < b\<rbrakk> \<Longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_right ?x

goal (2 subgoals):
 1. \<And>a i b I f1 f2 f. \<lbrakk>a \<le> i; i \<le> b; i \<notin> I; a < i \<Longrightarrow> (\<forall>x>a. x < i \<longrightarrow> x \<notin> I \<longrightarrow> (\<lambda>u. integral {a..u} f1) differentiable at x) \<and> (\<forall>x\<ge>a. x < i \<longrightarrow> (\<lambda>t. integral {a..t} f1) differentiable at_right x) \<and> (\<forall>x>a. x \<le> i \<longrightarrow> (\<lambda>t. integral {a..t} f1) differentiable at_left x); i < b \<Longrightarrow> (\<forall>x>i. x < b \<longrightarrow> x \<notin> I \<longrightarrow> (\<lambda>u. integral {i..u} f2) differentiable at x) \<and> (\<forall>x\<ge>i. x < b \<longrightarrow> (\<lambda>t. integral {i..t} f2) differentiable at_right x) \<and> (\<forall>x>i. x \<le> b \<longrightarrow> (\<lambda>t. integral {i..t} f2) differentiable at_left x); 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); a < b\<rbrakk> \<Longrightarrow> (\<forall>x>a. x < b \<longrightarrow> x \<notin> insert i I \<longrightarrow> (\<lambda>u. integral {a..u} f) differentiable at x) \<and> (\<forall>x\<ge>a. x < b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_right x) \<and> (\<forall>x>a. x \<le> b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_left x)
 2. \<And>a b i I f. \<lbrakk>a < b \<Longrightarrow> (\<forall>x>a. x < b \<longrightarrow> x \<notin> I \<longrightarrow> (\<lambda>u. integral {a..u} f) differentiable at x) \<and> (\<forall>x\<ge>a. x < b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_right x) \<and> (\<forall>x>a. x \<le> b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_left x); finite I; i \<notin> I; a < b\<rbrakk> \<Longrightarrow> (\<forall>x>a. x < b \<longrightarrow> x \<notin> insert i I \<longrightarrow> (\<lambda>u. integral {a..u} f) differentiable at x) \<and> (\<forall>x\<ge>a. x < b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_right x) \<and> (\<forall>x>a. x \<le> b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_left x)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<lbrakk>a \<le> ?x; ?x < b\<rbrakk> \<Longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_right ?x

goal (2 subgoals):
 1. \<And>a i b I f1 f2 f. \<lbrakk>a \<le> i; i \<le> b; i \<notin> I; a < i \<Longrightarrow> (\<forall>x>a. x < i \<longrightarrow> x \<notin> I \<longrightarrow> (\<lambda>u. integral {a..u} f1) differentiable at x) \<and> (\<forall>x\<ge>a. x < i \<longrightarrow> (\<lambda>t. integral {a..t} f1) differentiable at_right x) \<and> (\<forall>x>a. x \<le> i \<longrightarrow> (\<lambda>t. integral {a..t} f1) differentiable at_left x); i < b \<Longrightarrow> (\<forall>x>i. x < b \<longrightarrow> x \<notin> I \<longrightarrow> (\<lambda>u. integral {i..u} f2) differentiable at x) \<and> (\<forall>x\<ge>i. x < b \<longrightarrow> (\<lambda>t. integral {i..t} f2) differentiable at_right x) \<and> (\<forall>x>i. x \<le> b \<longrightarrow> (\<lambda>t. integral {i..t} f2) differentiable at_left x); 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); a < b\<rbrakk> \<Longrightarrow> (\<forall>x>a. x < b \<longrightarrow> x \<notin> insert i I \<longrightarrow> (\<lambda>u. integral {a..u} f) differentiable at x) \<and> (\<forall>x\<ge>a. x < b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_right x) \<and> (\<forall>x>a. x \<le> b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_left x)
 2. \<And>a b i I f. \<lbrakk>a < b \<Longrightarrow> (\<forall>x>a. x < b \<longrightarrow> x \<notin> I \<longrightarrow> (\<lambda>u. integral {a..u} f) differentiable at x) \<and> (\<forall>x\<ge>a. x < b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_right x) \<and> (\<forall>x>a. x \<le> b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_left x); finite I; i \<notin> I; a < b\<rbrakk> \<Longrightarrow> (\<forall>x>a. x < b \<longrightarrow> x \<notin> insert i I \<longrightarrow> (\<lambda>u. integral {a..u} f) differentiable at x) \<and> (\<forall>x\<ge>a. x < b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_right x) \<and> (\<forall>x>a. x \<le> b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_left x)
[PROOF STEP]
have "(\<lambda>t. integral {a..t} f) differentiable at_left x" if "a < x" "x \<le> b" for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>t. integral {a..t} f) differentiable at_left x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<lambda>t. integral {a..t} f) differentiable at_left x
[PROOF STEP]
from that
[PROOF STATE]
proof (chain)
picking this:
a < x
x \<le> b
[PROOF STEP]
consider "x \<le> i" |"i < x"
[PROOF STATE]
proof (prove)
using this:
a < x
x \<le> b

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

goal (1 subgoal):
 1. (\<lambda>t. integral {a..t} f) differentiable at_left x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>x \<le> i \<Longrightarrow> ?thesis; i < x \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>x \<le> i \<Longrightarrow> ?thesis; i < x \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. (\<lambda>t. integral {a..t} f) differentiable at_left x
[PROOF STEP]
proof cases
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. x \<le> i \<Longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_left x
 2. i < x \<Longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_left x
[PROOF STEP]
case 1
[PROOF STATE]
proof (state)
this:
x \<le> i

goal (2 subgoals):
 1. x \<le> i \<Longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_left x
 2. i < x \<Longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_left x
[PROOF STEP]
have at: "at x within {a..x} = at_left x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. at x within {a..x} = at_left x
[PROOF STEP]
using \<open>a < x\<close>
[PROOF STATE]
proof (prove)
using this:
a < x

goal (1 subgoal):
 1. at x within {a..x} = at_left x
[PROOF STEP]
by (rule at_within_Icc_at_left)
[PROOF STATE]
proof (state)
this:
at x within {a..x} = at_left x

goal (2 subgoals):
 1. x \<le> i \<Longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_left x
 2. i < x \<Longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_left x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
at x within {a..x} = at_left x
[PROOF STEP]
have "(\<lambda>u. integral {a..u} f1) differentiable at x within {a..x}"
[PROOF STATE]
proof (prove)
using this:
at x within {a..x} = at_left x

goal (1 subgoal):
 1. (\<lambda>u. integral {a..u} f1) differentiable at x within {a..x}
[PROOF STEP]
using that 1 f1
[PROOF STATE]
proof (prove)
using this:
at x within {a..x} = at_left x
a < x
x \<le> b
x \<le> i
\<lbrakk>a < ?x; ?x < i; ?x \<notin> I\<rbrakk> \<Longrightarrow> (\<lambda>u. integral {a..u} f1) differentiable at ?x
\<lbrakk>a \<le> ?x; ?x < i\<rbrakk> \<Longrightarrow> (\<lambda>t. integral {a..t} f1) differentiable at_right ?x
\<lbrakk>a < ?x; ?x \<le> i\<rbrakk> \<Longrightarrow> (\<lambda>t. integral {a..t} f1) differentiable at_left ?x

goal (1 subgoal):
 1. (\<lambda>u. integral {a..u} f1) differentiable at x within {a..x}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<lambda>u. integral {a..u} f1) differentiable at x within {a..x}

goal (2 subgoals):
 1. x \<le> i \<Longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_left x
 2. i < x \<Longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_left x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>u. integral {a..u} f1) differentiable at x within {a..x}
[PROOF STEP]
have "(\<lambda>u. integral {a..u} f) differentiable at x within {a..x}"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>u. integral {a..u} f1) differentiable at x within {a..x}

goal (1 subgoal):
 1. (\<lambda>u. integral {a..u} f) differentiable at x within {a..x}
[PROOF STEP]
apply (rule differentiable_transform_within[OF _ zero_less_one])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. x \<in> {a..x}
 2. \<And>x'. \<lbrakk>x' \<in> {a..x}; dist x' x < 1\<rbrakk> \<Longrightarrow> integral {a..x'} f1 = integral {a..x'} f
[PROOF STEP]
using that combine.hyps 1
[PROOF STATE]
proof (prove)
using this:
a < x
x \<le> b
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 \<le> i

goal (2 subgoals):
 1. x \<in> {a..x}
 2. \<And>x'. \<lbrakk>x' \<in> {a..x}; dist x' x < 1\<rbrakk> \<Longrightarrow> integral {a..x'} f1 = integral {a..x'} f
[PROOF STEP]
by (auto intro!: integral_spike[where S="{i,x}"])
[PROOF STATE]
proof (state)
this:
(\<lambda>u. integral {a..u} f) differentiable at x within {a..x}

goal (2 subgoals):
 1. x \<le> i \<Longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_left x
 2. i < x \<Longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_left x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>u. integral {a..u} f) differentiable at x within {a..x}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<lambda>u. integral {a..u} f) differentiable at x within {a..x}

goal (1 subgoal):
 1. (\<lambda>t. integral {a..t} f) differentiable at_left x
[PROOF STEP]
by (simp add: at)
[PROOF STATE]
proof (state)
this:
(\<lambda>t. integral {a..t} f) differentiable at_left x

goal (1 subgoal):
 1. i < x \<Longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_left x
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. i < x \<Longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_left x
[PROOF STEP]
case 2
[PROOF STATE]
proof (state)
this:
i < x

goal (1 subgoal):
 1. i < x \<Longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_left x
[PROOF STEP]
have at: "at x within {i..x} = at_left x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. at x within {i..x} = at_left x
[PROOF STEP]
using \<open>i < x\<close>
[PROOF STATE]
proof (prove)
using this:
i < x

goal (1 subgoal):
 1. at x within {i..x} = at_left x
[PROOF STEP]
by (rule at_within_Icc_at_left)
[PROOF STATE]
proof (state)
this:
at x within {i..x} = at_left x

goal (1 subgoal):
 1. i < x \<Longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_left x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
at x within {i..x} = at_left x
[PROOF STEP]
have "(\<lambda>u. integral {a..i} f + integral {i..u} f2) differentiable at x within {i..x}"
[PROOF STATE]
proof (prove)
using this:
at x within {i..x} = at_left x

goal (1 subgoal):
 1. (\<lambda>u. integral {a..i} f + integral {i..u} f2) differentiable at x within {i..x}
[PROOF STEP]
using that 2 f2
[PROOF STATE]
proof (prove)
using this:
at x within {i..x} = at_left x
a < x
x \<le> b
i < x
\<lbrakk>i < ?x; ?x < b; ?x \<notin> I\<rbrakk> \<Longrightarrow> (\<lambda>u. integral {i..u} f2) differentiable at ?x
\<lbrakk>i \<le> ?x; ?x < b\<rbrakk> \<Longrightarrow> (\<lambda>t. integral {i..t} f2) differentiable at_right ?x
\<lbrakk>i < ?x; ?x \<le> b\<rbrakk> \<Longrightarrow> (\<lambda>t. integral {i..t} f2) differentiable at_left ?x

goal (1 subgoal):
 1. (\<lambda>u. integral {a..i} f + integral {i..u} f2) differentiable at x within {i..x}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<lambda>u. integral {a..i} f + integral {i..u} f2) differentiable at x within {i..x}

goal (1 subgoal):
 1. i < x \<Longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_left x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>u. integral {a..i} f + integral {i..u} f2) differentiable at x within {i..x}
[PROOF STEP]
have "(\<lambda>u. integral {a..i} f + integral {i..u} f) differentiable at x within {i..x}"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>u. integral {a..i} f + integral {i..u} f2) differentiable at x within {i..x}

goal (1 subgoal):
 1. (\<lambda>u. integral {a..i} f + integral {i..u} f) differentiable at x within {i..x}
[PROOF STEP]
apply (rule differentiable_transform_within[OF _ zero_less_one])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. x \<in> {i..x}
 2. \<And>x'. \<lbrakk>x' \<in> {i..x}; dist x' x < 1\<rbrakk> \<Longrightarrow> integral {a..i} f + integral {i..x'} f2 = integral {a..i} f + integral {i..x'} f
[PROOF STEP]
using that combine.hyps 2
[PROOF STATE]
proof (prove)
using this:
a < x
x \<le> b
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. x \<in> {i..x}
 2. \<And>x'. \<lbrakk>x' \<in> {i..x}; dist x' x < 1\<rbrakk> \<Longrightarrow> integral {a..i} f + integral {i..x'} f2 = integral {a..i} f + integral {i..x'} f
[PROOF STEP]
by (auto intro!: integral_spike[where S="{i,x}"])
[PROOF STATE]
proof (state)
this:
(\<lambda>u. integral {a..i} f + integral {i..u} f) differentiable at x within {i..x}

goal (1 subgoal):
 1. i < x \<Longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_left x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>u. integral {a..i} f + integral {i..u} f) differentiable at x within {i..x}
[PROOF STEP]
have "(\<lambda>u. integral {a..u} f) differentiable at x within {i..x}"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>u. integral {a..i} f + integral {i..u} f) differentiable at x within {i..x}

goal (1 subgoal):
 1. (\<lambda>u. integral {a..u} f) differentiable at x within {i..x}
[PROOF STEP]
apply (rule differentiable_transform_within[OF _ zero_less_one])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. x \<in> {i..x}
 2. \<And>x'. \<lbrakk>x' \<in> {i..x}; dist x' x < 1\<rbrakk> \<Longrightarrow> integral {a..i} f + integral {i..x'} f = integral {a..x'} f
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> {i..x}
[PROOF STEP]
using that 2
[PROOF STATE]
proof (prove)
using this:
a < x
x \<le> b
i < x

goal (1 subgoal):
 1. x \<in> {i..x}
[PROOF STEP]
by auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x'. \<lbrakk>x' \<in> {i..x}; dist x' x < 1\<rbrakk> \<Longrightarrow> integral {a..i} f + integral {i..x'} f = integral {a..x'} f
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x'. \<lbrakk>dist x' x < 1; i \<le> x'; x' \<le> x\<rbrakk> \<Longrightarrow> integral {a..i} f + integral {i..x'} f = integral {a..x'} f
[PROOF STEP]
apply (subst Henstock_Kurzweil_Integration.integral_combine)
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<And>x'. \<lbrakk>dist x' x < 1; i \<le> x'; x' \<le> x\<rbrakk> \<Longrightarrow> a \<le> i
 2. \<And>x'. \<lbrakk>dist x' x < 1; i \<le> x'; x' \<le> x\<rbrakk> \<Longrightarrow> i \<le> x'
 3. \<And>x'. \<lbrakk>dist x' x < 1; i \<le> x'; x' \<le> x\<rbrakk> \<Longrightarrow> f integrable_on {a..x'}
 4. \<And>x'. \<lbrakk>dist x' x < 1; i \<le> x'; x' \<le> x\<rbrakk> \<Longrightarrow> integral {a..x'} f = integral {a..x'} f
[PROOF STEP]
using that 2 \<open>a \<le> i\<close>
[PROOF STATE]
proof (prove)
using this:
a < x
x \<le> b
i < x
a \<le> i

goal (4 subgoals):
 1. \<And>x'. \<lbrakk>dist x' x < 1; i \<le> x'; x' \<le> x\<rbrakk> \<Longrightarrow> a \<le> i
 2. \<And>x'. \<lbrakk>dist x' x < 1; i \<le> x'; x' \<le> x\<rbrakk> \<Longrightarrow> i \<le> x'
 3. \<And>x'. \<lbrakk>dist x' x < 1; i \<le> x'; x' \<le> x\<rbrakk> \<Longrightarrow> f integrable_on {a..x'}
 4. \<And>x'. \<lbrakk>dist x' x < 1; i \<le> x'; x' \<le> x\<rbrakk> \<Longrightarrow> integral {a..x'} f = integral {a..x'} f
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x'. \<lbrakk>dist x' x < 1; i \<le> x'; x' \<le> x; x \<le> b; i < x; a \<le> i\<rbrakk> \<Longrightarrow> f integrable_on {a..x'}
[PROOF STEP]
by (auto intro: integrable_on_subinterval f_int)
[PROOF STATE]
proof (state)
this:
(\<lambda>u. integral {a..u} f) differentiable at x within {i..x}

goal (1 subgoal):
 1. i < x \<Longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_left x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>u. integral {a..u} f) differentiable at x within {i..x}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<lambda>u. integral {a..u} f) differentiable at x within {i..x}

goal (1 subgoal):
 1. (\<lambda>t. integral {a..t} f) differentiable at_left x
[PROOF STEP]
by (simp add: at)
[PROOF STATE]
proof (state)
this:
(\<lambda>t. integral {a..t} f) differentiable at_left x

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<lambda>t. integral {a..t} f) differentiable at_left x

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<lbrakk>a < ?x; ?x \<le> b\<rbrakk> \<Longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_left ?x

goal (2 subgoals):
 1. \<And>a i b I f1 f2 f. \<lbrakk>a \<le> i; i \<le> b; i \<notin> I; a < i \<Longrightarrow> (\<forall>x>a. x < i \<longrightarrow> x \<notin> I \<longrightarrow> (\<lambda>u. integral {a..u} f1) differentiable at x) \<and> (\<forall>x\<ge>a. x < i \<longrightarrow> (\<lambda>t. integral {a..t} f1) differentiable at_right x) \<and> (\<forall>x>a. x \<le> i \<longrightarrow> (\<lambda>t. integral {a..t} f1) differentiable at_left x); i < b \<Longrightarrow> (\<forall>x>i. x < b \<longrightarrow> x \<notin> I \<longrightarrow> (\<lambda>u. integral {i..u} f2) differentiable at x) \<and> (\<forall>x\<ge>i. x < b \<longrightarrow> (\<lambda>t. integral {i..t} f2) differentiable at_right x) \<and> (\<forall>x>i. x \<le> b \<longrightarrow> (\<lambda>t. integral {i..t} f2) differentiable at_left x); 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); a < b\<rbrakk> \<Longrightarrow> (\<forall>x>a. x < b \<longrightarrow> x \<notin> insert i I \<longrightarrow> (\<lambda>u. integral {a..u} f) differentiable at x) \<and> (\<forall>x\<ge>a. x < b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_right x) \<and> (\<forall>x>a. x \<le> b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_left x)
 2. \<And>a b i I f. \<lbrakk>a < b \<Longrightarrow> (\<forall>x>a. x < b \<longrightarrow> x \<notin> I \<longrightarrow> (\<lambda>u. integral {a..u} f) differentiable at x) \<and> (\<forall>x\<ge>a. x < b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_right x) \<and> (\<forall>x>a. x \<le> b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_left x); finite I; i \<notin> I; a < b\<rbrakk> \<Longrightarrow> (\<forall>x>a. x < b \<longrightarrow> x \<notin> insert i I \<longrightarrow> (\<lambda>u. integral {a..u} f) differentiable at x) \<and> (\<forall>x\<ge>a. x < b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_right x) \<and> (\<forall>x>a. x \<le> b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_left x)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>a < ?x; ?x < b; ?x \<noteq> i; ?x \<notin> I\<rbrakk> \<Longrightarrow> (\<lambda>u. integral {a..u} f) differentiable at ?x
\<lbrakk>a \<le> ?x; ?x < b\<rbrakk> \<Longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_right ?x
\<lbrakk>a < ?x; ?x \<le> b\<rbrakk> \<Longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_left ?x
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>a < ?x; ?x < b; ?x \<noteq> i; ?x \<notin> I\<rbrakk> \<Longrightarrow> (\<lambda>u. integral {a..u} f) differentiable at ?x
\<lbrakk>a \<le> ?x; ?x < b\<rbrakk> \<Longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_right ?x
\<lbrakk>a < ?x; ?x \<le> b\<rbrakk> \<Longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_left ?x

goal (1 subgoal):
 1. (\<forall>x>a. x < b \<longrightarrow> x \<notin> insert i I \<longrightarrow> (\<lambda>u. integral {a..u} f) differentiable at x) \<and> (\<forall>x\<ge>a. x < b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_right x) \<and> (\<forall>x>a. x \<le> b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_left x)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<forall>x>a. x < b \<longrightarrow> x \<notin> insert i I \<longrightarrow> (\<lambda>u. integral {a..u} f) differentiable at x) \<and> (\<forall>x\<ge>a. x < b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_right x) \<and> (\<forall>x>a. x \<le> b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_left x)

goal (1 subgoal):
 1. \<And>a b i I f. \<lbrakk>a < b \<Longrightarrow> (\<forall>x>a. x < b \<longrightarrow> x \<notin> I \<longrightarrow> (\<lambda>u. integral {a..u} f) differentiable at x) \<and> (\<forall>x\<ge>a. x < b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_right x) \<and> (\<forall>x>a. x \<le> b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_left x); finite I; i \<notin> I; a < b\<rbrakk> \<Longrightarrow> (\<forall>x>a. x < b \<longrightarrow> x \<notin> insert i I \<longrightarrow> (\<lambda>u. integral {a..u} f) differentiable at x) \<and> (\<forall>x\<ge>a. x < b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_right x) \<and> (\<forall>x>a. x \<le> b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_left x)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a b i I f. \<lbrakk>a < b \<Longrightarrow> (\<forall>x>a. x < b \<longrightarrow> x \<notin> I \<longrightarrow> (\<lambda>u. integral {a..u} f) differentiable at x) \<and> (\<forall>x\<ge>a. x < b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_right x) \<and> (\<forall>x>a. x \<le> b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_left x); finite I; i \<notin> I; a < b\<rbrakk> \<Longrightarrow> (\<forall>x>a. x < b \<longrightarrow> x \<notin> insert i I \<longrightarrow> (\<lambda>u. integral {a..u} f) differentiable at x) \<and> (\<forall>x\<ge>a. x < b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_right x) \<and> (\<forall>x>a. x \<le> b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_left x)
[PROOF STEP]
case (weaken a b i I f)
[PROOF STATE]
proof (state)
this:
a < b \<Longrightarrow> (\<forall>x>a. x < b \<longrightarrow> x \<notin> I \<longrightarrow> (\<lambda>u. integral {a..u} f) differentiable at x) \<and> (\<forall>x\<ge>a. x < b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_right x) \<and> (\<forall>x>a. x \<le> b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_left x)
finite I
i \<notin> I
a < b

goal (1 subgoal):
 1. \<And>a b i I f. \<lbrakk>a < b \<Longrightarrow> (\<forall>x>a. x < b \<longrightarrow> x \<notin> I \<longrightarrow> (\<lambda>u. integral {a..u} f) differentiable at x) \<and> (\<forall>x\<ge>a. x < b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_right x) \<and> (\<forall>x>a. x \<le> b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_left x); finite I; i \<notin> I; a < b\<rbrakk> \<Longrightarrow> (\<forall>x>a. x < b \<longrightarrow> x \<notin> insert i I \<longrightarrow> (\<lambda>u. integral {a..u} f) differentiable at x) \<and> (\<forall>x\<ge>a. x < b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_right x) \<and> (\<forall>x>a. x \<le> b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_left x)
[PROOF STEP]
from weaken.IH[OF \<open>a < b\<close>]
[PROOF STATE]
proof (chain)
picking this:
(\<forall>x>a. x < b \<longrightarrow> x \<notin> I \<longrightarrow> (\<lambda>u. integral {a..u} f) differentiable at x) \<and> (\<forall>x\<ge>a. x < b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_right x) \<and> (\<forall>x>a. x \<le> b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_left x)
[PROOF STEP]
obtain l u where IH:
    "\<And>x. a < x \<Longrightarrow> x < b \<Longrightarrow> x \<notin> I \<Longrightarrow> (\<lambda>u. integral {a..u} f) differentiable (at x)"
    "\<And>x. a \<le> x \<Longrightarrow> x < b \<Longrightarrow> (\<lambda>t. integral {a..t} f) differentiable (at_right x)"
    "\<And>x. a < x \<Longrightarrow> x \<le> b \<Longrightarrow> (\<lambda>t. integral {a..t} f) differentiable (at_left x)"
[PROOF STATE]
proof (prove)
using this:
(\<forall>x>a. x < b \<longrightarrow> x \<notin> I \<longrightarrow> (\<lambda>u. integral {a..u} f) differentiable at x) \<and> (\<forall>x\<ge>a. x < b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_right x) \<and> (\<forall>x>a. x \<le> b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_left x)

goal (1 subgoal):
 1. (\<lbrakk>\<And>x. \<lbrakk>a < x; x < b; x \<notin> I\<rbrakk> \<Longrightarrow> (\<lambda>u. integral {a..u} f) differentiable at x; \<And>x. \<lbrakk>a \<le> x; x < b\<rbrakk> \<Longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_right x; \<And>x. \<lbrakk>a < x; x \<le> b\<rbrakk> \<Longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_left x\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
\<lbrakk>a < ?x1; ?x1 < b; ?x1 \<notin> I\<rbrakk> \<Longrightarrow> (\<lambda>u. integral {a..u} f) differentiable at ?x1
\<lbrakk>a \<le> ?x1; ?x1 < b\<rbrakk> \<Longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_right ?x1
\<lbrakk>a < ?x1; ?x1 \<le> b\<rbrakk> \<Longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_left ?x1

goal (1 subgoal):
 1. \<And>a b i I f. \<lbrakk>a < b \<Longrightarrow> (\<forall>x>a. x < b \<longrightarrow> x \<notin> I \<longrightarrow> (\<lambda>u. integral {a..u} f) differentiable at x) \<and> (\<forall>x\<ge>a. x < b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_right x) \<and> (\<forall>x>a. x \<le> b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_left x); finite I; i \<notin> I; a < b\<rbrakk> \<Longrightarrow> (\<forall>x>a. x < b \<longrightarrow> x \<notin> insert i I \<longrightarrow> (\<lambda>u. integral {a..u} f) differentiable at x) \<and> (\<forall>x\<ge>a. x < b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_right x) \<and> (\<forall>x>a. x \<le> b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_left x)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>a < ?x1; ?x1 < b; ?x1 \<notin> I\<rbrakk> \<Longrightarrow> (\<lambda>u. integral {a..u} f) differentiable at ?x1
\<lbrakk>a \<le> ?x1; ?x1 < b\<rbrakk> \<Longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_right ?x1
\<lbrakk>a < ?x1; ?x1 \<le> b\<rbrakk> \<Longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_left ?x1
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>a < ?x1; ?x1 < b; ?x1 \<notin> I\<rbrakk> \<Longrightarrow> (\<lambda>u. integral {a..u} f) differentiable at ?x1
\<lbrakk>a \<le> ?x1; ?x1 < b\<rbrakk> \<Longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_right ?x1
\<lbrakk>a < ?x1; ?x1 \<le> b\<rbrakk> \<Longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_left ?x1

goal (1 subgoal):
 1. (\<forall>x>a. x < b \<longrightarrow> x \<notin> insert i I \<longrightarrow> (\<lambda>u. integral {a..u} f) differentiable at x) \<and> (\<forall>x\<ge>a. x < b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_right x) \<and> (\<forall>x>a. x \<le> b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_left x)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<forall>x>a. x < b \<longrightarrow> x \<notin> insert i I \<longrightarrow> (\<lambda>u. integral {a..u} f) differentiable at x) \<and> (\<forall>x\<ge>a. x < b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_right x) \<and> (\<forall>x>a. x \<le> b \<longrightarrow> (\<lambda>t. integral {a..t} f) differentiable at_left x)

goal:
No subgoals!
[PROOF STEP]
qed