[STATEMENT]
lemma int_step_then_rat_poly_step :
  assumes Some:"Some (a1,a2) = div_int_poly_step q b (Some (c1,c2))"
  shows "(rp a1,rp a2) = (div_rat_poly_step (rp q) \<circ> rat_of_int) b (rp c1,rp c2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (of_int_poly a1, of_int_poly a2) = (div_rat_poly_step (of_int_poly q) \<circ> rat_of_int) b (of_int_poly c1, of_int_poly c2)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (of_int_poly a1, of_int_poly a2) = (div_rat_poly_step (of_int_poly q) \<circ> rat_of_int) b (of_int_poly c1, of_int_poly c2)
[PROOF STEP]
note simps = div_int_poly_step_def option.simps Let_def divmod_int_def prod.simps
[PROOF STATE]
proof (state)
this:
div_int_poly_step ?q = (\<lambda>a sro. case sro of None \<Rightarrow> None | Some (s, r) \<Rightarrow> let ar = pCons a r; (b, m) = divmod_int (coeff ar (degree ?q)) (lead_coeff ?q) in if m = 0 then Some (pCons b s, ar - smult b ?q) else None)
(Some ?x2.0 = Some ?y2.0) = (?x2.0 = ?y2.0)
None \<noteq> Some ?x2.0
Some ?x2.0 \<noteq> None
(case None of None \<Rightarrow> ?f1.0 | Some x \<Rightarrow> ?f2.0 x) = ?f1.0
(case Some ?x2.0 of None \<Rightarrow> ?f1.0 | Some x \<Rightarrow> ?f2.0 x) = ?f2.0 ?x2.0
rec_option ?f1.0 ?f2.0 None = ?f1.0
rec_option ?f1.0 ?f2.0 (Some ?x2.0) = ?f2.0 ?x2.0
map_option ?f None = None
map_option ?f (Some ?x2.0) = Some (?f ?x2.0)
rel_option ?R None None
rel_option ?R (Some ?x2.0) (Some ?y2.0) = ?R ?x2.0 ?y2.0
\<not> rel_option ?R None (Some ?y2.0)
\<not> rel_option ?R (Some ?y2.0) None
set_option None = {}
set_option (Some ?x2.0) = {?x2.0}
Let ?s ?f \<equiv> ?f ?s
divmod_int ?n ?m = (?n div ?m, ?n mod ?m)
((?x1.0, ?x2.0) = (?y1.0, ?y2.0)) = (?x1.0 = ?y1.0 \<and> ?x2.0 = ?y2.0)
(case (?x1.0, ?x2.0) of (x, xa) \<Rightarrow> ?f x xa) = ?f ?x1.0 ?x2.0
old.rec_prod ?f1.0 (?a, ?b) = ?f1.0 ?a ?b

goal (1 subgoal):
 1. (of_int_poly a1, of_int_poly a2) = (div_rat_poly_step (of_int_poly q) \<circ> rat_of_int) b (of_int_poly c1, of_int_poly c2)
[PROOF STEP]
from Some[unfolded simps]
[PROOF STATE]
proof (chain)
picking this:
Some (a1, a2) = (if coeff (pCons b c2) (degree q) mod lead_coeff q = 0 then Some (pCons (coeff (pCons b c2) (degree q) div lead_coeff q) c1, pCons b c2 - smult (coeff (pCons b c2) (degree q) div lead_coeff q) q) else None)
[PROOF STEP]
have mod0: "coeff (pCons b c2) (degree q) mod coeff q (degree q) = 0"
[PROOF STATE]
proof (prove)
using this:
Some (a1, a2) = (if coeff (pCons b c2) (degree q) mod lead_coeff q = 0 then Some (pCons (coeff (pCons b c2) (degree q) div lead_coeff q) c1, pCons b c2 - smult (coeff (pCons b c2) (degree q) div lead_coeff q) q) else None)

goal (1 subgoal):
 1. coeff (pCons b c2) (degree q) mod lead_coeff q = 0
[PROOF STEP]
by (auto split: option.splits prod.splits if_splits)
[PROOF STATE]
proof (state)
this:
coeff (pCons b c2) (degree q) mod lead_coeff q = 0

goal (1 subgoal):
 1. (of_int_poly a1, of_int_poly a2) = (div_rat_poly_step (of_int_poly q) \<circ> rat_of_int) b (of_int_poly c1, of_int_poly c2)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
coeff (pCons b c2) (degree q) mod lead_coeff q = 0

goal (1 subgoal):
 1. (of_int_poly a1, of_int_poly a2) = (div_rat_poly_step (of_int_poly q) \<circ> rat_of_int) b (of_int_poly c1, of_int_poly c2)
[PROOF STEP]
using assms rat_int_poly_step_agree
[PROOF STATE]
proof (prove)
using this:
coeff (pCons b c2) (degree q) mod lead_coeff q = 0
Some (a1, a2) = div_int_poly_step q b (Some (c1, c2))
coeff (pCons ?b ?c2.0) (degree ?q) mod lead_coeff ?q = 0 \<Longrightarrow> ((of_int_poly ?a1.0, of_int_poly ?a2.0) = (div_rat_poly_step (of_int_poly ?q) \<circ> rat_of_int) ?b (of_int_poly ?c1.0, of_int_poly ?c2.0)) = (Some (?a1.0, ?a2.0) = div_int_poly_step ?q ?b (Some (?c1.0, ?c2.0)))

goal (1 subgoal):
 1. (of_int_poly a1, of_int_poly a2) = (div_rat_poly_step (of_int_poly q) \<circ> rat_of_int) b (of_int_poly c1, of_int_poly c2)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(of_int_poly a1, of_int_poly a2) = (div_rat_poly_step (of_int_poly q) \<circ> rat_of_int) b (of_int_poly c1, of_int_poly c2)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma par_two_sides_two_sides:
  assumes "A B Par C D" and
    "B D TS A C"
  shows "A C TS B D"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A C TS B D
[PROOF STEP]
by (metis Par_def TS_def assms(1) assms(2) invert_one_side invert_two_sides l12_6 l9_31 not_col_permutation_4 one_side_symmetry os_ts1324__os pars__os3412)


[STATEMENT]
lemma tl_lem1[rule_format]: "l \<noteq> [] \<longrightarrow> tl l = [] \<longrightarrow> length l = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. l \<noteq> [] \<longrightarrow> tl l = [] \<longrightarrow> length l = 1
[PROOF STEP]
by (induction l, simp+)


[STATEMENT]
lemma distinct_adj_mapD: "distinct_adj (map f xs) \<Longrightarrow> distinct_adj xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distinct_adj (map f xs) \<Longrightarrow> distinct_adj xs
[PROOF STEP]
unfolding distinct_adj_def successively_map
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. successively (\<lambda>x y. f x \<noteq> f y) xs \<Longrightarrow> successively (\<noteq>) xs
[PROOF STEP]
by (erule successively_mono) auto


[STATEMENT]
lemma elem_in_uniq_set:
  assumes in_set: "x \<in> A"
      and part: "P partitions A"
  shows "\<exists>! X \<in> P . x \<in> X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>!X. X \<in> P \<and> x \<in> X
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>!X. X \<in> P \<and> x \<in> X
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
x \<in> A
P partitions A
[PROOF STEP]
obtain X where *: "X \<in> P \<and> x \<in> X"
[PROOF STATE]
proof (prove)
using this:
x \<in> A
P partitions A

goal (1 subgoal):
 1. (\<And>X. X \<in> P \<and> x \<in> X \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (rule elem_in_partition) blast
[PROOF STATE]
proof (state)
this:
X \<in> P \<and> x \<in> X

goal (1 subgoal):
 1. \<exists>!X. X \<in> P \<and> x \<in> X
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
X \<in> P \<and> x \<in> X

goal (1 subgoal):
 1. \<exists>!X. X \<in> P \<and> x \<in> X
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
X \<in> P \<and> x \<in> X

goal (1 subgoal):
 1. \<exists>!X. X \<in> P \<and> x \<in> X
[PROOF STEP]
fix Y
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>!X. X \<in> P \<and> x \<in> X
[PROOF STEP]
assume "Y \<in> P \<and> x \<in> Y"
[PROOF STATE]
proof (state)
this:
Y \<in> P \<and> x \<in> Y

goal (1 subgoal):
 1. \<exists>!X. X \<in> P \<and> x \<in> X
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
Y \<in> P \<and> x \<in> Y
[PROOF STEP]
have "Y = X"
[PROOF STATE]
proof (prove)
using this:
Y \<in> P \<and> x \<in> Y

goal (1 subgoal):
 1. Y = X
[PROOF STEP]
using part in_set *
[PROOF STATE]
proof (prove)
using this:
Y \<in> P \<and> x \<in> Y
P partitions A
x \<in> A
X \<in> P \<and> x \<in> X

goal (1 subgoal):
 1. Y = X
[PROOF STEP]
unfolding is_partition_of_def is_non_overlapping_def
[PROOF STATE]
proof (prove)
using this:
Y \<in> P \<and> x \<in> Y
\<Union> P = A \<and> (\<forall>X\<in>P. \<forall>Y\<in>P. (X \<inter> Y \<noteq> {}) = (X = Y))
x \<in> A
X \<in> P \<and> x \<in> X

goal (1 subgoal):
 1. Y = X
[PROOF STEP]
by (metis disjoint_iff_not_equal)
[PROOF STATE]
proof (state)
this:
Y = X

goal (1 subgoal):
 1. \<exists>!X. X \<in> P \<and> x \<in> X
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
?Y2 \<in> P \<and> x \<in> ?Y2 \<Longrightarrow> ?Y2 = X

goal (1 subgoal):
 1. \<exists>!X. X \<in> P \<and> x \<in> X
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
X \<in> P \<and> x \<in> X
?Y2 \<in> P \<and> x \<in> ?Y2 \<Longrightarrow> ?Y2 = X
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
X \<in> P \<and> x \<in> X
?Y2 \<in> P \<and> x \<in> ?Y2 \<Longrightarrow> ?Y2 = X

goal (1 subgoal):
 1. \<exists>!X. X \<in> P \<and> x \<in> X
[PROOF STEP]
by (rule ex1I)
[PROOF STATE]
proof (state)
this:
\<exists>!X. X \<in> P \<and> x \<in> X

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma diagvector_const[simp]: "diagvector (\<lambda> x. k) = mat k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. diagvector (\<lambda>x. k) = mat k
[PROOF STEP]
unfolding diagvector_def mat_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<chi>i j. if i = j then k else (0::'a)) = (\<chi>i j. if i = j then k else (0::'a))
[PROOF STEP]
by auto


[STATEMENT]
lemma iprev_closed: "n \<in> I \<Longrightarrow> iprev n I \<in> I"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n \<in> I \<Longrightarrow> iprev n I \<in> I
[PROOF STEP]
apply (clarsimp simp: iprev_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>n \<in> I; I \<down>< n \<noteq> {}\<rbrakk> \<Longrightarrow> Max (I \<down>< n) \<in> I
[PROOF STEP]
apply (rule subsetD[of "I \<down>< n"], fastforce)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>n \<in> I; I \<down>< n \<noteq> {}\<rbrakk> \<Longrightarrow> Max (I \<down>< n) \<in> I \<down>< n
[PROOF STEP]
by (rule Max_in[OF nat_cut_less_finite])


[STATEMENT]
lemma foldli_size_aux: "distinct (map fst l)
    \<Longrightarrow> foldli l (\<lambda>_. True) (\<lambda>_ n. Suc n) n = n + op_map_size (map_of l)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distinct (map fst l) \<Longrightarrow> foldli l (\<lambda>_. True) (\<lambda>_. Suc) n = n + op_map_size (map_of l)
[PROOF STEP]
apply (induct l arbitrary: n)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>n. distinct (map fst []) \<Longrightarrow> foldli [] (\<lambda>_. True) (\<lambda>_. Suc) n = n + op_map_size (map_of [])
 2. \<And>a l n. \<lbrakk>\<And>n. distinct (map fst l) \<Longrightarrow> foldli l (\<lambda>_. True) (\<lambda>_. Suc) n = n + op_map_size (map_of l); distinct (map fst (a # l))\<rbrakk> \<Longrightarrow> foldli (a # l) (\<lambda>_. True) (\<lambda>_. Suc) n = n + op_map_size (map_of (a # l))
[PROOF STEP]
apply (auto simp: dom_map_of_conv_image_fst)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma interleavings_filter_eq1:
  assumes "interleavings xs ys zs"
  assumes "(\<forall>x\<in>set xs. P x) \<and> (\<forall>y\<in>set ys. \<not> P y)"
  shows "filter P zs = xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. filter P zs = xs
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
interleavings xs ys zs
(\<forall>x\<in>set xs. P x) \<and> (\<forall>y\<in>set ys. \<not> P y)

goal (1 subgoal):
 1. filter P zs = xs
[PROOF STEP]
by (induct rule: interleavings.induct) auto


[STATEMENT]
lemma traces_list_all:
  "trace c T c' \<Longrightarrow> P c' \<Longrightarrow> (\<And> c c'. c \<Rightarrow> c' \<Longrightarrow> P c' \<Longrightarrow> P c) \<Longrightarrow> (\<forall> x\<in>set T. P x) \<and> P c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>trace c T c'; P c'; \<And>c c'. \<lbrakk>c \<Rightarrow> c'; P c'\<rbrakk> \<Longrightarrow> P c\<rbrakk> \<Longrightarrow> (\<forall>x\<in>set T. P x) \<and> P c
[PROOF STEP]
by (induction rule:trace.induct) auto


[STATEMENT]
lemma (in Congruence_Rule) Seg_not_Eq_Point :
  assumes
    "\<not> Eq (Geos (Seg (Se A B)) add Emp) (Geos (Seg (Se A C)) add Emp)"
  shows "\<not> Eq (Geos (Poi B) add Emp) (Geos (Poi C) add Emp)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> Eq (Geos (Poi B) add Emp) (Geos (Poi C) add Emp)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> Eq (Geos (Poi B) add Emp) (Geos (Poi C) add Emp)
[PROOF STEP]
have P1 : "Eq (Geos (Poi B) add Emp) (Geos (Poi C) add Emp) \<Longrightarrow>
    Eq (Geos (Seg (Se A B)) add Emp) (Geos (Seg (Se A C)) add Emp)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Eq (Geos (Poi B) add Emp) (Geos (Poi C) add Emp) \<Longrightarrow> Eq (Geos (Seg (Se A B)) add Emp) (Geos (Seg (Se A C)) add Emp)
[PROOF STEP]
by (simp add:Seg_Point_Eq)
[PROOF STATE]
proof (state)
this:
Eq (Geos (Poi B) add Emp) (Geos (Poi C) add Emp) \<Longrightarrow> Eq (Geos (Seg (Se A B)) add Emp) (Geos (Seg (Se A C)) add Emp)

goal (1 subgoal):
 1. \<not> Eq (Geos (Poi B) add Emp) (Geos (Poi C) add Emp)
[PROOF STEP]
from assms P1
[PROOF STATE]
proof (chain)
picking this:
\<not> Eq (Geos (Seg (Se A B)) add Emp) (Geos (Seg (Se A C)) add Emp)
Eq (Geos (Poi B) add Emp) (Geos (Poi C) add Emp) \<Longrightarrow> Eq (Geos (Seg (Se A B)) add Emp) (Geos (Seg (Se A C)) add Emp)
[PROOF STEP]
show "\<not> Eq (Geos (Poi B) add Emp) (Geos (Poi C) add Emp)"
[PROOF STATE]
proof (prove)
using this:
\<not> Eq (Geos (Seg (Se A B)) add Emp) (Geos (Seg (Se A C)) add Emp)
Eq (Geos (Poi B) add Emp) (Geos (Poi C) add Emp) \<Longrightarrow> Eq (Geos (Seg (Se A B)) add Emp) (Geos (Seg (Se A C)) add Emp)

goal (1 subgoal):
 1. \<not> Eq (Geos (Poi B) add Emp) (Geos (Poi C) add Emp)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<not> Eq (Geos (Poi B) add Emp) (Geos (Poi C) add Emp)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma cindex_pathE_linepath_on:
  assumes "z \<in> closed_segment a b"
  shows "cindex_pathE (linepath a b) z  = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cindex_pathE (linepath a b) z = 0
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. cindex_pathE (linepath a b) z = 0
[PROOF STEP]
obtain u where "0\<le>u" "u\<le>1"
      and z_eq:"z = complex_of_real (1 - u) * a + complex_of_real u * b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>u. \<lbrakk>0 \<le> u; u \<le> 1; z = complex_of_real (1 - u) * a + complex_of_real u * b\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
z \<in> closed_segment a b

goal (1 subgoal):
 1. (\<And>u. \<lbrakk>0 \<le> u; u \<le> 1; z = complex_of_real (1 - u) * a + complex_of_real u * b\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding in_segment scaleR_conv_of_real
[PROOF STATE]
proof (prove)
using this:
\<exists>u\<ge>0. u \<le> 1 \<and> z = complex_of_real (1 - u) * a + complex_of_real u * b

goal (1 subgoal):
 1. (\<And>u. \<lbrakk>0 \<le> u; u \<le> 1; z = complex_of_real (1 - u) * a + complex_of_real u * b\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 \<le> u
u \<le> 1
z = complex_of_real (1 - u) * a + complex_of_real u * b

goal (1 subgoal):
 1. cindex_pathE (linepath a b) z = 0
[PROOF STEP]
define U where "U = [:-u, 1:]"
[PROOF STATE]
proof (state)
this:
U = [:- u, 1:]

goal (1 subgoal):
 1. cindex_pathE (linepath a b) z = 0
[PROOF STEP]
have "U\<noteq>0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. U \<noteq> 0
[PROOF STEP]
unfolding U_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [:- u, 1:] \<noteq> 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
U \<noteq> 0

goal (1 subgoal):
 1. cindex_pathE (linepath a b) z = 0
[PROOF STEP]
have "cindex_pathE (linepath a b) z
        = cindexE 0 1 (\<lambda>t. (Im a + t * Im b - (Im z + t * Im a))
                          / (Re a + t * Re b - (Re z + t * Re a)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cindex_pathE (linepath a b) z = cindexE 0 1 (\<lambda>t. (Im a + t * Im b - (Im z + t * Im a)) / (Re a + t * Re b - (Re z + t * Re a)))
[PROOF STEP]
unfolding cindex_pathE_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cindexE 0 1 (\<lambda>t. Im (linepath a b t - z) / Re (linepath a b t - z)) = cindexE 0 1 (\<lambda>t. (Im a + t * Im b - (Im z + t * Im a)) / (Re a + t * Re b - (Re z + t * Re a)))
[PROOF STEP]
by (simp add:linepath_def algebra_simps)
[PROOF STATE]
proof (state)
this:
cindex_pathE (linepath a b) z = cindexE 0 1 (\<lambda>t. (Im a + t * Im b - (Im z + t * Im a)) / (Re a + t * Re b - (Re z + t * Re a)))

goal (1 subgoal):
 1. cindex_pathE (linepath a b) z = 0
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
cindex_pathE (linepath a b) z = cindexE 0 1 (\<lambda>t. (Im a + t * Im b - (Im z + t * Im a)) / (Re a + t * Re b - (Re z + t * Re a)))

goal (1 subgoal):
 1. cindex_pathE (linepath a b) z = 0
[PROOF STEP]
have "...  = cindexE 0 1
     (\<lambda>t. ( (Im b - Im a) * (t-u))
        / ( (Re b - Re a) * (t-u)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cindexE 0 1 (\<lambda>t. (Im a + t * Im b - (Im z + t * Im a)) / (Re a + t * Re b - (Re z + t * Re a))) = cindexE 0 1 (\<lambda>t. (Im b - Im a) * (t - u) / ((Re b - Re a) * (t - u)))
[PROOF STEP]
unfolding z_eq
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cindexE 0 1 (\<lambda>t. (Im a + t * Im b - (Im (complex_of_real (1 - u) * a + complex_of_real u * b) + t * Im a)) / (Re a + t * Re b - (Re (complex_of_real (1 - u) * a + complex_of_real u * b) + t * Re a))) = cindexE 0 1 (\<lambda>t. (Im b - Im a) * (t - u) / ((Re b - Re a) * (t - u)))
[PROOF STEP]
by (simp add:algebra_simps)
[PROOF STATE]
proof (state)
this:
cindexE 0 1 (\<lambda>t. (Im a + t * Im b - (Im z + t * Im a)) / (Re a + t * Re b - (Re z + t * Re a))) = cindexE 0 1 (\<lambda>t. (Im b - Im a) * (t - u) / ((Re b - Re a) * (t - u)))

goal (1 subgoal):
 1. cindex_pathE (linepath a b) z = 0
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
cindexE 0 1 (\<lambda>t. (Im a + t * Im b - (Im z + t * Im a)) / (Re a + t * Re b - (Re z + t * Re a))) = cindexE 0 1 (\<lambda>t. (Im b - Im a) * (t - u) / ((Re b - Re a) * (t - u)))

goal (1 subgoal):
 1. cindex_pathE (linepath a b) z = 0
[PROOF STEP]
have "... = cindex_polyE 0 1 (U*[:Im b - Im a:]) (U*[:Re b - Re a:])"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cindexE 0 1 (\<lambda>t. (Im b - Im a) * (t - u) / ((Re b - Re a) * (t - u))) = cindex_polyE 0 1 (U * [:Im b - Im a:]) (U * [:Re b - Re a:])
[PROOF STEP]
proof (subst cindexE_eq_cindex_polyE[symmetric])
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. 0 < 1
 2. cindexE 0 1 (\<lambda>t. (Im b - Im a) * (t - u) / ((Re b - Re a) * (t - u))) = cindexE 0 1 (\<lambda>x. poly (U * [:Im b - Im a:]) x / poly (U * [:Re b - Re a:]) x)
[PROOF STEP]
have " (Im b - Im a) * (t - u) / ((Re b - Re a) * (t - u))
            =  poly (U * [:Im b - Im a:]) t / poly (U * [:Re b - Re a:]) t" for t
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (Im b - Im a) * (t - u) / ((Re b - Re a) * (t - u)) = poly (U * [:Im b - Im a:]) t / poly (U * [:Re b - Re a:]) t
[PROOF STEP]
unfolding U_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (Im b - Im a) * (t - u) / ((Re b - Re a) * (t - u)) = poly ([:- u, 1:] * [:Im b - Im a:]) t / poly ([:- u, 1:] * [:Re b - Re a:]) t
[PROOF STEP]
by (simp add:algebra_simps)
[PROOF STATE]
proof (state)
this:
(Im b - Im a) * (?t - u) / ((Re b - Re a) * (?t - u)) = poly (U * [:Im b - Im a:]) ?t / poly (U * [:Re b - Re a:]) ?t

goal (2 subgoals):
 1. 0 < 1
 2. cindexE 0 1 (\<lambda>t. (Im b - Im a) * (t - u) / ((Re b - Re a) * (t - u))) = cindexE 0 1 (\<lambda>x. poly (U * [:Im b - Im a:]) x / poly (U * [:Re b - Re a:]) x)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(Im b - Im a) * (?t - u) / ((Re b - Re a) * (?t - u)) = poly (U * [:Im b - Im a:]) ?t / poly (U * [:Re b - Re a:]) ?t
[PROOF STEP]
show "cindexE 0 1 (\<lambda>t. (Im b - Im a) * (t - u) / ((Re b - Re a) * (t - u))) =
                  cindexE 0 1 (\<lambda>x. poly (U * [:Im b - Im a:]) x / poly (U * [:Re b - Re a:]) x)"
[PROOF STATE]
proof (prove)
using this:
(Im b - Im a) * (?t - u) / ((Re b - Re a) * (?t - u)) = poly (U * [:Im b - Im a:]) ?t / poly (U * [:Re b - Re a:]) ?t

goal (1 subgoal):
 1. cindexE 0 1 (\<lambda>t. (Im b - Im a) * (t - u) / ((Re b - Re a) * (t - u))) = cindexE 0 1 (\<lambda>x. poly (U * [:Im b - Im a:]) x / poly (U * [:Re b - Re a:]) x)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
cindexE 0 1 (\<lambda>t. (Im b - Im a) * (t - u) / ((Re b - Re a) * (t - u))) = cindexE 0 1 (\<lambda>x. poly (U * [:Im b - Im a:]) x / poly (U * [:Re b - Re a:]) x)

goal (1 subgoal):
 1. 0 < 1
[PROOF STEP]
qed simp
[PROOF STATE]
proof (state)
this:
cindexE 0 1 (\<lambda>t. (Im b - Im a) * (t - u) / ((Re b - Re a) * (t - u))) = cindex_polyE 0 1 (U * [:Im b - Im a:]) (U * [:Re b - Re a:])

goal (1 subgoal):
 1. cindex_pathE (linepath a b) z = 0
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
cindexE 0 1 (\<lambda>t. (Im b - Im a) * (t - u) / ((Re b - Re a) * (t - u))) = cindex_polyE 0 1 (U * [:Im b - Im a:]) (U * [:Re b - Re a:])

goal (1 subgoal):
 1. cindex_pathE (linepath a b) z = 0
[PROOF STEP]
have "... = cindex_polyE 0 1 [:Im b - Im a:] [:Re b - Re a:]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cindex_polyE 0 1 (U * [:Im b - Im a:]) (U * [:Re b - Re a:]) = cindex_polyE 0 1 [:Im b - Im a:] [:Re b - Re a:]
[PROOF STEP]
apply (rule cindex_polyE_mult_cancel)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. U \<noteq> 0
[PROOF STEP]
by fact
[PROOF STATE]
proof (state)
this:
cindex_polyE 0 1 (U * [:Im b - Im a:]) (U * [:Re b - Re a:]) = cindex_polyE 0 1 [:Im b - Im a:] [:Re b - Re a:]

goal (1 subgoal):
 1. cindex_pathE (linepath a b) z = 0
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
cindex_polyE 0 1 (U * [:Im b - Im a:]) (U * [:Re b - Re a:]) = cindex_polyE 0 1 [:Im b - Im a:] [:Re b - Re a:]

goal (1 subgoal):
 1. cindex_pathE (linepath a b) z = 0
[PROOF STEP]
have "... = cindexE 0 1 (\<lambda>x. (Im b - Im a) / (Re b - Re a))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cindex_polyE 0 1 [:Im b - Im a:] [:Re b - Re a:] = cindexE 0 1 (\<lambda>x. (Im b - Im a) / (Re b - Re a))
[PROOF STEP]
apply (subst cindexE_eq_cindex_polyE[symmetric])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. 0 < 1
 2. cindexE 0 1 (\<lambda>x. poly [:Im b - Im a:] x / poly [:Re b - Re a:] x) = cindexE 0 1 (\<lambda>x. (Im b - Im a) / (Re b - Re a))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
cindex_polyE 0 1 [:Im b - Im a:] [:Re b - Re a:] = cindexE 0 1 (\<lambda>x. (Im b - Im a) / (Re b - Re a))

goal (1 subgoal):
 1. cindex_pathE (linepath a b) z = 0
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
cindex_polyE 0 1 [:Im b - Im a:] [:Re b - Re a:] = cindexE 0 1 (\<lambda>x. (Im b - Im a) / (Re b - Re a))

goal (1 subgoal):
 1. cindex_pathE (linepath a b) z = 0
[PROOF STEP]
have "... = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cindexE 0 1 (\<lambda>x. (Im b - Im a) / (Re b - Re a)) = 0
[PROOF STEP]
apply (rule cindexE_constI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>t. \<lbrakk>0 < t; t < 1\<rbrakk> \<Longrightarrow> (Im b - Im a) / (Re b - Re a) = ?c
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
cindexE 0 1 (\<lambda>x. (Im b - Im a) / (Re b - Re a)) = 0

goal (1 subgoal):
 1. cindex_pathE (linepath a b) z = 0
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
cindex_pathE (linepath a b) z = 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
cindex_pathE (linepath a b) z = 0

goal (1 subgoal):
 1. cindex_pathE (linepath a b) z = 0
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
cindex_pathE (linepath a b) z = 0

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma le_exps_pref:  "k \<le> l \<Longrightarrow> r\<^sup>@k \<le>p r\<^sup>@l"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. k \<le> l \<Longrightarrow> r \<^sup>@ k \<le>p r \<^sup>@ l
[PROOF STEP]
using leI pop_pow[of k l r]
[PROOF STATE]
proof (prove)
using this:
\<not> ?x < ?y \<Longrightarrow> ?y \<le> ?x
k \<le> l \<Longrightarrow> r \<^sup>@ k \<cdot> r \<^sup>@ (l - k) = r \<^sup>@ l

goal (1 subgoal):
 1. k \<le> l \<Longrightarrow> r \<^sup>@ k \<le>p r \<^sup>@ l
[PROOF STEP]
by blast


[STATEMENT]
lemma size_Suc_Diff1: "x \<in># M \<Longrightarrow> Suc (size (M - {#x#})) = size M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in># M \<Longrightarrow> Suc (size (M - {#x#})) = size M
[PROOF STEP]
using arg_cong[OF insert_DiffM, of _ _ size]
[PROOF STATE]
proof (prove)
using this:
?x1 \<in># ?y \<Longrightarrow> size (add_mset ?x1 (?y - {#?x1#})) = size ?y

goal (1 subgoal):
 1. x \<in># M \<Longrightarrow> Suc (size (M - {#x#})) = size M
[PROOF STEP]
by simp


[STATEMENT]
lemma Var_eq_subst_iff: "Var z = t[x \<^bold>\<rightarrow>t y] \<longleftrightarrow> (if z = x then x = y \<and> t = Var x else
  if z = y then t = Var x \<or> t = Var y else t = Var z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (Var z = t[x \<^bold>\<rightarrow>t y]) = (if z = x then x = y \<and> t = Var x else if z = y then t = Var x \<or> t = Var y else t = Var z)
[PROOF STEP]
by (cases t) auto


[STATEMENT]
lemma (in module) lincomb_not_depend:
  fixes a A N
  assumes h1: "finite A" and h2: "A\<subseteq>N" and h3: "submodule R N M" and h4: "a:A\<rightarrow>carrier R"
  shows "lincomb a A = module.lincomb (md N) a A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lincomb a A = module.lincomb (md N) a A
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. lincomb a A = module.lincomb (md N) a A
[PROOF STEP]
from h3
[PROOF STATE]
proof (chain)
picking this:
LinearCombinations.submodule R N M
[PROOF STEP]
interpret N: module R "(md N)"
[PROOF STATE]
proof (prove)
using this:
LinearCombinations.submodule R N M

goal (1 subgoal):
 1. module R (md N)
[PROOF STEP]
by (rule submodule_is_module)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. lincomb a A = N.lincomb a A
[PROOF STEP]
have 3: "N=carrier (md N)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. N = carrier (md N)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
N = carrier (md N)

goal (1 subgoal):
 1. lincomb a A = N.lincomb a A
[PROOF STEP]
have 4: "(smult M ) = (smult (md N))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<odot>\<^bsub>M\<^esub>) = (\<odot>\<^bsub>md N\<^esub>)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<odot>\<^bsub>M\<^esub>) = (\<odot>\<^bsub>md N\<^esub>)

goal (1 subgoal):
 1. lincomb a A = N.lincomb a A
[PROOF STEP]
from h1 h2 h3 h4
[PROOF STATE]
proof (chain)
picking this:
finite A
A \<subseteq> N
LinearCombinations.submodule R N M
a \<in> A \<rightarrow> carrier R
[PROOF STEP]
have "(\<Oplus>\<^bsub>(md N)\<^esub>v\<in>A. a v \<odot>\<^bsub>M\<^esub> v) = (\<Oplus>\<^bsub>M\<^esub>v\<in>A. a v \<odot>\<^bsub>M\<^esub> v)"
[PROOF STATE]
proof (prove)
using this:
finite A
A \<subseteq> N
LinearCombinations.submodule R N M
a \<in> A \<rightarrow> carrier R

goal (1 subgoal):
 1. (\<Oplus>\<^bsub>md N\<^esub>v\<in>A. a v \<odot>\<^bsub>M\<^esub> v) = (\<Oplus>\<^bsub>M\<^esub>v\<in>A. a v \<odot>\<^bsub>M\<^esub> v)
[PROOF STEP]
apply (intro finsum_not_depend)
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<lbrakk>finite A; A \<subseteq> N; LinearCombinations.submodule R N M; a \<in> A \<rightarrow> carrier R\<rbrakk> \<Longrightarrow> finite A
 2. \<lbrakk>finite A; A \<subseteq> N; LinearCombinations.submodule R N M; a \<in> A \<rightarrow> carrier R\<rbrakk> \<Longrightarrow> A \<subseteq> N
 3. \<lbrakk>finite A; A \<subseteq> N; LinearCombinations.submodule R N M; a \<in> A \<rightarrow> carrier R\<rbrakk> \<Longrightarrow> LinearCombinations.submodule R N M
 4. \<lbrakk>finite A; A \<subseteq> N; LinearCombinations.submodule R N M; a \<in> A \<rightarrow> carrier R\<rbrakk> \<Longrightarrow> (\<lambda>v. a v \<odot>\<^bsub>M\<^esub> v) \<in> A \<rightarrow> N
[PROOF STEP]
using N.summands_valid
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?A \<subseteq> carrier (md N); ?a \<in> ?A \<rightarrow> carrier R\<rbrakk> \<Longrightarrow> \<forall>v\<in>?A. ?a v \<odot>\<^bsub>md N\<^esub> v \<in> carrier (md N)

goal (4 subgoals):
 1. \<lbrakk>finite A; A \<subseteq> N; LinearCombinations.submodule R N M; a \<in> A \<rightarrow> carrier R\<rbrakk> \<Longrightarrow> finite A
 2. \<lbrakk>finite A; A \<subseteq> N; LinearCombinations.submodule R N M; a \<in> A \<rightarrow> carrier R\<rbrakk> \<Longrightarrow> A \<subseteq> N
 3. \<lbrakk>finite A; A \<subseteq> N; LinearCombinations.submodule R N M; a \<in> A \<rightarrow> carrier R\<rbrakk> \<Longrightarrow> LinearCombinations.submodule R N M
 4. \<lbrakk>finite A; A \<subseteq> N; LinearCombinations.submodule R N M; a \<in> A \<rightarrow> carrier R\<rbrakk> \<Longrightarrow> (\<lambda>v. a v \<odot>\<^bsub>M\<^esub> v) \<in> A \<rightarrow> N
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<Oplus>\<^bsub>md N\<^esub>v\<in>A. a v \<odot>\<^bsub>M\<^esub> v) = (\<Oplus>\<^bsub>M\<^esub>v\<in>A. a v \<odot>\<^bsub>M\<^esub> v)

goal (1 subgoal):
 1. lincomb a A = N.lincomb a A
[PROOF STEP]
from this
[PROOF STATE]
proof (chain)
picking this:
(\<Oplus>\<^bsub>md N\<^esub>v\<in>A. a v \<odot>\<^bsub>M\<^esub> v) = (\<Oplus>\<^bsub>M\<^esub>v\<in>A. a v \<odot>\<^bsub>M\<^esub> v)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<Oplus>\<^bsub>md N\<^esub>v\<in>A. a v \<odot>\<^bsub>M\<^esub> v) = (\<Oplus>\<^bsub>M\<^esub>v\<in>A. a v \<odot>\<^bsub>M\<^esub> v)

goal (1 subgoal):
 1. lincomb a A = N.lincomb a A
[PROOF STEP]
by (unfold lincomb_def N.lincomb_def, simp)
[PROOF STATE]
proof (state)
this:
lincomb a A = N.lincomb a A

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma is_monic_setD:
  assumes "is_monic_set B" and "b \<in> B" and "b \<noteq> 0"
  shows "lc b = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lc b = (1::'b)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
is_monic_set B
b \<in> B
b \<noteq> 0

goal (1 subgoal):
 1. lc b = (1::'b)
[PROOF STEP]
unfolding is_monic_set_def
[PROOF STATE]
proof (prove)
using this:
\<forall>b\<in>B. b \<noteq> 0 \<longrightarrow> lc b = (1::'b)
b \<in> B
b \<noteq> 0

goal (1 subgoal):
 1. lc b = (1::'b)
[PROOF STEP]
by auto


[STATEMENT]
lemma [simp]: "(\<forall>x\<in>set s_s'_list. case x of (s_XXX, s_') \<Rightarrow> tr_s T s_XXX s_' \<and> tr_s_f T s_XXX = s_') \<longrightarrow>
       tr_ss_f T (map fst s_s'_list) = map snd s_s'_list"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>x\<in>set s_s'_list. case x of (s_XXX, s_') \<Rightarrow> tr_s T s_XXX s_' \<and> tr_s_f T s_XXX = s_') \<longrightarrow> tr_ss_f T (map fst s_s'_list) = map snd s_s'_list
[PROOF STEP]
by (induct s_s'_list, auto)


[STATEMENT]
lemma (in padic_integers) mod_in_carrier:
  "a mod (p^n) \<in> carrier (Zp_res_ring n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a mod p ^ n \<in> carrier (residue_ring (p ^ n))
[PROOF STEP]
using p_residue_alt_def p_residue_range'
[PROOF STATE]
proof (prove)
using this:
p_residue ?m ?n = ?n mod p ^ ?m
p_residue ?m ?n \<in> carrier (residue_ring (p ^ ?m))

goal (1 subgoal):
 1. a mod p ^ n \<in> carrier (residue_ring (p ^ n))
[PROOF STEP]
by auto


[STATEMENT]
lemma twisted_cartesian_product_memI:
  assumes "\<pi>\<^bsub>S\<^esub> a \<in> A"
  assumes "\<pi>\<^bsub>S'\<^esub> a \<in> B"
  assumes "length a = card S + card S'"
  shows "a \<in> twisted_cartesian_product S S' A B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<in> Prod\<^bsub>S, S'\<^esub> A B
[PROOF STEP]
by (metis (mono_tags, lifting) assms(1) assms(2) assms(3) mem_Collect_eq twisted_cartesian_product_def)


[STATEMENT]
lemma is_K33_component_size_step1:
  assumes comp:"is_K33_component_size_inv G k blue blue_cnt"
  assumes blue: "blue (ig_verts G ! k)"
  shows "is_K33_component_size_inv G (Suc k) blue (Suc blue_cnt)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_K33_component_size_inv G (Suc k) blue (Suc blue_cnt)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. is_K33_component_size_inv G (Suc k) blue (Suc blue_cnt)
[PROOF STEP]
have "{i. i < Suc k \<and> blue (ig_verts G ! i)}
      = insert k {i. i < k \<and> blue (ig_verts G ! i)}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {i. i < Suc k \<and> blue (ig_verts G ! i)} = insert k {i. i < k \<and> blue (ig_verts G ! i)}
[PROOF STEP]
using blue
[PROOF STATE]
proof (prove)
using this:
blue (ig_verts G ! k)

goal (1 subgoal):
 1. {i. i < Suc k \<and> blue (ig_verts G ! i)} = insert k {i. i < k \<and> blue (ig_verts G ! i)}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{i. i < Suc k \<and> blue (ig_verts G ! i)} = insert k {i. i < k \<and> blue (ig_verts G ! i)}

goal (1 subgoal):
 1. is_K33_component_size_inv G (Suc k) blue (Suc blue_cnt)
[PROOF STEP]
with comp
[PROOF STATE]
proof (chain)
picking this:
is_K33_component_size_inv G k blue blue_cnt
{i. i < Suc k \<and> blue (ig_verts G ! i)} = insert k {i. i < k \<and> blue (ig_verts G ! i)}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
is_K33_component_size_inv G k blue blue_cnt
{i. i < Suc k \<and> blue (ig_verts G ! i)} = insert k {i. i < k \<and> blue (ig_verts G ! i)}

goal (1 subgoal):
 1. is_K33_component_size_inv G (Suc k) blue (Suc blue_cnt)
[PROOF STEP]
unfolding is_K33_component_size_inv_def
[PROOF STATE]
proof (prove)
using this:
blue_cnt = card {i. i < k \<and> blue (ig_verts G ! i)}
{i. i < Suc k \<and> blue (ig_verts G ! i)} = insert k {i. i < k \<and> blue (ig_verts G ! i)}

goal (1 subgoal):
 1. Suc blue_cnt = card {i. i < Suc k \<and> blue (ig_verts G ! i)}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
is_K33_component_size_inv G (Suc k) blue (Suc blue_cnt)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma G_relpow_matpow_pos_ge:
  assumes "(i,j) \<in> G ^^ m" "n \<ge> m"
  shows "matpow (A + mat 1) n $ i $ j > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0::'a) < matpow (A + mat (1::'a)) n $h i $h j
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (0::'a) < matpow (A + mat (1::'a)) n $h i $h j
[PROOF STEP]
from assms(2)
[PROOF STATE]
proof (chain)
picking this:
m \<le> n
[PROOF STEP]
obtain k where n: "n = m + k"
[PROOF STATE]
proof (prove)
using this:
m \<le> n

goal (1 subgoal):
 1. (\<And>k. n = m + k \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using le_Suc_ex
[PROOF STATE]
proof (prove)
using this:
m \<le> n
?k \<le> ?l \<Longrightarrow> \<exists>n. ?l = ?k + n

goal (1 subgoal):
 1. (\<And>k. n = m + k \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
n = m + k

goal (1 subgoal):
 1. (0::'a) < matpow (A + mat (1::'a)) n $h i $h j
[PROOF STEP]
have "0 < matpow A m $ i $ j"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0::'a) < matpow A m $h i $h j
[PROOF STEP]
by (rule G_relpow_matpow_pos[OF assms(1)])
[PROOF STATE]
proof (state)
this:
(0::'a) < matpow A m $h i $h j

goal (1 subgoal):
 1. (0::'a) < matpow (A + mat (1::'a)) n $h i $h j
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(0::'a) < matpow A m $h i $h j

goal (1 subgoal):
 1. (0::'a) < matpow (A + mat (1::'a)) n $h i $h j
[PROOF STEP]
have "\<dots> \<le> matpow (A + mat 1) m $ i $ j"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. matpow A m $h i $h j \<le> matpow (A + mat (1::'a)) m $h i $h j
[PROOF STEP]
by (rule matpow_mono, auto simp: mat_def)
[PROOF STATE]
proof (state)
this:
matpow A m $h i $h j \<le> matpow (A + mat (1::'a)) m $h i $h j

goal (1 subgoal):
 1. (0::'a) < matpow (A + mat (1::'a)) n $h i $h j
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
matpow A m $h i $h j \<le> matpow (A + mat (1::'a)) m $h i $h j

goal (1 subgoal):
 1. (0::'a) < matpow (A + mat (1::'a)) n $h i $h j
[PROOF STEP]
have "\<dots> \<le> matpow (A + mat 1) n $ i $ j"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. matpow (A + mat (1::'a)) m $h i $h j \<le> matpow (A + mat (1::'a)) n $h i $h j
[PROOF STEP]
unfolding n
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. matpow (A + mat (1::'a)) m $h i $h j \<le> matpow (A + mat (1::'a)) (m + k) $h i $h j
[PROOF STEP]
using matpow_sum_one_mono
[PROOF STATE]
proof (prove)
using this:
matpow (A + mat (1::'a)) ?n $h ?i $h ?j \<le> matpow (A + mat (1::'a)) (?n + ?k) $h ?i $h ?j

goal (1 subgoal):
 1. matpow (A + mat (1::'a)) m $h i $h j \<le> matpow (A + mat (1::'a)) (m + k) $h i $h j
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
matpow (A + mat (1::'a)) m $h i $h j \<le> matpow (A + mat (1::'a)) n $h i $h j

goal (1 subgoal):
 1. (0::'a) < matpow (A + mat (1::'a)) n $h i $h j
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(0::'a) < matpow (A + mat (1::'a)) n $h i $h j
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(0::'a) < matpow (A + mat (1::'a)) n $h i $h j

goal (1 subgoal):
 1. (0::'a) < matpow (A + mat (1::'a)) n $h i $h j
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(0::'a) < matpow (A + mat (1::'a)) n $h i $h j

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma least_0: "(LEAST n. n \<in> (UNIV::'a set)) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (LEAST n. n \<in> UNIV) = (0::'a)
[PROOF STEP]
proof (rule Least_equality, auto)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>y. (0::'a) \<le> y
[PROOF STEP]
fix y::"'a"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>y. (0::'a) \<le> y
[PROOF STEP]
have "(0::'a) \<le> Abs (Rep y mod int CARD('a))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0::'a) \<le> Abs (Rep y mod int CARD('a))
[PROOF STEP]
using strict_mono_Rep
[PROOF STATE]
proof (prove)
using this:
strict_mono Rep

goal (1 subgoal):
 1. (0::'a) \<le> Abs (Rep y mod int CARD('a))
[PROOF STEP]
unfolding strict_mono_def
[PROOF STATE]
proof (prove)
using this:
\<forall>x y. x < y \<longrightarrow> Rep x < Rep y

goal (1 subgoal):
 1. (0::'a) \<le> Abs (Rep y mod int CARD('a))
[PROOF STEP]
by (metis (opaque_lifting, mono_tags) Rep_0 Rep_ge_0 strict_mono_Rep strict_mono_less_eq)
[PROOF STATE]
proof (state)
this:
(0::'a) \<le> Abs (Rep y mod int CARD('a))

goal (1 subgoal):
 1. \<And>y. (0::'a) \<le> y
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(0::'a) \<le> Abs (Rep y mod int CARD('a))

goal (1 subgoal):
 1. \<And>y. (0::'a) \<le> y
[PROOF STEP]
have "... = y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Abs (Rep y mod int CARD('a)) = y
[PROOF STEP]
by (metis Rep_inverse Rep_mod)
[PROOF STATE]
proof (state)
this:
Abs (Rep y mod int CARD('a)) = y

goal (1 subgoal):
 1. \<And>y. (0::'a) \<le> y
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(0::'a) \<le> y
[PROOF STEP]
show "(0::'a) \<le> y"
[PROOF STATE]
proof (prove)
using this:
(0::'a) \<le> y

goal (1 subgoal):
 1. (0::'a) \<le> y
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(0::'a) \<le> y

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma sink_invar_init:
      assumes I: "heap_invar h"
      assumes NE: "length h > 1"
      shows "sink_invar (butlast (exch h (Suc 0) (length h))) (Suc 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sink_invar (butlast (exch h (Suc 0) (length h))) (Suc 0)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. sink_invar (butlast (exch h (Suc 0) (length h))) (Suc 0)
[PROOF STEP]
from NE
[PROOF STATE]
proof (chain)
picking this:
1 < length h
[PROOF STEP]
have V: "valid h (Suc 0)" "valid h (length h)"
[PROOF STATE]
proof (prove)
using this:
1 < length h

goal (1 subgoal):
 1. valid h (Suc 0) &&& valid h (length h)
[PROOF STEP]
apply -
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. 1 < length h \<Longrightarrow> valid h (Suc 0)
 2. 1 < length h \<Longrightarrow> valid h (length h)
[PROOF STEP]
apply (auto simp: valid_def neq_Nil_conv) []
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 < length h \<Longrightarrow> valid h (length h)
[PROOF STEP]
by (cases h) (auto simp: valid_def)
[PROOF STATE]
proof (state)
this:
valid h (Suc 0)
valid h (length h)

goal (1 subgoal):
 1. sink_invar (butlast (exch h (Suc 0) (length h))) (Suc 0)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sink_invar (butlast (exch h (Suc 0) (length h))) (Suc 0)
[PROOF STEP]
using I
[PROOF STATE]
proof (prove)
using this:
heap_invar h

goal (1 subgoal):
 1. sink_invar (butlast (exch h (Suc 0) (length h))) (Suc 0)
[PROOF STEP]
unfolding heap_eq_heap' heap_invar'_def sink_invar_def
[PROOF STATE]
proof (prove)
using this:
\<forall>i. valid h i \<longrightarrow> children_ge h (prio_of h i) i

goal (1 subgoal):
 1. valid (butlast (exch h (Suc 0) (length h))) (Suc 0) \<and> (\<forall>j. valid (butlast (exch h (Suc 0) (length h))) j \<and> j \<noteq> Suc 0 \<longrightarrow> children_ge (butlast (exch h (Suc 0) (length h))) (prio_of (butlast (exch h (Suc 0) (length h))) j) j) \<and> (has_parent (butlast (exch h (Suc 0) (length h))) (Suc 0) \<longrightarrow> children_ge (butlast (exch h (Suc 0) (length h))) (pparent (butlast (exch h (Suc 0) (length h))) (Suc 0)) (Suc 0))
[PROOF STEP]
apply (intro impI conjI allI)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<forall>i. valid h i \<longrightarrow> children_ge h (prio_of h i) i \<Longrightarrow> valid (butlast (exch h (Suc 0) (length h))) (Suc 0)
 2. \<And>j. \<lbrakk>\<forall>i. valid h i \<longrightarrow> children_ge h (prio_of h i) i; valid (butlast (exch h (Suc 0) (length h))) j \<and> j \<noteq> Suc 0\<rbrakk> \<Longrightarrow> children_ge (butlast (exch h (Suc 0) (length h))) (prio_of (butlast (exch h (Suc 0) (length h))) j) j
 3. \<lbrakk>\<forall>i. valid h i \<longrightarrow> children_ge h (prio_of h i) i; has_parent (butlast (exch h (Suc 0) (length h))) (Suc 0)\<rbrakk> \<Longrightarrow> children_ge (butlast (exch h (Suc 0) (length h))) (pparent (butlast (exch h (Suc 0) (length h))) (Suc 0)) (Suc 0)
[PROOF STEP]
using NE
[PROOF STATE]
proof (prove)
using this:
1 < length h

goal (3 subgoals):
 1. \<forall>i. valid h i \<longrightarrow> children_ge h (prio_of h i) i \<Longrightarrow> valid (butlast (exch h (Suc 0) (length h))) (Suc 0)
 2. \<And>j. \<lbrakk>\<forall>i. valid h i \<longrightarrow> children_ge h (prio_of h i) i; valid (butlast (exch h (Suc 0) (length h))) j \<and> j \<noteq> Suc 0\<rbrakk> \<Longrightarrow> children_ge (butlast (exch h (Suc 0) (length h))) (prio_of (butlast (exch h (Suc 0) (length h))) j) j
 3. \<lbrakk>\<forall>i. valid h i \<longrightarrow> children_ge h (prio_of h i) i; has_parent (butlast (exch h (Suc 0) (length h))) (Suc 0)\<rbrakk> \<Longrightarrow> children_ge (butlast (exch h (Suc 0) (length h))) (pparent (butlast (exch h (Suc 0) (length h))) (Suc 0)) (Suc 0)
[PROOF STEP]
apply (auto simp: V valid_butlast_conv) []
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>j. \<lbrakk>\<forall>i. valid h i \<longrightarrow> children_ge h (prio_of h i) i; valid (butlast (exch h (Suc 0) (length h))) j \<and> j \<noteq> Suc 0\<rbrakk> \<Longrightarrow> children_ge (butlast (exch h (Suc 0) (length h))) (prio_of (butlast (exch h (Suc 0) (length h))) j) j
 2. \<lbrakk>\<forall>i. valid h i \<longrightarrow> children_ge h (prio_of h i) i; has_parent (butlast (exch h (Suc 0) (length h))) (Suc 0)\<rbrakk> \<Longrightarrow> children_ge (butlast (exch h (Suc 0) (length h))) (pparent (butlast (exch h (Suc 0) (length h))) (Suc 0)) (Suc 0)
[PROOF STEP]
apply (auto simp add: children_ge_def V NE valid_butlast_conv) []
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>i. valid h i \<longrightarrow> children_ge h (prio_of h i) i; has_parent (butlast (exch h (Suc 0) (length h))) (Suc 0)\<rbrakk> \<Longrightarrow> children_ge (butlast (exch h (Suc 0) (length h))) (pparent (butlast (exch h (Suc 0) (length h))) (Suc 0)) (Suc 0)
[PROOF STEP]
apply (auto simp add: children_ge_def V NE valid_butlast_conv) []
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
sink_invar (butlast (exch h (Suc 0) (length h))) (Suc 0)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Cons_inj2: "inj2 (#)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj2 (#)
[PROOF STEP]
unfolding inj2_on_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x1\<in>UNIV. \<forall>x2\<in>UNIV. \<forall>y1\<in>UNIV. \<forall>y2\<in>UNIV. x1 # y1 = x2 # y2 \<longrightarrow> x1 = x2 \<and> y1 = y2
[PROOF STEP]
by simp


[STATEMENT]
lemma int_vertices_simps[simp]:
    "int_vertices [] = {}"
    "int_vertices (vv#p) = insert (fst vv) (int_vertices p)"
    "int_vertices (p1@p2) = int_vertices p1 \<union> int_vertices p2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. int_vertices [] = {} &&& int_vertices (vv # p) = insert (fst vv) (int_vertices p) &&& int_vertices (p1 @ p2) = int_vertices p1 \<union> int_vertices p2
[PROOF STEP]
by (auto simp add: int_vertices_def)


[STATEMENT]
lemma vdisjntI:
  assumes "\<And>x y. x \<in>\<^sub>\<circ> A \<Longrightarrow> y \<in>\<^sub>\<circ> B \<Longrightarrow> x \<noteq> y"
  shows "vdisjnt A B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vdisjnt A B
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?x \<in>\<^sub>\<circ> A; ?y \<in>\<^sub>\<circ> B\<rbrakk> \<Longrightarrow> ?x \<noteq> ?y

goal (1 subgoal):
 1. vdisjnt A B
[PROOF STEP]
by auto


[STATEMENT]
lemma list_ord_trans_imp: "\<And>i.
  \<lbrakk> transP ord; list_ord ord xs; j < length xs; i < j \<rbrakk> \<Longrightarrow>
  ord (xs ! i) (xs ! j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i. \<lbrakk>trans {(x, y). ord x y}; list_ord ord xs; j < length xs; i < j\<rbrakk> \<Longrightarrow> ord (xs ! i) (xs ! j)
[PROOF STEP]
apply (simp add: list_ord_all_conv)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i. \<lbrakk>trans {(x, y). ord x y}; \<forall>n<length xs - Suc 0. ord (xs ! n) (xs ! Suc n); j < length xs; i < j\<rbrakk> \<Longrightarrow> ord (xs ! i) (xs ! j)
[PROOF STEP]
apply (induct j, simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>j i. \<lbrakk>\<And>i. \<lbrakk>trans {(x, y). ord x y}; \<forall>n<length xs - Suc 0. ord (xs ! n) (xs ! Suc n); j < length xs; i < j\<rbrakk> \<Longrightarrow> ord (xs ! i) (xs ! j); trans {(x, y). ord x y}; \<forall>n<length xs - Suc 0. ord (xs ! n) (xs ! Suc n); Suc j < length xs; i < Suc j\<rbrakk> \<Longrightarrow> ord (xs ! i) (xs ! Suc j)
[PROOF STEP]
apply (case_tac "j < i", simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>j i. \<lbrakk>\<And>i. \<lbrakk>trans {(x, y). ord x y}; \<forall>n<length xs - Suc 0. ord (xs ! n) (xs ! Suc n); j < length xs; i < j\<rbrakk> \<Longrightarrow> ord (xs ! i) (xs ! j); trans {(x, y). ord x y}; \<forall>n<length xs - Suc 0. ord (xs ! n) (xs ! Suc n); Suc j < length xs; i < Suc j; \<not> j < i\<rbrakk> \<Longrightarrow> ord (xs ! i) (xs ! Suc j)
[PROOF STEP]
apply (simp add: linorder_not_less)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>j i. \<lbrakk>\<And>i. i < j \<Longrightarrow> ord (xs ! i) (xs ! j); trans {(x, y). ord x y}; \<forall>n<length xs - Suc 0. ord (xs ! n) (xs ! Suc n); Suc j < length xs; i \<le> j\<rbrakk> \<Longrightarrow> ord (xs ! i) (xs ! Suc j)
[PROOF STEP]
apply (case_tac "i = j", simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>j i. \<lbrakk>\<And>i. i < j \<Longrightarrow> ord (xs ! i) (xs ! j); trans {(x, y). ord x y}; \<forall>n<length xs - Suc 0. ord (xs ! n) (xs ! Suc n); Suc j < length xs; i \<le> j; i \<noteq> j\<rbrakk> \<Longrightarrow> ord (xs ! i) (xs ! Suc j)
[PROOF STEP]
apply (drule_tac x=i in meta_spec, simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>j i. \<lbrakk>trans {(x, y). ord x y}; \<forall>n<length xs - Suc 0. ord (xs ! n) (xs ! Suc n); Suc j < length xs; i \<le> j; i \<noteq> j; ord (xs ! i) (xs ! j)\<rbrakk> \<Longrightarrow> ord (xs ! i) (xs ! Suc j)
[PROOF STEP]
apply (drule_tac x=j in spec, simp add: Suc_less_pred_conv)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>j i. \<lbrakk>trans {(x, y). ord x y}; j < length xs - Suc 0; i \<le> j; i \<noteq> j; ord (xs ! i) (xs ! j); ord (xs ! j) (xs ! Suc j)\<rbrakk> \<Longrightarrow> ord (xs ! i) (xs ! Suc j)
[PROOF STEP]
apply (unfold trans_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>j i. \<lbrakk>\<forall>x y z. (x, y) \<in> {(x, y). ord x y} \<longrightarrow> (y, z) \<in> {(x, y). ord x y} \<longrightarrow> (x, z) \<in> {(x, y). ord x y}; j < length xs - Suc 0; i \<le> j; i \<noteq> j; ord (xs ! i) (xs ! j); ord (xs ! j) (xs ! Suc j)\<rbrakk> \<Longrightarrow> ord (xs ! i) (xs ! Suc j)
[PROOF STEP]
apply (drule_tac x="xs ! i" in spec, drule_tac x="xs ! j" in spec, drule_tac x="xs ! Suc j" in spec)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>j i. \<lbrakk>j < length xs - Suc 0; i \<le> j; i \<noteq> j; ord (xs ! i) (xs ! j); ord (xs ! j) (xs ! Suc j); (xs ! i, xs ! j) \<in> {(x, y). ord x y} \<longrightarrow> (xs ! j, xs ! Suc j) \<in> {(x, y). ord x y} \<longrightarrow> (xs ! i, xs ! Suc j) \<in> {(x, y). ord x y}\<rbrakk> \<Longrightarrow> ord (xs ! i) (xs ! Suc j)
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma superadditive_converges_bounded'':
  assumes "superadditive u"
          "\<And>n. n > 0 \<Longrightarrow> u n \<le> n * (a::real)"
  shows "\<exists>l. (\<lambda>n. u n / n) \<longlonglongrightarrow> l \<and> (\<forall>n>0. u n \<le> n * l)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>l. (\<lambda>n. u n / real n) \<longlonglongrightarrow> l \<and> (\<forall>n>0. u n \<le> real n * l)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>l. (\<lambda>n. u n / real n) \<longlonglongrightarrow> l \<and> (\<forall>n>0. u n \<le> real n * l)
[PROOF STEP]
have "\<exists>l. (\<lambda>n. -u n / n) \<longlonglongrightarrow> l \<and> (\<forall>n>0. -u n \<ge> n * l)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>l. (\<lambda>n. - u n / real n) \<longlonglongrightarrow> l \<and> (\<forall>n>0. real n * l \<le> - u n)
[PROOF STEP]
apply (rule subadditive_converges_bounded''[OF subadditive_of_superadditive[OF assms(1)], of "-a"])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. 0 < n \<Longrightarrow> real n * - a \<le> - u n
[PROOF STEP]
using assms(2)
[PROOF STATE]
proof (prove)
using this:
0 < ?n \<Longrightarrow> u ?n \<le> real ?n * a

goal (1 subgoal):
 1. \<And>n. 0 < n \<Longrightarrow> real n * - a \<le> - u n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>l. (\<lambda>n. - u n / real n) \<longlonglongrightarrow> l \<and> (\<forall>n>0. real n * l \<le> - u n)

goal (1 subgoal):
 1. \<exists>l. (\<lambda>n. u n / real n) \<longlonglongrightarrow> l \<and> (\<forall>n>0. u n \<le> real n * l)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>l. (\<lambda>n. - u n / real n) \<longlonglongrightarrow> l \<and> (\<forall>n>0. real n * l \<le> - u n)
[PROOF STEP]
obtain l where l: "(\<lambda>n. -u n / n) \<longlonglongrightarrow> l" "(\<forall>n>0. -u n \<ge> n * l)"
[PROOF STATE]
proof (prove)
using this:
\<exists>l. (\<lambda>n. - u n / real n) \<longlonglongrightarrow> l \<and> (\<forall>n>0. real n * l \<le> - u n)

goal (1 subgoal):
 1. (\<And>l. \<lbrakk>(\<lambda>n. - u n / real n) \<longlonglongrightarrow> l; \<forall>n>0. real n * l \<le> - u n\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(\<lambda>n. - u n / real n) \<longlonglongrightarrow> l
\<forall>n>0. real n * l \<le> - u n

goal (1 subgoal):
 1. \<exists>l. (\<lambda>n. u n / real n) \<longlonglongrightarrow> l \<and> (\<forall>n>0. u n \<le> real n * l)
[PROOF STEP]
have "(\<lambda>n. -((-u n)/n)) \<longlonglongrightarrow> -l"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. - (- u n / real n)) \<longlonglongrightarrow> - l
[PROOF STEP]
by (intro tendsto_intros l)
[PROOF STATE]
proof (state)
this:
(\<lambda>n. - (- u n / real n)) \<longlonglongrightarrow> - l

goal (1 subgoal):
 1. \<exists>l. (\<lambda>n. u n / real n) \<longlonglongrightarrow> l \<and> (\<forall>n>0. u n \<le> real n * l)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(\<lambda>n. - (- u n / real n)) \<longlonglongrightarrow> - l

goal (1 subgoal):
 1. \<exists>l. (\<lambda>n. u n / real n) \<longlonglongrightarrow> l \<and> (\<forall>n>0. u n \<le> real n * l)
[PROOF STEP]
have "\<forall>n>0. u n \<le> n * (-l)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>n>0. u n \<le> real n * - l
[PROOF STEP]
using l(2)
[PROOF STATE]
proof (prove)
using this:
\<forall>n>0. real n * l \<le> - u n

goal (1 subgoal):
 1. \<forall>n>0. u n \<le> real n * - l
[PROOF STEP]
by (auto simp add: algebra_simps) (metis minus_equation_iff neg_le_iff_le)
[PROOF STATE]
proof (state)
this:
\<forall>n>0. u n \<le> real n * - l

goal (1 subgoal):
 1. \<exists>l. (\<lambda>n. u n / real n) \<longlonglongrightarrow> l \<and> (\<forall>n>0. u n \<le> real n * l)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>n. - (- u n / real n)) \<longlonglongrightarrow> - l
\<forall>n>0. u n \<le> real n * - l
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. - (- u n / real n)) \<longlonglongrightarrow> - l
\<forall>n>0. u n \<le> real n * - l

goal (1 subgoal):
 1. \<exists>l. (\<lambda>n. u n / real n) \<longlonglongrightarrow> l \<and> (\<forall>n>0. u n \<le> real n * l)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>l. (\<lambda>n. u n / real n) \<longlonglongrightarrow> l \<and> (\<forall>n>0. u n \<le> real n * l)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma irreducible\<^sub>d_dvd_smult:
  fixes p :: "'a::{comm_semiring_1,semiring_no_zero_divisors} poly"
  assumes "degree p > 0" "irreducible\<^sub>d q" "p dvd q"
  shows "\<exists> c. c \<noteq> 0 \<and> q = smult c p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>c. c \<noteq> (0::'a) \<and> q = smult c p
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>c. c \<noteq> (0::'a) \<and> q = smult c p
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
0 < degree p
irreducible\<^sub>d q
p dvd q
[PROOF STEP]
obtain r where q: "q = p * r"
[PROOF STATE]
proof (prove)
using this:
0 < degree p
irreducible\<^sub>d q
p dvd q

goal (1 subgoal):
 1. (\<And>r. q = p * r \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (elim dvdE, auto)
[PROOF STATE]
proof (state)
this:
q = p * r

goal (1 subgoal):
 1. \<exists>c. c \<noteq> (0::'a) \<and> q = smult c p
[PROOF STEP]
from degree_mult_eq[of p r] assms(1) q
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>p \<noteq> 0; r \<noteq> 0\<rbrakk> \<Longrightarrow> degree (p * r) = degree p + degree r
0 < degree p
q = p * r
[PROOF STEP]
have "\<not> degree p < degree q" and nz: "p \<noteq> 0" "q \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>p \<noteq> 0; r \<noteq> 0\<rbrakk> \<Longrightarrow> degree (p * r) = degree p + degree r
0 < degree p
q = p * r

goal (1 subgoal):
 1. \<not> degree p < degree q &&& p \<noteq> 0 &&& q \<noteq> 0
[PROOF STEP]
apply (metis assms(2) degree_mult_eq_0 gr_implies_not_zero irreducible\<^sub>dD(2) less_add_same_cancel2)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. p \<noteq> 0
 2. q \<noteq> 0
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
0 < degree p
irreducible\<^sub>d q
p dvd q

goal (2 subgoals):
 1. p \<noteq> 0
 2. q \<noteq> 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<not> degree p < degree q
p \<noteq> 0
q \<noteq> 0

goal (1 subgoal):
 1. \<exists>c. c \<noteq> (0::'a) \<and> q = smult c p
[PROOF STEP]
hence deg: "degree p \<ge> degree q"
[PROOF STATE]
proof (prove)
using this:
\<not> degree p < degree q
p \<noteq> 0
q \<noteq> 0

goal (1 subgoal):
 1. degree q \<le> degree p
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
degree q \<le> degree p

goal (1 subgoal):
 1. \<exists>c. c \<noteq> (0::'a) \<and> q = smult c p
[PROOF STEP]
from \<open>p dvd q\<close>
[PROOF STATE]
proof (chain)
picking this:
p dvd q
[PROOF STEP]
obtain k where q: "q = k * p"
[PROOF STATE]
proof (prove)
using this:
p dvd q

goal (1 subgoal):
 1. (\<And>k. q = k * p \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding dvd_def
[PROOF STATE]
proof (prove)
using this:
\<exists>k. q = p * k

goal (1 subgoal):
 1. (\<And>k. q = k * p \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp: ac_simps)
[PROOF STATE]
proof (state)
this:
q = k * p

goal (1 subgoal):
 1. \<exists>c. c \<noteq> (0::'a) \<and> q = smult c p
[PROOF STEP]
with nz
[PROOF STATE]
proof (chain)
picking this:
p \<noteq> 0
q \<noteq> 0
q = k * p
[PROOF STEP]
have "k \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
p \<noteq> 0
q \<noteq> 0
q = k * p

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

goal (1 subgoal):
 1. \<exists>c. c \<noteq> (0::'a) \<and> q = smult c p
[PROOF STEP]
from deg[unfolded q degree_mult_eq[OF \<open>k \<noteq> 0\<close> \<open>p \<noteq> 0\<close> ]]
[PROOF STATE]
proof (chain)
picking this:
degree k + degree p \<le> degree p
[PROOF STEP]
have "degree k = 0"
[PROOF STATE]
proof (prove)
using this:
degree k + degree p \<le> degree p

goal (1 subgoal):
 1. degree k = 0
[PROOF STEP]
unfolding q
[PROOF STATE]
proof (prove)
using this:
degree k + degree p \<le> degree p

goal (1 subgoal):
 1. degree k = 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
degree k = 0

goal (1 subgoal):
 1. \<exists>c. c \<noteq> (0::'a) \<and> q = smult c p
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
degree k = 0
[PROOF STEP]
obtain c where k: "k = [: c :]"
[PROOF STATE]
proof (prove)
using this:
degree k = 0

goal (1 subgoal):
 1. (\<And>c. k = [:c:] \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis degree_0_id)
[PROOF STATE]
proof (state)
this:
k = [:c:]

goal (1 subgoal):
 1. \<exists>c. c \<noteq> (0::'a) \<and> q = smult c p
[PROOF STEP]
with \<open>k \<noteq> 0\<close>
[PROOF STATE]
proof (chain)
picking this:
k \<noteq> 0
k = [:c:]
[PROOF STEP]
have "c \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
k \<noteq> 0
k = [:c:]

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

goal (1 subgoal):
 1. \<exists>c. c \<noteq> (0::'a) \<and> q = smult c p
[PROOF STEP]
have "q = smult c p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. q = smult c p
[PROOF STEP]
unfolding q k
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [:c:] * p = smult c p
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
q = smult c p

goal (1 subgoal):
 1. \<exists>c. c \<noteq> (0::'a) \<and> q = smult c p
[PROOF STEP]
with \<open>c \<noteq> 0\<close>
[PROOF STATE]
proof (chain)
picking this:
c \<noteq> (0::'a)
q = smult c p
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
c \<noteq> (0::'a)
q = smult c p

goal (1 subgoal):
 1. \<exists>c. c \<noteq> (0::'a) \<and> q = smult c p
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>c. c \<noteq> (0::'a) \<and> q = smult c p

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma arc_regular:
  assumes "arc x"
    shows "regular x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. regular x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. regular x
[PROOF STEP]
have "--x \<le> --(x * top \<sqinter> top * x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - - x \<le> - - (x * top \<sqinter> top * x)
[PROOF STEP]
by (simp add: pp_isotone top_left_mult_increasing top_right_mult_increasing)
[PROOF STATE]
proof (state)
this:
- - x \<le> - - (x * top \<sqinter> top * x)

goal (1 subgoal):
 1. regular x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
- - x \<le> - - (x * top \<sqinter> top * x)

goal (1 subgoal):
 1. regular x
[PROOF STEP]
have "... = --(x * top) \<sqinter> --(top * x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - - (x * top \<sqinter> top * x) = - - (x * top) \<sqinter> - - (top * x)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
- - (x * top \<sqinter> top * x) = - - (x * top) \<sqinter> - - (top * x)

goal (1 subgoal):
 1. regular x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
- - (x * top \<sqinter> top * x) = - - (x * top) \<sqinter> - - (top * x)

goal (1 subgoal):
 1. regular x
[PROOF STEP]
have "... = x * top \<sqinter> top * x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - - (x * top) \<sqinter> - - (top * x) = x * top \<sqinter> top * x
[PROOF STEP]
by (metis assms bijective_regular conv_top conv_dist_comp conv_involutive mapping_regular)
[PROOF STATE]
proof (state)
this:
- - (x * top) \<sqinter> - - (top * x) = x * top \<sqinter> top * x

goal (1 subgoal):
 1. regular x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
- - (x * top) \<sqinter> - - (top * x) = x * top \<sqinter> top * x

goal (1 subgoal):
 1. regular x
[PROOF STEP]
have "... \<le> x * x\<^sup>T * top * x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x * top \<sqinter> top * x \<le> x * x\<^sup>T * top * x
[PROOF STEP]
by (metis comp_associative dedekind_1 inf.commute inf_top.right_neutral)
[PROOF STATE]
proof (state)
this:
x * top \<sqinter> top * x \<le> x * x\<^sup>T * top * x

goal (1 subgoal):
 1. regular x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
x * top \<sqinter> top * x \<le> x * x\<^sup>T * top * x

goal (1 subgoal):
 1. regular x
[PROOF STEP]
have "... \<le> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x * x\<^sup>T * top * x \<le> x
[PROOF STEP]
by (metis assms comp_right_one conv_top comp_associative conv_dist_comp conv_involutive mult_right_isotone vector_top_closed)
[PROOF STATE]
proof (state)
this:
x * x\<^sup>T * top * x \<le> x

goal (1 subgoal):
 1. regular x
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
- - x \<le> x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
- - x \<le> x

goal (1 subgoal):
 1. regular x
[PROOF STEP]
by (simp add: order.antisym pp_increasing)
[PROOF STATE]
proof (state)
this:
regular x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma lists_of_len_fin1: "finite P \<Longrightarrow> finite (lists P \<inter> { l. length l = n })"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite P \<Longrightarrow> finite (lists P \<inter> {l. length l = n})
[PROOF STEP]
proof (induct n)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. finite P \<Longrightarrow> finite (lists P \<inter> {l. length l = 0})
 2. \<And>n. \<lbrakk>finite P \<Longrightarrow> finite (lists P \<inter> {l. length l = n}); finite P\<rbrakk> \<Longrightarrow> finite (lists P \<inter> {l. length l = Suc n})
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:
finite P

goal (2 subgoals):
 1. finite P \<Longrightarrow> finite (lists P \<inter> {l. length l = 0})
 2. \<And>n. \<lbrakk>finite P \<Longrightarrow> finite (lists P \<inter> {l. length l = n}); finite P\<rbrakk> \<Longrightarrow> finite (lists P \<inter> {l. length l = Suc n})
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
finite P

goal (1 subgoal):
 1. finite (lists P \<inter> {l. length l = 0})
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
finite (lists P \<inter> {l. length l = 0})

goal (1 subgoal):
 1. \<And>n. \<lbrakk>finite P \<Longrightarrow> finite (lists P \<inter> {l. length l = n}); finite P\<rbrakk> \<Longrightarrow> finite (lists P \<inter> {l. length l = Suc n})
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. \<lbrakk>finite P \<Longrightarrow> finite (lists P \<inter> {l. length l = n}); finite P\<rbrakk> \<Longrightarrow> finite (lists P \<inter> {l. length l = Suc n})
[PROOF STEP]
case (Suc n)
[PROOF STATE]
proof (state)
this:
finite P \<Longrightarrow> finite (lists P \<inter> {l. length l = n})
finite P

goal (1 subgoal):
 1. \<And>n. \<lbrakk>finite P \<Longrightarrow> finite (lists P \<inter> {l. length l = n}); finite P\<rbrakk> \<Longrightarrow> finite (lists P \<inter> {l. length l = Suc n})
[PROOF STEP]
have "lists P \<inter> { l. length l = Suc n }
          = (\<lambda>(a,l). a#l) ` (P \<times> (lists P \<inter> {l. length l = n}))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lists P \<inter> {l. length l = Suc n} = (\<lambda>(a, l). a # l) ` (P \<times> (lists P \<inter> {l. length l = n}))
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>\<forall>x\<in>set x. x \<in> P; length x = Suc n\<rbrakk> \<Longrightarrow> x \<in> (\<lambda>x. case x of (a, l) \<Rightarrow> a # l) ` (P \<times> (lists P \<inter> {l. length l = n}))
[PROOF STEP]
apply (case_tac x)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x. \<lbrakk>\<forall>x\<in>set x. x \<in> P; length x = Suc n; x = []\<rbrakk> \<Longrightarrow> x \<in> (\<lambda>x. case x of (a, l) \<Rightarrow> a # l) ` (P \<times> (lists P \<inter> {l. length l = n}))
 2. \<And>x a list. \<lbrakk>\<forall>x\<in>set x. x \<in> P; length x = Suc n; x = a # list\<rbrakk> \<Longrightarrow> x \<in> (\<lambda>x. case x of (a, l) \<Rightarrow> a # l) ` (P \<times> (lists P \<inter> {l. length l = n}))
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
lists P \<inter> {l. length l = Suc n} = (\<lambda>(a, l). a # l) ` (P \<times> (lists P \<inter> {l. length l = n}))

goal (1 subgoal):
 1. \<And>n. \<lbrakk>finite P \<Longrightarrow> finite (lists P \<inter> {l. length l = n}); finite P\<rbrakk> \<Longrightarrow> finite (lists P \<inter> {l. length l = Suc n})
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
lists P \<inter> {l. length l = Suc n} = (\<lambda>(a, l). a # l) ` (P \<times> (lists P \<inter> {l. length l = n}))

goal (1 subgoal):
 1. \<And>n. \<lbrakk>finite P \<Longrightarrow> finite (lists P \<inter> {l. length l = n}); finite P\<rbrakk> \<Longrightarrow> finite (lists P \<inter> {l. length l = Suc n})
[PROOF STEP]
from Suc
[PROOF STATE]
proof (chain)
picking this:
finite P \<Longrightarrow> finite (lists P \<inter> {l. length l = n})
finite P
[PROOF STEP]
have "finite \<dots>"
[PROOF STATE]
proof (prove)
using this:
finite P \<Longrightarrow> finite (lists P \<inter> {l. length l = n})
finite P

goal (1 subgoal):
 1. finite ((\<lambda>(a, l). a # l) ` (P \<times> (lists P \<inter> {l. length l = n})))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
finite ((\<lambda>(a, l). a # l) ` (P \<times> (lists P \<inter> {l. length l = n})))

goal (1 subgoal):
 1. \<And>n. \<lbrakk>finite P \<Longrightarrow> finite (lists P \<inter> {l. length l = n}); finite P\<rbrakk> \<Longrightarrow> finite (lists P \<inter> {l. length l = Suc n})
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
lists P \<inter> {l. length l = Suc n} = (\<lambda>(a, l). a # l) ` (P \<times> (lists P \<inter> {l. length l = n}))
finite ((\<lambda>(a, l). a # l) ` (P \<times> (lists P \<inter> {l. length l = n})))
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
lists P \<inter> {l. length l = Suc n} = (\<lambda>(a, l). a # l) ` (P \<times> (lists P \<inter> {l. length l = n}))
finite ((\<lambda>(a, l). a # l) ` (P \<times> (lists P \<inter> {l. length l = n})))

goal (1 subgoal):
 1. finite (lists P \<inter> {l. length l = Suc n})
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
finite (lists P \<inter> {l. length l = Suc n})

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma field_differentiable_series:
  fixes f :: "nat \<Rightarrow> 'a::{real_normed_field,banach} \<Rightarrow> 'a"
  assumes "convex S" "open S"
  assumes "\<And>n x. x \<in> S \<Longrightarrow> (f n has_field_derivative f' n x) (at x)"
  assumes "uniformly_convergent_on S (\<lambda>n x. \<Sum>i<n. f' i x)"
  assumes "x0 \<in> S" "summable (\<lambda>n. f n x0)" and x: "x \<in> S"
  shows  "(\<lambda>x. \<Sum>n. f n x) field_differentiable (at x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. \<Sum>n. f n x) field_differentiable at x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<lambda>x. \<Sum>n. f n x) field_differentiable at x
[PROOF STEP]
from assms(4)
[PROOF STATE]
proof (chain)
picking this:
uniformly_convergent_on S (\<lambda>n x. \<Sum>i<n. f' i x)
[PROOF STEP]
obtain g' where A: "uniform_limit S (\<lambda>n x. \<Sum>i<n. f' i x) g' sequentially"
[PROOF STATE]
proof (prove)
using this:
uniformly_convergent_on S (\<lambda>n x. \<Sum>i<n. f' i x)

goal (1 subgoal):
 1. (\<And>g'. uniform_limit S (\<lambda>n x. \<Sum>i<n. f' i x) g' sequentially \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding uniformly_convergent_on_def
[PROOF STATE]
proof (prove)
using this:
\<exists>l. uniform_limit S (\<lambda>n x. \<Sum>i<n. f' i x) l sequentially

goal (1 subgoal):
 1. (\<And>g'. uniform_limit S (\<lambda>n x. \<Sum>i<n. f' i x) g' sequentially \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
uniform_limit S (\<lambda>n x. \<Sum>i<n. f' i x) g' sequentially

goal (1 subgoal):
 1. (\<lambda>x. \<Sum>n. f n x) field_differentiable at x
[PROOF STEP]
from x and \<open>open S\<close>
[PROOF STATE]
proof (chain)
picking this:
x \<in> S
open S
[PROOF STEP]
have S: "at x within S = at x"
[PROOF STATE]
proof (prove)
using this:
x \<in> S
open S

goal (1 subgoal):
 1. at x within S = at x
[PROOF STEP]
by (rule at_within_open)
[PROOF STATE]
proof (state)
this:
at x within S = at x

goal (1 subgoal):
 1. (\<lambda>x. \<Sum>n. f n x) field_differentiable at x
[PROOF STEP]
have "\<exists>g. \<forall>x\<in>S. (\<lambda>n. f n x) sums g x \<and> (g has_field_derivative g' x) (at x within S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>g. \<forall>x\<in>S. (\<lambda>n. f n x) sums g x \<and> (g has_field_derivative g' x) (at x within S)
[PROOF STEP]
by (intro has_field_derivative_series[of S f f' g' x0] assms A has_field_derivative_at_within)
[PROOF STATE]
proof (state)
this:
\<exists>g. \<forall>x\<in>S. (\<lambda>n. f n x) sums g x \<and> (g has_field_derivative g' x) (at x within S)

goal (1 subgoal):
 1. (\<lambda>x. \<Sum>n. f n x) field_differentiable at x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>g. \<forall>x\<in>S. (\<lambda>n. f n x) sums g x \<and> (g has_field_derivative g' x) (at x within S)
[PROOF STEP]
obtain g where g: "\<And>x. x \<in> S \<Longrightarrow> (\<lambda>n. f n x) sums g x"
    "\<And>x. x \<in> S \<Longrightarrow> (g has_field_derivative g' x) (at x within S)"
[PROOF STATE]
proof (prove)
using this:
\<exists>g. \<forall>x\<in>S. (\<lambda>n. f n x) sums g x \<and> (g has_field_derivative g' x) (at x within S)

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

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

goal (1 subgoal):
 1. (g has_derivative (*) (g' x)) (at x)
[PROOF STEP]
by (simp add: has_field_derivative_def S)
[PROOF STATE]
proof (state)
this:
(g has_derivative (*) (g' x)) (at x)

goal (1 subgoal):
 1. (\<lambda>x. \<Sum>n. f n x) field_differentiable at x
[PROOF STEP]
have "((\<lambda>x. \<Sum>n. f n x) has_derivative (*) (g' x)) (at x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. \<Sum>n. f n x) has_derivative (*) (g' x)) (at x)
[PROOF STEP]
by (rule has_derivative_transform_within_open[OF g' \<open>open S\<close> x])
       (insert g, auto simp: sums_iff)
[PROOF STATE]
proof (state)
this:
((\<lambda>x. \<Sum>n. f n x) has_derivative (*) (g' x)) (at x)

goal (1 subgoal):
 1. (\<lambda>x. \<Sum>n. f n x) field_differentiable at x
[PROOF STEP]
thus "(\<lambda>x. \<Sum>n. f n x) field_differentiable (at x)"
[PROOF STATE]
proof (prove)
using this:
((\<lambda>x. \<Sum>n. f n x) has_derivative (*) (g' x)) (at x)

goal (1 subgoal):
 1. (\<lambda>x. \<Sum>n. f n x) field_differentiable at x
[PROOF STEP]
unfolding differentiable_def
[PROOF STATE]
proof (prove)
using this:
((\<lambda>x. \<Sum>n. f n x) has_derivative (*) (g' x)) (at x)

goal (1 subgoal):
 1. (\<lambda>x. \<Sum>n. f n x) field_differentiable at x
[PROOF STEP]
by (auto simp: summable_def field_differentiable_def has_field_derivative_def)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. \<Sum>n. f n x) field_differentiable at x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma llist_all2_lmirror_aux:
  "\<lbrakk> llist_all2 P acc acc'; llist_all2 P xs xs' \<rbrakk>
  \<Longrightarrow> llist_all2 P (lmirror_aux acc xs) (lmirror_aux acc' xs')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>llist_all2 P acc acc'; llist_all2 P xs xs'\<rbrakk> \<Longrightarrow> llist_all2 P (lmirror_aux acc xs) (lmirror_aux acc' xs')
[PROOF STEP]
by(coinduction arbitrary: acc acc' xs xs')(auto simp add: lhd_lmirror_aux ltl_lmirror_aux elim: llist_all2_lhdD intro!: llist_all2_ltlI exI dest: llist_all2_lnullD)


[STATEMENT]
lemma blaschke_ounit_circle_fix':
  assumes "cmod a < 1"
  shows "moebius_ocircline (blaschke a) ounit_circle = ounit_circle"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. moebius_ocircline (blaschke a) ounit_circle = ounit_circle
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. moebius_ocircline (blaschke a) ounit_circle = ounit_circle
[PROOF STEP]
have "Re (a * cnj a) < 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Re (a * cnj a) < 1
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
cmod a < 1

goal (1 subgoal):
 1. Re (a * cnj a) < 1
[PROOF STEP]
by (metis complex_mod_sqrt_Re_mult_cnj real_sqrt_lt_1_iff)
[PROOF STATE]
proof (state)
this:
Re (a * cnj a) < 1

goal (1 subgoal):
 1. moebius_ocircline (blaschke a) ounit_circle = ounit_circle
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
Re (a * cnj a) < 1

goal (1 subgoal):
 1. moebius_ocircline (blaschke a) ounit_circle = ounit_circle
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
Re (a * cnj a) < 1
cmod a < 1

goal (1 subgoal):
 1. moebius_ocircline (blaschke a) ounit_circle = ounit_circle
[PROOF STEP]
using blaschke_unit_disc_fix unit_disc_fix_iff_ounit_circle
[PROOF STATE]
proof (prove)
using this:
Re (a * cnj a) < 1
cmod a < 1
cmod ?a < 1 \<Longrightarrow> unit_disc_fix (blaschke ?a)
unit_disc_fix ?M = (moebius_ocircline ?M ounit_circle = ounit_circle)

goal (1 subgoal):
 1. moebius_ocircline (blaschke a) ounit_circle = ounit_circle
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
moebius_ocircline (blaschke a) ounit_circle = ounit_circle

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma closed_fip_Heine_Borel:
  fixes \<F> :: "'a::heine_borel set set"
  assumes "closed S" "T \<in> \<F>" "bounded T"
      and "\<And>T. T \<in> \<F> \<Longrightarrow> closed T"
      and "\<And>\<F>'. \<lbrakk>finite \<F>'; \<F>' \<subseteq> \<F>\<rbrakk> \<Longrightarrow> \<Inter>\<F>' \<noteq> {}"
    shows "\<Inter>\<F> \<noteq> {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Inter> \<F> \<noteq> {}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<Inter> \<F> \<noteq> {}
[PROOF STEP]
have "UNIV \<inter> \<Inter>\<F> \<noteq> {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. UNIV \<inter> \<Inter> \<F> \<noteq> {}
[PROOF STEP]
using assms closed_imp_fip [OF closed_UNIV]
[PROOF STATE]
proof (prove)
using this:
closed S
T \<in> \<F>
bounded T
?T \<in> \<F> \<Longrightarrow> closed ?T
\<lbrakk>finite ?\<F>'; ?\<F>' \<subseteq> \<F>\<rbrakk> \<Longrightarrow> \<Inter> ?\<F>' \<noteq> {}
\<lbrakk>?T \<in> ?\<F>; bounded ?T; \<And>T. T \<in> ?\<F> \<Longrightarrow> closed T; \<And>\<F>'. \<lbrakk>finite \<F>'; \<F>' \<subseteq> ?\<F>\<rbrakk> \<Longrightarrow> UNIV \<inter> \<Inter> \<F>' \<noteq> {}\<rbrakk> \<Longrightarrow> UNIV \<inter> \<Inter> ?\<F> \<noteq> {}

goal (1 subgoal):
 1. UNIV \<inter> \<Inter> \<F> \<noteq> {}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
UNIV \<inter> \<Inter> \<F> \<noteq> {}

goal (1 subgoal):
 1. \<Inter> \<F> \<noteq> {}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
UNIV \<inter> \<Inter> \<F> \<noteq> {}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
UNIV \<inter> \<Inter> \<F> \<noteq> {}

goal (1 subgoal):
 1. \<Inter> \<F> \<noteq> {}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<Inter> \<F> \<noteq> {}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma to_nat_from_nat_id:
  assumes x: "x<CARD('a)"
  shows "to_nat ((from_nat x)::'a) = x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mod_type_class.to_nat (mod_type_class.from_nat x) = x
[PROOF STEP]
unfolding to_nat_is_inv[symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. the_inv_into {0..<CARD('a)} mod_type_class.from_nat (mod_type_class.from_nat x) = x
[PROOF STEP]
proof (rule the_inv_into_f_f)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. inj_on mod_type_class.from_nat {0..<CARD('a)}
 2. x \<in> {0..<CARD('a)}
[PROOF STEP]
show "inj_on (from_nat::nat=>'a) {0..<CARD('a)}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on mod_type_class.from_nat {0..<CARD('a)}
[PROOF STEP]
using bij_from_nat
[PROOF STATE]
proof (prove)
using this:
bij_betw mod_type_class.from_nat {0..<CARD('a)} UNIV

goal (1 subgoal):
 1. inj_on mod_type_class.from_nat {0..<CARD('a)}
[PROOF STEP]
unfolding bij_betw_def
[PROOF STATE]
proof (prove)
using this:
inj_on mod_type_class.from_nat {0..<CARD('a)} \<and> mod_type_class.from_nat ` {0..<CARD('a)} = UNIV

goal (1 subgoal):
 1. inj_on mod_type_class.from_nat {0..<CARD('a)}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
inj_on mod_type_class.from_nat {0..<CARD('a)}

goal (1 subgoal):
 1. x \<in> {0..<CARD('a)}
[PROOF STEP]
show "x \<in> {0..<CARD('a)}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> {0..<CARD('a)}
[PROOF STEP]
using x
[PROOF STATE]
proof (prove)
using this:
x < CARD('a)

goal (1 subgoal):
 1. x \<in> {0..<CARD('a)}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
x \<in> {0..<CARD('a)}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma prefixeq_iprefix_trans: "\<lbrakk> prefix xs ys; ys \<sqsubseteq> f \<rbrakk> \<Longrightarrow> xs \<sqsubseteq> f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>prefix xs ys; ys \<sqsubseteq> f\<rbrakk> \<Longrightarrow> xs \<sqsubseteq> f
[PROOF STEP]
by (fastforce simp: iprefix_eq_iprefix_take_ex prefix_eq_prefix_take_ex)


[STATEMENT]
lemma restrict_indets_ideal: "restrict_indets ` ideal F = ideal (restrict_indets ` F)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. restrict_indets ` ideal F = ideal (restrict_indets ` F)
[PROOF STEP]
using restrict_indets_plus restrict_indets_times
[PROOF STATE]
proof (prove)
using this:
restrict_indets (?p + ?q) = restrict_indets ?p + restrict_indets ?q
restrict_indets (?p * ?q) = restrict_indets ?p * restrict_indets ?q

goal (1 subgoal):
 1. restrict_indets ` ideal F = ideal (restrict_indets ` F)
[PROOF STEP]
proof (rule image_ideal_eq_surj)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. surj restrict_indets
[PROOF STEP]
from restrict_extend_indets
[PROOF STATE]
proof (chain)
picking this:
restrict_indets (extend_indets ?p) = ?p
[PROOF STEP]
show "surj restrict_indets"
[PROOF STATE]
proof (prove)
using this:
restrict_indets (extend_indets ?p) = ?p

goal (1 subgoal):
 1. surj restrict_indets
[PROOF STEP]
by (rule surjI)
[PROOF STATE]
proof (state)
this:
surj restrict_indets

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma lt_1_WtFT[simp]: "WtFT cl \<noteq> 1 \<Longrightarrow> 0 < 1 - WtFT cl"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. WtFT cl \<noteq> 1 \<Longrightarrow> 0 < 1 - WtFT cl
[PROOF STEP]
using le_1_WtFT
[PROOF STATE]
proof (prove)
using this:
0 \<le> 1 - WtFT ?cl

goal (1 subgoal):
 1. WtFT cl \<noteq> 1 \<Longrightarrow> 0 < 1 - WtFT cl
[PROOF STEP]
by (metis le_1_WtFT eq_iff_diff_eq_0 less_eq_real_def)


[STATEMENT]
lemma idx_sequence_idx:
  assumes "idx_sequence idx"
  shows "idx k \<in> {idx k ..< idx (Suc k)}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. idx k \<in> {idx k..<idx (Suc k)}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
idx_sequence idx

goal (1 subgoal):
 1. idx k \<in> {idx k..<idx (Suc k)}
[PROOF STEP]
by (auto simp add: idx_sequence_def)


[STATEMENT]
lemma finite_csucc: "a \<in> elts \<omega> \<Longrightarrow> csucc a = succ a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<in> elts \<omega> \<Longrightarrow> csucc a = ZFC_in_HOL.succ a
[PROOF STEP]
unfolding csucc_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<in> elts \<omega> \<Longrightarrow> (LEAST \<kappa>'. Ord \<kappa>' \<and> Card \<kappa>' \<and> a < \<kappa>') = ZFC_in_HOL.succ a
[PROOF STEP]
proof (rule Least_equality)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. a \<in> elts \<omega> \<Longrightarrow> Ord (ZFC_in_HOL.succ a) \<and> Card (ZFC_in_HOL.succ a) \<and> a < ZFC_in_HOL.succ a
 2. \<And>y. \<lbrakk>a \<in> elts \<omega>; Ord y \<and> Card y \<and> a < y\<rbrakk> \<Longrightarrow> ZFC_in_HOL.succ a \<le> y
[PROOF STEP]
show "Ord (ZFC_in_HOL.succ a) \<and> Card (ZFC_in_HOL.succ a) \<and> a < ZFC_in_HOL.succ a"
    if "a \<in> elts \<omega>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Ord (ZFC_in_HOL.succ a) \<and> Card (ZFC_in_HOL.succ a) \<and> a < ZFC_in_HOL.succ a
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
a \<in> elts \<omega>

goal (1 subgoal):
 1. Ord (ZFC_in_HOL.succ a) \<and> Card (ZFC_in_HOL.succ a) \<and> a < ZFC_in_HOL.succ a
[PROOF STEP]
by (auto simp: less_V_def less_eq_V_def nat_into_Card)
[PROOF STATE]
proof (state)
this:
a \<in> elts \<omega> \<Longrightarrow> Ord (ZFC_in_HOL.succ a) \<and> Card (ZFC_in_HOL.succ a) \<and> a < ZFC_in_HOL.succ a

goal (1 subgoal):
 1. \<And>y. \<lbrakk>a \<in> elts \<omega>; Ord y \<and> Card y \<and> a < y\<rbrakk> \<Longrightarrow> ZFC_in_HOL.succ a \<le> y
[PROOF STEP]
show "ZFC_in_HOL.succ a \<le> y"
    if "a \<in> elts \<omega>"
      and "Ord y \<and> Card y \<and> a < y"
    for y :: V
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ZFC_in_HOL.succ a \<le> y
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
a \<in> elts \<omega>
Ord y \<and> Card y \<and> a < y

goal (1 subgoal):
 1. ZFC_in_HOL.succ a \<le> y
[PROOF STEP]
using Ord_mem_iff_lt dual_order.strict_implies_order
[PROOF STATE]
proof (prove)
using this:
a \<in> elts \<omega>
Ord y \<and> Card y \<and> a < y
\<lbrakk>Ord ?k; Ord ?l\<rbrakk> \<Longrightarrow> (?k \<in> elts ?l) = (?k < ?l)
?b < ?a \<Longrightarrow> ?b \<le> ?a

goal (1 subgoal):
 1. ZFC_in_HOL.succ a \<le> y
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
\<lbrakk>a \<in> elts \<omega>; Ord ?y \<and> Card ?y \<and> a < ?y\<rbrakk> \<Longrightarrow> ZFC_in_HOL.succ a \<le> ?y

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma index_iff[simp]: "x\<in>index f s i \<longleftrightarrow> x\<in>s \<and> f x = i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<in> index f s i) = (x \<in> s \<and> f x = i)
[PROOF STEP]
by (simp add: index_def)


[STATEMENT]
lemma prime_sum_upto_mono:
  assumes "\<And>n. n > 0 \<Longrightarrow> f n \<ge> (0::real)" "x \<le> y"
  shows   "prime_sum_upto f x \<le> prime_sum_upto f y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prime_sum_upto f x \<le> prime_sum_upto f y
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
0 < ?n \<Longrightarrow> 0 \<le> f ?n
x \<le> y

goal (1 subgoal):
 1. prime_sum_upto f x \<le> prime_sum_upto f y
[PROOF STEP]
unfolding prime_sum_upto_altdef1 sum_upto_altdef
[PROOF STATE]
proof (prove)
using this:
0 < ?n \<Longrightarrow> 0 \<le> f ?n
x \<le> y

goal (1 subgoal):
 1. (\<Sum>p\<in>{0<..nat \<lfloor>x\<rfloor>}. ind prime p * f p) \<le> (\<Sum>p\<in>{0<..nat \<lfloor>y\<rfloor>}. ind prime p * f p)
[PROOF STEP]
by (intro sum_mono2) (auto simp: le_nat_iff' le_floor_iff ind_def)


[STATEMENT]
lemma reflp_joinablep: "reflp P \<Longrightarrow> reflp (joinablep P)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. reflp P \<Longrightarrow> reflp (joinablep P)
[PROOF STEP]
by (blast intro: reflpI joinable_refl[to_pred] refl_onI[to_pred] dest: reflpD)


[STATEMENT]
lemma (in linearform) diff [iff]:
  assumes "vectorspace V"
  shows "x \<in> V \<Longrightarrow> y \<in> V \<Longrightarrow> f (x - y) = f x - f y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<in> V; y \<in> V\<rbrakk> \<Longrightarrow> f (x - y) = f x - f y
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>x \<in> V; y \<in> V\<rbrakk> \<Longrightarrow> f (x - y) = f x - f y
[PROOF STEP]
interpret vectorspace V
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vectorspace V
[PROOF STEP]
by fact
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>x \<in> V; y \<in> V\<rbrakk> \<Longrightarrow> f (x - y) = f x - f y
[PROOF STEP]
assume x: "x \<in> V" and y: "y \<in> V"
[PROOF STATE]
proof (state)
this:
x \<in> V
y \<in> V

goal (1 subgoal):
 1. \<lbrakk>x \<in> V; y \<in> V\<rbrakk> \<Longrightarrow> f (x - y) = f x - f y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<in> V
y \<in> V
[PROOF STEP]
have "x - y = x + - y"
[PROOF STATE]
proof (prove)
using this:
x \<in> V
y \<in> V

goal (1 subgoal):
 1. x - y = x + - y
[PROOF STEP]
by (rule diff_eq1)
[PROOF STATE]
proof (state)
this:
x - y = x + - y

goal (1 subgoal):
 1. \<lbrakk>x \<in> V; y \<in> V\<rbrakk> \<Longrightarrow> f (x - y) = f x - f y
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
x - y = x + - y

goal (1 subgoal):
 1. \<lbrakk>x \<in> V; y \<in> V\<rbrakk> \<Longrightarrow> f (x - y) = f x - f y
[PROOF STEP]
have "f \<dots> = f x + f (- y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f (x + - y) = f x + f (- y)
[PROOF STEP]
by (rule add) (simp_all add: x y)
[PROOF STATE]
proof (state)
this:
f (x + - y) = f x + f (- y)

goal (1 subgoal):
 1. \<lbrakk>x \<in> V; y \<in> V\<rbrakk> \<Longrightarrow> f (x - y) = f x - f y
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
f (x + - y) = f x + f (- y)

goal (1 subgoal):
 1. \<lbrakk>x \<in> V; y \<in> V\<rbrakk> \<Longrightarrow> f (x - y) = f x - f y
[PROOF STEP]
have "f (- y) = - f y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f (- y) = - f y
[PROOF STEP]
using \<open>vectorspace V\<close> y
[PROOF STATE]
proof (prove)
using this:
vectorspace V
y \<in> V

goal (1 subgoal):
 1. f (- y) = - f y
[PROOF STEP]
by (rule neg)
[PROOF STATE]
proof (state)
this:
f (- y) = - f y

goal (1 subgoal):
 1. \<lbrakk>x \<in> V; y \<in> V\<rbrakk> \<Longrightarrow> f (x - y) = f x - f y
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
f (x - y) = f x + - f y
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
f (x - y) = f x + - f y

goal (1 subgoal):
 1. f (x - y) = f x - f y
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
f (x - y) = f x - f y

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma perp2_comm:
  assumes "P Perp2 A B C D"
  shows "P Perp2 B A D C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P Perp2 B A D C
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. P Perp2 B A D C
[PROOF STEP]
obtain X Y where "Col P X Y \<and> X Y Perp A B \<and> X Y Perp C D"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>X Y. Col P X Y \<and> X Y Perp A B \<and> X Y Perp C D \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using Perp2_def assms
[PROOF STATE]
proof (prove)
using this:
?P Perp2 ?A ?B ?C ?D \<equiv> \<exists>X Y. Col ?P X Y \<and> X Y Perp ?A ?B \<and> X Y Perp ?C ?D
P Perp2 A B C D

goal (1 subgoal):
 1. (\<And>X Y. Col P X Y \<and> X Y Perp A B \<and> X Y Perp C D \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Col P X Y \<and> X Y Perp A B \<and> X Y Perp C D

goal (1 subgoal):
 1. P Perp2 B A D C
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
Col P X Y \<and> X Y Perp A B \<and> X Y Perp C D

goal (1 subgoal):
 1. P Perp2 B A D C
[PROOF STEP]
using assms perp2_left_comm perp2_right_comm
[PROOF STATE]
proof (prove)
using this:
Col P X Y \<and> X Y Perp A B \<and> X Y Perp C D
P Perp2 A B C D
?P Perp2 ?A ?B ?C ?D \<Longrightarrow> ?P Perp2 ?B ?A ?C ?D
?P Perp2 ?A ?B ?C ?D \<Longrightarrow> ?P Perp2 ?A ?B ?D ?C

goal (1 subgoal):
 1. P Perp2 B A D C
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
P Perp2 B A D C

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma sym_derive_design_bibd:
  assumes "\<Lambda> > 1"
  shows "bibd bl \<B>\<^sup>D \<Lambda> (\<Lambda> - 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bibd bl \<B>\<^sup>D \<Lambda> (\<Lambda> - 1)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. bibd bl \<B>\<^sup>D \<Lambda> (\<Lambda> - 1)
[PROOF STEP]
interpret des: proper_design bl "\<B>\<^sup>D"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. proper_design bl \<B>\<^sup>D
[PROOF STEP]
using derived_is_proper assms valid_block
[PROOF STATE]
proof (prove)
using this:
(\<And>b. b \<in># remove1_mset bl \<B> \<Longrightarrow> 0 < bl |\<inter>| b) \<Longrightarrow> proper_design bl \<B>\<^sup>D
1 < \<Lambda>
bl \<in># \<B>

goal (1 subgoal):
 1. proper_design bl \<B>\<^sup>D
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. bibd bl \<B>\<^sup>D \<Lambda> (\<Lambda> - 1)
[PROOF STEP]
have "\<Lambda> < \<k>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Lambda> < \<k>
[PROOF STEP]
using index_lt_replication rep_value_sym
[PROOF STATE]
proof (prove)
using this:
\<Lambda> < \<r>
\<r> = \<k>

goal (1 subgoal):
 1. \<Lambda> < \<k>
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
\<Lambda> < \<k>

goal (1 subgoal):
 1. bibd bl \<B>\<^sup>D \<Lambda> (\<Lambda> - 1)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<Lambda> < \<k>
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<Lambda> < \<k>

goal (1 subgoal):
 1. bibd bl \<B>\<^sup>D \<Lambda> (\<Lambda> - 1)
[PROOF STEP]
using derived_block_size assms derived_points_index derived_points_order
[PROOF STATE]
proof (prove)
using this:
\<Lambda> < \<k>
?b \<in># \<B>\<^sup>D \<Longrightarrow> card ?b = \<Lambda>
1 < \<Lambda>
\<lbrakk>?ps \<subseteq> bl; card ?ps = 2\<rbrakk> \<Longrightarrow> \<B>\<^sup>D index ?ps = \<Lambda> - 1
derived_incidence_sys.\<v> = \<k>

goal (1 subgoal):
 1. bibd bl \<B>\<^sup>D \<Lambda> (\<Lambda> - 1)
[PROOF STEP]
by (unfold_locales) (simp_all)
[PROOF STATE]
proof (state)
this:
bibd bl \<B>\<^sup>D \<Lambda> (\<Lambda> - 1)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma triangle_set_graph_edge_ss:
  assumes "E' \<subseteq> E"
  shows "(sgraph.triangle_set E') \<subseteq> (triangle_set)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sgraph.triangle_set E' \<subseteq> triangle_set
[PROOF STEP]
proof (intro subsetI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> sgraph.triangle_set E' \<Longrightarrow> x \<in> triangle_set
[PROOF STEP]
interpret gnew: sgraph V E'
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sgraph V E'
[PROOF STEP]
using assms wellformed two_edges
[PROOF STATE]
proof (prove)
using this:
E' \<subseteq> E
?e \<in> E \<Longrightarrow> ?e \<subseteq> V
?e \<in> E \<Longrightarrow> card ?e = 2

goal (1 subgoal):
 1. sgraph V E'
[PROOF STEP]
by (unfold_locales) auto
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> gnew.triangle_set \<Longrightarrow> x \<in> triangle_set
[PROOF STEP]
fix t
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> gnew.triangle_set \<Longrightarrow> x \<in> triangle_set
[PROOF STEP]
assume "t \<in> gnew.triangle_set"
[PROOF STATE]
proof (state)
this:
t \<in> gnew.triangle_set

goal (1 subgoal):
 1. \<And>x. x \<in> gnew.triangle_set \<Longrightarrow> x \<in> triangle_set
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
t \<in> gnew.triangle_set
[PROOF STEP]
obtain x y z where "t = {x,y,z}" and "gnew.triangle_in_graph x y z"
[PROOF STATE]
proof (prove)
using this:
t \<in> gnew.triangle_set

goal (1 subgoal):
 1. (\<And>x y z. \<lbrakk>t = {x, y, z}; gnew.triangle_in_graph x y z\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using gnew.triangle_set_def assms mem_Collect_eq
[PROOF STATE]
proof (prove)
using this:
t \<in> gnew.triangle_set
gnew.triangle_set \<equiv> {{x, y, z} |x y z. gnew.triangle_in_graph x y z}
E' \<subseteq> E
(?a \<in> Collect ?P) = ?P ?a

goal (1 subgoal):
 1. (\<And>x y z. \<lbrakk>t = {x, y, z}; gnew.triangle_in_graph x y z\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
t = {x, y, z}
gnew.triangle_in_graph x y z

goal (1 subgoal):
 1. \<And>x. x \<in> gnew.triangle_set \<Longrightarrow> x \<in> triangle_set
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
t = {x, y, z}
gnew.triangle_in_graph x y z
[PROOF STEP]
have "triangle_in_graph x y z"
[PROOF STATE]
proof (prove)
using this:
t = {x, y, z}
gnew.triangle_in_graph x y z

goal (1 subgoal):
 1. triangle_in_graph x y z
[PROOF STEP]
using assms triangle_in_graph_ss
[PROOF STATE]
proof (prove)
using this:
t = {x, y, z}
gnew.triangle_in_graph x y z
E' \<subseteq> E
\<lbrakk>?E' \<subseteq> E; sgraph.triangle_in_graph ?E' ?x ?y ?z\<rbrakk> \<Longrightarrow> triangle_in_graph ?x ?y ?z

goal (1 subgoal):
 1. triangle_in_graph x y z
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
triangle_in_graph x y z

goal (1 subgoal):
 1. \<And>x. x \<in> gnew.triangle_set \<Longrightarrow> x \<in> triangle_set
[PROOF STEP]
thus "t \<in> triangle_set"
[PROOF STATE]
proof (prove)
using this:
triangle_in_graph x y z

goal (1 subgoal):
 1. t \<in> triangle_set
[PROOF STEP]
using triangle_set_def assms
[PROOF STATE]
proof (prove)
using this:
triangle_in_graph x y z
triangle_set \<equiv> {{x, y, z} |x y z. triangle_in_graph x y z}
E' \<subseteq> E

goal (1 subgoal):
 1. t \<in> triangle_set
[PROOF STEP]
using \<open>t = {x,y,z}\<close>
[PROOF STATE]
proof (prove)
using this:
triangle_in_graph x y z
triangle_set \<equiv> {{x, y, z} |x y z. triangle_in_graph x y z}
E' \<subseteq> E
t = {x, y, z}

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma poincare_map_returns:
  assumes "returns_to P x" "closed P"
  shows "poincare_map P x \<in> P"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poincare_map P x \<in> P
[PROOF STEP]
by (auto intro!: return_time_returns assms simp: poincare_map_def)


[STATEMENT]
lemma (in is_cat_coequalizer) cat_coeq_unique:
  assumes "\<epsilon>' : (\<aa>,\<bb>,F,F') >\<^sub>C\<^sub>F\<^sub>.\<^sub>c\<^sub>o\<^sub>e\<^sub>q E' : \<Up>\<^sub>C \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> \<CC>"
  shows "\<exists>!f'.
    f' : E \<mapsto>\<^bsub>\<CC>\<^esub> E' \<and> \<epsilon>' = ntcf_const (\<Up>\<^sub>C (\<bb>\<^sub>P\<^sub>L F) (\<aa>\<^sub>P\<^sub>L F) F) \<CC> f' \<bullet>\<^sub>N\<^sub>T\<^sub>C\<^sub>F \<epsilon>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>!f'. f' : E \<mapsto>\<^bsub>\<CC>\<^esub> E' \<and> \<epsilon>' = ntcf_const (\<Up>\<^sub>C (\<bb>\<^sub>P\<^sub>L F) (\<aa>\<^sub>P\<^sub>L F) F) \<CC> f' \<bullet>\<^sub>N\<^sub>T\<^sub>S\<^sub>M\<^sub>C\<^sub>F \<epsilon>
[PROOF STEP]
by (rule cat_colim_unique[OF is_cat_coequalizerD(1)[OF assms]])