[STATEMENT]
lemma Greens_thm_type_I:
  fixes F:: "((real*real) \<Rightarrow> (real * real))" and
    gamma1 gamma2 gamma3 gamma4 :: "(real \<Rightarrow> (real * real))" and
    a:: "real" and b:: "real" and
    g1:: "(real \<Rightarrow> real)" and g2:: "(real \<Rightarrow> real)"
  assumes Dy_def: "Dy_pair = {(x::real,y) . x \<in> cbox a b \<and> y \<in> cbox (g2 x) (g1 x)}" and
    gamma1_def: "gamma1 = (\<lambda>x. (a + (b - a) * x, g2(a + (b - a) * x)))" and
    gamma1_smooth: "gamma1 piecewise_C1_differentiable_on {0..1}" and (*TODO: This should be piecewise smooth*)
    gamma2_def: "gamma2 = (\<lambda>x. (b, g2(b) + x  *\<^sub>R (g1(b) - g2(b))))" and
    gamma3_def: "gamma3 = (\<lambda>x. (a + (b - a) * x, g1(a + (b - a) * x)))" and
    gamma3_smooth: "gamma3 piecewise_C1_differentiable_on {0..1}" and
    gamma4_def: "gamma4 = (\<lambda>x. (a,  g2(a) + x *\<^sub>R (g1(a) - g2(a))))" and
    F_i_analytically_valid: "analytically_valid Dy_pair (\<lambda>p. F(p) \<bullet> i) j" and
    g2_leq_g1: "\<forall>x \<in> cbox a b. (g2 x) \<le> (g1 x)" and (*This is needed otherwise what would Dy be?*)
    a_lt_b: "a < b"
  shows "(line_integral F {i} gamma1) +
         (line_integral F {i} gamma2) -
         (line_integral F {i} gamma3) -
         (line_integral F {i} gamma4)
                 = (integral Dy_pair (\<lambda>a. - (partial_vector_derivative (\<lambda>p. F(p) \<bullet> i) j a)))"
    "line_integral_exists F {i} gamma4"
    "line_integral_exists F {i} gamma3"
    "line_integral_exists F {i} gamma2"
    "line_integral_exists F {i} gamma1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (line_integral F {i} gamma1 + line_integral F {i} gamma2 - line_integral F {i} gamma3 - line_integral F {i} gamma4 = integral Dy_pair (\<lambda>a. - partial_vector_derivative (\<lambda>p. F p \<bullet> i) j a) &&& line_integral_exists F {i} gamma4) &&& line_integral_exists F {i} gamma3 &&& line_integral_exists F {i} gamma2 &&& line_integral_exists F {i} gamma1
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (5 subgoals):
 1. line_integral F {i} gamma1 + line_integral F {i} gamma2 - line_integral F {i} gamma3 - line_integral F {i} gamma4 = integral Dy_pair (\<lambda>a. - partial_vector_derivative (\<lambda>p. F p \<bullet> i) j a)
 2. line_integral_exists F {i} gamma4
 3. line_integral_exists F {i} gamma3
 4. line_integral_exists F {i} gamma2
 5. line_integral_exists F {i} gamma1
[PROOF STEP]
let ?F_b' = "partial_vector_derivative (\<lambda>a. (F a) \<bullet> i)  j"
[PROOF STATE]
proof (state)
goal (5 subgoals):
 1. line_integral F {i} gamma1 + line_integral F {i} gamma2 - line_integral F {i} gamma3 - line_integral F {i} gamma4 = integral Dy_pair (\<lambda>a. - partial_vector_derivative (\<lambda>p. F p \<bullet> i) j a)
 2. line_integral_exists F {i} gamma4
 3. line_integral_exists F {i} gamma3
 4. line_integral_exists F {i} gamma2
 5. line_integral_exists F {i} gamma1
[PROOF STEP]
have F_first_is_continuous: "continuous_on Dy_pair (\<lambda>a. F(a) \<bullet> i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on Dy_pair (\<lambda>a. F a \<bullet> i)
[PROOF STEP]
using F_i_analytically_valid
[PROOF STATE]
proof (prove)
using this:
analytically_valid Dy_pair (\<lambda>p. F p \<bullet> i) j

goal (1 subgoal):
 1. continuous_on Dy_pair (\<lambda>a. F a \<bullet> i)
[PROOF STEP]
by (auto simp add: analytically_valid_def)
[PROOF STATE]
proof (state)
this:
continuous_on Dy_pair (\<lambda>a. F a \<bullet> i)

goal (5 subgoals):
 1. line_integral F {i} gamma1 + line_integral F {i} gamma2 - line_integral F {i} gamma3 - line_integral F {i} gamma4 = integral Dy_pair (\<lambda>a. - partial_vector_derivative (\<lambda>p. F p \<bullet> i) j a)
 2. line_integral_exists F {i} gamma4
 3. line_integral_exists F {i} gamma3
 4. line_integral_exists F {i} gamma2
 5. line_integral_exists F {i} gamma1
[PROOF STEP]
let ?f = "(\<lambda>x. if x \<in> (Dy_pair) then (partial_vector_derivative (\<lambda>a. (F a) \<bullet> i)  j) x else 0)"
[PROOF STATE]
proof (state)
goal (5 subgoals):
 1. line_integral F {i} gamma1 + line_integral F {i} gamma2 - line_integral F {i} gamma3 - line_integral F {i} gamma4 = integral Dy_pair (\<lambda>a. - partial_vector_derivative (\<lambda>p. F p \<bullet> i) j a)
 2. line_integral_exists F {i} gamma4
 3. line_integral_exists F {i} gamma3
 4. line_integral_exists F {i} gamma2
 5. line_integral_exists F {i} gamma1
[PROOF STEP]
have f_lesbegue_integrable: "integrable lborel ?f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integrable lborel (\<lambda>x. if x \<in> Dy_pair then partial_vector_derivative (\<lambda>a. F a \<bullet> i) j x else 0)
[PROOF STEP]
using F_i_analytically_valid
[PROOF STATE]
proof (prove)
using this:
analytically_valid Dy_pair (\<lambda>p. F p \<bullet> i) j

goal (1 subgoal):
 1. integrable lborel (\<lambda>x. if x \<in> Dy_pair then partial_vector_derivative (\<lambda>a. F a \<bullet> i) j x else 0)
[PROOF STEP]
by (auto simp add: analytically_valid_def indic_ident)
[PROOF STATE]
proof (state)
this:
integrable lborel (\<lambda>x. if x \<in> Dy_pair then partial_vector_derivative (\<lambda>a. F a \<bullet> i) j x else 0)

goal (5 subgoals):
 1. line_integral F {i} gamma1 + line_integral F {i} gamma2 - line_integral F {i} gamma3 - line_integral F {i} gamma4 = integral Dy_pair (\<lambda>a. - partial_vector_derivative (\<lambda>p. F p \<bullet> i) j a)
 2. line_integral_exists F {i} gamma4
 3. line_integral_exists F {i} gamma3
 4. line_integral_exists F {i} gamma2
 5. line_integral_exists F {i} gamma1
[PROOF STEP]
have partially_vec_diff: "\<forall>a \<in> Dy_pair. partially_vector_differentiable (\<lambda>a. (F a) \<bullet> i) j a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>a\<in>Dy_pair. partially_vector_differentiable (\<lambda>a. F a \<bullet> i) j a
[PROOF STEP]
using F_i_analytically_valid
[PROOF STATE]
proof (prove)
using this:
analytically_valid Dy_pair (\<lambda>p. F p \<bullet> i) j

goal (1 subgoal):
 1. \<forall>a\<in>Dy_pair. partially_vector_differentiable (\<lambda>a. F a \<bullet> i) j a
[PROOF STEP]
by (auto simp add: analytically_valid_def indicator_def)
[PROOF STATE]
proof (state)
this:
\<forall>a\<in>Dy_pair. partially_vector_differentiable (\<lambda>a. F a \<bullet> i) j a

goal (5 subgoals):
 1. line_integral F {i} gamma1 + line_integral F {i} gamma2 - line_integral F {i} gamma3 - line_integral F {i} gamma4 = integral Dy_pair (\<lambda>a. - partial_vector_derivative (\<lambda>p. F p \<bullet> i) j a)
 2. line_integral_exists F {i} gamma4
 3. line_integral_exists F {i} gamma3
 4. line_integral_exists F {i} gamma2
 5. line_integral_exists F {i} gamma1
[PROOF STEP]
have x_axis_integral_measurable: "(\<lambda>x. integral UNIV (\<lambda>y. ?f(x, y))) \<in> borel_measurable lborel"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. integral UNIV (\<lambda>y. if (x, y) \<in> Dy_pair then partial_vector_derivative (\<lambda>a. F a \<bullet> i) j (x, y) else 0)) \<in> borel_measurable lborel
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<lambda>x. integral UNIV (\<lambda>y. if (x, y) \<in> Dy_pair then partial_vector_derivative (\<lambda>a. F a \<bullet> i) j (x, y) else 0)) \<in> borel_measurable lborel
[PROOF STEP]
have "(\<lambda>p. (?F_b' p) * indicator (Dy_pair) p) = (\<lambda>x. if x \<in> (Dy_pair) then (?F_b') x else 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>p. partial_vector_derivative (\<lambda>a. F a \<bullet> i) j p * indicat_real Dy_pair p) = (\<lambda>x. if x \<in> Dy_pair then partial_vector_derivative (\<lambda>a. F a \<bullet> i) j x else 0)
[PROOF STEP]
using indic_ident[of "?F_b'"]
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. partial_vector_derivative (\<lambda>a. F a \<bullet> i) j x * indicat_real ?s x) = (\<lambda>x. if x \<in> ?s then partial_vector_derivative (\<lambda>a. F a \<bullet> i) j x else 0)

goal (1 subgoal):
 1. (\<lambda>p. partial_vector_derivative (\<lambda>a. F a \<bullet> i) j p * indicat_real Dy_pair p) = (\<lambda>x. if x \<in> Dy_pair then partial_vector_derivative (\<lambda>a. F a \<bullet> i) j x else 0)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<lambda>p. partial_vector_derivative (\<lambda>a. F a \<bullet> i) j p * indicat_real Dy_pair p) = (\<lambda>x. if x \<in> Dy_pair then partial_vector_derivative (\<lambda>a. F a \<bullet> i) j x else 0)

goal (1 subgoal):
 1. (\<lambda>x. integral UNIV (\<lambda>y. if (x, y) \<in> Dy_pair then partial_vector_derivative (\<lambda>a. F a \<bullet> i) j (x, y) else 0)) \<in> borel_measurable lborel
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>p. partial_vector_derivative (\<lambda>a. F a \<bullet> i) j p * indicat_real Dy_pair p) = (\<lambda>x. if x \<in> Dy_pair then partial_vector_derivative (\<lambda>a. F a \<bullet> i) j x else 0)
[PROOF STEP]
have "\<And>x y. ?F_b' (x,y) * indicator (Dy_pair) (x,y) = (\<lambda>x. if x \<in> (Dy_pair) then (?F_b') x else 0) (x,y)"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>p. partial_vector_derivative (\<lambda>a. F a \<bullet> i) j p * indicat_real Dy_pair p) = (\<lambda>x. if x \<in> Dy_pair then partial_vector_derivative (\<lambda>a. F a \<bullet> i) j x else 0)

goal (1 subgoal):
 1. \<And>x y. partial_vector_derivative (\<lambda>a. F a \<bullet> i) j (x, y) * indicat_real Dy_pair (x, y) = (if (x, y) \<in> Dy_pair then partial_vector_derivative (\<lambda>a. F a \<bullet> i) j (x, y) else 0)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
partial_vector_derivative (\<lambda>a. F a \<bullet> i) j (?x, ?y) * indicat_real Dy_pair (?x, ?y) = (if (?x, ?y) \<in> Dy_pair then partial_vector_derivative (\<lambda>a. F a \<bullet> i) j (?x, ?y) else 0)

goal (1 subgoal):
 1. (\<lambda>x. integral UNIV (\<lambda>y. if (x, y) \<in> Dy_pair then partial_vector_derivative (\<lambda>a. F a \<bullet> i) j (x, y) else 0)) \<in> borel_measurable lborel
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
partial_vector_derivative (\<lambda>a. F a \<bullet> i) j (?x, ?y) * indicat_real Dy_pair (?x, ?y) = (if (?x, ?y) \<in> Dy_pair then partial_vector_derivative (\<lambda>a. F a \<bullet> i) j (?x, ?y) else 0)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
partial_vector_derivative (\<lambda>a. F a \<bullet> i) j (?x, ?y) * indicat_real Dy_pair (?x, ?y) = (if (?x, ?y) \<in> Dy_pair then partial_vector_derivative (\<lambda>a. F a \<bullet> i) j (?x, ?y) else 0)

goal (1 subgoal):
 1. (\<lambda>x. integral UNIV (\<lambda>y. if (x, y) \<in> Dy_pair then partial_vector_derivative (\<lambda>a. F a \<bullet> i) j (x, y) else 0)) \<in> borel_measurable lborel
[PROOF STEP]
using analytically_valid_x[OF F_i_analytically_valid]
[PROOF STATE]
proof (prove)
using this:
partial_vector_derivative (\<lambda>a. F a \<bullet> i) j (?x, ?y) * indicat_real Dy_pair (?x, ?y) = (if (?x, ?y) \<in> Dy_pair then partial_vector_derivative (\<lambda>a. F a \<bullet> i) j (?x, ?y) else 0)
(\<lambda>x. integral UNIV (\<lambda>y. partial_vector_derivative (\<lambda>p. F p \<bullet> i) j (x, y) * indicat_real Dy_pair (x, y))) \<in> borel_measurable lborel

goal (1 subgoal):
 1. (\<lambda>x. integral UNIV (\<lambda>y. if (x, y) \<in> Dy_pair then partial_vector_derivative (\<lambda>a. F a \<bullet> i) j (x, y) else 0)) \<in> borel_measurable lborel
[PROOF STEP]
by (auto simp add: indicator_def)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. integral UNIV (\<lambda>y. if (x, y) \<in> Dy_pair then partial_vector_derivative (\<lambda>a. F a \<bullet> i) j (x, y) else 0)) \<in> borel_measurable lborel

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<lambda>x. integral UNIV (\<lambda>y. if (x, y) \<in> Dy_pair then partial_vector_derivative (\<lambda>a. F a \<bullet> i) j (x, y) else 0)) \<in> borel_measurable lborel

goal (5 subgoals):
 1. line_integral F {i} gamma1 + line_integral F {i} gamma2 - line_integral F {i} gamma3 - line_integral F {i} gamma4 = integral Dy_pair (\<lambda>a. - partial_vector_derivative (\<lambda>p. F p \<bullet> i) j a)
 2. line_integral_exists F {i} gamma4
 3. line_integral_exists F {i} gamma3
 4. line_integral_exists F {i} gamma2
 5. line_integral_exists F {i} gamma1
[PROOF STEP]
have F_partially_differentiable: "\<forall>a\<in>Dy_pair. has_partial_vector_derivative (\<lambda>x. (F x) \<bullet> i) j (?F_b' a) a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>a\<in>Dy_pair. has_partial_vector_derivative (\<lambda>x. F x \<bullet> i) j (partial_vector_derivative (\<lambda>a. F a \<bullet> i) j a) a
[PROOF STEP]
using partial_vector_derivative_works partially_vec_diff
[PROOF STATE]
proof (prove)
using this:
partially_vector_differentiable ?F ?base_vec ?a \<Longrightarrow> has_partial_vector_derivative ?F ?base_vec (partial_vector_derivative ?F ?base_vec ?a) ?a
\<forall>a\<in>Dy_pair. partially_vector_differentiable (\<lambda>a. F a \<bullet> i) j a

goal (1 subgoal):
 1. \<forall>a\<in>Dy_pair. has_partial_vector_derivative (\<lambda>x. F x \<bullet> i) j (partial_vector_derivative (\<lambda>a. F a \<bullet> i) j a) a
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
\<forall>a\<in>Dy_pair. has_partial_vector_derivative (\<lambda>x. F x \<bullet> i) j (partial_vector_derivative (\<lambda>a. F a \<bullet> i) j a) a

goal (5 subgoals):
 1. line_integral F {i} gamma1 + line_integral F {i} gamma2 - line_integral F {i} gamma3 - line_integral F {i} gamma4 = integral Dy_pair (\<lambda>a. - partial_vector_derivative (\<lambda>p. F p \<bullet> i) j a)
 2. line_integral_exists F {i} gamma4
 3. line_integral_exists F {i} gamma3
 4. line_integral_exists F {i} gamma2
 5. line_integral_exists F {i} gamma1
[PROOF STEP]
have g1_g2_continuous: "continuous_on (cbox a b) g1"
    "continuous_on (cbox a b) g2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on (cbox a b) g1 &&& continuous_on (cbox a b) g2
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. continuous_on (cbox a b) g1
 2. continuous_on (cbox a b) g2
[PROOF STEP]
have shift_scale_cont: "continuous_on {a..b} (\<lambda>x. (x - a)*(1/(b-a)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on {a..b} (\<lambda>x. (x - a) * (1 / (b - a)))
[PROOF STEP]
by (intro continuous_intros)
[PROOF STATE]
proof (state)
this:
continuous_on {a..b} (\<lambda>x. (x - a) * (1 / (b - a)))

goal (2 subgoals):
 1. continuous_on (cbox a b) g1
 2. continuous_on (cbox a b) g2
[PROOF STEP]
have shift_scale_inv: "(\<lambda>x. a + (b - a) * x) \<circ> (\<lambda>x. (x - a)*(1/(b-a))) = id"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. a + (b - a) * x) \<circ> (\<lambda>x. (x - a) * (1 / (b - a))) = id
[PROOF STEP]
using a_lt_b
[PROOF STATE]
proof (prove)
using this:
a < b

goal (1 subgoal):
 1. (\<lambda>x. a + (b - a) * x) \<circ> (\<lambda>x. (x - a) * (1 / (b - a))) = id
[PROOF STEP]
by (auto simp add: o_def)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. a + (b - a) * x) \<circ> (\<lambda>x. (x - a) * (1 / (b - a))) = id

goal (2 subgoals):
 1. continuous_on (cbox a b) g1
 2. continuous_on (cbox a b) g2
[PROOF STEP]
have img_shift_scale: "(\<lambda>x. (x - a)*(1/(b-a)))`{a..b} = {0..1}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. (x - a) * (1 / (b - a))) ` {a..b} = {0..1}
[PROOF STEP]
using a_lt_b
[PROOF STATE]
proof (prove)
using this:
a < b

goal (1 subgoal):
 1. (\<lambda>x. (x - a) * (1 / (b - a))) ` {a..b} = {0..1}
[PROOF STEP]
apply (auto simp: divide_simps image_iff)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>a < b; 0 \<le> x; x \<le> 1\<rbrakk> \<Longrightarrow> \<exists>xa\<in>{a..b}. x * (b - a) = xa - a
[PROOF STEP]
apply (rule_tac x="x * (b - a) + a" in bexI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x. \<lbrakk>a < b; 0 \<le> x; x \<le> 1\<rbrakk> \<Longrightarrow> x * (b - a) = x * (b - a) + a - a
 2. \<And>x. \<lbrakk>a < b; 0 \<le> x; x \<le> 1\<rbrakk> \<Longrightarrow> x * (b - a) + a \<in> {a..b}
[PROOF STEP]
using le_diff_eq
[PROOF STATE]
proof (prove)
using this:
(?a \<le> ?c - ?b) = (?a + ?b \<le> ?c)

goal (2 subgoals):
 1. \<And>x. \<lbrakk>a < b; 0 \<le> x; x \<le> 1\<rbrakk> \<Longrightarrow> x * (b - a) = x * (b - a) + a - a
 2. \<And>x. \<lbrakk>a < b; 0 \<le> x; x \<le> 1\<rbrakk> \<Longrightarrow> x * (b - a) + a \<in> {a..b}
[PROOF STEP]
by fastforce+
[PROOF STATE]
proof (state)
this:
(\<lambda>x. (x - a) * (1 / (b - a))) ` {a..b} = {0..1}

goal (2 subgoals):
 1. continuous_on (cbox a b) g1
 2. continuous_on (cbox a b) g2
[PROOF STEP]
have gamma1_y_component: "(\<lambda>x. g2(a + (b - a) * x)) = g2 \<circ> (\<lambda>x.(a + (b - a) * x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. g2 (a + (b - a) * x)) = g2 \<circ> (\<lambda>x. a + (b - a) * x)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<lambda>x. g2 (a + (b - a) * x)) = g2 \<circ> (\<lambda>x. a + (b - a) * x)

goal (2 subgoals):
 1. continuous_on (cbox a b) g1
 2. continuous_on (cbox a b) g2
[PROOF STEP]
have "continuous_on {0..1} (\<lambda>x. g2(a + (b - a) * x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on {0..1} (\<lambda>x. g2 (a + (b - a) * x))
[PROOF STEP]
using continuous_on_inner[OF piecewise_C1_differentiable_on_imp_continuous_on[OF gamma1_smooth], of "(\<lambda>x. j)", OF continuous_on_const]
[PROOF STATE]
proof (prove)
using this:
continuous_on {0..1} (\<lambda>x. gamma1 x \<bullet> j)

goal (1 subgoal):
 1. continuous_on {0..1} (\<lambda>x. g2 (a + (b - a) * x))
[PROOF STEP]
by (simp add: gamma1_def j_is_y_axis)
[PROOF STATE]
proof (state)
this:
continuous_on {0..1} (\<lambda>x. g2 (a + (b - a) * x))

goal (2 subgoals):
 1. continuous_on (cbox a b) g1
 2. continuous_on (cbox a b) g2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
continuous_on {0..1} (\<lambda>x. g2 (a + (b - a) * x))
[PROOF STEP]
have "continuous_on {a..b} ((\<lambda>x. g2(a + (b - a) * x)) \<circ> (\<lambda>x. (x - a)*(1/(b-a))))"
[PROOF STATE]
proof (prove)
using this:
continuous_on {0..1} (\<lambda>x. g2 (a + (b - a) * x))

goal (1 subgoal):
 1. continuous_on {a..b} ((\<lambda>x. g2 (a + (b - a) * x)) \<circ> (\<lambda>x. (x - a) * (1 / (b - a))))
[PROOF STEP]
using img_shift_scale continuous_on_compose shift_scale_cont
[PROOF STATE]
proof (prove)
using this:
continuous_on {0..1} (\<lambda>x. g2 (a + (b - a) * x))
(\<lambda>x. (x - a) * (1 / (b - a))) ` {a..b} = {0..1}
\<lbrakk>continuous_on ?s ?f; continuous_on (?f ` ?s) ?g\<rbrakk> \<Longrightarrow> continuous_on ?s (?g \<circ> ?f)
continuous_on {a..b} (\<lambda>x. (x - a) * (1 / (b - a)))

goal (1 subgoal):
 1. continuous_on {a..b} ((\<lambda>x. g2 (a + (b - a) * x)) \<circ> (\<lambda>x. (x - a) * (1 / (b - a))))
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
continuous_on {a..b} ((\<lambda>x. g2 (a + (b - a) * x)) \<circ> (\<lambda>x. (x - a) * (1 / (b - a))))

goal (2 subgoals):
 1. continuous_on (cbox a b) g1
 2. continuous_on (cbox a b) g2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
continuous_on {a..b} ((\<lambda>x. g2 (a + (b - a) * x)) \<circ> (\<lambda>x. (x - a) * (1 / (b - a))))
[PROOF STEP]
have "continuous_on {a..b} (g2 \<circ> (\<lambda>x.(a + (b - a) * x)) \<circ> (\<lambda>x. (x - a)*(1/(b-a))))"
[PROOF STATE]
proof (prove)
using this:
continuous_on {a..b} ((\<lambda>x. g2 (a + (b - a) * x)) \<circ> (\<lambda>x. (x - a) * (1 / (b - a))))

goal (1 subgoal):
 1. continuous_on {a..b} (g2 \<circ> (\<lambda>x. a + (b - a) * x) \<circ> (\<lambda>x. (x - a) * (1 / (b - a))))
[PROOF STEP]
using gamma1_y_component
[PROOF STATE]
proof (prove)
using this:
continuous_on {a..b} ((\<lambda>x. g2 (a + (b - a) * x)) \<circ> (\<lambda>x. (x - a) * (1 / (b - a))))
(\<lambda>x. g2 (a + (b - a) * x)) = g2 \<circ> (\<lambda>x. a + (b - a) * x)

goal (1 subgoal):
 1. continuous_on {a..b} (g2 \<circ> (\<lambda>x. a + (b - a) * x) \<circ> (\<lambda>x. (x - a) * (1 / (b - a))))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
continuous_on {a..b} (g2 \<circ> (\<lambda>x. a + (b - a) * x) \<circ> (\<lambda>x. (x - a) * (1 / (b - a))))

goal (2 subgoals):
 1. continuous_on (cbox a b) g1
 2. continuous_on (cbox a b) g2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
continuous_on {a..b} (g2 \<circ> (\<lambda>x. a + (b - a) * x) \<circ> (\<lambda>x. (x - a) * (1 / (b - a))))
[PROOF STEP]
show "continuous_on (cbox a b) g2"
[PROOF STATE]
proof (prove)
using this:
continuous_on {a..b} (g2 \<circ> (\<lambda>x. a + (b - a) * x) \<circ> (\<lambda>x. (x - a) * (1 / (b - a))))

goal (1 subgoal):
 1. continuous_on (cbox a b) g2
[PROOF STEP]
using a_lt_b
[PROOF STATE]
proof (prove)
using this:
continuous_on {a..b} (g2 \<circ> (\<lambda>x. a + (b - a) * x) \<circ> (\<lambda>x. (x - a) * (1 / (b - a))))
a < b

goal (1 subgoal):
 1. continuous_on (cbox a b) g2
[PROOF STEP]
by (simp add: shift_scale_inv)
[PROOF STATE]
proof (state)
this:
continuous_on (cbox a b) g2

goal (1 subgoal):
 1. continuous_on (cbox a b) g1
[PROOF STEP]
have gamma3_y_component: "(\<lambda>x. g1(a + (b - a) * x)) = g1 \<circ> (\<lambda>x.(a + (b - a) * x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. g1 (a + (b - a) * x)) = g1 \<circ> (\<lambda>x. a + (b - a) * x)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<lambda>x. g1 (a + (b - a) * x)) = g1 \<circ> (\<lambda>x. a + (b - a) * x)

goal (1 subgoal):
 1. continuous_on (cbox a b) g1
[PROOF STEP]
have "continuous_on {0..1} (\<lambda>x. g1(a + (b - a) * x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on {0..1} (\<lambda>x. g1 (a + (b - a) * x))
[PROOF STEP]
using continuous_on_inner[OF piecewise_C1_differentiable_on_imp_continuous_on[OF gamma3_smooth], of "(\<lambda>x. j)", OF continuous_on_const]
[PROOF STATE]
proof (prove)
using this:
continuous_on {0..1} (\<lambda>x. gamma3 x \<bullet> j)

goal (1 subgoal):
 1. continuous_on {0..1} (\<lambda>x. g1 (a + (b - a) * x))
[PROOF STEP]
by (simp add: gamma3_def j_is_y_axis)
[PROOF STATE]
proof (state)
this:
continuous_on {0..1} (\<lambda>x. g1 (a + (b - a) * x))

goal (1 subgoal):
 1. continuous_on (cbox a b) g1
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
continuous_on {0..1} (\<lambda>x. g1 (a + (b - a) * x))
[PROOF STEP]
have "continuous_on {a..b} ((\<lambda>x. g1(a + (b - a) * x)) \<circ> (\<lambda>x. (x - a)*(1/(b-a))))"
[PROOF STATE]
proof (prove)
using this:
continuous_on {0..1} (\<lambda>x. g1 (a + (b - a) * x))

goal (1 subgoal):
 1. continuous_on {a..b} ((\<lambda>x. g1 (a + (b - a) * x)) \<circ> (\<lambda>x. (x - a) * (1 / (b - a))))
[PROOF STEP]
using img_shift_scale continuous_on_compose shift_scale_cont
[PROOF STATE]
proof (prove)
using this:
continuous_on {0..1} (\<lambda>x. g1 (a + (b - a) * x))
(\<lambda>x. (x - a) * (1 / (b - a))) ` {a..b} = {0..1}
\<lbrakk>continuous_on ?s ?f; continuous_on (?f ` ?s) ?g\<rbrakk> \<Longrightarrow> continuous_on ?s (?g \<circ> ?f)
continuous_on {a..b} (\<lambda>x. (x - a) * (1 / (b - a)))

goal (1 subgoal):
 1. continuous_on {a..b} ((\<lambda>x. g1 (a + (b - a) * x)) \<circ> (\<lambda>x. (x - a) * (1 / (b - a))))
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
continuous_on {a..b} ((\<lambda>x. g1 (a + (b - a) * x)) \<circ> (\<lambda>x. (x - a) * (1 / (b - a))))

goal (1 subgoal):
 1. continuous_on (cbox a b) g1
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
continuous_on {a..b} ((\<lambda>x. g1 (a + (b - a) * x)) \<circ> (\<lambda>x. (x - a) * (1 / (b - a))))
[PROOF STEP]
have "continuous_on {a..b} (g1 \<circ> (\<lambda>x.(a + (b - a) * x)) \<circ> (\<lambda>x. (x - a)*(1/(b-a))))"
[PROOF STATE]
proof (prove)
using this:
continuous_on {a..b} ((\<lambda>x. g1 (a + (b - a) * x)) \<circ> (\<lambda>x. (x - a) * (1 / (b - a))))

goal (1 subgoal):
 1. continuous_on {a..b} (g1 \<circ> (\<lambda>x. a + (b - a) * x) \<circ> (\<lambda>x. (x - a) * (1 / (b - a))))
[PROOF STEP]
using gamma3_y_component
[PROOF STATE]
proof (prove)
using this:
continuous_on {a..b} ((\<lambda>x. g1 (a + (b - a) * x)) \<circ> (\<lambda>x. (x - a) * (1 / (b - a))))
(\<lambda>x. g1 (a + (b - a) * x)) = g1 \<circ> (\<lambda>x. a + (b - a) * x)

goal (1 subgoal):
 1. continuous_on {a..b} (g1 \<circ> (\<lambda>x. a + (b - a) * x) \<circ> (\<lambda>x. (x - a) * (1 / (b - a))))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
continuous_on {a..b} (g1 \<circ> (\<lambda>x. a + (b - a) * x) \<circ> (\<lambda>x. (x - a) * (1 / (b - a))))

goal (1 subgoal):
 1. continuous_on (cbox a b) g1
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
continuous_on {a..b} (g1 \<circ> (\<lambda>x. a + (b - a) * x) \<circ> (\<lambda>x. (x - a) * (1 / (b - a))))
[PROOF STEP]
show "continuous_on (cbox a b) g1"
[PROOF STATE]
proof (prove)
using this:
continuous_on {a..b} (g1 \<circ> (\<lambda>x. a + (b - a) * x) \<circ> (\<lambda>x. (x - a) * (1 / (b - a))))

goal (1 subgoal):
 1. continuous_on (cbox a b) g1
[PROOF STEP]
using a_lt_b
[PROOF STATE]
proof (prove)
using this:
continuous_on {a..b} (g1 \<circ> (\<lambda>x. a + (b - a) * x) \<circ> (\<lambda>x. (x - a) * (1 / (b - a))))
a < b

goal (1 subgoal):
 1. continuous_on (cbox a b) g1
[PROOF STEP]
by (simp add: shift_scale_inv)
[PROOF STATE]
proof (state)
this:
continuous_on (cbox a b) g1

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
continuous_on (cbox a b) g1
continuous_on (cbox a b) g2

goal (5 subgoals):
 1. line_integral F {i} gamma1 + line_integral F {i} gamma2 - line_integral F {i} gamma3 - line_integral F {i} gamma4 = integral Dy_pair (\<lambda>a. - partial_vector_derivative (\<lambda>p. F p \<bullet> i) j a)
 2. line_integral_exists F {i} gamma4
 3. line_integral_exists F {i} gamma3
 4. line_integral_exists F {i} gamma2
 5. line_integral_exists F {i} gamma1
[PROOF STEP]
have g2_scale_j_contin: "continuous_on (cbox a b) (\<lambda>x. (0, g2 x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on (cbox a b) (\<lambda>x. (0::'a, g2 x))
[PROOF STEP]
by (intro continuous_intros g1_g2_continuous)
[PROOF STATE]
proof (state)
this:
continuous_on (cbox a b) (\<lambda>x. (0::?'a1, g2 x))

goal (5 subgoals):
 1. line_integral F {i} gamma1 + line_integral F {i} gamma2 - line_integral F {i} gamma3 - line_integral F {i} gamma4 = integral Dy_pair (\<lambda>a. - partial_vector_derivative (\<lambda>p. F p \<bullet> i) j a)
 2. line_integral_exists F {i} gamma4
 3. line_integral_exists F {i} gamma3
 4. line_integral_exists F {i} gamma2
 5. line_integral_exists F {i} gamma1
[PROOF STEP]
let ?Dg2 =  "{p. \<exists>x. x \<in> cbox a b \<and> p = (x, g2(x))}"
[PROOF STATE]
proof (state)
goal (5 subgoals):
 1. line_integral F {i} gamma1 + line_integral F {i} gamma2 - line_integral F {i} gamma3 - line_integral F {i} gamma4 = integral Dy_pair (\<lambda>a. - partial_vector_derivative (\<lambda>p. F p \<bullet> i) j a)
 2. line_integral_exists F {i} gamma4
 3. line_integral_exists F {i} gamma3
 4. line_integral_exists F {i} gamma2
 5. line_integral_exists F {i} gamma1
[PROOF STEP]
have line_is_pair_img: "?Dg2 = (\<lambda>x. (x, g2(x))) ` (cbox a b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {p. \<exists>x. x \<in> cbox a b \<and> p = (x, g2 x)} = (\<lambda>x. (x, g2 x)) ` cbox a b
[PROOF STEP]
using image_def
[PROOF STATE]
proof (prove)
using this:
?f ` ?A = {y. \<exists>x\<in>?A. y = ?f x}

goal (1 subgoal):
 1. {p. \<exists>x. x \<in> cbox a b \<and> p = (x, g2 x)} = (\<lambda>x. (x, g2 x)) ` cbox a b
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{p. \<exists>x. x \<in> cbox a b \<and> p = (x, g2 x)} = (\<lambda>x. (x, g2 x)) ` cbox a b

goal (5 subgoals):
 1. line_integral F {i} gamma1 + line_integral F {i} gamma2 - line_integral F {i} gamma3 - line_integral F {i} gamma4 = integral Dy_pair (\<lambda>a. - partial_vector_derivative (\<lambda>p. F p \<bullet> i) j a)
 2. line_integral_exists F {i} gamma4
 3. line_integral_exists F {i} gamma3
 4. line_integral_exists F {i} gamma2
 5. line_integral_exists F {i} gamma1
[PROOF STEP]
have g2_path_continuous: "continuous_on (cbox a b) (\<lambda>x. (x, g2(x)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on (cbox a b) (\<lambda>x. (x, g2 x))
[PROOF STEP]
by (intro continuous_intros g1_g2_continuous)
[PROOF STATE]
proof (state)
this:
continuous_on (cbox a b) (\<lambda>x. (x, g2 x))

goal (5 subgoals):
 1. line_integral F {i} gamma1 + line_integral F {i} gamma2 - line_integral F {i} gamma3 - line_integral F {i} gamma4 = integral Dy_pair (\<lambda>a. - partial_vector_derivative (\<lambda>p. F p \<bullet> i) j a)
 2. line_integral_exists F {i} gamma4
 3. line_integral_exists F {i} gamma3
 4. line_integral_exists F {i} gamma2
 5. line_integral_exists F {i} gamma1
[PROOF STEP]
have field_cont_on_gamma1_image: "continuous_on ?Dg2  (\<lambda>a. F(a) \<bullet> i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on {p. \<exists>x. x \<in> cbox a b \<and> p = (x, g2 x)} (\<lambda>a. F a \<bullet> i)
[PROOF STEP]
apply (rule continuous_on_subset [OF F_first_is_continuous])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {p. \<exists>x. x \<in> cbox a b \<and> p = (x, g2 x)} \<subseteq> Dy_pair
[PROOF STEP]
by (auto simp add: Dy_def g2_leq_g1)
[PROOF STATE]
proof (state)
this:
continuous_on {p. \<exists>x. x \<in> cbox a b \<and> p = (x, g2 x)} (\<lambda>a. F a \<bullet> i)

goal (5 subgoals):
 1. line_integral F {i} gamma1 + line_integral F {i} gamma2 - line_integral F {i} gamma3 - line_integral F {i} gamma4 = integral Dy_pair (\<lambda>a. - partial_vector_derivative (\<lambda>p. F p \<bullet> i) j a)
 2. line_integral_exists F {i} gamma4
 3. line_integral_exists F {i} gamma3
 4. line_integral_exists F {i} gamma2
 5. line_integral_exists F {i} gamma1
[PROOF STEP]
have gamma1_is_compos_of_scal_and_g2:
    "gamma1 = (\<lambda>x. (x, g2(x))) \<circ> (\<lambda>x. a + (b - a) * x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. gamma1 = (\<lambda>x. (x, g2 x)) \<circ> (\<lambda>x. a + (b - a) * x)
[PROOF STEP]
using gamma1_def
[PROOF STATE]
proof (prove)
using this:
gamma1 = (\<lambda>x. (a + (b - a) * x, g2 (a + (b - a) * x)))

goal (1 subgoal):
 1. gamma1 = (\<lambda>x. (x, g2 x)) \<circ> (\<lambda>x. a + (b - a) * x)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
gamma1 = (\<lambda>x. (x, g2 x)) \<circ> (\<lambda>x. a + (b - a) * x)

goal (5 subgoals):
 1. line_integral F {i} gamma1 + line_integral F {i} gamma2 - line_integral F {i} gamma3 - line_integral F {i} gamma4 = integral Dy_pair (\<lambda>a. - partial_vector_derivative (\<lambda>p. F p \<bullet> i) j a)
 2. line_integral_exists F {i} gamma4
 3. line_integral_exists F {i} gamma3
 4. line_integral_exists F {i} gamma2
 5. line_integral_exists F {i} gamma1
[PROOF STEP]
have add_scale_img:
    "(\<lambda>x. a + (b - a) * x) ` {0 .. 1} = {a .. b}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. a + (b - a) * x) ` {0..1} = {a..b}
[PROOF STEP]
using add_scale_img and a_lt_b
[PROOF STATE]
proof (prove)
using this:
?a < ?b \<Longrightarrow> (\<lambda>x. ?a + (?b - ?a) * x) ` {0..1} = {?a..?b}
a < b

goal (1 subgoal):
 1. (\<lambda>x. a + (b - a) * x) ` {0..1} = {a..b}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<lambda>x. a + (b - a) * x) ` {0..1} = {a..b}

goal (5 subgoals):
 1. line_integral F {i} gamma1 + line_integral F {i} gamma2 - line_integral F {i} gamma3 - line_integral F {i} gamma4 = integral Dy_pair (\<lambda>a. - partial_vector_derivative (\<lambda>p. F p \<bullet> i) j a)
 2. line_integral_exists F {i} gamma4
 3. line_integral_exists F {i} gamma3
 4. line_integral_exists F {i} gamma2
 5. line_integral_exists F {i} gamma1
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>x. a + (b - a) * x) ` {0..1} = {a..b}
[PROOF STEP]
have Dg2_is_gamma1_pathimg: "path_image gamma1 = ?Dg2"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. a + (b - a) * x) ` {0..1} = {a..b}

goal (1 subgoal):
 1. path_image gamma1 = {p. \<exists>x. x \<in> cbox a b \<and> p = (x, g2 x)}
[PROOF STEP]
by (metis (no_types, lifting) box_real(2) gamma1_is_compos_of_scal_and_g2 image_comp line_is_pair_img path_image_def)
[PROOF STATE]
proof (state)
this:
path_image gamma1 = {p. \<exists>x. x \<in> cbox a b \<and> p = (x, g2 x)}

goal (5 subgoals):
 1. line_integral F {i} gamma1 + line_integral F {i} gamma2 - line_integral F {i} gamma3 - line_integral F {i} gamma4 = integral Dy_pair (\<lambda>a. - partial_vector_derivative (\<lambda>p. F p \<bullet> i) j a)
 2. line_integral_exists F {i} gamma4
 3. line_integral_exists F {i} gamma3
 4. line_integral_exists F {i} gamma2
 5. line_integral_exists F {i} gamma1
[PROOF STEP]
have Base_vecs: "i \<in> Basis" "j \<in> Basis" "i \<noteq> j"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i \<in> Basis &&& j \<in> Basis &&& i \<noteq> j
[PROOF STEP]
using real_pair_basis and i_is_x_axis and j_is_y_axis
[PROOF STATE]
proof (prove)
using this:
Basis = {(1, 0), (0, 1)}
i = (1, 0)
j = (0, 1)

goal (1 subgoal):
 1. i \<in> Basis &&& j \<in> Basis &&& i \<noteq> j
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
i \<in> Basis
j \<in> Basis
i \<noteq> j

goal (5 subgoals):
 1. line_integral F {i} gamma1 + line_integral F {i} gamma2 - line_integral F {i} gamma3 - line_integral F {i} gamma4 = integral Dy_pair (\<lambda>a. - partial_vector_derivative (\<lambda>p. F p \<bullet> i) j a)
 2. line_integral_exists F {i} gamma4
 3. line_integral_exists F {i} gamma3
 4. line_integral_exists F {i} gamma2
 5. line_integral_exists F {i} gamma1
[PROOF STEP]
have gamma1_as_euclid_space_fun: "gamma1 = (\<lambda>x. (a + (b - a) * x) *\<^sub>R i + (0, g2 (a + (b - a) * x)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. gamma1 = (\<lambda>x. (a + (b - a) * x) *\<^sub>R i + (0, g2 (a + (b - a) * x)))
[PROOF STEP]
using i_is_x_axis gamma1_def
[PROOF STATE]
proof (prove)
using this:
i = (1, 0)
gamma1 = (\<lambda>x. (a + (b - a) * x, g2 (a + (b - a) * x)))

goal (1 subgoal):
 1. gamma1 = (\<lambda>x. (a + (b - a) * x) *\<^sub>R i + (0, g2 (a + (b - a) * x)))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
gamma1 = (\<lambda>x. (a + (b - a) * x) *\<^sub>R i + (0, g2 (a + (b - a) * x)))

goal (5 subgoals):
 1. line_integral F {i} gamma1 + line_integral F {i} gamma2 - line_integral F {i} gamma3 - line_integral F {i} gamma4 = integral Dy_pair (\<lambda>a. - partial_vector_derivative (\<lambda>p. F p \<bullet> i) j a)
 2. line_integral_exists F {i} gamma4
 3. line_integral_exists F {i} gamma3
 4. line_integral_exists F {i} gamma2
 5. line_integral_exists F {i} gamma1
[PROOF STEP]
have 0: "line_integral F {i} gamma1 = integral (cbox a b) (\<lambda>x. F(x, g2(x)) \<bullet> i )"
          "line_integral_exists F {i} gamma1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. line_integral F {i} gamma1 = integral (cbox a b) (\<lambda>x. F (x, g2 x) \<bullet> i) &&& line_integral_exists F {i} gamma1
[PROOF STEP]
using line_integral_on_pair_path_strong [OF norm_Basis[OF Base_vecs(1)] _ gamma1_as_euclid_space_fun, of "F"]
      gamma1_def gamma1_smooth g2_scale_j_contin a_lt_b add_scale_img
      Dg2_is_gamma1_pathimg and field_cont_on_gamma1_image
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<forall>x. (0, g2 x) \<bullet> i = 0; gamma1 piecewise_C1_differentiable_on {0..1}; continuous_on ((\<lambda>x. a + (b - a) * x) ` {0..1}) (\<lambda>a. (0, g2 a)); pathstart gamma1 \<bullet> i \<le> pathfinish gamma1 \<bullet> i; continuous_on (path_image gamma1) (\<lambda>x. F x \<bullet> i)\<rbrakk> \<Longrightarrow> line_integral F {i} gamma1 = integral (cbox (pathstart gamma1 \<bullet> i) (pathfinish gamma1 \<bullet> i)) (\<lambda>f_var. F (f_var *\<^sub>R i + (0, g2 f_var)) \<bullet> i)
\<lbrakk>\<forall>x. (0, g2 x) \<bullet> i = 0; gamma1 piecewise_C1_differentiable_on {0..1}; continuous_on ((\<lambda>x. a + (b - a) * x) ` {0..1}) (\<lambda>a. (0, g2 a)); pathstart gamma1 \<bullet> i \<le> pathfinish gamma1 \<bullet> i; continuous_on (path_image gamma1) (\<lambda>x. F x \<bullet> i)\<rbrakk> \<Longrightarrow> line_integral_exists F {i} gamma1
gamma1 = (\<lambda>x. (a + (b - a) * x, g2 (a + (b - a) * x)))
gamma1 piecewise_C1_differentiable_on {0..1}
continuous_on (cbox a b) (\<lambda>x. (0::?'a1, g2 x))
a < b
(\<lambda>x. a + (b - a) * x) ` {0..1} = {a..b}
path_image gamma1 = {p. \<exists>x. x \<in> cbox a b \<and> p = (x, g2 x)}
continuous_on {p. \<exists>x. x \<in> cbox a b \<and> p = (x, g2 x)} (\<lambda>a. F a \<bullet> i)

goal (1 subgoal):
 1. line_integral F {i} gamma1 = integral (cbox a b) (\<lambda>x. F (x, g2 x) \<bullet> i) &&& line_integral_exists F {i} gamma1
[PROOF STEP]
by (auto simp: pathstart_def pathfinish_def i_is_x_axis)
[PROOF STATE]
proof (state)
this:
line_integral F {i} gamma1 = integral (cbox a b) (\<lambda>x. F (x, g2 x) \<bullet> i)
line_integral_exists F {i} gamma1

goal (5 subgoals):
 1. line_integral F {i} gamma1 + line_integral F {i} gamma2 - line_integral F {i} gamma3 - line_integral F {i} gamma4 = integral Dy_pair (\<lambda>a. - partial_vector_derivative (\<lambda>p. F p \<bullet> i) j a)
 2. line_integral_exists F {i} gamma4
 3. line_integral_exists F {i} gamma3
 4. line_integral_exists F {i} gamma2
 5. line_integral_exists F {i} gamma1
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
line_integral F {i} gamma1 = integral (cbox a b) (\<lambda>x. F (x, g2 x) \<bullet> i)
line_integral_exists F {i} gamma1
[PROOF STEP]
show "(line_integral_exists F {i} gamma1)"
[PROOF STATE]
proof (prove)
using this:
line_integral F {i} gamma1 = integral (cbox a b) (\<lambda>x. F (x, g2 x) \<bullet> i)
line_integral_exists F {i} gamma1

goal (1 subgoal):
 1. line_integral_exists F {i} gamma1
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
line_integral_exists F {i} gamma1

goal (4 subgoals):
 1. line_integral F {i} gamma1 + line_integral F {i} gamma2 - line_integral F {i} gamma3 - line_integral F {i} gamma4 = integral Dy_pair (\<lambda>a. - partial_vector_derivative (\<lambda>p. F p \<bullet> i) j a)
 2. line_integral_exists F {i} gamma4
 3. line_integral_exists F {i} gamma3
 4. line_integral_exists F {i} gamma2
[PROOF STEP]
have gamma2_x_const: "\<forall>x. gamma2 x \<bullet> i = b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x. gamma2 x \<bullet> i = b
[PROOF STEP]
by (simp add: i_is_x_axis gamma2_def)
[PROOF STATE]
proof (state)
this:
\<forall>x. gamma2 x \<bullet> i = b

goal (4 subgoals):
 1. line_integral F {i} gamma1 + line_integral F {i} gamma2 - line_integral F {i} gamma3 - line_integral F {i} gamma4 = integral Dy_pair (\<lambda>a. - partial_vector_derivative (\<lambda>p. F p \<bullet> i) j a)
 2. line_integral_exists F {i} gamma4
 3. line_integral_exists F {i} gamma3
 4. line_integral_exists F {i} gamma2
[PROOF STEP]
have 1: "(line_integral F {i} gamma2) = 0" "(line_integral_exists F {i} gamma2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. line_integral F {i} gamma2 = 0 &&& line_integral_exists F {i} gamma2
[PROOF STEP]
using line_integral_on_pair_straight_path[OF gamma2_x_const] straight_path_diffrentiable_x gamma2_def
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>{0..1}. gamma2 differentiable at x \<Longrightarrow> line_integral ?F {i} gamma2 = 0
\<forall>x\<in>{0..1}. gamma2 differentiable at x \<Longrightarrow> line_integral_exists ?F {i} gamma2
?\<gamma> = (\<lambda>x. (?b, ?y2.0 + ?y1.0 * x)) \<Longrightarrow> \<forall>x. ?\<gamma> differentiable at x
gamma2 = (\<lambda>x. (b, g2 b + x *\<^sub>R (g1 b - g2 b)))

goal (1 subgoal):
 1. line_integral F {i} gamma2 = 0 &&& line_integral_exists F {i} gamma2
[PROOF STEP]
by (auto simp add: mult.commute)
[PROOF STATE]
proof (state)
this:
line_integral F {i} gamma2 = 0
line_integral_exists F {i} gamma2

goal (4 subgoals):
 1. line_integral F {i} gamma1 + line_integral F {i} gamma2 - line_integral F {i} gamma3 - line_integral F {i} gamma4 = integral Dy_pair (\<lambda>a. - partial_vector_derivative (\<lambda>p. F p \<bullet> i) j a)
 2. line_integral_exists F {i} gamma4
 3. line_integral_exists F {i} gamma3
 4. line_integral_exists F {i} gamma2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
line_integral F {i} gamma2 = 0
line_integral_exists F {i} gamma2
[PROOF STEP]
show "(line_integral_exists F {i} gamma2)"
[PROOF STATE]
proof (prove)
using this:
line_integral F {i} gamma2 = 0
line_integral_exists F {i} gamma2

goal (1 subgoal):
 1. line_integral_exists F {i} gamma2
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
line_integral_exists F {i} gamma2

goal (3 subgoals):
 1. line_integral F {i} gamma1 + line_integral F {i} gamma2 - line_integral F {i} gamma3 - line_integral F {i} gamma4 = integral Dy_pair (\<lambda>a. - partial_vector_derivative (\<lambda>p. F p \<bullet> i) j a)
 2. line_integral_exists F {i} gamma4
 3. line_integral_exists F {i} gamma3
[PROOF STEP]
have "continuous_on (cbox a b) (\<lambda>x. F(x, g2(x))  \<bullet> i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on (cbox a b) (\<lambda>x. F (x, g2 x) \<bullet> i)
[PROOF STEP]
using line_is_pair_img and g2_path_continuous and field_cont_on_gamma1_image
      Topological_Spaces.continuous_on_compose i_is_x_axis j_is_y_axis
[PROOF STATE]
proof (prove)
using this:
{p. \<exists>x. x \<in> cbox a b \<and> p = (x, g2 x)} = (\<lambda>x. (x, g2 x)) ` cbox a b
continuous_on (cbox a b) (\<lambda>x. (x, g2 x))
continuous_on {p. \<exists>x. x \<in> cbox a b \<and> p = (x, g2 x)} (\<lambda>a. F a \<bullet> i)
\<lbrakk>continuous_on ?s ?f; continuous_on (?f ` ?s) ?g\<rbrakk> \<Longrightarrow> continuous_on ?s (?g \<circ> ?f)
i = (1, 0)
j = (0, 1)

goal (1 subgoal):
 1. continuous_on (cbox a b) (\<lambda>x. F (x, g2 x) \<bullet> i)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
continuous_on (cbox a b) (\<lambda>x. F (x, g2 x) \<bullet> i)

goal (3 subgoals):
 1. line_integral F {i} gamma1 + line_integral F {i} gamma2 - line_integral F {i} gamma3 - line_integral F {i} gamma4 = integral Dy_pair (\<lambda>a. - partial_vector_derivative (\<lambda>p. F p \<bullet> i) j a)
 2. line_integral_exists F {i} gamma4
 3. line_integral_exists F {i} gamma3
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
continuous_on (cbox a b) (\<lambda>x. F (x, g2 x) \<bullet> i)
[PROOF STEP]
have 6: "(\<lambda>x. F(x, g2(x))  \<bullet> i) integrable_on (cbox a b)"
[PROOF STATE]
proof (prove)
using this:
continuous_on (cbox a b) (\<lambda>x. F (x, g2 x) \<bullet> i)

goal (1 subgoal):
 1. (\<lambda>x. F (x, g2 x) \<bullet> i) integrable_on cbox a b
[PROOF STEP]
using integrable_continuous [of "a" "b" "(\<lambda>x. F(x, g2(x))  \<bullet> i)"]
[PROOF STATE]
proof (prove)
using this:
continuous_on (cbox a b) (\<lambda>x. F (x, g2 x) \<bullet> i)
continuous_on (cbox a b) (\<lambda>x. F (x, g2 x) \<bullet> i) \<Longrightarrow> (\<lambda>x. F (x, g2 x) \<bullet> i) integrable_on cbox a b

goal (1 subgoal):
 1. (\<lambda>x. F (x, g2 x) \<bullet> i) integrable_on cbox a b
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<lambda>x. F (x, g2 x) \<bullet> i) integrable_on cbox a b

goal (3 subgoals):
 1. line_integral F {i} gamma1 + line_integral F {i} gamma2 - line_integral F {i} gamma3 - line_integral F {i} gamma4 = integral Dy_pair (\<lambda>a. - partial_vector_derivative (\<lambda>p. F p \<bullet> i) j a)
 2. line_integral_exists F {i} gamma4
 3. line_integral_exists F {i} gamma3
[PROOF STEP]
have g1_scale_j_contin: "continuous_on (cbox a b) (\<lambda>x. (0, g1 x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on (cbox a b) (\<lambda>x. (0::'a, g1 x))
[PROOF STEP]
by (intro continuous_intros g1_g2_continuous)
[PROOF STATE]
proof (state)
this:
continuous_on (cbox a b) (\<lambda>x. (0::?'a2, g1 x))

goal (3 subgoals):
 1. line_integral F {i} gamma1 + line_integral F {i} gamma2 - line_integral F {i} gamma3 - line_integral F {i} gamma4 = integral Dy_pair (\<lambda>a. - partial_vector_derivative (\<lambda>p. F p \<bullet> i) j a)
 2. line_integral_exists F {i} gamma4
 3. line_integral_exists F {i} gamma3
[PROOF STEP]
let ?Dg1 =  "{p. \<exists>x. x \<in> cbox a b \<and> p = (x, g1(x))}"
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. line_integral F {i} gamma1 + line_integral F {i} gamma2 - line_integral F {i} gamma3 - line_integral F {i} gamma4 = integral Dy_pair (\<lambda>a. - partial_vector_derivative (\<lambda>p. F p \<bullet> i) j a)
 2. line_integral_exists F {i} gamma4
 3. line_integral_exists F {i} gamma3
[PROOF STEP]
have line_is_pair_img: "?Dg1 = (\<lambda>x. (x, g1(x)) ) ` (cbox a b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {p. \<exists>x. x \<in> cbox a b \<and> p = (x, g1 x)} = (\<lambda>x. (x, g1 x)) ` cbox a b
[PROOF STEP]
using image_def
[PROOF STATE]
proof (prove)
using this:
?f ` ?A = {y. \<exists>x\<in>?A. y = ?f x}

goal (1 subgoal):
 1. {p. \<exists>x. x \<in> cbox a b \<and> p = (x, g1 x)} = (\<lambda>x. (x, g1 x)) ` cbox a b
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{p. \<exists>x. x \<in> cbox a b \<and> p = (x, g1 x)} = (\<lambda>x. (x, g1 x)) ` cbox a b

goal (3 subgoals):
 1. line_integral F {i} gamma1 + line_integral F {i} gamma2 - line_integral F {i} gamma3 - line_integral F {i} gamma4 = integral Dy_pair (\<lambda>a. - partial_vector_derivative (\<lambda>p. F p \<bullet> i) j a)
 2. line_integral_exists F {i} gamma4
 3. line_integral_exists F {i} gamma3
[PROOF STEP]
have g1_path_continuous: "continuous_on (cbox a b) (\<lambda>x. (x, g1(x)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on (cbox a b) (\<lambda>x. (x, g1 x))
[PROOF STEP]
by (intro continuous_intros g1_g2_continuous)
[PROOF STATE]
proof (state)
this:
continuous_on (cbox a b) (\<lambda>x. (x, g1 x))

goal (3 subgoals):
 1. line_integral F {i} gamma1 + line_integral F {i} gamma2 - line_integral F {i} gamma3 - line_integral F {i} gamma4 = integral Dy_pair (\<lambda>a. - partial_vector_derivative (\<lambda>p. F p \<bullet> i) j a)
 2. line_integral_exists F {i} gamma4
 3. line_integral_exists F {i} gamma3
[PROOF STEP]
have field_cont_on_gamma3_image: "continuous_on ?Dg1  (\<lambda>a. F(a)  \<bullet> i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on {p. \<exists>x. x \<in> cbox a b \<and> p = (x, g1 x)} (\<lambda>a. F a \<bullet> i)
[PROOF STEP]
apply (rule continuous_on_subset [OF F_first_is_continuous])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {p. \<exists>x. x \<in> cbox a b \<and> p = (x, g1 x)} \<subseteq> Dy_pair
[PROOF STEP]
by (auto simp add: Dy_def g2_leq_g1)
[PROOF STATE]
proof (state)
this:
continuous_on {p. \<exists>x. x \<in> cbox a b \<and> p = (x, g1 x)} (\<lambda>a. F a \<bullet> i)

goal (3 subgoals):
 1. line_integral F {i} gamma1 + line_integral F {i} gamma2 - line_integral F {i} gamma3 - line_integral F {i} gamma4 = integral Dy_pair (\<lambda>a. - partial_vector_derivative (\<lambda>p. F p \<bullet> i) j a)
 2. line_integral_exists F {i} gamma4
 3. line_integral_exists F {i} gamma3
[PROOF STEP]
have gamma3_is_compos_of_scal_and_g1:
    "gamma3 = (\<lambda>x. (x, g1(x))) \<circ> (\<lambda>x. a + (b - a) * x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. gamma3 = (\<lambda>x. (x, g1 x)) \<circ> (\<lambda>x. a + (b - a) * x)
[PROOF STEP]
using gamma3_def
[PROOF STATE]
proof (prove)
using this:
gamma3 = (\<lambda>x. (a + (b - a) * x, g1 (a + (b - a) * x)))

goal (1 subgoal):
 1. gamma3 = (\<lambda>x. (x, g1 x)) \<circ> (\<lambda>x. a + (b - a) * x)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
gamma3 = (\<lambda>x. (x, g1 x)) \<circ> (\<lambda>x. a + (b - a) * x)

goal (3 subgoals):
 1. line_integral F {i} gamma1 + line_integral F {i} gamma2 - line_integral F {i} gamma3 - line_integral F {i} gamma4 = integral Dy_pair (\<lambda>a. - partial_vector_derivative (\<lambda>p. F p \<bullet> i) j a)
 2. line_integral_exists F {i} gamma4
 3. line_integral_exists F {i} gamma3
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
gamma3 = (\<lambda>x. (x, g1 x)) \<circ> (\<lambda>x. a + (b - a) * x)
[PROOF STEP]
have Dg1_is_gamma3_pathimg: "path_image gamma3 = ?Dg1"
[PROOF STATE]
proof (prove)
using this:
gamma3 = (\<lambda>x. (x, g1 x)) \<circ> (\<lambda>x. a + (b - a) * x)

goal (1 subgoal):
 1. path_image gamma3 = {p. \<exists>x. x \<in> cbox a b \<and> p = (x, g1 x)}
[PROOF STEP]
by (metis (no_types, lifting) box_real(2) image_comp line_is_pair_img local.add_scale_img path_image_def)
[PROOF STATE]
proof (state)
this:
path_image gamma3 = {p. \<exists>x. x \<in> cbox a b \<and> p = (x, g1 x)}

goal (3 subgoals):
 1. line_integral F {i} gamma1 + line_integral F {i} gamma2 - line_integral F {i} gamma3 - line_integral F {i} gamma4 = integral Dy_pair (\<lambda>a. - partial_vector_derivative (\<lambda>p. F p \<bullet> i) j a)
 2. line_integral_exists F {i} gamma4
 3. line_integral_exists F {i} gamma3
[PROOF STEP]
have Base_vecs: "i \<in> Basis" "j \<in> Basis" "i \<noteq> j"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i \<in> Basis &&& j \<in> Basis &&& i \<noteq> j
[PROOF STEP]
using real_pair_basis and i_is_x_axis and j_is_y_axis
[PROOF STATE]
proof (prove)
using this:
Basis = {(1, 0), (0, 1)}
i = (1, 0)
j = (0, 1)

goal (1 subgoal):
 1. i \<in> Basis &&& j \<in> Basis &&& i \<noteq> j
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
i \<in> Basis
j \<in> Basis
i \<noteq> j

goal (3 subgoals):
 1. line_integral F {i} gamma1 + line_integral F {i} gamma2 - line_integral F {i} gamma3 - line_integral F {i} gamma4 = integral Dy_pair (\<lambda>a. - partial_vector_derivative (\<lambda>p. F p \<bullet> i) j a)
 2. line_integral_exists F {i} gamma4
 3. line_integral_exists F {i} gamma3
[PROOF STEP]
have gamma3_as_euclid_space_fun: "gamma3 = (\<lambda>x. (a + (b - a) * x) *\<^sub>R i + (0, g1 (a + (b - a) * x)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. gamma3 = (\<lambda>x. (a + (b - a) * x) *\<^sub>R i + (0, g1 (a + (b - a) * x)))
[PROOF STEP]
using i_is_x_axis gamma3_def
[PROOF STATE]
proof (prove)
using this:
i = (1, 0)
gamma3 = (\<lambda>x. (a + (b - a) * x, g1 (a + (b - a) * x)))

goal (1 subgoal):
 1. gamma3 = (\<lambda>x. (a + (b - a) * x) *\<^sub>R i + (0, g1 (a + (b - a) * x)))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
gamma3 = (\<lambda>x. (a + (b - a) * x) *\<^sub>R i + (0, g1 (a + (b - a) * x)))

goal (3 subgoals):
 1. line_integral F {i} gamma1 + line_integral F {i} gamma2 - line_integral F {i} gamma3 - line_integral F {i} gamma4 = integral Dy_pair (\<lambda>a. - partial_vector_derivative (\<lambda>p. F p \<bullet> i) j a)
 2. line_integral_exists F {i} gamma4
 3. line_integral_exists F {i} gamma3
[PROOF STEP]
have 2: "line_integral F {i} gamma3 = integral (cbox a b) (\<lambda>x. F(x, g1(x)) \<bullet> i )"
         "line_integral_exists F {i} gamma3"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. line_integral F {i} gamma3 = integral (cbox a b) (\<lambda>x. F (x, g1 x) \<bullet> i) &&& line_integral_exists F {i} gamma3
[PROOF STEP]
using line_integral_on_pair_path_strong [OF norm_Basis[OF Base_vecs(1)] _ gamma3_as_euclid_space_fun, of "F"]
      gamma3_def and gamma3_smooth and g1_scale_j_contin and a_lt_b and add_scale_img
      Dg1_is_gamma3_pathimg and field_cont_on_gamma3_image
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<forall>x. (0, g1 x) \<bullet> i = 0; gamma3 piecewise_C1_differentiable_on {0..1}; continuous_on ((\<lambda>x. a + (b - a) * x) ` {0..1}) (\<lambda>a. (0, g1 a)); pathstart gamma3 \<bullet> i \<le> pathfinish gamma3 \<bullet> i; continuous_on (path_image gamma3) (\<lambda>x. F x \<bullet> i)\<rbrakk> \<Longrightarrow> line_integral F {i} gamma3 = integral (cbox (pathstart gamma3 \<bullet> i) (pathfinish gamma3 \<bullet> i)) (\<lambda>f_var. F (f_var *\<^sub>R i + (0, g1 f_var)) \<bullet> i)
\<lbrakk>\<forall>x. (0, g1 x) \<bullet> i = 0; gamma3 piecewise_C1_differentiable_on {0..1}; continuous_on ((\<lambda>x. a + (b - a) * x) ` {0..1}) (\<lambda>a. (0, g1 a)); pathstart gamma3 \<bullet> i \<le> pathfinish gamma3 \<bullet> i; continuous_on (path_image gamma3) (\<lambda>x. F x \<bullet> i)\<rbrakk> \<Longrightarrow> line_integral_exists F {i} gamma3
gamma3 = (\<lambda>x. (a + (b - a) * x, g1 (a + (b - a) * x)))
gamma3 piecewise_C1_differentiable_on {0..1}
continuous_on (cbox a b) (\<lambda>x. (0::?'a2, g1 x))
a < b
(\<lambda>x. a + (b - a) * x) ` {0..1} = {a..b}
path_image gamma3 = {p. \<exists>x. x \<in> cbox a b \<and> p = (x, g1 x)}
continuous_on {p. \<exists>x. x \<in> cbox a b \<and> p = (x, g1 x)} (\<lambda>a. F a \<bullet> i)

goal (1 subgoal):
 1. line_integral F {i} gamma3 = integral (cbox a b) (\<lambda>x. F (x, g1 x) \<bullet> i) &&& line_integral_exists F {i} gamma3
[PROOF STEP]
by (auto simp: pathstart_def pathfinish_def i_is_x_axis)
[PROOF STATE]
proof (state)
this:
line_integral F {i} gamma3 = integral (cbox a b) (\<lambda>x. F (x, g1 x) \<bullet> i)
line_integral_exists F {i} gamma3

goal (3 subgoals):
 1. line_integral F {i} gamma1 + line_integral F {i} gamma2 - line_integral F {i} gamma3 - line_integral F {i} gamma4 = integral Dy_pair (\<lambda>a. - partial_vector_derivative (\<lambda>p. F p \<bullet> i) j a)
 2. line_integral_exists F {i} gamma4
 3. line_integral_exists F {i} gamma3
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
line_integral F {i} gamma3 = integral (cbox a b) (\<lambda>x. F (x, g1 x) \<bullet> i)
line_integral_exists F {i} gamma3
[PROOF STEP]
show "(line_integral_exists F {i} gamma3)"
[PROOF STATE]
proof (prove)
using this:
line_integral F {i} gamma3 = integral (cbox a b) (\<lambda>x. F (x, g1 x) \<bullet> i)
line_integral_exists F {i} gamma3

goal (1 subgoal):
 1. line_integral_exists F {i} gamma3
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
line_integral_exists F {i} gamma3

goal (2 subgoals):
 1. line_integral F {i} gamma1 + line_integral F {i} gamma2 - line_integral F {i} gamma3 - line_integral F {i} gamma4 = integral Dy_pair (\<lambda>a. - partial_vector_derivative (\<lambda>p. F p \<bullet> i) j a)
 2. line_integral_exists F {i} gamma4
[PROOF STEP]
have gamma4_x_const: "\<forall>x. gamma4 x \<bullet> i = a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x. gamma4 x \<bullet> i = a
[PROOF STEP]
using gamma4_def
[PROOF STATE]
proof (prove)
using this:
gamma4 = (\<lambda>x. (a, g2 a + x *\<^sub>R (g1 a - g2 a)))

goal (1 subgoal):
 1. \<forall>x. gamma4 x \<bullet> i = a
[PROOF STEP]
by (auto simp add: real_inner_class.inner_add_left inner_not_same_Basis  i_is_x_axis)
[PROOF STATE]
proof (state)
this:
\<forall>x. gamma4 x \<bullet> i = a

goal (2 subgoals):
 1. line_integral F {i} gamma1 + line_integral F {i} gamma2 - line_integral F {i} gamma3 - line_integral F {i} gamma4 = integral Dy_pair (\<lambda>a. - partial_vector_derivative (\<lambda>p. F p \<bullet> i) j a)
 2. line_integral_exists F {i} gamma4
[PROOF STEP]
have 3: "(line_integral F {i} gamma4) = 0" "(line_integral_exists F {i} gamma4)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. line_integral F {i} gamma4 = 0 &&& line_integral_exists F {i} gamma4
[PROOF STEP]
using line_integral_on_pair_straight_path[OF gamma4_x_const] straight_path_diffrentiable_x gamma4_def
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>{0..1}. gamma4 differentiable at x \<Longrightarrow> line_integral ?F {i} gamma4 = 0
\<forall>x\<in>{0..1}. gamma4 differentiable at x \<Longrightarrow> line_integral_exists ?F {i} gamma4
?\<gamma> = (\<lambda>x. (?b, ?y2.0 + ?y1.0 * x)) \<Longrightarrow> \<forall>x. ?\<gamma> differentiable at x
gamma4 = (\<lambda>x. (a, g2 a + x *\<^sub>R (g1 a - g2 a)))

goal (1 subgoal):
 1. line_integral F {i} gamma4 = 0 &&& line_integral_exists F {i} gamma4
[PROOF STEP]
by (auto simp add: mult.commute)
[PROOF STATE]
proof (state)
this:
line_integral F {i} gamma4 = 0
line_integral_exists F {i} gamma4

goal (2 subgoals):
 1. line_integral F {i} gamma1 + line_integral F {i} gamma2 - line_integral F {i} gamma3 - line_integral F {i} gamma4 = integral Dy_pair (\<lambda>a. - partial_vector_derivative (\<lambda>p. F p \<bullet> i) j a)
 2. line_integral_exists F {i} gamma4
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
line_integral F {i} gamma4 = 0
line_integral_exists F {i} gamma4
[PROOF STEP]
show "(line_integral_exists F {i} gamma4)"
[PROOF STATE]
proof (prove)
using this:
line_integral F {i} gamma4 = 0
line_integral_exists F {i} gamma4

goal (1 subgoal):
 1. line_integral_exists F {i} gamma4
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
line_integral_exists F {i} gamma4

goal (1 subgoal):
 1. line_integral F {i} gamma1 + line_integral F {i} gamma2 - line_integral F {i} gamma3 - line_integral F {i} gamma4 = integral Dy_pair (\<lambda>a. - partial_vector_derivative (\<lambda>p. F p \<bullet> i) j a)
[PROOF STEP]
have "continuous_on (cbox a b) (\<lambda>x. F(x, g1(x)) \<bullet> i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on (cbox a b) (\<lambda>x. F (x, g1 x) \<bullet> i)
[PROOF STEP]
using line_is_pair_img and g1_path_continuous and field_cont_on_gamma3_image
      continuous_on_compose i_is_x_axis j_is_y_axis
[PROOF STATE]
proof (prove)
using this:
{p. \<exists>x. x \<in> cbox a b \<and> p = (x, g1 x)} = (\<lambda>x. (x, g1 x)) ` cbox a b
continuous_on (cbox a b) (\<lambda>x. (x, g1 x))
continuous_on {p. \<exists>x. x \<in> cbox a b \<and> p = (x, g1 x)} (\<lambda>a. F a \<bullet> i)
\<lbrakk>continuous_on ?s ?f; continuous_on (?f ` ?s) ?g\<rbrakk> \<Longrightarrow> continuous_on ?s (?g \<circ> ?f)
i = (1, 0)
j = (0, 1)

goal (1 subgoal):
 1. continuous_on (cbox a b) (\<lambda>x. F (x, g1 x) \<bullet> i)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
continuous_on (cbox a b) (\<lambda>x. F (x, g1 x) \<bullet> i)

goal (1 subgoal):
 1. line_integral F {i} gamma1 + line_integral F {i} gamma2 - line_integral F {i} gamma3 - line_integral F {i} gamma4 = integral Dy_pair (\<lambda>a. - partial_vector_derivative (\<lambda>p. F p \<bullet> i) j a)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
continuous_on (cbox a b) (\<lambda>x. F (x, g1 x) \<bullet> i)
[PROOF STEP]
have 7: "(\<lambda>x. F(x, g1(x))  \<bullet> i) integrable_on (cbox a b)"
[PROOF STATE]
proof (prove)
using this:
continuous_on (cbox a b) (\<lambda>x. F (x, g1 x) \<bullet> i)

goal (1 subgoal):
 1. (\<lambda>x. F (x, g1 x) \<bullet> i) integrable_on cbox a b
[PROOF STEP]
using integrable_continuous [of "a" "b" "(\<lambda>x. F(x, g1(x))  \<bullet> i)"]
[PROOF STATE]
proof (prove)
using this:
continuous_on (cbox a b) (\<lambda>x. F (x, g1 x) \<bullet> i)
continuous_on (cbox a b) (\<lambda>x. F (x, g1 x) \<bullet> i) \<Longrightarrow> (\<lambda>x. F (x, g1 x) \<bullet> i) integrable_on cbox a b

goal (1 subgoal):
 1. (\<lambda>x. F (x, g1 x) \<bullet> i) integrable_on cbox a b
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<lambda>x. F (x, g1 x) \<bullet> i) integrable_on cbox a b

goal (1 subgoal):
 1. line_integral F {i} gamma1 + line_integral F {i} gamma2 - line_integral F {i} gamma3 - line_integral F {i} gamma4 = integral Dy_pair (\<lambda>a. - partial_vector_derivative (\<lambda>p. F p \<bullet> i) j a)
[PROOF STEP]
have partial_deriv_one_d_integrable:
    "((\<lambda>y. ?F_b'(xc, y)) has_integral
        F(xc,g1(xc)) \<bullet> i - F(xc, g2(xc)) \<bullet> i) (cbox (g2 xc) (g1 xc))"
     if "xc \<in> cbox a b" for xc
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>y. partial_vector_derivative (\<lambda>a. F a \<bullet> i) j (xc, y)) has_integral F (xc, g1 xc) \<bullet> i - F (xc, g2 xc) \<bullet> i) (cbox (g2 xc) (g1 xc))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ((\<lambda>y. partial_vector_derivative (\<lambda>a. F a \<bullet> i) j (xc, y)) has_integral F (xc, g1 xc) \<bullet> i - F (xc, g2 xc) \<bullet> i) (cbox (g2 xc) (g1 xc))
[PROOF STEP]
have "{(xc', y).  y \<in> cbox (g2 xc) (g1 xc) \<and> xc' = xc} \<subseteq> Dy_pair"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {(xc', y). y \<in> cbox (g2 xc) (g1 xc) \<and> xc' = xc} \<subseteq> Dy_pair
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
xc \<in> cbox a b

goal (1 subgoal):
 1. {(xc', y). y \<in> cbox (g2 xc) (g1 xc) \<and> xc' = xc} \<subseteq> Dy_pair
[PROOF STEP]
by (auto simp add: Dy_def)
[PROOF STATE]
proof (state)
this:
{(xc', y). y \<in> cbox (g2 xc) (g1 xc) \<and> xc' = xc} \<subseteq> Dy_pair

goal (1 subgoal):
 1. ((\<lambda>y. partial_vector_derivative (\<lambda>a. F a \<bullet> i) j (xc, y)) has_integral F (xc, g1 xc) \<bullet> i - F (xc, g2 xc) \<bullet> i) (cbox (g2 xc) (g1 xc))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
{(xc', y). y \<in> cbox (g2 xc) (g1 xc) \<and> xc' = xc} \<subseteq> Dy_pair
[PROOF STEP]
show "((\<lambda>y. ?F_b' (xc, y)) has_integral F(xc, g1 xc) \<bullet> i - F(xc, g2 xc) \<bullet> i) (cbox (g2 xc) (g1 xc))"
[PROOF STATE]
proof (prove)
using this:
{(xc', y). y \<in> cbox (g2 xc) (g1 xc) \<and> xc' = xc} \<subseteq> Dy_pair

goal (1 subgoal):
 1. ((\<lambda>y. partial_vector_derivative (\<lambda>a. F a \<bullet> i) j (xc, y)) has_integral F (xc, g1 xc) \<bullet> i - F (xc, g2 xc) \<bullet> i) (cbox (g2 xc) (g1 xc))
[PROOF STEP]
using that and Base_vecs and F_partially_differentiable
        and Dy_def [symmetric] and g2_leq_g1
        and fundamental_theorem_of_calculus_partial_vector
        [of "g2 xc" "g1 xc" "j" "i" "xc *\<^sub>R i" "Dy_pair" "F" "?F_b'" ]
[PROOF STATE]
proof (prove)
using this:
{(xc', y). y \<in> cbox (g2 xc) (g1 xc) \<and> xc' = xc} \<subseteq> Dy_pair
xc \<in> cbox a b
i \<in> Basis
j \<in> Basis
i \<noteq> j
\<forall>a\<in>Dy_pair. has_partial_vector_derivative (\<lambda>x. F x \<bullet> i) j (partial_vector_derivative (\<lambda>a. F a \<bullet> i) j a) a
{(x, y). x \<in> cbox a b \<and> y \<in> cbox (g2 x) (g1 x)} = Dy_pair
\<forall>x\<in>cbox a b. g2 x \<le> g1 x
\<lbrakk>g2 xc \<le> g1 xc; j \<in> Basis; i \<in> Basis; xc *\<^sub>R i \<bullet> j = 0; \<forall>p\<in>Dy_pair. has_partial_vector_derivative (\<lambda>x. F x \<bullet> i) j (partial_vector_derivative (\<lambda>a. F a \<bullet> i) j p) p; {x *\<^sub>R j + xc *\<^sub>R i |x. g2 xc \<le> x \<and> x \<le> g1 xc} \<subseteq> Dy_pair\<rbrakk> \<Longrightarrow> ((\<lambda>x. partial_vector_derivative (\<lambda>a. F a \<bullet> i) j (x *\<^sub>R j + xc *\<^sub>R i)) has_integral F (g1 xc *\<^sub>R j + xc *\<^sub>R i) \<bullet> i - F (g2 xc *\<^sub>R j + xc *\<^sub>R i) \<bullet> i) (cbox (g2 xc) (g1 xc))

goal (1 subgoal):
 1. ((\<lambda>y. partial_vector_derivative (\<lambda>a. F a \<bullet> i) j (xc, y)) has_integral F (xc, g1 xc) \<bullet> i - F (xc, g2 xc) \<bullet> i) (cbox (g2 xc) (g1 xc))
[PROOF STEP]
by (auto simp add:  Groups.ab_semigroup_add_class.add.commute i_is_x_axis j_is_y_axis)
[PROOF STATE]
proof (state)
this:
((\<lambda>y. partial_vector_derivative (\<lambda>a. F a \<bullet> i) j (xc, y)) has_integral F (xc, g1 xc) \<bullet> i - F (xc, g2 xc) \<bullet> i) (cbox (g2 xc) (g1 xc))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
?xc2 \<in> cbox a b \<Longrightarrow> ((\<lambda>y. partial_vector_derivative (\<lambda>a. F a \<bullet> i) j (?xc2, y)) has_integral F (?xc2, g1 ?xc2) \<bullet> i - F (?xc2, g2 ?xc2) \<bullet> i) (cbox (g2 ?xc2) (g1 ?xc2))

goal (1 subgoal):
 1. line_integral F {i} gamma1 + line_integral F {i} gamma2 - line_integral F {i} gamma3 - line_integral F {i} gamma4 = integral Dy_pair (\<lambda>a. - partial_vector_derivative (\<lambda>p. F p \<bullet> i) j a)
[PROOF STEP]
have partial_deriv_integrable: "(?F_b') integrable_on Dy_pair"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. partial_vector_derivative (\<lambda>a. F a \<bullet> i) j integrable_on Dy_pair
[PROOF STEP]
by (simp add: F_i_analytically_valid analytically_valid_imp_part_deriv_integrable_on)
[PROOF STATE]
proof (state)
this:
partial_vector_derivative (\<lambda>a. F a \<bullet> i) j integrable_on Dy_pair

goal (1 subgoal):
 1. line_integral F {i} gamma1 + line_integral F {i} gamma2 - line_integral F {i} gamma3 - line_integral F {i} gamma4 = integral Dy_pair (\<lambda>a. - partial_vector_derivative (\<lambda>p. F p \<bullet> i) j a)
[PROOF STEP]
have 4: "integral Dy_pair ?F_b'
           = integral (cbox a b) (\<lambda>x. integral (cbox (g2 x) (g1 x)) (\<lambda>y. ?F_b' (x, y)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral Dy_pair (partial_vector_derivative (\<lambda>a. F a \<bullet> i) j) = integral (cbox a b) (\<lambda>x. integral (cbox (g2 x) (g1 x)) (\<lambda>y. partial_vector_derivative (\<lambda>a. F a \<bullet> i) j (x, y)))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. integral Dy_pair (partial_vector_derivative (\<lambda>a. F a \<bullet> i) j) = integral (cbox a b) (\<lambda>x. integral (cbox (g2 x) (g1 x)) (\<lambda>y. partial_vector_derivative (\<lambda>a. F a \<bullet> i) j (x, y)))
[PROOF STEP]
have x_axis_gauge_integrable:
      "\<And>x. (\<lambda>y. ?f(x,y)) integrable_on UNIV"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. (\<lambda>y. if (x, y) \<in> Dy_pair then partial_vector_derivative (\<lambda>a. F a \<bullet> i) j (x, y) else 0) integrable_on UNIV
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. (\<lambda>y. if (x, y) \<in> Dy_pair then partial_vector_derivative (\<lambda>a. F a \<bullet> i) j (x, y) else 0) integrable_on UNIV
[PROOF STEP]
fix x::real
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. (\<lambda>y. if (x, y) \<in> Dy_pair then partial_vector_derivative (\<lambda>a. F a \<bullet> i) j (x, y) else 0) integrable_on UNIV
[PROOF STEP]
have "\<forall>x. x \<notin> cbox a b \<longrightarrow>  (\<lambda>y. ?f (x, y)) = (\<lambda>y. 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x. x \<notin> cbox a b \<longrightarrow> (\<lambda>y. if (x, y) \<in> Dy_pair then partial_vector_derivative (\<lambda>a. F a \<bullet> i) j (x, y) else 0) = (\<lambda>y. 0)
[PROOF STEP]
by (auto simp add: Dy_def)
[PROOF STATE]
proof (state)
this:
\<forall>x. x \<notin> cbox a b \<longrightarrow> (\<lambda>y. if (x, y) \<in> Dy_pair then partial_vector_derivative (\<lambda>a. F a \<bullet> i) j (x, y) else 0) = (\<lambda>y. 0)

goal (1 subgoal):
 1. \<And>x. (\<lambda>y. if (x, y) \<in> Dy_pair then partial_vector_derivative (\<lambda>a. F a \<bullet> i) j (x, y) else 0) integrable_on UNIV
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>x. x \<notin> cbox a b \<longrightarrow> (\<lambda>y. if (x, y) \<in> Dy_pair then partial_vector_derivative (\<lambda>a. F a \<bullet> i) j (x, y) else 0) = (\<lambda>y. 0)
[PROOF STEP]
have f_integrable_x_not_in_range:
        "\<forall>x. x \<notin> cbox a b \<longrightarrow>  (\<lambda>y. ?f (x, y)) integrable_on UNIV"
[PROOF STATE]
proof (prove)
using this:
\<forall>x. x \<notin> cbox a b \<longrightarrow> (\<lambda>y. if (x, y) \<in> Dy_pair then partial_vector_derivative (\<lambda>a. F a \<bullet> i) j (x, y) else 0) = (\<lambda>y. 0)

goal (1 subgoal):
 1. \<forall>x. x \<notin> cbox a b \<longrightarrow> (\<lambda>y. if (x, y) \<in> Dy_pair then partial_vector_derivative (\<lambda>a. F a \<bullet> i) j (x, y) else 0) integrable_on UNIV
[PROOF STEP]
by (simp add: integrable_0)
[PROOF STATE]
proof (state)
this:
\<forall>x. x \<notin> cbox a b \<longrightarrow> (\<lambda>y. if (x, y) \<in> Dy_pair then partial_vector_derivative (\<lambda>a. F a \<bullet> i) j (x, y) else 0) integrable_on UNIV

goal (1 subgoal):
 1. \<And>x. (\<lambda>y. if (x, y) \<in> Dy_pair then partial_vector_derivative (\<lambda>a. F a \<bullet> i) j (x, y) else 0) integrable_on UNIV
[PROOF STEP]
let ?F_b'_oneD = "(\<lambda>x. (\<lambda>y. if y \<in> (cbox (g2 x) ( g1 x)) then ?F_b' (x,y) else 0))"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. (\<lambda>y. if (x, y) \<in> Dy_pair then partial_vector_derivative (\<lambda>a. F a \<bullet> i) j (x, y) else 0) integrable_on UNIV
[PROOF STEP]
have f_value_x_in_range: "\<forall>x \<in> cbox a b. ?F_b'_oneD x = (\<lambda>y. ?f(x,y))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>cbox a b. (\<lambda>y. if y \<in> cbox (g2 x) (g1 x) then partial_vector_derivative (\<lambda>a. F a \<bullet> i) j (x, y) else 0) = (\<lambda>y. if (x, y) \<in> Dy_pair then partial_vector_derivative (\<lambda>a. F a \<bullet> i) j (x, y) else 0)
[PROOF STEP]
by (auto simp add: Dy_def)
[PROOF STATE]
proof (state)
this:
\<forall>x\<in>cbox a b. (\<lambda>y. if y \<in> cbox (g2 x) (g1 x) then partial_vector_derivative (\<lambda>a. F a \<bullet> i) j (x, y) else 0) = (\<lambda>y. if (x, y) \<in> Dy_pair then partial_vector_derivative (\<lambda>a. F a \<bullet> i) j (x, y) else 0)

goal (1 subgoal):
 1. \<And>x. (\<lambda>y. if (x, y) \<in> Dy_pair then partial_vector_derivative (\<lambda>a. F a \<bullet> i) j (x, y) else 0) integrable_on UNIV
[PROOF STEP]
have "\<forall>x \<in> cbox a b. ?F_b'_oneD x integrable_on UNIV"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>cbox a b. (\<lambda>y. if y \<in> cbox (g2 x) (g1 x) then partial_vector_derivative (\<lambda>a. F a \<bullet> i) j (x, y) else 0) integrable_on UNIV
[PROOF STEP]
using has_integral_integrable integrable_restrict_UNIV partial_deriv_one_d_integrable
[PROOF STATE]
proof (prove)
using this:
(?f has_integral ?i) ?s \<Longrightarrow> ?f integrable_on ?s
((\<lambda>x. if x \<in> ?s then ?f x else (0::?'a)) integrable_on UNIV) = (?f integrable_on ?s)
?xc2 \<in> cbox a b \<Longrightarrow> ((\<lambda>y. partial_vector_derivative (\<lambda>a. F a \<bullet> i) j (?xc2, y)) has_integral F (?xc2, g1 ?xc2) \<bullet> i - F (?xc2, g2 ?xc2) \<bullet> i) (cbox (g2 ?xc2) (g1 ?xc2))

goal (1 subgoal):
 1. \<forall>x\<in>cbox a b. (\<lambda>y. if y \<in> cbox (g2 x) (g1 x) then partial_vector_derivative (\<lambda>a. F a \<bullet> i) j (x, y) else 0) integrable_on UNIV
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<forall>x\<in>cbox a b. (\<lambda>y. if y \<in> cbox (g2 x) (g1 x) then partial_vector_derivative (\<lambda>a. F a \<bullet> i) j (x, y) else 0) integrable_on UNIV

goal (1 subgoal):
 1. \<And>x. (\<lambda>y. if (x, y) \<in> Dy_pair then partial_vector_derivative (\<lambda>a. F a \<bullet> i) j (x, y) else 0) integrable_on UNIV
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>x\<in>cbox a b. (\<lambda>y. if y \<in> cbox (g2 x) (g1 x) then partial_vector_derivative (\<lambda>a. F a \<bullet> i) j (x, y) else 0) integrable_on UNIV
[PROOF STEP]
have f_integrable_x_in_range:
        "\<forall>x. x \<in> cbox a b \<longrightarrow>  (\<lambda>y. ?f (x, y)) integrable_on UNIV"
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>cbox a b. (\<lambda>y. if y \<in> cbox (g2 x) (g1 x) then partial_vector_derivative (\<lambda>a. F a \<bullet> i) j (x, y) else 0) integrable_on UNIV

goal (1 subgoal):
 1. \<forall>x. x \<in> cbox a b \<longrightarrow> (\<lambda>y. if (x, y) \<in> Dy_pair then partial_vector_derivative (\<lambda>a. F a \<bullet> i) j (x, y) else 0) integrable_on UNIV
[PROOF STEP]
using f_value_x_in_range
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>cbox a b. (\<lambda>y. if y \<in> cbox (g2 x) (g1 x) then partial_vector_derivative (\<lambda>a. F a \<bullet> i) j (x, y) else 0) integrable_on UNIV
\<forall>x\<in>cbox a b. (\<lambda>y. if y \<in> cbox (g2 x) (g1 x) then partial_vector_derivative (\<lambda>a. F a \<bullet> i) j (x, y) else 0) = (\<lambda>y. if (x, y) \<in> Dy_pair then partial_vector_derivative (\<lambda>a. F a \<bullet> i) j (x, y) else 0)

goal (1 subgoal):
 1. \<forall>x. x \<in> cbox a b \<longrightarrow> (\<lambda>y. if (x, y) \<in> Dy_pair then partial_vector_derivative (\<lambda>a. F a \<bullet> i) j (x, y) else 0) integrable_on UNIV
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>x. x \<in> cbox a b \<longrightarrow> (\<lambda>y. if (x, y) \<in> Dy_pair then partial_vector_derivative (\<lambda>a. F a \<bullet> i) j (x, y) else 0) integrable_on UNIV

goal (1 subgoal):
 1. \<And>x. (\<lambda>y. if (x, y) \<in> Dy_pair then partial_vector_derivative (\<lambda>a. F a \<bullet> i) j (x, y) else 0) integrable_on UNIV
[PROOF STEP]
show "(\<lambda>y. ?f (x, y)) integrable_on UNIV"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>y. if (x, y) \<in> Dy_pair then partial_vector_derivative (\<lambda>a. F a \<bullet> i) j (x, y) else 0) integrable_on UNIV
[PROOF STEP]
using f_integrable_x_not_in_range and f_integrable_x_in_range
[PROOF STATE]
proof (prove)
using this:
\<forall>x. x \<notin> cbox a b \<longrightarrow> (\<lambda>y. if (x, y) \<in> Dy_pair then partial_vector_derivative (\<lambda>a. F a \<bullet> i) j (x, y) else 0) integrable_on UNIV
\<forall>x. x \<in> cbox a b \<longrightarrow> (\<lambda>y. if (x, y) \<in> Dy_pair then partial_vector_derivative (\<lambda>a. F a \<bullet> i) j (x, y) else 0) integrable_on UNIV

goal (1 subgoal):
 1. (\<lambda>y. if (x, y) \<in> Dy_pair then partial_vector_derivative (\<lambda>a. F a \<bullet> i) j (x, y) else 0) integrable_on UNIV
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<lambda>y. if (x, y) \<in> Dy_pair then partial_vector_derivative (\<lambda>a. F a \<bullet> i) j (x, y) else 0) integrable_on UNIV

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<lambda>y. if (?x2, y) \<in> Dy_pair then partial_vector_derivative (\<lambda>a. F a \<bullet> i) j (?x2, y) else 0) integrable_on UNIV

goal (1 subgoal):
 1. integral Dy_pair (partial_vector_derivative (\<lambda>a. F a \<bullet> i) j) = integral (cbox a b) (\<lambda>x. integral (cbox (g2 x) (g1 x)) (\<lambda>y. partial_vector_derivative (\<lambda>a. F a \<bullet> i) j (x, y)))
[PROOF STEP]
have arg: "(\<lambda>a. if a \<in> Dy_pair then partial_vector_derivative (\<lambda>a. F a \<bullet> i) j a else 0) =
               (\<lambda>x. if x \<in> Dy_pair then if x \<in> Dy_pair then partial_vector_derivative (\<lambda>a. F a \<bullet> i) j x else 0 else 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>a. if a \<in> Dy_pair then partial_vector_derivative (\<lambda>a. F a \<bullet> i) j a else 0) = (\<lambda>x. if x \<in> Dy_pair then if x \<in> Dy_pair then partial_vector_derivative (\<lambda>a. F a \<bullet> i) j x else 0 else 0)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<lambda>a. if a \<in> Dy_pair then partial_vector_derivative (\<lambda>a. F a \<bullet> i) j a else 0) = (\<lambda>x. if x \<in> Dy_pair then if x \<in> Dy_pair then partial_vector_derivative (\<lambda>a. F a \<bullet> i) j x else 0 else 0)

goal (1 subgoal):
 1. integral Dy_pair (partial_vector_derivative (\<lambda>a. F a \<bullet> i) j) = integral (cbox a b) (\<lambda>x. integral (cbox (g2 x) (g1 x)) (\<lambda>y. partial_vector_derivative (\<lambda>a. F a \<bullet> i) j (x, y)))
[PROOF STEP]
have arg2: "Dy_pair = {(x, y). (\<forall>i\<in>Basis. a \<bullet> i \<le> x \<bullet> i \<and> x \<bullet> i \<le> b \<bullet> i) \<and> (\<forall>i\<in>Basis. g2 x \<bullet> i \<le> y \<bullet> i \<and> y \<bullet> i \<le> g1 x \<bullet> i)}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Dy_pair = {(x, y). (\<forall>i\<in>Basis. a \<bullet> i \<le> x \<bullet> i \<and> x \<bullet> i \<le> b \<bullet> i) \<and> (\<forall>i\<in>Basis. g2 x \<bullet> i \<le> y \<bullet> i \<and> y \<bullet> i \<le> g1 x \<bullet> i)}
[PROOF STEP]
using Dy_def
[PROOF STATE]
proof (prove)
using this:
Dy_pair = {(x, y). x \<in> cbox a b \<and> y \<in> cbox (g2 x) (g1 x)}

goal (1 subgoal):
 1. Dy_pair = {(x, y). (\<forall>i\<in>Basis. a \<bullet> i \<le> x \<bullet> i \<and> x \<bullet> i \<le> b \<bullet> i) \<and> (\<forall>i\<in>Basis. g2 x \<bullet> i \<le> y \<bullet> i \<and> y \<bullet> i \<le> g1 x \<bullet> i)}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Dy_pair = {(x, y). (\<forall>i\<in>Basis. a \<bullet> i \<le> x \<bullet> i \<and> x \<bullet> i \<le> b \<bullet> i) \<and> (\<forall>i\<in>Basis. g2 x \<bullet> i \<le> y \<bullet> i \<and> y \<bullet> i \<le> g1 x \<bullet> i)}

goal (1 subgoal):
 1. integral Dy_pair (partial_vector_derivative (\<lambda>a. F a \<bullet> i) j) = integral (cbox a b) (\<lambda>x. integral (cbox (g2 x) (g1 x)) (\<lambda>y. partial_vector_derivative (\<lambda>a. F a \<bullet> i) j (x, y)))
[PROOF STEP]
have arg3: "\<And> x. x \<in> Dy_pair \<Longrightarrow> (\<lambda>x. if x \<in> Dy_pair then partial_vector_derivative (\<lambda>a. F a \<bullet> i) j x else 0) x
                           = (\<lambda>x. partial_vector_derivative (\<lambda>a. F a \<bullet> i) j x) x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. x \<in> Dy_pair \<Longrightarrow> (if x \<in> Dy_pair then partial_vector_derivative (\<lambda>a. F a \<bullet> i) j x else 0) = partial_vector_derivative (\<lambda>a. F a \<bullet> i) j x
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
?x2 \<in> Dy_pair \<Longrightarrow> (if ?x2 \<in> Dy_pair then partial_vector_derivative (\<lambda>a. F a \<bullet> i) j ?x2 else 0) = partial_vector_derivative (\<lambda>a. F a \<bullet> i) j ?x2

goal (1 subgoal):
 1. integral Dy_pair (partial_vector_derivative (\<lambda>a. F a \<bullet> i) j) = integral (cbox a b) (\<lambda>x. integral (cbox (g2 x) (g1 x)) (\<lambda>y. partial_vector_derivative (\<lambda>a. F a \<bullet> i) j (x, y)))
[PROOF STEP]
have arg4: "\<And>x. x \<in> (cbox a b) \<Longrightarrow>
                            (\<lambda>x. integral (cbox (g2 x) (g1 x)) (\<lambda>y. if (x, y) \<in> Dy_pair then partial_vector_derivative (\<lambda>a. F a \<bullet> i) j (x, y) else 0)) x =
                                      (\<lambda>x. integral (cbox (g2 x) (g1 x)) (\<lambda>y. partial_vector_derivative (\<lambda>a. F a \<bullet> i) j (x, y))) x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. x \<in> cbox a b \<Longrightarrow> integral (cbox (g2 x) (g1 x)) (\<lambda>y. if (x, y) \<in> Dy_pair then partial_vector_derivative (\<lambda>a. F a \<bullet> i) j (x, y) else 0) = integral (cbox (g2 x) (g1 x)) (\<lambda>y. partial_vector_derivative (\<lambda>a. F a \<bullet> i) j (x, y))
[PROOF STEP]
apply (simp add: Dy_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. a \<le> x \<and> x \<le> b \<Longrightarrow> integral {g2 x..g1 x} (\<lambda>y. if g2 x \<le> y \<and> y \<le> g1 x then partial_vector_derivative (\<lambda>a. F a \<bullet> i) j (x, y) else 0) = integral {g2 x..g1 x} (\<lambda>y. partial_vector_derivative (\<lambda>a. F a \<bullet> i) j (x, y))
[PROOF STEP]
by (smt Henstock_Kurzweil_Integration.integral_cong atLeastAtMost_iff)
[PROOF STATE]
proof (state)
this:
?x2 \<in> cbox a b \<Longrightarrow> integral (cbox (g2 ?x2) (g1 ?x2)) (\<lambda>y. if (?x2, y) \<in> Dy_pair then partial_vector_derivative (\<lambda>a. F a \<bullet> i) j (?x2, y) else 0) = integral (cbox (g2 ?x2) (g1 ?x2)) (\<lambda>y. partial_vector_derivative (\<lambda>a. F a \<bullet> i) j (?x2, y))

goal (1 subgoal):
 1. integral Dy_pair (partial_vector_derivative (\<lambda>a. F a \<bullet> i) j) = integral (cbox a b) (\<lambda>x. integral (cbox (g2 x) (g1 x)) (\<lambda>y. partial_vector_derivative (\<lambda>a. F a \<bullet> i) j (x, y)))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral Dy_pair (partial_vector_derivative (\<lambda>a. F a \<bullet> i) j) = integral (cbox a b) (\<lambda>x. integral (cbox (g2 x) (g1 x)) (\<lambda>y. partial_vector_derivative (\<lambda>a. F a \<bullet> i) j (x, y)))
[PROOF STEP]
using gauge_integral_Fubini_curve_bounded_region_x
        [OF f_lesbegue_integrable x_axis_gauge_integrable x_axis_integral_measurable arg arg2]
        Henstock_Kurzweil_Integration.integral_cong[OF arg3, of "Dy_pair" "(\<lambda>x. x)"]
        Henstock_Kurzweil_Integration.integral_cong[OF arg4, of "cbox a b" "(\<lambda>x. x)"]
[PROOF STATE]
proof (prove)
using this:
integral Dy_pair (\<lambda>x. if x \<in> Dy_pair then partial_vector_derivative (\<lambda>a. F a \<bullet> i) j x else 0) = integral (cbox a b) (\<lambda>x. integral (cbox (g2 x) (g1 x)) (\<lambda>y. if (x, y) \<in> Dy_pair then partial_vector_derivative (\<lambda>a. F a \<bullet> i) j (x, y) else 0))
(\<And>x. x \<in> Dy_pair \<Longrightarrow> x \<in> Dy_pair) \<Longrightarrow> integral Dy_pair (\<lambda>x. if x \<in> Dy_pair then partial_vector_derivative (\<lambda>a. F a \<bullet> i) j x else 0) = integral Dy_pair (partial_vector_derivative (\<lambda>a. F a \<bullet> i) j)
(\<And>x. x \<in> cbox a b \<Longrightarrow> x \<in> cbox a b) \<Longrightarrow> integral (cbox a b) (\<lambda>x. integral (cbox (g2 x) (g1 x)) (\<lambda>y. if (x, y) \<in> Dy_pair then partial_vector_derivative (\<lambda>a. F a \<bullet> i) j (x, y) else 0)) = integral (cbox a b) (\<lambda>x. integral (cbox (g2 x) (g1 x)) (\<lambda>y. partial_vector_derivative (\<lambda>a. F a \<bullet> i) j (x, y)))

goal (1 subgoal):
 1. integral Dy_pair (partial_vector_derivative (\<lambda>a. F a \<bullet> i) j) = integral (cbox a b) (\<lambda>x. integral (cbox (g2 x) (g1 x)) (\<lambda>y. partial_vector_derivative (\<lambda>a. F a \<bullet> i) j (x, y)))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
integral Dy_pair (partial_vector_derivative (\<lambda>a. F a \<bullet> i) j) = integral (cbox a b) (\<lambda>x. integral (cbox (g2 x) (g1 x)) (\<lambda>y. partial_vector_derivative (\<lambda>a. F a \<bullet> i) j (x, y)))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
integral Dy_pair (partial_vector_derivative (\<lambda>a. F a \<bullet> i) j) = integral (cbox a b) (\<lambda>x. integral (cbox (g2 x) (g1 x)) (\<lambda>y. partial_vector_derivative (\<lambda>a. F a \<bullet> i) j (x, y)))

goal (1 subgoal):
 1. line_integral F {i} gamma1 + line_integral F {i} gamma2 - line_integral F {i} gamma3 - line_integral F {i} gamma4 = integral Dy_pair (\<lambda>a. - partial_vector_derivative (\<lambda>p. F p \<bullet> i) j a)
[PROOF STEP]
have 5: "(integral Dy_pair (\<lambda>a. (?F_b' a))
        = integral (cbox a b) (\<lambda>x. F(x, g1(x))  \<bullet> i - F(x, g2(x))  \<bullet> i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral Dy_pair (partial_vector_derivative (\<lambda>a. F a \<bullet> i) j) = integral (cbox a b) (\<lambda>x. F (x, g1 x) \<bullet> i - F (x, g2 x) \<bullet> i)
[PROOF STEP]
using 4 Henstock_Kurzweil_Integration.integral_cong partial_deriv_one_d_integrable integrable_def
[PROOF STATE]
proof (prove)
using this:
integral Dy_pair (partial_vector_derivative (\<lambda>a. F a \<bullet> i) j) = integral (cbox a b) (\<lambda>x. integral (cbox (g2 x) (g1 x)) (\<lambda>y. partial_vector_derivative (\<lambda>a. F a \<bullet> i) j (x, y)))
(\<And>x. x \<in> ?s \<Longrightarrow> ?f x = ?g x) \<Longrightarrow> integral ?s ?f = integral ?s ?g
?xc2 \<in> cbox a b \<Longrightarrow> ((\<lambda>y. partial_vector_derivative (\<lambda>a. F a \<bullet> i) j (?xc2, y)) has_integral F (?xc2, g1 ?xc2) \<bullet> i - F (?xc2, g2 ?xc2) \<bullet> i) (cbox (g2 ?xc2) (g1 ?xc2))
integrable \<equiv> \<lambda>M f. lfp (\<lambda>p. \<exists>x. has_bochner_integral M f x)

goal (1 subgoal):
 1. integral Dy_pair (partial_vector_derivative (\<lambda>a. F a \<bullet> i) j) = integral (cbox a b) (\<lambda>x. F (x, g1 x) \<bullet> i - F (x, g2 x) \<bullet> i)
[PROOF STEP]
by (smt integral_unique)
[PROOF STATE]
proof (state)
this:
integral Dy_pair (partial_vector_derivative (\<lambda>a. F a \<bullet> i) j) = integral (cbox a b) (\<lambda>x. F (x, g1 x) \<bullet> i - F (x, g2 x) \<bullet> i)

goal (1 subgoal):
 1. line_integral F {i} gamma1 + line_integral F {i} gamma2 - line_integral F {i} gamma3 - line_integral F {i} gamma4 = integral Dy_pair (\<lambda>a. - partial_vector_derivative (\<lambda>p. F p \<bullet> i) j a)
[PROOF STEP]
show "(line_integral F {i} gamma1) + (line_integral F {i} gamma2) -
          (line_integral F {i} gamma3) - (line_integral F {i} gamma4)
        = (integral Dy_pair (\<lambda>a. - (?F_b' a)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. line_integral F {i} gamma1 + line_integral F {i} gamma2 - line_integral F {i} gamma3 - line_integral F {i} gamma4 = integral Dy_pair (\<lambda>a. - partial_vector_derivative (\<lambda>a. F a \<bullet> i) j a)
[PROOF STEP]
using "0"(1) "1"(1) "2"(1) "3"(1) 5 "6" "7"
[PROOF STATE]
proof (prove)
using this:
line_integral F {i} gamma1 = integral (cbox a b) (\<lambda>x. F (x, g2 x) \<bullet> i)
line_integral F {i} gamma2 = 0
line_integral F {i} gamma3 = integral (cbox a b) (\<lambda>x. F (x, g1 x) \<bullet> i)
line_integral F {i} gamma4 = 0
integral Dy_pair (partial_vector_derivative (\<lambda>a. F a \<bullet> i) j) = integral (cbox a b) (\<lambda>x. F (x, g1 x) \<bullet> i - F (x, g2 x) \<bullet> i)
(\<lambda>x. F (x, g2 x) \<bullet> i) integrable_on cbox a b
(\<lambda>x. F (x, g1 x) \<bullet> i) integrable_on cbox a b

goal (1 subgoal):
 1. line_integral F {i} gamma1 + line_integral F {i} gamma2 - line_integral F {i} gamma3 - line_integral F {i} gamma4 = integral Dy_pair (\<lambda>a. - partial_vector_derivative (\<lambda>a. F a \<bullet> i) j a)
[PROOF STEP]
by (simp add: Henstock_Kurzweil_Integration.integral_diff)
[PROOF STATE]
proof (state)
this:
line_integral F {i} gamma1 + line_integral F {i} gamma2 - line_integral F {i} gamma3 - line_integral F {i} gamma4 = integral Dy_pair (\<lambda>a. - partial_vector_derivative (\<lambda>a. F a \<bullet> i) j a)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Rats_eq_range_of_rat_o_nat_to_rat_surj:
  "\<rat> = range (of_rat \<circ> nat_to_rat_surj)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. field_char_0.Rats (/) (1::'a) (+) (0::'a) (-) = range (field_char_0.of_rat (/) (1::'a) (+) (0::'a) (-) \<circ> nat_to_rat_surj)
[PROOF STEP]
using surj_nat_to_rat_surj
[PROOF STATE]
proof (prove)
using this:
surj nat_to_rat_surj

goal (1 subgoal):
 1. field_char_0.Rats (/) (1::'a) (+) (0::'a) (-) = range (field_char_0.of_rat (/) (1::'a) (+) (0::'a) (-) \<circ> nat_to_rat_surj)
[PROOF STEP]
by (auto simp: Rats_def image_def surj_def) (blast intro: arg_cong[where f = of_rat])


[STATEMENT]
lemma fst_snd_arg_min_on: fixes p::"'a \<Rightarrow> 'b::linorder"
  assumes "finite B" "inj_on p B" "B \<noteq> {}"
  shows   "fst (arg_min_on snd ((\<lambda>x. (x, p x)) ` B)) = arg_min_on p B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fst (arg_min_on snd ((\<lambda>x. (x, p x)) ` B)) = arg_min_on p B
[PROOF STEP]
by (subst arg_min_on_image_finite [OF inj_on_imageI])
     (auto simp: o_def assms)


[STATEMENT]
lemma "(\<forall>x. P x \<and> (Q x \<or> R x)\<longrightarrow>S x) \<and>
      (\<forall>x. S x \<and> R x \<longrightarrow> L x) \<and>
      (\<forall>x. M x \<longrightarrow> R x)
    \<longrightarrow> (\<forall>x. P x \<and> M x \<longrightarrow> L x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>x. P x \<and> (Q x \<or> R x) \<longrightarrow> S x) \<and> (\<forall>x. S x \<and> R x \<longrightarrow> L x) \<and> (\<forall>x. M x \<longrightarrow> R x) \<longrightarrow> (\<forall>x. P x \<and> M x \<longrightarrow> L x)
[PROOF STEP]
by blast


[STATEMENT]
lemma \<K>_power_bound :
  assumes "0 < k"
shows " \<K>^k \<le> k * max_len"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<K> ^ k \<le> real (k * max_len)
[PROOF STEP]
using assms \<K>_power \<K>_rw \<K>_rw2
[PROOF STATE]
proof (prove)
using this:
0 < k
\<K> ^ ?k = (\<Sum>w | length w = ?k \<and> set w \<subseteq> L. 1 / b ^ cw_len_concat w)
(\<Sum>w | length w = ?k \<and> set w \<subseteq> L. 1 / b ^ cw_len_concat w) = (\<Sum>m = 0..<Suc (?k * max_len). real (card ({w. length w = ?k \<and> set w \<subseteq> L} \<inter> cw_len_concat -` {m})) * (1 / b ^ m))
0 < ?k \<Longrightarrow> (\<Sum>m = 0..<Suc (?k * max_len). real (card (set_of_k_words_length_m ?k m)) / b ^ m) \<le> real (?k * max_len)

goal (1 subgoal):
 1. \<K> ^ k \<le> real (k * max_len)
[PROOF STEP]
by (simp add: set_of_k_words_length_m_def)


[STATEMENT]
lemma dropWhile_dropWhile2: "(\<And>x. P x \<Longrightarrow> Q x) \<Longrightarrow> takeWhile P (takeWhile Q xs) = takeWhile P xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>x. P x \<Longrightarrow> Q x) \<Longrightarrow> takeWhile P (takeWhile Q xs) = takeWhile P xs
[PROOF STEP]
by(induct xs) simp_all


[STATEMENT]
lemma equiv_iff_eq[simp]: "x \<in> A \<Longrightarrow> y \<in> A \<Longrightarrow> x \<simeq> y \<longleftrightarrow> x = y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<in> A; y \<in> A\<rbrakk> \<Longrightarrow> (x \<simeq> y) = (x = y)
[PROOF STEP]
by (auto dest: antisym elim: equivpartpE)


[STATEMENT]
lemma AboveS_not_empty_in_regularCard':
  assumes "|S| <o r" "f`S \<subseteq> Field r" "T \<subseteq> S"
  assumes r: "Card_order r" "regularCard r" "\<not>finite (Field r)"
  shows "AboveS r (f`T) \<noteq> {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. AboveS r (f ` T) \<noteq> {}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. AboveS r (f ` T) \<noteq> {}
[PROOF STEP]
have "|f`T| \<le>o |T|"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. |f ` T| \<le>o |T|
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
|f ` T| \<le>o |T|

goal (1 subgoal):
 1. AboveS r (f ` T) \<noteq> {}
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
|f ` T| \<le>o |T|

goal (1 subgoal):
 1. AboveS r (f ` T) \<noteq> {}
[PROOF STEP]
have "|T| \<le>o |S|"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. |T| \<le>o |S|
[PROOF STEP]
using \<open>T \<subseteq> S\<close>
[PROOF STATE]
proof (prove)
using this:
T \<subseteq> S

goal (1 subgoal):
 1. |T| \<le>o |S|
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
|T| \<le>o |S|

goal (1 subgoal):
 1. AboveS r (f ` T) \<noteq> {}
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
|f ` T| \<le>o |T|
|T| \<le>o |S|
[PROOF STEP]
have *: "|f`T| <o r"
[PROOF STATE]
proof (prove)
using this:
|f ` T| \<le>o |T|
|T| \<le>o |S|

goal (1 subgoal):
 1. |f ` T| <o r
[PROOF STEP]
using \<open>|S| <o r\<close>
[PROOF STATE]
proof (prove)
using this:
|f ` T| \<le>o |T|
|T| \<le>o |S|
|S| <o r

goal (1 subgoal):
 1. |f ` T| <o r
[PROOF STEP]
by (meson ordLeq_ordLess_trans)
[PROOF STATE]
proof (state)
this:
|f ` T| <o r

goal (1 subgoal):
 1. AboveS r (f ` T) \<noteq> {}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. AboveS r (f ` T) \<noteq> {}
[PROOF STEP]
using AboveS_not_empty_in_regularCard[OF * _ r] \<open>T \<subseteq> S\<close> \<open>f`S \<subseteq> Field r\<close>
[PROOF STATE]
proof (prove)
using this:
f ` T \<subseteq> Field r \<Longrightarrow> AboveS r (f ` T) \<noteq> {}
T \<subseteq> S
f ` S \<subseteq> Field r

goal (1 subgoal):
 1. AboveS r (f ` T) \<noteq> {}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
AboveS r (f ` T) \<noteq> {}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma fps_deriv_fps_integral:
  fixes a :: "'a::{division_ring,ring_char_0} fps"
  shows "fps_deriv (fps_integral a a0) = a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fps_deriv (fps_integral a a0) = a
[PROOF STEP]
proof (intro fps_ext)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. fps_deriv (fps_integral a a0) $ n = a $ n
[PROOF STEP]
fix n
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. fps_deriv (fps_integral a a0) $ n = a $ n
[PROOF STEP]
have "(of_nat (Suc n) :: 'a) \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. of_nat (Suc n) \<noteq> (0::'a)
[PROOF STEP]
by (rule of_nat_neq_0)
[PROOF STATE]
proof (state)
this:
of_nat (Suc n) \<noteq> (0::'a)

goal (1 subgoal):
 1. \<And>n. fps_deriv (fps_integral a a0) $ n = a $ n
[PROOF STEP]
hence "of_nat (Suc n) * inverse (of_nat (Suc n) :: 'a) = 1"
[PROOF STATE]
proof (prove)
using this:
of_nat (Suc n) \<noteq> (0::'a)

goal (1 subgoal):
 1. of_nat (Suc n) * inverse (of_nat (Suc n)) = (1::'a)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
of_nat (Suc n) * inverse (of_nat (Suc n)) = (1::'a)

goal (1 subgoal):
 1. \<And>n. fps_deriv (fps_integral a a0) $ n = a $ n
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
of_nat (Suc n) * inverse (of_nat (Suc n)) = (1::'a)

goal (1 subgoal):
 1. \<And>n. fps_deriv (fps_integral a a0) $ n = a $ n
[PROOF STEP]
have
    "fps_deriv (fps_integral a a0) $ n = of_nat (Suc n) * inverse (of_nat (Suc n)) * a $ n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fps_deriv (fps_integral a a0) $ n = of_nat (Suc n) * inverse (of_nat (Suc n)) * a $ n
[PROOF STEP]
by (simp add: mult.assoc)
[PROOF STATE]
proof (state)
this:
fps_deriv (fps_integral a a0) $ n = of_nat (Suc n) * inverse (of_nat (Suc n)) * a $ n

goal (1 subgoal):
 1. \<And>n. fps_deriv (fps_integral a a0) $ n = a $ n
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
of_nat (Suc n) * inverse (of_nat (Suc n)) = (1::'a)
fps_deriv (fps_integral a a0) $ n = of_nat (Suc n) * inverse (of_nat (Suc n)) * a $ n
[PROOF STEP]
show "fps_deriv (fps_integral a a0) $ n = a $ n"
[PROOF STATE]
proof (prove)
using this:
of_nat (Suc n) * inverse (of_nat (Suc n)) = (1::'a)
fps_deriv (fps_integral a a0) $ n = of_nat (Suc n) * inverse (of_nat (Suc n)) * a $ n

goal (1 subgoal):
 1. fps_deriv (fps_integral a a0) $ n = a $ n
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
fps_deriv (fps_integral a a0) $ n = a $ n

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem T8: "|~ \<circle>(F \<and> G) = (\<circle>F \<and> \<circle>G)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. |~ \<circle>(F \<and> G) = (\<circle>F \<and> \<circle>G)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. |~ \<circle>(F \<and> G) = (\<circle>F \<and> \<circle>G)
[PROOF STEP]
have "|~ \<circle>(F \<and> G) \<longrightarrow> \<circle>F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. |~ \<circle>(F \<and> G) \<longrightarrow> \<circle>F
[PROOF STEP]
by (rule N1) auto
[PROOF STATE]
proof (state)
this:
|~ \<circle>(F \<and> G) \<longrightarrow> \<circle>F

goal (1 subgoal):
 1. |~ \<circle>(F \<and> G) = (\<circle>F \<and> \<circle>G)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
|~ \<circle>(F \<and> G) \<longrightarrow> \<circle>F

goal (1 subgoal):
 1. |~ \<circle>(F \<and> G) = (\<circle>F \<and> \<circle>G)
[PROOF STEP]
have "|~ \<circle>(F \<and> G) \<longrightarrow> \<circle>G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. |~ \<circle>(F \<and> G) \<longrightarrow> \<circle>G
[PROOF STEP]
by (rule N1) auto
[PROOF STATE]
proof (state)
this:
|~ \<circle>(F \<and> G) \<longrightarrow> \<circle>G

goal (1 subgoal):
 1. |~ \<circle>(F \<and> G) = (\<circle>F \<and> \<circle>G)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
|~ \<circle>(F \<and> G) \<longrightarrow> \<circle>G

goal (1 subgoal):
 1. |~ \<circle>(F \<and> G) = (\<circle>F \<and> \<circle>G)
[PROOF STEP]
have "\<turnstile> F \<longrightarrow> G \<longrightarrow> F \<and> G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<turnstile> F \<longrightarrow> G \<longrightarrow> F \<and> G
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<turnstile> F \<longrightarrow> G \<longrightarrow> F \<and> G

goal (1 subgoal):
 1. |~ \<circle>(F \<and> G) = (\<circle>F \<and> \<circle>G)
[PROOF STEP]
from nex[OF this]
[PROOF STATE]
proof (chain)
picking this:
|~ \<circle>(F \<longrightarrow> G \<longrightarrow> F \<and> G)
[PROOF STEP]
have "|~ \<circle>F \<longrightarrow> \<circle>G \<longrightarrow> \<circle>(F \<and> G)"
[PROOF STATE]
proof (prove)
using this:
|~ \<circle>(F \<longrightarrow> G \<longrightarrow> F \<and> G)

goal (1 subgoal):
 1. |~ \<circle>F \<longrightarrow> \<circle>G \<longrightarrow> \<circle>(F \<and> G)
[PROOF STEP]
by (force intro: pax2[unlift_rule])
[PROOF STATE]
proof (state)
this:
|~ \<circle>F \<longrightarrow> \<circle>G \<longrightarrow> \<circle>(F \<and> G)

goal (1 subgoal):
 1. |~ \<circle>(F \<and> G) = (\<circle>F \<and> \<circle>G)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
|~ \<circle>(F \<and> G) \<longrightarrow> \<circle>F
|~ \<circle>(F \<and> G) \<longrightarrow> \<circle>G
|~ \<circle>F \<longrightarrow> \<circle>G \<longrightarrow> \<circle>(F \<and> G)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
|~ \<circle>(F \<and> G) \<longrightarrow> \<circle>F
|~ \<circle>(F \<and> G) \<longrightarrow> \<circle>G
|~ \<circle>F \<longrightarrow> \<circle>G \<longrightarrow> \<circle>(F \<and> G)

goal (1 subgoal):
 1. |~ \<circle>(F \<and> G) = (\<circle>F \<and> \<circle>G)
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
|~ \<circle>(F \<and> G) = (\<circle>F \<and> \<circle>G)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma subcs_psubst: \<open>(\<forall>x \<in> (\<Union>p \<in> set z. params p). x \<noteq> c \<longrightarrow> f x \<noteq> f c) \<Longrightarrow>
    map (psubst f) (subcs c s z) = subcs (f c) (psubstt f s) (map (psubst f) z)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>\<Union> (params ` set z). x \<noteq> c \<longrightarrow> f x \<noteq> f c \<Longrightarrow> map (psubst f) (subcs c s z) = subcs (f c) (psubstt f s) (map (psubst f) z)
[PROOF STEP]
by (induct z) (simp_all add: subc_psubst)


[STATEMENT]
lemma drop_zip: "drop n (zip xs ys) = zip (drop n xs) (drop n ys)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. drop n (zip xs ys) = zip (drop n xs) (drop n ys)
[PROOF STEP]
proof (induct n arbitrary: xs ys)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>xs ys. drop 0 (zip xs ys) = zip (drop 0 xs) (drop 0 ys)
 2. \<And>n xs ys. (\<And>xs ys. drop n (zip xs ys) = zip (drop n xs) (drop n ys)) \<Longrightarrow> drop (Suc n) (zip xs ys) = zip (drop (Suc n) xs) (drop (Suc n) ys)
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:

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

goal (1 subgoal):
 1. \<And>n xs ys. (\<And>xs ys. drop n (zip xs ys) = zip (drop n xs) (drop n ys)) \<Longrightarrow> drop (Suc n) (zip xs ys) = zip (drop (Suc n) xs) (drop (Suc n) ys)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n xs ys. (\<And>xs ys. drop n (zip xs ys) = zip (drop n xs) (drop n ys)) \<Longrightarrow> drop (Suc n) (zip xs ys) = zip (drop (Suc n) xs) (drop (Suc n) ys)
[PROOF STEP]
case Suc
[PROOF STATE]
proof (state)
this:
drop n_ (zip ?xs ?ys) = zip (drop n_ ?xs) (drop n_ ?ys)

goal (1 subgoal):
 1. \<And>n xs ys. (\<And>xs ys. drop n (zip xs ys) = zip (drop n xs) (drop n ys)) \<Longrightarrow> drop (Suc n) (zip xs ys) = zip (drop (Suc n) xs) (drop (Suc n) ys)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
drop n_ (zip ?xs ?ys) = zip (drop n_ ?xs) (drop n_ ?ys)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
drop n_ (zip ?xs ?ys) = zip (drop n_ ?xs) (drop n_ ?ys)

goal (1 subgoal):
 1. drop (Suc n_) (zip xs ys) = zip (drop (Suc n_) xs) (drop (Suc n_) ys)
[PROOF STEP]
by (cases xs; cases ys) simp_all
[PROOF STATE]
proof (state)
this:
drop (Suc n_) (zip xs ys) = zip (drop (Suc n_) xs) (drop (Suc n_) ys)

goal:
No subgoals!
[PROOF STEP]
qed