[STATEMENT]
theorem Greens_thm_type_II:
  fixes F:: "((real*real) \<Rightarrow> (real * real))" and
    gamma4 gamma3 gamma2 gamma1 :: "(real \<Rightarrow> (real * real))" and
    a:: "real" and b:: "real" and
    g1:: "(real \<Rightarrow> real)" and g2:: "(real \<Rightarrow> real)"
  assumes Dx_def: "Dx_pair = {(x::real,y) . y \<in> cbox a b \<and> x \<in> cbox (g2 y) (g1 y)}" and
    gamma4_def: "gamma4 = (\<lambda>x. (g2(a + (b - a) * x), a + (b - a) * x))" and
    gamma4_smooth: "gamma4 piecewise_C1_differentiable_on {0..1}" and (*TODO: This should be piecewise smooth*)
    gamma3_def: "gamma3 = (\<lambda>x. (g2(b) + x  *\<^sub>R (g1(b) - g2(b)), b))" and
    gamma2_def: "gamma2 = (\<lambda>x. (g1(a + (b - a) * x), a + (b - a) * x))" and
    gamma2_smooth: "gamma2 piecewise_C1_differentiable_on {0..1}" and
    gamma1_def: "gamma1 = (\<lambda>x. (g2(a) + x *\<^sub>R (g1(a) - g2(a)), a))" and
    F_j_analytically_valid: "analytically_valid Dx_pair (\<lambda>p. F(p) \<bullet> j) i" 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 {j} gamma4) -
         (line_integral F {j} gamma3) +
         (line_integral F {j} gamma2) +
         (line_integral F {j} gamma1)
                 = (integral Dx_pair (\<lambda>a. (partial_vector_derivative (\<lambda>a. (F a) \<bullet> j)  i a)))"
    "line_integral_exists F {j} gamma4"
    "line_integral_exists F {j} gamma3"
    "line_integral_exists F {j} gamma2"
    "line_integral_exists F {j} gamma1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (- line_integral F {j} gamma4 - line_integral F {j} gamma3 + line_integral F {j} gamma2 + line_integral F {j} gamma1 = integral Dx_pair (partial_vector_derivative (\<lambda>a. F a \<bullet> j) i) &&& line_integral_exists F {j} gamma4) &&& line_integral_exists F {j} gamma3 &&& line_integral_exists F {j} gamma2 &&& line_integral_exists F {j} gamma1
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (5 subgoals):
 1. - line_integral F {j} gamma4 - line_integral F {j} gamma3 + line_integral F {j} gamma2 + line_integral F {j} gamma1 = integral Dx_pair (partial_vector_derivative (\<lambda>a. F a \<bullet> j) i)
 2. line_integral_exists F {j} gamma4
 3. line_integral_exists F {j} gamma3
 4. line_integral_exists F {j} gamma2
 5. line_integral_exists F {j} gamma1
[PROOF STEP]
let ?F_a' = "partial_vector_derivative (\<lambda>a. (F a) \<bullet> j)  i"
[PROOF STATE]
proof (state)
goal (5 subgoals):
 1. - line_integral F {j} gamma4 - line_integral F {j} gamma3 + line_integral F {j} gamma2 + line_integral F {j} gamma1 = integral Dx_pair (partial_vector_derivative (\<lambda>a. F a \<bullet> j) i)
 2. line_integral_exists F {j} gamma4
 3. line_integral_exists F {j} gamma3
 4. line_integral_exists F {j} gamma2
 5. line_integral_exists F {j} gamma1
[PROOF STEP]
have F_first_is_continuous: "continuous_on Dx_pair (\<lambda>a. F(a) \<bullet> j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on Dx_pair (\<lambda>a. F a \<bullet> j)
[PROOF STEP]
using F_j_analytically_valid
[PROOF STATE]
proof (prove)
using this:
analytically_valid Dx_pair (\<lambda>p. F p \<bullet> j) i

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

goal (5 subgoals):
 1. - line_integral F {j} gamma4 - line_integral F {j} gamma3 + line_integral F {j} gamma2 + line_integral F {j} gamma1 = integral Dx_pair (partial_vector_derivative (\<lambda>a. F a \<bullet> j) i)
 2. line_integral_exists F {j} gamma4
 3. line_integral_exists F {j} gamma3
 4. line_integral_exists F {j} gamma2
 5. line_integral_exists F {j} gamma1
[PROOF STEP]
let ?f = "(\<lambda>x. if x \<in> (Dx_pair) then (partial_vector_derivative (\<lambda>a. (F a) \<bullet> j)  i) x else 0)"
[PROOF STATE]
proof (state)
goal (5 subgoals):
 1. - line_integral F {j} gamma4 - line_integral F {j} gamma3 + line_integral F {j} gamma2 + line_integral F {j} gamma1 = integral Dx_pair (partial_vector_derivative (\<lambda>a. F a \<bullet> j) i)
 2. line_integral_exists F {j} gamma4
 3. line_integral_exists F {j} gamma3
 4. line_integral_exists F {j} gamma2
 5. line_integral_exists F {j} 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> Dx_pair then partial_vector_derivative (\<lambda>a. F a \<bullet> j) i x else 0)
[PROOF STEP]
using F_j_analytically_valid
[PROOF STATE]
proof (prove)
using this:
analytically_valid Dx_pair (\<lambda>p. F p \<bullet> j) i

goal (1 subgoal):
 1. integrable lborel (\<lambda>x. if x \<in> Dx_pair then partial_vector_derivative (\<lambda>a. F a \<bullet> j) i 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> Dx_pair then partial_vector_derivative (\<lambda>a. F a \<bullet> j) i x else 0)

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

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

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

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

goal (5 subgoals):
 1. - line_integral F {j} gamma4 - line_integral F {j} gamma3 + line_integral F {j} gamma2 + line_integral F {j} gamma1 = integral Dx_pair (partial_vector_derivative (\<lambda>a. F a \<bullet> j) i)
 2. line_integral_exists F {j} gamma4
 3. line_integral_exists F {j} gamma3
 4. line_integral_exists F {j} gamma2
 5. line_integral_exists F {j} gamma1
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
partial_vector_derivative (\<lambda>a. F a \<bullet> j) i (?x, ?y) * indicat_real Dx_pair (?x, ?y) = (if (?x, ?y) \<in> Dx_pair then partial_vector_derivative (\<lambda>a. F a \<bullet> j) i (?x, ?y) else 0)
[PROOF STEP]
have y_axis_integral_measurable: "(\<lambda>x. integral UNIV (\<lambda>y. ?f(y, x))) \<in> borel_measurable lborel"
[PROOF STATE]
proof (prove)
using this:
partial_vector_derivative (\<lambda>a. F a \<bullet> j) i (?x, ?y) * indicat_real Dx_pair (?x, ?y) = (if (?x, ?y) \<in> Dx_pair then partial_vector_derivative (\<lambda>a. F a \<bullet> j) i (?x, ?y) else 0)

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

goal (1 subgoal):
 1. (\<lambda>x. integral UNIV (\<lambda>y. if (y, x) \<in> Dx_pair then partial_vector_derivative (\<lambda>a. F a \<bullet> j) i (y, x) 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 (y, x) \<in> Dx_pair then partial_vector_derivative (\<lambda>a. F a \<bullet> j) i (y, x) else 0)) \<in> borel_measurable lborel

goal (5 subgoals):
 1. - line_integral F {j} gamma4 - line_integral F {j} gamma3 + line_integral F {j} gamma2 + line_integral F {j} gamma1 = integral Dx_pair (partial_vector_derivative (\<lambda>a. F a \<bullet> j) i)
 2. line_integral_exists F {j} gamma4
 3. line_integral_exists F {j} gamma3
 4. line_integral_exists F {j} gamma2
 5. line_integral_exists F {j} gamma1
[PROOF STEP]
have F_partially_differentiable: "\<forall>a\<in>Dx_pair. has_partial_vector_derivative (\<lambda>x. (F x) \<bullet> j) i (?F_a' a) a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>a\<in>Dx_pair. has_partial_vector_derivative (\<lambda>x. F x \<bullet> j) i (partial_vector_derivative (\<lambda>a. F a \<bullet> j) i 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>Dx_pair. partially_vector_differentiable (\<lambda>a. F a \<bullet> j) i a

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

goal (5 subgoals):
 1. - line_integral F {j} gamma4 - line_integral F {j} gamma3 + line_integral F {j} gamma2 + line_integral F {j} gamma1 = integral Dx_pair (partial_vector_derivative (\<lambda>a. F a \<bullet> j) i)
 2. line_integral_exists F {j} gamma4
 3. line_integral_exists F {j} gamma3
 4. line_integral_exists F {j} gamma2
 5. line_integral_exists F {j} 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]
apply (auto simp: divide_simps image_iff)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x. \<lbrakk>0 \<le> x; x \<le> 1\<rbrakk> \<Longrightarrow> \<exists>xa\<in>{a..b}. b \<noteq> a \<longrightarrow> x * (b - a) = xa - a
 2. \<And>x. \<lbrakk>0 \<le> x; x \<le> 1; b = a\<rbrakk> \<Longrightarrow> x = 0
[PROOF STEP]
apply (rule_tac x="x * (b - a) + a" in bexI)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>x. \<lbrakk>0 \<le> x; x \<le> 1\<rbrakk> \<Longrightarrow> b \<noteq> a \<longrightarrow> x * (b - a) = x * (b - a) + a - a
 2. \<And>x. \<lbrakk>0 \<le> x; x \<le> 1\<rbrakk> \<Longrightarrow> x * (b - a) + a \<in> {a..b}
 3. \<And>x. \<lbrakk>0 \<le> x; x \<le> 1; b = a\<rbrakk> \<Longrightarrow> x = 0
[PROOF STEP]
using a_lt_b
[PROOF STATE]
proof (prove)
using this:
a < b

goal (3 subgoals):
 1. \<And>x. \<lbrakk>0 \<le> x; x \<le> 1\<rbrakk> \<Longrightarrow> b \<noteq> a \<longrightarrow> x * (b - a) = x * (b - a) + a - a
 2. \<And>x. \<lbrakk>0 \<le> x; x \<le> 1\<rbrakk> \<Longrightarrow> x * (b - a) + a \<in> {a..b}
 3. \<And>x. \<lbrakk>0 \<le> x; x \<le> 1; b = a\<rbrakk> \<Longrightarrow> x = 0
[PROOF STEP]
by (auto simp: algebra_simps mult_le_cancel_left affine_ineq)
[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 "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 gamma4_smooth], of "(\<lambda>x. i)", OF continuous_on_const]
[PROOF STATE]
proof (prove)
using this:
continuous_on {0..1} (\<lambda>x. gamma4 x \<bullet> i)

goal (1 subgoal):
 1. continuous_on {0..1} (\<lambda>x. g2 (a + (b - a) * x))
[PROOF STEP]
by (simp add: gamma4_def i_is_x_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]
show "continuous_on (cbox a b) g2"
[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 (cbox a b) g2
[PROOF STEP]
using a_lt_b
[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))))
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 "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 gamma2_smooth], of "(\<lambda>x. i)", OF continuous_on_const]
[PROOF STATE]
proof (prove)
using this:
continuous_on {0..1} (\<lambda>x. gamma2 x \<bullet> i)

goal (1 subgoal):
 1. continuous_on {0..1} (\<lambda>x. g1 (a + (b - a) * x))
[PROOF STEP]
by (simp add: gamma2_def i_is_x_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]
show "continuous_on (cbox a b) g1"
[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 (cbox a b) g1
[PROOF STEP]
using a_lt_b
[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))))
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 {j} gamma4 - line_integral F {j} gamma3 + line_integral F {j} gamma2 + line_integral F {j} gamma1 = integral Dx_pair (partial_vector_derivative (\<lambda>a. F a \<bullet> j) i)
 2. line_integral_exists F {j} gamma4
 3. line_integral_exists F {j} gamma3
 4. line_integral_exists F {j} gamma2
 5. line_integral_exists F {j} gamma1
[PROOF STEP]
have g2_scale_i_contin: "continuous_on (cbox a b) (\<lambda>x. (g2 x, 0))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on (cbox a b) (\<lambda>x. (g2 x, 0::'a))
[PROOF STEP]
by (intro continuous_intros g1_g2_continuous)
[PROOF STATE]
proof (state)
this:
continuous_on (cbox a b) (\<lambda>x. (g2 x, 0::?'a1))

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

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

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

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

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

goal (5 subgoals):
 1. - line_integral F {j} gamma4 - line_integral F {j} gamma3 + line_integral F {j} gamma2 + line_integral F {j} gamma1 = integral Dx_pair (partial_vector_derivative (\<lambda>a. F a \<bullet> j) i)
 2. line_integral_exists F {j} gamma4
 3. line_integral_exists F {j} gamma3
 4. line_integral_exists F {j} gamma2
 5. line_integral_exists F {j} 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 {j} gamma4 - line_integral F {j} gamma3 + line_integral F {j} gamma2 + line_integral F {j} gamma1 = integral Dx_pair (partial_vector_derivative (\<lambda>a. F a \<bullet> j) i)
 2. line_integral_exists F {j} gamma4
 3. line_integral_exists F {j} gamma3
 4. line_integral_exists F {j} gamma2
 5. line_integral_exists F {j} 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_gamma4_pathimg: "path_image gamma4 = ?Dg2"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. a + (b - a) * x) ` {0..1} = {a..b}

goal (1 subgoal):
 1. path_image gamma4 = {p. \<exists>x. x \<in> cbox a b \<and> p = (g2 x, x)}
[PROOF STEP]
using line_is_pair_img and gamma4_is_compos_of_scal_and_g2 image_comp path_image_def
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. a + (b - a) * x) ` {0..1} = {a..b}
{p. \<exists>x. x \<in> cbox a b \<and> p = (g2 x, x)} = (\<lambda>x. (g2 x, x)) ` cbox a b
gamma4 = (\<lambda>x. (g2 x, x)) \<circ> (\<lambda>x. a + (b - a) * x)
?f ` ?g ` ?r = (?f \<circ> ?g) ` ?r
path_image ?g = ?g ` {0..1}

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

goal (5 subgoals):
 1. - line_integral F {j} gamma4 - line_integral F {j} gamma3 + line_integral F {j} gamma2 + line_integral F {j} gamma1 = integral Dx_pair (partial_vector_derivative (\<lambda>a. F a \<bullet> j) i)
 2. line_integral_exists F {j} gamma4
 3. line_integral_exists F {j} gamma3
 4. line_integral_exists F {j} gamma2
 5. line_integral_exists F {j} 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 {j} gamma4 - line_integral F {j} gamma3 + line_integral F {j} gamma2 + line_integral F {j} gamma1 = integral Dx_pair (partial_vector_derivative (\<lambda>a. F a \<bullet> j) i)
 2. line_integral_exists F {j} gamma4
 3. line_integral_exists F {j} gamma3
 4. line_integral_exists F {j} gamma2
 5. line_integral_exists F {j} gamma1
[PROOF STEP]
have gamma4_as_euclid_space_fun: "gamma4 = (\<lambda>x. (a + (b - a) * x) *\<^sub>R j + (g2 (a + (b - a) * x), 0))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. gamma4 = (\<lambda>x. (a + (b - a) * x) *\<^sub>R j + (g2 (a + (b - a) * x), 0))
[PROOF STEP]
using j_is_y_axis gamma4_def
[PROOF STATE]
proof (prove)
using this:
j = (0, 1)
gamma4 = (\<lambda>x. (g2 (a + (b - a) * x), a + (b - a) * x))

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

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

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

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

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

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

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

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

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

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

goal (3 subgoals):
 1. - line_integral F {j} gamma4 - line_integral F {j} gamma3 + line_integral F {j} gamma2 + line_integral F {j} gamma1 = integral Dx_pair (partial_vector_derivative (\<lambda>a. F a \<bullet> j) i)
 2. line_integral_exists F {j} gamma2
 3. line_integral_exists F {j} gamma1
[PROOF STEP]
have "continuous_on (cbox a b) (\<lambda>x. F(g2(x), x) \<bullet> j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on (cbox a b) (\<lambda>x. F (g2 x, x) \<bullet> j)
[PROOF STEP]
by (smt Collect_mono_iff continuous_on_compose2 continuous_on_eq field_cont_on_gamma4_image g2_path_continuous line_is_pair_img)
[PROOF STATE]
proof (state)
this:
continuous_on (cbox a b) (\<lambda>x. F (g2 x, x) \<bullet> j)

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

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

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

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

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

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

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

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

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

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

goal (1 subgoal):
 1. path_image gamma2 = {p. \<exists>x. x \<in> cbox a b \<and> p = (g1 x, x)}
[PROOF STEP]
using line_is_pair_img image_comp path_image_def add_scale_img
[PROOF STATE]
proof (prove)
using this:
gamma2 = (\<lambda>x. (g1 x, x)) \<circ> (\<lambda>x. a + (b - a) * x)
{p. \<exists>x. x \<in> cbox a b \<and> p = (g1 x, x)} = (\<lambda>x. (g1 x, x)) ` cbox a b
?f ` ?g ` ?r = (?f \<circ> ?g) ` ?r
path_image ?g = ?g ` {0..1}
(\<lambda>x. a + (b - a) * x) ` {0..1} = {a..b}

goal (1 subgoal):
 1. path_image gamma2 = {p. \<exists>x. x \<in> cbox a b \<and> p = (g1 x, x)}
[PROOF STEP]
by (metis (no_types, lifting) cbox_interval)
[PROOF STATE]
proof (state)
this:
path_image gamma2 = {p. \<exists>x. x \<in> cbox a b \<and> p = (g1 x, x)}

goal (3 subgoals):
 1. - line_integral F {j} gamma4 - line_integral F {j} gamma3 + line_integral F {j} gamma2 + line_integral F {j} gamma1 = integral Dx_pair (partial_vector_derivative (\<lambda>a. F a \<bullet> j) i)
 2. line_integral_exists F {j} gamma2
 3. line_integral_exists F {j} 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 (3 subgoals):
 1. - line_integral F {j} gamma4 - line_integral F {j} gamma3 + line_integral F {j} gamma2 + line_integral F {j} gamma1 = integral Dx_pair (partial_vector_derivative (\<lambda>a. F a \<bullet> j) i)
 2. line_integral_exists F {j} gamma2
 3. line_integral_exists F {j} gamma1
[PROOF STEP]
have gamma2_as_euclid_space_fun: "gamma2 = (\<lambda>x. (a + (b - a) * x) *\<^sub>R j + (g1 (a + (b - a) * x), 0))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. gamma2 = (\<lambda>x. (a + (b - a) * x) *\<^sub>R j + (g1 (a + (b - a) * x), 0))
[PROOF STEP]
using j_is_y_axis gamma2_def
[PROOF STATE]
proof (prove)
using this:
j = (0, 1)
gamma2 = (\<lambda>x. (g1 (a + (b - a) * x), a + (b - a) * x))

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

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

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

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

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

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

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

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

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

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

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

goal (1 subgoal):
 1. - line_integral F {j} gamma4 - line_integral F {j} gamma3 + line_integral F {j} gamma2 + line_integral F {j} gamma1 = integral Dx_pair (partial_vector_derivative (\<lambda>a. F a \<bullet> j) i)
[PROOF STEP]
have "continuous_on (cbox a b) (\<lambda>x. F(g1(x), x) \<bullet> j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on (cbox a b) (\<lambda>x. F (g1 x, x) \<bullet> j)
[PROOF STEP]
by (smt Collect_mono_iff continuous_on_compose2 continuous_on_eq field_cont_on_gamma2_image g1_path_continuous line_is_pair_img)
[PROOF STATE]
proof (state)
this:
continuous_on (cbox a b) (\<lambda>x. F (g1 x, x) \<bullet> j)

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

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

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

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

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

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

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

goal (1 subgoal):
 1. ((\<lambda>y. partial_vector_derivative (\<lambda>a. F a \<bullet> j) i (y, xc)) has_integral F (g1 xc, xc) \<bullet> j - F (g2 xc, xc) \<bullet> j) (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> j) i (y, xc)) has_integral F (g1 xc, xc) \<bullet> j - F (g2 xc, xc) \<bullet> j) (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> j) i (y, ?xc2)) has_integral F (g1 ?xc2, ?xc2) \<bullet> j - F (g2 ?xc2, ?xc2) \<bullet> j) (cbox (g2 ?xc2) (g1 ?xc2))

goal (1 subgoal):
 1. - line_integral F {j} gamma4 - line_integral F {j} gamma3 + line_integral F {j} gamma2 + line_integral F {j} gamma1 = integral Dx_pair (partial_vector_derivative (\<lambda>a. F a \<bullet> j) i)
[PROOF STEP]
have "?f integrable_on UNIV"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. if x \<in> Dx_pair then partial_vector_derivative (\<lambda>a. F a \<bullet> j) i x else 0) integrable_on UNIV
[PROOF STEP]
by (simp add: f_lesbegue_integrable integrable_on_lborel)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. if x \<in> Dx_pair then partial_vector_derivative (\<lambda>a. F a \<bullet> j) i x else 0) integrable_on UNIV

goal (1 subgoal):
 1. - line_integral F {j} gamma4 - line_integral F {j} gamma3 + line_integral F {j} gamma2 + line_integral F {j} gamma1 = integral Dx_pair (partial_vector_derivative (\<lambda>a. F a \<bullet> j) i)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>x. if x \<in> Dx_pair then partial_vector_derivative (\<lambda>a. F a \<bullet> j) i x else 0) integrable_on UNIV
[PROOF STEP]
have partial_deriv_integrable: "?F_a' integrable_on Dx_pair"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. if x \<in> Dx_pair then partial_vector_derivative (\<lambda>a. F a \<bullet> j) i x else 0) integrable_on UNIV

goal (1 subgoal):
 1. partial_vector_derivative (\<lambda>a. F a \<bullet> j) i integrable_on Dx_pair
[PROOF STEP]
using integrable_restrict_UNIV
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. if x \<in> Dx_pair then partial_vector_derivative (\<lambda>a. F a \<bullet> j) i x else 0) integrable_on UNIV
((\<lambda>x. if x \<in> ?s then ?f x else (0::?'a)) integrable_on UNIV) = (?f integrable_on ?s)

goal (1 subgoal):
 1. partial_vector_derivative (\<lambda>a. F a \<bullet> j) i integrable_on Dx_pair
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
partial_vector_derivative (\<lambda>a. F a \<bullet> j) i integrable_on Dx_pair

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

goal (1 subgoal):
 1. (\<lambda>y. if (y, x) \<in> Dx_pair then partial_vector_derivative (\<lambda>a. F a \<bullet> j) i (y, x) 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 (y, x) \<in> Dx_pair then partial_vector_derivative (\<lambda>a. F a \<bullet> j) i (y, x) 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 (y, x)) integrable_on UNIV"
[PROOF STATE]
proof (prove)
using this:
\<forall>x. x \<notin> cbox a b \<longrightarrow> (\<lambda>y. if (y, x) \<in> Dx_pair then partial_vector_derivative (\<lambda>a. F a \<bullet> j) i (y, x) else 0) = (\<lambda>y. 0)

goal (1 subgoal):
 1. \<forall>x. x \<notin> cbox a b \<longrightarrow> (\<lambda>y. if (y, x) \<in> Dx_pair then partial_vector_derivative (\<lambda>a. F a \<bullet> j) i (y, x) 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 (y, x) \<in> Dx_pair then partial_vector_derivative (\<lambda>a. F a \<bullet> j) i (y, x) else 0) integrable_on UNIV

goal (1 subgoal):
 1. (\<lambda>y. if (y, x) \<in> Dx_pair then partial_vector_derivative (\<lambda>a. F a \<bullet> j) i (y, x) else 0) integrable_on UNIV
[PROOF STEP]
have "\<forall>x \<in> cbox a b. ?F_a'_oneD x = (\<lambda>y. ?f(y, x))"
[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> j) i (y, x) else 0) = (\<lambda>y. if (y, x) \<in> Dx_pair then partial_vector_derivative (\<lambda>a. F a \<bullet> j) i (y, x) else 0)
[PROOF STEP]
using g2_leq_g1
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>cbox a b. g2 x \<le> g1 x

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> j) i (y, x) else 0) = (\<lambda>y. if (y, x) \<in> Dx_pair then partial_vector_derivative (\<lambda>a. F a \<bullet> j) i (y, x) else 0)
[PROOF STEP]
by (auto simp add: Dx_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> j) i (y, x) else 0) = (\<lambda>y. if (y, x) \<in> Dx_pair then partial_vector_derivative (\<lambda>a. F a \<bullet> j) i (y, x) else 0)

goal (1 subgoal):
 1. (\<lambda>y. if (y, x) \<in> Dx_pair then partial_vector_derivative (\<lambda>a. F a \<bullet> j) i (y, x) else 0) integrable_on UNIV
[PROOF STEP]
moreover
[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> j) i (y, x) else 0) = (\<lambda>y. if (y, x) \<in> Dx_pair then partial_vector_derivative (\<lambda>a. F a \<bullet> j) i (y, x) else 0)

goal (1 subgoal):
 1. (\<lambda>y. if (y, x) \<in> Dx_pair then partial_vector_derivative (\<lambda>a. F a \<bullet> j) i (y, x) else 0) integrable_on UNIV
[PROOF STEP]
have "\<forall>x \<in> cbox a b. ?F_a'_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> j) i (y, x) 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> j) i (y, ?xc2)) has_integral F (g1 ?xc2, ?xc2) \<bullet> j - F (g2 ?xc2, ?xc2) \<bullet> j) (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> j) i (y, x) 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> j) i (y, x) else 0) integrable_on UNIV

goal (1 subgoal):
 1. (\<lambda>y. if (y, x) \<in> Dx_pair then partial_vector_derivative (\<lambda>a. F a \<bullet> j) i (y, x) else 0) integrable_on UNIV
[PROOF STEP]
ultimately
[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> j) i (y, x) else 0) = (\<lambda>y. if (y, x) \<in> Dx_pair then partial_vector_derivative (\<lambda>a. F a \<bullet> j) i (y, x) else 0)
\<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> j) i (y, x) else 0) integrable_on UNIV
[PROOF STEP]
have "\<forall>x. x \<in> cbox a b \<longrightarrow>  (\<lambda>y. ?f (y, x)) 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> j) i (y, x) else 0) = (\<lambda>y. if (y, x) \<in> Dx_pair then partial_vector_derivative (\<lambda>a. F a \<bullet> j) i (y, x) else 0)
\<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> j) i (y, x) else 0) integrable_on UNIV

goal (1 subgoal):
 1. \<forall>x. x \<in> cbox a b \<longrightarrow> (\<lambda>y. if (y, x) \<in> Dx_pair then partial_vector_derivative (\<lambda>a. F a \<bullet> j) i (y, x) 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 (y, x) \<in> Dx_pair then partial_vector_derivative (\<lambda>a. F a \<bullet> j) i (y, x) else 0) integrable_on UNIV

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

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

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

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

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

goal (1 subgoal):
 1. integral Dx_pair (partial_vector_derivative (\<lambda>a. F a \<bullet> j) i) = integral (cbox a b) (\<lambda>x. integral (cbox (g2 x) (g1 x)) (\<lambda>y. partial_vector_derivative (\<lambda>a. F a \<bullet> j) i (y, x)))
[PROOF STEP]
have arg2: "Dx_pair = {(y, x). (\<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. Dx_pair = {(y, x). (\<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 Dx_def
[PROOF STATE]
proof (prove)
using this:
Dx_pair = {(x, y). y \<in> cbox a b \<and> x \<in> cbox (g2 y) (g1 y)}

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

goal (1 subgoal):
 1. integral Dx_pair (partial_vector_derivative (\<lambda>a. F a \<bullet> j) i) = integral (cbox a b) (\<lambda>x. integral (cbox (g2 x) (g1 x)) (\<lambda>y. partial_vector_derivative (\<lambda>a. F a \<bullet> j) i (y, x)))
[PROOF STEP]
have arg4: "\<And>x. x \<in> (cbox a b) \<Longrightarrow>
                      (\<lambda>x. integral (cbox (g2 x) (g1 x)) (\<lambda>y. if (y, x) \<in> Dx_pair then partial_vector_derivative (\<lambda>a. F a \<bullet> j) i (y, x) else 0)) x =
                      (\<lambda>x. integral (cbox (g2 x) (g1 x)) (\<lambda>y. partial_vector_derivative (\<lambda>a. F a \<bullet> j) i (y, x))) 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 (y, x) \<in> Dx_pair then partial_vector_derivative (\<lambda>a. F a \<bullet> j) i (y, x) else 0) = integral (cbox (g2 x) (g1 x)) (\<lambda>y. partial_vector_derivative (\<lambda>a. F a \<bullet> j) i (y, x))
[PROOF STEP]
apply (clarsimp simp: Dx_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>a \<le> x; x \<le> b\<rbrakk> \<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> j) i (y, x) else 0) = integral {g2 x..g1 x} (\<lambda>y. partial_vector_derivative (\<lambda>a. F a \<bullet> j) i (y, x))
[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 (y, ?x2) \<in> Dx_pair then partial_vector_derivative (\<lambda>a. F a \<bullet> j) i (y, ?x2) else 0) = integral (cbox (g2 ?x2) (g1 ?x2)) (\<lambda>y. partial_vector_derivative (\<lambda>a. F a \<bullet> j) i (y, ?x2))

goal (1 subgoal):
 1. integral Dx_pair (partial_vector_derivative (\<lambda>a. F a \<bullet> j) i) = integral (cbox a b) (\<lambda>x. integral (cbox (g2 x) (g1 x)) (\<lambda>y. partial_vector_derivative (\<lambda>a. F a \<bullet> j) i (y, x)))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral Dx_pair (partial_vector_derivative (\<lambda>a. F a \<bullet> j) i) = integral (cbox a b) (\<lambda>x. integral (cbox (g2 x) (g1 x)) (\<lambda>y. partial_vector_derivative (\<lambda>a. F a \<bullet> j) i (y, x)))
[PROOF STEP]
using gauge_integral_Fubini_curve_bounded_region_y
        [OF f_lesbegue_integrable y_axis_gauge_integrable y_axis_integral_measurable arg arg2]
        Henstock_Kurzweil_Integration.integral_cong[OF arg3, of "Dx_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 Dx_pair (\<lambda>x. if x \<in> Dx_pair then partial_vector_derivative (\<lambda>a. F a \<bullet> j) i x else 0) = integral (cbox a b) (\<lambda>x. integral (cbox (g2 x) (g1 x)) (\<lambda>y. if (y, x) \<in> Dx_pair then partial_vector_derivative (\<lambda>a. F a \<bullet> j) i (y, x) else 0))
(\<And>x. x \<in> Dx_pair \<Longrightarrow> x \<in> Dx_pair) \<Longrightarrow> integral Dx_pair (\<lambda>x. if x \<in> Dx_pair then partial_vector_derivative (\<lambda>a. F a \<bullet> j) i x else 0) = integral Dx_pair (partial_vector_derivative (\<lambda>a. F a \<bullet> j) i)
(\<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 (y, x) \<in> Dx_pair then partial_vector_derivative (\<lambda>a. F a \<bullet> j) i (y, x) else 0)) = integral (cbox a b) (\<lambda>x. integral (cbox (g2 x) (g1 x)) (\<lambda>y. partial_vector_derivative (\<lambda>a. F a \<bullet> j) i (y, x)))

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

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

goal (1 subgoal):
 1. - line_integral F {j} gamma4 - line_integral F {j} gamma3 + line_integral F {j} gamma2 + line_integral F {j} gamma1 = integral Dx_pair (partial_vector_derivative (\<lambda>a. F a \<bullet> j) i)
[PROOF STEP]
have "((integral Dx_pair (\<lambda>a. (?F_a' a)))
        = integral (cbox a b) (\<lambda>x. F(g1(x), x) \<bullet> j - F(g2(x), x) \<bullet> j))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral Dx_pair (partial_vector_derivative (\<lambda>a. F a \<bullet> j) i) = integral (cbox a b) (\<lambda>x. F (g1 x, x) \<bullet> j - F (g2 x, x) \<bullet> j)
[PROOF STEP]
using 4 Henstock_Kurzweil_Integration.integral_cong partial_deriv_one_d_integrable integrable_def
[PROOF STATE]
proof (prove)
using this:
integral Dx_pair (partial_vector_derivative (\<lambda>a. F a \<bullet> j) i) = integral (cbox a b) (\<lambda>x. integral (cbox (g2 x) (g1 x)) (\<lambda>y. partial_vector_derivative (\<lambda>a. F a \<bullet> j) i (y, x)))
(\<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> j) i (y, ?xc2)) has_integral F (g1 ?xc2, ?xc2) \<bullet> j - F (g2 ?xc2, ?xc2) \<bullet> j) (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 Dx_pair (partial_vector_derivative (\<lambda>a. F a \<bullet> j) i) = integral (cbox a b) (\<lambda>x. F (g1 x, x) \<bullet> j - F (g2 x, x) \<bullet> j)
[PROOF STEP]
by (smt integral_unique)
[PROOF STATE]
proof (state)
this:
integral Dx_pair (partial_vector_derivative (\<lambda>a. F a \<bullet> j) i) = integral (cbox a b) (\<lambda>x. F (g1 x, x) \<bullet> j - F (g2 x, x) \<bullet> j)

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

goal (1 subgoal):
 1. integral Dx_pair (\<lambda>a. - partial_vector_derivative (\<lambda>a. F a \<bullet> j) i a) = - integral (cbox a b) (\<lambda>x. F (g1 x, x) \<bullet> j - F (g2 x, x) \<bullet> j)
[PROOF STEP]
using partial_deriv_integrable and integral_neg
[PROOF STATE]
proof (prove)
using this:
integral Dx_pair (partial_vector_derivative (\<lambda>a. F a \<bullet> j) i) = integral (cbox a b) (\<lambda>x. F (g1 x, x) \<bullet> j - F (g2 x, x) \<bullet> j)
partial_vector_derivative (\<lambda>a. F a \<bullet> j) i integrable_on Dx_pair
integral ?S (\<lambda>x. - ?f x) = - integral ?S ?f

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

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

goal (1 subgoal):
 1. integral Dx_pair (\<lambda>a. - partial_vector_derivative (\<lambda>a. F a \<bullet> j) i a) = integral (cbox a b) (\<lambda>x. F (g2 x, x) \<bullet> j - F (g1 x, x) \<bullet> j)
[PROOF STEP]
using 6 7
      and integral_neg [of _ "(\<lambda>x. F(g1 x, x) \<bullet> j - F(g2 x, x) \<bullet> j)"]
[PROOF STATE]
proof (prove)
using this:
integral Dx_pair (\<lambda>a. - partial_vector_derivative (\<lambda>a. F a \<bullet> j) i a) = - integral (cbox a b) (\<lambda>x. F (g1 x, x) \<bullet> j - F (g2 x, x) \<bullet> j)
(\<lambda>x. F (g2 x, x) \<bullet> j) integrable_on cbox a b
(\<lambda>x. F (g1 x, x) \<bullet> j) integrable_on cbox a b
integral ?S (\<lambda>x. - (F (g1 x, x) \<bullet> j - F (g2 x, x) \<bullet> j)) = - integral ?S (\<lambda>x. F (g1 x, x) \<bullet> j - F (g2 x, x) \<bullet> j)

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

goal (1 subgoal):
 1. - line_integral F {j} gamma4 - line_integral F {j} gamma3 + line_integral F {j} gamma2 + line_integral F {j} gamma1 = integral Dx_pair (partial_vector_derivative (\<lambda>a. F a \<bullet> j) i)
[PROOF STEP]
have "(line_integral F {j} gamma4) + (line_integral F {j} gamma3) -
        (line_integral F {j} gamma2) - (line_integral F {j} gamma1)
        = (integral Dx_pair (\<lambda>a. -(?F_a' a)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. line_integral F {j} gamma4 + line_integral F {j} gamma3 - line_integral F {j} gamma2 - line_integral F {j} gamma1 = integral Dx_pair (\<lambda>a. - partial_vector_derivative (\<lambda>a. F a \<bullet> j) i a)
[PROOF STEP]
using 0 1 2 3 5 6 7
      Henstock_Kurzweil_Integration.integral_diff[of "(\<lambda>x. F(g2(x), x)  \<bullet> j)"
        "cbox a b" "(\<lambda>x. F(g1(x), x) \<bullet> j)"]
[PROOF STATE]
proof (prove)
using this:
line_integral F {j} gamma4 = integral (cbox a b) (\<lambda>x. F (g2 x, x) \<bullet> j)
line_integral_exists F {j} gamma4
line_integral F {j} gamma3 = 0
line_integral_exists F {j} gamma3
line_integral F {j} gamma2 = integral (cbox a b) (\<lambda>x. F (g1 x, x) \<bullet> j)
line_integral_exists F {j} gamma2
line_integral F {j} gamma1 = 0
line_integral_exists F {j} gamma1
integral Dx_pair (\<lambda>a. - partial_vector_derivative (\<lambda>a. F a \<bullet> j) i a) = integral (cbox a b) (\<lambda>x. F (g2 x, x) \<bullet> j - F (g1 x, x) \<bullet> j)
(\<lambda>x. F (g2 x, x) \<bullet> j) integrable_on cbox a b
(\<lambda>x. F (g1 x, x) \<bullet> j) integrable_on cbox a b
\<lbrakk>(\<lambda>x. F (g2 x, x) \<bullet> j) integrable_on cbox a b; (\<lambda>x. F (g1 x, x) \<bullet> j) integrable_on cbox a b\<rbrakk> \<Longrightarrow> integral (cbox a b) (\<lambda>x. F (g2 x, x) \<bullet> j - F (g1 x, x) \<bullet> j) = integral (cbox a b) (\<lambda>x. F (g2 x, x) \<bullet> j) - integral (cbox a b) (\<lambda>x. F (g1 x, x) \<bullet> j)

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

goal (1 subgoal):
 1. - line_integral F {j} gamma4 - line_integral F {j} gamma3 + line_integral F {j} gamma2 + line_integral F {j} gamma1 = integral Dx_pair (partial_vector_derivative (\<lambda>a. F a \<bullet> j) i)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
line_integral F {j} gamma4 + line_integral F {j} gamma3 - line_integral F {j} gamma2 - line_integral F {j} gamma1 = integral Dx_pair (\<lambda>a. - partial_vector_derivative (\<lambda>a. F a \<bullet> j) i a)
[PROOF STEP]
show "-(line_integral F {j} gamma4) -
         (line_integral F {j} gamma3) +
         (line_integral F {j} gamma2) +
         (line_integral F {j} gamma1)
                 = (integral Dx_pair (\<lambda>a. (?F_a' a)))"
[PROOF STATE]
proof (prove)
using this:
line_integral F {j} gamma4 + line_integral F {j} gamma3 - line_integral F {j} gamma2 - line_integral F {j} gamma1 = integral Dx_pair (\<lambda>a. - partial_vector_derivative (\<lambda>a. F a \<bullet> j) i a)

goal (1 subgoal):
 1. - line_integral F {j} gamma4 - line_integral F {j} gamma3 + line_integral F {j} gamma2 + line_integral F {j} gamma1 = integral Dx_pair (partial_vector_derivative (\<lambda>a. F a \<bullet> j) i)
[PROOF STEP]
by (simp add: \<open>integral Dx_pair (\<lambda>a. - ?F_a' a) = - integral (cbox a b) (\<lambda>x. F(g1 x, x) \<bullet> j - F(g2 x, x) \<bullet> j)\<close> \<open>integral Dx_pair ?F_a' = integral (cbox a b) (\<lambda>x. F(g1 x, x) \<bullet> j - F(g2 x, x) \<bullet> j)\<close>)
[PROOF STATE]
proof (state)
this:
- line_integral F {j} gamma4 - line_integral F {j} gamma3 + line_integral F {j} gamma2 + line_integral F {j} gamma1 = integral Dx_pair (partial_vector_derivative (\<lambda>a. F a \<bullet> j) i)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma length_univ_list_card: "length (univ_list :: 'a :: finite list) = CARD('a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length univ_list = CARD('a)
[PROOF STEP]
using distinct_card[of "univ_list :: 'a list", symmetric]
[PROOF STATE]
proof (prove)
using this:
distinct univ_list \<Longrightarrow> length univ_list = card (set univ_list)

goal (1 subgoal):
 1. length univ_list = CARD('a)
[PROOF STEP]
by (auto simp: univ_list)


[STATEMENT]
lemma norm_diff2: "\<lbrakk>y = y1 + y2; x = x1 + x2; e = e1 + e2; norm(y1 - x1) \<le> e1; norm(y2 - x2) \<le> e2\<rbrakk>
  \<Longrightarrow> norm(y-x) \<le> e"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>y = y1 + y2; x = x1 + x2; e = e1 + e2; norm (y1 - x1) \<le> e1; norm (y2 - x2) \<le> e2\<rbrakk> \<Longrightarrow> norm (y - x) \<le> e
[PROOF STEP]
using norm_triangle_mono [of "y1 - x1" "e1" "y2 - x2" "e2"]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>norm (y1 - x1) \<le> e1; norm (y2 - x2) \<le> e2\<rbrakk> \<Longrightarrow> norm (y1 - x1 + (y2 - x2)) \<le> e1 + e2

goal (1 subgoal):
 1. \<lbrakk>y = y1 + y2; x = x1 + x2; e = e1 + e2; norm (y1 - x1) \<le> e1; norm (y2 - x2) \<le> e2\<rbrakk> \<Longrightarrow> norm (y - x) \<le> e
[PROOF STEP]
by (simp add: add_diff_add)


[STATEMENT]
lemma d_OUT_mono: "(\<And>y. f (x, y) \<le> g (x, y)) \<Longrightarrow> d_OUT f x \<le> d_OUT g x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>y. f (x, y) \<le> g (x, y)) \<Longrightarrow> d_OUT f x \<le> d_OUT g x
[PROOF STEP]
by(auto simp add: d_OUT_def le_fun_def intro: nn_integral_mono)


[STATEMENT]
lemma has_field_derivative_inverse_basic:
  shows "DERIV f (g y) :> f' \<Longrightarrow>
        f' \<noteq> 0 \<Longrightarrow>
        continuous (at y) g \<Longrightarrow>
        open t \<Longrightarrow>
        y \<in> t \<Longrightarrow>
        (\<And>z. z \<in> t \<Longrightarrow> f (g z) = z)
        \<Longrightarrow> DERIV g y :> inverse (f')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(f has_field_derivative f') (at (g y)); f' \<noteq> (0::'a); isCont g y; open t; y \<in> t; \<And>z. z \<in> t \<Longrightarrow> f (g z) = z\<rbrakk> \<Longrightarrow> (g has_field_derivative inverse f') (at y)
[PROOF STEP]
unfolding has_field_derivative_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(f has_derivative (*) f') (at (g y)); f' \<noteq> (0::'a); isCont g y; open t; y \<in> t; \<And>z. z \<in> t \<Longrightarrow> f (g z) = z\<rbrakk> \<Longrightarrow> (g has_derivative (*) (inverse f')) (at y)
[PROOF STEP]
apply (rule has_derivative_inverse_basic)
[PROOF STATE]
proof (prove)
goal (7 subgoals):
 1. \<lbrakk>(f has_derivative (*) f') (at (g y)); f' \<noteq> (0::'a); isCont g y; open t; y \<in> t; \<And>z. z \<in> t \<Longrightarrow> f (g z) = z\<rbrakk> \<Longrightarrow> (?f has_derivative ?f') (at (g y))
 2. \<lbrakk>(f has_derivative (*) f') (at (g y)); f' \<noteq> (0::'a); isCont g y; open t; y \<in> t; \<And>z. z \<in> t \<Longrightarrow> f (g z) = z\<rbrakk> \<Longrightarrow> bounded_linear ((*) (inverse f'))
 3. \<lbrakk>(f has_derivative (*) f') (at (g y)); f' \<noteq> (0::'a); isCont g y; open t; y \<in> t; \<And>z. z \<in> t \<Longrightarrow> f (g z) = z\<rbrakk> \<Longrightarrow> (*) (inverse f') \<circ> ?f' = id
 4. \<lbrakk>(f has_derivative (*) f') (at (g y)); f' \<noteq> (0::'a); isCont g y; open t; y \<in> t; \<And>z. z \<in> t \<Longrightarrow> f (g z) = z\<rbrakk> \<Longrightarrow> isCont g y
 5. \<lbrakk>(f has_derivative (*) f') (at (g y)); f' \<noteq> (0::'a); isCont g y; open t; y \<in> t; \<And>z. z \<in> t \<Longrightarrow> f (g z) = z\<rbrakk> \<Longrightarrow> open ?T
 6. \<lbrakk>(f has_derivative (*) f') (at (g y)); f' \<noteq> (0::'a); isCont g y; open t; y \<in> t; \<And>z. z \<in> t \<Longrightarrow> f (g z) = z\<rbrakk> \<Longrightarrow> y \<in> ?T
 7. \<And>z. \<lbrakk>(f has_derivative (*) f') (at (g y)); f' \<noteq> (0::'a); isCont g y; open t; y \<in> t; \<And>z. z \<in> t \<Longrightarrow> f (g z) = z; z \<in> ?T\<rbrakk> \<Longrightarrow> ?f (g z) = z
[PROOF STEP]
apply (auto simp:  bounded_linear_mult_right)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma odd_odd_even':
  fixes a b :: int
  assumes "odd a" "odd b"
  shows "even (((a * b)\<^sup>2 - 1) div 8) \<longleftrightarrow> even (((a\<^sup>2 - 1) div 8) + ((b\<^sup>2 - 1) div 8))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. even (((a * b)\<^sup>2 - 1) div 8) = even ((a\<^sup>2 - 1) div 8 + (b\<^sup>2 - 1) div 8)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. even (((a * b)\<^sup>2 - 1) div 8) = even ((a\<^sup>2 - 1) div 8 + (b\<^sup>2 - 1) div 8)
[PROOF STEP]
obtain x where [simp]: "a = 2*x + 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>x. a = 2 * x + 1 \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using \<open>odd a\<close>
[PROOF STATE]
proof (prove)
using this:
odd a

goal (1 subgoal):
 1. (\<And>x. a = 2 * x + 1 \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto elim: oddE)
[PROOF STATE]
proof (state)
this:
a = 2 * x + 1

goal (1 subgoal):
 1. even (((a * b)\<^sup>2 - 1) div 8) = even ((a\<^sup>2 - 1) div 8 + (b\<^sup>2 - 1) div 8)
[PROOF STEP]
obtain y where [simp]: "b = 2*y + 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>y. b = 2 * y + 1 \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using \<open>odd b\<close>
[PROOF STATE]
proof (prove)
using this:
odd b

goal (1 subgoal):
 1. (\<And>y. b = 2 * y + 1 \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto elim: oddE)
[PROOF STATE]
proof (state)
this:
b = 2 * y + 1

goal (1 subgoal):
 1. even (((a * b)\<^sup>2 - 1) div 8) = even ((a\<^sup>2 - 1) div 8 + (b\<^sup>2 - 1) div 8)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. even (((a * b)\<^sup>2 - 1) div 8) = even ((a\<^sup>2 - 1) div 8 + (b\<^sup>2 - 1) div 8)
[PROOF STEP]
by (cases "even x"; cases "even y"; elim oddE evenE)
       (auto simp: power2_eq_square algebra_simps)
[PROOF STATE]
proof (state)
this:
even (((a * b)\<^sup>2 - 1) div 8) = even ((a\<^sup>2 - 1) div 8 + (b\<^sup>2 - 1) div 8)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Im_Arcsin_of_real:
  assumes "\<bar>x\<bar> \<le> 1"
    shows "Im (Arcsin (of_real x)) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Im (Arcsin (complex_of_real x)) = 0
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Im (Arcsin (complex_of_real x)) = 0
[PROOF STEP]
have "csqrt (1 - (of_real x)\<^sup>2) = (if x^2 \<le> 1 then sqrt (1 - x^2) else \<i> * sqrt (x^2 - 1))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. csqrt (1 - (complex_of_real x)\<^sup>2) = (if x\<^sup>2 \<le> 1 then complex_of_real (sqrt (1 - x\<^sup>2)) else \<i> * complex_of_real (sqrt (x\<^sup>2 - 1)))
[PROOF STEP]
by (simp add: of_real_sqrt del: csqrt_of_real_nonneg)
[PROOF STATE]
proof (state)
this:
csqrt (1 - (complex_of_real x)\<^sup>2) = (if x\<^sup>2 \<le> 1 then complex_of_real (sqrt (1 - x\<^sup>2)) else \<i> * complex_of_real (sqrt (x\<^sup>2 - 1)))

goal (1 subgoal):
 1. Im (Arcsin (complex_of_real x)) = 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
csqrt (1 - (complex_of_real x)\<^sup>2) = (if x\<^sup>2 \<le> 1 then complex_of_real (sqrt (1 - x\<^sup>2)) else \<i> * complex_of_real (sqrt (x\<^sup>2 - 1)))
[PROOF STEP]
have "cmod (\<i> * of_real x + csqrt (1 - (of_real x)\<^sup>2))^2 = 1"
[PROOF STATE]
proof (prove)
using this:
csqrt (1 - (complex_of_real x)\<^sup>2) = (if x\<^sup>2 \<le> 1 then complex_of_real (sqrt (1 - x\<^sup>2)) else \<i> * complex_of_real (sqrt (x\<^sup>2 - 1)))

goal (1 subgoal):
 1. (cmod (\<i> * complex_of_real x + csqrt (1 - (complex_of_real x)\<^sup>2)))\<^sup>2 = 1
[PROOF STEP]
using assms abs_square_le_1
[PROOF STATE]
proof (prove)
using this:
csqrt (1 - (complex_of_real x)\<^sup>2) = (if x\<^sup>2 \<le> 1 then complex_of_real (sqrt (1 - x\<^sup>2)) else \<i> * complex_of_real (sqrt (x\<^sup>2 - 1)))
\<bar>x\<bar> \<le> 1
(?x\<^sup>2 \<le> (1::?'a)) = (\<bar>?x\<bar> \<le> (1::?'a))

goal (1 subgoal):
 1. (cmod (\<i> * complex_of_real x + csqrt (1 - (complex_of_real x)\<^sup>2)))\<^sup>2 = 1
[PROOF STEP]
by (force simp add: Complex.cmod_power2)
[PROOF STATE]
proof (state)
this:
(cmod (\<i> * complex_of_real x + csqrt (1 - (complex_of_real x)\<^sup>2)))\<^sup>2 = 1

goal (1 subgoal):
 1. Im (Arcsin (complex_of_real x)) = 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(cmod (\<i> * complex_of_real x + csqrt (1 - (complex_of_real x)\<^sup>2)))\<^sup>2 = 1
[PROOF STEP]
have "cmod (\<i> * of_real x + csqrt (1 - (of_real x)\<^sup>2)) = 1"
[PROOF STATE]
proof (prove)
using this:
(cmod (\<i> * complex_of_real x + csqrt (1 - (complex_of_real x)\<^sup>2)))\<^sup>2 = 1

goal (1 subgoal):
 1. cmod (\<i> * complex_of_real x + csqrt (1 - (complex_of_real x)\<^sup>2)) = 1
[PROOF STEP]
by (simp add: norm_complex_def)
[PROOF STATE]
proof (state)
this:
cmod (\<i> * complex_of_real x + csqrt (1 - (complex_of_real x)\<^sup>2)) = 1

goal (1 subgoal):
 1. Im (Arcsin (complex_of_real x)) = 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
cmod (\<i> * complex_of_real x + csqrt (1 - (complex_of_real x)\<^sup>2)) = 1
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
cmod (\<i> * complex_of_real x + csqrt (1 - (complex_of_real x)\<^sup>2)) = 1

goal (1 subgoal):
 1. Im (Arcsin (complex_of_real x)) = 0
[PROOF STEP]
by (simp add: Im_Arcsin exp_minus)
[PROOF STATE]
proof (state)
this:
Im (Arcsin (complex_of_real x)) = 0

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma continuous_on_open_avoid:
  fixes f :: "'a::metric_space \<Rightarrow> 'b::t1_space"
  assumes "continuous_on s f"
    and "open s"
    and "x \<in> s"
    and "f x \<noteq> a"
  shows "\<exists>e>0. \<forall>y. dist x y < e \<longrightarrow> f y \<noteq> a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>e>0. \<forall>y. dist x y < e \<longrightarrow> f y \<noteq> a
[PROOF STEP]
using assms(1)[unfolded continuous_on_eq_continuous_at[OF assms(2)], THEN bspec[where x=x], OF assms(3)]
[PROOF STATE]
proof (prove)
using this:
isCont f x

goal (1 subgoal):
 1. \<exists>e>0. \<forall>y. dist x y < e \<longrightarrow> f y \<noteq> a
[PROOF STEP]
using continuous_at_avoid[of x f a] assms(4)
[PROOF STATE]
proof (prove)
using this:
isCont f x
\<lbrakk>isCont f x; f x \<noteq> a\<rbrakk> \<Longrightarrow> \<exists>e>0. \<forall>y. dist x y < e \<longrightarrow> f y \<noteq> a
f x \<noteq> a

goal (1 subgoal):
 1. \<exists>e>0. \<forall>y. dist x y < e \<longrightarrow> f y \<noteq> a
[PROOF STEP]
by auto


[STATEMENT]
lemma dist_triangle_third:
  assumes "dist x1 x2 < e/3" "dist x2 x3 < e/3" "dist x3 x4 < e/3"
  shows "dist x1 x4 < e"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dist x1 x4 < e
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. dist x1 x4 < e
[PROOF STEP]
have "dist x1 x3 < e/3 + e/3"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dist x1 x3 < e / 3 + e / 3
[PROOF STEP]
by (metis assms(1) assms(2) dist_commute dist_triangle_less_add)
[PROOF STATE]
proof (state)
this:
dist x1 x3 < e / 3 + e / 3

goal (1 subgoal):
 1. dist x1 x4 < e
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
dist x1 x3 < e / 3 + e / 3
[PROOF STEP]
have "dist x1 x4 < (e/3 + e/3) + e/3"
[PROOF STATE]
proof (prove)
using this:
dist x1 x3 < e / 3 + e / 3

goal (1 subgoal):
 1. dist x1 x4 < e / 3 + e / 3 + e / 3
[PROOF STEP]
by (metis assms(3) dist_commute dist_triangle_less_add)
[PROOF STATE]
proof (state)
this:
dist x1 x4 < e / 3 + e / 3 + e / 3

goal (1 subgoal):
 1. dist x1 x4 < e
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
dist x1 x4 < e / 3 + e / 3 + e / 3
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
dist x1 x4 < e / 3 + e / 3 + e / 3

goal (1 subgoal):
 1. dist x1 x4 < e
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
dist x1 x4 < e

goal:
No subgoals!
[PROOF STEP]
qed