[STATEMENT]
lemma measure_lborel_cbox_eq:
  "measure lborel (cbox l u) = (if \<forall>b\<in>Basis. l \<bullet> b \<le> u \<bullet> b then \<Prod>b\<in>Basis. (u - l) \<bullet> b else 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Sigma_Algebra.measure lborel (cbox l u) = (if \<forall>b\<in>Basis. l \<bullet> b \<le> u \<bullet> b then prod ((\<bullet>) (u - l)) Basis else 0)
[PROOF STEP]
using box_eq_empty(2)[THEN iffD2, of u l]
[PROOF STATE]
proof (prove)
using this:
\<exists>i\<in>Basis. u \<bullet> i < l \<bullet> i \<Longrightarrow> cbox l u = {}

goal (1 subgoal):
 1. Sigma_Algebra.measure lborel (cbox l u) = (if \<forall>b\<in>Basis. l \<bullet> b \<le> u \<bullet> b then prod ((\<bullet>) (u - l)) Basis else 0)
[PROOF STEP]
by (auto simp: not_le)


[STATEMENT]
theorem NSCauchy_Cauchy_iff: "NSCauchy X = Cauchy X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. NSCauchy X = Cauchy X
[PROOF STEP]
by (blast intro!: NSCauchy_Cauchy Cauchy_NSCauchy)


[STATEMENT]
lemma (in euclidean_space) euclidean_representation_sum_fun:
    "(\<lambda>x. \<Sum>b\<in>Basis. inner (f x) b *\<^sub>R b) = f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. \<Sum>b\<in>Basis. inner (f x) b *\<^sub>R b) = f
[PROOF STEP]
by (rule ext) (simp add: euclidean_representation_sum)


[STATEMENT]
lemma binomial_Suc_n [simp]: "Suc n choose n = Suc n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Suc n choose n = Suc n
[PROOF STEP]
by (induct n) simp_all


[STATEMENT]
lemma rank_iarrays_code[code]:
  "rank_iarray A = length (filter (\<lambda>x. \<not> is_zero_iarray x) (IArray.list_of (Gauss_Jordan_iarrays A)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rank_iarray A = length (filter (\<lambda>x. \<not> is_zero_iarray x) (IArray.list_of (Gauss_Jordan_iarrays A)))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. rank_iarray A = length (filter (\<lambda>x. \<not> is_zero_iarray x) (IArray.list_of (Gauss_Jordan_iarrays A)))
[PROOF STEP]
obtain xs where A_eq_xs: "(Gauss_Jordan_iarrays A) = IArray xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>xs. Gauss_Jordan_iarrays A = IArray xs \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis iarray.exhaust)
[PROOF STATE]
proof (state)
this:
Gauss_Jordan_iarrays A = IArray xs

goal (1 subgoal):
 1. rank_iarray A = length (filter (\<lambda>x. \<not> is_zero_iarray x) (IArray.list_of (Gauss_Jordan_iarrays A)))
[PROOF STEP]
have "rank_iarray A = card {i. i<(IArray.length (Gauss_Jordan_iarrays A)) \<and> \<not> is_zero_iarray ((Gauss_Jordan_iarrays A) !! i)}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rank_iarray A = card {i. i < IArray.length (Gauss_Jordan_iarrays A) \<and> \<not> is_zero_iarray (Gauss_Jordan_iarrays A !! i)}
[PROOF STEP]
unfolding rank_iarray_def Let_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card {i. i < IArray.length (Gauss_Jordan_iarrays A) \<and> \<not> is_zero_iarray (Gauss_Jordan_iarrays A !! i)} = card {i. i < IArray.length (Gauss_Jordan_iarrays A) \<and> \<not> is_zero_iarray (Gauss_Jordan_iarrays A !! i)}
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
rank_iarray A = card {i. i < IArray.length (Gauss_Jordan_iarrays A) \<and> \<not> is_zero_iarray (Gauss_Jordan_iarrays A !! i)}

goal (1 subgoal):
 1. rank_iarray A = length (filter (\<lambda>x. \<not> is_zero_iarray x) (IArray.list_of (Gauss_Jordan_iarrays A)))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
rank_iarray A = card {i. i < IArray.length (Gauss_Jordan_iarrays A) \<and> \<not> is_zero_iarray (Gauss_Jordan_iarrays A !! i)}

goal (1 subgoal):
 1. rank_iarray A = length (filter (\<lambda>x. \<not> is_zero_iarray x) (IArray.list_of (Gauss_Jordan_iarrays A)))
[PROOF STEP]
have "... = length (filter (\<lambda>x. \<not> is_zero_iarray x) (IArray.list_of (Gauss_Jordan_iarrays A)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card {i. i < IArray.length (Gauss_Jordan_iarrays A) \<and> \<not> is_zero_iarray (Gauss_Jordan_iarrays A !! i)} = length (filter (\<lambda>x. \<not> is_zero_iarray x) (IArray.list_of (Gauss_Jordan_iarrays A)))
[PROOF STEP]
unfolding A_eq_xs
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card {i. i < IArray.length (IArray xs) \<and> \<not> is_zero_iarray (IArray xs !! i)} = length (filter (\<lambda>x. \<not> is_zero_iarray x) (IArray.list_of (IArray xs)))
[PROOF STEP]
using length_filter_conv_card[symmetric]
[PROOF STATE]
proof (prove)
using this:
card {i. i < length ?xs \<and> ?p (?xs ! i)} = length (filter ?p ?xs)

goal (1 subgoal):
 1. card {i. i < IArray.length (IArray xs) \<and> \<not> is_zero_iarray (IArray xs !! i)} = length (filter (\<lambda>x. \<not> is_zero_iarray x) (IArray.list_of (IArray xs)))
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
card {i. i < IArray.length (Gauss_Jordan_iarrays A) \<and> \<not> is_zero_iarray (Gauss_Jordan_iarrays A !! i)} = length (filter (\<lambda>x. \<not> is_zero_iarray x) (IArray.list_of (Gauss_Jordan_iarrays A)))

goal (1 subgoal):
 1. rank_iarray A = length (filter (\<lambda>x. \<not> is_zero_iarray x) (IArray.list_of (Gauss_Jordan_iarrays A)))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
rank_iarray A = length (filter (\<lambda>x. \<not> is_zero_iarray x) (IArray.list_of (Gauss_Jordan_iarrays A)))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
rank_iarray A = length (filter (\<lambda>x. \<not> is_zero_iarray x) (IArray.list_of (Gauss_Jordan_iarrays A)))

goal (1 subgoal):
 1. rank_iarray A = length (filter (\<lambda>x. \<not> is_zero_iarray x) (IArray.list_of (Gauss_Jordan_iarrays A)))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
rank_iarray A = length (filter (\<lambda>x. \<not> is_zero_iarray x) (IArray.list_of (Gauss_Jordan_iarrays A)))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma bst_baliR:
  "\<lbrakk>bst l; bst r; \<forall>x\<in>set_tree l. x < a; \<forall>x\<in>set_tree r. a < x\<rbrakk>
   \<Longrightarrow> bst (baliR l a r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Tree2.bst l; Tree2.bst r; \<forall>x\<in>Tree2.set_tree l. x < a; \<forall>x\<in>Tree2.set_tree r. a < x\<rbrakk> \<Longrightarrow> Tree2.bst (baliR l a r)
[PROOF STEP]
by(cases "(l,a,r)" rule: baliR.cases) (auto simp: ball_Un)


[STATEMENT]
lemma "linear_fun_on S x \<Longrightarrow> a \<in> S \<Longrightarrow> b \<in> S \<Longrightarrow> x (a + b) = x a + x b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>linear_fun_on S x; a \<in> S; b \<in> S\<rbrakk> \<Longrightarrow> x (a + b) = x a + x b
[PROOF STEP]
using linear_on.axioms module_hom_on.add
[PROOF STATE]
proof (prove)
using this:
linear_on ?S1.0 ?S2.0 ?s1.0 ?s2.0 ?f \<Longrightarrow> module_hom_on ?S1.0 ?S2.0 ?s1.0 ?s2.0 ?f
\<lbrakk>module_hom_on ?S1.0 ?S2.0 ?s1.0 ?s2.0 ?f; ?b1.0 \<in> ?S1.0; ?b2.0 \<in> ?S1.0\<rbrakk> \<Longrightarrow> ?f (?b1.0 + ?b2.0) = ?f ?b1.0 + ?f ?b2.0

goal (1 subgoal):
 1. \<lbrakk>linear_fun_on S x; a \<in> S; b \<in> S\<rbrakk> \<Longrightarrow> x (a + b) = x a + x b
[PROOF STEP]
by blast


[STATEMENT]
lemma unify2EquivClasses_alt:
  assumes "R``{x} \<noteq> R``{y}" and inV: "y\<in>V" "x\<in>V" and "R\<subseteq>V\<times>V"
   and eq: "equiv V R" and [simp]: "finite V"
  shows "Suc (card (quotient V (per_union R x y))) = card (quotient V R)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Suc (card (V // per_union R x y)) = card (V // R)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Suc (card (V // per_union R x y)) = card (V // R)
[PROOF STEP]
from eq
[PROOF STATE]
proof (chain)
picking this:
equiv V R
[PROOF STEP]
have Rtrancl: "R\<^sup>+ = R"
[PROOF STATE]
proof (prove)
using this:
equiv V R

goal (1 subgoal):
 1. R\<^sup>+ = R
[PROOF STEP]
by (auto elim: equivE)
[PROOF STATE]
proof (state)
this:
R\<^sup>+ = R

goal (1 subgoal):
 1. Suc (card (V // per_union R x y)) = card (V // R)
[PROOF STEP]
from \<open>equiv V R\<close>
[PROOF STATE]
proof (chain)
picking this:
equiv V R
[PROOF STEP]
have sym: "sym R"
[PROOF STATE]
proof (prove)
using this:
equiv V R

goal (1 subgoal):
 1. sym R
[PROOF STEP]
unfolding equiv_def
[PROOF STATE]
proof (prove)
using this:
refl_on V R \<and> sym R \<and> trans R

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

goal (1 subgoal):
 1. Suc (card (V // per_union R x y)) = card (V // R)
[PROOF STEP]
let ?R' = "per_union R x y"

  \<comment> \<open> the equivalence classes not contining x and y, stay unchanged when performing @{term per_union} \<close>
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Suc (card (V // per_union R x y)) = card (V // R)
[PROOF STEP]
have "\<And>z. z \<in> V \<Longrightarrow> z \<notin> R `` {x} \<Longrightarrow> z \<notin> R `` {y} \<Longrightarrow> per_union R x y `` {z} = R `` {z}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>z. \<lbrakk>z \<in> V; z \<notin> R `` {x}; z \<notin> R `` {y}\<rbrakk> \<Longrightarrow> per_union R x y `` {z} = R `` {z}
[PROOF STEP]
using sym
[PROOF STATE]
proof (prove)
using this:
sym R

goal (1 subgoal):
 1. \<And>z. \<lbrakk>z \<in> V; z \<notin> R `` {x}; z \<notin> R `` {y}\<rbrakk> \<Longrightarrow> per_union R x y `` {z} = R `` {z}
[PROOF STEP]
by(auto simp: sym_def per_union_def)
[PROOF STATE]
proof (state)
this:
\<lbrakk>?z \<in> V; ?z \<notin> R `` {x}; ?z \<notin> R `` {y}\<rbrakk> \<Longrightarrow> per_union R x y `` {?z} = R `` {?z}

goal (1 subgoal):
 1. Suc (card (V // per_union R x y)) = card (V // R)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>?z \<in> V; ?z \<notin> R `` {x}; ?z \<notin> R `` {y}\<rbrakk> \<Longrightarrow> per_union R x y `` {?z} = R `` {?z}
[PROOF STEP]
have K: "(\<Union>x \<in> (V-(R``{x})-(R``{y})). {?R'``{x}}) = (\<Union>x \<in> (V-(R``{x})-(R``{y})). {R``{x}})"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?z \<in> V; ?z \<notin> R `` {x}; ?z \<notin> R `` {y}\<rbrakk> \<Longrightarrow> per_union R x y `` {?z} = R `` {?z}

goal (1 subgoal):
 1. (\<Union>xa\<in>V - R `` {x} - R `` {y}. {per_union R x y `` {xa}}) = (\<Union>x\<in>V - R `` {x} - R `` {y}. {R `` {x}})
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<Union>xa\<in>V - R `` {x} - R `` {y}. {per_union R x y `` {xa}}) = (\<Union>x\<in>V - R `` {x} - R `` {y}. {R `` {x}})

goal (1 subgoal):
 1. Suc (card (V // per_union R x y)) = card (V // R)
[PROOF STEP]
have R_respect: "(\<lambda>x. {R `` {x}}) respects R"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. {R `` {x}}) respects R
[PROOF STEP]
unfolding congruent_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>(y, z)\<in>R. {R `` {y}} = {R `` {z}}
[PROOF STEP]
using eq equiv_class_eq_iff
[PROOF STATE]
proof (prove)
using this:
equiv V R
equiv ?A ?r \<Longrightarrow> ((?x, ?y) \<in> ?r) = (?r `` {?x} = ?r `` {?y} \<and> ?x \<in> ?A \<and> ?y \<in> ?A)

goal (1 subgoal):
 1. \<forall>(y, z)\<in>R. {R `` {y}} = {R `` {z}}
[PROOF STEP]
by fastforce+
[PROOF STATE]
proof (state)
this:
(\<lambda>x. {R `` {x}}) respects R

goal (1 subgoal):
 1. Suc (card (V // per_union R x y)) = card (V // R)
[PROOF STEP]
have R'_respect: "(\<lambda>xa. {?R' `` {xa}}) respects R"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>xa. {per_union R x y `` {xa}}) respects R
[PROOF STEP]
unfolding congruent_def per_union_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>(ya, z)\<in>R. {(R \<union> {(xa, ya). (xa, x) \<in> R \<and> (ya, y) \<in> R} \<union> {(ya, xa). (xa, x) \<in> R \<and> (ya, y) \<in> R}) `` {ya}} = {(R \<union> {(xa, ya). (xa, x) \<in> R \<and> (ya, y) \<in> R} \<union> {(ya, xa). (xa, x) \<in> R \<and> (ya, y) \<in> R}) `` {z}}
[PROOF STEP]
using eq equiv_class_eq_iff
[PROOF STATE]
proof (prove)
using this:
equiv V R
equiv ?A ?r \<Longrightarrow> ((?x, ?y) \<in> ?r) = (?r `` {?x} = ?r `` {?y} \<and> ?x \<in> ?A \<and> ?y \<in> ?A)

goal (1 subgoal):
 1. \<forall>(ya, z)\<in>R. {(R \<union> {(xa, ya). (xa, x) \<in> R \<and> (ya, y) \<in> R} \<union> {(ya, xa). (xa, x) \<in> R \<and> (ya, y) \<in> R}) `` {ya}} = {(R \<union> {(xa, ya). (xa, x) \<in> R \<and> (ya, y) \<in> R} \<union> {(ya, xa). (xa, x) \<in> R \<and> (ya, y) \<in> R}) `` {z}}
[PROOF STEP]
by force+

  \<comment> \<open>some facts about the equivalence class of x, before and after the @{term per_union} operation\<close>
[PROOF STATE]
proof (state)
this:
(\<lambda>xa. {per_union R x y `` {xa}}) respects R

goal (1 subgoal):
 1. Suc (card (V // per_union R x y)) = card (V // R)
[PROOF STEP]
have xdrin: "(R``{x}) \<subseteq> V"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. R `` {x} \<subseteq> V
[PROOF STEP]
using assms(4)
[PROOF STATE]
proof (prove)
using this:
R \<subseteq> V \<times> V

goal (1 subgoal):
 1. R `` {x} \<subseteq> V
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
R `` {x} \<subseteq> V

goal (1 subgoal):
 1. Suc (card (V // per_union R x y)) = card (V // R)
[PROOF STEP]
have x1: "(\<Union>x \<in> (R``{x}). {?R'``{x}}) = {?R'``{x}}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Union>xa\<in>R `` {x}. {per_union R x y `` {xa}}) = {per_union R x y `` {x}}
[PROOF STEP]
apply(rule UN_equiv_class)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. equiv ?A R
 2. (\<lambda>xa. {per_union R x y `` {xa}}) respects R
 3. x \<in> ?A
[PROOF STEP]
by fact+
[PROOF STATE]
proof (state)
this:
(\<Union>xa\<in>R `` {x}. {per_union R x y `` {xa}}) = {per_union R x y `` {x}}

goal (1 subgoal):
 1. Suc (card (V // per_union R x y)) = card (V // R)
[PROOF STEP]
have x2: "(\<Union>x \<in> (R``{x}). {R``{x}}) = {R``{x}}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Union>x\<in>R `` {x}. {R `` {x}}) = {R `` {x}}
[PROOF STEP]
apply(rule UN_equiv_class)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. equiv ?A R
 2. (\<lambda>x. {R `` {x}}) respects R
 3. x \<in> ?A
[PROOF STEP]
by fact+

  \<comment> \<open>some facts about the equivalence class of y, before and after the @{term per_union} operation\<close>
[PROOF STATE]
proof (state)
this:
(\<Union>x\<in>R `` {x}. {R `` {x}}) = {R `` {x}}

goal (1 subgoal):
 1. Suc (card (V // per_union R x y)) = card (V // R)
[PROOF STEP]
have ydrin: "(R``{y}) \<subseteq> V"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. R `` {y} \<subseteq> V
[PROOF STEP]
using assms(4)
[PROOF STATE]
proof (prove)
using this:
R \<subseteq> V \<times> V

goal (1 subgoal):
 1. R `` {y} \<subseteq> V
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
R `` {y} \<subseteq> V

goal (1 subgoal):
 1. Suc (card (V // per_union R x y)) = card (V // R)
[PROOF STEP]
have y1: "(\<Union>x \<in> (R``{y}). {?R'``{x}}) = {?R'``{y}}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Union>xa\<in>R `` {y}. {per_union R x y `` {xa}}) = {per_union R x y `` {y}}
[PROOF STEP]
apply(rule UN_equiv_class)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. equiv ?A R
 2. (\<lambda>xa. {per_union R x y `` {xa}}) respects R
 3. y \<in> ?A
[PROOF STEP]
by fact+
[PROOF STATE]
proof (state)
this:
(\<Union>xa\<in>R `` {y}. {per_union R x y `` {xa}}) = {per_union R x y `` {y}}

goal (1 subgoal):
 1. Suc (card (V // per_union R x y)) = card (V // R)
[PROOF STEP]
have y2: "(\<Union>x \<in> (R``{y}). {R``{x}}) = {R``{y}}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Union>x\<in>R `` {y}. {R `` {x}}) = {R `` {y}}
[PROOF STEP]
apply(rule UN_equiv_class)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. equiv ?A R
 2. (\<lambda>x. {R `` {x}}) respects R
 3. y \<in> ?A
[PROOF STEP]
by fact+
[PROOF STATE]
proof (state)
this:
(\<Union>x\<in>R `` {y}. {R `` {x}}) = {R `` {y}}

goal (1 subgoal):
 1. Suc (card (V // per_union R x y)) = card (V // R)
[PROOF STEP]
have z: "(y,x)\<in>?R'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (y, x) \<in> per_union R x y
[PROOF STEP]
unfolding per_union_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (y, x) \<in> R \<union> {(xa, ya). (xa, x) \<in> R \<and> (ya, y) \<in> R} \<union> {(ya, xa). (xa, x) \<in> R \<and> (ya, y) \<in> R}
[PROOF STEP]
using sym sym_def
[PROOF STATE]
proof (prove)
using this:
sym R
sym ?r = (\<forall>x y. (x, y) \<in> ?r \<longrightarrow> (y, x) \<in> ?r)

goal (1 subgoal):
 1. (y, x) \<in> R \<union> {(xa, ya). (xa, x) \<in> R \<and> (ya, y) \<in> R} \<union> {(ya, xa). (xa, x) \<in> R \<and> (ya, y) \<in> R}
[PROOF STEP]
using assms(2) assms(3) eq eq_equiv_class
[PROOF STATE]
proof (prove)
using this:
sym R
sym ?r = (\<forall>x y. (x, y) \<in> ?r \<longrightarrow> (y, x) \<in> ?r)
y \<in> V
x \<in> V
equiv V R
\<lbrakk>?r `` {?a} = ?r `` {?b}; equiv ?A ?r; ?b \<in> ?A\<rbrakk> \<Longrightarrow> (?a, ?b) \<in> ?r

goal (1 subgoal):
 1. (y, x) \<in> R \<union> {(xa, ya). (xa, x) \<in> R \<and> (ya, y) \<in> R} \<union> {(ya, xa). (xa, x) \<in> R \<and> (ya, y) \<in> R}
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
(y, x) \<in> per_union R x y

goal (1 subgoal):
 1. Suc (card (V // per_union R x y)) = card (V // R)
[PROOF STEP]
have bla: "?R'``{y} = ?R'``{x}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. per_union R x y `` {y} = per_union R x y `` {x}
[PROOF STEP]
apply(rule equiv_class_eq)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. equiv ?A (per_union R x y)
 2. (y, x) \<in> per_union R x y
[PROOF STEP]
apply(rule union_equiv)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. equiv ?A R
 2. (y, x) \<in> per_union R x y
[PROOF STEP]
apply fact
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (y, x) \<in> per_union R x y
[PROOF STEP]
by fact
[PROOF STATE]
proof (state)
this:
per_union R x y `` {y} = per_union R x y `` {x}

goal (1 subgoal):
 1. Suc (card (V // per_union R x y)) = card (V // R)
[PROOF STEP]
let ?Vm = "(\<Union>x \<in> (V-(R``{x})-(R``{y})). {R``{x}})"

  \<comment> \<open>now consider the set of quotients wrt. the relation after the @{term per_union}\<close>
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Suc (card (V // per_union R x y)) = card (V // R)
[PROOF STEP]
have "quotient V ?R' = (\<Union>x \<in> V. {?R'``{x}})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. V // per_union R x y = (\<Union>xa\<in>V. {per_union R x y `` {xa}})
[PROOF STEP]
unfolding quotient_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Union>xa\<in>V. {per_union R x y `` {xa}}) = (\<Union>xa\<in>V. {per_union R x y `` {xa}})
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
V // per_union R x y = (\<Union>xa\<in>V. {per_union R x y `` {xa}})

goal (1 subgoal):
 1. Suc (card (V // per_union R x y)) = card (V // R)
[PROOF STEP]
also  \<comment> \<open>decompose it into the quotients for elements equivalent to x, y in R, and the rest\<close>
[PROOF STATE]
proof (state)
this:
V // per_union R x y = (\<Union>xa\<in>V. {per_union R x y `` {xa}})

goal (1 subgoal):
 1. Suc (card (V // per_union R x y)) = card (V // R)
[PROOF STEP]
have "\<dots> = (\<Union>x \<in> (V-(R``{x})-(R``{y})). {?R'``{x}})
             \<union> (\<Union>x \<in> (R``{y}). {?R'``{x}}) \<union> (\<Union>x \<in> (R``{x}). {?R'``{x}})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Union>xa\<in>V. {per_union R x y `` {xa}}) = (\<Union>xa\<in>V - R `` {x} - R `` {y}. {per_union R x y `` {xa}}) \<union> (\<Union>xa\<in>R `` {y}. {per_union R x y `` {xa}}) \<union> (\<Union>xa\<in>R `` {x}. {per_union R x y `` {xa}})
[PROOF STEP]
using xdrin ydrin
[PROOF STATE]
proof (prove)
using this:
R `` {x} \<subseteq> V
R `` {y} \<subseteq> V

goal (1 subgoal):
 1. (\<Union>xa\<in>V. {per_union R x y `` {xa}}) = (\<Union>xa\<in>V - R `` {x} - R `` {y}. {per_union R x y `` {xa}}) \<union> (\<Union>xa\<in>R `` {y}. {per_union R x y `` {xa}}) \<union> (\<Union>xa\<in>R `` {x}. {per_union R x y `` {xa}})
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<Union>xa\<in>V. {per_union R x y `` {xa}}) = (\<Union>xa\<in>V - R `` {x} - R `` {y}. {per_union R x y `` {xa}}) \<union> (\<Union>xa\<in>R `` {y}. {per_union R x y `` {xa}}) \<union> (\<Union>xa\<in>R `` {x}. {per_union R x y `` {xa}})

goal (1 subgoal):
 1. Suc (card (V // per_union R x y)) = card (V // R)
[PROOF STEP]
also  \<comment> \<open>for the elements equivalent to x and y in R the quotient is
            the quotient containing x and y respectively \<close>
[PROOF STATE]
proof (state)
this:
(\<Union>xa\<in>V. {per_union R x y `` {xa}}) = (\<Union>xa\<in>V - R `` {x} - R `` {y}. {per_union R x y `` {xa}}) \<union> (\<Union>xa\<in>R `` {y}. {per_union R x y `` {xa}}) \<union> (\<Union>xa\<in>R `` {x}. {per_union R x y `` {xa}})

goal (1 subgoal):
 1. Suc (card (V // per_union R x y)) = card (V // R)
[PROOF STEP]
have "\<dots> = (\<Union>x \<in> (V-(R``{x})-(R``{y})). {?R'``{x}}) \<union> {?R'``{y}} \<union> {?R'``{x}}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Union>xa\<in>V - R `` {x} - R `` {y}. {per_union R x y `` {xa}}) \<union> (\<Union>xa\<in>R `` {y}. {per_union R x y `` {xa}}) \<union> (\<Union>xa\<in>R `` {x}. {per_union R x y `` {xa}}) = (\<Union>xa\<in>V - R `` {x} - R `` {y}. {per_union R x y `` {xa}}) \<union> {per_union R x y `` {y}} \<union> {per_union R x y `` {x}}
[PROOF STEP]
using x1 y1
[PROOF STATE]
proof (prove)
using this:
(\<Union>xa\<in>R `` {x}. {per_union R x y `` {xa}}) = {per_union R x y `` {x}}
(\<Union>xa\<in>R `` {y}. {per_union R x y `` {xa}}) = {per_union R x y `` {y}}

goal (1 subgoal):
 1. (\<Union>xa\<in>V - R `` {x} - R `` {y}. {per_union R x y `` {xa}}) \<union> (\<Union>xa\<in>R `` {y}. {per_union R x y `` {xa}}) \<union> (\<Union>xa\<in>R `` {x}. {per_union R x y `` {xa}}) = (\<Union>xa\<in>V - R `` {x} - R `` {y}. {per_union R x y `` {xa}}) \<union> {per_union R x y `` {y}} \<union> {per_union R x y `` {x}}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<Union>xa\<in>V - R `` {x} - R `` {y}. {per_union R x y `` {xa}}) \<union> (\<Union>xa\<in>R `` {y}. {per_union R x y `` {xa}}) \<union> (\<Union>xa\<in>R `` {x}. {per_union R x y `` {xa}}) = (\<Union>xa\<in>V - R `` {x} - R `` {y}. {per_union R x y `` {xa}}) \<union> {per_union R x y `` {y}} \<union> {per_union R x y `` {x}}

goal (1 subgoal):
 1. Suc (card (V // per_union R x y)) = card (V // R)
[PROOF STEP]
also  \<comment> \<open>which is after uniting them, the same quotient \<close>
[PROOF STATE]
proof (state)
this:
(\<Union>xa\<in>V - R `` {x} - R `` {y}. {per_union R x y `` {xa}}) \<union> (\<Union>xa\<in>R `` {y}. {per_union R x y `` {xa}}) \<union> (\<Union>xa\<in>R `` {x}. {per_union R x y `` {xa}}) = (\<Union>xa\<in>V - R `` {x} - R `` {y}. {per_union R x y `` {xa}}) \<union> {per_union R x y `` {y}} \<union> {per_union R x y `` {x}}

goal (1 subgoal):
 1. Suc (card (V // per_union R x y)) = card (V // R)
[PROOF STEP]
have "\<dots> = (\<Union>x \<in> (V-(R``{x})-(R``{y})). {R``{x}}) \<union> {?R'``{y}}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Union>xa\<in>V - R `` {x} - R `` {y}. {per_union R x y `` {xa}}) \<union> {per_union R x y `` {y}} \<union> {per_union R x y `` {x}} = (\<Union>x\<in>V - R `` {x} - R `` {y}. {R `` {x}}) \<union> {per_union R x y `` {y}}
[PROOF STEP]
using K bla
[PROOF STATE]
proof (prove)
using this:
(\<Union>xa\<in>V - R `` {x} - R `` {y}. {per_union R x y `` {xa}}) = (\<Union>x\<in>V - R `` {x} - R `` {y}. {R `` {x}})
per_union R x y `` {y} = per_union R x y `` {x}

goal (1 subgoal):
 1. (\<Union>xa\<in>V - R `` {x} - R `` {y}. {per_union R x y `` {xa}}) \<union> {per_union R x y `` {y}} \<union> {per_union R x y `` {x}} = (\<Union>x\<in>V - R `` {x} - R `` {y}. {R `` {x}}) \<union> {per_union R x y `` {y}}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<Union>xa\<in>V - R `` {x} - R `` {y}. {per_union R x y `` {xa}}) \<union> {per_union R x y `` {y}} \<union> {per_union R x y `` {x}} = (\<Union>x\<in>V - R `` {x} - R `` {y}. {R `` {x}}) \<union> {per_union R x y `` {y}}

goal (1 subgoal):
 1. Suc (card (V // per_union R x y)) = card (V // R)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Union>xa\<in>V - R `` {x} - R `` {y}. {per_union R x y `` {xa}}) \<union> {per_union R x y `` {y}} \<union> {per_union R x y `` {x}} = (\<Union>x\<in>V - R `` {x} - R `` {y}. {R `` {x}}) \<union> {per_union R x y `` {y}}

goal (1 subgoal):
 1. Suc (card (V // per_union R x y)) = card (V // R)
[PROOF STEP]
have "\<dots> = insert (?R'``{y}) ?Vm"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Union>x\<in>V - R `` {x} - R `` {y}. {R `` {x}}) \<union> {per_union R x y `` {y}} = insert (per_union R x y `` {y}) (\<Union>x\<in>V - R `` {x} - R `` {y}. {R `` {x}})
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<Union>x\<in>V - R `` {x} - R `` {y}. {R `` {x}}) \<union> {per_union R x y `` {y}} = insert (per_union R x y `` {y}) (\<Union>x\<in>V - R `` {x} - R `` {y}. {R `` {x}})

goal (1 subgoal):
 1. Suc (card (V // per_union R x y)) = card (V // R)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
V // per_union R x y = insert (per_union R x y `` {y}) (\<Union>x\<in>V - R `` {x} - R `` {y}. {R `` {x}})
[PROOF STEP]
have leftside: "quotient V ?R' = insert (?R'``{y}) ?Vm"
[PROOF STATE]
proof (prove)
using this:
V // per_union R x y = insert (per_union R x y `` {y}) (\<Union>x\<in>V - R `` {x} - R `` {y}. {R `` {x}})

goal (1 subgoal):
 1. V // per_union R x y = insert (per_union R x y `` {y}) (\<Union>x\<in>V - R `` {x} - R `` {y}. {R `` {x}})
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
V // per_union R x y = insert (per_union R x y `` {y}) (\<Union>x\<in>V - R `` {x} - R `` {y}. {R `` {x}})

goal (1 subgoal):
 1. Suc (card (V // per_union R x y)) = card (V // R)
[PROOF STEP]
have notin: "?R'``{y} \<notin> ?Vm"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. per_union R x y `` {y} \<notin> (\<Union>x\<in>V - R `` {x} - R `` {y}. {R `` {x}})
[PROOF STEP]
apply (auto simp: per_union_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>xa. \<lbrakk>xa \<in> V; (y, xa) \<notin> R; (x, xa) \<notin> R; (R \<union> {xa. (xa, x) \<in> R} \<times> {ya. (ya, y) \<in> R} \<union> {(ya, xa). (xa, x) \<in> R \<and> (ya, y) \<in> R}) `` {y} = R `` {xa}\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
by (metis (no_types, lifting) Image_singleton_iff UnI1 assms(2) eq equiv_class_self local.sym symE)
[PROOF STATE]
proof (state)
this:
per_union R x y `` {y} \<notin> (\<Union>x\<in>V - R `` {x} - R `` {y}. {R `` {x}})

goal (1 subgoal):
 1. Suc (card (V // per_union R x y)) = card (V // R)
[PROOF STEP]
have o: "card (quotient V ?R') = Suc (card ?Vm)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (V // per_union R x y) = Suc (card (\<Union>x\<in>V - R `` {x} - R `` {y}. {R `` {x}}))
[PROOF STEP]
unfolding leftside
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (insert (per_union R x y `` {y}) (\<Union>x\<in>V - R `` {x} - R `` {y}. {R `` {x}})) = Suc (card (\<Union>x\<in>V - R `` {x} - R `` {y}. {R `` {x}}))
[PROOF STEP]
apply(rule card_insert_disjoint)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. finite (\<Union>x\<in>V - R `` {x} - R `` {y}. {R `` {x}})
 2. per_union R x y `` {y} \<notin> (\<Union>x\<in>V - R `` {x} - R `` {y}. {R `` {x}})
[PROOF STEP]
using notin
[PROOF STATE]
proof (prove)
using this:
per_union R x y `` {y} \<notin> (\<Union>x\<in>V - R `` {x} - R `` {y}. {R `` {x}})

goal (2 subgoals):
 1. finite (\<Union>x\<in>V - R `` {x} - R `` {y}. {R `` {x}})
 2. per_union R x y `` {y} \<notin> (\<Union>x\<in>V - R `` {x} - R `` {y}. {R `` {x}})
[PROOF STEP]
by auto

  \<comment> \<open>now consider the set of quotients wrt. the relation before the @{term per_union}\<close>
[PROOF STATE]
proof (state)
this:
card (V // per_union R x y) = Suc (card (\<Union>x\<in>V - R `` {x} - R `` {y}. {R `` {x}}))

goal (1 subgoal):
 1. Suc (card (V // per_union R x y)) = card (V // R)
[PROOF STEP]
have "quotient V R = (\<Union>x \<in> V. {R``{x}})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. V // R = (\<Union>x\<in>V. {R `` {x}})
[PROOF STEP]
unfolding quotient_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Union>x\<in>V. {R `` {x}}) = (\<Union>x\<in>V. {R `` {x}})
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
V // R = (\<Union>x\<in>V. {R `` {x}})

goal (1 subgoal):
 1. Suc (card (V // per_union R x y)) = card (V // R)
[PROOF STEP]
also \<comment> \<open>decompose it into the quotients for elements equivalent to x, y in R, and the rest\<close>
[PROOF STATE]
proof (state)
this:
V // R = (\<Union>x\<in>V. {R `` {x}})

goal (1 subgoal):
 1. Suc (card (V // per_union R x y)) = card (V // R)
[PROOF STEP]
have "\<dots> = (\<Union>x \<in> (V-(R``{x})-(R``{y})). {R``{x}})
           \<union> (\<Union>x \<in> (R``{y}). {R``{x}}) \<union> (\<Union>x \<in> (R``{x}). {R``{x}})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Union>x\<in>V. {R `` {x}}) = (\<Union>x\<in>V - R `` {x} - R `` {y}. {R `` {x}}) \<union> (\<Union>x\<in>R `` {y}. {R `` {x}}) \<union> (\<Union>x\<in>R `` {x}. {R `` {x}})
[PROOF STEP]
using xdrin ydrin
[PROOF STATE]
proof (prove)
using this:
R `` {x} \<subseteq> V
R `` {y} \<subseteq> V

goal (1 subgoal):
 1. (\<Union>x\<in>V. {R `` {x}}) = (\<Union>x\<in>V - R `` {x} - R `` {y}. {R `` {x}}) \<union> (\<Union>x\<in>R `` {y}. {R `` {x}}) \<union> (\<Union>x\<in>R `` {x}. {R `` {x}})
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<Union>x\<in>V. {R `` {x}}) = (\<Union>x\<in>V - R `` {x} - R `` {y}. {R `` {x}}) \<union> (\<Union>x\<in>R `` {y}. {R `` {x}}) \<union> (\<Union>x\<in>R `` {x}. {R `` {x}})

goal (1 subgoal):
 1. Suc (card (V // per_union R x y)) = card (V // R)
[PROOF STEP]
also \<comment> \<open>for the elements equivalent to x and y in R the quotient is
            the quotient containing x and y respectively \<close>
[PROOF STATE]
proof (state)
this:
(\<Union>x\<in>V. {R `` {x}}) = (\<Union>x\<in>V - R `` {x} - R `` {y}. {R `` {x}}) \<union> (\<Union>x\<in>R `` {y}. {R `` {x}}) \<union> (\<Union>x\<in>R `` {x}. {R `` {x}})

goal (1 subgoal):
 1. Suc (card (V // per_union R x y)) = card (V // R)
[PROOF STEP]
have "\<dots> = (\<Union>x \<in> (V-(R``{x})-(R``{y})). {R``{x}}) \<union> {R``{y}} \<union> {R``{x}}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Union>x\<in>V - R `` {x} - R `` {y}. {R `` {x}}) \<union> (\<Union>x\<in>R `` {y}. {R `` {x}}) \<union> (\<Union>x\<in>R `` {x}. {R `` {x}}) = (\<Union>x\<in>V - R `` {x} - R `` {y}. {R `` {x}}) \<union> {R `` {y}} \<union> {R `` {x}}
[PROOF STEP]
using x2 y2
[PROOF STATE]
proof (prove)
using this:
(\<Union>x\<in>R `` {x}. {R `` {x}}) = {R `` {x}}
(\<Union>x\<in>R `` {y}. {R `` {x}}) = {R `` {y}}

goal (1 subgoal):
 1. (\<Union>x\<in>V - R `` {x} - R `` {y}. {R `` {x}}) \<union> (\<Union>x\<in>R `` {y}. {R `` {x}}) \<union> (\<Union>x\<in>R `` {x}. {R `` {x}}) = (\<Union>x\<in>V - R `` {x} - R `` {y}. {R `` {x}}) \<union> {R `` {y}} \<union> {R `` {x}}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<Union>x\<in>V - R `` {x} - R `` {y}. {R `` {x}}) \<union> (\<Union>x\<in>R `` {y}. {R `` {x}}) \<union> (\<Union>x\<in>R `` {x}. {R `` {x}}) = (\<Union>x\<in>V - R `` {x} - R `` {y}. {R `` {x}}) \<union> {R `` {y}} \<union> {R `` {x}}

goal (1 subgoal):
 1. Suc (card (V // per_union R x y)) = card (V // R)
[PROOF STEP]
also \<comment> \<open> these are two distinct quotients  \<close>
[PROOF STATE]
proof (state)
this:
(\<Union>x\<in>V - R `` {x} - R `` {y}. {R `` {x}}) \<union> (\<Union>x\<in>R `` {y}. {R `` {x}}) \<union> (\<Union>x\<in>R `` {x}. {R `` {x}}) = (\<Union>x\<in>V - R `` {x} - R `` {y}. {R `` {x}}) \<union> {R `` {y}} \<union> {R `` {x}}

goal (1 subgoal):
 1. Suc (card (V // per_union R x y)) = card (V // R)
[PROOF STEP]
have "\<dots> = insert (R``{y}) (insert (R``{x}) ?Vm)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Union>x\<in>V - R `` {x} - R `` {y}. {R `` {x}}) \<union> {R `` {y}} \<union> {R `` {x}} = insert (R `` {y}) (insert (R `` {x}) (\<Union>x\<in>V - R `` {x} - R `` {y}. {R `` {x}}))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<Union>x\<in>V - R `` {x} - R `` {y}. {R `` {x}}) \<union> {R `` {y}} \<union> {R `` {x}} = insert (R `` {y}) (insert (R `` {x}) (\<Union>x\<in>V - R `` {x} - R `` {y}. {R `` {x}}))

goal (1 subgoal):
 1. Suc (card (V // per_union R x y)) = card (V // R)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
V // R = insert (R `` {y}) (insert (R `` {x}) (\<Union>x\<in>V - R `` {x} - R `` {y}. {R `` {x}}))
[PROOF STEP]
have ii: "quotient V R = insert (R``{y}) (insert (R``{x}) ?Vm)"
[PROOF STATE]
proof (prove)
using this:
V // R = insert (R `` {y}) (insert (R `` {x}) (\<Union>x\<in>V - R `` {x} - R `` {y}. {R `` {x}}))

goal (1 subgoal):
 1. V // R = insert (R `` {y}) (insert (R `` {x}) (\<Union>x\<in>V - R `` {x} - R `` {y}. {R `` {x}}))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
V // R = insert (R `` {y}) (insert (R `` {x}) (\<Union>x\<in>V - R `` {x} - R `` {y}. {R `` {x}}))

goal (1 subgoal):
 1. Suc (card (V // per_union R x y)) = card (V // R)
[PROOF STEP]
have "R``{x} \<notin> ?Vm"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. R `` {x} \<notin> (\<Union>x\<in>V - R `` {x} - R `` {y}. {R `` {x}})
[PROOF STEP]
using eq equiv_class_self
[PROOF STATE]
proof (prove)
using this:
equiv V R
\<lbrakk>equiv ?A ?r; ?a \<in> ?A\<rbrakk> \<Longrightarrow> ?a \<in> ?r `` {?a}

goal (1 subgoal):
 1. R `` {x} \<notin> (\<Union>x\<in>V - R `` {x} - R `` {y}. {R `` {x}})
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
R `` {x} \<notin> (\<Union>x\<in>V - R `` {x} - R `` {y}. {R `` {x}})

goal (1 subgoal):
 1. Suc (card (V // per_union R x y)) = card (V // R)
[PROOF STEP]
have "R``{y} \<notin> ?Vm"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. R `` {y} \<notin> (\<Union>x\<in>V - R `` {x} - R `` {y}. {R `` {x}})
[PROOF STEP]
using eq equiv_class_self
[PROOF STATE]
proof (prove)
using this:
equiv V R
\<lbrakk>equiv ?A ?r; ?a \<in> ?A\<rbrakk> \<Longrightarrow> ?a \<in> ?r `` {?a}

goal (1 subgoal):
 1. R `` {y} \<notin> (\<Union>x\<in>V - R `` {x} - R `` {y}. {R `` {x}})
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
R `` {y} \<notin> (\<Union>x\<in>V - R `` {x} - R `` {y}. {R `` {x}})

goal (1 subgoal):
 1. Suc (card (V // per_union R x y)) = card (V // R)
[PROOF STEP]
with assms(1)
[PROOF STATE]
proof (chain)
picking this:
R `` {x} \<noteq> R `` {y}
R `` {y} \<notin> (\<Union>x\<in>V - R `` {x} - R `` {y}. {R `` {x}})
[PROOF STEP]
have "R``{y} \<notin> (insert (R``{x}) ?Vm)"
[PROOF STATE]
proof (prove)
using this:
R `` {x} \<noteq> R `` {y}
R `` {y} \<notin> (\<Union>x\<in>V - R `` {x} - R `` {y}. {R `` {x}})

goal (1 subgoal):
 1. R `` {y} \<notin> insert (R `` {x}) (\<Union>x\<in>V - R `` {x} - R `` {y}. {R `` {x}})
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
R `` {y} \<notin> insert (R `` {x}) (\<Union>x\<in>V - R `` {x} - R `` {y}. {R `` {x}})

goal (1 subgoal):
 1. Suc (card (V // per_union R x y)) = card (V // R)
[PROOF STEP]
have "card (quotient V R) = Suc (card (insert (R``{x}) ?Vm))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (V // R) = Suc (card (insert (R `` {x}) (\<Union>x\<in>V - R `` {x} - R `` {y}. {R `` {x}})))
[PROOF STEP]
apply(simp only: ii)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (insert (R `` {y}) (insert (R `` {x}) (\<Union>x\<in>V - R `` {x} - R `` {y}. {R `` {x}}))) = Suc (card (insert (R `` {x}) (\<Union>x\<in>V - R `` {x} - R `` {y}. {R `` {x}})))
[PROOF STEP]
apply(rule card_insert_disjoint)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. finite (insert (R `` {x}) (\<Union>x\<in>V - R `` {x} - R `` {y}. {R `` {x}}))
 2. R `` {y} \<notin> insert (R `` {x}) (\<Union>x\<in>V - R `` {x} - R `` {y}. {R `` {x}})
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. R `` {y} \<notin> insert (R `` {x}) (\<Union>x\<in>V - R `` {x} - R `` {y}. {R `` {x}})
[PROOF STEP]
apply fact
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
card (V // R) = Suc (card (insert (R `` {x}) (\<Union>x\<in>V - R `` {x} - R `` {y}. {R `` {x}})))

goal (1 subgoal):
 1. Suc (card (V // per_union R x y)) = card (V // R)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
card (V // R) = Suc (card (insert (R `` {x}) (\<Union>x\<in>V - R `` {x} - R `` {y}. {R `` {x}})))

goal (1 subgoal):
 1. Suc (card (V // per_union R x y)) = card (V // R)
[PROOF STEP]
have "card (insert (R``{x}) ?Vm) = Suc (card ?Vm)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (insert (R `` {x}) (\<Union>x\<in>V - R `` {x} - R `` {y}. {R `` {x}})) = Suc (card (\<Union>x\<in>V - R `` {x} - R `` {y}. {R `` {x}}))
[PROOF STEP]
apply(rule card_insert_disjoint)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. finite (\<Union>x\<in>V - R `` {x} - R `` {y}. {R `` {x}})
 2. R `` {x} \<notin> (\<Union>x\<in>V - R `` {x} - R `` {y}. {R `` {x}})
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. R `` {x} \<notin> (\<Union>x\<in>V - R `` {x} - R `` {y}. {R `` {x}})
[PROOF STEP]
apply fact
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
card (insert (R `` {x}) (\<Union>x\<in>V - R `` {x} - R `` {y}. {R `` {x}})) = Suc (card (\<Union>x\<in>V - R `` {x} - R `` {y}. {R `` {x}}))

goal (1 subgoal):
 1. Suc (card (V // per_union R x y)) = card (V // R)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
card (V // R) = Suc (Suc (card (\<Union>x\<in>V - R `` {x} - R `` {y}. {R `` {x}})))
[PROOF STEP]
have a: "card (quotient V R) = Suc (Suc (card ?Vm))"
[PROOF STATE]
proof (prove)
using this:
card (V // R) = Suc (Suc (card (\<Union>x\<in>V - R `` {x} - R `` {y}. {R `` {x}})))

goal (1 subgoal):
 1. card (V // R) = Suc (Suc (card (\<Union>x\<in>V - R `` {x} - R `` {y}. {R `` {x}})))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
card (V // R) = Suc (Suc (card (\<Union>x\<in>V - R `` {x} - R `` {y}. {R `` {x}})))

goal (1 subgoal):
 1. Suc (card (V // per_union R x y)) = card (V // R)
[PROOF STEP]
from a o
[PROOF STATE]
proof (chain)
picking this:
card (V // R) = Suc (Suc (card (\<Union>x\<in>V - R `` {x} - R `` {y}. {R `` {x}})))
card (V // per_union R x y) = Suc (card (\<Union>x\<in>V - R `` {x} - R `` {y}. {R `` {x}}))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
card (V // R) = Suc (Suc (card (\<Union>x\<in>V - R `` {x} - R `` {y}. {R `` {x}})))
card (V // per_union R x y) = Suc (card (\<Union>x\<in>V - R `` {x} - R `` {y}. {R `` {x}}))

goal (1 subgoal):
 1. Suc (card (V // per_union R x y)) = card (V // R)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Suc (card (V // per_union R x y)) = card (V // R)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma removeLastMarkedFromMarkedElementsToLastMarkedAreAllMarkedElementsInPrefixLastMarked:
  assumes
  "markedElements M \<noteq> []"
  shows
  "removeAll (lastMarked M) (markedElementsTo (lastMarked M) M) = markedElements (prefixBeforeElement (lastMarked M) M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. removeAll (lastMarked M) (markedElementsTo (lastMarked M) M) = markedElements (prefixBeforeElement (lastMarked M) M)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
markedElements M \<noteq> []

goal (1 subgoal):
 1. removeAll (lastMarked M) (markedElementsTo (lastMarked M) M) = markedElements (prefixBeforeElement (lastMarked M) M)
[PROOF STEP]
unfolding lastMarked_def
[PROOF STATE]
proof (prove)
using this:
markedElements M \<noteq> []

goal (1 subgoal):
 1. removeAll (last (markedElements M)) (markedElementsTo (last (markedElements M)) M) = markedElements (prefixBeforeElement (last (markedElements M)) M)
[PROOF STEP]
unfolding markedElementsTo_def
[PROOF STATE]
proof (prove)
using this:
markedElements M \<noteq> []

goal (1 subgoal):
 1. removeAll (last (markedElements M)) (markedElements (prefixToElement (last (markedElements M)) M)) = markedElements (prefixBeforeElement (last (markedElements M)) M)
[PROOF STEP]
by (induct M) auto


[STATEMENT]
lemma equivalent_transitive:
  assumes "equivalent S1 S2"
  assumes "equivalent S2 S3"
  shows "equivalent S1 S3"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. equivalent S1 S3
[PROOF STEP]
using assms entails_transitive equivalent_def
[PROOF STATE]
proof (prove)
using this:
equivalent S1 S2
equivalent S2 S3
\<lbrakk>entails_formula ?S1.0 ?S2.0; entails_formula ?S2.0 ?S3.0\<rbrakk> \<Longrightarrow> entails_formula ?S1.0 ?S3.0
equivalent ?S1.0 ?S2.0 = (entails_formula ?S1.0 ?S2.0 \<and> entails_formula ?S2.0 ?S1.0)

goal (1 subgoal):
 1. equivalent S1 S3
[PROOF STEP]
by auto


[STATEMENT]
lemma neg_le_divideC_eq [field_simps]:
  "a \<le> b /\<^sub>C c \<longleftrightarrow> b \<le> c *\<^sub>C a" (is "?P \<longleftrightarrow> ?Q") if "c < 0"
    for a b :: "'a :: ordered_complex_vector"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a \<le> b /\<^sub>C c) = (b \<le> c *\<^sub>C a)
[PROOF STEP]
using that pos_le_divideC_eq [of "- c" a "- b"]
[PROOF STATE]
proof (prove)
using this:
c < 0
0 < - c \<Longrightarrow> (a \<le> - b /\<^sub>C - c) = (- c *\<^sub>C a \<le> - b)

goal (1 subgoal):
 1. (a \<le> b /\<^sub>C c) = (b \<le> c *\<^sub>C a)
[PROOF STEP]
by (simp add: less_complex_def)


[STATEMENT]
lemma tan_inj_pi:
  "- (pi/2) < x \<Longrightarrow> x < pi/2 \<Longrightarrow> - (pi/2) < y \<Longrightarrow> y < pi/2 \<Longrightarrow> tan x = tan y \<Longrightarrow> x = y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>- (pi / 2) < x; x < pi / 2; - (pi / 2) < y; y < pi / 2; tan x = tan y\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
by (metis arctan_tan)


[STATEMENT]
lemma lotteries_on_subset: "A \<subseteq> B \<Longrightarrow> p \<in> lotteries_on A \<Longrightarrow> p \<in> lotteries_on B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>A \<subseteq> B; p \<in> lotteries_on A\<rbrakk> \<Longrightarrow> p \<in> lotteries_on B
[PROOF STEP]
unfolding lotteries_on_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>A \<subseteq> B; p \<in> {p. set_pmf p \<subseteq> A}\<rbrakk> \<Longrightarrow> p \<in> {p. set_pmf p \<subseteq> B}
[PROOF STEP]
by blast


[STATEMENT]
lemma LIM_isCont_iff: "(f \<midarrow>a\<rightarrow> f a) = ((\<lambda>h. f (a + h)) \<midarrow>0\<rightarrow> f a)"
  for f :: "'a::real_normed_vector \<Rightarrow> 'b::topological_space"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<midarrow>a\<rightarrow> f a = (\<lambda>h. f (a + h)) \<midarrow>0::'a\<rightarrow> f a
[PROOF STEP]
by (rule iffI [OF LIM_offset_zero LIM_offset_zero_cancel])


[STATEMENT]
lemma floor_eq: "real_of_int n < x \<Longrightarrow> x < real_of_int n + 1 \<Longrightarrow> \<lfloor>x\<rfloor> = n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>real_of_int n < x; x < real_of_int n + 1\<rbrakk> \<Longrightarrow> \<lfloor>x\<rfloor> = n
[PROOF STEP]
by linarith


[STATEMENT]
lemma Bseq_minus_iff: "Bseq (\<lambda>n. - (X n) :: 'a::real_normed_vector) \<longleftrightarrow> Bseq X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Bseq (\<lambda>n. - X n) = Bseq X
[PROOF STEP]
by (simp add: Bseq_def)


[STATEMENT]
lemma join_table: "table n A X \<Longrightarrow> table n B Y \<Longrightarrow> (\<not> b \<Longrightarrow> B \<subseteq> A) \<Longrightarrow> A \<union> B = C \<Longrightarrow>
  table n C (join X b Y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>table n A X; table n B Y; \<not> b \<Longrightarrow> B \<subseteq> A; A \<union> B = C\<rbrakk> \<Longrightarrow> table n C (join X b Y)
[PROOF STEP]
unfolding table_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Ball X (wf_tuple n A); Ball Y (wf_tuple n B); \<not> b \<Longrightarrow> B \<subseteq> A; A \<union> B = C\<rbrakk> \<Longrightarrow> Ball (join X b Y) (wf_tuple n C)
[PROOF STEP]
by (auto elim!: join_wf_tuple)


[STATEMENT]
lemma wordinterval_eq_set_eq:
  "wordinterval_eq r1 r2 \<longleftrightarrow> wordinterval_to_set r1 = wordinterval_to_set r2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wordinterval_eq r1 r2 = (wordinterval_to_set r1 = wordinterval_to_set r2)
[PROOF STEP]
unfolding wordinterval_eq_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (wordinterval_subset r1 r2 \<and> wordinterval_subset r2 r1) = (wordinterval_to_set r1 = wordinterval_to_set r2)
[PROOF STEP]
by auto


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

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


[STATEMENT]
lemma fps_nth_compose_X_power:
  "fps_nth (f oo (fps_X ^ d)) n = (if d dvd n then fps_nth f (n div d) else 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f oo fps_X ^ d) $ n = (if d dvd n then f $ (n div d) else (0::'a))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (f oo fps_X ^ d) $ n = (if d dvd n then f $ (n div d) else (0::'a))
[PROOF STEP]
have "fps_nth (f oo (fps_X ^ d)) n = (\<Sum>i = 0..n. f $ i * (fps_X ^ (d * i)) $ n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f oo fps_X ^ d) $ n = (\<Sum>i = 0..n. f $ i * fps_X ^ (d * i) $ n)
[PROOF STEP]
unfolding fps_compose_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Abs_fps (\<lambda>n. \<Sum>i = 0..n. f $ i * (fps_X ^ d) ^ i $ n) $ n = (\<Sum>i = 0..n. f $ i * fps_X ^ (d * i) $ n)
[PROOF STEP]
by (simp add: power_mult)
[PROOF STATE]
proof (state)
this:
(f oo fps_X ^ d) $ n = (\<Sum>i = 0..n. f $ i * fps_X ^ (d * i) $ n)

goal (1 subgoal):
 1. (f oo fps_X ^ d) $ n = (if d dvd n then f $ (n div d) else (0::'a))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(f oo fps_X ^ d) $ n = (\<Sum>i = 0..n. f $ i * fps_X ^ (d * i) $ n)

goal (1 subgoal):
 1. (f oo fps_X ^ d) $ n = (if d dvd n then f $ (n div d) else (0::'a))
[PROOF STEP]
have "\<dots> = (\<Sum>i\<in>(if d dvd n then {n div d} else {}). f $ i * (fps_X ^ (d * i)) $ n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i = 0..n. f $ i * fps_X ^ (d * i) $ n) = (\<Sum>i\<in>(if d dvd n then {n div d} else {}). f $ i * fps_X ^ (d * i) $ n)
[PROOF STEP]
by (intro sum.mono_neutral_right) auto
[PROOF STATE]
proof (state)
this:
(\<Sum>i = 0..n. f $ i * fps_X ^ (d * i) $ n) = (\<Sum>i\<in>(if d dvd n then {n div d} else {}). f $ i * fps_X ^ (d * i) $ n)

goal (1 subgoal):
 1. (f oo fps_X ^ d) $ n = (if d dvd n then f $ (n div d) else (0::'a))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>i = 0..n. f $ i * fps_X ^ (d * i) $ n) = (\<Sum>i\<in>(if d dvd n then {n div d} else {}). f $ i * fps_X ^ (d * i) $ n)

goal (1 subgoal):
 1. (f oo fps_X ^ d) $ n = (if d dvd n then f $ (n div d) else (0::'a))
[PROOF STEP]
have "\<dots> = (if d dvd n then fps_nth f (n div d) else 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i\<in>(if d dvd n then {n div d} else {}). f $ i * fps_X ^ (d * i) $ n) = (if d dvd n then f $ (n div d) else (0::'a))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<in>(if d dvd n then {n div d} else {}). f $ i * fps_X ^ (d * i) $ n) = (if d dvd n then f $ (n div d) else (0::'a))

goal (1 subgoal):
 1. (f oo fps_X ^ d) $ n = (if d dvd n then f $ (n div d) else (0::'a))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(f oo fps_X ^ d) $ n = (if d dvd n then f $ (n div d) else (0::'a))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(f oo fps_X ^ d) $ n = (if d dvd n then f $ (n div d) else (0::'a))

goal (1 subgoal):
 1. (f oo fps_X ^ d) $ n = (if d dvd n then f $ (n div d) else (0::'a))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(f oo fps_X ^ d) $ n = (if d dvd n then f $ (n div d) else (0::'a))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma factorial2: "VARS i f
 {True}
 i := (1::nat); f := 1;
 WHILE i <= n INV {f = fac(i - 1) & 1 <= i & i <= n+1}
 DO f := f*i; i := i+1 OD
 {f = fac n}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {True}
i := 1; f := 1; WHILE i \<le> n INV {f = fac (i - 1) \<and> 1 \<le> i \<and> i \<le> n + 1}  VAR {0}
DO f := f * i; i := i + 1 OD
{f = fac n}
[PROOF STEP]
apply vcg_simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i. Suc 0 \<le> i \<and> i \<le> Suc n \<and> \<not> i \<le> n \<Longrightarrow> fac (i - Suc 0) = fac n
[PROOF STEP]
apply(subgoal_tac "i = Suc n")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>i. \<lbrakk>Suc 0 \<le> i \<and> i \<le> Suc n \<and> \<not> i \<le> n; i = Suc n\<rbrakk> \<Longrightarrow> fac (i - Suc 0) = fac n
 2. \<And>i. Suc 0 \<le> i \<and> i \<le> Suc n \<and> \<not> i \<le> n \<Longrightarrow> i = Suc n
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i. Suc 0 \<le> i \<and> i \<le> Suc n \<and> \<not> i \<le> n \<Longrightarrow> i = Suc n
[PROOF STEP]
apply arith
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
theorem TBtheorem1b:
assumes "ineM PQ M E"
       and "subcomponents PQ = {P,Q}"
       and "correctCompositionIn PQ"
shows    "ineM P M E \<or> ineM Q M E"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ineM P M E \<or> ineM Q M E
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
ineM PQ M E
subcomponents PQ = {P, Q}
correctCompositionIn PQ

goal (1 subgoal):
 1. ineM P M E \<or> ineM Q M E
[PROOF STEP]
by (simp add: ineM_def correctCompositionIn_def, auto)


[STATEMENT]
lemma sets_borel_eq_count_space: "sets (borel :: 'a::{countable, t2_space} measure) = count_space UNIV"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sets borel = sets (count_space UNIV)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. sets borel = sets (count_space UNIV)
[PROOF STEP]
have "(\<Union>a\<in>A. {a}) \<in> sets borel" for A :: "'a set"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Union>a\<in>A. {a}) \<in> sets borel
[PROOF STEP]
by (intro sets.countable_UN') auto
[PROOF STATE]
proof (state)
this:
(\<Union>a\<in>?A. {a}) \<in> sets borel

goal (1 subgoal):
 1. sets borel = sets (count_space UNIV)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<Union>a\<in>?A. {a}) \<in> sets borel
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<Union>a\<in>?A. {a}) \<in> sets borel

goal (1 subgoal):
 1. sets borel = sets (count_space UNIV)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
sets borel = sets (count_space UNIV)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem berlekamp_zassenhaus_factorization_irreducible\<^sub>d:
  assumes res: "berlekamp_zassenhaus_factorization f = fs"
  and sf: "square_free f"
  and deg: "degree f > 0"
  shows "f = prod_list fs \<and> (\<forall> fi \<in> set fs. irreducible\<^sub>d fi)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f = prod_list fs \<and> (\<forall>fi\<in>set fs. irreducible\<^sub>d fi)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. f = prod_list fs \<and> (\<forall>fi\<in>set fs. irreducible\<^sub>d fi)
[PROOF STEP]
let ?lc = "lead_coeff f"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. f = prod_list fs \<and> (\<forall>fi\<in>set fs. irreducible\<^sub>d fi)
[PROOF STEP]
define p where "p \<equiv> suitable_prime_bz f"
[PROOF STATE]
proof (state)
this:
p \<equiv> suitable_prime_bz f

goal (1 subgoal):
 1. f = prod_list fs \<and> (\<forall>fi\<in>set fs. irreducible\<^sub>d fi)
[PROOF STEP]
obtain c gs where berl: "finite_field_factorization_int p f = (c,gs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>c gs. finite_field_factorization_int p f = (c, gs) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
finite_field_factorization_int p f = (c, gs)

goal (1 subgoal):
 1. f = prod_list fs \<and> (\<forall>fi\<in>set fs. irreducible\<^sub>d fi)
[PROOF STEP]
let ?degs = "map degree gs"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. f = prod_list fs \<and> (\<forall>fi\<in>set fs. irreducible\<^sub>d fi)
[PROOF STEP]
note res = res[unfolded berlekamp_zassenhaus_factorization_def Let_def, folded p_def,
    unfolded berl split, folded]
[PROOF STATE]
proof (state)
this:
zassenhaus_reconstruction (hensel_lifting p (find_exponent p (2 * \<bar>lead_coeff f\<bar> * factor_bound f (degree_bound gs))) f gs) p (find_exponent p (2 * \<bar>lead_coeff f\<bar> * factor_bound f (degree_bound gs))) f = fs

goal (1 subgoal):
 1. f = prod_list fs \<and> (\<forall>fi\<in>set fs. irreducible\<^sub>d fi)
[PROOF STEP]
from suitable_prime_bz[OF sf refl]
[PROOF STATE]
proof (chain)
picking this:
prime (suitable_prime_bz f)
comm_monoid_mult_class.coprime (lead_coeff f) (suitable_prime_bz f)
poly_mod.square_free_m (suitable_prime_bz f) f
[PROOF STEP]
have prime: "prime p" and cop: "coprime ?lc p" and sf: "poly_mod.square_free_m p f"
[PROOF STATE]
proof (prove)
using this:
prime (suitable_prime_bz f)
comm_monoid_mult_class.coprime (lead_coeff f) (suitable_prime_bz f)
poly_mod.square_free_m (suitable_prime_bz f) f

goal (1 subgoal):
 1. prime p &&& comm_monoid_mult_class.coprime (lead_coeff f) p &&& poly_mod.square_free_m p f
[PROOF STEP]
unfolding p_def
[PROOF STATE]
proof (prove)
using this:
prime (suitable_prime_bz f)
comm_monoid_mult_class.coprime (lead_coeff f) (suitable_prime_bz f)
poly_mod.square_free_m (suitable_prime_bz f) f

goal (1 subgoal):
 1. prime (suitable_prime_bz f) &&& comm_monoid_mult_class.coprime (lead_coeff f) (suitable_prime_bz f) &&& poly_mod.square_free_m (suitable_prime_bz f) f
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
prime p
comm_monoid_mult_class.coprime (lead_coeff f) p
poly_mod.square_free_m p f

goal (1 subgoal):
 1. f = prod_list fs \<and> (\<forall>fi\<in>set fs. irreducible\<^sub>d fi)
[PROOF STEP]
from prime
[PROOF STATE]
proof (chain)
picking this:
prime p
[PROOF STEP]
interpret poly_mod_prime p
[PROOF STATE]
proof (prove)
using this:
prime p

goal (1 subgoal):
 1. poly_mod_prime p
[PROOF STEP]
by unfold_locales
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. f = prod_list fs \<and> (\<forall>fi\<in>set fs. irreducible\<^sub>d fi)
[PROOF STEP]
define n where "n = find_exponent p (2 * abs ?lc * factor_bound f (degree_bound gs))"
[PROOF STATE]
proof (state)
this:
n = find_exponent p (2 * \<bar>lead_coeff f\<bar> * factor_bound f (degree_bound gs))

goal (1 subgoal):
 1. f = prod_list fs \<and> (\<forall>fi\<in>set fs. irreducible\<^sub>d fi)
[PROOF STEP]
note n = find_exponent[OF m1, of "2 * abs ?lc * factor_bound f (degree_bound gs)",
    folded n_def]
[PROOF STATE]
proof (state)
this:
2 * \<bar>lead_coeff f\<bar> * factor_bound f (degree_bound gs) < p ^ n
n \<noteq> 0

goal (1 subgoal):
 1. f = prod_list fs \<and> (\<forall>fi\<in>set fs. irreducible\<^sub>d fi)
[PROOF STEP]
note bh = berlekamp_and_hensel_separated[OF cop sf refl berl n(2)]
[PROOF STATE]
proof (state)
this:
berlekamp_hensel p n f = hensel_lifting p n f gs
sort (map degree gs) = sort (map degree (hensel_lifting p n f gs))

goal (1 subgoal):
 1. f = prod_list fs \<and> (\<forall>fi\<in>set fs. irreducible\<^sub>d fi)
[PROOF STEP]
have db: "degree_bound (berlekamp_hensel p n f) = degree_bound gs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree_bound (berlekamp_hensel p n f) = degree_bound gs
[PROOF STEP]
unfolding bh
    degree_bound_def max_factor_degree_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (let ds = sort (map degree (hensel_lifting p n f gs)) in sum_list (drop (length ds div 2) ds)) = (let ds = sort (map degree (hensel_lifting p n f gs)) in sum_list (drop (length ds div 2) ds))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
degree_bound (berlekamp_hensel p n f) = degree_bound gs

goal (1 subgoal):
 1. f = prod_list fs \<and> (\<forall>fi\<in>set fs. irreducible\<^sub>d fi)
[PROOF STEP]
note res = res[folded n_def bh(1)]
[PROOF STATE]
proof (state)
this:
zassenhaus_reconstruction (berlekamp_hensel p n f) p n f = fs

goal (1 subgoal):
 1. f = prod_list fs \<and> (\<forall>fi\<in>set fs. irreducible\<^sub>d fi)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f = prod_list fs \<and> (\<forall>fi\<in>set fs. irreducible\<^sub>d fi)
[PROOF STEP]
by (rule zassenhaus_reconstruction_irreducible\<^sub>d[OF prime cop sf deg refl _ res], insert n db, auto)
[PROOF STATE]
proof (state)
this:
f = prod_list fs \<and> (\<forall>fi\<in>set fs. irreducible\<^sub>d fi)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma poly_roots_power [simp]: "poly_roots (p ^ n) = repeat_mset n (poly_roots p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly_roots (p ^ n) = repeat_mset n (poly_roots p)
[PROOF STEP]
proof (cases "p = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. p = 0 \<Longrightarrow> poly_roots (p ^ n) = repeat_mset n (poly_roots p)
 2. p \<noteq> 0 \<Longrightarrow> poly_roots (p ^ n) = repeat_mset n (poly_roots p)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
p = 0

goal (2 subgoals):
 1. p = 0 \<Longrightarrow> poly_roots (p ^ n) = repeat_mset n (poly_roots p)
 2. p \<noteq> 0 \<Longrightarrow> poly_roots (p ^ n) = repeat_mset n (poly_roots p)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
p = 0

goal (1 subgoal):
 1. poly_roots (p ^ n) = repeat_mset n (poly_roots p)
[PROOF STEP]
by (cases n) auto
[PROOF STATE]
proof (state)
this:
poly_roots (p ^ n) = repeat_mset n (poly_roots p)

goal (1 subgoal):
 1. p \<noteq> 0 \<Longrightarrow> poly_roots (p ^ n) = repeat_mset n (poly_roots p)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. p \<noteq> 0 \<Longrightarrow> poly_roots (p ^ n) = repeat_mset n (poly_roots p)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
p \<noteq> 0

goal (1 subgoal):
 1. p \<noteq> 0 \<Longrightarrow> poly_roots (p ^ n) = repeat_mset n (poly_roots p)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
p \<noteq> 0

goal (1 subgoal):
 1. poly_roots (p ^ n) = repeat_mset n (poly_roots p)
[PROOF STEP]
by (induction n) (auto simp: poly_roots_mult)
[PROOF STATE]
proof (state)
this:
poly_roots (p ^ n) = repeat_mset n (poly_roots p)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma islimpt_greaterThanLessThan2:
  fixes a b::"'a::{linorder_topology, dense_order}"
  assumes "a < b"
  shows  "b islimpt {a<..<b}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. b islimpt {a<..<b}
[PROOF STEP]
proof (rule islimptI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>T. \<lbrakk>b \<in> T; open T\<rbrakk> \<Longrightarrow> \<exists>y\<in>{a<..<b}. y \<in> T \<and> y \<noteq> b
[PROOF STEP]
fix T
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>T. \<lbrakk>b \<in> T; open T\<rbrakk> \<Longrightarrow> \<exists>y\<in>{a<..<b}. y \<in> T \<and> y \<noteq> b
[PROOF STEP]
assume "open T" "b \<in> T"
[PROOF STATE]
proof (state)
this:
open T
b \<in> T

goal (1 subgoal):
 1. \<And>T. \<lbrakk>b \<in> T; open T\<rbrakk> \<Longrightarrow> \<exists>y\<in>{a<..<b}. y \<in> T \<and> y \<noteq> b
[PROOF STEP]
from open_left[OF this \<open>a < b\<close>]
[PROOF STATE]
proof (chain)
picking this:
\<exists>ba<b. {ba<..b} \<subseteq> T
[PROOF STEP]
obtain c where c: "c < b" "{c<..b} \<subseteq> T"
[PROOF STATE]
proof (prove)
using this:
\<exists>ba<b. {ba<..b} \<subseteq> T

goal (1 subgoal):
 1. (\<And>c. \<lbrakk>c < b; {c<..b} \<subseteq> T\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
c < b
{c<..b} \<subseteq> T

goal (1 subgoal):
 1. \<And>T. \<lbrakk>b \<in> T; open T\<rbrakk> \<Longrightarrow> \<exists>y\<in>{a<..<b}. y \<in> T \<and> y \<noteq> b
[PROOF STEP]
with assms dense[of "max a c" b]
[PROOF STATE]
proof (chain)
picking this:
a < b
max a c < b \<Longrightarrow> \<exists>z>max a c. z < b
c < b
{c<..b} \<subseteq> T
[PROOF STEP]
show "\<exists>y\<in>{a<..<b}. y \<in> T \<and> y \<noteq> b"
[PROOF STATE]
proof (prove)
using this:
a < b
max a c < b \<Longrightarrow> \<exists>z>max a c. z < b
c < b
{c<..b} \<subseteq> T

goal (1 subgoal):
 1. \<exists>y\<in>{a<..<b}. y \<in> T \<and> y \<noteq> b
[PROOF STEP]
by (metis greaterThanAtMost_iff greaterThanLessThan_iff max_less_iff_conj
      not_le order.strict_implies_order subset_eq)
[PROOF STATE]
proof (state)
this:
\<exists>y\<in>{a<..<b}. y \<in> T \<and> y \<noteq> b

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem IF1set_simps:
  "IF1set (ctor1 x) = F1set1 x \<union> ((\<Union>a \<in> F1set2 x. IF1set a) \<union> (\<Union>a \<in> F1set3 x. IF2set a))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. IF1set (ctor1 x) = F1set1 x \<union> (\<Union> (IF1set ` F1set2 x) \<union> \<Union> (IF2set ` F1set3 x))
[PROOF STEP]
apply (rule trans[OF o_eq_dest[OF IF1set]])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. IF1col (F1map id IF1set IF2set x) = F1set1 x \<union> (\<Union> (IF1set ` F1set2 x) \<union> \<Union> (IF2set ` F1set3 x))
[PROOF STEP]
apply (rule arg_cong2[of _ _ _ _ "(\<union>)"])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. F1set1 (F1map id IF1set IF2set x) = F1set1 x
 2. \<Union> (F1set2 (F1map id IF1set IF2set x)) \<union> \<Union> (F1set3 (F1map id IF1set IF2set x)) = \<Union> (IF1set ` F1set2 x) \<union> \<Union> (IF2set ` F1set3 x)
[PROOF STEP]
apply (rule trans[OF F1.set_map(1) trans[OF fun_cong[OF image_id] id_apply]])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union> (F1set2 (F1map id IF1set IF2set x)) \<union> \<Union> (F1set3 (F1map id IF1set IF2set x)) = \<Union> (IF1set ` F1set2 x) \<union> \<Union> (IF2set ` F1set3 x)
[PROOF STEP]
apply (rule arg_cong2[of _ _ _ _ "(\<union>)"])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<Union> (F1set2 (F1map id IF1set IF2set x)) = \<Union> (IF1set ` F1set2 x)
 2. \<Union> (F1set3 (F1map id IF1set IF2set x)) = \<Union> (IF2set ` F1set3 x)
[PROOF STEP]
apply (rule arg_cong[OF F1.set_map(2)])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union> (F1set3 (F1map id IF1set IF2set x)) = \<Union> (IF2set ` F1set3 x)
[PROOF STEP]
apply (rule arg_cong[OF F1.set_map(3)])
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma eventually_at_infinityI:
  fixes P::"'a::real_normed_vector \<Rightarrow> bool"
  assumes "\<And>x. c \<le> norm x \<Longrightarrow> P x"
  shows "eventually P at_infinity"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eventually P at_infinity
[PROOF STEP]
unfolding eventually_at_infinity
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>b. \<forall>x. b \<le> norm x \<longrightarrow> P x
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
c \<le> norm ?x \<Longrightarrow> P ?x

goal (1 subgoal):
 1. \<exists>b. \<forall>x. b \<le> norm x \<longrightarrow> P x
[PROOF STEP]
by auto


[STATEMENT]
lemma onorm_push_exp [simp]: "onorm (push_exp d) = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. onorm (push_exp d) = 1
[PROOF STEP]
proof (intro antisym)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. onorm (push_exp d) \<le> 1
 2. 1 \<le> onorm (push_exp d)
[PROOF STEP]
show "onorm (push_exp d) \<le> 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. onorm (push_exp d) \<le> 1
[PROOF STEP]
using norm_push_exp_le_norm
[PROOF STATE]
proof (prove)
using this:
norm (push_exp ?d ?x) \<le> norm ?x

goal (1 subgoal):
 1. onorm (push_exp d) \<le> 1
[PROOF STEP]
by (auto intro!: onorm_bound)
[PROOF STATE]
proof (state)
this:
onorm (push_exp d) \<le> 1

goal (1 subgoal):
 1. 1 \<le> onorm (push_exp d)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 1 \<le> onorm (push_exp d)
[PROOF STEP]
show "1 \<le> onorm (push_exp d)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 \<le> onorm (push_exp d)
[PROOF STEP]
using onorm[of _ 1, OF push_exp_bounded_linear]
[PROOF STATE]
proof (prove)
using this:
norm (push_exp ?d2 1) \<le> onorm (push_exp ?d2) * norm 1

goal (1 subgoal):
 1. 1 \<le> onorm (push_exp d)
[PROOF STEP]
by (auto simp: norm_bfun_def')
[PROOF STATE]
proof (state)
this:
1 \<le> onorm (push_exp d)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma p_binom_complex: assumes sk: "s \<le> k"
  shows "of_nat (k choose s) = complex_of_real (poly (p s) (of_nat k))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. of_nat (k choose s) = complex_of_real (poly (p s) (real k))
[PROOF STEP]
unfolding p_binom[OF sk, symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. of_nat (k choose s) = complex_of_real (real (k choose s))
[PROOF STEP]
by simp


[STATEMENT]
lemma ereal_Limsup_uminus:
  fixes f :: "'a \<Rightarrow> ereal"
  shows "Limsup net (\<lambda>x. - (f x)) = - Liminf net f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Limsup net (\<lambda>x. - f x) = - Liminf net f
[PROOF STEP]
unfolding Limsup_def Liminf_def ereal_SUP_uminus ereal_INF_uminus_eq
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - (SUP P\<in>{P. eventually P net}. Inf (f ` Collect P)) = - (SUP P\<in>{P. eventually P net}. Inf (f ` Collect P))
[PROOF STEP]
..


[STATEMENT]
lemma pow_int_add: assumes x: "x \<noteq> 0" shows "pow_int x (a + b) = pow_int x a * pow_int x b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pow_int x (a + b) = pow_int x a * pow_int x b
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. pow_int x (a + b) = pow_int x a * pow_int x b
[PROOF STEP]
have *:
    "\<not> a + b < 0 \<Longrightarrow> a < 0 \<Longrightarrow> nat b = nat (a + b) + nat (-a)"
    "\<not> a + b < 0 \<Longrightarrow> b < 0 \<Longrightarrow> nat a = nat (a + b) + nat (-b)"
    "a + b < 0 \<Longrightarrow> \<not> a < 0 \<Longrightarrow> nat (-b) = nat a + nat (-a -b) "
    "a + b < 0 \<Longrightarrow> \<not> b < 0 \<Longrightarrow> nat (-a) = nat b + nat (-a -b) "
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lbrakk>\<not> a + b < 0; a < 0\<rbrakk> \<Longrightarrow> nat b = nat (a + b) + nat (- a)) &&& (\<lbrakk>\<not> a + b < 0; b < 0\<rbrakk> \<Longrightarrow> nat a = nat (a + b) + nat (- b))) &&& (\<lbrakk>a + b < 0; \<not> a < 0\<rbrakk> \<Longrightarrow> nat (- b) = nat a + nat (- a - b)) &&& (\<lbrakk>a + b < 0; \<not> b < 0\<rbrakk> \<Longrightarrow> nat (- a) = nat b + nat (- a - b))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<lbrakk>\<not> a + b < 0; a < 0\<rbrakk> \<Longrightarrow> nat b = nat (a + b) + nat (- a)
\<lbrakk>\<not> a + b < 0; b < 0\<rbrakk> \<Longrightarrow> nat a = nat (a + b) + nat (- b)
\<lbrakk>a + b < 0; \<not> a < 0\<rbrakk> \<Longrightarrow> nat (- b) = nat a + nat (- a - b)
\<lbrakk>a + b < 0; \<not> b < 0\<rbrakk> \<Longrightarrow> nat (- a) = nat b + nat (- a - b)

goal (1 subgoal):
 1. pow_int x (a + b) = pow_int x a * pow_int x b
[PROOF STEP]
have pow_eq: "l = m \<Longrightarrow> (x ^ l = x ^ m)" for l m
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. l = m \<Longrightarrow> x ^ l = x ^ m
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
?l = ?m \<Longrightarrow> x ^ ?l = x ^ ?m

goal (1 subgoal):
 1. pow_int x (a + b) = pow_int x a * pow_int x b
[PROOF STEP]
from x
[PROOF STATE]
proof (chain)
picking this:
x \<noteq> (0::'a)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
x \<noteq> (0::'a)

goal (1 subgoal):
 1. pow_int x (a + b) = pow_int x a * pow_int x b
[PROOF STEP]
unfolding pow_int_def
[PROOF STATE]
proof (prove)
using this:
x \<noteq> (0::'a)

goal (1 subgoal):
 1. (if a + b < 0 then (1::'a) / x ^ nat (- (a + b)) else x ^ nat (a + b)) = (if a < 0 then (1::'a) / x ^ nat (- a) else x ^ nat a) * (if b < 0 then (1::'a) / x ^ nat (- b) else x ^ nat b)
[PROOF STEP]
by (auto split: if_splits simp: power_add[symmetric] simp: * intro!: pow_eq, auto simp: power_add)
[PROOF STATE]
proof (state)
this:
pow_int x (a + b) = pow_int x a * pow_int x b

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma winding_number_homotopic_loops_eq:
  assumes "path p" and \<zeta>p: "\<zeta> \<notin> path_image p"
      and "path q" and \<zeta>q: "\<zeta> \<notin> path_image q"
      and loops: "pathfinish p = pathstart p" "pathfinish q = pathstart q"
    shows "winding_number p \<zeta> = winding_number q \<zeta> \<longleftrightarrow> homotopic_loops (-{\<zeta>}) p q"
    (is "?lhs = ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (winding_number p \<zeta> = winding_number q \<zeta>) = homotopic_loops (- {\<zeta>}) p q
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. winding_number p \<zeta> = winding_number q \<zeta> \<Longrightarrow> homotopic_loops (- {\<zeta>}) p q
 2. homotopic_loops (- {\<zeta>}) p q \<Longrightarrow> winding_number p \<zeta> = winding_number q \<zeta>
[PROOF STEP]
assume L: ?lhs
[PROOF STATE]
proof (state)
this:
winding_number p \<zeta> = winding_number q \<zeta>

goal (2 subgoals):
 1. winding_number p \<zeta> = winding_number q \<zeta> \<Longrightarrow> homotopic_loops (- {\<zeta>}) p q
 2. homotopic_loops (- {\<zeta>}) p q \<Longrightarrow> winding_number p \<zeta> = winding_number q \<zeta>
[PROOF STEP]
have "pathstart p \<noteq> \<zeta>" "pathstart q \<noteq> \<zeta>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pathstart p \<noteq> \<zeta> &&& pathstart q \<noteq> \<zeta>
[PROOF STEP]
using \<zeta>p \<zeta>q
[PROOF STATE]
proof (prove)
using this:
\<zeta> \<notin> path_image p
\<zeta> \<notin> path_image q

goal (1 subgoal):
 1. pathstart p \<noteq> \<zeta> &&& pathstart q \<noteq> \<zeta>
[PROOF STEP]
by blast+
[PROOF STATE]
proof (state)
this:
pathstart p \<noteq> \<zeta>
pathstart q \<noteq> \<zeta>

goal (2 subgoals):
 1. winding_number p \<zeta> = winding_number q \<zeta> \<Longrightarrow> homotopic_loops (- {\<zeta>}) p q
 2. homotopic_loops (- {\<zeta>}) p q \<Longrightarrow> winding_number p \<zeta> = winding_number q \<zeta>
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
pathstart p \<noteq> \<zeta>
pathstart q \<noteq> \<zeta>

goal (2 subgoals):
 1. winding_number p \<zeta> = winding_number q \<zeta> \<Longrightarrow> homotopic_loops (- {\<zeta>}) p q
 2. homotopic_loops (- {\<zeta>}) p q \<Longrightarrow> winding_number p \<zeta> = winding_number q \<zeta>
[PROOF STEP]
have "path_connected (-{\<zeta>})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. path_connected (- {\<zeta>})
[PROOF STEP]
by (simp add: path_connected_punctured_universe)
[PROOF STATE]
proof (state)
this:
path_connected (- {\<zeta>})

goal (2 subgoals):
 1. winding_number p \<zeta> = winding_number q \<zeta> \<Longrightarrow> homotopic_loops (- {\<zeta>}) p q
 2. homotopic_loops (- {\<zeta>}) p q \<Longrightarrow> winding_number p \<zeta> = winding_number q \<zeta>
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
pathstart p \<noteq> \<zeta>
pathstart q \<noteq> \<zeta>
path_connected (- {\<zeta>})
[PROOF STEP]
obtain r where "path r" and rim: "path_image r \<subseteq> -{\<zeta>}"
                        and pas: "pathstart r = pathstart p" and paf: "pathfinish r = pathstart q"
[PROOF STATE]
proof (prove)
using this:
pathstart p \<noteq> \<zeta>
pathstart q \<noteq> \<zeta>
path_connected (- {\<zeta>})

goal (1 subgoal):
 1. (\<And>r. \<lbrakk>path r; path_image r \<subseteq> - {\<zeta>}; pathstart r = pathstart p; pathfinish r = pathstart q\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp: path_connected_def)
[PROOF STATE]
proof (state)
this:
path r
path_image r \<subseteq> - {\<zeta>}
pathstart r = pathstart p
pathfinish r = pathstart q

goal (2 subgoals):
 1. winding_number p \<zeta> = winding_number q \<zeta> \<Longrightarrow> homotopic_loops (- {\<zeta>}) p q
 2. homotopic_loops (- {\<zeta>}) p q \<Longrightarrow> winding_number p \<zeta> = winding_number q \<zeta>
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
path r
path_image r \<subseteq> - {\<zeta>}
pathstart r = pathstart p
pathfinish r = pathstart q
[PROOF STEP]
have "pathstart r \<noteq> \<zeta>"
[PROOF STATE]
proof (prove)
using this:
path r
path_image r \<subseteq> - {\<zeta>}
pathstart r = pathstart p
pathfinish r = pathstart q

goal (1 subgoal):
 1. pathstart r \<noteq> \<zeta>
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
pathstart r \<noteq> \<zeta>

goal (2 subgoals):
 1. winding_number p \<zeta> = winding_number q \<zeta> \<Longrightarrow> homotopic_loops (- {\<zeta>}) p q
 2. homotopic_loops (- {\<zeta>}) p q \<Longrightarrow> winding_number p \<zeta> = winding_number q \<zeta>
[PROOF STEP]
have "homotopic_loops (- {\<zeta>}) p (r +++ q +++ reversepath r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. homotopic_loops (- {\<zeta>}) p (r +++ q +++ reversepath r)
[PROOF STEP]
proof (rule homotopic_paths_imp_homotopic_loops)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. homotopic_paths (- {\<zeta>}) p (r +++ q +++ reversepath r)
 2. pathfinish p = pathstart p
 3. pathfinish (r +++ q +++ reversepath r) = pathstart p
[PROOF STEP]
show "homotopic_paths (- {\<zeta>}) p (r +++ q +++ reversepath r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. homotopic_paths (- {\<zeta>}) p (r +++ q +++ reversepath r)
[PROOF STEP]
by (metis (mono_tags, opaque_lifting) \<open>path r\<close> L \<zeta>p \<zeta>q \<open>path p\<close> \<open>path q\<close> homotopic_loops_conjugate loops not_in_path_image_join paf pas path_image_reversepath path_imp_reversepath path_join_eq pathfinish_join pathfinish_reversepath  pathstart_join pathstart_reversepath rim subset_Compl_singleton winding_number_homotopic_loops winding_number_homotopic_paths_eq)
[PROOF STATE]
proof (state)
this:
homotopic_paths (- {\<zeta>}) p (r +++ q +++ reversepath r)

goal (2 subgoals):
 1. pathfinish p = pathstart p
 2. pathfinish (r +++ q +++ reversepath r) = pathstart p
[PROOF STEP]
qed (use loops pas in auto)
[PROOF STATE]
proof (state)
this:
homotopic_loops (- {\<zeta>}) p (r +++ q +++ reversepath r)

goal (2 subgoals):
 1. winding_number p \<zeta> = winding_number q \<zeta> \<Longrightarrow> homotopic_loops (- {\<zeta>}) p q
 2. homotopic_loops (- {\<zeta>}) p q \<Longrightarrow> winding_number p \<zeta> = winding_number q \<zeta>
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
homotopic_loops (- {\<zeta>}) p (r +++ q +++ reversepath r)

goal (2 subgoals):
 1. winding_number p \<zeta> = winding_number q \<zeta> \<Longrightarrow> homotopic_loops (- {\<zeta>}) p q
 2. homotopic_loops (- {\<zeta>}) p q \<Longrightarrow> winding_number p \<zeta> = winding_number q \<zeta>
[PROOF STEP]
have "homotopic_loops (- {\<zeta>}) (r +++ q +++ reversepath r) q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. homotopic_loops (- {\<zeta>}) (r +++ q +++ reversepath r) q
[PROOF STEP]
using rim \<zeta>q
[PROOF STATE]
proof (prove)
using this:
path_image r \<subseteq> - {\<zeta>}
\<zeta> \<notin> path_image q

goal (1 subgoal):
 1. homotopic_loops (- {\<zeta>}) (r +++ q +++ reversepath r) q
[PROOF STEP]
by (auto simp: homotopic_loops_conjugate paf \<open>path q\<close> \<open>path r\<close> loops)
[PROOF STATE]
proof (state)
this:
homotopic_loops (- {\<zeta>}) (r +++ q +++ reversepath r) q

goal (2 subgoals):
 1. winding_number p \<zeta> = winding_number q \<zeta> \<Longrightarrow> homotopic_loops (- {\<zeta>}) p q
 2. homotopic_loops (- {\<zeta>}) p q \<Longrightarrow> winding_number p \<zeta> = winding_number q \<zeta>
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
homotopic_loops (- {\<zeta>}) p (r +++ q +++ reversepath r)
homotopic_loops (- {\<zeta>}) (r +++ q +++ reversepath r) q
[PROOF STEP]
show ?rhs
[PROOF STATE]
proof (prove)
using this:
homotopic_loops (- {\<zeta>}) p (r +++ q +++ reversepath r)
homotopic_loops (- {\<zeta>}) (r +++ q +++ reversepath r) q

goal (1 subgoal):
 1. homotopic_loops (- {\<zeta>}) p q
[PROOF STEP]
using homotopic_loops_trans
[PROOF STATE]
proof (prove)
using this:
homotopic_loops (- {\<zeta>}) p (r +++ q +++ reversepath r)
homotopic_loops (- {\<zeta>}) (r +++ q +++ reversepath r) q
\<lbrakk>homotopic_loops ?s ?p ?q; homotopic_loops ?s ?q ?r\<rbrakk> \<Longrightarrow> homotopic_loops ?s ?p ?r

goal (1 subgoal):
 1. homotopic_loops (- {\<zeta>}) p q
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
homotopic_loops (- {\<zeta>}) p q

goal (1 subgoal):
 1. homotopic_loops (- {\<zeta>}) p q \<Longrightarrow> winding_number p \<zeta> = winding_number q \<zeta>
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. homotopic_loops (- {\<zeta>}) p q \<Longrightarrow> winding_number p \<zeta> = winding_number q \<zeta>
[PROOF STEP]
assume ?rhs
[PROOF STATE]
proof (state)
this:
homotopic_loops (- {\<zeta>}) p q

goal (1 subgoal):
 1. homotopic_loops (- {\<zeta>}) p q \<Longrightarrow> winding_number p \<zeta> = winding_number q \<zeta>
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
homotopic_loops (- {\<zeta>}) p q
[PROOF STEP]
show ?lhs
[PROOF STATE]
proof (prove)
using this:
homotopic_loops (- {\<zeta>}) p q

goal (1 subgoal):
 1. winding_number p \<zeta> = winding_number q \<zeta>
[PROOF STEP]
by (simp add: winding_number_homotopic_loops)
[PROOF STATE]
proof (state)
this:
winding_number p \<zeta> = winding_number q \<zeta>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma cle_add_iff2: "a *\<^sub>C e + c \<le> b *\<^sub>C e + d \<longleftrightarrow> c \<le> (b - a) *\<^sub>C e + d"
  for c d e :: "'a::ordered_complex_vector"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a *\<^sub>C e + c \<le> b *\<^sub>C e + d) = (c \<le> (b - a) *\<^sub>C e + d)
[PROOF STEP]
by (simp add: algebra_simps)


[STATEMENT]
lemma matrix_to_iarray_interchange_columns[code_unfold]:
  fixes A::"'a::{semiring_1}^'columns::{mod_type}^'rows::{mod_type}"
  shows "matrix_to_iarray (interchange_columns A i j) = interchange_columns_iarray (matrix_to_iarray A) (to_nat i) (to_nat j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. matrix_to_iarray (interchange_columns A i j) = interchange_columns_iarray (matrix_to_iarray A) (mod_type_class.to_nat i) (mod_type_class.to_nat j)
[PROOF STEP]
unfolding interchange_columns_def interchange_columns_iarray_def o_def tabulate2_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. matrix_to_iarray (\<chi>ia ja. if ja = i then A $ ia $ j else if ja = j then A $ ia $ i else A $ ia $ ja) = IArray.of_fun (\<lambda>ia. IArray.of_fun (\<lambda>ja. if ja = mod_type_class.to_nat i then matrix_to_iarray A !! ia !! mod_type_class.to_nat j else if ja = mod_type_class.to_nat j then matrix_to_iarray A !! ia !! mod_type_class.to_nat i else matrix_to_iarray A !! ia !! ja) (ncols_iarray (matrix_to_iarray A))) (nrows_iarray (matrix_to_iarray A))
[PROOF STEP]
unfolding nrows_eq_card_rows ncols_eq_card_columns
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. matrix_to_iarray (\<chi>ia ja. if ja = i then A $ ia $ j else if ja = j then A $ ia $ i else A $ ia $ ja) = IArray.of_fun (\<lambda>ia. IArray.of_fun (\<lambda>ja. if ja = mod_type_class.to_nat i then matrix_to_iarray A !! ia !! mod_type_class.to_nat j else if ja = mod_type_class.to_nat j then matrix_to_iarray A !! ia !! mod_type_class.to_nat i else matrix_to_iarray A !! ia !! ja) CARD('columns)) CARD('rows)
[PROOF STEP]
unfolding matrix_to_iarray_def o_def vec_to_iarray_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. IArray (map (\<lambda>x. IArray.of_fun (\<lambda>ia. (\<chi>ia ja. if ja = i then A $ ia $ j else if ja = j then A $ ia $ i else A $ ia $ ja) $ mod_type_class.from_nat x $ mod_type_class.from_nat ia) CARD('columns)) [0..<CARD('rows)]) = IArray.of_fun (\<lambda>ia. IArray.of_fun (\<lambda>ja. if ja = mod_type_class.to_nat i then IArray (map (\<lambda>x. IArray.of_fun (\<lambda>i. A $ mod_type_class.from_nat x $ mod_type_class.from_nat i) CARD('columns)) [0..<CARD('rows)]) !! ia !! mod_type_class.to_nat j else if ja = mod_type_class.to_nat j then IArray (map (\<lambda>x. IArray.of_fun (\<lambda>i. A $ mod_type_class.from_nat x $ mod_type_class.from_nat i) CARD('columns)) [0..<CARD('rows)]) !! ia !! mod_type_class.to_nat i else IArray (map (\<lambda>x. IArray.of_fun (\<lambda>i. A $ mod_type_class.from_nat x $ mod_type_class.from_nat i) CARD('columns)) [0..<CARD('rows)]) !! ia !! ja) CARD('columns)) CARD('rows)
[PROOF STEP]
by (auto simp add: to_nat_from_nat_id to_nat_less_card[of i] to_nat_less_card[of j])


[STATEMENT]
lemma mat_O_split:
  "mat_O = 1\<^sub>m N - 2 \<cdot>\<^sub>m proj_O"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat_O = 1\<^sub>m N - 2 \<cdot>\<^sub>m proj_O
[PROOF STEP]
apply (rule eq_matI)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>i j. \<lbrakk>i < dim_row (1\<^sub>m N - 2 \<cdot>\<^sub>m proj_O); j < dim_col (1\<^sub>m N - 2 \<cdot>\<^sub>m proj_O)\<rbrakk> \<Longrightarrow> mat_O $$ (i, j) = (1\<^sub>m N - 2 \<cdot>\<^sub>m proj_O) $$ (i, j)
 2. dim_row mat_O = dim_row (1\<^sub>m N - 2 \<cdot>\<^sub>m proj_O)
 3. dim_col mat_O = dim_col (1\<^sub>m N - 2 \<cdot>\<^sub>m proj_O)
[PROOF STEP]
unfolding mat_O_def proj_O_def
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>i j. \<lbrakk>i < dim_row (1\<^sub>m N - 2 \<cdot>\<^sub>m mat N N (\<lambda>(i, j). if i = j then if f i then 1 else 0 else 0)); j < dim_col (1\<^sub>m N - 2 \<cdot>\<^sub>m mat N N (\<lambda>(i, j). if i = j then if f i then 1 else 0 else 0))\<rbrakk> \<Longrightarrow> mat N N (\<lambda>(i, j). if i = j then if f i then - 1 else 1 else 0) $$ (i, j) = (1\<^sub>m N - 2 \<cdot>\<^sub>m mat N N (\<lambda>(i, j). if i = j then if f i then 1 else 0 else 0)) $$ (i, j)
 2. dim_row (mat N N (\<lambda>(i, j). if i = j then if f i then - 1 else 1 else 0)) = dim_row (1\<^sub>m N - 2 \<cdot>\<^sub>m mat N N (\<lambda>(i, j). if i = j then if f i then 1 else 0 else 0))
 3. dim_col (mat N N (\<lambda>(i, j). if i = j then if f i then - 1 else 1 else 0)) = dim_col (1\<^sub>m N - 2 \<cdot>\<^sub>m mat N N (\<lambda>(i, j). if i = j then if f i then 1 else 0 else 0))
[PROOF STEP]
by auto


[STATEMENT]
lemma sinvar_tainting_edges_def: "wf_graph G \<Longrightarrow>
    sinvar_tainting G nP \<longleftrightarrow> (\<forall> (v1,v2) \<in> edges G. \<forall>r \<in> (succ_tran G v1). nP v1 \<subseteq> nP r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wf_graph G \<Longrightarrow> sinvar_tainting G nP = (\<forall>(v1, v2)\<in>edges G. \<forall>r\<in>succ_tran G v1. nP v1 \<subseteq> nP r)
[PROOF STEP]
unfolding sinvar_tainting_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wf_graph G \<Longrightarrow> (\<forall>n\<in>nodes G. \<forall>r\<in>succ_tran G n. nP n \<subseteq> nP r) = (\<forall>(v1, v2)\<in>edges G. \<forall>r\<in>succ_tran G v1. nP v1 \<subseteq> nP r)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>wf_graph G; \<forall>n\<in>nodes G. \<forall>r\<in>succ_tran G n. nP n \<subseteq> nP r\<rbrakk> \<Longrightarrow> \<forall>(v1, v2)\<in>edges G. \<forall>r\<in>succ_tran G v1. nP v1 \<subseteq> nP r
 2. \<lbrakk>wf_graph G; \<forall>(v1, v2)\<in>edges G. \<forall>r\<in>succ_tran G v1. nP v1 \<subseteq> nP r\<rbrakk> \<Longrightarrow> \<forall>n\<in>nodes G. \<forall>r\<in>succ_tran G n. nP n \<subseteq> nP r
[PROOF STEP]
assume a1: "wf_graph G"
        and  a2: "\<forall>n\<in>nodes G. \<forall>r\<in>succ_tran G n. nP n \<subseteq> nP r"
[PROOF STATE]
proof (state)
this:
wf_graph G
\<forall>n\<in>nodes G. \<forall>r\<in>succ_tran G n. nP n \<subseteq> nP r

goal (2 subgoals):
 1. \<lbrakk>wf_graph G; \<forall>n\<in>nodes G. \<forall>r\<in>succ_tran G n. nP n \<subseteq> nP r\<rbrakk> \<Longrightarrow> \<forall>(v1, v2)\<in>edges G. \<forall>r\<in>succ_tran G v1. nP v1 \<subseteq> nP r
 2. \<lbrakk>wf_graph G; \<forall>(v1, v2)\<in>edges G. \<forall>r\<in>succ_tran G v1. nP v1 \<subseteq> nP r\<rbrakk> \<Longrightarrow> \<forall>n\<in>nodes G. \<forall>r\<in>succ_tran G n. nP n \<subseteq> nP r
[PROOF STEP]
from a1[simplified wf_graph_def]
[PROOF STATE]
proof (chain)
picking this:
(fst ` edges G \<subseteq> nodes G \<and> snd ` edges G \<subseteq> nodes G) \<and> finite (edges G) \<and> finite (nodes G)
[PROOF STEP]
have f1: "fst ` edges G \<subseteq> nodes G"
[PROOF STATE]
proof (prove)
using this:
(fst ` edges G \<subseteq> nodes G \<and> snd ` edges G \<subseteq> nodes G) \<and> finite (edges G) \<and> finite (nodes G)

goal (1 subgoal):
 1. fst ` edges G \<subseteq> nodes G
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
fst ` edges G \<subseteq> nodes G

goal (2 subgoals):
 1. \<lbrakk>wf_graph G; \<forall>n\<in>nodes G. \<forall>r\<in>succ_tran G n. nP n \<subseteq> nP r\<rbrakk> \<Longrightarrow> \<forall>(v1, v2)\<in>edges G. \<forall>r\<in>succ_tran G v1. nP v1 \<subseteq> nP r
 2. \<lbrakk>wf_graph G; \<forall>(v1, v2)\<in>edges G. \<forall>r\<in>succ_tran G v1. nP v1 \<subseteq> nP r\<rbrakk> \<Longrightarrow> \<forall>n\<in>nodes G. \<forall>r\<in>succ_tran G n. nP n \<subseteq> nP r
[PROOF STEP]
from f1 a2
[PROOF STATE]
proof (chain)
picking this:
fst ` edges G \<subseteq> nodes G
\<forall>n\<in>nodes G. \<forall>r\<in>succ_tran G n. nP n \<subseteq> nP r
[PROOF STEP]
have "\<forall>v \<in> (fst ` edges G). \<forall>r\<in>succ_tran G v. nP v \<subseteq> nP r"
[PROOF STATE]
proof (prove)
using this:
fst ` edges G \<subseteq> nodes G
\<forall>n\<in>nodes G. \<forall>r\<in>succ_tran G n. nP n \<subseteq> nP r

goal (1 subgoal):
 1. \<forall>v\<in>fst ` edges G. \<forall>r\<in>succ_tran G v. nP v \<subseteq> nP r
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>v\<in>fst ` edges G. \<forall>r\<in>succ_tran G v. nP v \<subseteq> nP r

goal (2 subgoals):
 1. \<lbrakk>wf_graph G; \<forall>n\<in>nodes G. \<forall>r\<in>succ_tran G n. nP n \<subseteq> nP r\<rbrakk> \<Longrightarrow> \<forall>(v1, v2)\<in>edges G. \<forall>r\<in>succ_tran G v1. nP v1 \<subseteq> nP r
 2. \<lbrakk>wf_graph G; \<forall>(v1, v2)\<in>edges G. \<forall>r\<in>succ_tran G v1. nP v1 \<subseteq> nP r\<rbrakk> \<Longrightarrow> \<forall>n\<in>nodes G. \<forall>r\<in>succ_tran G n. nP n \<subseteq> nP r
[PROOF STEP]
thus "\<forall>(v1, _)\<in>edges G. \<forall>r\<in>succ_tran G v1. nP v1 \<subseteq> nP r"
[PROOF STATE]
proof (prove)
using this:
\<forall>v\<in>fst ` edges G. \<forall>r\<in>succ_tran G v. nP v \<subseteq> nP r

goal (1 subgoal):
 1. \<forall>(v1, uu_)\<in>edges G. \<forall>r\<in>succ_tran G v1. nP v1 \<subseteq> nP r
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
\<forall>(v1, uu_)\<in>edges G. \<forall>r\<in>succ_tran G v1. nP v1 \<subseteq> nP r

goal (1 subgoal):
 1. \<lbrakk>wf_graph G; \<forall>(v1, v2)\<in>edges G. \<forall>r\<in>succ_tran G v1. nP v1 \<subseteq> nP r\<rbrakk> \<Longrightarrow> \<forall>n\<in>nodes G. \<forall>r\<in>succ_tran G n. nP n \<subseteq> nP r
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>wf_graph G; \<forall>(v1, v2)\<in>edges G. \<forall>r\<in>succ_tran G v1. nP v1 \<subseteq> nP r\<rbrakk> \<Longrightarrow> \<forall>n\<in>nodes G. \<forall>r\<in>succ_tran G n. nP n \<subseteq> nP r
[PROOF STEP]
assume a1: "wf_graph G"
        and  a2: "\<forall>(v1, v2)\<in>edges G. \<forall>r\<in>succ_tran G v1. nP v1 \<subseteq> nP r"
[PROOF STATE]
proof (state)
this:
wf_graph G
\<forall>(v1, v2)\<in>edges G. \<forall>r\<in>succ_tran G v1. nP v1 \<subseteq> nP r

goal (1 subgoal):
 1. \<lbrakk>wf_graph G; \<forall>(v1, v2)\<in>edges G. \<forall>r\<in>succ_tran G v1. nP v1 \<subseteq> nP r\<rbrakk> \<Longrightarrow> \<forall>n\<in>nodes G. \<forall>r\<in>succ_tran G n. nP n \<subseteq> nP r
[PROOF STEP]
from a2
[PROOF STATE]
proof (chain)
picking this:
\<forall>(v1, v2)\<in>edges G. \<forall>r\<in>succ_tran G v1. nP v1 \<subseteq> nP r
[PROOF STEP]
have g1: "\<forall> v \<in> (fst ` edges G). \<forall>r\<in>succ_tran G v. nP v \<subseteq> nP r"
[PROOF STATE]
proof (prove)
using this:
\<forall>(v1, v2)\<in>edges G. \<forall>r\<in>succ_tran G v1. nP v1 \<subseteq> nP r

goal (1 subgoal):
 1. \<forall>v\<in>fst ` edges G. \<forall>r\<in>succ_tran G v. nP v \<subseteq> nP r
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
\<forall>v\<in>fst ` edges G. \<forall>r\<in>succ_tran G v. nP v \<subseteq> nP r

goal (1 subgoal):
 1. \<lbrakk>wf_graph G; \<forall>(v1, v2)\<in>edges G. \<forall>r\<in>succ_tran G v1. nP v1 \<subseteq> nP r\<rbrakk> \<Longrightarrow> \<forall>n\<in>nodes G. \<forall>r\<in>succ_tran G n. nP n \<subseteq> nP r
[PROOF STEP]
from FiniteGraph.succ_tran_empty[OF a1]
[PROOF STATE]
proof (chain)
picking this:
?v \<notin> fst ` edges G \<Longrightarrow> succ_tran G ?v = {}
[PROOF STEP]
have g2: "\<forall> v. v \<notin> (fst ` edges G) \<longrightarrow> (\<forall>r\<in>succ_tran G v. nP v \<subseteq> nP r)"
[PROOF STATE]
proof (prove)
using this:
?v \<notin> fst ` edges G \<Longrightarrow> succ_tran G ?v = {}

goal (1 subgoal):
 1. \<forall>v. v \<notin> fst ` edges G \<longrightarrow> (\<forall>r\<in>succ_tran G v. nP v \<subseteq> nP r)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<forall>v. v \<notin> fst ` edges G \<longrightarrow> (\<forall>r\<in>succ_tran G v. nP v \<subseteq> nP r)

goal (1 subgoal):
 1. \<lbrakk>wf_graph G; \<forall>(v1, v2)\<in>edges G. \<forall>r\<in>succ_tran G v1. nP v1 \<subseteq> nP r\<rbrakk> \<Longrightarrow> \<forall>n\<in>nodes G. \<forall>r\<in>succ_tran G n. nP n \<subseteq> nP r
[PROOF STEP]
from g1 g2
[PROOF STATE]
proof (chain)
picking this:
\<forall>v\<in>fst ` edges G. \<forall>r\<in>succ_tran G v. nP v \<subseteq> nP r
\<forall>v. v \<notin> fst ` edges G \<longrightarrow> (\<forall>r\<in>succ_tran G v. nP v \<subseteq> nP r)
[PROOF STEP]
show "\<forall>n\<in>nodes G. \<forall>r\<in>succ_tran G n. nP n \<subseteq> nP r"
[PROOF STATE]
proof (prove)
using this:
\<forall>v\<in>fst ` edges G. \<forall>r\<in>succ_tran G v. nP v \<subseteq> nP r
\<forall>v. v \<notin> fst ` edges G \<longrightarrow> (\<forall>r\<in>succ_tran G v. nP v \<subseteq> nP r)

goal (1 subgoal):
 1. \<forall>n\<in>nodes G. \<forall>r\<in>succ_tran G n. nP n \<subseteq> nP r
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
\<forall>n\<in>nodes G. \<forall>r\<in>succ_tran G n. nP n \<subseteq> nP r

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma convex_hull_subset:
    "s \<subseteq> convex hull t \<Longrightarrow> convex hull s \<subseteq> convex hull t"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. s \<subseteq> convex hull t \<Longrightarrow> convex hull s \<subseteq> convex hull t
[PROOF STEP]
by (simp add: subset_hull)


[STATEMENT]
lemma integrable_spike_set_eq:
  fixes f :: "'n::euclidean_space \<Rightarrow> 'a::banach"
  assumes "negligible ((S - T) \<union> (T - S))"
  shows "f integrable_on S \<longleftrightarrow> f integrable_on T"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f integrable_on S) = (f integrable_on T)
[PROOF STEP]
by (blast intro: integrable_spike_set assms negligible_subset)


[STATEMENT]
lemma  trace_add: "trace ((A::'a::comm_semiring_1^'n^'n) + B) = trace A + trace B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. trace (A + B) = trace A + trace B
[PROOF STEP]
by (simp add: trace_def sum.distrib)


[STATEMENT]
lemma dim_eq_full:
  shows "dim S = dimension \<longleftrightarrow> span S = UNIV"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (dim S = dimension) = (span S = UNIV)
[PROOF STEP]
by (metis dim_eq_span dim_subset_UNIV span_Basis span_span subset_UNIV
        dim_UNIV dim_span dimension_def)


[STATEMENT]
lemma c_tl_c_drop: "c_tl (c_drop y x) = c_drop y (c_tl x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c_tl (c_drop y x) = c_drop y (c_tl x)
[PROOF STEP]
apply(induct y)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. c_tl (c_drop 0 x) = c_drop 0 (c_tl x)
 2. \<And>y. c_tl (c_drop y x) = c_drop y (c_tl x) \<Longrightarrow> c_tl (c_drop (Suc y) x) = c_drop (Suc y) (c_tl x)
[PROOF STEP]
apply(simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>y. c_tl (c_drop y x) = c_drop y (c_tl x) \<Longrightarrow> c_tl (c_drop (Suc y) x) = c_drop (Suc y) (c_tl x)
[PROOF STEP]
apply(simp add: c_drop_at_Suc)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma int_of_integer_less_iff: "int_of_integer x < int_of_integer y \<longleftrightarrow> x<y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (int_of_integer x < int_of_integer y) = (x < y)
[PROOF STEP]
by (simp add: less_integer_def)


[STATEMENT]
lemma (in gcd_condition_monoid) gcd_assoc:
  assumes "a \<in> carrier G"  "b \<in> carrier G"  "c \<in> carrier G"
  shows "somegcd G (somegcd G a b) c \<sim> somegcd G a (somegcd G b c)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. somegcd G (somegcd G a b) c \<sim> somegcd G a (somegcd G b c)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. somegcd G (somegcd G a b) c \<sim> somegcd G a (somegcd G b c)
[PROOF STEP]
interpret weak_lower_semilattice "division_rel G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. weak_lower_semilattice (division_rel G)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. somegcd G (somegcd G a b) c \<sim> somegcd G a (somegcd G b c)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. somegcd G (somegcd G a b) c \<sim> somegcd G a (somegcd G b c)
[PROOF STEP]
unfolding associated_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. somegcd G (somegcd G a b) c divides somegcd G a (somegcd G b c) \<and> somegcd G a (somegcd G b c) divides somegcd G (somegcd G a b) c
[PROOF STEP]
by (meson assms divides_trans gcd_divides gcd_divides_l gcd_divides_r gcd_exists)
[PROOF STATE]
proof (state)
this:
somegcd G (somegcd G a b) c \<sim> somegcd G a (somegcd G b c)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma NSDERIV_cmult: "NSDERIV f x :> D \<Longrightarrow> NSDERIV (\<lambda>x. c * f x) x :> c * D"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. NSDERIV f x :> D \<Longrightarrow> NSDERIV (\<lambda>x. c * f x) x :> c * D
[PROOF STEP]
unfolding times_divide_eq_right [symmetric] NSDERIV_NSLIM_iff
      minus_mult_right right_diff_distrib [symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>h. (f (x + h) - f x) / h) \<midarrow>0::'a\<rightarrow>\<^sub>N\<^sub>S D \<Longrightarrow> (\<lambda>h. c * ((f (x + h) - f x) / h)) \<midarrow>0::'a\<rightarrow>\<^sub>N\<^sub>S c * D
[PROOF STEP]
by (erule NSLIM_const [THEN NSLIM_mult])


[STATEMENT]
lemma mcont_lprefix_case [cont_intro, simp]:
  assumes "\<And>x. mcont lSup (\<sqsubseteq>) lSup (\<sqsubseteq>) (\<lambda>xs. f x xs (LCons x xs))"
  shows "mcont lSup (\<sqsubseteq>) lSup (\<sqsubseteq>) (\<lambda>xs. case xs of LNil \<Rightarrow> LNil | LCons x xs' \<Rightarrow> f x xs' xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mcont lSup (\<sqsubseteq>) lSup (\<sqsubseteq>) (\<lambda>xs. case xs of LNil \<Rightarrow> LNil | LCons x xs' \<Rightarrow> f x xs' xs)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
mcont lSup (\<sqsubseteq>) lSup (\<sqsubseteq>) (\<lambda>xs. f ?x xs (LCons ?x xs))

goal (1 subgoal):
 1. mcont lSup (\<sqsubseteq>) lSup (\<sqsubseteq>) (\<lambda>xs. case xs of LNil \<Rightarrow> LNil | LCons x xs' \<Rightarrow> f x xs' xs)
[PROOF STEP]
by(rule mcont_lprefix_case_aux)(simp_all add: llist_ccpo)


[STATEMENT]
theorem p48: "a = b \<or> c = d \<Longrightarrow> a = c \<or> b = d \<Longrightarrow> a = d \<or> b = c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a = b \<or> c = d; a = c \<or> b = d\<rbrakk> \<Longrightarrow> a = d \<or> b = c
[PROOF STEP]
by auto2


[STATEMENT]
lemma iso_Inf_subdistl:
  assumes "mono (f::'a \<Rightarrow> 'b::complete_lattice)"
  shows "f \<circ> Inf \<le> Inf \<circ> (`) f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<circ> Inf \<le> Inf \<circ> (`) f
[PROOF STEP]
by (simp add: assms complete_lattice_class.le_Inf_iff le_funI Inf_lower monoD)


[STATEMENT]
lemma dim_factorization_lattice:
  assumes "x < degree u + d"
  shows "dim_vec (factorization_lattice u d m ! x) = degree u + d"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_vec (factorization_lattice u d m ! x) = degree u + d
[PROOF STEP]
unfolding factorization_lattice_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_vec ((map (\<lambda>i. vec_of_poly_n (u * monom (1::'a) i) (degree u + d)) [d>..0] @ map (\<lambda>i. vec_of_poly_n (monom m i) (degree u + d)) [degree u>..0]) ! x) = degree u + d
[PROOF STEP]
using assms nth_append
[PROOF STATE]
proof (prove)
using this:
x < degree u + d
(?xs @ ?ys) ! ?n = (if ?n < length ?xs then ?xs ! ?n else ?ys ! (?n - length ?xs))

goal (1 subgoal):
 1. dim_vec ((map (\<lambda>i. vec_of_poly_n (u * monom (1::'a) i) (degree u + d)) [d>..0] @ map (\<lambda>i. vec_of_poly_n (monom m i) (degree u + d)) [degree u>..0]) ! x) = degree u + d
[PROOF STEP]
by (simp add: nth_append Let_def)


[STATEMENT]
lemma one_less_card: "Suc 0 < CARD('a::card2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Suc 0 < CARD('a)
[PROOF STEP]
using two_le_card [where 'a='a]
[PROOF STATE]
proof (prove)
using this:
2 \<le> CARD('a)

goal (1 subgoal):
 1. Suc 0 < CARD('a)
[PROOF STEP]
by simp


[STATEMENT]
lemma conv_compl: "(-x)\<^sup>\<smile> = -(x\<^sup>\<smile>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (- x)\<^sup>\<smile> = - x\<^sup>\<smile>
[PROOF STEP]
by (metis add_commute conv_add conv_compl_aux conv_invol)


[STATEMENT]
lemma evimage_Diff: "f \<inverse>\<^bsub>n\<^esub> (A - B) = (f \<inverse>\<^bsub>n\<^esub> A) - (f \<inverse>\<^bsub>n\<^esub> B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<inverse>\<^bsub>n\<^esub> (A - B) = f \<inverse>\<^bsub>n\<^esub> A - f \<inverse>\<^bsub>n\<^esub> B
[PROOF STEP]
unfolding evimage_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f -` (A - B) \<inter> carrier (R\<^bsup>n\<^esup>) = f -` A \<inter> carrier (R\<^bsup>n\<^esup>) - f -` B \<inter> carrier (R\<^bsup>n\<^esup>)
[PROOF STEP]
by blast


[STATEMENT]
lemma power_both_mono: "1 \<le> a \<Longrightarrow> m \<le> n \<Longrightarrow> a \<le> b \<Longrightarrow> a ^ m \<le> b ^ n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(1::'a) \<le> a; m \<le> n; a \<le> b\<rbrakk> \<Longrightarrow> a ^ m \<le> b ^ n
[PROOF STEP]
using power_mono[of a b n] power_increasing[of m n a]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>a \<le> b; (0::'a) \<le> a\<rbrakk> \<Longrightarrow> a ^ n \<le> b ^ n
\<lbrakk>m \<le> n; (1::'a) \<le> a\<rbrakk> \<Longrightarrow> a ^ m \<le> a ^ n

goal (1 subgoal):
 1. \<lbrakk>(1::'a) \<le> a; m \<le> n; a \<le> b\<rbrakk> \<Longrightarrow> a ^ m \<le> b ^ n
[PROOF STEP]
by (auto simp: order.trans[OF zero_le_one])


[STATEMENT]
lemma bind_def':
  "(f >>= g) \<equiv>
       \<lambda>s. ({(r'', s''). \<exists>(r', s') \<in> fst (f s). (r'', s'') \<in> fst (g r' s') },
                     snd (f s) \<or> (\<exists>(r', s') \<in> fst (f s). snd (g r' s')))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f >>= g \<equiv> \<lambda>s. ({(r'', s''). \<exists>(r', s')\<in>fst (f s). (r'', s'') \<in> fst (g r' s')}, snd (f s) \<or> (\<exists>(r', s')\<in>fst (f s). snd (g r' s')))
[PROOF STEP]
apply (rule eq_reflection)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f >>= g = (\<lambda>s. ({(r'', s''). \<exists>(r', s')\<in>fst (f s). (r'', s'') \<in> fst (g r' s')}, snd (f s) \<or> (\<exists>(r', s')\<in>fst (f s). snd (g r' s'))))
[PROOF STEP]
apply (auto simp add: bind_def split_def Let_def)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma set_add_0 [simp]:
  fixes A :: "'a::comm_monoid_add set"
  shows "{0} + A = A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {0::'a} + A = A
[PROOF STEP]
by (metis comm_monoid_add_class.add_0 set_zero)


[STATEMENT]
lemma fact_mono: "m \<le> n \<Longrightarrow> fact m \<le> (fact n :: 'a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. m \<le> n \<Longrightarrow> fact m \<le> fact n
[PROOF STEP]
by (metis of_nat_fact of_nat_le_iff fact_mono_nat)