[STATEMENT]
lemma finite_nList[intro]:
  assumes finA: "finite A"
  shows "finite (nList A n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (nList A n)
[PROOF STEP]
proof(induct n)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. finite (nList A 0)
 2. \<And>n. finite (nList A n) \<Longrightarrow> finite (nList A (Suc n))
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. finite (nList A 0)
 2. \<And>n. finite (nList A n) \<Longrightarrow> finite (nList A (Suc n))
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (nList A 0)
[PROOF STEP]
by (simp add:nList_def)
[PROOF STATE]
proof (state)
this:
finite (nList A 0)

goal (1 subgoal):
 1. \<And>n. finite (nList A n) \<Longrightarrow> finite (nList A (Suc n))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. finite (nList A n) \<Longrightarrow> finite (nList A (Suc n))
[PROOF STEP]
case (Suc n)
[PROOF STATE]
proof (state)
this:
finite (nList A n)

goal (1 subgoal):
 1. \<And>n. finite (nList A n) \<Longrightarrow> finite (nList A (Suc n))
[PROOF STEP]
hence finn: "finite (nList (A) n)"
[PROOF STATE]
proof (prove)
using this:
finite (nList A n)

goal (1 subgoal):
 1. finite (nList A n)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
finite (nList A n)

goal (1 subgoal):
 1. \<And>n. finite (nList A n) \<Longrightarrow> finite (nList A (Suc n))
[PROOF STEP]
have "nList A (Suc n) = (case_prod (#)) ` (A \<times> nList A n)" (is "?lhs = ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nList A (Suc n) = (\<lambda>(x, y). x # y) ` (A \<times> nList A n)
[PROOF STEP]
proof(rule subset_antisym[OF subsetI subsetI])
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x. x \<in> nList A (Suc n) \<Longrightarrow> x \<in> (\<lambda>(x, y). x # y) ` (A \<times> nList A n)
 2. \<And>x. x \<in> (\<lambda>(x, y). x # y) ` (A \<times> nList A n) \<Longrightarrow> x \<in> nList A (Suc n)
[PROOF STEP]
fix l
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x. x \<in> nList A (Suc n) \<Longrightarrow> x \<in> (\<lambda>(x, y). x # y) ` (A \<times> nList A n)
 2. \<And>x. x \<in> (\<lambda>(x, y). x # y) ` (A \<times> nList A n) \<Longrightarrow> x \<in> nList A (Suc n)
[PROOF STEP]
assume "l \<in> ?lhs"
[PROOF STATE]
proof (state)
this:
l \<in> nList A (Suc n)

goal (2 subgoals):
 1. \<And>x. x \<in> nList A (Suc n) \<Longrightarrow> x \<in> (\<lambda>(x, y). x # y) ` (A \<times> nList A n)
 2. \<And>x. x \<in> (\<lambda>(x, y). x # y) ` (A \<times> nList A n) \<Longrightarrow> x \<in> nList A (Suc n)
[PROOF STEP]
thus "l \<in> ?rhs"
[PROOF STATE]
proof (prove)
using this:
l \<in> nList A (Suc n)

goal (1 subgoal):
 1. l \<in> (\<lambda>(x, y). x # y) ` (A \<times> nList A n)
[PROOF STEP]
by (cases l, auto simp add:nList_def)
[PROOF STATE]
proof (state)
this:
l \<in> (\<lambda>(x, y). x # y) ` (A \<times> nList A n)

goal (1 subgoal):
 1. \<And>x. x \<in> (\<lambda>(x, y). x # y) ` (A \<times> nList A n) \<Longrightarrow> x \<in> nList A (Suc n)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> (\<lambda>(x, y). x # y) ` (A \<times> nList A n) \<Longrightarrow> x \<in> nList A (Suc n)
[PROOF STEP]
fix l
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> (\<lambda>(x, y). x # y) ` (A \<times> nList A n) \<Longrightarrow> x \<in> nList A (Suc n)
[PROOF STEP]
assume "l \<in> ?rhs"
[PROOF STATE]
proof (state)
this:
l \<in> (\<lambda>(x, y). x # y) ` (A \<times> nList A n)

goal (1 subgoal):
 1. \<And>x. x \<in> (\<lambda>(x, y). x # y) ` (A \<times> nList A n) \<Longrightarrow> x \<in> nList A (Suc n)
[PROOF STEP]
thus "l \<in> ?lhs"
[PROOF STATE]
proof (prove)
using this:
l \<in> (\<lambda>(x, y). x # y) ` (A \<times> nList A n)

goal (1 subgoal):
 1. l \<in> nList A (Suc n)
[PROOF STEP]
by (auto simp add:nList_def)
[PROOF STATE]
proof (state)
this:
l \<in> nList A (Suc n)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
nList A (Suc n) = (\<lambda>(x, y). x # y) ` (A \<times> nList A n)

goal (1 subgoal):
 1. \<And>n. finite (nList A n) \<Longrightarrow> finite (nList A (Suc n))
[PROOF STEP]
thus "finite ?lhs"
[PROOF STATE]
proof (prove)
using this:
nList A (Suc n) = (\<lambda>(x, y). x # y) ` (A \<times> nList A n)

goal (1 subgoal):
 1. finite (nList A (Suc n))
[PROOF STEP]
using finA and finn
[PROOF STATE]
proof (prove)
using this:
nList A (Suc n) = (\<lambda>(x, y). x # y) ` (A \<times> nList A n)
finite A
finite (nList A n)

goal (1 subgoal):
 1. finite (nList A (Suc n))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
finite (nList A (Suc n))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma converse_rtrancl3pD:
  "rtrancl3p (converse3p r) a' bs a \<Longrightarrow> rtrancl3p r a (rev bs) a'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rtrancl3p (converse3p r) a' bs a \<Longrightarrow> rtrancl3p r a (rev bs) a'
[PROOF STEP]
apply(induct rule: rtrancl3p.induct)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>a. rtrancl3p r a (rev []) a
 2. \<And>a bs a' b a''. \<lbrakk>rtrancl3p (converse3p r) a bs a'; rtrancl3p r a' (rev bs) a; converse3p r a' b a''\<rbrakk> \<Longrightarrow> rtrancl3p r a'' (rev (bs @ [b])) a
[PROOF STEP]
apply(fastforce intro: rtrancl3p.intros)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a bs a' b a''. \<lbrakk>rtrancl3p (converse3p r) a bs a'; rtrancl3p r a' (rev bs) a; converse3p r a' b a''\<rbrakk> \<Longrightarrow> rtrancl3p r a'' (rev (bs @ [b])) a
[PROOF STEP]
apply(auto dest: converse3pD intro: rtrancl3p_step_converse)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma del_UnEdge_even_even:
    assumes "valid_unMultigraph G" "finite(edges G)" "finite(nodes G)" "(v, w, v')\<in>edges G"
    assumes parity_assms: "even (degree v G)" "even (degree v' G)"
    shows "num_of_odd_nodes(del_unEdge v w v' G)=num_of_odd_nodes G + 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. num_of_odd_nodes (del_unEdge v w v' G) = num_of_odd_nodes G + 2
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. num_of_odd_nodes (del_unEdge v w v' G) = num_of_odd_nodes G + 2
[PROOF STEP]
interpret G:valid_unMultigraph
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. valid_unMultigraph G
[PROOF STEP]
by fact
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. num_of_odd_nodes (del_unEdge v w v' G) = num_of_odd_nodes G + 2
[PROOF STEP]
have  "v\<in>odd_nodes_set(del_unEdge v w v' G)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. v \<in> odd_nodes_set (del_unEdge v w v' G)
[PROOF STEP]
by (metis G.del_UnEdge_even assms(2) assms(4) parity_assms(1))
[PROOF STATE]
proof (state)
this:
v \<in> odd_nodes_set (del_unEdge v w v' G)

goal (1 subgoal):
 1. num_of_odd_nodes (del_unEdge v w v' G) = num_of_odd_nodes G + 2
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
v \<in> odd_nodes_set (del_unEdge v w v' G)

goal (1 subgoal):
 1. num_of_odd_nodes (del_unEdge v w v' G) = num_of_odd_nodes G + 2
[PROOF STEP]
have  "v'\<in>odd_nodes_set(del_unEdge v w v' G)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. v' \<in> odd_nodes_set (del_unEdge v w v' G)
[PROOF STEP]
by (metis G.del_UnEdge_even' assms(2) assms(4) parity_assms(2))
[PROOF STATE]
proof (state)
this:
v' \<in> odd_nodes_set (del_unEdge v w v' G)

goal (1 subgoal):
 1. num_of_odd_nodes (del_unEdge v w v' G) = num_of_odd_nodes G + 2
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
v \<in> odd_nodes_set (del_unEdge v w v' G)
v' \<in> odd_nodes_set (del_unEdge v w v' G)
[PROOF STEP]
have extra_odd_nodes:"{v,v'} \<subseteq> odd_nodes_set(del_unEdge v w v' G)"
[PROOF STATE]
proof (prove)
using this:
v \<in> odd_nodes_set (del_unEdge v w v' G)
v' \<in> odd_nodes_set (del_unEdge v w v' G)

goal (1 subgoal):
 1. {v, v'} \<subseteq> odd_nodes_set (del_unEdge v w v' G)
[PROOF STEP]
unfolding odd_nodes_set_def
[PROOF STATE]
proof (prove)
using this:
v \<in> {va \<in> nodes (del_unEdge v w v' G). odd (degree va (del_unEdge v w v' G))}
v' \<in> {va \<in> nodes (del_unEdge v w v' G). odd (degree va (del_unEdge v w v' G))}

goal (1 subgoal):
 1. {v, v'} \<subseteq> {va \<in> nodes (del_unEdge v w v' G). odd (degree va (del_unEdge v w v' G))}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{v, v'} \<subseteq> odd_nodes_set (del_unEdge v w v' G)

goal (1 subgoal):
 1. num_of_odd_nodes (del_unEdge v w v' G) = num_of_odd_nodes G + 2
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
{v, v'} \<subseteq> odd_nodes_set (del_unEdge v w v' G)

goal (1 subgoal):
 1. num_of_odd_nodes (del_unEdge v w v' G) = num_of_odd_nodes G + 2
[PROOF STEP]
have "v \<notin>odd_nodes_set G" and "v'\<notin>odd_nodes_set G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. v \<notin> odd_nodes_set G &&& v' \<notin> odd_nodes_set G
[PROOF STEP]
using parity_assms
[PROOF STATE]
proof (prove)
using this:
even (degree v G)
even (degree v' G)

goal (1 subgoal):
 1. v \<notin> odd_nodes_set G &&& v' \<notin> odd_nodes_set G
[PROOF STEP]
unfolding odd_nodes_set_def
[PROOF STATE]
proof (prove)
using this:
even (degree v G)
even (degree v' G)

goal (1 subgoal):
 1. v \<notin> {v \<in> G.V. odd (degree v G)} &&& v' \<notin> {v \<in> G.V. odd (degree v G)}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
v \<notin> odd_nodes_set G
v' \<notin> odd_nodes_set G

goal (1 subgoal):
 1. num_of_odd_nodes (del_unEdge v w v' G) = num_of_odd_nodes G + 2
[PROOF STEP]
hence vv'_odd_disjoint: "{v,v'} \<inter> odd_nodes_set G = {}"
[PROOF STATE]
proof (prove)
using this:
v \<notin> odd_nodes_set G
v' \<notin> odd_nodes_set G

goal (1 subgoal):
 1. {v, v'} \<inter> odd_nodes_set G = {}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{v, v'} \<inter> odd_nodes_set G = {}

goal (1 subgoal):
 1. num_of_odd_nodes (del_unEdge v w v' G) = num_of_odd_nodes G + 2
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
{v, v'} \<inter> odd_nodes_set G = {}

goal (1 subgoal):
 1. num_of_odd_nodes (del_unEdge v w v' G) = num_of_odd_nodes G + 2
[PROOF STEP]
have "odd_nodes_set(del_unEdge v w v' G) -{v,v'}\<subseteq>odd_nodes_set G "
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. odd_nodes_set (del_unEdge v w v' G) - {v, v'} \<subseteq> odd_nodes_set G
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> odd_nodes_set (del_unEdge v w v' G) - {v, v'} \<Longrightarrow> x \<in> odd_nodes_set G
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> odd_nodes_set (del_unEdge v w v' G) - {v, v'} \<Longrightarrow> x \<in> odd_nodes_set G
[PROOF STEP]
assume x_odd_set: "x \<in> odd_nodes_set (del_unEdge v w v' G) - {v, v'}"
[PROOF STATE]
proof (state)
this:
x \<in> odd_nodes_set (del_unEdge v w v' G) - {v, v'}

goal (1 subgoal):
 1. \<And>x. x \<in> odd_nodes_set (del_unEdge v w v' G) - {v, v'} \<Longrightarrow> x \<in> odd_nodes_set G
[PROOF STEP]
hence "degree x (del_unEdge v w v' G) = degree x G"
[PROOF STATE]
proof (prove)
using this:
x \<in> odd_nodes_set (del_unEdge v w v' G) - {v, v'}

goal (1 subgoal):
 1. degree x (del_unEdge v w v' G) = degree x G
[PROOF STEP]
by (metis Diff_iff G.degree_frame assms(2))
[PROOF STATE]
proof (state)
this:
degree x (del_unEdge v w v' G) = degree x G

goal (1 subgoal):
 1. \<And>x. x \<in> odd_nodes_set (del_unEdge v w v' G) - {v, v'} \<Longrightarrow> x \<in> odd_nodes_set G
[PROOF STEP]
hence "odd(degree x G)"
[PROOF STATE]
proof (prove)
using this:
degree x (del_unEdge v w v' G) = degree x G

goal (1 subgoal):
 1. odd (degree x G)
[PROOF STEP]
using x_odd_set
[PROOF STATE]
proof (prove)
using this:
degree x (del_unEdge v w v' G) = degree x G
x \<in> odd_nodes_set (del_unEdge v w v' G) - {v, v'}

goal (1 subgoal):
 1. odd (degree x G)
[PROOF STEP]
unfolding odd_nodes_set_def
[PROOF STATE]
proof (prove)
using this:
degree x (del_unEdge v w v' G) = degree x G
x \<in> {va \<in> nodes (del_unEdge v w v' G). odd (degree va (del_unEdge v w v' G))} - {v, v'}

goal (1 subgoal):
 1. odd (degree x G)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
odd (degree x G)

goal (1 subgoal):
 1. \<And>x. x \<in> odd_nodes_set (del_unEdge v w v' G) - {v, v'} \<Longrightarrow> x \<in> odd_nodes_set G
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
odd (degree x G)

goal (1 subgoal):
 1. \<And>x. x \<in> odd_nodes_set (del_unEdge v w v' G) - {v, v'} \<Longrightarrow> x \<in> odd_nodes_set G
[PROOF STEP]
have "x \<in> nodes G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> G.V
[PROOF STEP]
using x_odd_set
[PROOF STATE]
proof (prove)
using this:
x \<in> odd_nodes_set (del_unEdge v w v' G) - {v, v'}

goal (1 subgoal):
 1. x \<in> G.V
[PROOF STEP]
unfolding odd_nodes_set_def
[PROOF STATE]
proof (prove)
using this:
x \<in> {va \<in> nodes (del_unEdge v w v' G). odd (degree va (del_unEdge v w v' G))} - {v, v'}

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

goal (1 subgoal):
 1. \<And>x. x \<in> odd_nodes_set (del_unEdge v w v' G) - {v, v'} \<Longrightarrow> x \<in> odd_nodes_set G
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
odd (degree x G)
x \<in> G.V
[PROOF STEP]
show "x \<in> odd_nodes_set G"
[PROOF STATE]
proof (prove)
using this:
odd (degree x G)
x \<in> G.V

goal (1 subgoal):
 1. x \<in> odd_nodes_set G
[PROOF STEP]
unfolding odd_nodes_set_def
[PROOF STATE]
proof (prove)
using this:
odd (degree x G)
x \<in> G.V

goal (1 subgoal):
 1. x \<in> {v \<in> G.V. odd (degree v G)}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x \<in> odd_nodes_set G

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
odd_nodes_set (del_unEdge v w v' G) - {v, v'} \<subseteq> odd_nodes_set G

goal (1 subgoal):
 1. num_of_odd_nodes (del_unEdge v w v' G) = num_of_odd_nodes G + 2
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
odd_nodes_set (del_unEdge v w v' G) - {v, v'} \<subseteq> odd_nodes_set G

goal (1 subgoal):
 1. num_of_odd_nodes (del_unEdge v w v' G) = num_of_odd_nodes G + 2
[PROOF STEP]
have "odd_nodes_set G \<subseteq> odd_nodes_set(del_unEdge v w v' G)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. odd_nodes_set G \<subseteq> odd_nodes_set (del_unEdge v w v' G)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> odd_nodes_set G \<Longrightarrow> x \<in> odd_nodes_set (del_unEdge v w v' G)
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> odd_nodes_set G \<Longrightarrow> x \<in> odd_nodes_set (del_unEdge v w v' G)
[PROOF STEP]
assume x_odd_set:  "x \<in> odd_nodes_set G"
[PROOF STATE]
proof (state)
this:
x \<in> odd_nodes_set G

goal (1 subgoal):
 1. \<And>x. x \<in> odd_nodes_set G \<Longrightarrow> x \<in> odd_nodes_set (del_unEdge v w v' G)
[PROOF STEP]
hence "x\<notin>{v,v'} \<Longrightarrow> odd(degree x (del_unEdge v w v' G))"
[PROOF STATE]
proof (prove)
using this:
x \<in> odd_nodes_set G

goal (1 subgoal):
 1. x \<notin> {v, v'} \<Longrightarrow> odd (degree x (del_unEdge v w v' G))
[PROOF STEP]
by (metis (lifting) G.degree_frame assms(2) mem_Collect_eq odd_nodes_set_def)
[PROOF STATE]
proof (state)
this:
x \<notin> {v, v'} \<Longrightarrow> odd (degree x (del_unEdge v w v' G))

goal (1 subgoal):
 1. \<And>x. x \<in> odd_nodes_set G \<Longrightarrow> x \<in> odd_nodes_set (del_unEdge v w v' G)
[PROOF STEP]
hence "x\<notin>{v,v'} \<Longrightarrow> x\<in>odd_nodes_set(del_unEdge v w v' G)"
[PROOF STATE]
proof (prove)
using this:
x \<notin> {v, v'} \<Longrightarrow> odd (degree x (del_unEdge v w v' G))

goal (1 subgoal):
 1. x \<notin> {v, v'} \<Longrightarrow> x \<in> odd_nodes_set (del_unEdge v w v' G)
[PROOF STEP]
using x_odd_set del_UnEdge_node
[PROOF STATE]
proof (prove)
using this:
x \<notin> {v, v'} \<Longrightarrow> odd (degree x (del_unEdge v w v' G))
x \<in> odd_nodes_set G
(?v \<in> nodes (del_unEdge ?u ?e ?u' ?G)) = (?v \<in> nodes ?G)

goal (1 subgoal):
 1. x \<notin> {v, v'} \<Longrightarrow> x \<in> odd_nodes_set (del_unEdge v w v' G)
[PROOF STEP]
unfolding odd_nodes_set_def
[PROOF STATE]
proof (prove)
using this:
x \<notin> {v, v'} \<Longrightarrow> odd (degree x (del_unEdge v w v' G))
x \<in> {v \<in> G.V. odd (degree v G)}
(?v \<in> nodes (del_unEdge ?u ?e ?u' ?G)) = (?v \<in> nodes ?G)

goal (1 subgoal):
 1. x \<notin> {v, v'} \<Longrightarrow> x \<in> {va \<in> nodes (del_unEdge v w v' G). odd (degree va (del_unEdge v w v' G))}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x \<notin> {v, v'} \<Longrightarrow> x \<in> odd_nodes_set (del_unEdge v w v' G)

goal (1 subgoal):
 1. \<And>x. x \<in> odd_nodes_set G \<Longrightarrow> x \<in> odd_nodes_set (del_unEdge v w v' G)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
x \<notin> {v, v'} \<Longrightarrow> x \<in> odd_nodes_set (del_unEdge v w v' G)

goal (1 subgoal):
 1. \<And>x. x \<in> odd_nodes_set G \<Longrightarrow> x \<in> odd_nodes_set (del_unEdge v w v' G)
[PROOF STEP]
have "x\<in>{v,v'} \<Longrightarrow> x\<in>odd_nodes_set(del_unEdge v w v' G)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> {v, v'} \<Longrightarrow> x \<in> odd_nodes_set (del_unEdge v w v' G)
[PROOF STEP]
using extra_odd_nodes
[PROOF STATE]
proof (prove)
using this:
{v, v'} \<subseteq> odd_nodes_set (del_unEdge v w v' G)

goal (1 subgoal):
 1. x \<in> {v, v'} \<Longrightarrow> x \<in> odd_nodes_set (del_unEdge v w v' G)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x \<in> {v, v'} \<Longrightarrow> x \<in> odd_nodes_set (del_unEdge v w v' G)

goal (1 subgoal):
 1. \<And>x. x \<in> odd_nodes_set G \<Longrightarrow> x \<in> odd_nodes_set (del_unEdge v w v' G)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
x \<notin> {v, v'} \<Longrightarrow> x \<in> odd_nodes_set (del_unEdge v w v' G)
x \<in> {v, v'} \<Longrightarrow> x \<in> odd_nodes_set (del_unEdge v w v' G)
[PROOF STEP]
show "x \<in> odd_nodes_set (del_unEdge v w v' G)"
[PROOF STATE]
proof (prove)
using this:
x \<notin> {v, v'} \<Longrightarrow> x \<in> odd_nodes_set (del_unEdge v w v' G)
x \<in> {v, v'} \<Longrightarrow> x \<in> odd_nodes_set (del_unEdge v w v' G)

goal (1 subgoal):
 1. x \<in> odd_nodes_set (del_unEdge v w v' G)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x \<in> odd_nodes_set (del_unEdge v w v' G)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
odd_nodes_set G \<subseteq> odd_nodes_set (del_unEdge v w v' G)

goal (1 subgoal):
 1. num_of_odd_nodes (del_unEdge v w v' G) = num_of_odd_nodes G + 2
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
{v, v'} \<subseteq> odd_nodes_set (del_unEdge v w v' G)
{v, v'} \<inter> odd_nodes_set G = {}
odd_nodes_set (del_unEdge v w v' G) - {v, v'} \<subseteq> odd_nodes_set G
odd_nodes_set G \<subseteq> odd_nodes_set (del_unEdge v w v' G)
[PROOF STEP]
have "odd_nodes_set(del_unEdge v w v' G)=odd_nodes_set G \<union> {v,v'}"
[PROOF STATE]
proof (prove)
using this:
{v, v'} \<subseteq> odd_nodes_set (del_unEdge v w v' G)
{v, v'} \<inter> odd_nodes_set G = {}
odd_nodes_set (del_unEdge v w v' G) - {v, v'} \<subseteq> odd_nodes_set G
odd_nodes_set G \<subseteq> odd_nodes_set (del_unEdge v w v' G)

goal (1 subgoal):
 1. odd_nodes_set (del_unEdge v w v' G) = odd_nodes_set G \<union> {v, v'}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
odd_nodes_set (del_unEdge v w v' G) = odd_nodes_set G \<union> {v, v'}

goal (1 subgoal):
 1. num_of_odd_nodes (del_unEdge v w v' G) = num_of_odd_nodes G + 2
[PROOF STEP]
thus "num_of_odd_nodes(del_unEdge v w v' G) = num_of_odd_nodes G + 2"
[PROOF STATE]
proof (prove)
using this:
odd_nodes_set (del_unEdge v w v' G) = odd_nodes_set G \<union> {v, v'}

goal (1 subgoal):
 1. num_of_odd_nodes (del_unEdge v w v' G) = num_of_odd_nodes G + 2
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. odd_nodes_set (del_unEdge v w v' G) = odd_nodes_set G \<union> {v, v'} \<Longrightarrow> num_of_odd_nodes (del_unEdge v w v' G) = num_of_odd_nodes G + 2
[PROOF STEP]
assume "odd_nodes_set(del_unEdge v w v' G)=odd_nodes_set G \<union> {v,v'}"
[PROOF STATE]
proof (state)
this:
odd_nodes_set (del_unEdge v w v' G) = odd_nodes_set G \<union> {v, v'}

goal (1 subgoal):
 1. odd_nodes_set (del_unEdge v w v' G) = odd_nodes_set G \<union> {v, v'} \<Longrightarrow> num_of_odd_nodes (del_unEdge v w v' G) = num_of_odd_nodes G + 2
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
odd_nodes_set (del_unEdge v w v' G) = odd_nodes_set G \<union> {v, v'}

goal (1 subgoal):
 1. odd_nodes_set (del_unEdge v w v' G) = odd_nodes_set G \<union> {v, v'} \<Longrightarrow> num_of_odd_nodes (del_unEdge v w v' G) = num_of_odd_nodes G + 2
[PROOF STEP]
have "v\<noteq>v'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. v \<noteq> v'
[PROOF STEP]
using G.no_id \<open>(v,w,v')\<in>edges G\<close>
[PROOF STATE]
proof (prove)
using this:
(?v, ?w, ?v) \<notin> G.E
(v, w, v') \<in> G.E

goal (1 subgoal):
 1. v \<noteq> v'
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
v \<noteq> v'

goal (1 subgoal):
 1. odd_nodes_set (del_unEdge v w v' G) = odd_nodes_set G \<union> {v, v'} \<Longrightarrow> num_of_odd_nodes (del_unEdge v w v' G) = num_of_odd_nodes G + 2
[PROOF STEP]
hence "card{v,v'}=2"
[PROOF STATE]
proof (prove)
using this:
v \<noteq> v'

goal (1 subgoal):
 1. card {v, v'} = 2
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
card {v, v'} = 2

goal (1 subgoal):
 1. odd_nodes_set (del_unEdge v w v' G) = odd_nodes_set G \<union> {v, v'} \<Longrightarrow> num_of_odd_nodes (del_unEdge v w v' G) = num_of_odd_nodes G + 2
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
card {v, v'} = 2

goal (1 subgoal):
 1. odd_nodes_set (del_unEdge v w v' G) = odd_nodes_set G \<union> {v, v'} \<Longrightarrow> num_of_odd_nodes (del_unEdge v w v' G) = num_of_odd_nodes G + 2
[PROOF STEP]
have " odd_nodes_set G \<inter> {v,v'} = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. odd_nodes_set G \<inter> {v, v'} = {}
[PROOF STEP]
using vv'_odd_disjoint
[PROOF STATE]
proof (prove)
using this:
{v, v'} \<inter> odd_nodes_set G = {}

goal (1 subgoal):
 1. odd_nodes_set G \<inter> {v, v'} = {}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
odd_nodes_set G \<inter> {v, v'} = {}

goal (1 subgoal):
 1. odd_nodes_set (del_unEdge v w v' G) = odd_nodes_set G \<union> {v, v'} \<Longrightarrow> num_of_odd_nodes (del_unEdge v w v' G) = num_of_odd_nodes G + 2
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
odd_nodes_set G \<inter> {v, v'} = {}

goal (1 subgoal):
 1. odd_nodes_set (del_unEdge v w v' G) = odd_nodes_set G \<union> {v, v'} \<Longrightarrow> num_of_odd_nodes (del_unEdge v w v' G) = num_of_odd_nodes G + 2
[PROOF STEP]
have "finite(odd_nodes_set G)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (odd_nodes_set G)
[PROOF STEP]
by (metis (lifting) assms(3) mem_Collect_eq odd_nodes_set_def rev_finite_subset subsetI)
[PROOF STATE]
proof (state)
this:
finite (odd_nodes_set G)

goal (1 subgoal):
 1. odd_nodes_set (del_unEdge v w v' G) = odd_nodes_set G \<union> {v, v'} \<Longrightarrow> num_of_odd_nodes (del_unEdge v w v' G) = num_of_odd_nodes G + 2
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
finite (odd_nodes_set G)

goal (1 subgoal):
 1. odd_nodes_set (del_unEdge v w v' G) = odd_nodes_set G \<union> {v, v'} \<Longrightarrow> num_of_odd_nodes (del_unEdge v w v' G) = num_of_odd_nodes G + 2
[PROOF STEP]
have "finite {v,v'}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {v, v'}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
finite {v, v'}

goal (1 subgoal):
 1. odd_nodes_set (del_unEdge v w v' G) = odd_nodes_set G \<union> {v, v'} \<Longrightarrow> num_of_odd_nodes (del_unEdge v w v' G) = num_of_odd_nodes G + 2
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
odd_nodes_set (del_unEdge v w v' G) = odd_nodes_set G \<union> {v, v'}
card {v, v'} = 2
odd_nodes_set G \<inter> {v, v'} = {}
finite (odd_nodes_set G)
finite {v, v'}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
odd_nodes_set (del_unEdge v w v' G) = odd_nodes_set G \<union> {v, v'}
card {v, v'} = 2
odd_nodes_set G \<inter> {v, v'} = {}
finite (odd_nodes_set G)
finite {v, v'}

goal (1 subgoal):
 1. num_of_odd_nodes (del_unEdge v w v' G) = num_of_odd_nodes G + 2
[PROOF STEP]
unfolding num_of_odd_nodes_def
[PROOF STATE]
proof (prove)
using this:
odd_nodes_set (del_unEdge v w v' G) = odd_nodes_set G \<union> {v, v'}
card {v, v'} = 2
odd_nodes_set G \<inter> {v, v'} = {}
finite (odd_nodes_set G)
finite {v, v'}

goal (1 subgoal):
 1. card (odd_nodes_set (del_unEdge v w v' G)) = card (odd_nodes_set G) + 2
[PROOF STEP]
using card_Un_disjoint
[PROOF STATE]
proof (prove)
using this:
odd_nodes_set (del_unEdge v w v' G) = odd_nodes_set G \<union> {v, v'}
card {v, v'} = 2
odd_nodes_set G \<inter> {v, v'} = {}
finite (odd_nodes_set G)
finite {v, v'}
\<lbrakk>finite ?A; finite ?B; ?A \<inter> ?B = {}\<rbrakk> \<Longrightarrow> card (?A \<union> ?B) = card ?A + card ?B

goal (1 subgoal):
 1. card (odd_nodes_set (del_unEdge v w v' G)) = card (odd_nodes_set G) + 2
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
num_of_odd_nodes (del_unEdge v w v' G) = num_of_odd_nodes G + 2

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
num_of_odd_nodes (del_unEdge v w v' G) = num_of_odd_nodes G + 2

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma card_partition':
  assumes "\<forall>v\<in>A. card {n. R v n} = k" "k>0" "finite A"
      "\<forall>v1 v2. v1\<noteq>v2 \<longrightarrow> {n. R v1 n} \<inter> {n. R v2 n}={}"
  shows "card (\<Union>v\<in>A. {n. R v n}) = k * card A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (\<Union>v\<in>A. {n. R v n}) = k * card A
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. card (\<Union>v\<in>A. {n. R v n}) = k * card A
[PROOF STEP]
have "\<And>C. C \<in> (\<lambda>x. {n. R x n}) ` A \<Longrightarrow> card C = k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>C. C \<in> (\<lambda>x. {n. R x n}) ` A \<Longrightarrow> card C = k
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>C. C \<in> (\<lambda>x. {n. R x n}) ` A \<Longrightarrow> card C = k
[PROOF STEP]
fix C
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>C. C \<in> (\<lambda>x. {n. R x n}) ` A \<Longrightarrow> card C = k
[PROOF STEP]
assume "C \<in> (\<lambda>x. {n. R x n}) ` A"
[PROOF STATE]
proof (state)
this:
C \<in> (\<lambda>x. {n. R x n}) ` A

goal (1 subgoal):
 1. \<And>C. C \<in> (\<lambda>x. {n. R x n}) ` A \<Longrightarrow> card C = k
[PROOF STEP]
show "card C=k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card C = k
[PROOF STEP]
by (metis (mono_tags) \<open>C \<in> (\<lambda>x. {n. R x n}) ` A\<close> assms(1) imageE)
[PROOF STATE]
proof (state)
this:
card C = k

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
?C \<in> (\<lambda>x. {n. R x n}) ` A \<Longrightarrow> card ?C = k

goal (1 subgoal):
 1. card (\<Union>v\<in>A. {n. R v n}) = k * card A
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
?C \<in> (\<lambda>x. {n. R x n}) ` A \<Longrightarrow> card ?C = k

goal (1 subgoal):
 1. card (\<Union>v\<in>A. {n. R v n}) = k * card A
[PROOF STEP]
have "\<And>C1 C2. C1 \<in>(\<lambda>x. {n. R x n}) ` A  \<Longrightarrow> C2 \<in> (\<lambda>x. {n. R x n}) ` A \<Longrightarrow> C1 \<noteq> C2
      \<Longrightarrow> C1 \<inter> C2 = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>C1 C2. \<lbrakk>C1 \<in> (\<lambda>x. {n. R x n}) ` A; C2 \<in> (\<lambda>x. {n. R x n}) ` A; C1 \<noteq> C2\<rbrakk> \<Longrightarrow> C1 \<inter> C2 = {}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>C1 C2. \<lbrakk>C1 \<in> (\<lambda>x. {n. R x n}) ` A; C2 \<in> (\<lambda>x. {n. R x n}) ` A; C1 \<noteq> C2\<rbrakk> \<Longrightarrow> C1 \<inter> C2 = {}
[PROOF STEP]
fix C1 C2
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>C1 C2. \<lbrakk>C1 \<in> (\<lambda>x. {n. R x n}) ` A; C2 \<in> (\<lambda>x. {n. R x n}) ` A; C1 \<noteq> C2\<rbrakk> \<Longrightarrow> C1 \<inter> C2 = {}
[PROOF STEP]
assume "C1 \<in> (\<lambda>x. {n. R x n}) ` A"  "C2 \<in> (\<lambda>x. {n. R x n}) ` A"  "C1 \<noteq> C2"
[PROOF STATE]
proof (state)
this:
C1 \<in> (\<lambda>x. {n. R x n}) ` A
C2 \<in> (\<lambda>x. {n. R x n}) ` A
C1 \<noteq> C2

goal (1 subgoal):
 1. \<And>C1 C2. \<lbrakk>C1 \<in> (\<lambda>x. {n. R x n}) ` A; C2 \<in> (\<lambda>x. {n. R x n}) ` A; C1 \<noteq> C2\<rbrakk> \<Longrightarrow> C1 \<inter> C2 = {}
[PROOF STEP]
obtain v1 where "v1\<in>A" "C1={n. R v1 n}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>v1. \<lbrakk>v1 \<in> A; C1 = {n. R v1 n}\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis \<open>C1 \<in> (\<lambda>x. {n. R x n}) ` A\<close> imageE)
[PROOF STATE]
proof (state)
this:
v1 \<in> A
C1 = {n. R v1 n}

goal (1 subgoal):
 1. \<And>C1 C2. \<lbrakk>C1 \<in> (\<lambda>x. {n. R x n}) ` A; C2 \<in> (\<lambda>x. {n. R x n}) ` A; C1 \<noteq> C2\<rbrakk> \<Longrightarrow> C1 \<inter> C2 = {}
[PROOF STEP]
obtain v2 where "v2\<in>A" "C2={n. R v2 n}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>v2. \<lbrakk>v2 \<in> A; C2 = {n. R v2 n}\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis \<open>C2 \<in> (\<lambda>x. {n. R x n}) ` A\<close> imageE)
[PROOF STATE]
proof (state)
this:
v2 \<in> A
C2 = {n. R v2 n}

goal (1 subgoal):
 1. \<And>C1 C2. \<lbrakk>C1 \<in> (\<lambda>x. {n. R x n}) ` A; C2 \<in> (\<lambda>x. {n. R x n}) ` A; C1 \<noteq> C2\<rbrakk> \<Longrightarrow> C1 \<inter> C2 = {}
[PROOF STEP]
have "v1\<noteq>v2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. v1 \<noteq> v2
[PROOF STEP]
by (metis \<open>C1 = {n. R v1 n}\<close> \<open>C1 \<noteq> C2\<close> \<open>C2 = {n. R v2 n}\<close>)
[PROOF STATE]
proof (state)
this:
v1 \<noteq> v2

goal (1 subgoal):
 1. \<And>C1 C2. \<lbrakk>C1 \<in> (\<lambda>x. {n. R x n}) ` A; C2 \<in> (\<lambda>x. {n. R x n}) ` A; C1 \<noteq> C2\<rbrakk> \<Longrightarrow> C1 \<inter> C2 = {}
[PROOF STEP]
thus "C1 \<inter> C2 ={}"
[PROOF STATE]
proof (prove)
using this:
v1 \<noteq> v2

goal (1 subgoal):
 1. C1 \<inter> C2 = {}
[PROOF STEP]
by (metis \<open>C1 = {n. R v1 n}\<close> \<open>C2 = {n. R v2 n}\<close> assms(4))
[PROOF STATE]
proof (state)
this:
C1 \<inter> C2 = {}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<lbrakk>?C1.0 \<in> (\<lambda>x. {n. R x n}) ` A; ?C2.0 \<in> (\<lambda>x. {n. R x n}) ` A; ?C1.0 \<noteq> ?C2.0\<rbrakk> \<Longrightarrow> ?C1.0 \<inter> ?C2.0 = {}

goal (1 subgoal):
 1. card (\<Union>v\<in>A. {n. R v n}) = k * card A
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<lbrakk>?C1.0 \<in> (\<lambda>x. {n. R x n}) ` A; ?C2.0 \<in> (\<lambda>x. {n. R x n}) ` A; ?C1.0 \<noteq> ?C2.0\<rbrakk> \<Longrightarrow> ?C1.0 \<inter> ?C2.0 = {}

goal (1 subgoal):
 1. card (\<Union>v\<in>A. {n. R v n}) = k * card A
[PROOF STEP]
have "\<Union>((\<lambda>x. {n. R x n}) ` A) = (\<Union>x\<in>A. {n. R x n})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Union>x\<in>A. {n. R x n}) = (\<Union>x\<in>A. {n. R x n})
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<Union>x\<in>A. {n. R x n}) = (\<Union>x\<in>A. {n. R x n})

goal (1 subgoal):
 1. card (\<Union>v\<in>A. {n. R v n}) = k * card A
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(\<Union>x\<in>A. {n. R x n}) = (\<Union>x\<in>A. {n. R x n})

goal (1 subgoal):
 1. card (\<Union>v\<in>A. {n. R v n}) = k * card A
[PROOF STEP]
have "finite ((\<lambda>x. {n. R x n}) ` A )"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite ((\<lambda>x. {n. R x n}) ` A)
[PROOF STEP]
by (metis assms(3) finite_imageI)
[PROOF STATE]
proof (state)
this:
finite ((\<lambda>x. {n. R x n}) ` A)

goal (1 subgoal):
 1. card (\<Union>v\<in>A. {n. R v n}) = k * card A
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
finite ((\<lambda>x. {n. R x n}) ` A)

goal (1 subgoal):
 1. card (\<Union>v\<in>A. {n. R v n}) = k * card A
[PROOF STEP]
have "finite (\<Union>((\<lambda>x. {n. R x n}) ` A))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (\<Union>x\<in>A. {n. R x n})
[PROOF STEP]
by (metis (full_types) assms(1)
    assms(2) assms(3) card_eq_0_iff finite_UN_I less_nat_zero_code)
[PROOF STATE]
proof (state)
this:
finite (\<Union>x\<in>A. {n. R x n})

goal (1 subgoal):
 1. card (\<Union>v\<in>A. {n. R v n}) = k * card A
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
finite (\<Union>x\<in>A. {n. R x n})

goal (1 subgoal):
 1. card (\<Union>v\<in>A. {n. R v n}) = k * card A
[PROOF STEP]
have " card A = card ((\<lambda>x. {n. R x n}) ` A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card A = card ((\<lambda>x. {n. R x n}) ` A)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. card A = card ((\<lambda>x. {n. R x n}) ` A)
[PROOF STEP]
have "inj_on (\<lambda>x. {n. R x n}) A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on (\<lambda>x. {n. R x n}) A
[PROOF STEP]
unfolding inj_on_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>A. \<forall>y\<in>A. Collect (R x) = Collect (R y) \<longrightarrow> x = y
[PROOF STEP]
using \<open>\<forall>v1 v2. v1\<noteq>v2 \<longrightarrow> {n. R v1 n} \<inter> {n. R v2 n}={}\<close>
[PROOF STATE]
proof (prove)
using this:
\<forall>v1 v2. v1 \<noteq> v2 \<longrightarrow> {n. R v1 n} \<inter> {n. R v2 n} = {}

goal (1 subgoal):
 1. \<forall>x\<in>A. \<forall>y\<in>A. Collect (R x) = Collect (R y) \<longrightarrow> x = y
[PROOF STEP]
by (metis assms(1) assms(2) card.empty inf.idem less_le)
[PROOF STATE]
proof (state)
this:
inj_on (\<lambda>x. {n. R x n}) A

goal (1 subgoal):
 1. card A = card ((\<lambda>x. {n. R x n}) ` A)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
inj_on (\<lambda>x. {n. R x n}) A

goal (1 subgoal):
 1. card A = card ((\<lambda>x. {n. R x n}) ` A)
[PROOF STEP]
by (metis card_image)
[PROOF STATE]
proof (state)
this:
card A = card ((\<lambda>x. {n. R x n}) ` A)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
card A = card ((\<lambda>x. {n. R x n}) ` A)

goal (1 subgoal):
 1. card (\<Union>v\<in>A. {n. R v n}) = k * card A
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
?C \<in> (\<lambda>x. {n. R x n}) ` A \<Longrightarrow> card ?C = k
\<lbrakk>?C1.0 \<in> (\<lambda>x. {n. R x n}) ` A; ?C2.0 \<in> (\<lambda>x. {n. R x n}) ` A; ?C1.0 \<noteq> ?C2.0\<rbrakk> \<Longrightarrow> ?C1.0 \<inter> ?C2.0 = {}
(\<Union>x\<in>A. {n. R x n}) = (\<Union>x\<in>A. {n. R x n})
finite ((\<lambda>x. {n. R x n}) ` A)
finite (\<Union>x\<in>A. {n. R x n})
card A = card ((\<lambda>x. {n. R x n}) ` A)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
?C \<in> (\<lambda>x. {n. R x n}) ` A \<Longrightarrow> card ?C = k
\<lbrakk>?C1.0 \<in> (\<lambda>x. {n. R x n}) ` A; ?C2.0 \<in> (\<lambda>x. {n. R x n}) ` A; ?C1.0 \<noteq> ?C2.0\<rbrakk> \<Longrightarrow> ?C1.0 \<inter> ?C2.0 = {}
(\<Union>x\<in>A. {n. R x n}) = (\<Union>x\<in>A. {n. R x n})
finite ((\<lambda>x. {n. R x n}) ` A)
finite (\<Union>x\<in>A. {n. R x n})
card A = card ((\<lambda>x. {n. R x n}) ` A)

goal (1 subgoal):
 1. card (\<Union>v\<in>A. {n. R v n}) = k * card A
[PROOF STEP]
using card_partition[of "(\<lambda>x. {n. R x n}) ` A"]
[PROOF STATE]
proof (prove)
using this:
?C \<in> (\<lambda>x. {n. R x n}) ` A \<Longrightarrow> card ?C = k
\<lbrakk>?C1.0 \<in> (\<lambda>x. {n. R x n}) ` A; ?C2.0 \<in> (\<lambda>x. {n. R x n}) ` A; ?C1.0 \<noteq> ?C2.0\<rbrakk> \<Longrightarrow> ?C1.0 \<inter> ?C2.0 = {}
(\<Union>x\<in>A. {n. R x n}) = (\<Union>x\<in>A. {n. R x n})
finite ((\<lambda>x. {n. R x n}) ` A)
finite (\<Union>x\<in>A. {n. R x n})
card A = card ((\<lambda>x. {n. R x n}) ` A)
\<lbrakk>finite ((\<lambda>x. {n. R x n}) ` A); finite (\<Union>x\<in>A. {n. R x n}); \<And>c. c \<in> (\<lambda>x. {n. R x n}) ` A \<Longrightarrow> card c = ?k; \<And>c1 c2. \<lbrakk>c1 \<in> (\<lambda>x. {n. R x n}) ` A; c2 \<in> (\<lambda>x. {n. R x n}) ` A; c1 \<noteq> c2\<rbrakk> \<Longrightarrow> c1 \<inter> c2 = {}\<rbrakk> \<Longrightarrow> ?k * card ((\<lambda>x. {n. R x n}) ` A) = card (\<Union>x\<in>A. {n. R x n})

goal (1 subgoal):
 1. card (\<Union>v\<in>A. {n. R v n}) = k * card A
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
card (\<Union>v\<in>A. {n. R v n}) = k * card A

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma tiny_digraphI':
  assumes "digraph \<alpha> \<CC>" and "\<CC>\<lparr>Obj\<rparr> \<in>\<^sub>\<circ> Vset \<alpha>" and "\<CC>\<lparr>Arr\<rparr> \<in>\<^sub>\<circ> Vset \<alpha>"
  shows "tiny_digraph \<alpha> \<CC>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. tiny_digraph \<alpha> \<CC>
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
digraph \<alpha> \<CC>
\<CC>\<lparr>Obj\<rparr> \<in>\<^sub>\<circ> Vset \<alpha>
\<CC>\<lparr>Arr\<rparr> \<in>\<^sub>\<circ> Vset \<alpha>

goal (1 subgoal):
 1. tiny_digraph \<alpha> \<CC>
[PROOF STEP]
by (meson digraphD(5,6,7,8,9) digraph_def tiny_digraphI)


[STATEMENT]
lemma facetrel_complement_vertex: "y\<lhd>x \<Longrightarrow> x = insert v y \<Longrightarrow> v\<notin>y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>y \<lhd> x; x = insert v y\<rbrakk> \<Longrightarrow> v \<notin> y
[PROOF STEP]
using facetrel_def[of y x]
[PROOF STATE]
proof (prove)
using this:
y \<lhd> x \<equiv> \<exists>v. v \<notin> y \<and> x = insert v y

goal (1 subgoal):
 1. \<lbrakk>y \<lhd> x; x = insert v y\<rbrakk> \<Longrightarrow> v \<notin> y
[PROOF STEP]
by fastforce


[STATEMENT]
lemma ex1_poincare_line:
  assumes "u \<noteq> v" "u \<in> unit_disc" "v \<in> unit_disc"
  shows "\<exists>! l. is_poincare_line l \<and> u \<in> circline_set l \<and> v \<in> circline_set l"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>!l. is_poincare_line l \<and> u \<in> circline_set l \<and> v \<in> circline_set l
[PROOF STEP]
proof (rule ex1I)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. is_poincare_line ?a \<and> u \<in> circline_set ?a \<and> v \<in> circline_set ?a
 2. \<And>l. is_poincare_line l \<and> u \<in> circline_set l \<and> v \<in> circline_set l \<Longrightarrow> l = ?a
[PROOF STEP]
let ?l = "poincare_line u v"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. is_poincare_line ?a \<and> u \<in> circline_set ?a \<and> v \<in> circline_set ?a
 2. \<And>l. is_poincare_line l \<and> u \<in> circline_set l \<and> v \<in> circline_set l \<Longrightarrow> l = ?a
[PROOF STEP]
show "is_poincare_line ?l \<and> u \<in> circline_set ?l \<and> v \<in> circline_set ?l"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_poincare_line (poincare_line u v) \<and> u \<in> circline_set (poincare_line u v) \<and> v \<in> circline_set (poincare_line u v)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
u \<noteq> v
u \<in> unit_disc
v \<in> unit_disc

goal (1 subgoal):
 1. is_poincare_line (poincare_line u v) \<and> u \<in> circline_set (poincare_line u v) \<and> v \<in> circline_set (poincare_line u v)
[PROOF STEP]
unfolding circline_set_def
[PROOF STATE]
proof (prove)
using this:
u \<noteq> v
u \<in> unit_disc
v \<in> unit_disc

goal (1 subgoal):
 1. is_poincare_line (poincare_line u v) \<and> u \<in> Collect (on_circline (poincare_line u v)) \<and> v \<in> Collect (on_circline (poincare_line u v))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
is_poincare_line (poincare_line u v) \<and> u \<in> circline_set (poincare_line u v) \<and> v \<in> circline_set (poincare_line u v)

goal (1 subgoal):
 1. \<And>l. is_poincare_line l \<and> u \<in> circline_set l \<and> v \<in> circline_set l \<Longrightarrow> l = poincare_line u v
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>l. is_poincare_line l \<and> u \<in> circline_set l \<and> v \<in> circline_set l \<Longrightarrow> l = poincare_line u v
[PROOF STEP]
fix l
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>l. is_poincare_line l \<and> u \<in> circline_set l \<and> v \<in> circline_set l \<Longrightarrow> l = poincare_line u v
[PROOF STEP]
assume "is_poincare_line l \<and> u \<in> circline_set l \<and> v \<in> circline_set l"
[PROOF STATE]
proof (state)
this:
is_poincare_line l \<and> u \<in> circline_set l \<and> v \<in> circline_set l

goal (1 subgoal):
 1. \<And>l. is_poincare_line l \<and> u \<in> circline_set l \<and> v \<in> circline_set l \<Longrightarrow> l = poincare_line u v
[PROOF STEP]
thus "l = poincare_line u v"
[PROOF STATE]
proof (prove)
using this:
is_poincare_line l \<and> u \<in> circline_set l \<and> v \<in> circline_set l

goal (1 subgoal):
 1. l = poincare_line u v
[PROOF STEP]
using unique_poincare_line assms
[PROOF STATE]
proof (prove)
using this:
is_poincare_line l \<and> u \<in> circline_set l \<and> v \<in> circline_set l
\<lbrakk>?u \<noteq> ?v; ?u \<in> unit_disc; ?v \<in> unit_disc; ?u \<in> circline_set ?l; ?v \<in> circline_set ?l; is_poincare_line ?l\<rbrakk> \<Longrightarrow> ?l = poincare_line ?u ?v
u \<noteq> v
u \<in> unit_disc
v \<in> unit_disc

goal (1 subgoal):
 1. l = poincare_line u v
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
l = poincare_line u v

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma finite_elements: "finite A \<Longrightarrow> partition_on A P \<Longrightarrow> finite P"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite A; partition_on A P\<rbrakk> \<Longrightarrow> finite P
[PROOF STEP]
using partition_onD1[of A P]
[PROOF STATE]
proof (prove)
using this:
partition_on A P \<Longrightarrow> A = \<Union> P

goal (1 subgoal):
 1. \<lbrakk>finite A; partition_on A P\<rbrakk> \<Longrightarrow> finite P
[PROOF STEP]
by (simp add: finite_UnionD)


[STATEMENT]
lemma convergent_add_const_iff:
  "convergent (\<lambda>n. c + f n :: 'a::topological_ab_group_add) \<longleftrightarrow> convergent f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. convergent (\<lambda>n. c + f n) = convergent f
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. convergent (\<lambda>n. c + f n) \<Longrightarrow> convergent f
 2. convergent f \<Longrightarrow> convergent (\<lambda>n. c + f n)
[PROOF STEP]
assume "convergent (\<lambda>n. c + f n)"
[PROOF STATE]
proof (state)
this:
convergent (\<lambda>n. c + f n)

goal (2 subgoals):
 1. convergent (\<lambda>n. c + f n) \<Longrightarrow> convergent f
 2. convergent f \<Longrightarrow> convergent (\<lambda>n. c + f n)
[PROOF STEP]
from convergent_diff[OF this convergent_const[of c]]
[PROOF STATE]
proof (chain)
picking this:
convergent (\<lambda>n. c + f n - c)
[PROOF STEP]
show "convergent f"
[PROOF STATE]
proof (prove)
using this:
convergent (\<lambda>n. c + f n - c)

goal (1 subgoal):
 1. convergent f
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
convergent f

goal (1 subgoal):
 1. convergent f \<Longrightarrow> convergent (\<lambda>n. c + f n)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. convergent f \<Longrightarrow> convergent (\<lambda>n. c + f n)
[PROOF STEP]
assume "convergent f"
[PROOF STATE]
proof (state)
this:
convergent f

goal (1 subgoal):
 1. convergent f \<Longrightarrow> convergent (\<lambda>n. c + f n)
[PROOF STEP]
from convergent_add[OF convergent_const[of c] this]
[PROOF STATE]
proof (chain)
picking this:
convergent (\<lambda>n. c + f n)
[PROOF STEP]
show "convergent (\<lambda>n. c + f n)"
[PROOF STATE]
proof (prove)
using this:
convergent (\<lambda>n. c + f n)

goal (1 subgoal):
 1. convergent (\<lambda>n. c + f n)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
convergent (\<lambda>n. c + f n)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma to_vec_from_vec[simp]: "to_vec (from_vec M) = M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. to_vec (from_vec M) = M
[PROOF STEP]
by transfer (simp add: vec_eq_iff)


[STATEMENT]
lemma exponent_p_a_m_k_equation:
  fixes p :: nat
  assumes "0 < m" "0 < k" "p \<noteq> 0" "k < p^a"
    shows "multiplicity p (p^a * m - k) = multiplicity p (p^a - k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. multiplicity p (p ^ a * m - k) = multiplicity p (p ^ a - k)
[PROOF STEP]
proof (rule multiplicity_cong [OF iffI])
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>r. p ^ r dvd p ^ a * m - k \<Longrightarrow> p ^ r dvd p ^ a - k
 2. \<And>r. p ^ r dvd p ^ a - k \<Longrightarrow> p ^ r dvd p ^ a * m - k
[PROOF STEP]
fix r
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>r. p ^ r dvd p ^ a * m - k \<Longrightarrow> p ^ r dvd p ^ a - k
 2. \<And>r. p ^ r dvd p ^ a - k \<Longrightarrow> p ^ r dvd p ^ a * m - k
[PROOF STEP]
assume *: "p ^ r dvd p ^ a * m - k"
[PROOF STATE]
proof (state)
this:
p ^ r dvd p ^ a * m - k

goal (2 subgoals):
 1. \<And>r. p ^ r dvd p ^ a * m - k \<Longrightarrow> p ^ r dvd p ^ a - k
 2. \<And>r. p ^ r dvd p ^ a - k \<Longrightarrow> p ^ r dvd p ^ a * m - k
[PROOF STEP]
show "p ^ r dvd p ^ a - k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p ^ r dvd p ^ a - k
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. p ^ r dvd p ^ a - k
[PROOF STEP]
have "k \<le> p ^ a * m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. k \<le> p ^ a * m
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
0 < m
0 < k
p \<noteq> 0
k < p ^ a

goal (1 subgoal):
 1. k \<le> p ^ a * m
[PROOF STEP]
by (meson nat_dvd_not_less dvd_triv_left leI mult_pos_pos order.strict_trans)
[PROOF STATE]
proof (state)
this:
k \<le> p ^ a * m

goal (1 subgoal):
 1. p ^ r dvd p ^ a - k
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
k \<le> p ^ a * m
[PROOF STEP]
have "r \<le> a"
[PROOF STATE]
proof (prove)
using this:
k \<le> p ^ a * m

goal (1 subgoal):
 1. r \<le> a
[PROOF STEP]
by (meson "*" \<open>0 < k\<close> \<open>k < p^a\<close> dvd_diffD1 dvd_triv_left leI less_imp_le_nat nat_dvd_not_less power_le_dvd)
[PROOF STATE]
proof (state)
this:
r \<le> a

goal (1 subgoal):
 1. p ^ r dvd p ^ a - k
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
r \<le> a
[PROOF STEP]
have "p^r dvd p^a * m"
[PROOF STATE]
proof (prove)
using this:
r \<le> a

goal (1 subgoal):
 1. p ^ r dvd p ^ a * m
[PROOF STEP]
by (simp add: le_imp_power_dvd)
[PROOF STATE]
proof (state)
this:
p ^ r dvd p ^ a * m

goal (1 subgoal):
 1. p ^ r dvd p ^ a - k
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
p ^ r dvd p ^ a * m

goal (1 subgoal):
 1. p ^ r dvd p ^ a - k
[PROOF STEP]
by (meson \<open>k \<le> p ^ a * m\<close> \<open>r \<le> a\<close> * dvd_diffD1 dvd_diff_nat le_imp_power_dvd)
[PROOF STATE]
proof (state)
this:
p ^ r dvd p ^ a - k

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
p ^ r dvd p ^ a - k

goal (1 subgoal):
 1. \<And>r. p ^ r dvd p ^ a - k \<Longrightarrow> p ^ r dvd p ^ a * m - k
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>r. p ^ r dvd p ^ a - k \<Longrightarrow> p ^ r dvd p ^ a * m - k
[PROOF STEP]
fix r
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>r. p ^ r dvd p ^ a - k \<Longrightarrow> p ^ r dvd p ^ a * m - k
[PROOF STEP]
assume *: "p ^ r dvd p ^ a - k"
[PROOF STATE]
proof (state)
this:
p ^ r dvd p ^ a - k

goal (1 subgoal):
 1. \<And>r. p ^ r dvd p ^ a - k \<Longrightarrow> p ^ r dvd p ^ a * m - k
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
0 < m
0 < k
p \<noteq> 0
k < p ^ a
p ^ r dvd p ^ a - k
[PROOF STEP]
have "r \<le> a"
[PROOF STATE]
proof (prove)
using this:
0 < m
0 < k
p \<noteq> 0
k < p ^ a
p ^ r dvd p ^ a - k

goal (1 subgoal):
 1. r \<le> a
[PROOF STEP]
by (metis diff_diff_cancel less_imp_le_nat nat_dvd_not_less nat_le_linear power_le_dvd zero_less_diff)
[PROOF STATE]
proof (state)
this:
r \<le> a

goal (1 subgoal):
 1. \<And>r. p ^ r dvd p ^ a - k \<Longrightarrow> p ^ r dvd p ^ a * m - k
[PROOF STEP]
show "p ^ r dvd p ^ a * m - k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p ^ r dvd p ^ a * m - k
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. p ^ r dvd p ^ a * m - k
[PROOF STEP]
have "p^r dvd p^a*m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p ^ r dvd p ^ a * m
[PROOF STEP]
by (simp add: \<open>r \<le> a\<close> le_imp_power_dvd)
[PROOF STATE]
proof (state)
this:
p ^ r dvd p ^ a * m

goal (1 subgoal):
 1. p ^ r dvd p ^ a * m - k
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
p ^ r dvd p ^ a * m
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
p ^ r dvd p ^ a * m

goal (1 subgoal):
 1. p ^ r dvd p ^ a * m - k
[PROOF STEP]
by (meson assms * dvd_diffD1 dvd_diff_nat le_imp_power_dvd less_imp_le_nat \<open>r \<le> a\<close>)
[PROOF STATE]
proof (state)
this:
p ^ r dvd p ^ a * m - k

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
p ^ r dvd p ^ a * m - k

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma row_length_mat_to_cols_list [simp]:
  assumes "dim_col A > 0"
  shows "mult.row_length (mat_to_cols_list A) = dim_row A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mult.row_length (mat_to_cols_list A) = dim_row A
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. mult.row_length (mat_to_cols_list A) = dim_row A
[PROOF STEP]
have "mat_to_cols_list A \<noteq> []"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat_to_cols_list A \<noteq> []
[PROOF STEP]
by (simp add: assms)
[PROOF STATE]
proof (state)
this:
mat_to_cols_list A \<noteq> []

goal (1 subgoal):
 1. mult.row_length (mat_to_cols_list A) = dim_row A
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
mat_to_cols_list A \<noteq> []
[PROOF STEP]
have "mult.row_length (mat_to_cols_list A) = length (hd (mat_to_cols_list A))"
[PROOF STATE]
proof (prove)
using this:
mat_to_cols_list A \<noteq> []

goal (1 subgoal):
 1. mult.row_length (mat_to_cols_list A) = length (hd (mat_to_cols_list A))
[PROOF STEP]
using mult.row_length_def[of "1" "(*)"]
[PROOF STATE]
proof (prove)
using this:
mat_to_cols_list A \<noteq> []
Matrix_Tensor.mult (1::?'a1) (*) \<Longrightarrow> mult.row_length ?xs \<equiv> if ?xs = [] then 0 else length (hd ?xs)

goal (1 subgoal):
 1. mult.row_length (mat_to_cols_list A) = length (hd (mat_to_cols_list A))
[PROOF STEP]
by (simp add: \<open>\<And>xs. Matrix_Tensor.mult 1 (*) \<Longrightarrow> mult.row_length xs \<equiv> if xs = [] then 0 else length (hd xs)\<close> mult.intro)
[PROOF STATE]
proof (state)
this:
mult.row_length (mat_to_cols_list A) = length (hd (mat_to_cols_list A))

goal (1 subgoal):
 1. mult.row_length (mat_to_cols_list A) = dim_row A
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
mult.row_length (mat_to_cols_list A) = length (hd (mat_to_cols_list A))

goal (1 subgoal):
 1. mult.row_length (mat_to_cols_list A) = dim_row A
[PROOF STEP]
by (simp add: assms mat_to_cols_list_def upt_conv_Cons)
[PROOF STATE]
proof (state)
this:
mult.row_length (mat_to_cols_list A) = dim_row A

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma finite_cone_mono: assumes fin: "finite Ws"
  and Ws: "Ws \<subseteq> carrier_vec n"
  and sub: "Vs \<subseteq> Ws"
shows "finite_cone Vs \<subseteq> finite_cone Ws"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite_cone Vs \<subseteq> finite_cone Ws
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> finite_cone Vs \<Longrightarrow> x \<in> finite_cone Ws
[PROOF STEP]
fix b
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> finite_cone Vs \<Longrightarrow> x \<in> finite_cone Ws
[PROOF STEP]
assume "b \<in> finite_cone Vs"
[PROOF STATE]
proof (state)
this:
b \<in> finite_cone Vs

goal (1 subgoal):
 1. \<And>x. x \<in> finite_cone Vs \<Longrightarrow> x \<in> finite_cone Ws
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
b \<in> finite_cone Vs
[PROOF STEP]
obtain c where b: "b = lincomb c Vs" and c: "c ` Vs \<subseteq> {x. x \<ge> 0}"
[PROOF STATE]
proof (prove)
using this:
b \<in> finite_cone Vs

goal (1 subgoal):
 1. (\<And>c. \<lbrakk>b = lincomb c Vs; c ` Vs \<subseteq> {x. (0::'a) \<le> x}\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding finite_cone_def nonneg_lincomb_def
[PROOF STATE]
proof (prove)
using this:
b \<in> {b. \<exists>c. lincomb c (if finite Vs then Vs else {}) = b \<and> c ` (if finite Vs then Vs else {}) \<subseteq> Collect ((\<le>) (0::'a))}

goal (1 subgoal):
 1. (\<And>c. \<lbrakk>b = lincomb c Vs; c ` Vs \<subseteq> {x. (0::'a) \<le> x}\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using finite_subset[OF sub fin]
[PROOF STATE]
proof (prove)
using this:
b \<in> {b. \<exists>c. lincomb c (if finite Vs then Vs else {}) = b \<and> c ` (if finite Vs then Vs else {}) \<subseteq> Collect ((\<le>) (0::'a))}
finite Vs

goal (1 subgoal):
 1. (\<And>c. \<lbrakk>b = lincomb c Vs; c ` Vs \<subseteq> {x. (0::'a) \<le> x}\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
b = lincomb c Vs
c ` Vs \<subseteq> {x. (0::'a) \<le> x}

goal (1 subgoal):
 1. \<And>x. x \<in> finite_cone Vs \<Longrightarrow> x \<in> finite_cone Ws
[PROOF STEP]
define d where "d = (\<lambda> v. if v \<in> Vs then c v else 0)"
[PROOF STATE]
proof (state)
this:
d = (\<lambda>v. if v \<in> Vs then c v else (0::'a))

goal (1 subgoal):
 1. \<And>x. x \<in> finite_cone Vs \<Longrightarrow> x \<in> finite_cone Ws
[PROOF STEP]
from c
[PROOF STATE]
proof (chain)
picking this:
c ` Vs \<subseteq> {x. (0::'a) \<le> x}
[PROOF STEP]
have d: "d ` Ws \<subseteq> {x. x \<ge> 0}"
[PROOF STATE]
proof (prove)
using this:
c ` Vs \<subseteq> {x. (0::'a) \<le> x}

goal (1 subgoal):
 1. d ` Ws \<subseteq> {x. (0::'a) \<le> x}
[PROOF STEP]
unfolding d_def
[PROOF STATE]
proof (prove)
using this:
c ` Vs \<subseteq> {x. (0::'a) \<le> x}

goal (1 subgoal):
 1. (\<lambda>v. if v \<in> Vs then c v else (0::'a)) ` Ws \<subseteq> {x. (0::'a) \<le> x}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
d ` Ws \<subseteq> {x. (0::'a) \<le> x}

goal (1 subgoal):
 1. \<And>x. x \<in> finite_cone Vs \<Longrightarrow> x \<in> finite_cone Ws
[PROOF STEP]
have "lincomb d Ws = lincomb d (Ws - Vs) + lincomb d Vs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lincomb d Ws = lincomb d (Ws - Vs) + lincomb d Vs
[PROOF STEP]
by (rule lincomb_vec_diff_add[OF Ws sub fin], auto)
[PROOF STATE]
proof (state)
this:
lincomb d Ws = lincomb d (Ws - Vs) + lincomb d Vs

goal (1 subgoal):
 1. \<And>x. x \<in> finite_cone Vs \<Longrightarrow> x \<in> finite_cone Ws
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
lincomb d Ws = lincomb d (Ws - Vs) + lincomb d Vs

goal (1 subgoal):
 1. \<And>x. x \<in> finite_cone Vs \<Longrightarrow> x \<in> finite_cone Ws
[PROOF STEP]
have "lincomb d Vs = lincomb c Vs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lincomb d Vs = lincomb c Vs
[PROOF STEP]
by (rule lincomb_cong, insert Ws sub, auto simp: d_def)
[PROOF STATE]
proof (state)
this:
lincomb d Vs = lincomb c Vs

goal (1 subgoal):
 1. \<And>x. x \<in> finite_cone Vs \<Longrightarrow> x \<in> finite_cone Ws
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
lincomb d Vs = lincomb c Vs

goal (1 subgoal):
 1. \<And>x. x \<in> finite_cone Vs \<Longrightarrow> x \<in> finite_cone Ws
[PROOF STEP]
have "lincomb d (Ws - Vs) = 0\<^sub>v n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lincomb d (Ws - Vs) = 0\<^sub>v n
[PROOF STEP]
by (rule lincomb_zero, insert Ws sub, auto simp: d_def)
[PROOF STATE]
proof (state)
this:
lincomb d (Ws - Vs) = 0\<^sub>v n

goal (1 subgoal):
 1. \<And>x. x \<in> finite_cone Vs \<Longrightarrow> x \<in> finite_cone Ws
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
lincomb d (Ws - Vs) = 0\<^sub>v n

goal (1 subgoal):
 1. \<And>x. x \<in> finite_cone Vs \<Longrightarrow> x \<in> finite_cone Ws
[PROOF STEP]
have "0\<^sub>v n + lincomb c Vs = lincomb c Vs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0\<^sub>v n + lincomb c Vs = lincomb c Vs
[PROOF STEP]
using Ws sub
[PROOF STATE]
proof (prove)
using this:
Ws \<subseteq> carrier_vec n
Vs \<subseteq> Ws

goal (1 subgoal):
 1. 0\<^sub>v n + lincomb c Vs = lincomb c Vs
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0\<^sub>v n + lincomb c Vs = lincomb c Vs

goal (1 subgoal):
 1. \<And>x. x \<in> finite_cone Vs \<Longrightarrow> x \<in> finite_cone Ws
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
0\<^sub>v n + lincomb c Vs = lincomb c Vs

goal (1 subgoal):
 1. \<And>x. x \<in> finite_cone Vs \<Longrightarrow> x \<in> finite_cone Ws
[PROOF STEP]
have "\<dots> = b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lincomb c Vs = b
[PROOF STEP]
unfolding b
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lincomb c Vs = lincomb c Vs
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
lincomb c Vs = b

goal (1 subgoal):
 1. \<And>x. x \<in> finite_cone Vs \<Longrightarrow> x \<in> finite_cone Ws
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
lincomb d Ws = b
[PROOF STEP]
have "b = lincomb d Ws"
[PROOF STATE]
proof (prove)
using this:
lincomb d Ws = b

goal (1 subgoal):
 1. b = lincomb d Ws
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
b = lincomb d Ws

goal (1 subgoal):
 1. \<And>x. x \<in> finite_cone Vs \<Longrightarrow> x \<in> finite_cone Ws
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
b = lincomb d Ws
[PROOF STEP]
show "b \<in> finite_cone Ws"
[PROOF STATE]
proof (prove)
using this:
b = lincomb d Ws

goal (1 subgoal):
 1. b \<in> finite_cone Ws
[PROOF STEP]
using d fin
[PROOF STATE]
proof (prove)
using this:
b = lincomb d Ws
d ` Ws \<subseteq> {x. (0::'a) \<le> x}
finite Ws

goal (1 subgoal):
 1. b \<in> finite_cone Ws
[PROOF STEP]
unfolding finite_cone_def nonneg_lincomb_def
[PROOF STATE]
proof (prove)
using this:
b = lincomb d Ws
d ` Ws \<subseteq> {x. (0::'a) \<le> x}
finite Ws

goal (1 subgoal):
 1. b \<in> {b. \<exists>c. lincomb c (if finite Ws then Ws else {}) = b \<and> c ` (if finite Ws then Ws else {}) \<subseteq> Collect ((\<le>) (0::'a))}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
b \<in> finite_cone Ws

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma fls_const_nonzero: "c \<noteq> 0 \<Longrightarrow> fls_const c \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c \<noteq> (0::'a) \<Longrightarrow> fls_const c \<noteq> 0
[PROOF STEP]
using fls_nonzeroI[of "fls_const c" 0]
[PROOF STATE]
proof (prove)
using this:
fls_const c $$ 0 \<noteq> (0::'a) \<Longrightarrow> fls_const c \<noteq> 0

goal (1 subgoal):
 1. c \<noteq> (0::'a) \<Longrightarrow> fls_const c \<noteq> 0
[PROOF STEP]
by simp


[STATEMENT]
lemma ucast_range_less:
  "LENGTH('a :: len) < LENGTH('b :: len) \<Longrightarrow>
   range (ucast :: 'a word \<Rightarrow> 'b word) = {x. x < 2 ^ len_of TYPE ('a)}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. LENGTH('a) < LENGTH('b) \<Longrightarrow> range ucast = {x. x < 2 ^ LENGTH('a)}
[PROOF STEP]
apply safe
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x xa. \<lbrakk>LENGTH('a) < LENGTH('b); xa \<in> UNIV\<rbrakk> \<Longrightarrow> ucast xa < 2 ^ LENGTH('a)
 2. \<And>x. \<lbrakk>LENGTH('a) < LENGTH('b); x < 2 ^ LENGTH('a)\<rbrakk> \<Longrightarrow> x \<in> range ucast
[PROOF STEP]
apply (erule ucast_less)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>LENGTH('a) < LENGTH('b); x < 2 ^ LENGTH('a)\<rbrakk> \<Longrightarrow> x \<in> range ucast
[PROOF STEP]
apply (simp add: image_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>LENGTH('a) < LENGTH('b); x < 2 ^ LENGTH('a)\<rbrakk> \<Longrightarrow> \<exists>xa. x = ucast xa
[PROOF STEP]
apply (rule_tac x="ucast x" in exI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>LENGTH('a) < LENGTH('b); x < 2 ^ LENGTH('a)\<rbrakk> \<Longrightarrow> x = ucast (ucast x)
[PROOF STEP]
apply (rule bit_word_eqI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x n. \<lbrakk>LENGTH('a) < LENGTH('b); x < 2 ^ LENGTH('a); n < LENGTH('b)\<rbrakk> \<Longrightarrow> bit x n = bit (ucast (ucast x)) n
[PROOF STEP]
apply (auto simp add: bit_simps)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x n. \<lbrakk>LENGTH('a) < LENGTH('b); x < 2 ^ LENGTH('a); n < LENGTH('b); bit x n\<rbrakk> \<Longrightarrow> n < LENGTH('a)
[PROOF STEP]
apply (metis bit_take_bit_iff take_bit_word_eq_self_iff)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma One_not_eq_j0 [simp]:
    shows "One \<noteq> j0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. One \<noteq> j0
[PROOF STEP]
using One_def j0_def One_not_eq_fromArr
[PROOF STATE]
proof (prove)
using this:
One \<equiv> MkIde True
j0 \<equiv> fromArr False
One \<notin> fromArr ` {False, True}

goal (1 subgoal):
 1. One \<noteq> j0
[PROOF STEP]
by auto


[STATEMENT]
lemma poincare_on_ray_poincare_collinear:
  assumes "p \<in> unit_disc" and "a \<in> unit_disc" and "b \<in> unit_disc" and "poincare_on_ray p a b"
  shows "poincare_collinear {p, a, b}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poincare_collinear {p, a, b}
[PROOF STEP]
using assms poincare_between_poincare_collinear
[PROOF STATE]
proof (prove)
using this:
p \<in> unit_disc
a \<in> unit_disc
b \<in> unit_disc
poincare_on_ray p a b
\<lbrakk>?u \<in> unit_disc; ?v \<in> unit_disc; ?w \<in> unit_disc; poincare_between ?u ?v ?w\<rbrakk> \<Longrightarrow> poincare_collinear {?u, ?v, ?w}

goal (1 subgoal):
 1. poincare_collinear {p, a, b}
[PROOF STEP]
unfolding poincare_on_ray_def
[PROOF STATE]
proof (prove)
using this:
p \<in> unit_disc
a \<in> unit_disc
b \<in> unit_disc
poincare_between a p b \<or> poincare_between a b p
\<lbrakk>?u \<in> unit_disc; ?v \<in> unit_disc; ?w \<in> unit_disc; poincare_between ?u ?v ?w\<rbrakk> \<Longrightarrow> poincare_collinear {?u, ?v, ?w}

goal (1 subgoal):
 1. poincare_collinear {p, a, b}
[PROOF STEP]
by (metis insert_commute)


[STATEMENT]
lemma locate_unique:
assumes "\<And> a. a \<in> set al \<Longrightarrow> 0 < f a"
and "n < length al" and "j < f (al ! n)" and "i = lsum f (take n al) + j"
shows "n = locate1 f al i \<and> j = locate2 f al i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n = locate1 f al i \<and> j = locate2 f al i
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. n = locate1 f al i \<and> j = locate2 f al i
[PROOF STEP]
define n_j where "n_j = (n,j)"
[PROOF STATE]
proof (state)
this:
n_j = (n, j)

goal (1 subgoal):
 1. n = locate1 f al i \<and> j = locate2 f al i
[PROOF STEP]
have "locate_pred f al i n_j"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. locate_pred f al i n_j
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
?a \<in> set al \<Longrightarrow> 0 < f ?a
n < length al
j < f (al ! n)
i = lsum f (take n al) + j

goal (1 subgoal):
 1. locate_pred f al i n_j
[PROOF STEP]
unfolding n_j_def locate_pred_def
[PROOF STATE]
proof (prove)
using this:
?a \<in> set al \<Longrightarrow> 0 < f ?a
n < length al
j < f (al ! n)
i = lsum f (take n al) + j

goal (1 subgoal):
 1. fst (n, j) < length al \<and> snd (n, j) < f (al ! fst (n, j)) \<and> i = lsum f (take (fst (n, j)) al) + snd (n, j)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
locate_pred f al i n_j

goal (1 subgoal):
 1. n = locate1 f al i \<and> j = locate2 f al i
[PROOF STEP]
hence "n_j = locate f al i"
[PROOF STATE]
proof (prove)
using this:
locate_pred f al i n_j

goal (1 subgoal):
 1. n_j = locate f al i
[PROOF STEP]
using assms locate_locate_pred_unique
[PROOF STATE]
proof (prove)
using this:
locate_pred f al i n_j
?a \<in> set al \<Longrightarrow> 0 < f ?a
n < length al
j < f (al ! n)
i = lsum f (take n al) + j
\<lbrakk>\<And>a. a \<in> set ?al \<Longrightarrow> 0 < ?f a; locate_pred ?f ?al ?i ?n_j\<rbrakk> \<Longrightarrow> ?n_j = locate ?f ?al ?i

goal (1 subgoal):
 1. n_j = locate f al i
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
n_j = locate f al i

goal (1 subgoal):
 1. n = locate1 f al i \<and> j = locate2 f al i
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
n_j = locate f al i

goal (1 subgoal):
 1. n = locate1 f al i \<and> j = locate2 f al i
[PROOF STEP]
unfolding n_j_def locate1_def locate2_def
[PROOF STATE]
proof (prove)
using this:
(n, j) = locate f al i

goal (1 subgoal):
 1. n = fst (locate f al i) \<and> j = snd (locate f al i)
[PROOF STEP]
by (metis fst_conv n_j_def snd_conv)
[PROOF STATE]
proof (state)
this:
n = locate1 f al i \<and> j = locate2 f al i

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma max_lpI [intro]:
  assumes "[A *\<^sub>v x]\<le>b"
  assumes "(\<And>y. [A *\<^sub>v y]\<le>b \<Longrightarrow> (\<lambda>x y. (y \<bullet> c) \<ge> (x \<bullet> c)) y x)"
  shows "x \<in> max_lp A b c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> max_lp A b c
[PROOF STEP]
using optimal_setI[of x "{ x. [A *\<^sub>v x]\<le>b }" c]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>x \<in> {x. [A*\<^sub>vx]\<le>b}; \<And>y. y \<in> {x. [A*\<^sub>vx]\<le>b} \<Longrightarrow> x \<bullet> c \<le> y \<bullet> c\<rbrakk> \<Longrightarrow> x \<in> optimal_set (\<lambda>x y. x \<bullet> c \<le> y \<bullet> c) {x. [A*\<^sub>vx]\<le>b}

goal (1 subgoal):
 1. x \<in> max_lp A b c
[PROOF STEP]
unfolding optimal_set_def optimal_setI
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>x \<in> {x. [A*\<^sub>vx]\<le>b}; \<And>y. y \<in> {x. [A*\<^sub>vx]\<le>b} \<Longrightarrow> x \<bullet> c \<le> y \<bullet> c\<rbrakk> \<Longrightarrow> x \<in> {x \<in> {x. [A*\<^sub>vx]\<le>b}. \<forall>y\<in>{x. [A*\<^sub>vx]\<le>b}. x \<bullet> c \<le> y \<bullet> c}

goal (1 subgoal):
 1. x \<in> {x \<in> sat_primal A b. \<forall>y\<in>sat_primal A b. y \<bullet> c \<le> x \<bullet> c}
[PROOF STEP]
by (simp add: assms(1) assms(2) sat_primal_def)


[STATEMENT]
lemma linord_of_list_linord_of_listP:
  shows "xy \<in> linord_of_list xs \<longleftrightarrow> linord_of_listP (fst xy) (snd xy) xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (xy \<in> linord_of_list xs) = linord_of_listP (fst xy) (snd xy) xs
[PROOF STEP]
unfolding linord_of_list_def split_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (xy \<in> {p. linord_of_listP (fst p) (snd p) xs}) = linord_of_listP (fst xy) (snd xy) xs
[PROOF STEP]
by simp


[STATEMENT]
lemma ModPonP_subst [simp]:
  "(ModPonP t u v)(i::=w) = ModPonP (subst i w t) (subst i w u) (subst i w v)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (ModPonP t u v)(i::=w) = ModPonP (subst i w t) (subst i w u) (subst i w v)
[PROOF STEP]
by (auto simp: ModPonP_def)


[STATEMENT]
lemma char_to_digit_div_mod [simp]:
assumes is_digit: "is_digit_char c"
shows "char_to_digit c < 10"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. char_to_digit c < 10
[PROOF STEP]
using is_digit
[PROOF STATE]
proof (prove)
using this:
is_digit_char c

goal (1 subgoal):
 1. char_to_digit c < 10
[PROOF STEP]
unfolding char_to_digit_def is_digit_char_def
[PROOF STATE]
proof (prove)
using this:
c = CHR ''0'' \<or> c = CHR ''5'' \<or> c = CHR ''1'' \<or> c = CHR ''6'' \<or> c = CHR ''2'' \<or> c = CHR ''7'' \<or> c = CHR ''3'' \<or> c = CHR ''8'' \<or> c = CHR ''4'' \<or> c = CHR ''9''

goal (1 subgoal):
 1. (if c = CHR ''0'' then 0 else if c = CHR ''1'' then 1 else if c = CHR ''2'' then 2 else if c = CHR ''3'' then 3 else if c = CHR ''4'' then 4 else if c = CHR ''5'' then 5 else if c = CHR ''6'' then 6 else if c = CHR ''7'' then 7 else if c = CHR ''8'' then 8 else if c = CHR ''9'' then 9 else 10) < 10
[PROOF STEP]
by auto


[STATEMENT]
lemma in_set_drop_conv_nth: "x\<in>set (drop n l) \<longleftrightarrow> (\<exists>i. n\<le>i \<and> i<length l \<and> x = l!i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<in> set (drop n l)) = (\<exists>i\<ge>n. i < length l \<and> x = l ! i)
[PROOF STEP]
apply (clarsimp simp: in_set_conv_nth)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>i<length l - n. drop n l ! i = x) = (\<exists>i\<ge>n. i < length l \<and> x = l ! i)
[PROOF STEP]
apply safe
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>i. \<lbrakk>i < length l - n; x = drop n l ! i\<rbrakk> \<Longrightarrow> \<exists>ia\<ge>n. ia < length l \<and> drop n l ! i = l ! ia
 2. \<And>i. \<lbrakk>n \<le> i; i < length l; x = l ! i\<rbrakk> \<Longrightarrow> \<exists>ia<length l - n. drop n l ! ia = l ! i
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>i. \<lbrakk>i < length l - n; x = l ! (n + i)\<rbrakk> \<Longrightarrow> \<exists>ia\<ge>n. ia < length l \<and> l ! (n + i) = l ! ia
 2. \<And>i. \<lbrakk>n \<le> i; i < length l; x = l ! i\<rbrakk> \<Longrightarrow> \<exists>ia<length l - n. drop n l ! ia = l ! i
[PROOF STEP]
apply (metis le_add2 less_diff_conv add.commute)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i. \<lbrakk>n \<le> i; i < length l; x = l ! i\<rbrakk> \<Longrightarrow> \<exists>ia<length l - n. drop n l ! ia = l ! i
[PROOF STEP]
apply (rule_tac x="i-n" in exI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i. \<lbrakk>n \<le> i; i < length l; x = l ! i\<rbrakk> \<Longrightarrow> i - n < length l - n \<and> drop n l ! (i - n) = l ! i
[PROOF STEP]
apply auto []
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma has_field_derivative_series':
  fixes f :: "nat \<Rightarrow> ('a :: {real_normed_field,banach}) \<Rightarrow> 'a"
  assumes "convex S"
  assumes "\<And>n x. x \<in> S \<Longrightarrow> (f n has_field_derivative f' n x) (at x within S)"
  assumes "uniformly_convergent_on S (\<lambda>n x. \<Sum>i<n. f' i x)"
  assumes "x0 \<in> S" "summable (\<lambda>n. f n x0)" "x \<in> interior S"
  shows   "summable (\<lambda>n. f n x)" "((\<lambda>x. \<Sum>n. f n x) has_field_derivative (\<Sum>n. f' n x)) (at x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. summable (\<lambda>n. f n x) &&& ((\<lambda>x. \<Sum>n. f n x) has_field_derivative (\<Sum>n. f' n x)) (at x)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. summable (\<lambda>n. f n x)
 2. ((\<lambda>x. \<Sum>n. f n x) has_field_derivative (\<Sum>n. f' n x)) (at x)
[PROOF STEP]
from \<open>x \<in> interior S\<close>
[PROOF STATE]
proof (chain)
picking this:
x \<in> interior S
[PROOF STEP]
have "x \<in> S"
[PROOF STATE]
proof (prove)
using this:
x \<in> interior S

goal (1 subgoal):
 1. x \<in> S
[PROOF STEP]
using interior_subset
[PROOF STATE]
proof (prove)
using this:
x \<in> interior S
interior ?S \<subseteq> ?S

goal (1 subgoal):
 1. x \<in> S
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
x \<in> S

goal (2 subgoals):
 1. summable (\<lambda>n. f n x)
 2. ((\<lambda>x. \<Sum>n. f n x) has_field_derivative (\<Sum>n. f' n x)) (at x)
[PROOF STEP]
define g' where [abs_def]: "g' x = (\<Sum>i. f' i x)" for x
[PROOF STATE]
proof (state)
this:
g' \<equiv> \<lambda>x. \<Sum>i. f' i x

goal (2 subgoals):
 1. summable (\<lambda>n. f n x)
 2. ((\<lambda>x. \<Sum>n. f n x) has_field_derivative (\<Sum>n. f' n x)) (at x)
[PROOF STEP]
from assms(3)
[PROOF STATE]
proof (chain)
picking this:
uniformly_convergent_on S (\<lambda>n x. \<Sum>i<n. f' i x)
[PROOF STEP]
have "uniform_limit S (\<lambda>n x. \<Sum>i<n. f' i x) g' sequentially"
[PROOF STATE]
proof (prove)
using this:
uniformly_convergent_on S (\<lambda>n x. \<Sum>i<n. f' i x)

goal (1 subgoal):
 1. uniform_limit S (\<lambda>n x. \<Sum>i<n. f' i x) g' sequentially
[PROOF STEP]
by (simp add: uniformly_convergent_uniform_limit_iff suminf_eq_lim g'_def)
[PROOF STATE]
proof (state)
this:
uniform_limit S (\<lambda>n x. \<Sum>i<n. f' i x) g' sequentially

goal (2 subgoals):
 1. summable (\<lambda>n. f n x)
 2. ((\<lambda>x. \<Sum>n. f n x) has_field_derivative (\<Sum>n. f' n x)) (at x)
[PROOF STEP]
from has_field_derivative_series[OF assms(1,2) this assms(4,5)]
[PROOF STATE]
proof (chain)
picking this:
(\<And>n x. x \<in> S \<Longrightarrow> x \<in> S) \<Longrightarrow> \<exists>g. \<forall>x\<in>S. (\<lambda>n. f n x) sums g x \<and> (g has_field_derivative g' x) (at x within S)
[PROOF STEP]
obtain g where g:
    "\<And>x. x \<in> S \<Longrightarrow> (\<lambda>n. f n x) sums g x"
    "\<And>x. x \<in> S \<Longrightarrow> (g has_field_derivative g' x) (at x within S)"
[PROOF STATE]
proof (prove)
using this:
(\<And>n x. x \<in> S \<Longrightarrow> x \<in> S) \<Longrightarrow> \<exists>g. \<forall>x\<in>S. (\<lambda>n. f n x) sums g x \<and> (g has_field_derivative g' x) (at x within S)

goal (1 subgoal):
 1. (\<And>g. \<lbrakk>\<And>x. x \<in> S \<Longrightarrow> (\<lambda>n. f n x) sums g x; \<And>x. x \<in> S \<Longrightarrow> (g has_field_derivative g' x) (at x within S)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
?x \<in> S \<Longrightarrow> (\<lambda>n. f n ?x) sums g ?x
?x \<in> S \<Longrightarrow> (g has_field_derivative g' ?x) (at ?x within S)

goal (2 subgoals):
 1. summable (\<lambda>n. f n x)
 2. ((\<lambda>x. \<Sum>n. f n x) has_field_derivative (\<Sum>n. f' n x)) (at x)
[PROOF STEP]
from g(1)[OF \<open>x \<in> S\<close>]
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>n. f n x) sums g x
[PROOF STEP]
show "summable (\<lambda>n. f n x)"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. f n x) sums g x

goal (1 subgoal):
 1. summable (\<lambda>n. f n x)
[PROOF STEP]
by (simp add: sums_iff)
[PROOF STATE]
proof (state)
this:
summable (\<lambda>n. f n x)

goal (1 subgoal):
 1. ((\<lambda>x. \<Sum>n. f n x) has_field_derivative (\<Sum>n. f' n x)) (at x)
[PROOF STEP]
from g(2)[OF \<open>x \<in> S\<close>] \<open>x \<in> interior S\<close>
[PROOF STATE]
proof (chain)
picking this:
(g has_field_derivative g' x) (at x within S)
x \<in> interior S
[PROOF STEP]
have "(g has_field_derivative g' x) (at x)"
[PROOF STATE]
proof (prove)
using this:
(g has_field_derivative g' x) (at x within S)
x \<in> interior S

goal (1 subgoal):
 1. (g has_field_derivative g' x) (at x)
[PROOF STEP]
by (simp add: at_within_interior[of x S])
[PROOF STATE]
proof (state)
this:
(g has_field_derivative g' x) (at x)

goal (1 subgoal):
 1. ((\<lambda>x. \<Sum>n. f n x) has_field_derivative (\<Sum>n. f' n x)) (at x)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(g has_field_derivative g' x) (at x)

goal (1 subgoal):
 1. ((\<lambda>x. \<Sum>n. f n x) has_field_derivative (\<Sum>n. f' n x)) (at x)
[PROOF STEP]
have "(g has_field_derivative g' x) (at x) \<longleftrightarrow>
                ((\<lambda>x. \<Sum>n. f n x) has_field_derivative g' x) (at x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (g has_field_derivative g' x) (at x) = ((\<lambda>x. \<Sum>n. f n x) has_field_derivative g' x) (at x)
[PROOF STEP]
using eventually_nhds_in_nhd[OF \<open>x \<in> interior S\<close>] interior_subset[of S] g(1)
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F y in nhds x. y \<in> S
interior S \<subseteq> S
?x \<in> S \<Longrightarrow> (\<lambda>n. f n ?x) sums g ?x

goal (1 subgoal):
 1. (g has_field_derivative g' x) (at x) = ((\<lambda>x. \<Sum>n. f n x) has_field_derivative g' x) (at x)
[PROOF STEP]
by (intro DERIV_cong_ev) (auto elim!: eventually_mono simp: sums_iff)
[PROOF STATE]
proof (state)
this:
(g has_field_derivative g' x) (at x) = ((\<lambda>x. \<Sum>n. f n x) has_field_derivative g' x) (at x)

goal (1 subgoal):
 1. ((\<lambda>x. \<Sum>n. f n x) has_field_derivative (\<Sum>n. f' n x)) (at x)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
((\<lambda>x. \<Sum>n. f n x) has_field_derivative g' x) (at x)
[PROOF STEP]
show "((\<lambda>x. \<Sum>n. f n x) has_field_derivative g' x) (at x)"
[PROOF STATE]
proof (prove)
using this:
((\<lambda>x. \<Sum>n. f n x) has_field_derivative g' x) (at x)

goal (1 subgoal):
 1. ((\<lambda>x. \<Sum>n. f n x) has_field_derivative g' x) (at x)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
((\<lambda>x. \<Sum>n. f n x) has_field_derivative g' x) (at x)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma sorted_pprt_spvec: "sorted_spvec v \<Longrightarrow> sorted_spvec (pprt_spvec v)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sorted_spvec v \<Longrightarrow> sorted_spvec (pprt_spvec v)
[PROOF STEP]
apply (induct v)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. sorted_spvec [] \<Longrightarrow> sorted_spvec (pprt_spvec [])
 2. \<And>a v. \<lbrakk>sorted_spvec v \<Longrightarrow> sorted_spvec (pprt_spvec v); sorted_spvec (a # v)\<rbrakk> \<Longrightarrow> sorted_spvec (pprt_spvec (a # v))
[PROOF STEP]
apply (simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a v. \<lbrakk>sorted_spvec v \<Longrightarrow> sorted_spvec (pprt_spvec v); sorted_spvec (a # v)\<rbrakk> \<Longrightarrow> sorted_spvec (pprt_spvec (a # v))
[PROOF STEP]
apply (frule sorted_spvec_cons1)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a v. \<lbrakk>sorted_spvec v \<Longrightarrow> sorted_spvec (pprt_spvec v); sorted_spvec (a # v); sorted_spvec v\<rbrakk> \<Longrightarrow> sorted_spvec (pprt_spvec (a # v))
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a v. \<lbrakk>sorted_spvec (pprt_spvec v); sorted_spvec (a # v); sorted_spvec v\<rbrakk> \<Longrightarrow> sorted_spvec ((fst a, pprt (snd a)) # pprt_spvec v)
[PROOF STEP]
apply (simp add: sorted_spvec.simps split:list.split_asm)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma extendEquivalentFormulaWithEntailedClause:
  fixes formula1 :: Formula and formula2 :: Formula and clause :: Clause
  assumes "equivalentFormulae formula1 formula2" and "formulaEntailsClause formula2 clause"
  shows "equivalentFormulae formula1 (formula2 @ [clause])"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. equivalentFormulae formula1 (formula2 @ [clause])
[PROOF STEP]
unfolding equivalentFormulae_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>valuation. model valuation formula1 = model valuation (formula2 @ [clause])
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>valuation. model valuation formula1 = model valuation (formula2 @ [clause])
[PROOF STEP]
fix valuation :: Valuation
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>valuation. model valuation formula1 = model valuation (formula2 @ [clause])
[PROOF STEP]
show "model valuation formula1 = model valuation (formula2 @ [clause])"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. model valuation formula1 = model valuation (formula2 @ [clause])
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. model valuation formula1 \<Longrightarrow> model valuation (formula2 @ [clause])
 2. model valuation (formula2 @ [clause]) \<Longrightarrow> model valuation formula1
[PROOF STEP]
assume "model valuation formula1"
[PROOF STATE]
proof (state)
this:
model valuation formula1

goal (2 subgoals):
 1. model valuation formula1 \<Longrightarrow> model valuation (formula2 @ [clause])
 2. model valuation (formula2 @ [clause]) \<Longrightarrow> model valuation formula1
[PROOF STEP]
hence "consistent valuation"
[PROOF STATE]
proof (prove)
using this:
model valuation formula1

goal (1 subgoal):
 1. consistent valuation
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
consistent valuation

goal (2 subgoals):
 1. model valuation formula1 \<Longrightarrow> model valuation (formula2 @ [clause])
 2. model valuation (formula2 @ [clause]) \<Longrightarrow> model valuation formula1
[PROOF STEP]
from \<open>model valuation formula1\<close> \<open>equivalentFormulae formula1 formula2\<close>
[PROOF STATE]
proof (chain)
picking this:
model valuation formula1
equivalentFormulae formula1 formula2
[PROOF STEP]
have "model valuation formula2"
[PROOF STATE]
proof (prove)
using this:
model valuation formula1
equivalentFormulae formula1 formula2

goal (1 subgoal):
 1. model valuation formula2
[PROOF STEP]
unfolding equivalentFormulae_def
[PROOF STATE]
proof (prove)
using this:
model valuation formula1
\<forall>valuation. model valuation formula1 = model valuation formula2

goal (1 subgoal):
 1. model valuation formula2
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
model valuation formula2

goal (2 subgoals):
 1. model valuation formula1 \<Longrightarrow> model valuation (formula2 @ [clause])
 2. model valuation (formula2 @ [clause]) \<Longrightarrow> model valuation formula1
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
model valuation formula2

goal (2 subgoals):
 1. model valuation formula1 \<Longrightarrow> model valuation (formula2 @ [clause])
 2. model valuation (formula2 @ [clause]) \<Longrightarrow> model valuation formula1
[PROOF STEP]
from \<open>model valuation formula2\<close> \<open>formulaEntailsClause formula2 clause\<close>
[PROOF STATE]
proof (chain)
picking this:
model valuation formula2
formulaEntailsClause formula2 clause
[PROOF STEP]
have "clauseTrue clause valuation"
[PROOF STATE]
proof (prove)
using this:
model valuation formula2
formulaEntailsClause formula2 clause

goal (1 subgoal):
 1. clauseTrue clause valuation
[PROOF STEP]
unfolding formulaEntailsClause_def
[PROOF STATE]
proof (prove)
using this:
model valuation formula2
\<forall>valuation. model valuation formula2 \<longrightarrow> model valuation clause

goal (1 subgoal):
 1. clauseTrue clause valuation
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
clauseTrue clause valuation

goal (2 subgoals):
 1. model valuation formula1 \<Longrightarrow> model valuation (formula2 @ [clause])
 2. model valuation (formula2 @ [clause]) \<Longrightarrow> model valuation formula1
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
model valuation formula2
clauseTrue clause valuation
[PROOF STEP]
show
      "model valuation (formula2 @ [clause])"
[PROOF STATE]
proof (prove)
using this:
model valuation formula2
clauseTrue clause valuation

goal (1 subgoal):
 1. model valuation (formula2 @ [clause])
[PROOF STEP]
by (simp add: formulaTrueAppend)
[PROOF STATE]
proof (state)
this:
model valuation (formula2 @ [clause])

goal (1 subgoal):
 1. model valuation (formula2 @ [clause]) \<Longrightarrow> model valuation formula1
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. model valuation (formula2 @ [clause]) \<Longrightarrow> model valuation formula1
[PROOF STEP]
assume "model valuation (formula2 @ [clause])"
[PROOF STATE]
proof (state)
this:
model valuation (formula2 @ [clause])

goal (1 subgoal):
 1. model valuation (formula2 @ [clause]) \<Longrightarrow> model valuation formula1
[PROOF STEP]
hence "consistent valuation"
[PROOF STATE]
proof (prove)
using this:
model valuation (formula2 @ [clause])

goal (1 subgoal):
 1. consistent valuation
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
consistent valuation

goal (1 subgoal):
 1. model valuation (formula2 @ [clause]) \<Longrightarrow> model valuation formula1
[PROOF STEP]
from \<open>model valuation (formula2 @ [clause])\<close>
[PROOF STATE]
proof (chain)
picking this:
model valuation (formula2 @ [clause])
[PROOF STEP]
have "model valuation formula2"
[PROOF STATE]
proof (prove)
using this:
model valuation (formula2 @ [clause])

goal (1 subgoal):
 1. model valuation formula2
[PROOF STEP]
by (simp add:formulaTrueAppend)
[PROOF STATE]
proof (state)
this:
model valuation formula2

goal (1 subgoal):
 1. model valuation (formula2 @ [clause]) \<Longrightarrow> model valuation formula1
[PROOF STEP]
with \<open>equivalentFormulae formula1 formula2\<close>
[PROOF STATE]
proof (chain)
picking this:
equivalentFormulae formula1 formula2
model valuation formula2
[PROOF STEP]
show "model valuation formula1"
[PROOF STATE]
proof (prove)
using this:
equivalentFormulae formula1 formula2
model valuation formula2

goal (1 subgoal):
 1. model valuation formula1
[PROOF STEP]
unfolding equivalentFormulae_def
[PROOF STATE]
proof (prove)
using this:
\<forall>valuation. model valuation formula1 = model valuation formula2
model valuation formula2

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
model valuation formula1 = model valuation (formula2 @ [clause])

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma add_perm_eqvt [eqvt]:
  fixes p p1 p2 :: perm
  shows "p \<bullet> (p1 + p2) = p \<bullet> p1 + p \<bullet> p2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p \<bullet> (p1 + p2) = p \<bullet> p1 + p \<bullet> p2
[PROOF STEP]
unfolding permute_perm_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p + (p1 + p2) - p = p + p1 - p + (p + p2 - p)
[PROOF STEP]
by (simp add: perm_eq_iff)


[STATEMENT]
lemma irreducible_multD:
  assumes l: "irreducible (a*b)"
  shows "a dvd 1 \<and> irreducible b \<or> b dvd 1 \<and> irreducible a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a dvd (1::'a) \<and> irreducible b \<or> b dvd (1::'a) \<and> irreducible a
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. a dvd (1::'a) \<and> irreducible b \<or> b dvd (1::'a) \<and> irreducible a
[PROOF STEP]
from l
[PROOF STATE]
proof (chain)
picking this:
irreducible (a * b)
[PROOF STEP]
have "a dvd 1 \<or> b dvd 1"
[PROOF STATE]
proof (prove)
using this:
irreducible (a * b)

goal (1 subgoal):
 1. a dvd (1::'a) \<or> b dvd (1::'a)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
a dvd (1::'a) \<or> b dvd (1::'a)

goal (1 subgoal):
 1. a dvd (1::'a) \<and> irreducible b \<or> b dvd (1::'a) \<and> irreducible a
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a dvd (1::'a) \<or> b dvd (1::'a)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
a dvd (1::'a) \<or> b dvd (1::'a)

goal (1 subgoal):
 1. a dvd (1::'a) \<and> irreducible b \<or> b dvd (1::'a) \<and> irreducible a
[PROOF STEP]
proof(elim disjE)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. a dvd (1::'a) \<Longrightarrow> a dvd (1::'a) \<and> irreducible b \<or> b dvd (1::'a) \<and> irreducible a
 2. b dvd (1::'a) \<Longrightarrow> a dvd (1::'a) \<and> irreducible b \<or> b dvd (1::'a) \<and> irreducible a
[PROOF STEP]
assume a: "a dvd 1"
[PROOF STATE]
proof (state)
this:
a dvd (1::'a)

goal (2 subgoals):
 1. a dvd (1::'a) \<Longrightarrow> a dvd (1::'a) \<and> irreducible b \<or> b dvd (1::'a) \<and> irreducible a
 2. b dvd (1::'a) \<Longrightarrow> a dvd (1::'a) \<and> irreducible b \<or> b dvd (1::'a) \<and> irreducible a
[PROOF STEP]
with l
[PROOF STATE]
proof (chain)
picking this:
irreducible (a * b)
a dvd (1::'a)
[PROOF STEP]
have "irreducible b"
[PROOF STATE]
proof (prove)
using this:
irreducible (a * b)
a dvd (1::'a)

goal (1 subgoal):
 1. irreducible b
[PROOF STEP]
unfolding irreducible_def
[PROOF STATE]
proof (prove)
using this:
a * b \<noteq> (0::'a) \<and> \<not> a * b dvd (1::'a) \<and> (\<forall>aa ba. a * b = aa * ba \<longrightarrow> aa dvd (1::'a) \<or> ba dvd (1::'a))
a dvd (1::'a)

goal (1 subgoal):
 1. b \<noteq> (0::'a) \<and> \<not> b dvd (1::'a) \<and> (\<forall>a ba. b = a * ba \<longrightarrow> a dvd (1::'a) \<or> ba dvd (1::'a))
[PROOF STEP]
by (meson is_unit_mult_iff mult.left_commute mult_not_zero)
[PROOF STATE]
proof (state)
this:
irreducible b

goal (2 subgoals):
 1. a dvd (1::'a) \<Longrightarrow> a dvd (1::'a) \<and> irreducible b \<or> b dvd (1::'a) \<and> irreducible a
 2. b dvd (1::'a) \<Longrightarrow> a dvd (1::'a) \<and> irreducible b \<or> b dvd (1::'a) \<and> irreducible a
[PROOF STEP]
with a
[PROOF STATE]
proof (chain)
picking this:
a dvd (1::'a)
irreducible b
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
a dvd (1::'a)
irreducible b

goal (1 subgoal):
 1. a dvd (1::'a) \<and> irreducible b \<or> b dvd (1::'a) \<and> irreducible a
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
a dvd (1::'a) \<and> irreducible b \<or> b dvd (1::'a) \<and> irreducible a

goal (1 subgoal):
 1. b dvd (1::'a) \<Longrightarrow> a dvd (1::'a) \<and> irreducible b \<or> b dvd (1::'a) \<and> irreducible a
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. b dvd (1::'a) \<Longrightarrow> a dvd (1::'a) \<and> irreducible b \<or> b dvd (1::'a) \<and> irreducible a
[PROOF STEP]
assume a: "b dvd 1"
[PROOF STATE]
proof (state)
this:
b dvd (1::'a)

goal (1 subgoal):
 1. b dvd (1::'a) \<Longrightarrow> a dvd (1::'a) \<and> irreducible b \<or> b dvd (1::'a) \<and> irreducible a
[PROOF STEP]
with l
[PROOF STATE]
proof (chain)
picking this:
irreducible (a * b)
b dvd (1::'a)
[PROOF STEP]
have "irreducible a"
[PROOF STATE]
proof (prove)
using this:
irreducible (a * b)
b dvd (1::'a)

goal (1 subgoal):
 1. irreducible a
[PROOF STEP]
unfolding irreducible_def
[PROOF STATE]
proof (prove)
using this:
a * b \<noteq> (0::'a) \<and> \<not> a * b dvd (1::'a) \<and> (\<forall>aa ba. a * b = aa * ba \<longrightarrow> aa dvd (1::'a) \<or> ba dvd (1::'a))
b dvd (1::'a)

goal (1 subgoal):
 1. a \<noteq> (0::'a) \<and> \<not> a dvd (1::'a) \<and> (\<forall>aa b. a = aa * b \<longrightarrow> aa dvd (1::'a) \<or> b dvd (1::'a))
[PROOF STEP]
by (meson is_unit_mult_iff mult_not_zero semiring_normalization_rules(16))
[PROOF STATE]
proof (state)
this:
irreducible a

goal (1 subgoal):
 1. b dvd (1::'a) \<Longrightarrow> a dvd (1::'a) \<and> irreducible b \<or> b dvd (1::'a) \<and> irreducible a
[PROOF STEP]
with a
[PROOF STATE]
proof (chain)
picking this:
b dvd (1::'a)
irreducible a
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
b dvd (1::'a)
irreducible a

goal (1 subgoal):
 1. a dvd (1::'a) \<and> irreducible b \<or> b dvd (1::'a) \<and> irreducible a
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
a dvd (1::'a) \<and> irreducible b \<or> b dvd (1::'a) \<and> irreducible a

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
a dvd (1::'a) \<and> irreducible b \<or> b dvd (1::'a) \<and> irreducible a

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma poly_maps_memI:
  assumes "is_poly_tuple n fs"
  assumes "length fs = m"
  assumes "F = poly_map n fs"
  shows "F \<in> poly_maps n m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. F \<in> poly_maps n m
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
is_poly_tuple n fs
length fs = m
F = poly_map n fs

goal (1 subgoal):
 1. F \<in> poly_maps n m
[PROOF STEP]
unfolding poly_maps_def
[PROOF STATE]
proof (prove)
using this:
is_poly_tuple n fs
length fs = m
F = poly_map n fs

goal (1 subgoal):
 1. F \<in> {F. \<exists>fs. length fs = m \<and> is_poly_tuple n fs \<and> F = poly_map n fs}
[PROOF STEP]
by blast


[STATEMENT]
lemma exponent_p_a_m_k_equation:
  fixes p :: nat
  assumes "0 < m" "0 < k" "p \<noteq> 0" "k < p^a"
    shows "multiplicity p (p^a * m - k) = multiplicity p (p^a - k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. multiplicity p (p ^ a * m - k) = multiplicity p (p ^ a - k)
[PROOF STEP]
proof (rule multiplicity_cong [OF iffI])
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>r. p ^ r dvd p ^ a * m - k \<Longrightarrow> p ^ r dvd p ^ a - k
 2. \<And>r. p ^ r dvd p ^ a - k \<Longrightarrow> p ^ r dvd p ^ a * m - k
[PROOF STEP]
fix r
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>r. p ^ r dvd p ^ a * m - k \<Longrightarrow> p ^ r dvd p ^ a - k
 2. \<And>r. p ^ r dvd p ^ a - k \<Longrightarrow> p ^ r dvd p ^ a * m - k
[PROOF STEP]
assume *: "p ^ r dvd p ^ a * m - k"
[PROOF STATE]
proof (state)
this:
p ^ r dvd p ^ a * m - k

goal (2 subgoals):
 1. \<And>r. p ^ r dvd p ^ a * m - k \<Longrightarrow> p ^ r dvd p ^ a - k
 2. \<And>r. p ^ r dvd p ^ a - k \<Longrightarrow> p ^ r dvd p ^ a * m - k
[PROOF STEP]
show "p ^ r dvd p ^ a - k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p ^ r dvd p ^ a - k
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. p ^ r dvd p ^ a - k
[PROOF STEP]
have "k \<le> p ^ a * m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. k \<le> p ^ a * m
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
0 < m
0 < k
p \<noteq> 0
k < p ^ a

goal (1 subgoal):
 1. k \<le> p ^ a * m
[PROOF STEP]
by (meson nat_dvd_not_less dvd_triv_left leI mult_pos_pos order.strict_trans)
[PROOF STATE]
proof (state)
this:
k \<le> p ^ a * m

goal (1 subgoal):
 1. p ^ r dvd p ^ a - k
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
k \<le> p ^ a * m
[PROOF STEP]
have "r \<le> a"
[PROOF STATE]
proof (prove)
using this:
k \<le> p ^ a * m

goal (1 subgoal):
 1. r \<le> a
[PROOF STEP]
by (meson "*" \<open>0 < k\<close> \<open>k < p^a\<close> dvd_diffD1 dvd_triv_left leI less_imp_le_nat nat_dvd_not_less power_le_dvd)
[PROOF STATE]
proof (state)
this:
r \<le> a

goal (1 subgoal):
 1. p ^ r dvd p ^ a - k
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
r \<le> a
[PROOF STEP]
have "p^r dvd p^a * m"
[PROOF STATE]
proof (prove)
using this:
r \<le> a

goal (1 subgoal):
 1. p ^ r dvd p ^ a * m
[PROOF STEP]
by (simp add: le_imp_power_dvd)
[PROOF STATE]
proof (state)
this:
p ^ r dvd p ^ a * m

goal (1 subgoal):
 1. p ^ r dvd p ^ a - k
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
p ^ r dvd p ^ a * m

goal (1 subgoal):
 1. p ^ r dvd p ^ a - k
[PROOF STEP]
by (meson \<open>k \<le> p ^ a * m\<close> \<open>r \<le> a\<close> * dvd_diffD1 dvd_diff_nat le_imp_power_dvd)
[PROOF STATE]
proof (state)
this:
p ^ r dvd p ^ a - k

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
p ^ r dvd p ^ a - k

goal (1 subgoal):
 1. \<And>r. p ^ r dvd p ^ a - k \<Longrightarrow> p ^ r dvd p ^ a * m - k
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>r. p ^ r dvd p ^ a - k \<Longrightarrow> p ^ r dvd p ^ a * m - k
[PROOF STEP]
fix r
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>r. p ^ r dvd p ^ a - k \<Longrightarrow> p ^ r dvd p ^ a * m - k
[PROOF STEP]
assume *: "p ^ r dvd p ^ a - k"
[PROOF STATE]
proof (state)
this:
p ^ r dvd p ^ a - k

goal (1 subgoal):
 1. \<And>r. p ^ r dvd p ^ a - k \<Longrightarrow> p ^ r dvd p ^ a * m - k
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
0 < m
0 < k
p \<noteq> 0
k < p ^ a
p ^ r dvd p ^ a - k
[PROOF STEP]
have "r \<le> a"
[PROOF STATE]
proof (prove)
using this:
0 < m
0 < k
p \<noteq> 0
k < p ^ a
p ^ r dvd p ^ a - k

goal (1 subgoal):
 1. r \<le> a
[PROOF STEP]
by (metis diff_diff_cancel less_imp_le_nat nat_dvd_not_less nat_le_linear power_le_dvd zero_less_diff)
[PROOF STATE]
proof (state)
this:
r \<le> a

goal (1 subgoal):
 1. \<And>r. p ^ r dvd p ^ a - k \<Longrightarrow> p ^ r dvd p ^ a * m - k
[PROOF STEP]
show "p ^ r dvd p ^ a * m - k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p ^ r dvd p ^ a * m - k
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. p ^ r dvd p ^ a * m - k
[PROOF STEP]
have "p^r dvd p^a*m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p ^ r dvd p ^ a * m
[PROOF STEP]
by (simp add: \<open>r \<le> a\<close> le_imp_power_dvd)
[PROOF STATE]
proof (state)
this:
p ^ r dvd p ^ a * m

goal (1 subgoal):
 1. p ^ r dvd p ^ a * m - k
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
p ^ r dvd p ^ a * m
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
p ^ r dvd p ^ a * m

goal (1 subgoal):
 1. p ^ r dvd p ^ a * m - k
[PROOF STEP]
by (meson assms * dvd_diffD1 dvd_diff_nat le_imp_power_dvd less_imp_le_nat \<open>r \<le> a\<close>)
[PROOF STATE]
proof (state)
this:
p ^ r dvd p ^ a * m - k

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
p ^ r dvd p ^ a * m - k

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma EmptyMap_ran_override:
  "\<lbrakk> S \<noteq> {}; (S \<inter> (dom G)) = {} \<rbrakk> \<Longrightarrow>
  ran (G ++ EmptyMap S) = insert {} (ran G)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>S \<noteq> {}; S \<inter> dom G = {}\<rbrakk> \<Longrightarrow> ran (G ++ EmptyMap S) = insert {} (ran G)
[PROOF STEP]
apply (subst ran_override)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>S \<noteq> {}; S \<inter> dom G = {}\<rbrakk> \<Longrightarrow> dom G \<inter> dom (EmptyMap S) = {}
 2. \<lbrakk>S \<noteq> {}; S \<inter> dom G = {}\<rbrakk> \<Longrightarrow> ran G \<union> ran (EmptyMap S) = insert {} (ran G)
[PROOF STEP]
apply (simp add: Int_commute)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>S \<noteq> {}; S \<inter> dom G = {}\<rbrakk> \<Longrightarrow> ran G \<union> ran (EmptyMap S) = insert {} (ran G)
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma eq_swap_rev:
      assumes "w\<^sub>1 =\<^sub>S w\<^sub>2"
      shows "rev w\<^sub>1 =\<^sub>S rev w\<^sub>2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rev w\<^sub>1 =\<^sub>S rev w\<^sub>2
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
w\<^sub>1 =\<^sub>S w\<^sub>2

goal (1 subgoal):
 1. rev w\<^sub>1 =\<^sub>S rev w\<^sub>2
[PROOF STEP]
proof induct
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a b u v. ind a b \<Longrightarrow> rev (u @ [a] @ [b] @ v) =\<^sub>S rev (u @ [b] @ [a] @ v)
[PROOF STEP]
case (swap a b u v)
[PROOF STATE]
proof (state)
this:
ind a b

goal (1 subgoal):
 1. \<And>a b u v. ind a b \<Longrightarrow> rev (u @ [a] @ [b] @ v) =\<^sub>S rev (u @ [b] @ [a] @ v)
[PROOF STEP]
have 1: "rev v @ [a] @ [b] @ rev u =\<^sub>S rev v @ [b] @ [a] @ rev u"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rev v @ [a] @ [b] @ rev u =\<^sub>S rev v @ [b] @ [a] @ rev u
[PROOF STEP]
using swap
[PROOF STATE]
proof (prove)
using this:
ind a b

goal (1 subgoal):
 1. rev v @ [a] @ [b] @ rev u =\<^sub>S rev v @ [b] @ [a] @ rev u
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
rev v @ [a] @ [b] @ rev u =\<^sub>S rev v @ [b] @ [a] @ rev u

goal (1 subgoal):
 1. \<And>a b u v. ind a b \<Longrightarrow> rev (u @ [a] @ [b] @ v) =\<^sub>S rev (u @ [b] @ [a] @ v)
[PROOF STEP]
have 2: "rev v @ [b] @ [a] @ rev u =\<^sub>S rev v @ [a] @ [b] @ rev u"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rev v @ [b] @ [a] @ rev u =\<^sub>S rev v @ [a] @ [b] @ rev u
[PROOF STEP]
using 1 eq_swap_sym
[PROOF STATE]
proof (prove)
using this:
rev v @ [a] @ [b] @ rev u =\<^sub>S rev v @ [b] @ [a] @ rev u
?v =\<^sub>S ?w \<Longrightarrow> ?w =\<^sub>S ?v

goal (1 subgoal):
 1. rev v @ [b] @ [a] @ rev u =\<^sub>S rev v @ [a] @ [b] @ rev u
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
rev v @ [b] @ [a] @ rev u =\<^sub>S rev v @ [a] @ [b] @ rev u

goal (1 subgoal):
 1. \<And>a b u v. ind a b \<Longrightarrow> rev (u @ [a] @ [b] @ v) =\<^sub>S rev (u @ [b] @ [a] @ v)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rev (u @ [a] @ [b] @ v) =\<^sub>S rev (u @ [b] @ [a] @ v)
[PROOF STEP]
using 2
[PROOF STATE]
proof (prove)
using this:
rev v @ [b] @ [a] @ rev u =\<^sub>S rev v @ [a] @ [b] @ rev u

goal (1 subgoal):
 1. rev (u @ [a] @ [b] @ v) =\<^sub>S rev (u @ [b] @ [a] @ v)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
rev (u @ [a] @ [b] @ v) =\<^sub>S rev (u @ [b] @ [a] @ v)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma l6_4_1:
  assumes "P Out A B" and
    "Col A P B"
  shows "\<not> Bet A P B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> Bet A P B
[PROOF STEP]
using Out_def assms(1) between_equality between_symmetry
[PROOF STATE]
proof (prove)
using this:
?P Out ?A ?B \<equiv> ?A \<noteq> ?P \<and> ?B \<noteq> ?P \<and> (Bet ?P ?A ?B \<or> Bet ?P ?B ?A)
P Out A B
\<lbrakk>Bet ?A ?B ?C; Bet ?B ?A ?C\<rbrakk> \<Longrightarrow> ?A = ?B
Bet ?A ?B ?C \<Longrightarrow> Bet ?C ?B ?A

goal (1 subgoal):
 1. \<not> Bet A P B
[PROOF STEP]
by fastforce