[STATEMENT]
lemma GreenThm_typeII_twoCube:
  shows "integral (cubeImage twoC) (\<lambda>a. partial_vector_derivative (\<lambda>x. (F x) \<bullet> j) i  a) = one_chain_line_integral F {j} (boundary twoC)"
    "\<forall>(k,\<gamma>) \<in> boundary twoC. line_integral_exists F {j} \<gamma>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral (cubeImage twoC) (partial_vector_derivative (\<lambda>x. F x \<bullet> j) i) = one_chain_line_integral F {j} (boundary twoC) &&& \<forall>(k, \<gamma>)\<in>boundary twoC. line_integral_exists F {j} \<gamma>
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. integral (cubeImage twoC) (partial_vector_derivative (\<lambda>x. F x \<bullet> j) i) = one_chain_line_integral F {j} (boundary twoC)
 2. \<forall>(k, \<gamma>)\<in>boundary twoC. line_integral_exists F {j} \<gamma>
[PROOF STEP]
let ?bottom_edge = "(\<lambda>x. twoC(x, 0))"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. integral (cubeImage twoC) (partial_vector_derivative (\<lambda>x. F x \<bullet> j) i) = one_chain_line_integral F {j} (boundary twoC)
 2. \<forall>(k, \<gamma>)\<in>boundary twoC. line_integral_exists F {j} \<gamma>
[PROOF STEP]
let ?right_edge = "(\<lambda>y. twoC(1, y))"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. integral (cubeImage twoC) (partial_vector_derivative (\<lambda>x. F x \<bullet> j) i) = one_chain_line_integral F {j} (boundary twoC)
 2. \<forall>(k, \<gamma>)\<in>boundary twoC. line_integral_exists F {j} \<gamma>
[PROOF STEP]
let ?top_edge = "(\<lambda>x. twoC(x, 1))"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. integral (cubeImage twoC) (partial_vector_derivative (\<lambda>x. F x \<bullet> j) i) = one_chain_line_integral F {j} (boundary twoC)
 2. \<forall>(k, \<gamma>)\<in>boundary twoC. line_integral_exists F {j} \<gamma>
[PROOF STEP]
let ?left_edge = "(\<lambda>y. twoC(0, y))"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. integral (cubeImage twoC) (partial_vector_derivative (\<lambda>x. F x \<bullet> j) i) = one_chain_line_integral F {j} (boundary twoC)
 2. \<forall>(k, \<gamma>)\<in>boundary twoC. line_integral_exists F {j} \<gamma>
[PROOF STEP]
have line_integral_around_boundary:
      "one_chain_line_integral F {j} (boundary twoC) =
         line_integral F {j} ?bottom_edge + line_integral F {j} ?right_edge
         - line_integral F {j} ?top_edge - line_integral F {j} ?left_edge"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. one_chain_line_integral F {j} (boundary twoC) = line_integral F {j} (\<lambda>x. twoC (x, 0)) + line_integral F {j} (\<lambda>y. twoC (1, y)) - line_integral F {j} (\<lambda>x. twoC (x, 1)) - line_integral F {j} (\<lambda>y. twoC (0, y))
[PROOF STEP]
proof (simp add: one_chain_line_integral_def horizontal_boundary_def vertical_boundary_def boundary_def)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<Sum>x\<in>{(- 1, \<lambda>y. twoC (0, y)), (1, \<lambda>y. twoC (1, y)), (1, \<lambda>x. twoC (x, 0)), (- 1, \<lambda>x. twoC (x, 1))}. case x of (k, g) \<Rightarrow> real_of_int k * line_integral F {j} g) = line_integral F {j} (\<lambda>x. twoC (x, 0)) + line_integral F {j} (\<lambda>y. twoC (1, y)) - line_integral F {j} (\<lambda>x. twoC (x, 1)) - line_integral F {j} (\<lambda>y. twoC (0, y))
[PROOF STEP]
have finite1: "finite {(- 1::int, \<lambda>y. twoC (0, y)), (1, \<lambda>y. twoC (1, y)), (- 1, \<lambda>x. twoC (x, 1))}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {(- 1, \<lambda>y. twoC (0, y)), (1, \<lambda>y. twoC (1, y)), (- 1, \<lambda>x. twoC (x, 1))}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
finite {(- 1, \<lambda>y. twoC (0, y)), (1, \<lambda>y. twoC (1, y)), (- 1, \<lambda>x. twoC (x, 1))}

goal (1 subgoal):
 1. (\<Sum>x\<in>{(- 1, \<lambda>y. twoC (0, y)), (1, \<lambda>y. twoC (1, y)), (1, \<lambda>x. twoC (x, 0)), (- 1, \<lambda>x. twoC (x, 1))}. case x of (k, g) \<Rightarrow> real_of_int k * line_integral F {j} g) = line_integral F {j} (\<lambda>x. twoC (x, 0)) + line_integral F {j} (\<lambda>y. twoC (1, y)) - line_integral F {j} (\<lambda>x. twoC (x, 1)) - line_integral F {j} (\<lambda>y. twoC (0, y))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
finite {(- 1, \<lambda>y. twoC (0, y)), (1, \<lambda>y. twoC (1, y)), (- 1, \<lambda>x. twoC (x, 1))}
[PROOF STEP]
have sum_step1: "(\<Sum>(k, g)\<in>{(- (1::int), \<lambda>y. twoC (0, y)), (1, \<lambda>y. twoC (1, y)), (1, \<lambda>x. twoC (x, 0)), (- 1, \<lambda>x. twoC (x, 1))}. k * line_integral F {j} g) =
                       line_integral F {j} (\<lambda>x. twoC (x, 0)) + (\<Sum>(k, g)\<in>{(- (1::int), \<lambda>y. twoC (0, y)), (1, \<lambda>y. twoC (1, y)), (- 1, \<lambda>x. twoC (x, 1))}. k * line_integral F {j} g)"
[PROOF STATE]
proof (prove)
using this:
finite {(- 1, \<lambda>y. twoC (0, y)), (1, \<lambda>y. twoC (1, y)), (- 1, \<lambda>x. twoC (x, 1))}

goal (1 subgoal):
 1. (\<Sum>(k, g)\<in>{(- 1, \<lambda>y. twoC (0, y)), (1, \<lambda>y. twoC (1, y)), (1, \<lambda>x. twoC (x, 0)), (- 1, \<lambda>x. twoC (x, 1))}. real_of_int k * line_integral F {j} g) = line_integral F {j} (\<lambda>x. twoC (x, 0)) + (\<Sum>(k, g)\<in>{(- 1, \<lambda>y. twoC (0, y)), (1, \<lambda>y. twoC (1, y)), (- 1, \<lambda>x. twoC (x, 1))}. real_of_int k * line_integral F {j} g)
[PROOF STEP]
using sum.insert_remove [OF finite1]
[PROOF STATE]
proof (prove)
using this:
finite {(- 1, \<lambda>y. twoC (0, y)), (1, \<lambda>y. twoC (1, y)), (- 1, \<lambda>x. twoC (x, 1))}
sum ?g {?x, (- 1, \<lambda>y. twoC (0, y)), (1, \<lambda>y. twoC (1, y)), (- 1, \<lambda>x. twoC (x, 1))} = ?g ?x + sum ?g ({(- 1, \<lambda>y. twoC (0, y)), (1, \<lambda>y. twoC (1, y)), (- 1, \<lambda>x. twoC (x, 1))} - {?x})

goal (1 subgoal):
 1. (\<Sum>(k, g)\<in>{(- 1, \<lambda>y. twoC (0, y)), (1, \<lambda>y. twoC (1, y)), (1, \<lambda>x. twoC (x, 0)), (- 1, \<lambda>x. twoC (x, 1))}. real_of_int k * line_integral F {j} g) = line_integral F {j} (\<lambda>x. twoC (x, 0)) + (\<Sum>(k, g)\<in>{(- 1, \<lambda>y. twoC (0, y)), (1, \<lambda>y. twoC (1, y)), (- 1, \<lambda>x. twoC (x, 1))}. real_of_int k * line_integral F {j} g)
[PROOF STEP]
using valid_two_cube
[PROOF STATE]
proof (prove)
using this:
finite {(- 1, \<lambda>y. twoC (0, y)), (1, \<lambda>y. twoC (1, y)), (- 1, \<lambda>x. twoC (x, 1))}
sum ?g {?x, (- 1, \<lambda>y. twoC (0, y)), (1, \<lambda>y. twoC (1, y)), (- 1, \<lambda>x. twoC (x, 1))} = ?g ?x + sum ?g ({(- 1, \<lambda>y. twoC (0, y)), (1, \<lambda>y. twoC (1, y)), (- 1, \<lambda>x. twoC (x, 1))} - {?x})
valid_two_cube twoC

goal (1 subgoal):
 1. (\<Sum>(k, g)\<in>{(- 1, \<lambda>y. twoC (0, y)), (1, \<lambda>y. twoC (1, y)), (1, \<lambda>x. twoC (x, 0)), (- 1, \<lambda>x. twoC (x, 1))}. real_of_int k * line_integral F {j} g) = line_integral F {j} (\<lambda>x. twoC (x, 0)) + (\<Sum>(k, g)\<in>{(- 1, \<lambda>y. twoC (0, y)), (1, \<lambda>y. twoC (1, y)), (- 1, \<lambda>x. twoC (x, 1))}. real_of_int k * line_integral F {j} g)
[PROOF STEP]
apply (simp only: one_chain_line_integral_def horizontal_boundary_def vertical_boundary_def boundary_def valid_two_cube_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite {(- 1, \<lambda>y. twoC (0, y)), (1, \<lambda>y. twoC (1, y)), (- 1, \<lambda>x. twoC (x, 1))}; \<And>g x. sum g {x, (- 1, \<lambda>y. twoC (0, y)), (1, \<lambda>y. twoC (1, y)), (- 1, \<lambda>x. twoC (x, 1))} = g x + sum g ({(- 1, \<lambda>y. twoC (0, y)), (1, \<lambda>y. twoC (1, y)), (- 1, \<lambda>x. twoC (x, 1))} - {x}); card ({(1, \<lambda>x. twoC (x, 0)), (- 1, \<lambda>x. twoC (x, 1))} \<union> {(- 1, \<lambda>y. twoC (0, y)), (1, \<lambda>y. twoC (1, y))}) = 4\<rbrakk> \<Longrightarrow> (\<Sum>(k, g)\<in>{(- 1, \<lambda>y. twoC (0, y)), (1, \<lambda>y. twoC (1, y)), (1, \<lambda>x. twoC (x, 0)), (- 1, \<lambda>x. twoC (x, 1))}. real_of_int k * line_integral F {j} g) = line_integral F {j} (\<lambda>x. twoC (x, 0)) + (\<Sum>(k, g)\<in>{(- 1, \<lambda>y. twoC (0, y)), (1, \<lambda>y. twoC (1, y)), (- 1, \<lambda>x. twoC (x, 1))}. real_of_int k * line_integral F {j} g)
[PROOF STEP]
by (auto simp: card_insert_if split: if_split_asm)
[PROOF STATE]
proof (state)
this:
(\<Sum>(k, g)\<in>{(- 1, \<lambda>y. twoC (0, y)), (1, \<lambda>y. twoC (1, y)), (1, \<lambda>x. twoC (x, 0)), (- 1, \<lambda>x. twoC (x, 1))}. real_of_int k * line_integral F {j} g) = line_integral F {j} (\<lambda>x. twoC (x, 0)) + (\<Sum>(k, g)\<in>{(- 1, \<lambda>y. twoC (0, y)), (1, \<lambda>y. twoC (1, y)), (- 1, \<lambda>x. twoC (x, 1))}. real_of_int k * line_integral F {j} g)

goal (1 subgoal):
 1. (\<Sum>x\<in>{(- 1, \<lambda>y. twoC (0, y)), (1, \<lambda>y. twoC (1, y)), (1, \<lambda>x. twoC (x, 0)), (- 1, \<lambda>x. twoC (x, 1))}. case x of (k, g) \<Rightarrow> real_of_int k * line_integral F {j} g) = line_integral F {j} (\<lambda>x. twoC (x, 0)) + line_integral F {j} (\<lambda>y. twoC (1, y)) - line_integral F {j} (\<lambda>x. twoC (x, 1)) - line_integral F {j} (\<lambda>y. twoC (0, y))
[PROOF STEP]
have three_distinct_edges: "card {(- 1::int, \<lambda>y. twoC (0, y)), (1, \<lambda>y. twoC (1, y)), (- 1, \<lambda>x. twoC (x, 1))} = 3"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card {(- 1, \<lambda>y. twoC (0, y)), (1, \<lambda>y. twoC (1, y)), (- 1, \<lambda>x. twoC (x, 1))} = 3
[PROOF STEP]
using valid_two_cube
[PROOF STATE]
proof (prove)
using this:
valid_two_cube twoC

goal (1 subgoal):
 1. card {(- 1, \<lambda>y. twoC (0, y)), (1, \<lambda>y. twoC (1, y)), (- 1, \<lambda>x. twoC (x, 1))} = 3
[PROOF STEP]
apply (simp add: one_chain_line_integral_def horizontal_boundary_def vertical_boundary_def boundary_def valid_two_cube_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card {(- 1, \<lambda>y. twoC (0, y)), (1, \<lambda>y. twoC (1, y)), (1, \<lambda>x. twoC (x, 0)), (- 1, \<lambda>x. twoC (x, 1))} = 4 \<Longrightarrow> card {(- 1, \<lambda>y. twoC (0, y)), (1, \<lambda>y. twoC (1, y)), (- 1, \<lambda>x. twoC (x, 1))} = 3
[PROOF STEP]
by (auto simp: card_insert_if split: if_split_asm)
[PROOF STATE]
proof (state)
this:
card {(- 1, \<lambda>y. twoC (0, y)), (1, \<lambda>y. twoC (1, y)), (- 1, \<lambda>x. twoC (x, 1))} = 3

goal (1 subgoal):
 1. (\<Sum>x\<in>{(- 1, \<lambda>y. twoC (0, y)), (1, \<lambda>y. twoC (1, y)), (1, \<lambda>x. twoC (x, 0)), (- 1, \<lambda>x. twoC (x, 1))}. case x of (k, g) \<Rightarrow> real_of_int k * line_integral F {j} g) = line_integral F {j} (\<lambda>x. twoC (x, 0)) + line_integral F {j} (\<lambda>y. twoC (1, y)) - line_integral F {j} (\<lambda>x. twoC (x, 1)) - line_integral F {j} (\<lambda>y. twoC (0, y))
[PROOF STEP]
have finite2: "finite {(- 1::int, \<lambda>y. twoC (0, y)), (1, \<lambda>y. twoC (1, y))}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {(- 1, \<lambda>y. twoC (0, y)), (1, \<lambda>y. twoC (1, y))}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
finite {(- 1, \<lambda>y. twoC (0, y)), (1, \<lambda>y. twoC (1, y))}

goal (1 subgoal):
 1. (\<Sum>x\<in>{(- 1, \<lambda>y. twoC (0, y)), (1, \<lambda>y. twoC (1, y)), (1, \<lambda>x. twoC (x, 0)), (- 1, \<lambda>x. twoC (x, 1))}. case x of (k, g) \<Rightarrow> real_of_int k * line_integral F {j} g) = line_integral F {j} (\<lambda>x. twoC (x, 0)) + line_integral F {j} (\<lambda>y. twoC (1, y)) - line_integral F {j} (\<lambda>x. twoC (x, 1)) - line_integral F {j} (\<lambda>y. twoC (0, y))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
finite {(- 1, \<lambda>y. twoC (0, y)), (1, \<lambda>y. twoC (1, y))}
[PROOF STEP]
have sum_step2: "(\<Sum>(k, g)\<in>{(- (1::int), \<lambda>y. twoC (0, y)), (1, \<lambda>y. twoC (1, y)), (-1, \<lambda>x. twoC (x, 1))}. k * line_integral F {j} g) =
                       (- line_integral F {j} (\<lambda>x. twoC (x, 1))) + (\<Sum>(k, g)\<in>{(- (1::int), \<lambda>y. twoC (0, y)), (1, \<lambda>y. twoC (1, y))}. k * line_integral F {j} g)"
[PROOF STATE]
proof (prove)
using this:
finite {(- 1, \<lambda>y. twoC (0, y)), (1, \<lambda>y. twoC (1, y))}

goal (1 subgoal):
 1. (\<Sum>(k, g)\<in>{(- 1, \<lambda>y. twoC (0, y)), (1, \<lambda>y. twoC (1, y)), (- 1, \<lambda>x. twoC (x, 1))}. real_of_int k * line_integral F {j} g) = - line_integral F {j} (\<lambda>x. twoC (x, 1)) + (\<Sum>(k, g)\<in>{(- 1, \<lambda>y. twoC (0, y)), (1, \<lambda>y. twoC (1, y))}. real_of_int k * line_integral F {j} g)
[PROOF STEP]
using sum.insert_remove [OF finite2] three_distinct_edges
[PROOF STATE]
proof (prove)
using this:
finite {(- 1, \<lambda>y. twoC (0, y)), (1, \<lambda>y. twoC (1, y))}
sum ?g {?x, (- 1, \<lambda>y. twoC (0, y)), (1, \<lambda>y. twoC (1, y))} = ?g ?x + sum ?g ({(- 1, \<lambda>y. twoC (0, y)), (1, \<lambda>y. twoC (1, y))} - {?x})
card {(- 1, \<lambda>y. twoC (0, y)), (1, \<lambda>y. twoC (1, y)), (- 1, \<lambda>x. twoC (x, 1))} = 3

goal (1 subgoal):
 1. (\<Sum>(k, g)\<in>{(- 1, \<lambda>y. twoC (0, y)), (1, \<lambda>y. twoC (1, y)), (- 1, \<lambda>x. twoC (x, 1))}. real_of_int k * line_integral F {j} g) = - line_integral F {j} (\<lambda>x. twoC (x, 1)) + (\<Sum>(k, g)\<in>{(- 1, \<lambda>y. twoC (0, y)), (1, \<lambda>y. twoC (1, y))}. real_of_int k * line_integral F {j} g)
[PROOF STEP]
by (auto simp: card_insert_if split: if_split_asm)
[PROOF STATE]
proof (state)
this:
(\<Sum>(k, g)\<in>{(- 1, \<lambda>y. twoC (0, y)), (1, \<lambda>y. twoC (1, y)), (- 1, \<lambda>x. twoC (x, 1))}. real_of_int k * line_integral F {j} g) = - line_integral F {j} (\<lambda>x. twoC (x, 1)) + (\<Sum>(k, g)\<in>{(- 1, \<lambda>y. twoC (0, y)), (1, \<lambda>y. twoC (1, y))}. real_of_int k * line_integral F {j} g)

goal (1 subgoal):
 1. (\<Sum>x\<in>{(- 1, \<lambda>y. twoC (0, y)), (1, \<lambda>y. twoC (1, y)), (1, \<lambda>x. twoC (x, 0)), (- 1, \<lambda>x. twoC (x, 1))}. case x of (k, g) \<Rightarrow> real_of_int k * line_integral F {j} g) = line_integral F {j} (\<lambda>x. twoC (x, 0)) + line_integral F {j} (\<lambda>y. twoC (1, y)) - line_integral F {j} (\<lambda>x. twoC (x, 1)) - line_integral F {j} (\<lambda>y. twoC (0, y))
[PROOF STEP]
have two_distinct_edges: "card {(- 1::int, \<lambda>y. twoC (0, y)), (1, \<lambda>y. twoC (1, y))} = 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card {(- 1, \<lambda>y. twoC (0, y)), (1, \<lambda>y. twoC (1, y))} = 2
[PROOF STEP]
using three_distinct_edges
[PROOF STATE]
proof (prove)
using this:
card {(- 1, \<lambda>y. twoC (0, y)), (1, \<lambda>y. twoC (1, y)), (- 1, \<lambda>x. twoC (x, 1))} = 3

goal (1 subgoal):
 1. card {(- 1, \<lambda>y. twoC (0, y)), (1, \<lambda>y. twoC (1, y))} = 2
[PROOF STEP]
by (simp add: one_chain_line_integral_def horizontal_boundary_def vertical_boundary_def boundary_def)
[PROOF STATE]
proof (state)
this:
card {(- 1, \<lambda>y. twoC (0, y)), (1, \<lambda>y. twoC (1, y))} = 2

goal (1 subgoal):
 1. (\<Sum>x\<in>{(- 1, \<lambda>y. twoC (0, y)), (1, \<lambda>y. twoC (1, y)), (1, \<lambda>x. twoC (x, 0)), (- 1, \<lambda>x. twoC (x, 1))}. case x of (k, g) \<Rightarrow> real_of_int k * line_integral F {j} g) = line_integral F {j} (\<lambda>x. twoC (x, 0)) + line_integral F {j} (\<lambda>y. twoC (1, y)) - line_integral F {j} (\<lambda>x. twoC (x, 1)) - line_integral F {j} (\<lambda>y. twoC (0, y))
[PROOF STEP]
have finite3: "finite {(- 1::int, \<lambda>y. twoC (0, y))}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {(- 1, \<lambda>y. twoC (0, y))}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
finite {(- 1, \<lambda>y. twoC (0, y))}

goal (1 subgoal):
 1. (\<Sum>x\<in>{(- 1, \<lambda>y. twoC (0, y)), (1, \<lambda>y. twoC (1, y)), (1, \<lambda>x. twoC (x, 0)), (- 1, \<lambda>x. twoC (x, 1))}. case x of (k, g) \<Rightarrow> real_of_int k * line_integral F {j} g) = line_integral F {j} (\<lambda>x. twoC (x, 0)) + line_integral F {j} (\<lambda>y. twoC (1, y)) - line_integral F {j} (\<lambda>x. twoC (x, 1)) - line_integral F {j} (\<lambda>y. twoC (0, y))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
finite {(- 1, \<lambda>y. twoC (0, y))}
[PROOF STEP]
have sum_step3: "(\<Sum>(k, g)\<in>{(- (1::int), \<lambda>y. twoC (0, y)), (1, \<lambda>y. twoC (1, y))}. k * line_integral F {j} g) =
                       ( line_integral F {j} (\<lambda>y. twoC (1, y))) + (\<Sum>(k, g)\<in>{(- (1::real), \<lambda>y. twoC (0, y))}. k * line_integral F {j} g)"
[PROOF STATE]
proof (prove)
using this:
finite {(- 1, \<lambda>y. twoC (0, y))}

goal (1 subgoal):
 1. (\<Sum>(k, g)\<in>{(- 1, \<lambda>y. twoC (0, y)), (1, \<lambda>y. twoC (1, y))}. real_of_int k * line_integral F {j} g) = line_integral F {j} (\<lambda>y. twoC (1, y)) + (\<Sum>(k, g)\<in>{(- 1, \<lambda>y. twoC (0, y))}. k * line_integral F {j} g)
[PROOF STEP]
using sum.insert_remove [OF finite2] three_distinct_edges
[PROOF STATE]
proof (prove)
using this:
finite {(- 1, \<lambda>y. twoC (0, y))}
sum ?g {?x, (- 1, \<lambda>y. twoC (0, y)), (1, \<lambda>y. twoC (1, y))} = ?g ?x + sum ?g ({(- 1, \<lambda>y. twoC (0, y)), (1, \<lambda>y. twoC (1, y))} - {?x})
card {(- 1, \<lambda>y. twoC (0, y)), (1, \<lambda>y. twoC (1, y)), (- 1, \<lambda>x. twoC (x, 1))} = 3

goal (1 subgoal):
 1. (\<Sum>(k, g)\<in>{(- 1, \<lambda>y. twoC (0, y)), (1, \<lambda>y. twoC (1, y))}. real_of_int k * line_integral F {j} g) = line_integral F {j} (\<lambda>y. twoC (1, y)) + (\<Sum>(k, g)\<in>{(- 1, \<lambda>y. twoC (0, y))}. k * line_integral F {j} g)
[PROOF STEP]
by (auto simp: card_insert_if split: if_split_asm)
[PROOF STATE]
proof (state)
this:
(\<Sum>(k, g)\<in>{(- 1, \<lambda>y. twoC (0, y)), (1, \<lambda>y. twoC (1, y))}. real_of_int k * line_integral F {j} g) = line_integral F {j} (\<lambda>y. twoC (1, y)) + (\<Sum>(k, g)\<in>{(- 1, \<lambda>y. twoC (0, y))}. k * line_integral F {j} g)

goal (1 subgoal):
 1. (\<Sum>x\<in>{(- 1, \<lambda>y. twoC (0, y)), (1, \<lambda>y. twoC (1, y)), (1, \<lambda>x. twoC (x, 0)), (- 1, \<lambda>x. twoC (x, 1))}. case x of (k, g) \<Rightarrow> real_of_int k * line_integral F {j} g) = line_integral F {j} (\<lambda>x. twoC (x, 0)) + line_integral F {j} (\<lambda>y. twoC (1, y)) - line_integral F {j} (\<lambda>x. twoC (x, 1)) - line_integral F {j} (\<lambda>y. twoC (0, y))
[PROOF STEP]
show "(\<Sum>x\<in>{(- 1::int, \<lambda>y. twoC (0, y)), (1, \<lambda>y. twoC (1, y)), (1, \<lambda>x. twoC (x, 0)), (- 1, \<lambda>x. twoC (x, 1))}. case x of (k, g) \<Rightarrow> k * line_integral F {j} g) =
                  line_integral F {j} (\<lambda>x. twoC (x, 0)) + line_integral F {j} (\<lambda>y. twoC (1, y)) - line_integral F {j} (\<lambda>x. twoC (x, 1)) - line_integral F {j} (\<lambda>y. twoC (0, y))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>x\<in>{(- 1, \<lambda>y. twoC (0, y)), (1, \<lambda>y. twoC (1, y)), (1, \<lambda>x. twoC (x, 0)), (- 1, \<lambda>x. twoC (x, 1))}. case x of (k, g) \<Rightarrow> real_of_int k * line_integral F {j} g) = line_integral F {j} (\<lambda>x. twoC (x, 0)) + line_integral F {j} (\<lambda>y. twoC (1, y)) - line_integral F {j} (\<lambda>x. twoC (x, 1)) - line_integral F {j} (\<lambda>y. twoC (0, y))
[PROOF STEP]
using sum_step1 sum_step2 sum_step3
[PROOF STATE]
proof (prove)
using this:
(\<Sum>(k, g)\<in>{(- 1, \<lambda>y. twoC (0, y)), (1, \<lambda>y. twoC (1, y)), (1, \<lambda>x. twoC (x, 0)), (- 1, \<lambda>x. twoC (x, 1))}. real_of_int k * line_integral F {j} g) = line_integral F {j} (\<lambda>x. twoC (x, 0)) + (\<Sum>(k, g)\<in>{(- 1, \<lambda>y. twoC (0, y)), (1, \<lambda>y. twoC (1, y)), (- 1, \<lambda>x. twoC (x, 1))}. real_of_int k * line_integral F {j} g)
(\<Sum>(k, g)\<in>{(- 1, \<lambda>y. twoC (0, y)), (1, \<lambda>y. twoC (1, y)), (- 1, \<lambda>x. twoC (x, 1))}. real_of_int k * line_integral F {j} g) = - line_integral F {j} (\<lambda>x. twoC (x, 1)) + (\<Sum>(k, g)\<in>{(- 1, \<lambda>y. twoC (0, y)), (1, \<lambda>y. twoC (1, y))}. real_of_int k * line_integral F {j} g)
(\<Sum>(k, g)\<in>{(- 1, \<lambda>y. twoC (0, y)), (1, \<lambda>y. twoC (1, y))}. real_of_int k * line_integral F {j} g) = line_integral F {j} (\<lambda>y. twoC (1, y)) + (\<Sum>(k, g)\<in>{(- 1, \<lambda>y. twoC (0, y))}. k * line_integral F {j} g)

goal (1 subgoal):
 1. (\<Sum>x\<in>{(- 1, \<lambda>y. twoC (0, y)), (1, \<lambda>y. twoC (1, y)), (1, \<lambda>x. twoC (x, 0)), (- 1, \<lambda>x. twoC (x, 1))}. case x of (k, g) \<Rightarrow> real_of_int k * line_integral F {j} g) = line_integral F {j} (\<lambda>x. twoC (x, 0)) + line_integral F {j} (\<lambda>y. twoC (1, y)) - line_integral F {j} (\<lambda>x. twoC (x, 1)) - line_integral F {j} (\<lambda>y. twoC (0, y))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<Sum>x\<in>{(- 1, \<lambda>y. twoC (0, y)), (1, \<lambda>y. twoC (1, y)), (1, \<lambda>x. twoC (x, 0)), (- 1, \<lambda>x. twoC (x, 1))}. case x of (k, g) \<Rightarrow> real_of_int k * line_integral F {j} g) = line_integral F {j} (\<lambda>x. twoC (x, 0)) + line_integral F {j} (\<lambda>y. twoC (1, y)) - line_integral F {j} (\<lambda>x. twoC (x, 1)) - line_integral F {j} (\<lambda>y. twoC (0, y))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
one_chain_line_integral F {j} (boundary twoC) = line_integral F {j} (\<lambda>x. twoC (x, 0)) + line_integral F {j} (\<lambda>y. twoC (1, y)) - line_integral F {j} (\<lambda>x. twoC (x, 1)) - line_integral F {j} (\<lambda>y. twoC (0, y))

goal (2 subgoals):
 1. integral (cubeImage twoC) (partial_vector_derivative (\<lambda>x. F x \<bullet> j) i) = one_chain_line_integral F {j} (boundary twoC)
 2. \<forall>(k, \<gamma>)\<in>boundary twoC. line_integral_exists F {j} \<gamma>
[PROOF STEP]
obtain a b g1 g2 where
    twoCisTypeII: "a < b"
    "(\<forall>x \<in> cbox a b. g2 x \<le> g1 x)"
    "cubeImage twoC = {(y, x). x \<in> cbox a b \<and> y \<in> cbox (g2 x) (g1 x)}"
    "twoC = (\<lambda>(y, x). ((1 - y) * g2 ((1 - x) * a + x * b) + y * g1 ((1 - x) * a + x * b), (1 - x) * a + x * b))"
    "g1 piecewise_C1_differentiable_on {a .. b}"
    "g2 piecewise_C1_differentiable_on {a .. b}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>a b g2 g1. \<lbrakk>a < b; \<forall>x\<in>cbox a b. g2 x \<le> g1 x; cubeImage twoC = {(y, x). x \<in> cbox a b \<and> y \<in> cbox (g2 x) (g1 x)}; twoC = (\<lambda>(y, x). ((1 - y) * g2 ((1 - x) * a + x * b) + y * g1 ((1 - x) * a + x * b), (1 - x) * a + x * b)); g1 piecewise_C1_differentiable_on {a..b}; g2 piecewise_C1_differentiable_on {a..b}\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using two_cube and typeII_twoCubeImg[of"twoC"]
[PROOF STATE]
proof (prove)
using this:
typeII_twoCube twoC
typeII_twoCube twoC \<Longrightarrow> \<exists>a b g1 g2. a < b \<and> (\<forall>x\<in>{a..b}. g2 x \<le> g1 x) \<and> cubeImage twoC = {(y, x). x \<in> {a..b} \<and> y \<in> {g2 x..g1 x}} \<and> twoC = (\<lambda>(y, x). ((1 - y) * g2 ((1 - x) * a + x * b) + y * g1 ((1 - x) * a + x * b), (1 - x) * a + x * b)) \<and> g1 piecewise_C1_differentiable_on {a..b} \<and> g2 piecewise_C1_differentiable_on {a..b}

goal (1 subgoal):
 1. (\<And>a b g2 g1. \<lbrakk>a < b; \<forall>x\<in>cbox a b. g2 x \<le> g1 x; cubeImage twoC = {(y, x). x \<in> cbox a b \<and> y \<in> cbox (g2 x) (g1 x)}; twoC = (\<lambda>(y, x). ((1 - y) * g2 ((1 - x) * a + x * b) + y * g1 ((1 - x) * a + x * b), (1 - x) * a + x * b)); g1 piecewise_C1_differentiable_on {a..b}; g2 piecewise_C1_differentiable_on {a..b}\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
a < b
\<forall>x\<in>cbox a b. g2 x \<le> g1 x
cubeImage twoC = {(y, x). x \<in> cbox a b \<and> y \<in> cbox (g2 x) (g1 x)}
twoC = (\<lambda>(y, x). ((1 - y) * g2 ((1 - x) * a + x * b) + y * g1 ((1 - x) * a + x * b), (1 - x) * a + x * b))
g1 piecewise_C1_differentiable_on {a..b}
g2 piecewise_C1_differentiable_on {a..b}

goal (2 subgoals):
 1. integral (cubeImage twoC) (partial_vector_derivative (\<lambda>x. F x \<bullet> j) i) = one_chain_line_integral F {j} (boundary twoC)
 2. \<forall>(k, \<gamma>)\<in>boundary twoC. line_integral_exists F {j} \<gamma>
[PROOF STEP]
have left_edge_explicit: "?left_edge = (\<lambda>x. (g2 (a + (b - a) * x), a + (b - a) * x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>y. twoC (0, y)) = (\<lambda>x. (g2 (a + (b - a) * x), a + (b - a) * x))
[PROOF STEP]
by (simp add: twoCisTypeII(4) algebra_simps)
[PROOF STATE]
proof (state)
this:
(\<lambda>y. twoC (0, y)) = (\<lambda>x. (g2 (a + (b - a) * x), a + (b - a) * x))

goal (2 subgoals):
 1. integral (cubeImage twoC) (partial_vector_derivative (\<lambda>x. F x \<bullet> j) i) = one_chain_line_integral F {j} (boundary twoC)
 2. \<forall>(k, \<gamma>)\<in>boundary twoC. line_integral_exists F {j} \<gamma>
[PROOF STEP]
have left_edge_smooth: "?left_edge piecewise_C1_differentiable_on {0..1}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>y. twoC (0, y)) piecewise_C1_differentiable_on {0..1}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<lambda>y. twoC (0, y)) piecewise_C1_differentiable_on {0..1}
[PROOF STEP]
have "\<forall>x. (\<lambda>x. (a + (b - a) * x))-` {x} = {(x - a)/(b -a)}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x. (\<lambda>x. a + (b - a) * x) -` {x} = {(x - a) / (b - a)}
[PROOF STEP]
using twoCisTypeII(1)
[PROOF STATE]
proof (prove)
using this:
a < b

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

goal (1 subgoal):
 1. (\<lambda>y. twoC (0, y)) piecewise_C1_differentiable_on {0..1}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>x. (\<lambda>x. a + (b - a) * x) -` {x} = {(x - a) / (b - a)}
[PROOF STEP]
have finite_vimg: "\<And>x. finite({0..1} \<inter> (\<lambda>x. (a + (b - a) * x))-` {x})"
[PROOF STATE]
proof (prove)
using this:
\<forall>x. (\<lambda>x. a + (b - a) * x) -` {x} = {(x - a) / (b - a)}

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

goal (1 subgoal):
 1. (\<lambda>y. twoC (0, y)) piecewise_C1_differentiable_on {0..1}
[PROOF STEP]
have scale_shif_smth: "(\<lambda>x. (a + (b - a) * x)) C1_differentiable_on {0..1}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. a + (b - a) * x) C1_differentiable_on {0..1}
[PROOF STEP]
using scale_shift_smooth
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. ?a + ?b * x) C1_differentiable_on ?s

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

goal (1 subgoal):
 1. (\<lambda>y. twoC (0, y)) piecewise_C1_differentiable_on {0..1}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>x. a + (b - a) * x) C1_differentiable_on {0..1}
[PROOF STEP]
have scale_shif_pw_smth: "(\<lambda>x. (a + (b - a) * x)) piecewise_C1_differentiable_on {0..1}"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. a + (b - a) * x) C1_differentiable_on {0..1}

goal (1 subgoal):
 1. (\<lambda>x. a + (b - a) * x) piecewise_C1_differentiable_on {0..1}
[PROOF STEP]
using C1_differentiable_imp_piecewise
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. a + (b - a) * x) C1_differentiable_on {0..1}
?f C1_differentiable_on ?S \<Longrightarrow> ?f piecewise_C1_differentiable_on ?S

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

goal (1 subgoal):
 1. (\<lambda>y. twoC (0, y)) piecewise_C1_differentiable_on {0..1}
[PROOF STEP]
have g2_smooth: "g2 piecewise_C1_differentiable_on (\<lambda>x. a + (b - a) * x) ` {0..1}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. g2 piecewise_C1_differentiable_on (\<lambda>x. a + (b - a) * x) ` {0..1}
[PROOF STEP]
using add_scale_img[OF twoCisTypeII(1)] twoCisTypeII(6)
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. a + (b - a) * x) ` {0..1} = {a..b}
g2 piecewise_C1_differentiable_on {a..b}

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

goal (1 subgoal):
 1. (\<lambda>y. twoC (0, y)) piecewise_C1_differentiable_on {0..1}
[PROOF STEP]
have "(\<lambda>x. g2 (a + (b - a) * x)) piecewise_C1_differentiable_on {0..1}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. g2 (a + (b - a) * x)) piecewise_C1_differentiable_on {0..1}
[PROOF STEP]
using piecewise_C1_differentiable_compose[OF scale_shif_pw_smth g2_smooth finite_vimg]
[PROOF STATE]
proof (prove)
using this:
g2 \<circ> (\<lambda>x. a + (b - a) * x) piecewise_C1_differentiable_on {0..1}

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

goal (1 subgoal):
 1. (\<lambda>y. twoC (0, y)) piecewise_C1_differentiable_on {0..1}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>x. g2 (a + (b - a) * x)) piecewise_C1_differentiable_on {0..1}
[PROOF STEP]
have "(\<lambda>x::real. (g2 (a + (b - a) * x), a + (b - a) * x)) piecewise_C1_differentiable_on {0..1}"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. g2 (a + (b - a) * x)) piecewise_C1_differentiable_on {0..1}

goal (1 subgoal):
 1. (\<lambda>x. (g2 (a + (b - a) * x), a + (b - a) * x)) piecewise_C1_differentiable_on {0..1}
[PROOF STEP]
using all_components_smooth_one_pw_smooth_is_pw_smooth[where f = "(\<lambda>x::real. (g2 (a + (b - a) * x), a + (b - a) * x))"]
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. g2 (a + (b - a) * x)) piecewise_C1_differentiable_on {0..1}
\<lbrakk>\<And>i. i \<in> Basis - {?j} \<Longrightarrow> (\<lambda>x. (g2 (a + (b - a) * x), a + (b - a) * x) \<bullet> i) C1_differentiable_on ?s; (\<lambda>x. (g2 (a + (b - a) * x), a + (b - a) * x) \<bullet> ?j) piecewise_C1_differentiable_on ?s\<rbrakk> \<Longrightarrow> (\<lambda>x. (g2 (a + (b - a) * x), a + (b - a) * x)) piecewise_C1_differentiable_on ?s

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

goal (1 subgoal):
 1. (\<lambda>y. twoC (0, y)) piecewise_C1_differentiable_on {0..1}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>x. (g2 (a + (b - a) * x), a + (b - a) * x)) piecewise_C1_differentiable_on {0..1}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. (g2 (a + (b - a) * x), a + (b - a) * x)) piecewise_C1_differentiable_on {0..1}

goal (1 subgoal):
 1. (\<lambda>y. twoC (0, y)) piecewise_C1_differentiable_on {0..1}
[PROOF STEP]
using left_edge_explicit
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. (g2 (a + (b - a) * x), a + (b - a) * x)) piecewise_C1_differentiable_on {0..1}
(\<lambda>y. twoC (0, y)) = (\<lambda>x. (g2 (a + (b - a) * x), a + (b - a) * x))

goal (1 subgoal):
 1. (\<lambda>y. twoC (0, y)) piecewise_C1_differentiable_on {0..1}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<lambda>y. twoC (0, y)) piecewise_C1_differentiable_on {0..1}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<lambda>y. twoC (0, y)) piecewise_C1_differentiable_on {0..1}

goal (2 subgoals):
 1. integral (cubeImage twoC) (partial_vector_derivative (\<lambda>x. F x \<bullet> j) i) = one_chain_line_integral F {j} (boundary twoC)
 2. \<forall>(k, \<gamma>)\<in>boundary twoC. line_integral_exists F {j} \<gamma>
[PROOF STEP]
have top_edge_explicit: "?top_edge = (\<lambda>x. (g2 b + x *\<^sub>R (g1 b - g2 b), b))"
   and right_edge_explicit: "?right_edge = (\<lambda>x. (g1 (a + (b - a) * x), a + (b - a) * x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. twoC (x, 1)) = (\<lambda>x. (g2 b + x *\<^sub>R (g1 b - g2 b), b)) &&& (\<lambda>y. twoC (1, y)) = (\<lambda>x. (g1 (a + (b - a) * x), a + (b - a) * x))
[PROOF STEP]
by (simp_all add: twoCisTypeII(4) algebra_simps)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. twoC (x, 1)) = (\<lambda>x. (g2 b + x *\<^sub>R (g1 b - g2 b), b))
(\<lambda>y. twoC (1, y)) = (\<lambda>x. (g1 (a + (b - a) * x), a + (b - a) * x))

goal (2 subgoals):
 1. integral (cubeImage twoC) (partial_vector_derivative (\<lambda>x. F x \<bullet> j) i) = one_chain_line_integral F {j} (boundary twoC)
 2. \<forall>(k, \<gamma>)\<in>boundary twoC. line_integral_exists F {j} \<gamma>
[PROOF STEP]
have right_edge_smooth: "?right_edge piecewise_C1_differentiable_on {0..1}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>y. twoC (1, y)) piecewise_C1_differentiable_on {0..1}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<lambda>y. twoC (1, y)) piecewise_C1_differentiable_on {0..1}
[PROOF STEP]
have "\<forall>x. (\<lambda>x. (a + (b - a) * x))-` {x} = {(x - a)/(b -a)}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x. (\<lambda>x. a + (b - a) * x) -` {x} = {(x - a) / (b - a)}
[PROOF STEP]
using twoCisTypeII(1)
[PROOF STATE]
proof (prove)
using this:
a < b

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

goal (1 subgoal):
 1. (\<lambda>y. twoC (1, y)) piecewise_C1_differentiable_on {0..1}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>x. (\<lambda>x. a + (b - a) * x) -` {x} = {(x - a) / (b - a)}
[PROOF STEP]
have finite_vimg: "\<And>x. finite({0..1} \<inter> (\<lambda>x. (a + (b - a) * x))-` {x})"
[PROOF STATE]
proof (prove)
using this:
\<forall>x. (\<lambda>x. a + (b - a) * x) -` {x} = {(x - a) / (b - a)}

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

goal (1 subgoal):
 1. (\<lambda>y. twoC (1, y)) piecewise_C1_differentiable_on {0..1}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
finite ({0..1} \<inter> (\<lambda>x. a + (b - a) * x) -` {?x})
[PROOF STEP]
have scale_shif_pw_smth: "(\<lambda>x. (a + (b - a) * x)) piecewise_C1_differentiable_on {0..1}"
[PROOF STATE]
proof (prove)
using this:
finite ({0..1} \<inter> (\<lambda>x. a + (b - a) * x) -` {?x})

goal (1 subgoal):
 1. (\<lambda>x. a + (b - a) * x) piecewise_C1_differentiable_on {0..1}
[PROOF STEP]
using C1_differentiable_imp_piecewise [OF scale_shift_smooth]
[PROOF STATE]
proof (prove)
using this:
finite ({0..1} \<inter> (\<lambda>x. a + (b - a) * x) -` {?x})
(\<lambda>x. ?a1 + ?b1 * x) piecewise_C1_differentiable_on ?S

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

goal (1 subgoal):
 1. (\<lambda>y. twoC (1, y)) piecewise_C1_differentiable_on {0..1}
[PROOF STEP]
have g1_smooth: "g1 piecewise_C1_differentiable_on (\<lambda>x. a + (b - a) * x) ` {0..1}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. g1 piecewise_C1_differentiable_on (\<lambda>x. a + (b - a) * x) ` {0..1}
[PROOF STEP]
using add_scale_img[OF twoCisTypeII(1)] twoCisTypeII(5)
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. a + (b - a) * x) ` {0..1} = {a..b}
g1 piecewise_C1_differentiable_on {a..b}

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

goal (1 subgoal):
 1. (\<lambda>y. twoC (1, y)) piecewise_C1_differentiable_on {0..1}
[PROOF STEP]
have "(\<lambda>x. g1 (a + (b - a) * x)) piecewise_C1_differentiable_on {0..1}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. g1 (a + (b - a) * x)) piecewise_C1_differentiable_on {0..1}
[PROOF STEP]
using piecewise_C1_differentiable_compose[OF scale_shif_pw_smth g1_smooth finite_vimg]
[PROOF STATE]
proof (prove)
using this:
g1 \<circ> (\<lambda>x. a + (b - a) * x) piecewise_C1_differentiable_on {0..1}

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

goal (1 subgoal):
 1. (\<lambda>y. twoC (1, y)) piecewise_C1_differentiable_on {0..1}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>x. g1 (a + (b - a) * x)) piecewise_C1_differentiable_on {0..1}
[PROOF STEP]
have "(\<lambda>x::real. (g1 (a + (b - a) * x), a + (b - a) * x)) piecewise_C1_differentiable_on {0..1}"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. g1 (a + (b - a) * x)) piecewise_C1_differentiable_on {0..1}

goal (1 subgoal):
 1. (\<lambda>x. (g1 (a + (b - a) * x), a + (b - a) * x)) piecewise_C1_differentiable_on {0..1}
[PROOF STEP]
using all_components_smooth_one_pw_smooth_is_pw_smooth[where f = "(\<lambda>x::real. (g1 (a + (b - a) * x), a + (b - a) * x))"]
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. g1 (a + (b - a) * x)) piecewise_C1_differentiable_on {0..1}
\<lbrakk>\<And>i. i \<in> Basis - {?j} \<Longrightarrow> (\<lambda>x. (g1 (a + (b - a) * x), a + (b - a) * x) \<bullet> i) C1_differentiable_on ?s; (\<lambda>x. (g1 (a + (b - a) * x), a + (b - a) * x) \<bullet> ?j) piecewise_C1_differentiable_on ?s\<rbrakk> \<Longrightarrow> (\<lambda>x. (g1 (a + (b - a) * x), a + (b - a) * x)) piecewise_C1_differentiable_on ?s

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

goal (1 subgoal):
 1. (\<lambda>y. twoC (1, y)) piecewise_C1_differentiable_on {0..1}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>x. (g1 (a + (b - a) * x), a + (b - a) * x)) piecewise_C1_differentiable_on {0..1}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. (g1 (a + (b - a) * x), a + (b - a) * x)) piecewise_C1_differentiable_on {0..1}

goal (1 subgoal):
 1. (\<lambda>y. twoC (1, y)) piecewise_C1_differentiable_on {0..1}
[PROOF STEP]
using right_edge_explicit
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. (g1 (a + (b - a) * x), a + (b - a) * x)) piecewise_C1_differentiable_on {0..1}
(\<lambda>y. twoC (1, y)) = (\<lambda>x. (g1 (a + (b - a) * x), a + (b - a) * x))

goal (1 subgoal):
 1. (\<lambda>y. twoC (1, y)) piecewise_C1_differentiable_on {0..1}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<lambda>y. twoC (1, y)) piecewise_C1_differentiable_on {0..1}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<lambda>y. twoC (1, y)) piecewise_C1_differentiable_on {0..1}

goal (2 subgoals):
 1. integral (cubeImage twoC) (partial_vector_derivative (\<lambda>x. F x \<bullet> j) i) = one_chain_line_integral F {j} (boundary twoC)
 2. \<forall>(k, \<gamma>)\<in>boundary twoC. line_integral_exists F {j} \<gamma>
[PROOF STEP]
have bottom_edge_explicit: "?bottom_edge = (\<lambda>x. (g2 a + x *\<^sub>R (g1 a - g2 a), a))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. twoC (x, 0)) = (\<lambda>x. (g2 a + x *\<^sub>R (g1 a - g2 a), a))
[PROOF STEP]
by (simp add: twoCisTypeII(4) algebra_simps)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. twoC (x, 0)) = (\<lambda>x. (g2 a + x *\<^sub>R (g1 a - g2 a), a))

goal (2 subgoals):
 1. integral (cubeImage twoC) (partial_vector_derivative (\<lambda>x. F x \<bullet> j) i) = one_chain_line_integral F {j} (boundary twoC)
 2. \<forall>(k, \<gamma>)\<in>boundary twoC. line_integral_exists F {j} \<gamma>
[PROOF STEP]
show "integral (cubeImage twoC) (\<lambda>a. partial_vector_derivative (\<lambda>x. (F x) \<bullet> j) i  a) = one_chain_line_integral F {j} (boundary twoC)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral (cubeImage twoC) (partial_vector_derivative (\<lambda>x. F x \<bullet> j) i) = one_chain_line_integral F {j} (boundary twoC)
[PROOF STEP]
using Greens_thm_type_II[OF twoCisTypeII(3) left_edge_explicit left_edge_smooth
        top_edge_explicit right_edge_explicit right_edge_smooth
        bottom_edge_explicit f_analytically_valid
        twoCisTypeII(2) twoCisTypeII(1)]
      line_integral_around_boundary
[PROOF STATE]
proof (prove)
using this:
- line_integral F {j} (\<lambda>y. twoC (0, y)) - line_integral F {j} (\<lambda>x. twoC (x, 1)) + line_integral F {j} (\<lambda>y. twoC (1, y)) + line_integral F {j} (\<lambda>x. twoC (x, 0)) = integral (cubeImage twoC) (partial_vector_derivative (\<lambda>a. F a \<bullet> j) i)
line_integral_exists F {j} (\<lambda>y. twoC (0, y))
line_integral_exists F {j} (\<lambda>x. twoC (x, 1))
line_integral_exists F {j} (\<lambda>y. twoC (1, y))
line_integral_exists F {j} (\<lambda>x. twoC (x, 0))
one_chain_line_integral F {j} (boundary twoC) = line_integral F {j} (\<lambda>x. twoC (x, 0)) + line_integral F {j} (\<lambda>y. twoC (1, y)) - line_integral F {j} (\<lambda>x. twoC (x, 1)) - line_integral F {j} (\<lambda>y. twoC (0, y))

goal (1 subgoal):
 1. integral (cubeImage twoC) (partial_vector_derivative (\<lambda>x. F x \<bullet> j) i) = one_chain_line_integral F {j} (boundary twoC)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
integral (cubeImage twoC) (partial_vector_derivative (\<lambda>x. F x \<bullet> j) i) = one_chain_line_integral F {j} (boundary twoC)

goal (1 subgoal):
 1. \<forall>(k, \<gamma>)\<in>boundary twoC. line_integral_exists F {j} \<gamma>
[PROOF STEP]
have "line_integral_exists F {j} \<gamma>" if "(k,\<gamma>) \<in> boundary twoC" for k \<gamma>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. line_integral_exists F {j} \<gamma>
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. line_integral_exists F {j} \<gamma>
[PROOF STEP]
have "line_integral_exists F {j} (\<lambda>y. twoC (0, y))"
         "line_integral_exists F {j} (\<lambda>x. twoC (x, 1))"
         "line_integral_exists F {j} (\<lambda>y. twoC (1, y))"
         "line_integral_exists F {j} (\<lambda>x. twoC (x, 0))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (line_integral_exists F {j} (\<lambda>y. twoC (0, y)) &&& line_integral_exists F {j} (\<lambda>x. twoC (x, 1))) &&& line_integral_exists F {j} (\<lambda>y. twoC (1, y)) &&& line_integral_exists F {j} (\<lambda>x. twoC (x, 0))
[PROOF STEP]
using Greens_thm_type_II[OF twoCisTypeII(3) left_edge_explicit left_edge_smooth
          top_edge_explicit right_edge_explicit right_edge_smooth
          bottom_edge_explicit f_analytically_valid
          twoCisTypeII(2) twoCisTypeII(1)] line_integral_around_boundary
[PROOF STATE]
proof (prove)
using this:
- line_integral F {j} (\<lambda>y. twoC (0, y)) - line_integral F {j} (\<lambda>x. twoC (x, 1)) + line_integral F {j} (\<lambda>y. twoC (1, y)) + line_integral F {j} (\<lambda>x. twoC (x, 0)) = integral (cubeImage twoC) (partial_vector_derivative (\<lambda>a. F a \<bullet> j) i)
line_integral_exists F {j} (\<lambda>y. twoC (0, y))
line_integral_exists F {j} (\<lambda>x. twoC (x, 1))
line_integral_exists F {j} (\<lambda>y. twoC (1, y))
line_integral_exists F {j} (\<lambda>x. twoC (x, 0))
one_chain_line_integral F {j} (boundary twoC) = line_integral F {j} (\<lambda>x. twoC (x, 0)) + line_integral F {j} (\<lambda>y. twoC (1, y)) - line_integral F {j} (\<lambda>x. twoC (x, 1)) - line_integral F {j} (\<lambda>y. twoC (0, y))

goal (1 subgoal):
 1. (line_integral_exists F {j} (\<lambda>y. twoC (0, y)) &&& line_integral_exists F {j} (\<lambda>x. twoC (x, 1))) &&& line_integral_exists F {j} (\<lambda>y. twoC (1, y)) &&& line_integral_exists F {j} (\<lambda>x. twoC (x, 0))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
line_integral_exists F {j} (\<lambda>y. twoC (0, y))
line_integral_exists F {j} (\<lambda>x. twoC (x, 1))
line_integral_exists F {j} (\<lambda>y. twoC (1, y))
line_integral_exists F {j} (\<lambda>x. twoC (x, 0))

goal (1 subgoal):
 1. line_integral_exists F {j} \<gamma>
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
line_integral_exists F {j} (\<lambda>y. twoC (0, y))
line_integral_exists F {j} (\<lambda>x. twoC (x, 1))
line_integral_exists F {j} (\<lambda>y. twoC (1, y))
line_integral_exists F {j} (\<lambda>x. twoC (x, 0))
[PROOF STEP]
show "line_integral_exists F {j} \<gamma>"
[PROOF STATE]
proof (prove)
using this:
line_integral_exists F {j} (\<lambda>y. twoC (0, y))
line_integral_exists F {j} (\<lambda>x. twoC (x, 1))
line_integral_exists F {j} (\<lambda>y. twoC (1, y))
line_integral_exists F {j} (\<lambda>x. twoC (x, 0))

goal (1 subgoal):
 1. line_integral_exists F {j} \<gamma>
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
line_integral_exists F {j} (\<lambda>y. twoC (0, y))
line_integral_exists F {j} (\<lambda>x. twoC (x, 1))
line_integral_exists F {j} (\<lambda>y. twoC (1, y))
line_integral_exists F {j} (\<lambda>x. twoC (x, 0))
(k, \<gamma>) \<in> boundary twoC

goal (1 subgoal):
 1. line_integral_exists F {j} \<gamma>
[PROOF STEP]
by (auto simp add: boundary_def horizontal_boundary_def vertical_boundary_def)
[PROOF STATE]
proof (state)
this:
line_integral_exists F {j} \<gamma>

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(?k, ?\<gamma>) \<in> boundary twoC \<Longrightarrow> line_integral_exists F {j} ?\<gamma>

goal (1 subgoal):
 1. \<forall>(k, \<gamma>)\<in>boundary twoC. line_integral_exists F {j} \<gamma>
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(?k, ?\<gamma>) \<in> boundary twoC \<Longrightarrow> line_integral_exists F {j} ?\<gamma>
[PROOF STEP]
show "\<forall>(k,\<gamma>) \<in> boundary twoC. line_integral_exists F {j} \<gamma>"
[PROOF STATE]
proof (prove)
using this:
(?k, ?\<gamma>) \<in> boundary twoC \<Longrightarrow> line_integral_exists F {j} ?\<gamma>

goal (1 subgoal):
 1. \<forall>(k, \<gamma>)\<in>boundary twoC. line_integral_exists F {j} \<gamma>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>(k, \<gamma>)\<in>boundary twoC. line_integral_exists F {j} \<gamma>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma pos_less_minus_divide_eq [field_simps]: "0 < c \<Longrightarrow> a < - (b / c) \<longleftrightarrow> a * c < - b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0::'a) < c \<Longrightarrow> (a < - (b / c)) = (a * c < - b)
[PROOF STEP]
unfolding minus_divide_left
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0::'a) < c \<Longrightarrow> (a < - b / c) = (a * c < - b)
[PROOF STEP]
by (rule pos_less_divide_eq)


[STATEMENT]
lemma linf_norm_vec_as_Greatest:
  fixes v :: "'a :: ring_1_abs_real_line vec"
  shows "\<parallel>v\<parallel>\<^sub>\<infinity> = (GREATEST a. a \<in> abs ` set (list_of_vec v) \<union> {0})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<parallel>v\<parallel>\<^sub>\<infinity> = (GREATEST a. a \<in> abs ` set (list_of_vec v) \<union> {0::'a})
[PROOF STEP]
unfolding linf_norm_vec_of_list[of "list_of_vec v", simplified]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Missing_Lemmas.max_list (map abs (list_of_vec v) @ [0::'a]) = (GREATEST a. a \<in> abs ` set (list_of_vec v) \<union> {0::'a})
[PROOF STEP]
by (subst max_list_as_Greatest, auto)


[STATEMENT]
lemma affine_parallel_expl: "affine_parallel S T \<longleftrightarrow> (\<exists>a. \<forall>x. x \<in> S \<longleftrightarrow> a + x \<in> T)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. affine_parallel S T = (\<exists>a. \<forall>x. (x \<in> S) = (a + x \<in> T))
[PROOF STEP]
by (auto simp add: affine_parallel_def)
    (use affine_parallel_expl_aux [of S _ T] in blast)


[STATEMENT]
lemma pt_list_inst:
  assumes pt: "pt TYPE('a) TYPE('x)"
  shows  "pt TYPE('a list) TYPE('x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pt TYPE('a list) TYPE('x)
[PROOF STEP]
apply(auto simp only: pt_def)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>x. [] \<bullet> x = x
 2. \<And>pi1 pi2 x. (pi1 @ pi2) \<bullet> x = pi1 \<bullet> pi2 \<bullet> x
 3. \<And>pi1 pi2 x.  pi1 \<triangleq> pi2  \<Longrightarrow> pi1 \<bullet> x = pi2 \<bullet> x
[PROOF STEP]
apply(rule pt_list_nil[OF pt])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>pi1 pi2 x. (pi1 @ pi2) \<bullet> x = pi1 \<bullet> pi2 \<bullet> x
 2. \<And>pi1 pi2 x.  pi1 \<triangleq> pi2  \<Longrightarrow> pi1 \<bullet> x = pi2 \<bullet> x
[PROOF STEP]
apply(rule pt_list_append[OF pt])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>pi1 pi2 x.  pi1 \<triangleq> pi2  \<Longrightarrow> pi1 \<bullet> x = pi2 \<bullet> x
[PROOF STEP]
apply(rule pt_list_prm_eq[OF pt],assumption)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma (in group) setmult_rcos_assoc:
  "\<lbrakk>H \<subseteq> carrier G; K \<subseteq> carrier G; x \<in> carrier G\<rbrakk> \<Longrightarrow>
    H <#> (K #> x) = (H <#> K) #> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>H \<subseteq> carrier G; K \<subseteq> carrier G; x \<in> carrier G\<rbrakk> \<Longrightarrow> H <#> (K #> x) = H <#> K #> x
[PROOF STEP]
using set_mult_assoc[of H K "{x}"]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>H \<subseteq> carrier G; K \<subseteq> carrier G; {x} \<subseteq> carrier G\<rbrakk> \<Longrightarrow> H <#> K <#> {x} = H <#> (K <#> {x})

goal (1 subgoal):
 1. \<lbrakk>H \<subseteq> carrier G; K \<subseteq> carrier G; x \<in> carrier G\<rbrakk> \<Longrightarrow> H <#> (K #> x) = H <#> K #> x
[PROOF STEP]
by (simp add: r_coset_eq_set_mult)


[STATEMENT]
lemma (in ring_closed) coeff_poly_mult_closed [intro]:
  assumes "\<And>i. poly.coeff p i \<in> A" "\<And>i. poly.coeff q i \<in> A"
  shows   "poly.coeff (p * q) i \<in> A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly.coeff (p * q) i \<in> A
[PROOF STEP]
unfolding coeff_mult
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>ia\<le>i. poly.coeff p ia * poly.coeff q (i - ia)) \<in> A
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
poly.coeff p ?i \<in> A
poly.coeff q ?i \<in> A

goal (1 subgoal):
 1. (\<Sum>ia\<le>i. poly.coeff p ia * poly.coeff q (i - ia)) \<in> A
[PROOF STEP]
by auto


[STATEMENT]
lemma Gmult_diff:
  assumes "a \<in> G" "n\<le>m"
  shows "Gmult a m \<ominus> Gmult a n = Gmult a (m-n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Gmult a m \<ominus> Gmult a n = Gmult a (m - n)
[PROOF STEP]
by (metis Gmult_add_diff assms le_add_diff_inverse)


[STATEMENT]
lemma log_exp2_ge: "2 * 2 ^ log n \<ge> n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n \<le> 2 * 2 ^ local.log n
[PROOF STEP]
using log_exp2_gt[of n]
[PROOF STATE]
proof (prove)
using this:
n < 2 * 2 ^ local.log n

goal (1 subgoal):
 1. n \<le> 2 * 2 ^ local.log n
[PROOF STEP]
by simp


[STATEMENT]
lemma surj_Sup_pres_id:
  fixes f :: "'a::complete_lattice_with_dual \<Rightarrow> 'b::complete_lattice_with_dual"
  assumes "surj f"
  and "Sup_pres f"
  shows "f \<circ> (radj f) = id"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<circ> radj f = id
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. f \<circ> radj f = id
[PROOF STEP]
have "f \<stileturn> (radj f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<stileturn> radj f
[PROOF STEP]
using Sup_pres_ladj assms(2) radj_adj
[PROOF STATE]
proof (prove)
using this:
Sup_pres ?f \<Longrightarrow> \<exists>g. ?f \<stileturn> g
Sup_pres f
?f \<stileturn> ?g \<Longrightarrow> ?g = radj ?f

goal (1 subgoal):
 1. f \<stileturn> radj f
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
f \<stileturn> radj f

goal (1 subgoal):
 1. f \<circ> radj f = id
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
f \<stileturn> radj f

goal (1 subgoal):
 1. f \<circ> radj f = id
[PROOF STEP]
using adj_sur_inv assms(1)
[PROOF STATE]
proof (prove)
using this:
f \<stileturn> radj f
?f \<stileturn> ?g \<Longrightarrow> top_pres ((`) ?f) = (?f \<circ> ?g = id)
top_pres ((`) f)

goal (1 subgoal):
 1. f \<circ> radj f = id
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
f \<circ> radj f = id

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in domain) pprimeE:
  assumes "subfield K R" "p \<in> carrier (K[X])" "pprime K p"
  shows "p \<noteq> []" "p \<notin> Units (K[X])"
    and "\<And>q r. \<lbrakk> q \<in> carrier (K[X]); r \<in> carrier (K[X])\<rbrakk> \<Longrightarrow>
                 p pdivides (q \<otimes>\<^bsub>K[X]\<^esub> r) \<Longrightarrow> p pdivides q \<or> p pdivides r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (p \<noteq> [] &&& p \<notin> Units (K [X])) &&& (\<And>q r. \<lbrakk>q \<in> carrier (K [X]); r \<in> carrier (K [X]); p pdivides q \<otimes>\<^bsub>K [X]\<^esub> r\<rbrakk> \<Longrightarrow> p pdivides q \<or> p pdivides r)
[PROOF STEP]
using assms(2-3) poly_mult_closed[OF subfieldE(1)[OF assms(1)]] pdivides_iff[OF assms(1)]
[PROOF STATE]
proof (prove)
using this:
p \<in> carrier (K [X])
pprime K p
\<lbrakk>polynomial K ?p1.0; polynomial K ?p2.0\<rbrakk> \<Longrightarrow> polynomial K (poly_mult ?p1.0 ?p2.0)
\<lbrakk>polynomial K ?p; polynomial K ?q\<rbrakk> \<Longrightarrow> ?p pdivides ?q = ?p divides\<^bsub>K [X]\<^esub> ?q

goal (1 subgoal):
 1. (p \<noteq> [] &&& p \<notin> Units (K [X])) &&& (\<And>q r. \<lbrakk>q \<in> carrier (K [X]); r \<in> carrier (K [X]); p pdivides q \<otimes>\<^bsub>K [X]\<^esub> r\<rbrakk> \<Longrightarrow> p pdivides q \<or> p pdivides r)
[PROOF STEP]
unfolding ring_prime_def prime_def
[PROOF STATE]
proof (prove)
using this:
p \<in> carrier (K [X])
p \<noteq> \<zero>\<^bsub>K [X]\<^esub> \<and> p \<notin> Units (K [X]) \<and> (\<forall>a\<in>carrier (K [X]). \<forall>b\<in>carrier (K [X]). p divides\<^bsub>K [X]\<^esub> a \<otimes>\<^bsub>K [X]\<^esub> b \<longrightarrow> p divides\<^bsub>K [X]\<^esub> a \<or> p divides\<^bsub>K [X]\<^esub> b)
\<lbrakk>polynomial K ?p1.0; polynomial K ?p2.0\<rbrakk> \<Longrightarrow> polynomial K (poly_mult ?p1.0 ?p2.0)
\<lbrakk>polynomial K ?p; polynomial K ?q\<rbrakk> \<Longrightarrow> ?p pdivides ?q = ?p divides\<^bsub>K [X]\<^esub> ?q

goal (1 subgoal):
 1. (p \<noteq> [] &&& p \<notin> Units (K [X])) &&& (\<And>q r. \<lbrakk>q \<in> carrier (K [X]); r \<in> carrier (K [X]); p pdivides q \<otimes>\<^bsub>K [X]\<^esub> r\<rbrakk> \<Longrightarrow> p pdivides q \<or> p pdivides r)
[PROOF STEP]
by (auto simp add: univ_poly_mult univ_poly_carrier univ_poly_zero)


[STATEMENT]
lemma vcard_finite_set: "finite A \<Longrightarrow> vcard (set A) = ord_of_nat (card A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite A \<Longrightarrow> vcard (set A) = ord_of_nat (card A)
[PROOF STEP]
by (induction A rule: finite_induct) (auto simp: set_empty \<omega>_def finite_csucc)


[STATEMENT]
lemma moebius_mu_power:
  assumes "a > 1" "n > 1"
  shows   "moebius_mu (a ^ n) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. moebius_mu (a ^ n) = (0::'a)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. moebius_mu (a ^ n) = (0::'a)
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
1 < a
1 < n
[PROOF STEP]
have "a ^ 2 dvd a ^ n"
[PROOF STATE]
proof (prove)
using this:
1 < a
1 < n

goal (1 subgoal):
 1. a\<^sup>2 dvd a ^ n
[PROOF STEP]
by (simp add: le_imp_power_dvd)
[PROOF STATE]
proof (state)
this:
a\<^sup>2 dvd a ^ n

goal (1 subgoal):
 1. moebius_mu (a ^ n) = (0::'a)
[PROOF STEP]
with moebius_mu_eq_zero_iff[of "a ^ n"] and \<open>a > 1\<close>
[PROOF STATE]
proof (chain)
picking this:
(moebius_mu (a ^ n) = (0::?'a)) = (\<not> squarefree (a ^ n))
1 < a
a\<^sup>2 dvd a ^ n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(moebius_mu (a ^ n) = (0::?'a)) = (\<not> squarefree (a ^ n))
1 < a
a\<^sup>2 dvd a ^ n

goal (1 subgoal):
 1. moebius_mu (a ^ n) = (0::'a)
[PROOF STEP]
by (auto simp: squarefree_def)
[PROOF STATE]
proof (state)
this:
moebius_mu (a ^ n) = (0::'a)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma HComplex_inject [simp]: "\<And>x y x' y'. HComplex x y = HComplex x' y' \<longleftrightarrow> x = x' \<and> y = y'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x y x' y'. (HComplex x y = HComplex x' y') = (x = x' \<and> y = y')
[PROOF STEP]
by transfer (rule complex.inject)


[STATEMENT]
lemma supp_neg_eq_supp :
  fixes     f :: "'a \<Rightarrow> 'b::group_add"
  shows     "supp (- f) = supp f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. supp (- f) = supp f
[PROOF STEP]
unfolding supp_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {x. (- f) x \<noteq> (0::'b)} = {x. f x \<noteq> (0::'b)}
[PROOF STEP]
by        auto


[STATEMENT]
lemma diag_block_mat_dim_col_cong:
  assumes "length Ul = length Bl"
  and "\<forall>i < length Bl. dim_col (Bl!i) = dim_col (Ul!i)"
  shows "dim_col (diag_block_mat Ul) = dim_col (diag_block_mat Bl)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_col (diag_block_mat Ul) = dim_col (diag_block_mat Bl)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. dim_col (diag_block_mat Ul) = dim_col (diag_block_mat Bl)
[PROOF STEP]
have "dim_col (diag_block_mat Ul) = sum_list (map dim_col Ul)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_col (diag_block_mat Ul) = sum_list (map dim_col Ul)
[PROOF STEP]
by (simp add: dim_diag_block_mat(2))
[PROOF STATE]
proof (state)
this:
dim_col (diag_block_mat Ul) = sum_list (map dim_col Ul)

goal (1 subgoal):
 1. dim_col (diag_block_mat Ul) = dim_col (diag_block_mat Bl)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
dim_col (diag_block_mat Ul) = sum_list (map dim_col Ul)

goal (1 subgoal):
 1. dim_col (diag_block_mat Ul) = dim_col (diag_block_mat Bl)
[PROOF STEP]
have "... = sum_list (map dim_col Bl)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum_list (map dim_col Ul) = sum_list (map dim_col Bl)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
length Ul = length Bl
\<forall>i<length Bl. dim_col (Bl ! i) = dim_col (Ul ! i)

goal (1 subgoal):
 1. sum_list (map dim_col Ul) = sum_list (map dim_col Bl)
[PROOF STEP]
by (metis nth_map_conv)
[PROOF STATE]
proof (state)
this:
sum_list (map dim_col Ul) = sum_list (map dim_col Bl)

goal (1 subgoal):
 1. dim_col (diag_block_mat Ul) = dim_col (diag_block_mat Bl)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
sum_list (map dim_col Ul) = sum_list (map dim_col Bl)

goal (1 subgoal):
 1. dim_col (diag_block_mat Ul) = dim_col (diag_block_mat Bl)
[PROOF STEP]
have "... = dim_col (diag_block_mat Bl)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum_list (map dim_col Bl) = dim_col (diag_block_mat Bl)
[PROOF STEP]
by (simp add: dim_diag_block_mat(2))
[PROOF STATE]
proof (state)
this:
sum_list (map dim_col Bl) = dim_col (diag_block_mat Bl)

goal (1 subgoal):
 1. dim_col (diag_block_mat Ul) = dim_col (diag_block_mat Bl)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
dim_col (diag_block_mat Ul) = dim_col (diag_block_mat Bl)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
dim_col (diag_block_mat Ul) = dim_col (diag_block_mat Bl)

goal (1 subgoal):
 1. dim_col (diag_block_mat Ul) = dim_col (diag_block_mat Bl)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
dim_col (diag_block_mat Ul) = dim_col (diag_block_mat Bl)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma sum_def: "U + V = {u + v | u v. u \<in> U \<and> v \<in> V}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. U + V = {u + v |u v. u \<in> U \<and> v \<in> V}
[PROOF STEP]
unfolding set_plus_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {c. \<exists>a\<in>U. \<exists>b\<in>V. c = a + b} = {u + v |u v. u \<in> U \<and> v \<in> V}
[PROOF STEP]
by auto


[STATEMENT]
lemma path_connected_Times:
  assumes "path_connected s" "path_connected t"
    shows "path_connected (s \<times> t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. path_connected (s \<times> t)
[PROOF STEP]
proof (simp add: path_connected_def Sigma_def, clarify)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>y ya yb yc. \<lbrakk>y \<in> s; ya \<in> t; yb \<in> s; yc \<in> t\<rbrakk> \<Longrightarrow> \<exists>g. path g \<and> path_image g \<subseteq> (\<Union>x\<in>s. \<Union>y\<in>t. {(x, y)}) \<and> pathstart g = (y, ya) \<and> pathfinish g = (yb, yc)
[PROOF STEP]
fix x1 y1 x2 y2
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>y ya yb yc. \<lbrakk>y \<in> s; ya \<in> t; yb \<in> s; yc \<in> t\<rbrakk> \<Longrightarrow> \<exists>g. path g \<and> path_image g \<subseteq> (\<Union>x\<in>s. \<Union>y\<in>t. {(x, y)}) \<and> pathstart g = (y, ya) \<and> pathfinish g = (yb, yc)
[PROOF STEP]
assume "x1 \<in> s" "y1 \<in> t" "x2 \<in> s" "y2 \<in> t"
[PROOF STATE]
proof (state)
this:
x1 \<in> s
y1 \<in> t
x2 \<in> s
y2 \<in> t

goal (1 subgoal):
 1. \<And>y ya yb yc. \<lbrakk>y \<in> s; ya \<in> t; yb \<in> s; yc \<in> t\<rbrakk> \<Longrightarrow> \<exists>g. path g \<and> path_image g \<subseteq> (\<Union>x\<in>s. \<Union>y\<in>t. {(x, y)}) \<and> pathstart g = (y, ya) \<and> pathfinish g = (yb, yc)
[PROOF STEP]
obtain g where "path g" and g: "path_image g \<subseteq> s" and gs: "pathstart g = x1" and gf: "pathfinish g = x2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>g. \<lbrakk>path g; path_image g \<subseteq> s; pathstart g = x1; pathfinish g = x2\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using \<open>x1 \<in> s\<close> \<open>x2 \<in> s\<close> assms
[PROOF STATE]
proof (prove)
using this:
x1 \<in> s
x2 \<in> s
path_connected s
path_connected t

goal (1 subgoal):
 1. (\<And>g. \<lbrakk>path g; path_image g \<subseteq> s; pathstart g = x1; pathfinish g = x2\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (force simp: path_connected_def)
[PROOF STATE]
proof (state)
this:
path g
path_image g \<subseteq> s
pathstart g = x1
pathfinish g = x2

goal (1 subgoal):
 1. \<And>y ya yb yc. \<lbrakk>y \<in> s; ya \<in> t; yb \<in> s; yc \<in> t\<rbrakk> \<Longrightarrow> \<exists>g. path g \<and> path_image g \<subseteq> (\<Union>x\<in>s. \<Union>y\<in>t. {(x, y)}) \<and> pathstart g = (y, ya) \<and> pathfinish g = (yb, yc)
[PROOF STEP]
obtain h where "path h" and h: "path_image h \<subseteq> t" and hs: "pathstart h = y1" and hf: "pathfinish h = y2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>h. \<lbrakk>path h; path_image h \<subseteq> t; pathstart h = y1; pathfinish h = y2\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using \<open>y1 \<in> t\<close> \<open>y2 \<in> t\<close> assms
[PROOF STATE]
proof (prove)
using this:
y1 \<in> t
y2 \<in> t
path_connected s
path_connected t

goal (1 subgoal):
 1. (\<And>h. \<lbrakk>path h; path_image h \<subseteq> t; pathstart h = y1; pathfinish h = y2\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (force simp: path_connected_def)
[PROOF STATE]
proof (state)
this:
path h
path_image h \<subseteq> t
pathstart h = y1
pathfinish h = y2

goal (1 subgoal):
 1. \<And>y ya yb yc. \<lbrakk>y \<in> s; ya \<in> t; yb \<in> s; yc \<in> t\<rbrakk> \<Longrightarrow> \<exists>g. path g \<and> path_image g \<subseteq> (\<Union>x\<in>s. \<Union>y\<in>t. {(x, y)}) \<and> pathstart g = (y, ya) \<and> pathfinish g = (yb, yc)
[PROOF STEP]
have "path (\<lambda>z. (x1, h z))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. path (\<lambda>z. (x1, h z))
[PROOF STEP]
using \<open>path h\<close>
[PROOF STATE]
proof (prove)
using this:
path h

goal (1 subgoal):
 1. path (\<lambda>z. (x1, h z))
[PROOF STEP]
unfolding path_def
[PROOF STATE]
proof (prove)
using this:
continuous_on {0..1} h

goal (1 subgoal):
 1. continuous_on {0..1} (\<lambda>z. (x1, h z))
[PROOF STEP]
by (intro continuous_intros continuous_on_compose2 [where g = "Pair _"]; force)
[PROOF STATE]
proof (state)
this:
path (\<lambda>z. (x1, h z))

goal (1 subgoal):
 1. \<And>y ya yb yc. \<lbrakk>y \<in> s; ya \<in> t; yb \<in> s; yc \<in> t\<rbrakk> \<Longrightarrow> \<exists>g. path g \<and> path_image g \<subseteq> (\<Union>x\<in>s. \<Union>y\<in>t. {(x, y)}) \<and> pathstart g = (y, ya) \<and> pathfinish g = (yb, yc)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
path (\<lambda>z. (x1, h z))

goal (1 subgoal):
 1. \<And>y ya yb yc. \<lbrakk>y \<in> s; ya \<in> t; yb \<in> s; yc \<in> t\<rbrakk> \<Longrightarrow> \<exists>g. path g \<and> path_image g \<subseteq> (\<Union>x\<in>s. \<Union>y\<in>t. {(x, y)}) \<and> pathstart g = (y, ya) \<and> pathfinish g = (yb, yc)
[PROOF STEP]
have "path (\<lambda>z. (g z, y2))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. path (\<lambda>z. (g z, y2))
[PROOF STEP]
using \<open>path g\<close>
[PROOF STATE]
proof (prove)
using this:
path g

goal (1 subgoal):
 1. path (\<lambda>z. (g z, y2))
[PROOF STEP]
unfolding path_def
[PROOF STATE]
proof (prove)
using this:
continuous_on {0..1} g

goal (1 subgoal):
 1. continuous_on {0..1} (\<lambda>z. (g z, y2))
[PROOF STEP]
by (intro continuous_intros continuous_on_compose2 [where g = "Pair _"]; force)
[PROOF STATE]
proof (state)
this:
path (\<lambda>z. (g z, y2))

goal (1 subgoal):
 1. \<And>y ya yb yc. \<lbrakk>y \<in> s; ya \<in> t; yb \<in> s; yc \<in> t\<rbrakk> \<Longrightarrow> \<exists>g. path g \<and> path_image g \<subseteq> (\<Union>x\<in>s. \<Union>y\<in>t. {(x, y)}) \<and> pathstart g = (y, ya) \<and> pathfinish g = (yb, yc)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
path (\<lambda>z. (x1, h z))
path (\<lambda>z. (g z, y2))
[PROOF STEP]
have 1: "path ((\<lambda>z. (x1, h z)) +++ (\<lambda>z. (g z, y2)))"
[PROOF STATE]
proof (prove)
using this:
path (\<lambda>z. (x1, h z))
path (\<lambda>z. (g z, y2))

goal (1 subgoal):
 1. path ((\<lambda>z. (x1, h z)) +++ (\<lambda>z. (g z, y2)))
[PROOF STEP]
by (metis hf gs path_join_imp pathstart_def pathfinish_def)
[PROOF STATE]
proof (state)
this:
path ((\<lambda>z. (x1, h z)) +++ (\<lambda>z. (g z, y2)))

goal (1 subgoal):
 1. \<And>y ya yb yc. \<lbrakk>y \<in> s; ya \<in> t; yb \<in> s; yc \<in> t\<rbrakk> \<Longrightarrow> \<exists>g. path g \<and> path_image g \<subseteq> (\<Union>x\<in>s. \<Union>y\<in>t. {(x, y)}) \<and> pathstart g = (y, ya) \<and> pathfinish g = (yb, yc)
[PROOF STEP]
have "path_image ((\<lambda>z. (x1, h z)) +++ (\<lambda>z. (g z, y2))) \<subseteq> path_image (\<lambda>z. (x1, h z)) \<union> path_image (\<lambda>z. (g z, y2))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. path_image ((\<lambda>z. (x1, h z)) +++ (\<lambda>z. (g z, y2))) \<subseteq> path_image (\<lambda>z. (x1, h z)) \<union> path_image (\<lambda>z. (g z, y2))
[PROOF STEP]
by (rule Path_Connected.path_image_join_subset)
[PROOF STATE]
proof (state)
this:
path_image ((\<lambda>z. (x1, h z)) +++ (\<lambda>z. (g z, y2))) \<subseteq> path_image (\<lambda>z. (x1, h z)) \<union> path_image (\<lambda>z. (g z, y2))

goal (1 subgoal):
 1. \<And>y ya yb yc. \<lbrakk>y \<in> s; ya \<in> t; yb \<in> s; yc \<in> t\<rbrakk> \<Longrightarrow> \<exists>g. path g \<and> path_image g \<subseteq> (\<Union>x\<in>s. \<Union>y\<in>t. {(x, y)}) \<and> pathstart g = (y, ya) \<and> pathfinish g = (yb, yc)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
path_image ((\<lambda>z. (x1, h z)) +++ (\<lambda>z. (g z, y2))) \<subseteq> path_image (\<lambda>z. (x1, h z)) \<union> path_image (\<lambda>z. (g z, y2))

goal (1 subgoal):
 1. \<And>y ya yb yc. \<lbrakk>y \<in> s; ya \<in> t; yb \<in> s; yc \<in> t\<rbrakk> \<Longrightarrow> \<exists>g. path g \<and> path_image g \<subseteq> (\<Union>x\<in>s. \<Union>y\<in>t. {(x, y)}) \<and> pathstart g = (y, ya) \<and> pathfinish g = (yb, yc)
[PROOF STEP]
have "\<dots> \<subseteq> (\<Union>x\<in>s. \<Union>x1\<in>t. {(x, x1)})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. path_image (\<lambda>z. (x1, h z)) \<union> path_image (\<lambda>z. (g z, y2)) \<subseteq> (\<Union>x\<in>s. \<Union>x1\<in>t. {(x, x1)})
[PROOF STEP]
using g h \<open>x1 \<in> s\<close> \<open>y2 \<in> t\<close>
[PROOF STATE]
proof (prove)
using this:
path_image g \<subseteq> s
path_image h \<subseteq> t
x1 \<in> s
y2 \<in> t

goal (1 subgoal):
 1. path_image (\<lambda>z. (x1, h z)) \<union> path_image (\<lambda>z. (g z, y2)) \<subseteq> (\<Union>x\<in>s. \<Union>x1\<in>t. {(x, x1)})
[PROOF STEP]
by (force simp: path_image_def)
[PROOF STATE]
proof (state)
this:
path_image (\<lambda>z. (x1, h z)) \<union> path_image (\<lambda>z. (g z, y2)) \<subseteq> (\<Union>x\<in>s. \<Union>x1\<in>t. {(x, x1)})

goal (1 subgoal):
 1. \<And>y ya yb yc. \<lbrakk>y \<in> s; ya \<in> t; yb \<in> s; yc \<in> t\<rbrakk> \<Longrightarrow> \<exists>g. path g \<and> path_image g \<subseteq> (\<Union>x\<in>s. \<Union>y\<in>t. {(x, y)}) \<and> pathstart g = (y, ya) \<and> pathfinish g = (yb, yc)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
path_image ((\<lambda>z. (x1, h z)) +++ (\<lambda>z. (g z, y2))) \<subseteq> (\<Union>x\<in>s. \<Union>x1\<in>t. {(x, x1)})
[PROOF STEP]
have 2: "path_image ((\<lambda>z. (x1, h z)) +++ (\<lambda>z. (g z, y2))) \<subseteq> (\<Union>x\<in>s. \<Union>x1\<in>t. {(x, x1)})"
[PROOF STATE]
proof (prove)
using this:
path_image ((\<lambda>z. (x1, h z)) +++ (\<lambda>z. (g z, y2))) \<subseteq> (\<Union>x\<in>s. \<Union>x1\<in>t. {(x, x1)})

goal (1 subgoal):
 1. path_image ((\<lambda>z. (x1, h z)) +++ (\<lambda>z. (g z, y2))) \<subseteq> (\<Union>x\<in>s. \<Union>x1\<in>t. {(x, x1)})
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
path_image ((\<lambda>z. (x1, h z)) +++ (\<lambda>z. (g z, y2))) \<subseteq> (\<Union>x\<in>s. \<Union>x1\<in>t. {(x, x1)})

goal (1 subgoal):
 1. \<And>y ya yb yc. \<lbrakk>y \<in> s; ya \<in> t; yb \<in> s; yc \<in> t\<rbrakk> \<Longrightarrow> \<exists>g. path g \<and> path_image g \<subseteq> (\<Union>x\<in>s. \<Union>y\<in>t. {(x, y)}) \<and> pathstart g = (y, ya) \<and> pathfinish g = (yb, yc)
[PROOF STEP]
show "\<exists>g. path g \<and> path_image g \<subseteq> (\<Union>x\<in>s. \<Union>x1\<in>t. {(x, x1)}) \<and>
            pathstart g = (x1, y1) \<and> pathfinish g = (x2, y2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>g. path g \<and> path_image g \<subseteq> (\<Union>x\<in>s. \<Union>x1\<in>t. {(x, x1)}) \<and> pathstart g = (x1, y1) \<and> pathfinish g = (x2, y2)
[PROOF STEP]
using 1 2 gf hs
[PROOF STATE]
proof (prove)
using this:
path ((\<lambda>z. (x1, h z)) +++ (\<lambda>z. (g z, y2)))
path_image ((\<lambda>z. (x1, h z)) +++ (\<lambda>z. (g z, y2))) \<subseteq> (\<Union>x\<in>s. \<Union>x1\<in>t. {(x, x1)})
pathfinish g = x2
pathstart h = y1

goal (1 subgoal):
 1. \<exists>g. path g \<and> path_image g \<subseteq> (\<Union>x\<in>s. \<Union>x1\<in>t. {(x, x1)}) \<and> pathstart g = (x1, y1) \<and> pathfinish g = (x2, y2)
[PROOF STEP]
by (metis (no_types, lifting) pathfinish_def pathfinish_join pathstart_def pathstart_join)
[PROOF STATE]
proof (state)
this:
\<exists>g. path g \<and> path_image g \<subseteq> (\<Union>x\<in>s. \<Union>x1\<in>t. {(x, x1)}) \<and> pathstart g = (x1, y1) \<and> pathfinish g = (x2, y2)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma set_iterator_genord_image_correct :
  fixes it :: "('a,'\<sigma>) set_iterator"
  assumes it_OK: "set_iterator_genord it S R"
  assumes g_inj: "inj_on g S"
  assumes R'_prop: "\<And>x y. \<lbrakk>x \<in> S; y \<in> S; R x y\<rbrakk> \<Longrightarrow> R' (g x) (g y)"
  shows "set_iterator_genord (set_iterator_image g it) (g ` S) R'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set_iterator_genord (set_iterator_image g it) (g ` S) R'
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. set_iterator_genord (set_iterator_image g it) (g ` S) R'
[PROOF STEP]
let ?g = "\<lambda>x. Some (g x)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. set_iterator_genord (set_iterator_image g it) (g ` S) R'
[PROOF STEP]
have set_eq: "\<And>S. {y . \<exists>x. x \<in> S \<and> ?g x = Some y} = g ` S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>S. {y. \<exists>x. x \<in> S \<and> Some (g x) = Some y} = g ` S
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{y. \<exists>x. x \<in> ?S \<and> Some (g x) = Some y} = g ` ?S

goal (1 subgoal):
 1. set_iterator_genord (set_iterator_image g it) (g ` S) R'
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set_iterator_genord (set_iterator_image g it) (g ` S) R'
[PROOF STEP]
apply (rule set_iterator_genord_image_filter_correct [OF it_OK, of ?g R',
     folded set_iterator_image_def set_eq[symmetric]])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. inj_on (\<lambda>x. Some (g x)) (S \<inter> dom (\<lambda>x. Some (g x)))
 2. \<And>x y x' y'. \<lbrakk>x \<in> S; Some (g x) = Some x'; y \<in> S; Some (g y) = Some y'; R x y\<rbrakk> \<Longrightarrow> R' x' y'
[PROOF STEP]
apply (insert g_inj, simp add: inj_on_def) []
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x y x' y'. \<lbrakk>x \<in> S; Some (g x) = Some x'; y \<in> S; Some (g y) = Some y'; R x y\<rbrakk> \<Longrightarrow> R' x' y'
[PROOF STEP]
apply (insert R'_prop, auto)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
set_iterator_genord (set_iterator_image g it) (g ` S) R'

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma PiE_mono: "(\<And>x. x \<in> A \<Longrightarrow> B x \<subseteq> C x) \<Longrightarrow> Pi\<^sub>E A B \<subseteq> Pi\<^sub>E A C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>x. x \<in> A \<Longrightarrow> B x \<subseteq> C x) \<Longrightarrow> Pi\<^sub>E A B \<subseteq> Pi\<^sub>E A C
[PROOF STEP]
by auto


[STATEMENT]
lemma LIM_less_bound:
  fixes f :: "real \<Rightarrow> real"
  assumes ev: "b < x" "\<forall> x' \<in> { b <..< x}. 0 \<le> f x'" and "isCont f x"
  shows "0 \<le> f x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> f x
[PROOF STEP]
proof (rule tendsto_lowerbound)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. (?f \<longlongrightarrow> f x) ?F
 2. \<forall>\<^sub>F i in ?F. 0 \<le> ?f i
 3. ?F \<noteq> bot
[PROOF STEP]
show "(f \<longlongrightarrow> f x) (at_left x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f \<longlongrightarrow> f x) (at_left x)
[PROOF STEP]
using \<open>isCont f x\<close>
[PROOF STATE]
proof (prove)
using this:
isCont f x

goal (1 subgoal):
 1. (f \<longlongrightarrow> f x) (at_left x)
[PROOF STEP]
by (simp add: filterlim_at_split isCont_def)
[PROOF STATE]
proof (state)
this:
(f \<longlongrightarrow> f x) (at_left x)

goal (2 subgoals):
 1. \<forall>\<^sub>F i in at_left x. 0 \<le> f i
 2. at_left x \<noteq> bot
[PROOF STEP]
show "eventually (\<lambda>x. 0 \<le> f x) (at_left x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_left x. 0 \<le> f x
[PROOF STEP]
using ev
[PROOF STATE]
proof (prove)
using this:
b < x
\<forall>x'\<in>{b<..<x}. 0 \<le> f x'

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_left x. 0 \<le> f x
[PROOF STEP]
by (auto simp: eventually_at dist_real_def intro!: exI[of _ "x - b"])
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in at_left x. 0 \<le> f x

goal (1 subgoal):
 1. at_left x \<noteq> bot
[PROOF STEP]
qed simp


[STATEMENT]
lemma powrat_mult_neg_pos:
  assumes "0 < x" and "r < 0" and "0 < s"
  shows "x pow\<^sub>\<rat> (r * s) = (x pow\<^sub>\<rat> r) pow\<^sub>\<rat> s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x pow\<^sub>\<rat> (r * s) = (x pow\<^sub>\<rat> r) pow\<^sub>\<rat> s
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x pow\<^sub>\<rat> (r * s) = (x pow\<^sub>\<rat> r) pow\<^sub>\<rat> s
[PROOF STEP]
have "x pow\<^sub>\<rat> (- r * s) = (x pow\<^sub>\<rat> - r) pow\<^sub>\<rat> s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x pow\<^sub>\<rat> (- r * s) = (x pow\<^sub>\<rat> - r) pow\<^sub>\<rat> s
[PROOF STEP]
using powrat_mult_pos assms neg_0_less_iff_less
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>0 < ?x; 0 < ?r; 0 < ?s\<rbrakk> \<Longrightarrow> ?x pow\<^sub>\<rat> (?r * ?s) = (?x pow\<^sub>\<rat> ?r) pow\<^sub>\<rat> ?s
0 < x
r < 0
0 < s
((0::?'a) < - ?a) = (?a < (0::?'a))

goal (1 subgoal):
 1. x pow\<^sub>\<rat> (- r * s) = (x pow\<^sub>\<rat> - r) pow\<^sub>\<rat> s
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
x pow\<^sub>\<rat> (- r * s) = (x pow\<^sub>\<rat> - r) pow\<^sub>\<rat> s

goal (1 subgoal):
 1. x pow\<^sub>\<rat> (r * s) = (x pow\<^sub>\<rat> r) pow\<^sub>\<rat> s
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x pow\<^sub>\<rat> (- r * s) = (x pow\<^sub>\<rat> - r) pow\<^sub>\<rat> s
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
x pow\<^sub>\<rat> (- r * s) = (x pow\<^sub>\<rat> - r) pow\<^sub>\<rat> s

goal (1 subgoal):
 1. x pow\<^sub>\<rat> (r * s) = (x pow\<^sub>\<rat> r) pow\<^sub>\<rat> s
[PROOF STEP]
by (simp add: powrat_inverse powrat_minus)
[PROOF STATE]
proof (state)
this:
x pow\<^sub>\<rat> (r * s) = (x pow\<^sub>\<rat> r) pow\<^sub>\<rat> s

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma SN_nat_gt: "SN {(a, b :: nat) . a > b}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. SN {(a, b). b < a}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. SN {(a, b). b < a}
[PROOF STEP]
from wf_less
[PROOF STATE]
proof (chain)
picking this:
wf {(x, y). x < y}
[PROOF STEP]
have "wf ({(x, y) . (x :: nat) > y}\<inverse>)"
[PROOF STATE]
proof (prove)
using this:
wf {(x, y). x < y}

goal (1 subgoal):
 1. wf ({(x, y). y < x}\<inverse>)
[PROOF STEP]
unfolding converse_unfold
[PROOF STATE]
proof (prove)
using this:
wf {(x, y). x < y}

goal (1 subgoal):
 1. wf {(y, x). (x, y) \<in> {(x, y). y < x}}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
wf ({(x, y). y < x}\<inverse>)

goal (1 subgoal):
 1. SN {(a, b). b < a}
[PROOF STEP]
from wf_imp_SN [OF this]
[PROOF STATE]
proof (chain)
picking this:
SN {(x, y). y < x}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
SN {(x, y). y < x}

goal (1 subgoal):
 1. SN {(a, b). b < a}
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
SN {(a, b). b < a}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma comp_fun_commute_maybe_and: "comp_fun_commute maybe_and"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. comp_fun_commute (\<and>?)
[PROOF STEP]
apply standard
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>y x. (\<and>?) y \<circ> (\<and>?) x = (\<and>?) x \<circ> (\<and>?) y
[PROOF STEP]
apply (simp add: comp_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>y x. (\<lambda>xa. y \<and>? (x \<and>? xa)) = (\<lambda>xa. x \<and>? (y \<and>? xa))
[PROOF STEP]
apply (rule ext)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>y x xa. y \<and>? (x \<and>? xa) = x \<and>? (y \<and>? xa)
[PROOF STEP]
by (metis add.left_commute de_morgans_2 maybe_not_eq)


[STATEMENT]
lemma vec_is_zero: "dim_vec v = n \<Longrightarrow> vec_is_zero n v \<longleftrightarrow> v = 0\<^sub>v n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_vec v = n \<Longrightarrow> vec_is_zero n v = (v = 0\<^sub>v n)
[PROOF STEP]
unfolding vec_is_zero_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_vec v = n \<Longrightarrow> (\<forall>i<n. v $ i = (0::'a)) = (v = 0\<^sub>v n)
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i. \<lbrakk>n = dim_vec v; v = 0\<^sub>v (dim_vec v); i < dim_vec v\<rbrakk> \<Longrightarrow> v $ i = (0::'a)
[PROOF STEP]
by (metis index_zero_vec(1))


[STATEMENT]
lemma (in monoid) division_weak_partial_order [simp, intro!]:
  "weak_partial_order (division_rel G)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. weak_partial_order (division_rel G)
[PROOF STEP]
apply unfold_locales
[PROOF STATE]
proof (prove)
goal (7 subgoals):
 1. \<And>x. x \<in> carrier (division_rel G) \<Longrightarrow> x .=\<^bsub>division_rel G\<^esub> x
 2. \<And>x y. \<lbrakk>x .=\<^bsub>division_rel G\<^esub> y; x \<in> carrier (division_rel G); y \<in> carrier (division_rel G)\<rbrakk> \<Longrightarrow> y .=\<^bsub>division_rel G\<^esub> x
 3. \<And>x y z. \<lbrakk>x .=\<^bsub>division_rel G\<^esub> y; y .=\<^bsub>division_rel G\<^esub> z; x \<in> carrier (division_rel G); y \<in> carrier (division_rel G); z \<in> carrier (division_rel G)\<rbrakk> \<Longrightarrow> x .=\<^bsub>division_rel G\<^esub> z
 4. \<And>x. x \<in> carrier (division_rel G) \<Longrightarrow> x \<sqsubseteq>\<^bsub>division_rel G\<^esub> x
 5. \<And>x y. \<lbrakk>x \<sqsubseteq>\<^bsub>division_rel G\<^esub> y; y \<sqsubseteq>\<^bsub>division_rel G\<^esub> x; x \<in> carrier (division_rel G); y \<in> carrier (division_rel G)\<rbrakk> \<Longrightarrow> x .=\<^bsub>division_rel G\<^esub> y
 6. \<And>x y z. \<lbrakk>x \<sqsubseteq>\<^bsub>division_rel G\<^esub> y; y \<sqsubseteq>\<^bsub>division_rel G\<^esub> z; x \<in> carrier (division_rel G); y \<in> carrier (division_rel G); z \<in> carrier (division_rel G)\<rbrakk> \<Longrightarrow> x \<sqsubseteq>\<^bsub>division_rel G\<^esub> z
 7. \<And>x y z w. \<lbrakk>x .=\<^bsub>division_rel G\<^esub> y; z .=\<^bsub>division_rel G\<^esub> w; x \<in> carrier (division_rel G); y \<in> carrier (division_rel G); z \<in> carrier (division_rel G); w \<in> carrier (division_rel G)\<rbrakk> \<Longrightarrow> (x \<sqsubseteq>\<^bsub>division_rel G\<^esub> z) = (y \<sqsubseteq>\<^bsub>division_rel G\<^esub> w)
[PROOF STEP]
apply (simp_all add: associated_sym divides_antisym)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>x y z. \<lbrakk>x \<sim> y; y \<sim> z; x \<in> carrier G; y \<in> carrier G; z \<in> carrier G\<rbrakk> \<Longrightarrow> x \<sim> z
 2. \<And>x y z. \<lbrakk>x divides y; y divides z; x \<in> carrier G; y \<in> carrier G; z \<in> carrier G\<rbrakk> \<Longrightarrow> x divides z
 3. \<And>x y z w. \<lbrakk>x \<sim> y; z \<sim> w; x \<in> carrier G; y \<in> carrier G; z \<in> carrier G; w \<in> carrier G\<rbrakk> \<Longrightarrow> x divides z = y divides w
[PROOF STEP]
apply (metis associated_trans)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x y z. \<lbrakk>x divides y; y divides z; x \<in> carrier G; y \<in> carrier G; z \<in> carrier G\<rbrakk> \<Longrightarrow> x divides z
 2. \<And>x y z w. \<lbrakk>x \<sim> y; z \<sim> w; x \<in> carrier G; y \<in> carrier G; z \<in> carrier G; w \<in> carrier G\<rbrakk> \<Longrightarrow> x divides z = y divides w
[PROOF STEP]
apply (metis divides_trans)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x y z w. \<lbrakk>x \<sim> y; z \<sim> w; x \<in> carrier G; y \<in> carrier G; z \<in> carrier G; w \<in> carrier G\<rbrakk> \<Longrightarrow> x divides z = y divides w
[PROOF STEP]
by (meson associated_def divides_trans)


[STATEMENT]
lemma monoI[intro?]:
  assumes "\<And>x y. x \<le>\<^sub>a y \<Longrightarrow> f x \<le>\<^sub>b f y"
  shows "mono\<^sub>a\<^sub>b f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mono\<^sub>a\<^sub>b f
[PROOF STEP]
unfolding mono_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>UNIV. \<forall>y\<in>UNIV. x \<le>\<^sub>a y \<longrightarrow> f x \<le>\<^sub>b f y
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
?x \<le>\<^sub>a ?y \<Longrightarrow> f ?x \<le>\<^sub>b f ?y

goal (1 subgoal):
 1. \<forall>x\<in>UNIV. \<forall>y\<in>UNIV. x \<le>\<^sub>a y \<longrightarrow> f x \<le>\<^sub>b f y
[PROOF STEP]
by simp


[STATEMENT]
lemma pdevs_val_map:
  \<open>pdevs_val e (pdevs_of_list xs)
    = (\<Sum>n\<leftarrow>[0..<length xs]. e n *\<^sub>R xs ! n)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pdevs_val e (pdevs_of_list xs) = (\<Sum>n\<leftarrow>[0..<length xs]. e n *\<^sub>R xs ! n)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. pdevs_val e (pdevs_of_list xs) = (\<Sum>n\<leftarrow>[0..<length xs]. e n *\<^sub>R xs ! n)
[PROOF STEP]
have \<open>map2 (\<lambda>i. (*\<^sub>R) (e i)) [0..<length xs] xs =
    map (\<lambda>n. e n *\<^sub>R xs ! n) [0..<length xs]\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map2 (\<lambda>x. (*\<^sub>R) (e x)) [0..<length xs] xs = map (\<lambda>n. e n *\<^sub>R xs ! n) [0..<length xs]
[PROOF STEP]
by (rule nth_equalityI) simp_all
[PROOF STATE]
proof (state)
this:
map2 (\<lambda>x. (*\<^sub>R) (e x)) [0..<length xs] xs = map (\<lambda>n. e n *\<^sub>R xs ! n) [0..<length xs]

goal (1 subgoal):
 1. pdevs_val e (pdevs_of_list xs) = (\<Sum>n\<leftarrow>[0..<length xs]. e n *\<^sub>R xs ! n)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
map2 (\<lambda>x. (*\<^sub>R) (e x)) [0..<length xs] xs = map (\<lambda>n. e n *\<^sub>R xs ! n) [0..<length xs]
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
map2 (\<lambda>x. (*\<^sub>R) (e x)) [0..<length xs] xs = map (\<lambda>n. e n *\<^sub>R xs ! n) [0..<length xs]

goal (1 subgoal):
 1. pdevs_val e (pdevs_of_list xs) = (\<Sum>n\<leftarrow>[0..<length xs]. e n *\<^sub>R xs ! n)
[PROOF STEP]
by (simp add: pdevs_val_zip)
[PROOF STATE]
proof (state)
this:
pdevs_val e (pdevs_of_list xs) = (\<Sum>n\<leftarrow>[0..<length xs]. e n *\<^sub>R xs ! n)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma outcomes_sum [simp]:
  fixes f :: "nat \<Rightarrow> real"
  shows
  "(\<Sum>j\<in>{k| k::nat. select_index n i k}. (f j)) +
   (\<Sum>j\<in>{k| k::nat. (k<2^n) \<and> \<not> select_index n i k}. (f j)) =
   (\<Sum>j\<in>{0..<2^n::nat}. (f j))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum f {k |k. select_index n i k} + sum f {k |k. k < 2 ^ n \<and> \<not> select_index n i k} = sum f {0..<2 ^ n}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. sum f {k |k. select_index n i k} + sum f {k |k. k < 2 ^ n \<and> \<not> select_index n i k} = sum f {0..<2 ^ n}
[PROOF STEP]
have "{k| k::nat. select_index n i k} \<subseteq> {0..<2^n::nat}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {k |k. select_index n i k} \<subseteq> {0..<2 ^ n}
[PROOF STEP]
using select_index_union
[PROOF STATE]
proof (prove)
using this:
{k |k. select_index ?n ?i k} \<union> {k |k. k < 2 ^ ?n \<and> \<not> select_index ?n ?i k} = {0..<2 ^ ?n}

goal (1 subgoal):
 1. {k |k. select_index n i k} \<subseteq> {0..<2 ^ n}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
{k |k. select_index n i k} \<subseteq> {0..<2 ^ n}

goal (1 subgoal):
 1. sum f {k |k. select_index n i k} + sum f {k |k. k < 2 ^ n \<and> \<not> select_index n i k} = sum f {0..<2 ^ n}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
{k |k. select_index n i k} \<subseteq> {0..<2 ^ n}
[PROOF STEP]
have "finite {k| k::nat. select_index n i k}"
[PROOF STATE]
proof (prove)
using this:
{k |k. select_index n i k} \<subseteq> {0..<2 ^ n}

goal (1 subgoal):
 1. finite {k |k. select_index n i k}
[PROOF STEP]
using rev_finite_subset
[PROOF STATE]
proof (prove)
using this:
{k |k. select_index n i k} \<subseteq> {0..<2 ^ n}
\<lbrakk>finite ?B; ?A \<subseteq> ?B\<rbrakk> \<Longrightarrow> finite ?A

goal (1 subgoal):
 1. finite {k |k. select_index n i k}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
finite {k |k. select_index n i k}

goal (1 subgoal):
 1. sum f {k |k. select_index n i k} + sum f {k |k. k < 2 ^ n \<and> \<not> select_index n i k} = sum f {0..<2 ^ n}
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
finite {k |k. select_index n i k}

goal (1 subgoal):
 1. sum f {k |k. select_index n i k} + sum f {k |k. k < 2 ^ n \<and> \<not> select_index n i k} = sum f {0..<2 ^ n}
[PROOF STEP]
have "{k| k::nat. (k<2^n) \<and> \<not> select_index n i k} \<subseteq> {0..<2^n::nat}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {k |k. k < 2 ^ n \<and> \<not> select_index n i k} \<subseteq> {0..<2 ^ n}
[PROOF STEP]
using select_index_union
[PROOF STATE]
proof (prove)
using this:
{k |k. select_index ?n ?i k} \<union> {k |k. k < 2 ^ ?n \<and> \<not> select_index ?n ?i k} = {0..<2 ^ ?n}

goal (1 subgoal):
 1. {k |k. k < 2 ^ n \<and> \<not> select_index n i k} \<subseteq> {0..<2 ^ n}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
{k |k. k < 2 ^ n \<and> \<not> select_index n i k} \<subseteq> {0..<2 ^ n}

goal (1 subgoal):
 1. sum f {k |k. select_index n i k} + sum f {k |k. k < 2 ^ n \<and> \<not> select_index n i k} = sum f {0..<2 ^ n}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
{k |k. k < 2 ^ n \<and> \<not> select_index n i k} \<subseteq> {0..<2 ^ n}
[PROOF STEP]
have "finite {k| k::nat. (k<2^n) \<and> \<not> select_index n i k}"
[PROOF STATE]
proof (prove)
using this:
{k |k. k < 2 ^ n \<and> \<not> select_index n i k} \<subseteq> {0..<2 ^ n}

goal (1 subgoal):
 1. finite {k |k. k < 2 ^ n \<and> \<not> select_index n i k}
[PROOF STEP]
using rev_finite_subset
[PROOF STATE]
proof (prove)
using this:
{k |k. k < 2 ^ n \<and> \<not> select_index n i k} \<subseteq> {0..<2 ^ n}
\<lbrakk>finite ?B; ?A \<subseteq> ?B\<rbrakk> \<Longrightarrow> finite ?A

goal (1 subgoal):
 1. finite {k |k. k < 2 ^ n \<and> \<not> select_index n i k}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
finite {k |k. k < 2 ^ n \<and> \<not> select_index n i k}

goal (1 subgoal):
 1. sum f {k |k. select_index n i k} + sum f {k |k. k < 2 ^ n \<and> \<not> select_index n i k} = sum f {0..<2 ^ n}
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
finite {k |k. select_index n i k}
finite {k |k. k < 2 ^ n \<and> \<not> select_index n i k}
[PROOF STEP]
have "(\<Sum>j\<in>{k| k::nat. select_index n i k}\<union>{k| k::nat. (k<2^n) \<and> \<not> select_index n i k}. (f j)) =
           (\<Sum>j\<in>{k| k::nat. select_index n i k}. (f j)) +
           (\<Sum>j\<in>{k| k::nat. (k<2^n) \<and> \<not> select_index n i k}. (f j)) -
           (\<Sum>j\<in>{k| k::nat. select_index n i k}\<inter>{k| k::nat. (k<2^n) \<and> \<not> select_index n i k}. (f j))"
[PROOF STATE]
proof (prove)
using this:
finite {k |k. select_index n i k}
finite {k |k. k < 2 ^ n \<and> \<not> select_index n i k}

goal (1 subgoal):
 1. sum f ({k |k. select_index n i k} \<union> {k |k. k < 2 ^ n \<and> \<not> select_index n i k}) = sum f {k |k. select_index n i k} + sum f {k |k. k < 2 ^ n \<and> \<not> select_index n i k} - sum f ({k |k. select_index n i k} \<inter> {k |k. k < 2 ^ n \<and> \<not> select_index n i k})
[PROOF STEP]
using sum_Un
[PROOF STATE]
proof (prove)
using this:
finite {k |k. select_index n i k}
finite {k |k. k < 2 ^ n \<and> \<not> select_index n i k}
\<lbrakk>finite ?A; finite ?B\<rbrakk> \<Longrightarrow> sum ?f (?A \<union> ?B) = sum ?f ?A + sum ?f ?B - sum ?f (?A \<inter> ?B)

goal (1 subgoal):
 1. sum f ({k |k. select_index n i k} \<union> {k |k. k < 2 ^ n \<and> \<not> select_index n i k}) = sum f {k |k. select_index n i k} + sum f {k |k. k < 2 ^ n \<and> \<not> select_index n i k} - sum f ({k |k. select_index n i k} \<inter> {k |k. k < 2 ^ n \<and> \<not> select_index n i k})
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
sum f ({k |k. select_index n i k} \<union> {k |k. k < 2 ^ n \<and> \<not> select_index n i k}) = sum f {k |k. select_index n i k} + sum f {k |k. k < 2 ^ n \<and> \<not> select_index n i k} - sum f ({k |k. select_index n i k} \<inter> {k |k. k < 2 ^ n \<and> \<not> select_index n i k})

goal (1 subgoal):
 1. sum f {k |k. select_index n i k} + sum f {k |k. k < 2 ^ n \<and> \<not> select_index n i k} = sum f {0..<2 ^ n}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
sum f ({k |k. select_index n i k} \<union> {k |k. k < 2 ^ n \<and> \<not> select_index n i k}) = sum f {k |k. select_index n i k} + sum f {k |k. k < 2 ^ n \<and> \<not> select_index n i k} - sum f ({k |k. select_index n i k} \<inter> {k |k. k < 2 ^ n \<and> \<not> select_index n i k})
[PROOF STEP]
have "(\<Sum>j\<in>{0..<2^n::nat}. (f j)) =
                (\<Sum>j\<in>{k| k::nat. select_index n i k}. (f j)) +
                (\<Sum>j\<in>{k| k::nat. (k<2^n) \<and> \<not> select_index n i k}. (f j)) -
                (\<Sum>j\<in>{}. (f j))"
[PROOF STATE]
proof (prove)
using this:
sum f ({k |k. select_index n i k} \<union> {k |k. k < 2 ^ n \<and> \<not> select_index n i k}) = sum f {k |k. select_index n i k} + sum f {k |k. k < 2 ^ n \<and> \<not> select_index n i k} - sum f ({k |k. select_index n i k} \<inter> {k |k. k < 2 ^ n \<and> \<not> select_index n i k})

goal (1 subgoal):
 1. sum f {0..<2 ^ n} = sum f {k |k. select_index n i k} + sum f {k |k. k < 2 ^ n \<and> \<not> select_index n i k} - sum f {}
[PROOF STEP]
using select_index_union select_index_inter
[PROOF STATE]
proof (prove)
using this:
sum f ({k |k. select_index n i k} \<union> {k |k. k < 2 ^ n \<and> \<not> select_index n i k}) = sum f {k |k. select_index n i k} + sum f {k |k. k < 2 ^ n \<and> \<not> select_index n i k} - sum f ({k |k. select_index n i k} \<inter> {k |k. k < 2 ^ n \<and> \<not> select_index n i k})
{k |k. select_index ?n ?i k} \<union> {k |k. k < 2 ^ ?n \<and> \<not> select_index ?n ?i k} = {0..<2 ^ ?n}
{k |k. select_index ?n ?i k} \<inter> {k |k. k < 2 ^ ?n \<and> \<not> select_index ?n ?i k} = {}

goal (1 subgoal):
 1. sum f {0..<2 ^ n} = sum f {k |k. select_index n i k} + sum f {k |k. k < 2 ^ n \<and> \<not> select_index n i k} - sum f {}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
sum f {0..<2 ^ n} = sum f {k |k. select_index n i k} + sum f {k |k. k < 2 ^ n \<and> \<not> select_index n i k} - sum f {}

goal (1 subgoal):
 1. sum f {k |k. select_index n i k} + sum f {k |k. k < 2 ^ n \<and> \<not> select_index n i k} = sum f {0..<2 ^ n}
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
sum f {0..<2 ^ n} = sum f {k |k. select_index n i k} + sum f {k |k. k < 2 ^ n \<and> \<not> select_index n i k} - sum f {}

goal (1 subgoal):
 1. sum f {k |k. select_index n i k} + sum f {k |k. k < 2 ^ n \<and> \<not> select_index n i k} = sum f {0..<2 ^ n}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
sum f {k |k. select_index n i k} + sum f {k |k. k < 2 ^ n \<and> \<not> select_index n i k} = sum f {0..<2 ^ n}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma path_image_translation: "path_image((\<lambda>x. a + x) \<circ> g) = (\<lambda>x. a + x) ` (path_image g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. path_image ((+) a \<circ> g) = (+) a ` path_image g
[PROOF STEP]
by (simp add: image_comp path_image_def)


[STATEMENT]
lemma "subst_term (subst_term f1 \<circ> f2) t = subst_term f1 (subst_term f2 t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subst_term (subst_term f1 \<circ> f2) t = subst_term f1 (subst_term f2 t)
[PROOF STEP]
proof (induct t rule: term.induct)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x. subst_term (subst_term f1 \<circ> f2) (Var x) = subst_term f1 (subst_term f2 (Var x))
 2. \<And>x1a x2. (\<And>x2a. x2a \<in> set x2 \<Longrightarrow> subst_term (subst_term f1 \<circ> f2) x2a = subst_term f1 (subst_term f2 x2a)) \<Longrightarrow> subst_term (subst_term f1 \<circ> f2) (App x1a x2) = subst_term f1 (subst_term f2 (App x1a x2))
[PROOF STEP]
case (Var a)
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. \<And>x. subst_term (subst_term f1 \<circ> f2) (Var x) = subst_term f1 (subst_term f2 (Var x))
 2. \<And>x1a x2. (\<And>x2a. x2a \<in> set x2 \<Longrightarrow> subst_term (subst_term f1 \<circ> f2) x2a = subst_term f1 (subst_term f2 x2a)) \<Longrightarrow> subst_term (subst_term f1 \<circ> f2) (App x1a x2) = subst_term f1 (subst_term f2 (App x1a x2))
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subst_term (subst_term f1 \<circ> f2) (Var a) = subst_term f1 (subst_term f2 (Var a))
[PROOF STEP]
by (simp add: o_def)
[PROOF STATE]
proof (state)
this:
subst_term (subst_term f1 \<circ> f2) (Var a) = subst_term f1 (subst_term f2 (Var a))

goal (1 subgoal):
 1. \<And>x1a x2. (\<And>x2a. x2a \<in> set x2 \<Longrightarrow> subst_term (subst_term f1 \<circ> f2) x2a = subst_term f1 (subst_term f2 x2a)) \<Longrightarrow> subst_term (subst_term f1 \<circ> f2) (App x1a x2) = subst_term f1 (subst_term f2 (App x1a x2))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x1a x2. (\<And>x2a. x2a \<in> set x2 \<Longrightarrow> subst_term (subst_term f1 \<circ> f2) x2a = subst_term f1 (subst_term f2 x2a)) \<Longrightarrow> subst_term (subst_term f1 \<circ> f2) (App x1a x2) = subst_term f1 (subst_term f2 (App x1a x2))
[PROOF STEP]
case (App b ts)
[PROOF STATE]
proof (state)
this:
?x2a \<in> set ts \<Longrightarrow> subst_term (subst_term f1 \<circ> f2) ?x2a = subst_term f1 (subst_term f2 ?x2a)

goal (1 subgoal):
 1. \<And>x1a x2. (\<And>x2a. x2a \<in> set x2 \<Longrightarrow> subst_term (subst_term f1 \<circ> f2) x2a = subst_term f1 (subst_term f2 x2a)) \<Longrightarrow> subst_term (subst_term f1 \<circ> f2) (App x1a x2) = subst_term f1 (subst_term f2 (App x1a x2))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
?x2a \<in> set ts \<Longrightarrow> subst_term (subst_term f1 \<circ> f2) ?x2a = subst_term f1 (subst_term f2 ?x2a)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
?x2a \<in> set ts \<Longrightarrow> subst_term (subst_term f1 \<circ> f2) ?x2a = subst_term f1 (subst_term f2 ?x2a)

goal (1 subgoal):
 1. subst_term (subst_term f1 \<circ> f2) (App b ts) = subst_term f1 (subst_term f2 (App b ts))
[PROOF STEP]
by (induct ts) simp_all
[PROOF STATE]
proof (state)
this:
subst_term (subst_term f1 \<circ> f2) (App b ts) = subst_term f1 (subst_term f2 (App b ts))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma pos_minus_divideR_less_eq [field_simps]:
  "- (b /\<^sub>R c) < a \<longleftrightarrow> - b < c *\<^sub>R a" if "c > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (- (b /\<^sub>R c) < a) = (- b < c *\<^sub>R a)
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
0 < c

goal (1 subgoal):
 1. (- (b /\<^sub>R c) < a) = (- b < c *\<^sub>R a)
[PROOF STEP]
by (simp add: less_le_not_le pos_le_minus_divideR_eq pos_minus_divideR_le_eq)


[STATEMENT]
lemma "0 \<le> (x::real) \<and> 0 \<le> y \<longrightarrow> x * y * (x + y)\<^sup>2 \<le> (x\<^sup>2 + y\<^sup>2)\<^sup>2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> x \<and> 0 \<le> y \<longrightarrow> x * y * (x + y)\<^sup>2 \<le> (x\<^sup>2 + y\<^sup>2)\<^sup>2
[PROOF STEP]
by (sos "(((A<0 * R<1) + (R<1 * ((R<1 * [~1/2*x^2 + y^2 + ~1/2*x*y]^2) + (R<3/4 * [~1*x^2 + x*y]^2)))))")


[STATEMENT]
lemma n2s_ths:
  \<open>2 + n = Suc (Suc n)\<close>
  \<open>n + 2 = Suc (Suc n)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 + n = Suc (Suc n) &&& n + 2 = Suc (Suc n)
[PROOF STEP]
by (fact add_2_eq_Suc add_2_eq_Suc')+


[STATEMENT]
lemma A_card_eq: "card A = nat ((int p - 1) div 2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card A = nat ((int p - 1) div 2)
[PROOF STEP]
by (auto simp add: A_def)