[STATEMENT]
lemma no_outflow_t: "\<forall>e \<in> outgoing t. f e = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>e\<in>outgoing t. f e = (0::'capacity)
[PROOF STEP]
proof (rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> (\<forall>e\<in>outgoing t. f e = (0::'capacity)) \<Longrightarrow> False
[PROOF STEP]
assume "\<not>(\<forall>e \<in> outgoing t. f e = 0)"
[PROOF STATE]
proof (state)
this:
\<not> (\<forall>e\<in>outgoing t. f e = (0::'capacity))

goal (1 subgoal):
 1. \<not> (\<forall>e\<in>outgoing t. f e = (0::'capacity)) \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> (\<forall>e\<in>outgoing t. f e = (0::'capacity))
[PROOF STEP]
obtain e where obt1: "e \<in> outgoing t \<and> f e \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
\<not> (\<forall>e\<in>outgoing t. f e = (0::'capacity))

goal (1 subgoal):
 1. (\<And>e. e \<in> outgoing t \<and> f e \<noteq> (0::'capacity) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
e \<in> outgoing t \<and> f e \<noteq> (0::'capacity)

goal (1 subgoal):
 1. \<not> (\<forall>e\<in>outgoing t. f e = (0::'capacity)) \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
e \<in> outgoing t \<and> f e \<noteq> (0::'capacity)
[PROOF STEP]
have "e \<in> E"
[PROOF STATE]
proof (prove)
using this:
e \<in> outgoing t \<and> f e \<noteq> (0::'capacity)

goal (1 subgoal):
 1. e \<in> E
[PROOF STEP]
using outgoing_def
[PROOF STATE]
proof (prove)
using this:
e \<in> outgoing t \<and> f e \<noteq> (0::'capacity)
outgoing ?v \<equiv> {(?v, u) |u. (?v, u) \<in> E}

goal (1 subgoal):
 1. e \<in> E
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
e \<in> E

goal (1 subgoal):
 1. \<not> (\<forall>e\<in>outgoing t. f e = (0::'capacity)) \<Longrightarrow> False
[PROOF STEP]
thus "False"
[PROOF STATE]
proof (prove)
using this:
e \<in> E

goal (1 subgoal):
 1. False
[PROOF STEP]
using obt1 no_outgoing_t outgoing_def
[PROOF STATE]
proof (prove)
using this:
e \<in> E
e \<in> outgoing t \<and> f e \<noteq> (0::'capacity)
\<forall>u. (t, u) \<notin> E
outgoing ?v \<equiv> {(?v, u) |u. (?v, u) \<in> E}

goal (1 subgoal):
 1. False
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
False

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma arr_mset_split:
  assumes "l \<le> m" "m \<le> r"
  shows "arr_mset arr l r = arr_mset arr l m + arr_mset arr m r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. arr_mset arr l r = arr_mset arr l m + arr_mset arr m r
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
l \<le> m
m \<le> r

goal (1 subgoal):
 1. arr_mset arr l r = arr_mset arr l m + arr_mset arr m r
[PROOF STEP]
proof(induction m rule: int_ge_induct[of l])
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. l \<le> r \<Longrightarrow> arr_mset arr l r = arr_mset arr l l + arr_mset arr l r
 2. \<And>i. \<lbrakk>l \<le> i; i \<le> r \<Longrightarrow> arr_mset arr l r = arr_mset arr l i + arr_mset arr i r; i + 1 \<le> r\<rbrakk> \<Longrightarrow> arr_mset arr l r = arr_mset arr l (i + 1) + arr_mset arr (i + 1) r
[PROOF STEP]
case (step i)
[PROOF STATE]
proof (state)
this:
l \<le> i
i \<le> r \<Longrightarrow> arr_mset arr l r = arr_mset arr l i + arr_mset arr i r
i + 1 \<le> r

goal (2 subgoals):
 1. l \<le> r \<Longrightarrow> arr_mset arr l r = arr_mset arr l l + arr_mset arr l r
 2. \<And>i. \<lbrakk>l \<le> i; i \<le> r \<Longrightarrow> arr_mset arr l r = arr_mset arr l i + arr_mset arr i r; i + 1 \<le> r\<rbrakk> \<Longrightarrow> arr_mset arr l r = arr_mset arr l (i + 1) + arr_mset arr (i + 1) r
[PROOF STEP]
have add_last: "arr_mset arr l (i + 1) = arr_mset arr l i + {#arr i#}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. arr_mset arr l (i + 1) = arr_mset arr l i + {#arr i#}
[PROOF STEP]
using step arr_mset_append
[PROOF STATE]
proof (prove)
using this:
l \<le> i
i \<le> r \<Longrightarrow> arr_mset arr l r = arr_mset arr l i + arr_mset arr i r
i + 1 \<le> r
?l \<le> ?r \<Longrightarrow> arr_mset ?arr ?l (?r + 1) = arr_mset ?arr ?l ?r + {#?arr ?r#}

goal (1 subgoal):
 1. arr_mset arr l (i + 1) = arr_mset arr l i + {#arr i#}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
arr_mset arr l (i + 1) = arr_mset arr l i + {#arr i#}

goal (2 subgoals):
 1. l \<le> r \<Longrightarrow> arr_mset arr l r = arr_mset arr l l + arr_mset arr l r
 2. \<And>i. \<lbrakk>l \<le> i; i \<le> r \<Longrightarrow> arr_mset arr l r = arr_mset arr l i + arr_mset arr i r; i + 1 \<le> r\<rbrakk> \<Longrightarrow> arr_mset arr l r = arr_mset arr l (i + 1) + arr_mset arr (i + 1) r
[PROOF STEP]
have rem_first: "arr_mset arr (i+1) r = arr_mset arr i r - {#arr i#}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. arr_mset arr (i + 1) r = arr_mset arr i r - {#arr i#}
[PROOF STEP]
by (metis step.prems arr_mset_remove_first add_diff_cancel_right')
[PROOF STATE]
proof (state)
this:
arr_mset arr (i + 1) r = arr_mset arr i r - {#arr i#}

goal (2 subgoals):
 1. l \<le> r \<Longrightarrow> arr_mset arr l r = arr_mset arr l l + arr_mset arr l r
 2. \<And>i. \<lbrakk>l \<le> i; i \<le> r \<Longrightarrow> arr_mset arr l r = arr_mset arr l i + arr_mset arr i r; i + 1 \<le> r\<rbrakk> \<Longrightarrow> arr_mset arr l r = arr_mset arr l (i + 1) + arr_mset arr (i + 1) r
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. arr_mset arr l r = arr_mset arr l (i + 1) + arr_mset arr (i + 1) r
[PROOF STEP]
using step add_last rem_first
[PROOF STATE]
proof (prove)
using this:
l \<le> i
i \<le> r \<Longrightarrow> arr_mset arr l r = arr_mset arr l i + arr_mset arr i r
i + 1 \<le> r
arr_mset arr l (i + 1) = arr_mset arr l i + {#arr i#}
arr_mset arr (i + 1) r = arr_mset arr i r - {#arr i#}

goal (1 subgoal):
 1. arr_mset arr l r = arr_mset arr l (i + 1) + arr_mset arr (i + 1) r
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
arr_mset arr l r = arr_mset arr l (i + 1) + arr_mset arr (i + 1) r

goal (1 subgoal):
 1. l \<le> r \<Longrightarrow> arr_mset arr l r = arr_mset arr l l + arr_mset arr l r
[PROOF STEP]
qed (simp)


[STATEMENT]
lemma vint_assoc_law_addition:
  assumes "x \<in>\<^sub>\<circ> \<int>\<^sub>\<circ>" and "y \<in>\<^sub>\<circ> \<int>\<^sub>\<circ>" and "z \<in>\<^sub>\<circ> \<int>\<^sub>\<circ>"
  shows "(x +\<^sub>\<int> y) +\<^sub>\<int> z = x +\<^sub>\<int> (y +\<^sub>\<int> z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x +\<^sub>\<int> y +\<^sub>\<int> z = x +\<^sub>\<int> (y +\<^sub>\<int> z)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x +\<^sub>\<int> y +\<^sub>\<int> z = x +\<^sub>\<int> (y +\<^sub>\<int> z)
[PROOF STEP]
have "(x' + y') + z' = x' + (y' + z')" for x' y' z' :: int
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x' + y' + z' = x' + (y' + z')
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
?x' + ?y' + ?z' = ?x' + (?y' + ?z')

goal (1 subgoal):
 1. x +\<^sub>\<int> y +\<^sub>\<int> z = x +\<^sub>\<int> (y +\<^sub>\<int> z)
[PROOF STEP]
from this[untransferred, OF assms]
[PROOF STATE]
proof (chain)
picking this:
x +\<^sub>\<int> y +\<^sub>\<int> z = x +\<^sub>\<int> (y +\<^sub>\<int> z)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
x +\<^sub>\<int> y +\<^sub>\<int> z = x +\<^sub>\<int> (y +\<^sub>\<int> z)

goal (1 subgoal):
 1. x +\<^sub>\<int> y +\<^sub>\<int> z = x +\<^sub>\<int> (y +\<^sub>\<int> z)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
x +\<^sub>\<int> y +\<^sub>\<int> z = x +\<^sub>\<int> (y +\<^sub>\<int> z)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma interval_lebesgue_integral_le_eq:
  fixes a b f
  assumes "a \<le> b"
  shows "interval_lebesgue_integral M a b f = (LINT x : einterval a b | M. f x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. interval_lebesgue_integral M a b f = set_lebesgue_integral M (einterval a b) f
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
a \<le> b

goal (1 subgoal):
 1. interval_lebesgue_integral M a b f = set_lebesgue_integral M (einterval a b) f
[PROOF STEP]
by (auto simp: interval_lebesgue_integral_def)


[STATEMENT]
lemma connected_with_outside:
    fixes S :: "'a :: real_normed_vector set"
    assumes S: "closed S" and cons: "connected S"
      shows "connected(S \<union> outside S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. connected (S \<union> outside S)
[PROOF STEP]
proof (cases "S \<union> outside S = UNIV")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. S \<union> outside S = UNIV \<Longrightarrow> connected (S \<union> outside S)
 2. S \<union> outside S \<noteq> UNIV \<Longrightarrow> connected (S \<union> outside S)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
S \<union> outside S = UNIV

goal (2 subgoals):
 1. S \<union> outside S = UNIV \<Longrightarrow> connected (S \<union> outside S)
 2. S \<union> outside S \<noteq> UNIV \<Longrightarrow> connected (S \<union> outside S)
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
closed S
connected S
S \<union> outside S = UNIV
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
closed S
connected S
S \<union> outside S = UNIV

goal (1 subgoal):
 1. connected (S \<union> outside S)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
connected (S \<union> outside S)

goal (1 subgoal):
 1. S \<union> outside S \<noteq> UNIV \<Longrightarrow> connected (S \<union> outside S)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. S \<union> outside S \<noteq> UNIV \<Longrightarrow> connected (S \<union> outside S)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
S \<union> outside S \<noteq> UNIV

goal (1 subgoal):
 1. S \<union> outside S \<noteq> UNIV \<Longrightarrow> connected (S \<union> outside S)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
S \<union> outside S \<noteq> UNIV
[PROOF STEP]
obtain b where b: "b \<notin> S" "b \<notin> outside S"
[PROOF STATE]
proof (prove)
using this:
S \<union> outside S \<noteq> UNIV

goal (1 subgoal):
 1. (\<And>b. \<lbrakk>b \<notin> S; b \<notin> outside S\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
b \<notin> S
b \<notin> outside S

goal (1 subgoal):
 1. S \<union> outside S \<noteq> UNIV \<Longrightarrow> connected (S \<union> outside S)
[PROOF STEP]
have *: "\<exists>y T. y \<in> S \<and> connected T \<and> a \<in> T \<and> y \<in> T \<and> T \<subseteq> (S \<union> outside S)" if "a \<in> (S \<union> outside S)" for a
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>y T. y \<in> S \<and> connected T \<and> a \<in> T \<and> y \<in> T \<and> T \<subseteq> S \<union> outside S
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
a \<in> S \<union> outside S

goal (1 subgoal):
 1. \<exists>y T. y \<in> S \<and> connected T \<and> a \<in> T \<and> y \<in> T \<and> T \<subseteq> S \<union> outside S
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. a \<in> S \<Longrightarrow> \<exists>y T. y \<in> S \<and> connected T \<and> a \<in> T \<and> y \<in> T \<and> T \<subseteq> S \<union> outside S
 2. a \<in> outside S \<Longrightarrow> \<exists>y T. y \<in> S \<and> connected T \<and> a \<in> T \<and> y \<in> T \<and> T \<subseteq> S \<union> outside S
[PROOF STEP]
assume "a \<in> S"
[PROOF STATE]
proof (state)
this:
a \<in> S

goal (2 subgoals):
 1. a \<in> S \<Longrightarrow> \<exists>y T. y \<in> S \<and> connected T \<and> a \<in> T \<and> y \<in> T \<and> T \<subseteq> S \<union> outside S
 2. a \<in> outside S \<Longrightarrow> \<exists>y T. y \<in> S \<and> connected T \<and> a \<in> T \<and> y \<in> T \<and> T \<subseteq> S \<union> outside S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a \<in> S
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
a \<in> S

goal (1 subgoal):
 1. \<exists>y T. y \<in> S \<and> connected T \<and> a \<in> T \<and> y \<in> T \<and> T \<subseteq> S \<union> outside S
[PROOF STEP]
by (rule_tac x=a in exI, rule_tac x="{a}" in exI, simp)
[PROOF STATE]
proof (state)
this:
\<exists>y T. y \<in> S \<and> connected T \<and> a \<in> T \<and> y \<in> T \<and> T \<subseteq> S \<union> outside S

goal (1 subgoal):
 1. a \<in> outside S \<Longrightarrow> \<exists>y T. y \<in> S \<and> connected T \<and> a \<in> T \<and> y \<in> T \<and> T \<subseteq> S \<union> outside S
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. a \<in> outside S \<Longrightarrow> \<exists>y T. y \<in> S \<and> connected T \<and> a \<in> T \<and> y \<in> T \<and> T \<subseteq> S \<union> outside S
[PROOF STEP]
assume a: "a \<in> outside S"
[PROOF STATE]
proof (state)
this:
a \<in> outside S

goal (1 subgoal):
 1. a \<in> outside S \<Longrightarrow> \<exists>y T. y \<in> S \<and> connected T \<and> a \<in> T \<and> y \<in> T \<and> T \<subseteq> S \<union> outside S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a \<in> outside S
[PROOF STEP]
have ain: "a \<in> closure (outside S)"
[PROOF STATE]
proof (prove)
using this:
a \<in> outside S

goal (1 subgoal):
 1. a \<in> closure (outside S)
[PROOF STEP]
by (simp add: closure_def)
[PROOF STATE]
proof (state)
this:
a \<in> closure (outside S)

goal (1 subgoal):
 1. a \<in> outside S \<Longrightarrow> \<exists>y T. y \<in> S \<and> connected T \<and> a \<in> T \<and> y \<in> T \<and> T \<subseteq> S \<union> outside S
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>y T. y \<in> S \<and> connected T \<and> a \<in> T \<and> y \<in> T \<and> T \<subseteq> S \<union> outside S
[PROOF STEP]
apply (rule exists_path_subpath_to_frontier [OF path_linepath [of a b], of "outside S"])
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. pathstart (linepath a b) \<in> closure (outside S)
 2. pathfinish (linepath a b) \<notin> outside S
 3. \<And>h. \<lbrakk>path h; pathstart h = pathstart (linepath a b); path_image h \<subseteq> path_image (linepath a b); path_image h - {pathfinish h} \<subseteq> interior (outside S); pathfinish h \<in> frontier (outside S)\<rbrakk> \<Longrightarrow> \<exists>y T. y \<in> S \<and> connected T \<and> a \<in> T \<and> y \<in> T \<and> T \<subseteq> S \<union> outside S
[PROOF STEP]
apply (simp_all add: ain b)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>h. \<lbrakk>path h; pathstart h = a; path_image h \<subseteq> closed_segment a b; path_image h - {pathfinish h} \<subseteq> interior (outside S); pathfinish h \<in> frontier (outside S)\<rbrakk> \<Longrightarrow> \<exists>y. y \<in> S \<and> (\<exists>T. connected T \<and> a \<in> T \<and> y \<in> T \<and> T \<subseteq> S \<union> outside S)
[PROOF STEP]
subgoal for h
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>path h; pathstart h = a; path_image h \<subseteq> closed_segment a b; path_image h - {pathfinish h} \<subseteq> interior (outside S); pathfinish h \<in> frontier (outside S)\<rbrakk> \<Longrightarrow> \<exists>y. y \<in> S \<and> (\<exists>T. connected T \<and> a \<in> T \<and> y \<in> T \<and> T \<subseteq> S \<union> outside S)
[PROOF STEP]
apply (rule_tac x="pathfinish h" in exI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>path h; pathstart h = a; path_image h \<subseteq> closed_segment a b; path_image h - {pathfinish h} \<subseteq> interior (outside S); pathfinish h \<in> frontier (outside S)\<rbrakk> \<Longrightarrow> pathfinish h \<in> S \<and> (\<exists>T. connected T \<and> a \<in> T \<and> pathfinish h \<in> T \<and> T \<subseteq> S \<union> outside S)
[PROOF STEP]
apply (simp add: subsetD [OF frontier_outside_subset[OF S]])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>path h; pathstart h = a; path_image h \<subseteq> closed_segment a b; path_image h - {pathfinish h} \<subseteq> interior (outside S); pathfinish h \<in> frontier (outside S)\<rbrakk> \<Longrightarrow> \<exists>T. connected T \<and> a \<in> T \<and> pathfinish h \<in> T \<and> T \<subseteq> S \<union> outside S
[PROOF STEP]
apply (rule_tac x="path_image h" in exI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>path h; pathstart h = a; path_image h \<subseteq> closed_segment a b; path_image h - {pathfinish h} \<subseteq> interior (outside S); pathfinish h \<in> frontier (outside S)\<rbrakk> \<Longrightarrow> connected (path_image h) \<and> a \<in> path_image h \<and> pathfinish h \<in> path_image h \<and> path_image h \<subseteq> S \<union> outside S
[PROOF STEP]
apply (simp add: pathfinish_in_path_image connected_path_image, auto)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>path h; path_image h \<subseteq> closed_segment (pathstart h) b; path_image h - {pathfinish h} \<subseteq> interior (outside S); pathfinish h \<in> frontier (outside S); a = pathstart h; x \<in> path_image h; x \<notin> outside S\<rbrakk> \<Longrightarrow> x \<in> S
[PROOF STEP]
by (metis (no_types, lifting) frontier_outside_subset insertE insert_Diff interior_eq open_outside pathfinish_in_path_image S subsetCE)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
\<exists>y T. y \<in> S \<and> connected T \<and> a \<in> T \<and> y \<in> T \<and> T \<subseteq> S \<union> outside S

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
?a \<in> S \<union> outside S \<Longrightarrow> \<exists>y T. y \<in> S \<and> connected T \<and> ?a \<in> T \<and> y \<in> T \<and> T \<subseteq> S \<union> outside S

goal (1 subgoal):
 1. S \<union> outside S \<noteq> UNIV \<Longrightarrow> connected (S \<union> outside S)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. connected (S \<union> outside S)
[PROOF STEP]
apply (simp add: connected_iff_connected_component)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>S \<union> outside S. \<forall>y\<in>S \<union> outside S. connected_component (S \<union> outside S) x y
[PROOF STEP]
apply (clarsimp simp add: connected_component_def dest!: *)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x y ya yb T Ta. \<lbrakk>ya \<in> S; yb \<in> S; connected T; connected Ta; x \<in> T; y \<in> Ta; ya \<in> T; T \<subseteq> S \<union> outside S; yb \<in> Ta; Ta \<subseteq> S \<union> outside S\<rbrakk> \<Longrightarrow> \<exists>T. connected T \<and> T \<subseteq> S \<union> outside S \<and> x \<in> T \<and> y \<in> T
[PROOF STEP]
subgoal for x y u u' T t'
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>u \<in> S; u' \<in> S; connected T; connected t'; x \<in> T; y \<in> t'; u \<in> T; T \<subseteq> S \<union> outside S; u' \<in> t'; t' \<subseteq> S \<union> outside S\<rbrakk> \<Longrightarrow> \<exists>T. connected T \<and> T \<subseteq> S \<union> outside S \<and> x \<in> T \<and> y \<in> T
[PROOF STEP]
by (rule_tac x="(S \<union> T \<union> t')" in exI) (auto intro!: connected_Un cons)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
connected (S \<union> outside S)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma translate_origin: "NO_MATCH 0 p \<Longrightarrow> ccw p q r \<longleftrightarrow> ccw 0 (q - p) (r - p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. NO_MATCH (0::'b) p \<Longrightarrow> ccw p q r = ccw (0::'a) (q - p) (r - p)
[PROOF STEP]
using translate_plus[of p "- p" q r]
[PROOF STATE]
proof (prove)
using this:
ccw (p + - p) (q + - p) (r + - p) = ccw p q r

goal (1 subgoal):
 1. NO_MATCH (0::'b) p \<Longrightarrow> ccw p q r = ccw (0::'a) (q - p) (r - p)
[PROOF STEP]
by simp


[STATEMENT]
lemma Re_pos_in_ball:
  assumes "Re z > 0" "t \<in> ball z (Re z/2)"
  shows   "Re t > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < Re t
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 0 < Re t
[PROOF STEP]
have "Re (z - t) \<le> norm (z - t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Re (z - t) \<le> cmod (z - t)
[PROOF STEP]
by (rule complex_Re_le_cmod)
[PROOF STATE]
proof (state)
this:
Re (z - t) \<le> cmod (z - t)

goal (1 subgoal):
 1. 0 < Re t
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
Re (z - t) \<le> cmod (z - t)

goal (1 subgoal):
 1. 0 < Re t
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
0 < Re z
t \<in> ball z (Re z / 2)
[PROOF STEP]
have "\<dots> < Re z / 2"
[PROOF STATE]
proof (prove)
using this:
0 < Re z
t \<in> ball z (Re z / 2)

goal (1 subgoal):
 1. cmod (z - t) < Re z / 2
[PROOF STEP]
by (simp add: dist_complex_def)
[PROOF STATE]
proof (state)
this:
cmod (z - t) < Re z / 2

goal (1 subgoal):
 1. 0 < Re t
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
Re (z - t) < Re z / 2
[PROOF STEP]
show "Re t > 0"
[PROOF STATE]
proof (prove)
using this:
Re (z - t) < Re z / 2

goal (1 subgoal):
 1. 0 < Re t
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
Re (z - t) < Re z / 2
0 < Re z
t \<in> ball z (Re z / 2)

goal (1 subgoal):
 1. 0 < Re t
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
0 < Re t

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma inf_complement_left_antitone:
  "-x \<le> -y \<Longrightarrow> -(-y \<sqinter> -z) \<le> -(-x \<sqinter> -z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - x \<le> - y \<Longrightarrow> - (- y \<sqinter> - z) \<le> - (- x \<sqinter> - z)
[PROOF STEP]
by (simp add: sub_complement_antitone inf_demorgan sub_sup_left_isotone)


[STATEMENT]
theorem mono_step': "S1 \<le> S2 \<Longrightarrow> C1 \<le> C2 \<Longrightarrow> step' S1 C1 \<le> step' S2 C2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>S1 \<le> S2; C1 \<le> C2\<rbrakk> \<Longrightarrow> step' S1 C1 \<le> step' S2 C2
[PROOF STEP]
unfolding step'_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>S1 \<le> S2; C1 \<le> C2\<rbrakk> \<Longrightarrow> Step (\<lambda>x e. case_option None (\<lambda>S. Some (update S x (aval' e S)))) (\<lambda>b S. S) S1 C1 \<le> Step (\<lambda>x e. case_option None (\<lambda>S. Some (update S x (aval' e S)))) (\<lambda>b S. S) S2 C2
[PROOF STEP]
by(rule mono2_Step) (auto simp: mono_aval' split: option.split)


[STATEMENT]
lemma insert_simp_mima: assumes "x = mi \<or> x = ma" and "deg \<ge> 2"
  shows "vebt_insert (Node (Some (mi,ma)) deg treeList summary) x =  (Node (Some (mi,ma)) deg treeList summary)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vebt_insert (Node (Some (mi, ma)) deg treeList summary) x = Node (Some (mi, ma)) deg treeList summary
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. vebt_insert (Node (Some (mi, ma)) deg treeList summary) x = Node (Some (mi, ma)) deg treeList summary
[PROOF STEP]
have 11:"vebt_insert (Node (Some (mi,ma)) deg treeList summary) x =
    ( let xn = (if x < mi then mi else x); minn = (if x< mi then x else mi);
                  l= low xn (deg div 2); h = high xn (deg div 2)
                   in
              ( if h < length treeList \<and> \<not> (x = mi \<or> x = ma)then
                 Node (Some (minn, max xn ma)) deg (treeList[h:= vebt_insert (treeList ! h) l])
                               (if minNull (treeList ! h) then  vebt_insert summary h else summary)
    else  (Node (Some (mi, ma)) deg treeList summary)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vebt_insert (Node (Some (mi, ma)) deg treeList summary) x = (let xn = if x < mi then mi else x; minn = if x < mi then x else mi; l = low xn (deg div 2); h = high xn (deg div 2) in if h < length treeList \<and> \<not> (x = mi \<or> x = ma) then Node (Some (minn, max xn ma)) deg (treeList[h := vebt_insert (treeList ! h) l]) (if minNull (treeList ! h) then vebt_insert summary h else summary) else Node (Some (mi, ma)) deg treeList summary)
[PROOF STEP]
using assms vebt_insert.simps(5)[of mi ma "deg-2" treeList summary x]
[PROOF STATE]
proof (prove)
using this:
x = mi \<or> x = ma
2 \<le> deg
vebt_insert (Node (Some (mi, ma)) (Suc (Suc (deg - 2))) treeList summary) x = (let xn = if x < mi then mi else x; minn = if x < mi then x else mi; l = low xn (Suc (Suc (deg - 2)) div 2); h = high xn (Suc (Suc (deg - 2)) div 2) in if h < length treeList \<and> \<not> (x = mi \<or> x = ma) then Node (Some (minn, max xn ma)) (Suc (Suc (deg - 2))) (treeList[h := vebt_insert (treeList ! h) l]) (if minNull (treeList ! h) then vebt_insert summary h else summary) else Node (Some (mi, ma)) (Suc (Suc (deg - 2))) treeList summary)

goal (1 subgoal):
 1. vebt_insert (Node (Some (mi, ma)) deg treeList summary) x = (let xn = if x < mi then mi else x; minn = if x < mi then x else mi; l = low xn (deg div 2); h = high xn (deg div 2) in if h < length treeList \<and> \<not> (x = mi \<or> x = ma) then Node (Some (minn, max xn ma)) deg (treeList[h := vebt_insert (treeList ! h) l]) (if minNull (treeList ! h) then vebt_insert summary h else summary) else Node (Some (mi, ma)) deg treeList summary)
[PROOF STEP]
by (smt add_numeral_left le_add_diff_inverse numerals(1) plus_1_eq_Suc semiring_norm(2))
[PROOF STATE]
proof (state)
this:
vebt_insert (Node (Some (mi, ma)) deg treeList summary) x = (let xn = if x < mi then mi else x; minn = if x < mi then x else mi; l = low xn (deg div 2); h = high xn (deg div 2) in if h < length treeList \<and> \<not> (x = mi \<or> x = ma) then Node (Some (minn, max xn ma)) deg (treeList[h := vebt_insert (treeList ! h) l]) (if minNull (treeList ! h) then vebt_insert summary h else summary) else Node (Some (mi, ma)) deg treeList summary)

goal (1 subgoal):
 1. vebt_insert (Node (Some (mi, ma)) deg treeList summary) x = Node (Some (mi, ma)) deg treeList summary
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
vebt_insert (Node (Some (mi, ma)) deg treeList summary) x = (let xn = if x < mi then mi else x; minn = if x < mi then x else mi; l = low xn (deg div 2); h = high xn (deg div 2) in if h < length treeList \<and> \<not> (x = mi \<or> x = ma) then Node (Some (minn, max xn ma)) deg (treeList[h := vebt_insert (treeList ! h) l]) (if minNull (treeList ! h) then vebt_insert summary h else summary) else Node (Some (mi, ma)) deg treeList summary)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
vebt_insert (Node (Some (mi, ma)) deg treeList summary) x = (let xn = if x < mi then mi else x; minn = if x < mi then x else mi; l = low xn (deg div 2); h = high xn (deg div 2) in if h < length treeList \<and> \<not> (x = mi \<or> x = ma) then Node (Some (minn, max xn ma)) deg (treeList[h := vebt_insert (treeList ! h) l]) (if minNull (treeList ! h) then vebt_insert summary h else summary) else Node (Some (mi, ma)) deg treeList summary)

goal (1 subgoal):
 1. vebt_insert (Node (Some (mi, ma)) deg treeList summary) x = Node (Some (mi, ma)) deg treeList summary
[PROOF STEP]
using assms(1)
[PROOF STATE]
proof (prove)
using this:
vebt_insert (Node (Some (mi, ma)) deg treeList summary) x = (let xn = if x < mi then mi else x; minn = if x < mi then x else mi; l = low xn (deg div 2); h = high xn (deg div 2) in if h < length treeList \<and> \<not> (x = mi \<or> x = ma) then Node (Some (minn, max xn ma)) deg (treeList[h := vebt_insert (treeList ! h) l]) (if minNull (treeList ! h) then vebt_insert summary h else summary) else Node (Some (mi, ma)) deg treeList summary)
x = mi \<or> x = ma

goal (1 subgoal):
 1. vebt_insert (Node (Some (mi, ma)) deg treeList summary) x = Node (Some (mi, ma)) deg treeList summary
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
vebt_insert (Node (Some (mi, ma)) deg treeList summary) x = Node (Some (mi, ma)) deg treeList summary

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma finmap_UNIV[simp]: "(\<Union>J\<in>Collect finite. \<Pi>' j\<in>J. UNIV) = UNIV"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Union>J\<in>Collect finite. \<Pi>' j\<in>J. UNIV) = UNIV
[PROOF STEP]
by auto


[STATEMENT]
lemma mem_Rep_preal_mult_iff:
  "(z \<in> Rep_preal(r*s)) = (\<exists>x \<in> Rep_preal r. \<exists>y \<in> Rep_preal s. z = x * y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (z \<in> Rep_preal (r * s)) = (\<exists>x\<in>Rep_preal r. \<exists>y\<in>Rep_preal s. z = x * y)
[PROOF STEP]
apply (simp add: preal_mult_def mem_mult_set Rep_preal)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (z \<in> mult_set (Rep_preal r) (Rep_preal s)) = (\<exists>x\<in>Rep_preal r. \<exists>y\<in>Rep_preal s. z = x * y)
[PROOF STEP]
apply (simp add: mult_set_def)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma finite_ReZ_segments_poly_rectpath:
    "finite_ReZ_segments (poly p \<circ> rectpath a b) z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite_ReZ_segments (poly p \<circ> rectpath a b) z
[PROOF STEP]
unfolding rectpath_def Let_def path_compose_join
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite_ReZ_segments ((poly p \<circ> linepath a (Complex (Re b) (Im a))) +++ (poly p \<circ> linepath (Complex (Re b) (Im a)) b) +++ (poly p \<circ> linepath b (Complex (Re a) (Im b))) +++ (poly p \<circ> linepath (Complex (Re a) (Im b)) a)) z
[PROOF STEP]
by ((subst finite_ReZ_segments_joinpaths
            |intro path_poly_comp conjI);
        (simp add:poly_linepath_comp finite_ReZ_segments_poly_of_real path_compose_join
          pathfinish_compose pathstart_compose poly_pcompose)?)+


[STATEMENT]
lemma c_tr_append:
 "c_tr step out s (xs @ ys) = c_tr step out s xs @ c_tr step out (foldl step s xs) ys"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c_tr step out s (xs @ ys) = c_tr step out s xs @ c_tr step out (foldl step s xs) ys
[PROOF STEP]
proof (rule_tac xs = ys in rev_induct, simp, subst append_assoc [symmetric])
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x xsa. c_tr step out s (xs @ xsa) = c_tr step out s xs @ c_tr step out (foldl step s xs) xsa \<Longrightarrow> c_tr step out s ((xs @ xsa) @ [x]) = c_tr step out s xs @ c_tr step out (foldl step s xs) (xsa @ [x])
[PROOF STEP]
qed (simp del: append_assoc)


[STATEMENT]
lemma invertible_Gauss_Jordan_column_k:
  fixes A::"'a::{field}^'n::{mod_type}^'m::{mod_type}" and k::nat
  shows "\<exists>P. invertible P \<and> (snd (Gauss_Jordan_column_k (i,A) k)) = P**A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>P. invertible P \<and> snd (Gauss_Jordan_column_k (i, A) k) = P ** A
[PROOF STEP]
unfolding Gauss_Jordan_column_k_def Let_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>P. invertible P \<and> snd (if (\<forall>m\<ge>mod_type_class.from_nat (fst (i, A)). snd (i, A) $ m $ mod_type_class.from_nat k = (0::'a)) \<or> fst (i, A) = nrows (snd (i, A)) then (fst (i, A), snd (i, A)) else (fst (i, A) + 1, Gauss_Jordan_in_ij (snd (i, A)) (mod_type_class.from_nat (fst (i, A))) (mod_type_class.from_nat k))) = P ** A
[PROOF STEP]
proof (auto)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<forall>m\<ge>mod_type_class.from_nat i. A $ m $ mod_type_class.from_nat k = (0::'a) \<Longrightarrow> \<exists>P. invertible P \<and> A = P ** A
 2. i = nrows A \<Longrightarrow> \<exists>P. invertible P \<and> A = P ** A
 3. \<And>m. \<lbrakk>i \<noteq> nrows A; mod_type_class.from_nat i \<le> m; A $ m $ mod_type_class.from_nat k \<noteq> (0::'a)\<rbrakk> \<Longrightarrow> \<exists>P. invertible P \<and> Gauss_Jordan_in_ij A (mod_type_class.from_nat i) (mod_type_class.from_nat k) = P ** A
[PROOF STEP]
show "\<exists>P. invertible P \<and> A = P ** A" and "\<exists>P. invertible P \<and> A = P ** A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>P. invertible P \<and> A = P ** A &&& \<exists>P. invertible P \<and> A = P ** A
[PROOF STEP]
using invertible_mat_1 matrix_mul_lid[of A]
[PROOF STATE]
proof (prove)
using this:
invertible (mat (1::?'a))
mat (1::'a) ** A = A

goal (1 subgoal):
 1. \<exists>P. invertible P \<and> A = P ** A &&& \<exists>P. invertible P \<and> A = P ** A
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>P. invertible P \<and> A = P ** A
\<exists>P. invertible P \<and> A = P ** A

goal (1 subgoal):
 1. \<And>m. \<lbrakk>i \<noteq> nrows A; mod_type_class.from_nat i \<le> m; A $ m $ mod_type_class.from_nat k \<noteq> (0::'a)\<rbrakk> \<Longrightarrow> \<exists>P. invertible P \<and> Gauss_Jordan_in_ij A (mod_type_class.from_nat i) (mod_type_class.from_nat k) = P ** A
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>m. \<lbrakk>i \<noteq> nrows A; mod_type_class.from_nat i \<le> m; A $ m $ mod_type_class.from_nat k \<noteq> (0::'a)\<rbrakk> \<Longrightarrow> \<exists>P. invertible P \<and> Gauss_Jordan_in_ij A (mod_type_class.from_nat i) (mod_type_class.from_nat k) = P ** A
[PROOF STEP]
fix m
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>m. \<lbrakk>i \<noteq> nrows A; mod_type_class.from_nat i \<le> m; A $ m $ mod_type_class.from_nat k \<noteq> (0::'a)\<rbrakk> \<Longrightarrow> \<exists>P. invertible P \<and> Gauss_Jordan_in_ij A (mod_type_class.from_nat i) (mod_type_class.from_nat k) = P ** A
[PROOF STEP]
assume i: "i \<noteq> nrows A"
    and i_le_m: "from_nat i \<le> m" and Amk_not_zero: "A $ m $ from_nat k \<noteq> 0"
[PROOF STATE]
proof (state)
this:
i \<noteq> nrows A
mod_type_class.from_nat i \<le> m
A $ m $ mod_type_class.from_nat k \<noteq> (0::'a)

goal (1 subgoal):
 1. \<And>m. \<lbrakk>i \<noteq> nrows A; mod_type_class.from_nat i \<le> m; A $ m $ mod_type_class.from_nat k \<noteq> (0::'a)\<rbrakk> \<Longrightarrow> \<exists>P. invertible P \<and> Gauss_Jordan_in_ij A (mod_type_class.from_nat i) (mod_type_class.from_nat k) = P ** A
[PROOF STEP]
define A_interchange where "A_interchange = interchange_rows A (from_nat i) (LEAST n. A $ n $ from_nat k \<noteq> 0 \<and> (from_nat i) \<le> n)"
[PROOF STATE]
proof (state)
this:
A_interchange = interchange_rows A (mod_type_class.from_nat i) (LEAST n. A $ n $ mod_type_class.from_nat k \<noteq> (0::'a) \<and> mod_type_class.from_nat i \<le> n)

goal (1 subgoal):
 1. \<And>m. \<lbrakk>i \<noteq> nrows A; mod_type_class.from_nat i \<le> m; A $ m $ mod_type_class.from_nat k \<noteq> (0::'a)\<rbrakk> \<Longrightarrow> \<exists>P. invertible P \<and> Gauss_Jordan_in_ij A (mod_type_class.from_nat i) (mod_type_class.from_nat k) = P ** A
[PROOF STEP]
define A_mult where "A_mult = mult_row A_interchange (from_nat i) (1 / (A_interchange $ (from_nat i) $ from_nat k))"
[PROOF STATE]
proof (state)
this:
A_mult = mult_row A_interchange (mod_type_class.from_nat i) ((1::'a) / A_interchange $ mod_type_class.from_nat i $ mod_type_class.from_nat k)

goal (1 subgoal):
 1. \<And>m. \<lbrakk>i \<noteq> nrows A; mod_type_class.from_nat i \<le> m; A $ m $ mod_type_class.from_nat k \<noteq> (0::'a)\<rbrakk> \<Longrightarrow> \<exists>P. invertible P \<and> Gauss_Jordan_in_ij A (mod_type_class.from_nat i) (mod_type_class.from_nat k) = P ** A
[PROOF STEP]
obtain P where inv_P: "invertible P" and PA: "A_interchange = P**A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>P. \<lbrakk>invertible P; A_interchange = P ** A\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding A_interchange_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>P. \<lbrakk>invertible P; interchange_rows A (mod_type_class.from_nat i) (LEAST n. A $ n $ mod_type_class.from_nat k \<noteq> (0::'a) \<and> mod_type_class.from_nat i \<le> n) = P ** A\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using interchange_rows_mat_1[of "from_nat i" "(LEAST n. A $ n $ from_nat k \<noteq> 0 \<and> from_nat i \<le> n)" A]
[PROOF STATE]
proof (prove)
using this:
interchange_rows (mat (1::'a)) (mod_type_class.from_nat i) (LEAST n. A $ n $ mod_type_class.from_nat k \<noteq> (0::'a) \<and> mod_type_class.from_nat i \<le> n) ** A = interchange_rows A (mod_type_class.from_nat i) (LEAST n. A $ n $ mod_type_class.from_nat k \<noteq> (0::'a) \<and> mod_type_class.from_nat i \<le> n)

goal (1 subgoal):
 1. (\<And>P. \<lbrakk>invertible P; interchange_rows A (mod_type_class.from_nat i) (LEAST n. A $ n $ mod_type_class.from_nat k \<noteq> (0::'a) \<and> mod_type_class.from_nat i \<le> n) = P ** A\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using invertible_interchange_rows[of "from_nat i" "(LEAST n. A $ n $ from_nat k \<noteq> 0 \<and> from_nat i \<le> n)"]
[PROOF STATE]
proof (prove)
using this:
interchange_rows (mat (1::'a)) (mod_type_class.from_nat i) (LEAST n. A $ n $ mod_type_class.from_nat k \<noteq> (0::'a) \<and> mod_type_class.from_nat i \<le> n) ** A = interchange_rows A (mod_type_class.from_nat i) (LEAST n. A $ n $ mod_type_class.from_nat k \<noteq> (0::'a) \<and> mod_type_class.from_nat i \<le> n)
invertible (interchange_rows (mat (1::?'a)) (mod_type_class.from_nat i) (LEAST n. A $ n $ mod_type_class.from_nat k \<noteq> (0::'a) \<and> mod_type_class.from_nat i \<le> n))

goal (1 subgoal):
 1. (\<And>P. \<lbrakk>invertible P; interchange_rows A (mod_type_class.from_nat i) (LEAST n. A $ n $ mod_type_class.from_nat k \<noteq> (0::'a) \<and> mod_type_class.from_nat i \<le> n) = P ** A\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
invertible P
A_interchange = P ** A

goal (1 subgoal):
 1. \<And>m. \<lbrakk>i \<noteq> nrows A; mod_type_class.from_nat i \<le> m; A $ m $ mod_type_class.from_nat k \<noteq> (0::'a)\<rbrakk> \<Longrightarrow> \<exists>P. invertible P \<and> Gauss_Jordan_in_ij A (mod_type_class.from_nat i) (mod_type_class.from_nat k) = P ** A
[PROOF STEP]
define Q :: "'a^'m::{mod_type}^'m::{mod_type}"
    where "Q = mult_row (mat 1) (from_nat i) (1 / (A_interchange $ (from_nat i) $ from_nat k))"
[PROOF STATE]
proof (state)
this:
Q = mult_row (mat (1::'a)) (mod_type_class.from_nat i) ((1::'a) / A_interchange $ mod_type_class.from_nat i $ mod_type_class.from_nat k)

goal (1 subgoal):
 1. \<And>m. \<lbrakk>i \<noteq> nrows A; mod_type_class.from_nat i \<le> m; A $ m $ mod_type_class.from_nat k \<noteq> (0::'a)\<rbrakk> \<Longrightarrow> \<exists>P. invertible P \<and> Gauss_Jordan_in_ij A (mod_type_class.from_nat i) (mod_type_class.from_nat k) = P ** A
[PROOF STEP]
have Q_A_interchange: "A_mult = Q**A_interchange"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A_mult = Q ** A_interchange
[PROOF STEP]
unfolding A_mult_def A_interchange_def Q_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mult_row (interchange_rows A (mod_type_class.from_nat i) (LEAST n. A $ n $ mod_type_class.from_nat k \<noteq> (0::'a) \<and> mod_type_class.from_nat i \<le> n)) (mod_type_class.from_nat i) ((1::'a) / interchange_rows A (mod_type_class.from_nat i) (LEAST n. A $ n $ mod_type_class.from_nat k \<noteq> (0::'a) \<and> mod_type_class.from_nat i \<le> n) $ mod_type_class.from_nat i $ mod_type_class.from_nat k) = mult_row (mat (1::'a)) (mod_type_class.from_nat i) ((1::'a) / interchange_rows A (mod_type_class.from_nat i) (LEAST n. A $ n $ mod_type_class.from_nat k \<noteq> (0::'a) \<and> mod_type_class.from_nat i \<le> n) $ mod_type_class.from_nat i $ mod_type_class.from_nat k) ** interchange_rows A (mod_type_class.from_nat i) (LEAST n. A $ n $ mod_type_class.from_nat k \<noteq> (0::'a) \<and> mod_type_class.from_nat i \<le> n)
[PROOF STEP]
unfolding mult_row_mat_1
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mult_row (interchange_rows A (mod_type_class.from_nat i) (LEAST n. A $ n $ mod_type_class.from_nat k \<noteq> (0::'a) \<and> mod_type_class.from_nat i \<le> n)) (mod_type_class.from_nat i) ((1::'a) / interchange_rows A (mod_type_class.from_nat i) (LEAST n. A $ n $ mod_type_class.from_nat k \<noteq> (0::'a) \<and> mod_type_class.from_nat i \<le> n) $ mod_type_class.from_nat i $ mod_type_class.from_nat k) = mult_row (interchange_rows A (mod_type_class.from_nat i) (LEAST n. A $ n $ mod_type_class.from_nat k \<noteq> (0::'a) \<and> mod_type_class.from_nat i \<le> n)) (mod_type_class.from_nat i) ((1::'a) / interchange_rows A (mod_type_class.from_nat i) (LEAST n. A $ n $ mod_type_class.from_nat k \<noteq> (0::'a) \<and> mod_type_class.from_nat i \<le> n) $ mod_type_class.from_nat i $ mod_type_class.from_nat k)
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
A_mult = Q ** A_interchange

goal (1 subgoal):
 1. \<And>m. \<lbrakk>i \<noteq> nrows A; mod_type_class.from_nat i \<le> m; A $ m $ mod_type_class.from_nat k \<noteq> (0::'a)\<rbrakk> \<Longrightarrow> \<exists>P. invertible P \<and> Gauss_Jordan_in_ij A (mod_type_class.from_nat i) (mod_type_class.from_nat k) = P ** A
[PROOF STEP]
have inv_Q: "invertible Q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. invertible Q
[PROOF STEP]
proof (unfold Q_def, rule invertible_mult_row', unfold A_interchange_def, rule LeastI2_ex)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<exists>a. A $ a $ mod_type_class.from_nat k \<noteq> (0::'a) \<and> mod_type_class.from_nat i \<le> a
 2. \<And>x. A $ x $ mod_type_class.from_nat k \<noteq> (0::'a) \<and> mod_type_class.from_nat i \<le> x \<Longrightarrow> (1::'a) / interchange_rows A (mod_type_class.from_nat i) x $ mod_type_class.from_nat i $ mod_type_class.from_nat k \<noteq> (0::'a)
[PROOF STEP]
show "\<exists>a. A $ a $ from_nat k \<noteq> 0 \<and> (from_nat i) \<le> a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>a. A $ a $ mod_type_class.from_nat k \<noteq> (0::'a) \<and> mod_type_class.from_nat i \<le> a
[PROOF STEP]
using i_le_m Amk_not_zero
[PROOF STATE]
proof (prove)
using this:
mod_type_class.from_nat i \<le> m
A $ m $ mod_type_class.from_nat k \<noteq> (0::'a)

goal (1 subgoal):
 1. \<exists>a. A $ a $ mod_type_class.from_nat k \<noteq> (0::'a) \<and> mod_type_class.from_nat i \<le> a
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>a. A $ a $ mod_type_class.from_nat k \<noteq> (0::'a) \<and> mod_type_class.from_nat i \<le> a

goal (1 subgoal):
 1. \<And>x. A $ x $ mod_type_class.from_nat k \<noteq> (0::'a) \<and> mod_type_class.from_nat i \<le> x \<Longrightarrow> (1::'a) / interchange_rows A (mod_type_class.from_nat i) x $ mod_type_class.from_nat i $ mod_type_class.from_nat k \<noteq> (0::'a)
[PROOF STEP]
show "\<And>x. A $ x $ from_nat k \<noteq> 0 \<and> (from_nat i) \<le> x \<Longrightarrow> 1 / interchange_rows A (from_nat i) x $ (from_nat i) $ from_nat k \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. A $ x $ mod_type_class.from_nat k \<noteq> (0::'a) \<and> mod_type_class.from_nat i \<le> x \<Longrightarrow> (1::'a) / interchange_rows A (mod_type_class.from_nat i) x $ mod_type_class.from_nat i $ mod_type_class.from_nat k \<noteq> (0::'a)
[PROOF STEP]
using interchange_rows_i mult_zero_left nonzero_divide_eq_eq zero_neq_one
[PROOF STATE]
proof (prove)
using this:
interchange_rows ?A ?i ?j $ ?i = ?A $ ?j
(0::?'a) * ?a = (0::?'a)
?c \<noteq> (0::?'a) \<Longrightarrow> (?b / ?c = ?a) = (?b = ?a * ?c)
(0::?'a) \<noteq> (1::?'a)

goal (1 subgoal):
 1. \<And>x. A $ x $ mod_type_class.from_nat k \<noteq> (0::'a) \<and> mod_type_class.from_nat i \<le> x \<Longrightarrow> (1::'a) / interchange_rows A (mod_type_class.from_nat i) x $ mod_type_class.from_nat i $ mod_type_class.from_nat k \<noteq> (0::'a)
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
A $ ?x $ mod_type_class.from_nat k \<noteq> (0::'a) \<and> mod_type_class.from_nat i \<le> ?x \<Longrightarrow> (1::'a) / interchange_rows A (mod_type_class.from_nat i) ?x $ mod_type_class.from_nat i $ mod_type_class.from_nat k \<noteq> (0::'a)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
invertible Q

goal (1 subgoal):
 1. \<And>m. \<lbrakk>i \<noteq> nrows A; mod_type_class.from_nat i \<le> m; A $ m $ mod_type_class.from_nat k \<noteq> (0::'a)\<rbrakk> \<Longrightarrow> \<exists>P. invertible P \<and> Gauss_Jordan_in_ij A (mod_type_class.from_nat i) (mod_type_class.from_nat k) = P ** A
[PROOF STEP]
obtain Pa where inv_Pa: "invertible Pa" and Pa: "row_add_iterate (Q ** (P ** A)) (nrows A - 1) (from_nat i) (from_nat k) = Pa ** (Q ** (P ** A))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>Pa. \<lbrakk>invertible Pa; row_add_iterate (Q ** (P ** A)) (nrows A - 1) (mod_type_class.from_nat i) (mod_type_class.from_nat k) = Pa ** (Q ** (P ** A))\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using invertible_row_add_iterate
[PROOF STATE]
proof (prove)
using this:
?n < nrows ?A \<Longrightarrow> \<exists>P. invertible P \<and> row_add_iterate ?A ?n ?i ?j = P ** ?A

goal (1 subgoal):
 1. (\<And>Pa. \<lbrakk>invertible Pa; row_add_iterate (Q ** (P ** A)) (nrows A - 1) (mod_type_class.from_nat i) (mod_type_class.from_nat k) = Pa ** (Q ** (P ** A))\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis (full_types) diff_less nrows_def zero_less_card_finite zero_less_one)
[PROOF STATE]
proof (state)
this:
invertible Pa
row_add_iterate (Q ** (P ** A)) (nrows A - 1) (mod_type_class.from_nat i) (mod_type_class.from_nat k) = Pa ** (Q ** (P ** A))

goal (1 subgoal):
 1. \<And>m. \<lbrakk>i \<noteq> nrows A; mod_type_class.from_nat i \<le> m; A $ m $ mod_type_class.from_nat k \<noteq> (0::'a)\<rbrakk> \<Longrightarrow> \<exists>P. invertible P \<and> Gauss_Jordan_in_ij A (mod_type_class.from_nat i) (mod_type_class.from_nat k) = P ** A
[PROOF STEP]
show "\<exists>P. invertible P \<and> Gauss_Jordan_in_ij A (from_nat i) (from_nat k) = P ** A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>P. invertible P \<and> Gauss_Jordan_in_ij A (mod_type_class.from_nat i) (mod_type_class.from_nat k) = P ** A
[PROOF STEP]
proof (rule exI[of _ "Pa**Q**P"], rule conjI)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. invertible (Pa ** Q ** P)
 2. Gauss_Jordan_in_ij A (mod_type_class.from_nat i) (mod_type_class.from_nat k) = Pa ** Q ** P ** A
[PROOF STEP]
show "invertible (Pa ** Q ** P)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. invertible (Pa ** Q ** P)
[PROOF STEP]
using inv_P inv_Pa inv_Q invertible_mult
[PROOF STATE]
proof (prove)
using this:
invertible P
invertible Pa
invertible Q
\<lbrakk>invertible ?A; invertible ?B\<rbrakk> \<Longrightarrow> invertible (?A ** ?B)

goal (1 subgoal):
 1. invertible (Pa ** Q ** P)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
invertible (Pa ** Q ** P)

goal (1 subgoal):
 1. Gauss_Jordan_in_ij A (mod_type_class.from_nat i) (mod_type_class.from_nat k) = Pa ** Q ** P ** A
[PROOF STEP]
have "Gauss_Jordan_in_ij A (from_nat i) (from_nat k) = row_add_iterate A_mult (nrows A - 1) (from_nat i) (from_nat k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Gauss_Jordan_in_ij A (mod_type_class.from_nat i) (mod_type_class.from_nat k) = row_add_iterate A_mult (nrows A - 1) (mod_type_class.from_nat i) (mod_type_class.from_nat k)
[PROOF STEP]
unfolding row_add_iterate_eq_Gauss_Jordan_in_ij[symmetric]  A_mult_def A_interchange_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. row_add_iterate (mult_row (interchange_rows A (mod_type_class.from_nat i) (LEAST n. A $ n $ mod_type_class.from_nat k \<noteq> (0::'a) \<and> mod_type_class.from_nat i \<le> n)) (mod_type_class.from_nat i) ((1::'a) / interchange_rows A (mod_type_class.from_nat i) (LEAST n. A $ n $ mod_type_class.from_nat k \<noteq> (0::'a) \<and> mod_type_class.from_nat i \<le> n) $ mod_type_class.from_nat i $ mod_type_class.from_nat k)) (nrows A - 1) (mod_type_class.from_nat i) (mod_type_class.from_nat k) = row_add_iterate (mult_row (interchange_rows A (mod_type_class.from_nat i) (LEAST n. A $ n $ mod_type_class.from_nat k \<noteq> (0::'a) \<and> mod_type_class.from_nat i \<le> n)) (mod_type_class.from_nat i) ((1::'a) / interchange_rows A (mod_type_class.from_nat i) (LEAST n. A $ n $ mod_type_class.from_nat k \<noteq> (0::'a) \<and> mod_type_class.from_nat i \<le> n) $ mod_type_class.from_nat i $ mod_type_class.from_nat k)) (nrows A - 1) (mod_type_class.from_nat i) (mod_type_class.from_nat k)
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
Gauss_Jordan_in_ij A (mod_type_class.from_nat i) (mod_type_class.from_nat k) = row_add_iterate A_mult (nrows A - 1) (mod_type_class.from_nat i) (mod_type_class.from_nat k)

goal (1 subgoal):
 1. Gauss_Jordan_in_ij A (mod_type_class.from_nat i) (mod_type_class.from_nat k) = Pa ** Q ** P ** A
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
Gauss_Jordan_in_ij A (mod_type_class.from_nat i) (mod_type_class.from_nat k) = row_add_iterate A_mult (nrows A - 1) (mod_type_class.from_nat i) (mod_type_class.from_nat k)

goal (1 subgoal):
 1. Gauss_Jordan_in_ij A (mod_type_class.from_nat i) (mod_type_class.from_nat k) = Pa ** Q ** P ** A
[PROOF STEP]
have "... = Pa ** (Q ** (P ** A))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. row_add_iterate A_mult (nrows A - 1) (mod_type_class.from_nat i) (mod_type_class.from_nat k) = Pa ** (Q ** (P ** A))
[PROOF STEP]
using Pa
[PROOF STATE]
proof (prove)
using this:
row_add_iterate (Q ** (P ** A)) (nrows A - 1) (mod_type_class.from_nat i) (mod_type_class.from_nat k) = Pa ** (Q ** (P ** A))

goal (1 subgoal):
 1. row_add_iterate A_mult (nrows A - 1) (mod_type_class.from_nat i) (mod_type_class.from_nat k) = Pa ** (Q ** (P ** A))
[PROOF STEP]
unfolding PA[symmetric] Q_A_interchange[symmetric]
[PROOF STATE]
proof (prove)
using this:
row_add_iterate A_mult (nrows A - 1) (mod_type_class.from_nat i) (mod_type_class.from_nat k) = Pa ** A_mult

goal (1 subgoal):
 1. row_add_iterate A_mult (nrows A - 1) (mod_type_class.from_nat i) (mod_type_class.from_nat k) = Pa ** A_mult
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
row_add_iterate A_mult (nrows A - 1) (mod_type_class.from_nat i) (mod_type_class.from_nat k) = Pa ** (Q ** (P ** A))

goal (1 subgoal):
 1. Gauss_Jordan_in_ij A (mod_type_class.from_nat i) (mod_type_class.from_nat k) = Pa ** Q ** P ** A
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
row_add_iterate A_mult (nrows A - 1) (mod_type_class.from_nat i) (mod_type_class.from_nat k) = Pa ** (Q ** (P ** A))

goal (1 subgoal):
 1. Gauss_Jordan_in_ij A (mod_type_class.from_nat i) (mod_type_class.from_nat k) = Pa ** Q ** P ** A
[PROOF STEP]
have "... = Pa ** Q ** P ** A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Pa ** (Q ** (P ** A)) = Pa ** Q ** P ** A
[PROOF STEP]
unfolding matrix_mul_assoc
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Pa ** Q ** P ** A = Pa ** Q ** P ** A
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
Pa ** (Q ** (P ** A)) = Pa ** Q ** P ** A

goal (1 subgoal):
 1. Gauss_Jordan_in_ij A (mod_type_class.from_nat i) (mod_type_class.from_nat k) = Pa ** Q ** P ** A
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
Gauss_Jordan_in_ij A (mod_type_class.from_nat i) (mod_type_class.from_nat k) = Pa ** Q ** P ** A
[PROOF STEP]
show "Gauss_Jordan_in_ij A (from_nat i) (from_nat k) = Pa ** Q ** P ** A"
[PROOF STATE]
proof (prove)
using this:
Gauss_Jordan_in_ij A (mod_type_class.from_nat i) (mod_type_class.from_nat k) = Pa ** Q ** P ** A

goal (1 subgoal):
 1. Gauss_Jordan_in_ij A (mod_type_class.from_nat i) (mod_type_class.from_nat k) = Pa ** Q ** P ** A
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
Gauss_Jordan_in_ij A (mod_type_class.from_nat i) (mod_type_class.from_nat k) = Pa ** Q ** P ** A

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<exists>P. invertible P \<and> Gauss_Jordan_in_ij A (mod_type_class.from_nat i) (mod_type_class.from_nat k) = P ** A

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma add_left_inj: "inj (\<lambda>x. n + (x::'a::cancel_ab_semigroup_add))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj ((+) n)
[PROOF STEP]
by (simp add: inj_on_def)


[STATEMENT]
lemma HInter_iff [simp]: "A\<noteq>0 \<Longrightarrow> hmem x (\<Sqinter> A) \<longleftrightarrow> (\<forall>y. y \<^bold>\<in> A \<longrightarrow> x \<^bold>\<in> y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<noteq> 0 \<Longrightarrow> (x \<^bold>\<in> \<Sqinter>A) = (\<forall>y. y \<^bold>\<in> A \<longrightarrow> x \<^bold>\<in> y)
[PROOF STEP]
by (auto simp: HInter_def)


[STATEMENT]
lemma conj_galois_2:
  assumes "is_conjugation f g"
  shows "g x \<le> y \<longleftrightarrow> x \<le> -f (-y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (g x \<le> y) = (x \<le> - f (- y))
[PROOF STEP]
by (metis assms is_conjugation_sym conj_galois_1)


[STATEMENT]
lemma take_closed:
  assumes "n \<le> k"
  assumes "x \<in> carrier (Q\<^sub>p\<^bsup>k\<^esup>)"
  shows "take n x \<in> carrier (Q\<^sub>p\<^bsup>n\<^esup>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. take n x \<in> carrier (Q\<^sub>p\<^bsup>n\<^esup>)
[PROOF STEP]
using assms take_closed
[PROOF STATE]
proof (prove)
using this:
n \<le> k
x \<in> carrier (Q\<^sub>p\<^bsup>k\<^esup>)
\<lbrakk>?k \<le> ?n; ?x \<in> carrier (?R\<^bsup>?n\<^esup>)\<rbrakk> \<Longrightarrow> take ?k ?x \<in> carrier (?R\<^bsup>?k\<^esup>)

goal (1 subgoal):
 1. take n x \<in> carrier (Q\<^sub>p\<^bsup>n\<^esup>)
[PROOF STEP]
by blast


[STATEMENT]
lemma Min_set_closed:
"Min_set m As a \<subseteq> carrier (Q\<^sub>p\<^bsup>m\<^esup>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Min_set m As a \<subseteq> carrier (Q\<^sub>p\<^bsup>m\<^esup>)
[PROOF STEP]
unfolding Min_set_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. carrier (Q\<^sub>p\<^bsup>m\<^esup>) \<inter> (\<Inter>f\<in>As. {x \<in> carrier (Q\<^sub>p\<^bsup>m\<^esup>). val (a x) \<le> val (f x)}) \<subseteq> carrier (Q\<^sub>p\<^bsup>m\<^esup>)
[PROOF STEP]
by blast


[STATEMENT]
lemma fset_eq_alt: "(x = y) = (x |\<subseteq>| y \<and> size x = size y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x = y) = (x |\<subseteq>| y \<and> size x = size y)
[PROOF STEP]
by (metis exists_least_iff le_less size_fsubset)


[STATEMENT]
lemma ccFromList_replicate[simp]: "ccFromList (replicate n x) = (if n \<le> 1 then \<bottom>  else ccProd {x} {x})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ccFromList (replicate n x) = (if n \<le> 1 then \<bottom> else {x} G\<times> {x})
[PROOF STEP]
by (induction n) auto


[STATEMENT]
lemma are_all_operators_applicable_set:
  "are_all_operators_applicable s ops
    \<longleftrightarrow> (\<forall>op \<in> set ops. \<forall>v \<in> set (precondition_of op). s v = Some True)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. are_all_operators_applicable s ops = (\<forall>op\<in>set ops. \<forall>v\<in>set (precondition_of op). s v = Some True)
[PROOF STEP]
unfolding are_all_operators_applicable_def
    STRIPS_Representation.is_operator_applicable_in_def list_all_iff
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>op\<in>set ops. let p = precondition_of op in \<forall>v\<in>set p. s v = Some True) = (\<forall>op\<in>set ops. \<forall>v\<in>set (precondition_of op). s v = Some True)
[PROOF STEP]
by presburger


[STATEMENT]
theorem Times_ZeroL[simp]: "Times Zero r = Zero"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Times Zero r = Zero
[PROOF STEP]
by coinduction simp


[STATEMENT]
theorem HFail_HInv4d:
  "\<lbrakk> HFail s s' p; HInv4d s q \<rbrakk> \<Longrightarrow> HInv4d s' q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>HFail s s' p; HInv4d s q\<rbrakk> \<Longrightarrow> HInv4d s' q
[PROOF STEP]
by(blast dest: HFail_HInv4d_p HFail_HInv4d_q)


[STATEMENT]
lemma hrabs_add_minus_Infinitesimal_cancel:
  "e \<in> Infinitesimal \<Longrightarrow> e' \<in> Infinitesimal \<Longrightarrow> \<bar>x + -e\<bar> = \<bar>y + -e'\<bar> \<Longrightarrow> \<bar>x\<bar> \<approx> \<bar>y\<bar>"
  for e e' x y :: hypreal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>e \<in> Infinitesimal; e' \<in> Infinitesimal; \<bar>x + - e\<bar> = \<bar>y + - e'\<bar>\<rbrakk> \<Longrightarrow> \<bar>x\<bar> \<approx> \<bar>y\<bar>
[PROOF STEP]
by (meson Infinitesimal_minus_iff hrabs_add_Infinitesimal_cancel)


[STATEMENT]
lemma extending_maps_Union:
  assumes fin: "finite \<F>"
      and "\<And>S. S \<in> \<F> \<Longrightarrow> \<exists>g. continuous_on S g \<and> g ` S \<subseteq> T \<and> (\<forall>x \<in> S \<inter> K. g x = h x)"
      and "\<And>S. S \<in> \<F> \<Longrightarrow> closed S"
      and K: "\<And>X Y. \<lbrakk>X \<in> \<F>; Y \<in> \<F>; \<not> X \<subseteq> Y; \<not> Y \<subseteq> X\<rbrakk> \<Longrightarrow> X \<inter> Y \<subseteq> K"
    shows "\<exists>g. continuous_on (\<Union>\<F>) g \<and> g ` (\<Union>\<F>) \<subseteq> T \<and> (\<forall>x \<in> \<Union>\<F> \<inter> K. g x = h x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>g. continuous_on (\<Union> \<F>) g \<and> g ` \<Union> \<F> \<subseteq> T \<and> (\<forall>x\<in>\<Union> \<F> \<inter> K. g x = h x)
[PROOF STEP]
apply (simp flip: Union_maximal_sets [OF fin])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>g. continuous_on (\<Union> {T \<in> \<F>. \<forall>U\<in>\<F>. \<not> T \<subset> U}) g \<and> g ` \<Union> {T \<in> \<F>. \<forall>U\<in>\<F>. \<not> T \<subset> U} \<subseteq> T \<and> (\<forall>x\<in>\<Union> {T \<in> \<F>. \<forall>U\<in>\<F>. \<not> T \<subset> U} \<inter> K. g x = h x)
[PROOF STEP]
apply (rule extending_maps_Union_aux)
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. finite {T \<in> \<F>. \<forall>U\<in>\<F>. \<not> T \<subset> U}
 2. \<And>S. S \<in> {T \<in> \<F>. \<forall>U\<in>\<F>. \<not> T \<subset> U} \<Longrightarrow> closed S
 3. \<And>S T. \<lbrakk>S \<in> {T \<in> \<F>. \<forall>U\<in>\<F>. \<not> T \<subset> U}; T \<in> {T \<in> \<F>. \<forall>U\<in>\<F>. \<not> T \<subset> U}; S \<noteq> T\<rbrakk> \<Longrightarrow> S \<inter> T \<subseteq> K
 4. \<And>S. S \<in> {T \<in> \<F>. \<forall>U\<in>\<F>. \<not> T \<subset> U} \<Longrightarrow> \<exists>g. continuous_on S g \<and> g ` S \<subseteq> T \<and> (\<forall>x\<in>S \<inter> K. g x = h x)
[PROOF STEP]
apply (simp_all add: Union_maximal_sets [OF fin] assms)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>S T. \<lbrakk>S \<in> \<F> \<and> (\<forall>U\<in>\<F>. \<not> S \<subset> U); T \<in> \<F> \<and> (\<forall>U\<in>\<F>. \<not> T \<subset> U); S \<noteq> T\<rbrakk> \<Longrightarrow> S \<inter> T \<subseteq> K
[PROOF STEP]
by (metis K psubsetI)


[STATEMENT]
lemma add_zero [simp]: "add zero n = n"
  and add_succ [simp]: "add (succ m) n = succ (add m n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. add zero n = n &&& add (succ m) n = succ (add m n)
[PROOF STEP]
unfolding add_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rec n (\<lambda>_. succ) zero = n &&& rec n (\<lambda>_. succ) (succ m) = succ (rec n (\<lambda>_. succ) m)
[PROOF STEP]
by simp_all


[STATEMENT]
lemma nn_integral_count_space_indicator:
  assumes "NO_MATCH (UNIV::'a set) (X::'a set)"
  shows "(\<integral>\<^sup>+x. f x \<partial>count_space X) = (\<integral>\<^sup>+x. f x * indicator X x \<partial>count_space UNIV)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral\<^sup>N (count_space X) f = \<integral>\<^sup>+ x. f x * indicator X x \<partial>count_space UNIV
[PROOF STEP]
by (simp add: nn_integral_restrict_space[symmetric] restrict_count_space)


[STATEMENT]
lemma mono_comp_fun:
  fixes f :: "'a::order \<Rightarrow> 'b::order"
  shows "mono f \<Longrightarrow> mono ((\<circ>) f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mono f \<Longrightarrow> mono ((\<circ>) f)
[PROOF STEP]
by (rule monoI) (auto simp add: le_fun_def elim: monoE)


[STATEMENT]
lemma totalRemoveAllSingleLiteralClause:
  fixes literal :: Literal and valuation :: Valuation and formula :: Formula
  assumes varLiteral: "var literal \<in> vars valuation" and totalRemoveAll: "total valuation (vars (removeAll [literal] formula))"
  shows "total valuation (vars formula)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. CNF.total valuation (vars formula)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. CNF.total valuation (vars formula)
[PROOF STEP]
have "vars formula - vars [literal] \<subseteq> vars (removeAll [literal] formula)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vars formula - vars [literal] \<subseteq> vars (removeAll [literal] formula)
[PROOF STEP]
by (rule varsRemoveAllClauseSuperset)
[PROOF STATE]
proof (state)
this:
vars formula - vars [literal] \<subseteq> vars (removeAll [literal] formula)

goal (1 subgoal):
 1. CNF.total valuation (vars formula)
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
var literal \<in> vars valuation
CNF.total valuation (vars (removeAll [literal] formula))
vars formula - vars [literal] \<subseteq> vars (removeAll [literal] formula)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
var literal \<in> vars valuation
CNF.total valuation (vars (removeAll [literal] formula))
vars formula - vars [literal] \<subseteq> vars (removeAll [literal] formula)

goal (1 subgoal):
 1. CNF.total valuation (vars formula)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
CNF.total valuation (vars formula)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma bounded_Int[intro]: "bounded S \<or> bounded T \<Longrightarrow> bounded (S \<inter> T)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bounded S \<or> bounded T \<Longrightarrow> bounded (S \<inter> T)
[PROOF STEP]
by (metis Int_lower1 Int_lower2 bounded_subset)


[STATEMENT]
lemma Ioi_le_Ico: "{a<\<^sub>a..} \<subseteq> {a\<le>\<^sub>a..}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {a<\<^sub>a..} \<subseteq> {a\<le>\<^sub>a..}
[PROOF STEP]
unfolding ray_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {x \<in> UNIV. a <\<^sub>a x} \<subseteq> {x \<in> UNIV. a \<le>\<^sub>a x}
[PROOF STEP]
by (fastforce simp: less_le_not_le)


[STATEMENT]
lemma (in aGroup) fSum_zero1:"\<lbrakk>n < m; \<forall>j \<in> nset (Suc n) m. f j = \<zero>\<rbrakk>  \<Longrightarrow>
                       fSum A f  (Suc n) m = \<zero>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>n < m; \<forall>j\<in>nset (Suc n) m. f j = \<zero>\<rbrakk> \<Longrightarrow> \<Sigma>\<^sub>f A f Suc n m = \<zero>
[PROOF STEP]
apply (cut_tac fSum_zero[of "Suc n" "m - Suc n" f])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>n < m; \<forall>j\<in>nset (Suc n) m. f j = \<zero>; \<Sigma>\<^sub>f A f Suc n (Suc n + (m - Suc n)) = \<zero>\<rbrakk> \<Longrightarrow> \<Sigma>\<^sub>f A f Suc n m = \<zero>
 2. \<lbrakk>n < m; \<forall>j\<in>nset (Suc n) m. f j = \<zero>\<rbrakk> \<Longrightarrow> \<forall>j\<in>nset (Suc n) (Suc n + (m - Suc n)). f j = \<zero>
[PROOF STEP]
apply simp+
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma unifier_sub2:
  assumes asm: "unifier\<^sub>l\<^sub>s \<sigma> (L\<^sub>1 \<union> L\<^sub>2)"
  shows "unifier\<^sub>l\<^sub>s \<sigma> L\<^sub>1 \<and> unifier\<^sub>l\<^sub>s \<sigma> L\<^sub>2 "
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. unifier\<^sub>l\<^sub>s \<sigma> L\<^sub>1 \<and> unifier\<^sub>l\<^sub>s \<sigma> L\<^sub>2
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. unifier\<^sub>l\<^sub>s \<sigma> L\<^sub>1 \<and> unifier\<^sub>l\<^sub>s \<sigma> L\<^sub>2
[PROOF STEP]
have "L\<^sub>1 \<subseteq> (L\<^sub>1 \<union> L\<^sub>2) \<and> L\<^sub>2 \<subseteq> (L\<^sub>1 \<union> L\<^sub>2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. L\<^sub>1 \<subseteq> L\<^sub>1 \<union> L\<^sub>2 \<and> L\<^sub>2 \<subseteq> L\<^sub>1 \<union> L\<^sub>2
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
L\<^sub>1 \<subseteq> L\<^sub>1 \<union> L\<^sub>2 \<and> L\<^sub>2 \<subseteq> L\<^sub>1 \<union> L\<^sub>2

goal (1 subgoal):
 1. unifier\<^sub>l\<^sub>s \<sigma> L\<^sub>1 \<and> unifier\<^sub>l\<^sub>s \<sigma> L\<^sub>2
[PROOF STEP]
from this asm
[PROOF STATE]
proof (chain)
picking this:
L\<^sub>1 \<subseteq> L\<^sub>1 \<union> L\<^sub>2 \<and> L\<^sub>2 \<subseteq> L\<^sub>1 \<union> L\<^sub>2
unifier\<^sub>l\<^sub>s \<sigma> (L\<^sub>1 \<union> L\<^sub>2)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
L\<^sub>1 \<subseteq> L\<^sub>1 \<union> L\<^sub>2 \<and> L\<^sub>2 \<subseteq> L\<^sub>1 \<union> L\<^sub>2
unifier\<^sub>l\<^sub>s \<sigma> (L\<^sub>1 \<union> L\<^sub>2)

goal (1 subgoal):
 1. unifier\<^sub>l\<^sub>s \<sigma> L\<^sub>1 \<and> unifier\<^sub>l\<^sub>s \<sigma> L\<^sub>2
[PROOF STEP]
using unifier_sub1
[PROOF STATE]
proof (prove)
using this:
L\<^sub>1 \<subseteq> L\<^sub>1 \<union> L\<^sub>2 \<and> L\<^sub>2 \<subseteq> L\<^sub>1 \<union> L\<^sub>2
unifier\<^sub>l\<^sub>s \<sigma> (L\<^sub>1 \<union> L\<^sub>2)
\<lbrakk>unifier\<^sub>l\<^sub>s ?\<sigma> ?L; ?L' \<subseteq> ?L\<rbrakk> \<Longrightarrow> unifier\<^sub>l\<^sub>s ?\<sigma> ?L'

goal (1 subgoal):
 1. unifier\<^sub>l\<^sub>s \<sigma> L\<^sub>1 \<and> unifier\<^sub>l\<^sub>s \<sigma> L\<^sub>2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
unifier\<^sub>l\<^sub>s \<sigma> L\<^sub>1 \<and> unifier\<^sub>l\<^sub>s \<sigma> L\<^sub>2

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma mult_on_union': "(M,N) \<in> mult r \<Longrightarrow> (M + K, N + K) \<in> mult r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (M, N) \<in> mult r \<Longrightarrow> (M + K, N + K) \<in> mult r
[PROOF STEP]
using mulex_on_union'[of "\<lambda>x y. (x,y) \<in> r" UNIV]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>mulex (\<lambda>x y. (x, y) \<in> r) ?M ?N; ?K \<in> multisets UNIV\<rbrakk> \<Longrightarrow> mulex (\<lambda>x y. (x, y) \<in> r) (?M + ?K) (?N + ?K)

goal (1 subgoal):
 1. (M, N) \<in> mult r \<Longrightarrow> (M + K, N + K) \<in> mult r
[PROOF STEP]
by (auto simp: mulex_iff_mult)


[STATEMENT]
lemma drop_bit_numeral_minus_bit0 [simp]:
  \<open>drop_bit (numeral l) (- numeral (Num.Bit0 k)) = drop_bit (pred_numeral l) (- numeral k :: int)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. drop_bit (numeral l) (- numeral (num.Bit0 k)) = drop_bit (pred_numeral l) (- numeral k)
[PROOF STEP]
by (simp add: numeral_eq_Suc numeral_Bit0_div_2)


[STATEMENT]
lemma Abs_Rep_well_defined:
 assumes " is_tangle_diagram x"
 shows "Rep_Tangle_Diagram (Abs_Tangle_Diagram x) = x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Rep_Tangle_Diagram (Abs_Tangle_Diagram x) = x
[PROOF STEP]
using Rep_Tangle_Diagram Abs_Tangle_Diagram_inverse assms mem_Collect_eq
[PROOF STATE]
proof (prove)
using this:
Rep_Tangle_Diagram ?x \<in> {x. is_tangle_diagram x}
?y \<in> {x. is_tangle_diagram x} \<Longrightarrow> Rep_Tangle_Diagram (Abs_Tangle_Diagram ?y) = ?y
is_tangle_diagram x
(?a \<in> Collect ?P) = ?P ?a

goal (1 subgoal):
 1. Rep_Tangle_Diagram (Abs_Tangle_Diagram x) = x
[PROOF STEP]
by auto


[STATEMENT]
lemma predCC_eq:
  shows "predCC S f \<cdot> a = (if a \<noteq> 0 then cc_restr S (f\<cdot>(pred\<cdot>a)) else ccSquare S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. predCC S f\<cdot>a = (if a \<noteq> 0 then f\<cdot>(pred\<cdot>a) G|` S else S\<^sup>2)
[PROOF STEP]
unfolding predCC_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Lambda> a. if a \<noteq> 0 then f\<cdot>(pred\<cdot>a) G|` S else S\<^sup>2)\<cdot>a = (if a \<noteq> 0 then f\<cdot>(pred\<cdot>a) G|` S else S\<^sup>2)
[PROOF STEP]
apply (rule beta_cfun)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cont (\<lambda>x. if x \<noteq> 0 then f\<cdot>(pred\<cdot>x) G|` S else S\<^sup>2)
[PROOF STEP]
apply (rule cont_if_else_above)
[PROOF STATE]
proof (prove)
goal (5 subgoals):
 1. cont (\<lambda>x. f\<cdot>(pred\<cdot>x) G|` S)
 2. cont (\<lambda>x. S\<^sup>2)
 3. \<And>x. f\<cdot>(pred\<cdot>x) G|` S \<sqsubseteq> S\<^sup>2
 4. \<And>x y. \<lbrakk>x \<sqsubseteq> y; y \<noteq> 0\<rbrakk> \<Longrightarrow> x \<noteq> 0
 5. adm (\<lambda>x. x \<noteq> 0)
[PROOF STEP]
apply (auto dest: subsetD[OF ccField_cc_restr])
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma convex_explicit:
  fixes S :: "'a::real_vector set"
  shows "convex S \<longleftrightarrow>
    (\<forall>t u. finite t \<and> t \<subseteq> S \<and> (\<forall>x\<in>t. 0 \<le> u x) \<and> sum u t = 1 \<longrightarrow> sum (\<lambda>x. u x *\<^sub>R x) t \<in> S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. convex S = (\<forall>t u. finite t \<and> t \<subseteq> S \<and> (\<forall>x\<in>t. 0 \<le> u x) \<and> sum u t = 1 \<longrightarrow> (\<Sum>x\<in>t. u x *\<^sub>R x) \<in> S)
[PROOF STEP]
proof safe
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>t u. \<lbrakk>convex S; finite t; t \<subseteq> S; \<forall>x\<in>t. 0 \<le> u x; sum u t = 1\<rbrakk> \<Longrightarrow> (\<Sum>x\<in>t. u x *\<^sub>R x) \<in> S
 2. \<forall>t u. finite t \<and> t \<subseteq> S \<and> (\<forall>x\<in>t. 0 \<le> u x) \<and> sum u t = 1 \<longrightarrow> (\<Sum>x\<in>t. u x *\<^sub>R x) \<in> S \<Longrightarrow> convex S
[PROOF STEP]
fix t
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>t u. \<lbrakk>convex S; finite t; t \<subseteq> S; \<forall>x\<in>t. 0 \<le> u x; sum u t = 1\<rbrakk> \<Longrightarrow> (\<Sum>x\<in>t. u x *\<^sub>R x) \<in> S
 2. \<forall>t u. finite t \<and> t \<subseteq> S \<and> (\<forall>x\<in>t. 0 \<le> u x) \<and> sum u t = 1 \<longrightarrow> (\<Sum>x\<in>t. u x *\<^sub>R x) \<in> S \<Longrightarrow> convex S
[PROOF STEP]
fix u :: "'a \<Rightarrow> real"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>t u. \<lbrakk>convex S; finite t; t \<subseteq> S; \<forall>x\<in>t. 0 \<le> u x; sum u t = 1\<rbrakk> \<Longrightarrow> (\<Sum>x\<in>t. u x *\<^sub>R x) \<in> S
 2. \<forall>t u. finite t \<and> t \<subseteq> S \<and> (\<forall>x\<in>t. 0 \<le> u x) \<and> sum u t = 1 \<longrightarrow> (\<Sum>x\<in>t. u x *\<^sub>R x) \<in> S \<Longrightarrow> convex S
[PROOF STEP]
assume "convex S"
    and "finite t"
    and "t \<subseteq> S" "\<forall>x\<in>t. 0 \<le> u x" "sum u t = 1"
[PROOF STATE]
proof (state)
this:
convex S
finite t
t \<subseteq> S
\<forall>x\<in>t. 0 \<le> u x
sum u t = 1

goal (2 subgoals):
 1. \<And>t u. \<lbrakk>convex S; finite t; t \<subseteq> S; \<forall>x\<in>t. 0 \<le> u x; sum u t = 1\<rbrakk> \<Longrightarrow> (\<Sum>x\<in>t. u x *\<^sub>R x) \<in> S
 2. \<forall>t u. finite t \<and> t \<subseteq> S \<and> (\<forall>x\<in>t. 0 \<le> u x) \<and> sum u t = 1 \<longrightarrow> (\<Sum>x\<in>t. u x *\<^sub>R x) \<in> S \<Longrightarrow> convex S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
convex S
finite t
t \<subseteq> S
\<forall>x\<in>t. 0 \<le> u x
sum u t = 1
[PROOF STEP]
show "(\<Sum>x\<in>t. u x *\<^sub>R x) \<in> S"
[PROOF STATE]
proof (prove)
using this:
convex S
finite t
t \<subseteq> S
\<forall>x\<in>t. 0 \<le> u x
sum u t = 1

goal (1 subgoal):
 1. (\<Sum>x\<in>t. u x *\<^sub>R x) \<in> S
[PROOF STEP]
using convex_sum[of t S u "\<lambda> x. x"]
[PROOF STATE]
proof (prove)
using this:
convex S
finite t
t \<subseteq> S
\<forall>x\<in>t. 0 \<le> u x
sum u t = 1
\<lbrakk>finite t; convex S; sum u t = 1; \<And>i. i \<in> t \<Longrightarrow> 0 \<le> u i; \<And>i. i \<in> t \<Longrightarrow> i \<in> S\<rbrakk> \<Longrightarrow> (\<Sum>j\<in>t. u j *\<^sub>R j) \<in> S

goal (1 subgoal):
 1. (\<Sum>x\<in>t. u x *\<^sub>R x) \<in> S
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<Sum>x\<in>t. u x *\<^sub>R x) \<in> S

goal (1 subgoal):
 1. \<forall>t u. finite t \<and> t \<subseteq> S \<and> (\<forall>x\<in>t. 0 \<le> u x) \<and> sum u t = 1 \<longrightarrow> (\<Sum>x\<in>t. u x *\<^sub>R x) \<in> S \<Longrightarrow> convex S
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<forall>t u. finite t \<and> t \<subseteq> S \<and> (\<forall>x\<in>t. 0 \<le> u x) \<and> sum u t = 1 \<longrightarrow> (\<Sum>x\<in>t. u x *\<^sub>R x) \<in> S \<Longrightarrow> convex S
[PROOF STEP]
assume *: "\<forall>t. \<forall> u. finite t \<and> t \<subseteq> S \<and> (\<forall>x\<in>t. 0 \<le> u x) \<and>
    sum u t = 1 \<longrightarrow> (\<Sum>x\<in>t. u x *\<^sub>R x) \<in> S"
[PROOF STATE]
proof (state)
this:
\<forall>t u. finite t \<and> t \<subseteq> S \<and> (\<forall>x\<in>t. 0 \<le> u x) \<and> sum u t = 1 \<longrightarrow> (\<Sum>x\<in>t. u x *\<^sub>R x) \<in> S

goal (1 subgoal):
 1. \<forall>t u. finite t \<and> t \<subseteq> S \<and> (\<forall>x\<in>t. 0 \<le> u x) \<and> sum u t = 1 \<longrightarrow> (\<Sum>x\<in>t. u x *\<^sub>R x) \<in> S \<Longrightarrow> convex S
[PROOF STEP]
show "convex S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. convex S
[PROOF STEP]
unfolding convex_alt
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>S. \<forall>y\<in>S. \<forall>u. 0 \<le> u \<and> u \<le> 1 \<longrightarrow> (1 - u) *\<^sub>R x + u *\<^sub>R y \<in> S
[PROOF STEP]
proof safe
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x y u. \<lbrakk>x \<in> S; y \<in> S; 0 \<le> u; u \<le> 1\<rbrakk> \<Longrightarrow> (1 - u) *\<^sub>R x + u *\<^sub>R y \<in> S
[PROOF STEP]
fix x y
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x y u. \<lbrakk>x \<in> S; y \<in> S; 0 \<le> u; u \<le> 1\<rbrakk> \<Longrightarrow> (1 - u) *\<^sub>R x + u *\<^sub>R y \<in> S
[PROOF STEP]
fix \<mu> :: real
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x y u. \<lbrakk>x \<in> S; y \<in> S; 0 \<le> u; u \<le> 1\<rbrakk> \<Longrightarrow> (1 - u) *\<^sub>R x + u *\<^sub>R y \<in> S
[PROOF STEP]
assume **: "x \<in> S" "y \<in> S" "0 \<le> \<mu>" "\<mu> \<le> 1"
[PROOF STATE]
proof (state)
this:
x \<in> S
y \<in> S
0 \<le> \<mu>
\<mu> \<le> 1

goal (1 subgoal):
 1. \<And>x y u. \<lbrakk>x \<in> S; y \<in> S; 0 \<le> u; u \<le> 1\<rbrakk> \<Longrightarrow> (1 - u) *\<^sub>R x + u *\<^sub>R y \<in> S
[PROOF STEP]
show "(1 - \<mu>) *\<^sub>R x + \<mu> *\<^sub>R y \<in> S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (1 - \<mu>) *\<^sub>R x + \<mu> *\<^sub>R y \<in> S
[PROOF STEP]
proof (cases "x = y")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. x = y \<Longrightarrow> (1 - \<mu>) *\<^sub>R x + \<mu> *\<^sub>R y \<in> S
 2. x \<noteq> y \<Longrightarrow> (1 - \<mu>) *\<^sub>R x + \<mu> *\<^sub>R y \<in> S
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
x \<noteq> y

goal (2 subgoals):
 1. x = y \<Longrightarrow> (1 - \<mu>) *\<^sub>R x + \<mu> *\<^sub>R y \<in> S
 2. x \<noteq> y \<Longrightarrow> (1 - \<mu>) *\<^sub>R x + \<mu> *\<^sub>R y \<in> S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<noteq> y
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
x \<noteq> y

goal (1 subgoal):
 1. (1 - \<mu>) *\<^sub>R x + \<mu> *\<^sub>R y \<in> S
[PROOF STEP]
using *[rule_format, of "{x, y}" "\<lambda> z. if z = x then 1 - \<mu> else \<mu>"] **
[PROOF STATE]
proof (prove)
using this:
x \<noteq> y
finite {x, y} \<and> {x, y} \<subseteq> S \<and> (\<forall>xa\<in>{x, y}. 0 \<le> (if xa = x then 1 - \<mu> else \<mu>)) \<and> (\<Sum>z\<in>{x, y}. if z = x then 1 - \<mu> else \<mu>) = 1 \<Longrightarrow> (\<Sum>xa\<in>{x, y}. (if xa = x then 1 - \<mu> else \<mu>) *\<^sub>R xa) \<in> S
x \<in> S
y \<in> S
0 \<le> \<mu>
\<mu> \<le> 1

goal (1 subgoal):
 1. (1 - \<mu>) *\<^sub>R x + \<mu> *\<^sub>R y \<in> S
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(1 - \<mu>) *\<^sub>R x + \<mu> *\<^sub>R y \<in> S

goal (1 subgoal):
 1. x = y \<Longrightarrow> (1 - \<mu>) *\<^sub>R x + \<mu> *\<^sub>R y \<in> S
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x = y \<Longrightarrow> (1 - \<mu>) *\<^sub>R x + \<mu> *\<^sub>R y \<in> S
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
x = y

goal (1 subgoal):
 1. x = y \<Longrightarrow> (1 - \<mu>) *\<^sub>R x + \<mu> *\<^sub>R y \<in> S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x = y
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
x = y

goal (1 subgoal):
 1. (1 - \<mu>) *\<^sub>R x + \<mu> *\<^sub>R y \<in> S
[PROOF STEP]
using *[rule_format, of "{x, y}" "\<lambda> z. 1"] **
[PROOF STATE]
proof (prove)
using this:
x = y
finite {x, y} \<and> {x, y} \<subseteq> S \<and> (\<forall>x\<in>{x, y}. 0 \<le> 1) \<and> (\<Sum>z\<in>{x, y}. 1) = 1 \<Longrightarrow> sum ((*\<^sub>R) 1) {x, y} \<in> S
x \<in> S
y \<in> S
0 \<le> \<mu>
\<mu> \<le> 1

goal (1 subgoal):
 1. (1 - \<mu>) *\<^sub>R x + \<mu> *\<^sub>R y \<in> S
[PROOF STEP]
by (auto simp: field_simps real_vector.scale_left_diff_distrib)
[PROOF STATE]
proof (state)
this:
(1 - \<mu>) *\<^sub>R x + \<mu> *\<^sub>R y \<in> S

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(1 - \<mu>) *\<^sub>R x + \<mu> *\<^sub>R y \<in> S

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
convex S

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in monoid) properfactor_cong_r [trans]:
  assumes pf: "properfactor G x y"
    and yy': "y \<sim> y'"
    and carr: "x \<in> carrier G"  "y \<in> carrier G"  "y' \<in> carrier G"
  shows "properfactor G x y'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. properfactor G x y'
[PROOF STEP]
using pf
[PROOF STATE]
proof (prove)
using this:
properfactor G x y

goal (1 subgoal):
 1. properfactor G x y'
[PROOF STEP]
unfolding properfactor_lless
[PROOF STATE]
proof (prove)
using this:
x \<sqsubset>\<^bsub>division_rel G\<^esub> y

goal (1 subgoal):
 1. x \<sqsubset>\<^bsub>division_rel G\<^esub> y'
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x \<sqsubset>\<^bsub>division_rel G\<^esub> y \<Longrightarrow> x \<sqsubset>\<^bsub>division_rel G\<^esub> y'
[PROOF STEP]
interpret weak_partial_order "division_rel G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. weak_partial_order (division_rel G)
[PROOF STEP]
..
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x \<sqsubset>\<^bsub>division_rel G\<^esub> y \<Longrightarrow> x \<sqsubset>\<^bsub>division_rel G\<^esub> y'
[PROOF STEP]
assume "x \<sqsubset>\<^bsub>division_rel G\<^esub> y"
[PROOF STATE]
proof (state)
this:
x \<sqsubset>\<^bsub>division_rel G\<^esub> y

goal (1 subgoal):
 1. x \<sqsubset>\<^bsub>division_rel G\<^esub> y \<Longrightarrow> x \<sqsubset>\<^bsub>division_rel G\<^esub> y'
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
x \<sqsubset>\<^bsub>division_rel G\<^esub> y

goal (1 subgoal):
 1. x \<sqsubset>\<^bsub>division_rel G\<^esub> y \<Longrightarrow> x \<sqsubset>\<^bsub>division_rel G\<^esub> y'
[PROOF STEP]
from yy'
[PROOF STATE]
proof (chain)
picking this:
y \<sim> y'
[PROOF STEP]
have "y .=\<^bsub>division_rel G\<^esub> y'"
[PROOF STATE]
proof (prove)
using this:
y \<sim> y'

goal (1 subgoal):
 1. y .=\<^bsub>division_rel G\<^esub> y'
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
y .=\<^bsub>division_rel G\<^esub> y'

goal (1 subgoal):
 1. x \<sqsubset>\<^bsub>division_rel G\<^esub> y \<Longrightarrow> x \<sqsubset>\<^bsub>division_rel G\<^esub> y'
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>x \<in> carrier (division_rel G); y \<in> carrier (division_rel G); y' \<in> carrier (division_rel G)\<rbrakk> \<Longrightarrow> x \<sqsubset>\<^bsub>division_rel G\<^esub> y'
[PROOF STEP]
show "x \<sqsubset>\<^bsub>division_rel G\<^esub> y'"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>x \<in> carrier (division_rel G); y \<in> carrier (division_rel G); y' \<in> carrier (division_rel G)\<rbrakk> \<Longrightarrow> x \<sqsubset>\<^bsub>division_rel G\<^esub> y'

goal (1 subgoal):
 1. x \<sqsubset>\<^bsub>division_rel G\<^esub> y'
[PROOF STEP]
by (simp add: carr)
[PROOF STATE]
proof (state)
this:
x \<sqsubset>\<^bsub>division_rel G\<^esub> y'

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma linE [elim]:
  assumes "x \<in> lin v"
  obtains a :: real where "x = a \<cdot> v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>a. x = a \<cdot> v \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
x \<in> lin v

goal (1 subgoal):
 1. (\<And>a. x = a \<cdot> v \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding lin_def
[PROOF STATE]
proof (prove)
using this:
x \<in> {a \<cdot> v |a. True}

goal (1 subgoal):
 1. (\<And>a. x = a \<cdot> v \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast


[STATEMENT]
lemma wp_choice: "wp (x \<sqinter> y) = wp x \<sqinter> wp y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wp (x \<sqinter> y) = wp x \<sqinter> wp y
[PROOF STEP]
apply (simp add: fun_eq_iff wp_def inf_fun_def inf_comp inf_Assertion_def abs_wpt_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>xa. Abs_Assertion (wpt (x * {\<cdot> xa } \<sqinter> (y * {\<cdot> xa }))) = Abs_Assertion (wpt (x * {\<cdot> xa }) \<sqinter> wpt (y * {\<cdot> xa }))
[PROOF STEP]
by (simp add: wpt_choice)


[STATEMENT]
lemma list_slice_unslice_mult: "
  length xs = m * k \<Longrightarrow> concat (list_slice xs k) = xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length xs = m * k \<Longrightarrow> concat (list_slice xs k) = xs
[PROOF STEP]
apply (case_tac "k = 0")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>length xs = m * k; k = 0\<rbrakk> \<Longrightarrow> concat (list_slice xs k) = xs
 2. \<lbrakk>length xs = m * k; k \<noteq> 0\<rbrakk> \<Longrightarrow> concat (list_slice xs k) = xs
[PROOF STEP]
apply (simp add: list_slice_Nil)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>length xs = m * k; k \<noteq> 0\<rbrakk> \<Longrightarrow> concat (list_slice xs k) = xs
[PROOF STEP]
apply (simp add: list_slice_concat)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma bij_betw_number_partition_of:
   assumes "finite A" "finite B"
  shows "bij_betw (number_partition_of A B) ({f \<in> A \<rightarrow>\<^sub>E B. f ` A = B} // domain_and_range_permutation A B) {N. number_partition (card A) N \<and> size N = card B}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bij_betw (number_partition_of A B) ({f \<in> A \<rightarrow>\<^sub>E B. f ` A = B} // domain_and_range_permutation A B) {N. number_partition (card A) N \<and> size N = card B}
[PROOF STEP]
proof (rule bij_betw_byWitness[where f'="functions_of A B"])
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. \<forall>a\<in>{f \<in> A \<rightarrow>\<^sub>E B. f ` A = B} // domain_and_range_permutation A B. Twelvefold_Way_Entry10.functions_of A B (number_partition_of A B a) = a
 2. \<forall>a'\<in>{N. number_partition (card A) N \<and> size N = card B}. number_partition_of A B (Twelvefold_Way_Entry10.functions_of A B a') = a'
 3. number_partition_of A B ` {f \<in> A \<rightarrow>\<^sub>E B. f ` A = B} // domain_and_range_permutation A B \<subseteq> {N. number_partition (card A) N \<and> size N = card B}
 4. Twelvefold_Way_Entry10.functions_of A B ` {N. number_partition (card A) N \<and> size N = card B} \<subseteq> {f \<in> A \<rightarrow>\<^sub>E B. f ` A = B} // domain_and_range_permutation A B
[PROOF STEP]
have quotient_eq: "{f \<in> A \<rightarrow>\<^sub>E B. f ` A = B} // domain_and_range_permutation A B = {F \<in> ((A \<rightarrow>\<^sub>E B) // domain_and_range_permutation A B). univ (\<lambda>f. f ` A = B) F}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {f \<in> A \<rightarrow>\<^sub>E B. f ` A = B} // domain_and_range_permutation A B = {F \<in> (A \<rightarrow>\<^sub>E B) // domain_and_range_permutation A B. univ (\<lambda>f. f ` A = B) F}
[PROOF STEP]
using equiv_domain_and_range_permutation[of A B] surjective_respects_domain_and_range_permutation[of A B]
[PROOF STATE]
proof (prove)
using this:
equiv (A \<rightarrow>\<^sub>E B) (domain_and_range_permutation A B)
(\<lambda>f. f ` A = B) respects domain_and_range_permutation A B

goal (1 subgoal):
 1. {f \<in> A \<rightarrow>\<^sub>E B. f ` A = B} // domain_and_range_permutation A B = {F \<in> (A \<rightarrow>\<^sub>E B) // domain_and_range_permutation A B. univ (\<lambda>f. f ` A = B) F}
[PROOF STEP]
by (simp only: univ_preserves_predicate)
[PROOF STATE]
proof (state)
this:
{f \<in> A \<rightarrow>\<^sub>E B. f ` A = B} // domain_and_range_permutation A B = {F \<in> (A \<rightarrow>\<^sub>E B) // domain_and_range_permutation A B. univ (\<lambda>f. f ` A = B) F}

goal (4 subgoals):
 1. \<forall>a\<in>{f \<in> A \<rightarrow>\<^sub>E B. f ` A = B} // domain_and_range_permutation A B. Twelvefold_Way_Entry10.functions_of A B (number_partition_of A B a) = a
 2. \<forall>a'\<in>{N. number_partition (card A) N \<and> size N = card B}. number_partition_of A B (Twelvefold_Way_Entry10.functions_of A B a') = a'
 3. number_partition_of A B ` {f \<in> A \<rightarrow>\<^sub>E B. f ` A = B} // domain_and_range_permutation A B \<subseteq> {N. number_partition (card A) N \<and> size N = card B}
 4. Twelvefold_Way_Entry10.functions_of A B ` {N. number_partition (card A) N \<and> size N = card B} \<subseteq> {f \<in> A \<rightarrow>\<^sub>E B. f ` A = B} // domain_and_range_permutation A B
[PROOF STEP]
show "\<forall>F\<in>{f \<in> A \<rightarrow>\<^sub>E B. f ` A = B} // domain_and_range_permutation A B.
       functions_of A B (number_partition_of A B F) = F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>F\<in>{f \<in> A \<rightarrow>\<^sub>E B. f ` A = B} // domain_and_range_permutation A B. Twelvefold_Way_Entry10.functions_of A B (number_partition_of A B F) = F
[PROOF STEP]
using \<open>finite A\<close> \<open>finite B\<close>
[PROOF STATE]
proof (prove)
using this:
finite A
finite B

goal (1 subgoal):
 1. \<forall>F\<in>{f \<in> A \<rightarrow>\<^sub>E B. f ` A = B} // domain_and_range_permutation A B. Twelvefold_Way_Entry10.functions_of A B (number_partition_of A B F) = F
[PROOF STEP]
by (auto simp only: quotient_eq functions_of_number_partition_of)
[PROOF STATE]
proof (state)
this:
\<forall>F\<in>{f \<in> A \<rightarrow>\<^sub>E B. f ` A = B} // domain_and_range_permutation A B. Twelvefold_Way_Entry10.functions_of A B (number_partition_of A B F) = F

goal (3 subgoals):
 1. \<forall>a'\<in>{N. number_partition (card A) N \<and> size N = card B}. number_partition_of A B (Twelvefold_Way_Entry10.functions_of A B a') = a'
 2. number_partition_of A B ` {f \<in> A \<rightarrow>\<^sub>E B. f ` A = B} // domain_and_range_permutation A B \<subseteq> {N. number_partition (card A) N \<and> size N = card B}
 3. Twelvefold_Way_Entry10.functions_of A B ` {N. number_partition (card A) N \<and> size N = card B} \<subseteq> {f \<in> A \<rightarrow>\<^sub>E B. f ` A = B} // domain_and_range_permutation A B
[PROOF STEP]
show "\<forall>N\<in>{N. number_partition (card A) N  \<and> size N = card B}. number_partition_of A B (functions_of A B N) = N"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>N\<in>{N. number_partition (card A) N \<and> size N = card B}. number_partition_of A B (Twelvefold_Way_Entry10.functions_of A B N) = N
[PROOF STEP]
using \<open>finite A\<close> \<open>finite B\<close>
[PROOF STATE]
proof (prove)
using this:
finite A
finite B

goal (1 subgoal):
 1. \<forall>N\<in>{N. number_partition (card A) N \<and> size N = card B}. number_partition_of A B (Twelvefold_Way_Entry10.functions_of A B N) = N
[PROOF STEP]
by (simp add: number_partition_of_functions_of)
[PROOF STATE]
proof (state)
this:
\<forall>N\<in>{N. number_partition (card A) N \<and> size N = card B}. number_partition_of A B (Twelvefold_Way_Entry10.functions_of A B N) = N

goal (2 subgoals):
 1. number_partition_of A B ` {f \<in> A \<rightarrow>\<^sub>E B. f ` A = B} // domain_and_range_permutation A B \<subseteq> {N. number_partition (card A) N \<and> size N = card B}
 2. Twelvefold_Way_Entry10.functions_of A B ` {N. number_partition (card A) N \<and> size N = card B} \<subseteq> {f \<in> A \<rightarrow>\<^sub>E B. f ` A = B} // domain_and_range_permutation A B
[PROOF STEP]
show "number_partition_of A B ` ({f \<in> A \<rightarrow>\<^sub>E B. f ` A = B} // domain_and_range_permutation A B)
    \<subseteq> {N. number_partition (card A) N  \<and> size N = card B}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. number_partition_of A B ` {f \<in> A \<rightarrow>\<^sub>E B. f ` A = B} // domain_and_range_permutation A B \<subseteq> {N. number_partition (card A) N \<and> size N = card B}
[PROOF STEP]
using \<open>finite A\<close> \<open>finite B\<close>
[PROOF STATE]
proof (prove)
using this:
finite A
finite B

goal (1 subgoal):
 1. number_partition_of A B ` {f \<in> A \<rightarrow>\<^sub>E B. f ` A = B} // domain_and_range_permutation A B \<subseteq> {N. number_partition (card A) N \<and> size N = card B}
[PROOF STEP]
by (auto simp add: quotient_eq number_partition_of surj_on_implies_size_eq_card)
[PROOF STATE]
proof (state)
this:
number_partition_of A B ` {f \<in> A \<rightarrow>\<^sub>E B. f ` A = B} // domain_and_range_permutation A B \<subseteq> {N. number_partition (card A) N \<and> size N = card B}

goal (1 subgoal):
 1. Twelvefold_Way_Entry10.functions_of A B ` {N. number_partition (card A) N \<and> size N = card B} \<subseteq> {f \<in> A \<rightarrow>\<^sub>E B. f ` A = B} // domain_and_range_permutation A B
[PROOF STEP]
show "functions_of A B ` {N. number_partition (card A) N \<and> size N = card B}
    \<subseteq> {f \<in> A \<rightarrow>\<^sub>E B. f ` A = B} // domain_and_range_permutation A B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Twelvefold_Way_Entry10.functions_of A B ` {N. number_partition (card A) N \<and> size N = card B} \<subseteq> {f \<in> A \<rightarrow>\<^sub>E B. f ` A = B} // domain_and_range_permutation A B
[PROOF STEP]
using \<open>finite A\<close> \<open>finite B\<close>
[PROOF STATE]
proof (prove)
using this:
finite A
finite B

goal (1 subgoal):
 1. Twelvefold_Way_Entry10.functions_of A B ` {N. number_partition (card A) N \<and> size N = card B} \<subseteq> {f \<in> A \<rightarrow>\<^sub>E B. f ` A = B} // domain_and_range_permutation A B
[PROOF STEP]
by (auto simp add: quotient_eq intro: functions_of functions_of_is_surj_on)
[PROOF STATE]
proof (state)
this:
Twelvefold_Way_Entry10.functions_of A B ` {N. number_partition (card A) N \<and> size N = card B} \<subseteq> {f \<in> A \<rightarrow>\<^sub>E B. f ` A = B} // domain_and_range_permutation A B

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ls_delete_fst_map_set:
  "distinct (map fst l) \<Longrightarrow>
  set (map fst (fst (ls_delete k l))) = (set (map fst l)) - {k}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distinct (map fst l) \<Longrightarrow> set (map fst (fst (ls_delete k l))) = set (map fst l) - {k}
[PROOF STEP]
apply (induct l rule: ls_delete.induct)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>k. distinct (map fst []) \<Longrightarrow> set (map fst (fst (ls_delete k []))) = set (map fst []) - {k}
 2. \<And>k l w ls. \<lbrakk>\<lbrakk>k \<noteq> l; distinct (map fst ls)\<rbrakk> \<Longrightarrow> set (map fst (fst (ls_delete k ls))) = set (map fst ls) - {k}; distinct (map fst ((l, w) # ls))\<rbrakk> \<Longrightarrow> set (map fst (fst (ls_delete k ((l, w) # ls)))) = set (map fst ((l, w) # ls)) - {k}
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>k l w ls. \<lbrakk>\<lbrakk>k \<noteq> l; distinct (map fst ls)\<rbrakk> \<Longrightarrow> set (map fst (fst (ls_delete k ls))) = set (map fst ls) - {k}; distinct (map fst ((l, w) # ls))\<rbrakk> \<Longrightarrow> set (map fst (fst (ls_delete k ((l, w) # ls)))) = set (map fst ((l, w) # ls)) - {k}
[PROOF STEP]
apply (auto simp add: Let_def)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma f_expand_assoc: "xs \<odot>\<^sub>f a \<odot>\<^sub>f b = xs \<odot>\<^sub>f (a * b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. xs \<odot> a \<odot> b = xs \<odot> (a * b)
[PROOF STEP]
apply (induct xs)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. [] \<odot> a \<odot> b = [] \<odot> (a * b)
 2. \<And>aa xs. xs \<odot> a \<odot> b = xs \<odot> (a * b) \<Longrightarrow> (aa # xs) \<odot> a \<odot> b = (aa # xs) \<odot> (a * b)
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>aa xs. xs \<odot> a \<odot> b = xs \<odot> (a * b) \<Longrightarrow> (aa # xs) \<odot> a \<odot> b = (aa # xs) \<odot> (a * b)
[PROOF STEP]
apply (simp add: replicate_add[symmetric] diff_mult_distrib)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma weight_spmf_of_set_finite [simp]: "\<lbrakk> finite A; A \<noteq> {} \<rbrakk> \<Longrightarrow> weight_spmf (spmf_of_set A) = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite A; A \<noteq> {}\<rbrakk> \<Longrightarrow> weight_spmf (spmf_of_set A) = 1
[PROOF STEP]
by(simp add: weight_spmf_of_set)


[STATEMENT]
lemma AG_fp: "\<^bold>A\<^bold>G p = p \<inter> \<^bold>A\<^bold>X \<^bold>A\<^bold>G p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<^bold>A\<^bold>G p = p \<inter> \<^bold>A\<^bold>X \<^bold>A\<^bold>G p
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<^bold>A\<^bold>G p = p \<inter> \<^bold>A\<^bold>X \<^bold>A\<^bold>G p
[PROOF STEP]
have "mono (\<lambda>s. p \<inter> \<^bold>A\<^bold>X s)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mono (\<lambda>s. p \<inter> \<^bold>A\<^bold>X s)
[PROOF STEP]
by rule auto
[PROOF STATE]
proof (state)
this:
mono (\<lambda>s. p \<inter> \<^bold>A\<^bold>X s)

goal (1 subgoal):
 1. \<^bold>A\<^bold>G p = p \<inter> \<^bold>A\<^bold>X \<^bold>A\<^bold>G p
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
mono (\<lambda>s. p \<inter> \<^bold>A\<^bold>X s)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
mono (\<lambda>s. p \<inter> \<^bold>A\<^bold>X s)

goal (1 subgoal):
 1. \<^bold>A\<^bold>G p = p \<inter> \<^bold>A\<^bold>X \<^bold>A\<^bold>G p
[PROOF STEP]
by (simp only: AG_gfp) (rule gfp_unfold)
[PROOF STATE]
proof (state)
this:
\<^bold>A\<^bold>G p = p \<inter> \<^bold>A\<^bold>X \<^bold>A\<^bold>G p

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ntcf_rcomp_Hom_component_ArrDom[cat_cs_simps]:
  assumes "\<psi> : \<FF> \<mapsto>\<^sub>C\<^sub>F \<GG> : \<BB> \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> \<CC>" and "a \<in>\<^sub>\<circ> op_cat \<CC>\<lparr>Obj\<rparr>"
  shows "ntcf_rcomp_Hom_component \<psi> a b\<lparr>ArrDom\<rparr> = Hom \<CC> a (\<FF>\<lparr>ObjMap\<rparr>\<lparr>b\<rparr>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ntcf_rcomp_Hom_component \<psi> a b\<lparr>ArrDom\<rparr> = Hom \<CC> a (\<FF>\<lparr>ObjMap\<rparr>\<lparr>b\<rparr>)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ntcf_rcomp_Hom_component \<psi> a b\<lparr>ArrDom\<rparr> = Hom \<CC> a (\<FF>\<lparr>ObjMap\<rparr>\<lparr>b\<rparr>)
[PROOF STEP]
interpret \<psi>: is_ntcf \<alpha> \<BB> \<CC> \<FF> \<GG> \<psi>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<psi> : \<FF> \<mapsto>\<^sub>C\<^sub>F \<GG> : \<BB> \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> \<CC>
[PROOF STEP]
by (rule assms(1))
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ntcf_rcomp_Hom_component \<psi> a b\<lparr>ArrDom\<rparr> = Hom \<CC> a (\<FF>\<lparr>ObjMap\<rparr>\<lparr>b\<rparr>)
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
\<psi> : \<FF> \<mapsto>\<^sub>C\<^sub>F \<GG> : \<BB> \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> \<CC>
a \<in>\<^sub>\<circ> op_cat \<CC>\<lparr>Obj\<rparr>
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<psi> : \<FF> \<mapsto>\<^sub>C\<^sub>F \<GG> : \<BB> \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> \<CC>
a \<in>\<^sub>\<circ> op_cat \<CC>\<lparr>Obj\<rparr>

goal (1 subgoal):
 1. ntcf_rcomp_Hom_component \<psi> a b\<lparr>ArrDom\<rparr> = Hom \<CC> a (\<FF>\<lparr>ObjMap\<rparr>\<lparr>b\<rparr>)
[PROOF STEP]
unfolding cat_op_simps ntcf_rcomp_Hom_component_def \<psi>.ntcf_NTDGCod
[PROOF STATE]
proof (prove)
using this:
\<psi> : \<FF> \<mapsto>\<^sub>C\<^sub>F \<GG> : \<BB> \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> \<CC>
a \<in>\<^sub>\<circ> \<CC>\<lparr>Obj\<rparr>

goal (1 subgoal):
 1. ntcf_Hom_component (ntcf_id (dghm_id \<CC>)) \<psi> a b\<lparr>ArrDom\<rparr> = Hom \<CC> a (\<FF>\<lparr>ObjMap\<rparr>\<lparr>b\<rparr>)
[PROOF STEP]
by (cs_concl cs_simp: cat_cs_simps cs_intro: cat_cs_intros)
[PROOF STATE]
proof (state)
this:
ntcf_rcomp_Hom_component \<psi> a b\<lparr>ArrDom\<rparr> = Hom \<CC> a (\<FF>\<lparr>ObjMap\<rparr>\<lparr>b\<rparr>)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma supset_lbound_lcoset_shift:
  "supset_lbound_of X Y B \<Longrightarrow>
    ordering.lbound_of (\<supseteq>) (a +o X) (a +o Y) (a +o B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dual_order.lbound_of X Y B \<Longrightarrow> dual_order.lbound_of (a +o X) (a +o Y) (a +o B)
[PROOF STEP]
using ordering.lbound_of_def[OF supset_poset, of X Y B]
[PROOF STATE]
proof (prove)
using this:
dual_order.lbound_of X Y B \<equiv> X \<subseteq> B \<and> Y \<subseteq> B

goal (1 subgoal):
 1. dual_order.lbound_of X Y B \<Longrightarrow> dual_order.lbound_of (a +o X) (a +o Y) (a +o B)
[PROOF STEP]
by    (fast intro: ordering.lbound_ofI supset_poset)


[STATEMENT]
lemma has_vector_derivative_of_real[derivative_intros]:
  "(f has_field_derivative D) F \<Longrightarrow> ((\<lambda>x. of_real (f x)) has_vector_derivative (of_real D)) F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f has_real_derivative D) F \<Longrightarrow> ((\<lambda>x. of_real (f x)) has_vector_derivative of_real D) F
[PROOF STEP]
by (rule bounded_linear.has_vector_derivative[OF bounded_linear_of_real])
    (simp add: has_real_derivative_iff_has_vector_derivative)


[STATEMENT]
lemma le_TC_imp_VWO: "x \<sqsubseteq> y \<Longrightarrow> (x,y) \<in> VWO"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<sqsubseteq> y \<Longrightarrow> (x, y) \<in> VWO
[PROOF STEP]
by (metis Diff_iff Linear_order_VWO Linear_order_in_diff_Id UNIV_I VWO le_TC_def less_TC_imp_VWO)


[STATEMENT]
lemma left_add_mult_distrib_zmset:
  "repeat_zmset i u + (repeat_zmset j u + k) = repeat_zmset (i+j) u + k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. repeat_zmset i u + (repeat_zmset j u + k) = repeat_zmset (i + j) u + k
[PROOF STEP]
by (auto simp: zmultiset_eq_iff add_mult_distrib int_distrib(1))


[STATEMENT]
lemma sum_less_suminf: "summable f \<Longrightarrow> (\<And>m. m\<ge>n \<Longrightarrow> 0 < f m) \<Longrightarrow> sum f {..<n} < suminf f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>summable f; \<And>m. n \<le> m \<Longrightarrow> (0::'a) < f m\<rbrakk> \<Longrightarrow> sum f {..<n} < suminf f
[PROOF STEP]
using sum_less_suminf2[of n n]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>summable f; \<And>m. n \<le> m \<Longrightarrow> (0::'a) \<le> f m; n \<le> n; (0::'a) < f n\<rbrakk> \<Longrightarrow> sum f {..<n} < suminf f

goal (1 subgoal):
 1. \<lbrakk>summable f; \<And>m. n \<le> m \<Longrightarrow> (0::'a) < f m\<rbrakk> \<Longrightarrow> sum f {..<n} < suminf f
[PROOF STEP]
by (simp add: less_imp_le)


[STATEMENT]
lemma enumBase_bound: "\<forall>y \<in> set (enumBase nmax). \<forall>z \<in> set y. z \<le> nmax"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>y\<in>set (enumBase nmax). \<forall>z\<in>set y. z \<le> nmax
[PROOF STEP]
by (auto simp: enumBase_def)


[STATEMENT]
lemma openin_open: "openin (top_of_set U) S \<longleftrightarrow> (\<exists>T. open T \<and> (S = U \<inter> T))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. openin (top_of_set U) S = (\<exists>T. open T \<and> S = U \<inter> T)
[PROOF STEP]
by (auto simp: openin_subtopology)


[STATEMENT]
lemma mset_vec_same_size: "dim_vec v = size (vec_mset v)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_vec v = size (vec_mset v)
[PROOF STEP]
by (simp add: vec_mset_def)