[STATEMENT]
lemma "\<forall>x. 0 \<le> f x \<Longrightarrow> \<forall>x. f x \<le> c * g x \<Longrightarrow> f \<in> O(g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>x. (0::'b) \<le> f x; \<forall>x. f x \<le> c * g x\<rbrakk> \<Longrightarrow> f \<in> O(g)
[PROOF STEP]
apply (auto simp add: bigo_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>x. (0::'b) \<le> f x; \<forall>x. f x \<le> c * g x\<rbrakk> \<Longrightarrow> \<exists>c. \<forall>x. f x \<le> c * \<bar>g x\<bar>
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>\<forall>x. (0::'b) \<le> f x; \<forall>x. f x \<le> c * g x\<rbrakk> \<Longrightarrow> \<exists>c. \<forall>x. f x \<le> c * \<bar>g x\<bar>
[PROOF STEP]
assume "\<forall>x. f x \<le> c * g x"
[PROOF STATE]
proof (state)
this:
\<forall>x. f x \<le> c * g x

goal (1 subgoal):
 1. \<lbrakk>\<forall>x. (0::'b) \<le> f x; \<forall>x. f x \<le> c * g x\<rbrakk> \<Longrightarrow> \<exists>c. \<forall>x. f x \<le> c * \<bar>g x\<bar>
[PROOF STEP]
thus "\<exists>c. \<forall>x. f x \<le> c * \<bar>g x\<bar>"
[PROOF STATE]
proof (prove)
using this:
\<forall>x. f x \<le> c * g x

goal (1 subgoal):
 1. \<exists>c. \<forall>x. f x \<le> c * \<bar>g x\<bar>
[PROOF STEP]
by (metis abs_mult abs_ge_self order_trans)
[PROOF STATE]
proof (state)
this:
\<exists>c. \<forall>x. f x \<le> c * \<bar>g x\<bar>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma sinh_converges: "(\<lambda>n. if even n then 0 else x ^ n /\<^sub>R fact n) sums sinh x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. if even n then 0::'a else x ^ n /\<^sub>R fact n) sums sinh x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<lambda>n. if even n then 0::'a else x ^ n /\<^sub>R fact n) sums sinh x
[PROOF STEP]
have "(\<lambda>n. (x ^ n /\<^sub>R fact n - (-x) ^ n /\<^sub>R fact n) /\<^sub>R 2) sums sinh x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. (x ^ n /\<^sub>R fact n - (- x) ^ n /\<^sub>R fact n) /\<^sub>R 2) sums sinh x
[PROOF STEP]
unfolding sinh_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. (x ^ n /\<^sub>R fact n - (- x) ^ n /\<^sub>R fact n) /\<^sub>R 2) sums ((exp x - exp (- x)) /\<^sub>R 2)
[PROOF STEP]
by (intro sums_scaleR_right sums_diff exp_converges)
[PROOF STATE]
proof (state)
this:
(\<lambda>n. (x ^ n /\<^sub>R fact n - (- x) ^ n /\<^sub>R fact n) /\<^sub>R 2) sums sinh x

goal (1 subgoal):
 1. (\<lambda>n. if even n then 0::'a else x ^ n /\<^sub>R fact n) sums sinh x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<lambda>n. (x ^ n /\<^sub>R fact n - (- x) ^ n /\<^sub>R fact n) /\<^sub>R 2) sums sinh x

goal (1 subgoal):
 1. (\<lambda>n. if even n then 0::'a else x ^ n /\<^sub>R fact n) sums sinh x
[PROOF STEP]
have "(\<lambda>n. (x ^ n /\<^sub>R fact n - (-x) ^ n /\<^sub>R fact n) /\<^sub>R 2) =
               (\<lambda>n. if even n then 0 else x ^ n /\<^sub>R fact n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. (x ^ n /\<^sub>R fact n - (- x) ^ n /\<^sub>R fact n) /\<^sub>R 2) = (\<lambda>n. if even n then 0::'a else x ^ n /\<^sub>R fact n)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<lambda>n. (x ^ n /\<^sub>R fact n - (- x) ^ n /\<^sub>R fact n) /\<^sub>R 2) = (\<lambda>n. if even n then 0::'a else x ^ n /\<^sub>R fact n)

goal (1 subgoal):
 1. (\<lambda>n. if even n then 0::'a else x ^ n /\<^sub>R fact n) sums sinh x
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>n. if even n then 0::'a else x ^ n /\<^sub>R fact n) sums sinh x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. if even n then 0::'a else x ^ n /\<^sub>R fact n) sums sinh x

goal (1 subgoal):
 1. (\<lambda>n. if even n then 0::'a else x ^ n /\<^sub>R fact n) sums sinh x
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(\<lambda>n. if even n then 0::'a else x ^ n /\<^sub>R fact n) sums sinh x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma infinite_sumset_aux:
  assumes "infinite (A \<inter> G)"
  shows "infinite (sumset A B) \<longleftrightarrow> B \<inter> G \<noteq> {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. infinite (sumset A B) = (B \<inter> G \<noteq> {})
[PROOF STEP]
proof (cases "B \<inter> G = {}")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. B \<inter> G = {} \<Longrightarrow> infinite (sumset A B) = (B \<inter> G \<noteq> {})
 2. B \<inter> G \<noteq> {} \<Longrightarrow> infinite (sumset A B) = (B \<inter> G \<noteq> {})
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
B \<inter> G \<noteq> {}

goal (2 subgoals):
 1. B \<inter> G = {} \<Longrightarrow> infinite (sumset A B) = (B \<inter> G \<noteq> {})
 2. B \<inter> G \<noteq> {} \<Longrightarrow> infinite (sumset A B) = (B \<inter> G \<noteq> {})
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
B \<inter> G \<noteq> {}
[PROOF STEP]
obtain b where b: "b \<in> B" "b \<in> G"
[PROOF STATE]
proof (prove)
using this:
B \<inter> G \<noteq> {}

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

goal (2 subgoals):
 1. B \<inter> G = {} \<Longrightarrow> infinite (sumset A B) = (B \<inter> G \<noteq> {})
 2. B \<inter> G \<noteq> {} \<Longrightarrow> infinite (sumset A B) = (B \<inter> G \<noteq> {})
[PROOF STEP]
with assms commutative
[PROOF STATE]
proof (chain)
picking this:
infinite (A \<inter> G)
\<lbrakk>?x \<in> G; ?y \<in> G\<rbrakk> \<Longrightarrow> ?x \<oplus> ?y = ?y \<oplus> ?x
b \<in> B
b \<in> G
[PROOF STEP]
have "((\<oplus>)b) ` (A \<inter> G) \<subseteq> sumset A B"
[PROOF STATE]
proof (prove)
using this:
infinite (A \<inter> G)
\<lbrakk>?x \<in> G; ?y \<in> G\<rbrakk> \<Longrightarrow> ?x \<oplus> ?y = ?y \<oplus> ?x
b \<in> B
b \<in> G

goal (1 subgoal):
 1. (\<oplus>) b ` (A \<inter> G) \<subseteq> sumset A B
[PROOF STEP]
by (auto simp: sumset)
[PROOF STATE]
proof (state)
this:
(\<oplus>) b ` (A \<inter> G) \<subseteq> sumset A B

goal (2 subgoals):
 1. B \<inter> G = {} \<Longrightarrow> infinite (sumset A B) = (B \<inter> G \<noteq> {})
 2. B \<inter> G \<noteq> {} \<Longrightarrow> infinite (sumset A B) = (B \<inter> G \<noteq> {})
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(\<oplus>) b ` (A \<inter> G) \<subseteq> sumset A B

goal (2 subgoals):
 1. B \<inter> G = {} \<Longrightarrow> infinite (sumset A B) = (B \<inter> G \<noteq> {})
 2. B \<inter> G \<noteq> {} \<Longrightarrow> infinite (sumset A B) = (B \<inter> G \<noteq> {})
[PROOF STEP]
have "inj_on ((\<oplus>)b) (A \<inter> G)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on ((\<oplus>) b) (A \<inter> G)
[PROOF STEP]
by (meson IntD2 b inj_onI invertible invertible_left_cancel)
[PROOF STATE]
proof (state)
this:
inj_on ((\<oplus>) b) (A \<inter> G)

goal (2 subgoals):
 1. B \<inter> G = {} \<Longrightarrow> infinite (sumset A B) = (B \<inter> G \<noteq> {})
 2. B \<inter> G \<noteq> {} \<Longrightarrow> infinite (sumset A B) = (B \<inter> G \<noteq> {})
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
(\<oplus>) b ` (A \<inter> G) \<subseteq> sumset A B
inj_on ((\<oplus>) b) (A \<inter> G)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<oplus>) b ` (A \<inter> G) \<subseteq> sumset A B
inj_on ((\<oplus>) b) (A \<inter> G)

goal (1 subgoal):
 1. infinite (sumset A B) = (B \<inter> G \<noteq> {})
[PROOF STEP]
by (metis False assms inj_on_finite)
[PROOF STATE]
proof (state)
this:
infinite (sumset A B) = (B \<inter> G \<noteq> {})

goal (1 subgoal):
 1. B \<inter> G = {} \<Longrightarrow> infinite (sumset A B) = (B \<inter> G \<noteq> {})
[PROOF STEP]
qed (auto simp: sumset_eq)


[STATEMENT]
lemma Gamma_minus_one_half_real:
  "Gamma (-(1/2) :: real) = - 2 * sqrt pi"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Gamma (- (1 / 2)) = - 2 * sqrt pi
[PROOF STEP]
using rGamma_plus1[of "-1/2 :: real"]
[PROOF STATE]
proof (prove)
using this:
- 1 / 2 * rGamma (- 1 / 2 + 1) = rGamma (- 1 / 2)

goal (1 subgoal):
 1. Gamma (- (1 / 2)) = - 2 * sqrt pi
[PROOF STEP]
by (simp add: rGamma_inverse_Gamma divide_simps Gamma_one_half_real split: if_split_asm)


[STATEMENT]
lemma connecting_paths_empty_iff: "vert_connected u v \<longleftrightarrow> connecting_paths u v \<noteq> {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vert_connected u v = (connecting_paths u v \<noteq> {})
[PROOF STEP]
unfolding connecting_paths_def vert_connected_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>xs. connecting_path u v xs) = ({xs. connecting_path u v xs} \<noteq> {})
[PROOF STEP]
by auto


[STATEMENT]
theorem argmaxadequacy: fixes f::"'a => ('b::linorder)" fixes l::"'a list"
                        shows "argmaxList f l = [ x <- l. f x \<ge> Max (f`(set l))]"
                        (is "?lh=_")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. argmaxList f l = filter (\<lambda>x. Max (f ` set l) \<le> f x) l
[PROOF STEP]
(* pattern match ?lh abbreviates "argmaxList f l" *)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. argmaxList f l = filter (\<lambda>x. Max (f ` set l) \<le> f x) l
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. argmaxList f l = filter (\<lambda>x. Max (f ` set l) \<le> f x) l
[PROOF STEP]
let ?P="% y::('b::linorder) . y \<ge> Max (f`(set l))"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. argmaxList f l = filter (\<lambda>x. Max (f ` set l) \<le> f x) l
[PROOF STEP]
let ?mh="[nth l n . n <- [0..<size l], ?P (f (nth l n))]"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. argmaxList f l = filter (\<lambda>x. Max (f ` set l) \<le> f x) l
[PROOF STEP]
let ?rh="[ x <- (map (nth l) [0..<size l]). ?P (f x)]"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. argmaxList f l = filter (\<lambda>x. Max (f ` set l) \<le> f x) l
[PROOF STEP]
have "?lh = ?mh"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. argmaxList f l = concat (map (\<lambda>n. if Max (f ` set l) \<le> f (l ! n) then [l ! n] else []) [0..<length l])
[PROOF STEP]
using lm08
[PROOF STATE]
proof (prove)
using this:
argmaxList ?f ?l = concat (map (\<lambda>n. if Max (?f ` set ?l) \<le> ?f (?l ! n) then [?l ! n] else []) [0..<length ?l])

goal (1 subgoal):
 1. argmaxList f l = concat (map (\<lambda>n. if Max (f ` set l) \<le> f (l ! n) then [l ! n] else []) [0..<length l])
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
argmaxList f l = concat (map (\<lambda>n. if Max (f ` set l) \<le> f (l ! n) then [l ! n] else []) [0..<length l])

goal (1 subgoal):
 1. argmaxList f l = filter (\<lambda>x. Max (f ` set l) \<le> f x) l
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
argmaxList f l = concat (map (\<lambda>n. if Max (f ` set l) \<le> f (l ! n) then [l ! n] else []) [0..<length l])

goal (1 subgoal):
 1. argmaxList f l = filter (\<lambda>x. Max (f ` set l) \<le> f x) l
[PROOF STEP]
have "... = ?rh"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. concat (map (\<lambda>n. if Max (f ` set l) \<le> f (l ! n) then [l ! n] else []) [0..<length l]) = filter (\<lambda>x. Max (f ` set l) \<le> f x) (map ((!) l) [0..<length l])
[PROOF STEP]
using map_commutes
[PROOF STATE]
proof (prove)
using this:
concat (map (\<lambda>n. if ?Q (?f n) then [?f n] else []) ?xs) = filter ?Q (map ?f ?xs)

goal (1 subgoal):
 1. concat (map (\<lambda>n. if Max (f ` set l) \<le> f (l ! n) then [l ! n] else []) [0..<length l]) = filter (\<lambda>x. Max (f ` set l) \<le> f x) (map ((!) l) [0..<length l])
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
concat (map (\<lambda>n. if Max (f ` set l) \<le> f (l ! n) then [l ! n] else []) [0..<length l]) = filter (\<lambda>x. Max (f ` set l) \<le> f x) (map ((!) l) [0..<length l])

goal (1 subgoal):
 1. argmaxList f l = filter (\<lambda>x. Max (f ` set l) \<le> f x) l
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
concat (map (\<lambda>n. if Max (f ` set l) \<le> f (l ! n) then [l ! n] else []) [0..<length l]) = filter (\<lambda>x. Max (f ` set l) \<le> f x) (map ((!) l) [0..<length l])

goal (1 subgoal):
 1. argmaxList f l = filter (\<lambda>x. Max (f ` set l) \<le> f x) l
[PROOF STEP]
have "...= [x <- l. ?P (f x)]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. filter (\<lambda>x. Max (f ` set l) \<le> f x) (map ((!) l) [0..<length l]) = filter (\<lambda>x. Max (f ` set l) \<le> f x) l
[PROOF STEP]
using map_nth
[PROOF STATE]
proof (prove)
using this:
map ((!) ?xs) [0..<length ?xs] = ?xs

goal (1 subgoal):
 1. filter (\<lambda>x. Max (f ` set l) \<le> f x) (map ((!) l) [0..<length l]) = filter (\<lambda>x. Max (f ` set l) \<le> f x) l
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
filter (\<lambda>x. Max (f ` set l) \<le> f x) (map ((!) l) [0..<length l]) = filter (\<lambda>x. Max (f ` set l) \<le> f x) l

goal (1 subgoal):
 1. argmaxList f l = filter (\<lambda>x. Max (f ` set l) \<le> f x) l
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
argmaxList f l = filter (\<lambda>x. Max (f ` set l) \<le> f x) l
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
argmaxList f l = filter (\<lambda>x. Max (f ` set l) \<le> f x) l

goal (1 subgoal):
 1. argmaxList f l = filter (\<lambda>x. Max (f ` set l) \<le> f x) l
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
argmaxList f l = filter (\<lambda>x. Max (f ` set l) \<le> f x) l

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma finite_nempty_preorder_has_min:
  assumes "finite B" "B \<noteq> {}" "refl_on B R" "trans R" "total_on B R"
  shows "\<exists>x \<in> B. \<forall>y \<in> B. (y, x) \<in> R"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>x\<in>B. \<forall>y\<in>B. y \<succeq>[R] x
[PROOF STEP]
using assms(1) subset_refl[of B] assms(2)
[PROOF STATE]
proof (prove)
using this:
finite B
B \<subseteq> B
B \<noteq> {}

goal (1 subgoal):
 1. \<exists>x\<in>B. \<forall>y\<in>B. y \<succeq>[R] x
[PROOF STEP]
proof (induct B rule: finite_subset_induct)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. {} \<noteq> {} \<Longrightarrow> \<exists>x\<in>{}. \<forall>y\<in>{}. y \<succeq>[R] x
 2. \<And>a F. \<lbrakk>finite F; a \<in> B; a \<notin> F; F \<noteq> {} \<Longrightarrow> \<exists>x\<in>F. \<forall>y\<in>F. y \<succeq>[R] x; insert a F \<noteq> {}\<rbrakk> \<Longrightarrow> \<exists>x\<in>insert a F. \<forall>y\<in>insert a F. y \<succeq>[R] x
[PROOF STEP]
case (insert x F)
[PROOF STATE]
proof (state)
this:
finite F
x \<in> B
x \<notin> F
F \<noteq> {} \<Longrightarrow> \<exists>x\<in>F. \<forall>y\<in>F. y \<succeq>[R] x
insert x F \<noteq> {}

goal (2 subgoals):
 1. {} \<noteq> {} \<Longrightarrow> \<exists>x\<in>{}. \<forall>y\<in>{}. y \<succeq>[R] x
 2. \<And>a F. \<lbrakk>finite F; a \<in> B; a \<notin> F; F \<noteq> {} \<Longrightarrow> \<exists>x\<in>F. \<forall>y\<in>F. y \<succeq>[R] x; insert a F \<noteq> {}\<rbrakk> \<Longrightarrow> \<exists>x\<in>insert a F. \<forall>y\<in>insert a F. y \<succeq>[R] x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
finite F
x \<in> B
x \<notin> F
F \<noteq> {} \<Longrightarrow> \<exists>x\<in>F. \<forall>y\<in>F. y \<succeq>[R] x
insert x F \<noteq> {}
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
finite F
x \<in> B
x \<notin> F
F \<noteq> {} \<Longrightarrow> \<exists>x\<in>F. \<forall>y\<in>F. y \<succeq>[R] x
insert x F \<noteq> {}

goal (1 subgoal):
 1. \<exists>xa\<in>insert x F. \<forall>y\<in>insert x F. y \<succeq>[R] xa
[PROOF STEP]
using assms(3-)
[PROOF STATE]
proof (prove)
using this:
finite F
x \<in> B
x \<notin> F
F \<noteq> {} \<Longrightarrow> \<exists>x\<in>F. \<forall>y\<in>F. y \<succeq>[R] x
insert x F \<noteq> {}
refl_on B R
trans R
total_on B R

goal (1 subgoal):
 1. \<exists>xa\<in>insert x F. \<forall>y\<in>insert x F. y \<succeq>[R] xa
[PROOF STEP]
by (cases "F = {}") (auto simp: refl_onD total_on_def, metis refl_onD2 transE)
[PROOF STATE]
proof (state)
this:
\<exists>xa\<in>insert x F. \<forall>y\<in>insert x F. y \<succeq>[R] xa

goal (1 subgoal):
 1. {} \<noteq> {} \<Longrightarrow> \<exists>x\<in>{}. \<forall>y\<in>{}. y \<succeq>[R] x
[PROOF STEP]
qed auto


[STATEMENT]
lemma wf_atom_constT_imp_objT: "wf_atom (ty_term Q constT) a \<Longrightarrow> wf_atom (ty_term Q objT) a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wf_atom (ty_term Q constT) a \<Longrightarrow> wf_atom (ty_term Q objT) a
[PROOF STEP]
apply (erule wf_atom_mono[rotated])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ty_term Q constT \<subseteq>\<^sub>m ty_term Q objT
[PROOF STEP]
apply (rule ty_term_mono)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. Q \<subseteq>\<^sub>m Q
 2. constT \<subseteq>\<^sub>m objT
[PROOF STEP]
by (simp_all add: constT_ss_objT)


[STATEMENT]
lemma real_powr_at_top:
  assumes "(p::real) > 0"
  shows   "filterlim (\<lambda>x. x powr p) at_top at_top"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. LIM x at_top. x powr p :> at_top
[PROOF STEP]
proof (subst filterlim_cong[OF refl refl])
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<forall>\<^sub>F x in at_top. x powr p = ?g x
 2. filterlim ?g at_top at_top
[PROOF STEP]
show "LIM x at_top. exp (p * ln x) :> at_top"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. LIM x at_top. exp (p * ln x) :> at_top
[PROOF STEP]
by (rule filterlim_compose[OF exp_at_top filterlim_tendsto_pos_mult_at_top[OF tendsto_const]])
       (simp_all add: ln_at_top assms)
[PROOF STATE]
proof (state)
this:
LIM x at_top. exp (p * ln x) :> at_top

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. x powr p = exp (p * ln x)
[PROOF STEP]
show "eventually (\<lambda>x. x powr p = exp (p * ln x)) at_top"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. x powr p = exp (p * ln x)
[PROOF STEP]
using eventually_gt_at_top[of 0]
[PROOF STATE]
proof (prove)
using this:
eventually ((<) (0::?'a1)) at_top

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. x powr p = exp (p * ln x)
[PROOF STEP]
by eventually_elim (simp add: powr_def)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in at_top. x powr p = exp (p * ln x)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma moebius_translation_comp [simp]:
  shows "moebius_comp (moebius_translation v1) (moebius_translation v2) = moebius_translation (v1 + v2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. moebius_comp (moebius_translation v1) (moebius_translation v2) = moebius_translation (v1 + v2)
[PROOF STEP]
unfolding moebius_translation_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. moebius_comp (moebius_similarity 1 v1) (moebius_similarity 1 v2) = moebius_similarity 1 (v1 + v2)
[PROOF STEP]
by (simp add: field_simps)


[STATEMENT]
lemma winding_number_circlepath_centre: "0 < r \<Longrightarrow> winding_number (circlepath z r) z = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < r \<Longrightarrow> winding_number (circlepath z r) z = 1
[PROOF STEP]
apply (rule winding_number_unique_loop)
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. 0 < r \<Longrightarrow> path (circlepath z r)
 2. 0 < r \<Longrightarrow> z \<notin> path_image (circlepath z r)
 3. 0 < r \<Longrightarrow> pathfinish (circlepath z r) = pathstart (circlepath z r)
 4. \<And>e. \<lbrakk>0 < r; 0 < e\<rbrakk> \<Longrightarrow> \<exists>p. valid_path p \<and> z \<notin> path_image p \<and> pathfinish p = pathstart p \<and> (\<forall>t\<in>{0..1}. cmod (circlepath z r t - p t) < e) \<and> contour_integral p (\<lambda>w. 1 / (w - z)) = complex_of_real (2 * pi) * \<i> * 1
[PROOF STEP]
apply (simp_all add: sphere_def valid_path_imp_path)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>e. \<lbrakk>0 < r; 0 < e\<rbrakk> \<Longrightarrow> \<exists>p. valid_path p \<and> z \<notin> path_image p \<and> pathfinish p = pathstart p \<and> (\<forall>t\<in>{0..1}. cmod (circlepath z r t - p t) < e) \<and> contour_integral p (\<lambda>w. 1 / (w - z)) = 2 * complex_of_real pi * \<i>
[PROOF STEP]
apply (rule_tac x="circlepath z r" in exI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>e. \<lbrakk>0 < r; 0 < e\<rbrakk> \<Longrightarrow> valid_path (circlepath z r) \<and> z \<notin> path_image (circlepath z r) \<and> pathfinish (circlepath z r) = pathstart (circlepath z r) \<and> (\<forall>t\<in>{0..1}. cmod (circlepath z r t - circlepath z r t) < e) \<and> contour_integral (circlepath z r) (\<lambda>w. 1 / (w - z)) = 2 * complex_of_real pi * \<i>
[PROOF STEP]
apply (simp add: sphere_def contour_integral_circlepath)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma singleton_eq_conv: "({a} = {b}) = (a = b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ({a} = {b}) = (a = b)
[PROOF STEP]
by blast


[STATEMENT]
lemma bijective_open_imp_closed_map:
     "\<lbrakk>open_map X X' f; f ` (topspace X) = topspace X'; inj_on f (topspace X)\<rbrakk> \<Longrightarrow> closed_map X X' f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>open_map X X' f; f ` topspace X = topspace X'; inj_on f (topspace X)\<rbrakk> \<Longrightarrow> closed_map X X' f
[PROOF STEP]
unfolding open_map_def closed_map_def closedin_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>U. openin X U \<longrightarrow> openin X' (f ` U); f ` topspace X = topspace X'; inj_on f (topspace X)\<rbrakk> \<Longrightarrow> \<forall>U. U \<subseteq> topspace X \<and> openin X (topspace X - U) \<longrightarrow> f ` U \<subseteq> topspace X' \<and> openin X' (topspace X' - f ` U)
[PROOF STEP]
by auto (metis Diff_subset inj_on_image_set_diff)


[STATEMENT]
lemma bind_output_cong:
  assumes "x < order \<G>"
  shows "(x = nat ((int b - int ab) * fst (bezw (aa - ac) (order \<G>)) mod int (order \<G>)))
            \<longleftrightarrow> [x = nat ((int b - int ab) * fst (bezw (aa - ac) (order \<G>)) mod int (order \<G>))] (mod order \<G>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x = nat ((int b - int ab) * Number_Theory_Aux.inverse (aa - ac) (order \<G>) mod int (order \<G>))) = [x = nat ((int b - int ab) * Number_Theory_Aux.inverse (aa - ac) (order \<G>) mod int (order \<G>))] (mod order \<G>)
[PROOF STEP]
using assms cong_less_modulus_unique_nat nat_less_iff
[PROOF STATE]
proof (prove)
using this:
x < order \<G>
\<lbrakk>[?x = ?y] (mod ?m); ?x < ?m; ?y < ?m\<rbrakk> \<Longrightarrow> ?x = ?y
0 \<le> ?w \<Longrightarrow> (nat ?w < ?m) = (?w < int ?m)

goal (1 subgoal):
 1. (x = nat ((int b - int ab) * Number_Theory_Aux.inverse (aa - ac) (order \<G>) mod int (order \<G>))) = [x = nat ((int b - int ab) * Number_Theory_Aux.inverse (aa - ac) (order \<G>) mod int (order \<G>))] (mod order \<G>)
[PROOF STEP]
by auto


[STATEMENT]
lemma dord_pm_alt: "dord_pm ord = (\<lambda>x y. deg_pm x < deg_pm y \<or> (deg_pm x = deg_pm y \<and> ord x y))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dord_pm ord = (\<lambda>x y. deg_pm x < deg_pm y \<or> deg_pm x = deg_pm y \<and> ord x y)
[PROOF STEP]
by (intro ext) (transfer, simp add: dord_fun_def Let_def)


[STATEMENT]
lemma fun_mult_scalar_commute_canc:
  assumes "\<And>x y. f (x + y) = f x + f y" and "\<And>c t. f (monom_mult c t p) = monom_mult c t (f p)"
  shows "f (q \<odot> p) = q \<odot> (f (p::'t \<Rightarrow>\<^sub>0 'b::{semiring_0,cancel_comm_monoid_add}))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f (q \<odot> p) = q \<odot> f p
[PROOF STEP]
by (simp add: mult_scalar_sum_monomials assms(2)[symmetric], rule fun_sum_commute_canc, fact)


[STATEMENT]
lemma ceiling_ge_round: "\<lceil>x\<rceil> \<ge> round x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. round x \<le> \<lceil>x\<rceil>
[PROOF STEP]
unfolding round_altdef
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if (1::'a) / (2::'a) \<le> frac x then \<lceil>x\<rceil> else \<lfloor>x\<rfloor>) \<le> \<lceil>x\<rceil>
[PROOF STEP]
by simp


[STATEMENT]
lemma funs_term_subterms_eq[simp]:
  "(\<Union>s \<in> subterms t. funs_term s) = funs_term t"
  "(\<Union>s \<in> subterms\<^sub>s\<^sub>e\<^sub>t M. funs_term s) = \<Union>(funs_term ` M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union> (funs_term ` subterms t) = funs_term t &&& \<Union> (funs_term ` subterms\<^sub>s\<^sub>e\<^sub>t M) = \<Union> (funs_term ` M)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<Union> (funs_term ` subterms t) = funs_term t
 2. \<Union> (funs_term ` subterms\<^sub>s\<^sub>e\<^sub>t M) = \<Union> (funs_term ` M)
[PROOF STEP]
show "\<And>t. \<Union>(funs_term ` subterms t) = funs_term t"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>t. \<Union> (funs_term ` subterms t) = funs_term t
[PROOF STEP]
using term.order_refl subtermeq_imp_funs_term_subset
[PROOF STATE]
proof (prove)
using this:
?x \<sqsubseteq> ?x
?s \<sqsubseteq> ?t \<Longrightarrow> funs_term ?s \<subseteq> funs_term ?t

goal (1 subgoal):
 1. \<And>t. \<Union> (funs_term ` subterms t) = funs_term t
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<Union> (funs_term ` subterms ?t) = funs_term ?t

goal (1 subgoal):
 1. \<Union> (funs_term ` subterms\<^sub>s\<^sub>e\<^sub>t M) = \<Union> (funs_term ` M)
[PROOF STEP]
thus "\<Union>(funs_term ` (subterms\<^sub>s\<^sub>e\<^sub>t M)) = \<Union>(funs_term ` M)"
[PROOF STATE]
proof (prove)
using this:
\<Union> (funs_term ` subterms ?t) = funs_term ?t

goal (1 subgoal):
 1. \<Union> (funs_term ` subterms\<^sub>s\<^sub>e\<^sub>t M) = \<Union> (funs_term ` M)
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
\<Union> (funs_term ` subterms\<^sub>s\<^sub>e\<^sub>t M) = \<Union> (funs_term ` M)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma inv_baliL: "\<lbrakk> invh l; invh r; invc2 l; invc r; bheight l = bheight r \<rbrakk>
 \<Longrightarrow> invc (baliL l a r) \<and> invh (baliL l a r) \<and> bheight (baliL l a r) = Suc (bheight l)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>invh l; invh r; invc2 l; invc r; bheight l = bheight r\<rbrakk> \<Longrightarrow> invc (baliL l a r) \<and> invh (baliL l a r) \<and> bheight (baliL l a r) = Suc (bheight l)
[PROOF STEP]
by (induct l a r rule: baliL.induct) auto


[STATEMENT]
lemma stermsl_after_dtermsl [simp]:
  shows "(\<Union>x\<in>dtermsl p. stermsl x) = dtermsl p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union> (stermsl ` dtermsl p) = dtermsl p
[PROOF STEP]
by (induct p) simp_all


[STATEMENT]
lemma isCont_blinfunD:
  fixes f'::"'a::metric_space \<Rightarrow> 'b::real_normed_vector \<Rightarrow>\<^sub>L 'c::real_normed_vector"
  assumes "isCont f' a" "0 < e"
  shows "\<exists>d>0. \<forall>x. dist a x < d \<longrightarrow> onorm (\<lambda>v. blinfun_apply (f' x) v - blinfun_apply (f' a) v) < e"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>d>0. \<forall>x. dist a x < d \<longrightarrow> onorm (\<lambda>v. blinfun_apply (f' x) v - blinfun_apply (f' a) v) < e
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>d>0. \<forall>x. dist a x < d \<longrightarrow> onorm (\<lambda>v. blinfun_apply (f' x) v - blinfun_apply (f' a) v) < e
[PROOF STEP]
have "\<forall>\<^sub>F x in at a. dist (f' x) (f' a) < e"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F x in at a. dist (f' x) (f' a) < e
[PROOF STEP]
using assms isCont_def tendsto_iff
[PROOF STATE]
proof (prove)
using this:
isCont f' a
0 < e
isCont ?f ?a = ?f \<midarrow>?a\<rightarrow> ?f ?a
(?f \<longlongrightarrow> ?l) ?F = (\<forall>e>0. \<forall>\<^sub>F x in ?F. dist (?f x) ?l < e)

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at a. dist (f' x) (f' a) < e
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in at a. dist (f' x) (f' a) < e

goal (1 subgoal):
 1. \<exists>d>0. \<forall>x. dist a x < d \<longrightarrow> onorm (\<lambda>v. blinfun_apply (f' x) v - blinfun_apply (f' a) v) < e
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F x in at a. dist (f' x) (f' a) < e
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in at a. dist (f' x) (f' a) < e

goal (1 subgoal):
 1. \<exists>d>0. \<forall>x. dist a x < d \<longrightarrow> onorm (\<lambda>v. blinfun_apply (f' x) v - blinfun_apply (f' a) v) < e
[PROOF STEP]
using \<open>e > 0\<close> norm_eq_zero
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in at a. dist (f' x) (f' a) < e
0 < e
(norm ?x = 0) = (?x = (0::?'a))

goal (1 subgoal):
 1. \<exists>d>0. \<forall>x. dist a x < d \<longrightarrow> onorm (\<lambda>v. blinfun_apply (f' x) v - blinfun_apply (f' a) v) < e
[PROOF STEP]
by (force simp: eventually_at dist_commute dist_norm norm_blinfun.rep_eq
        simp flip: blinfun.bilinear_simps)
[PROOF STATE]
proof (state)
this:
\<exists>d>0. \<forall>x. dist a x < d \<longrightarrow> onorm (\<lambda>v. blinfun_apply (f' x) v - blinfun_apply (f' a) v) < e

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma gval_fold_equiv_fold_rev:
  "gval (fold gAnd G (Bc True)) s = gval (fold gAnd (rev G) (Bc True)) s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. gval (fold gAnd G (Bc True)) s = gval (fold gAnd (rev G) (Bc True)) s
[PROOF STEP]
by (simp add: gval_fold_rev_equiv_fold)


[STATEMENT]
lemma cong3_transitivity:
  assumes "A0 B0 C0 Cong3 A1 B1 C1" and
    "A1 B1 C1 Cong3 A2 B2 C2"
  shows "A0 B0 C0 Cong3 A2 B2 C2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A0 B0 C0 Cong3 A2 B2 C2
[PROOF STEP]
by (meson assms(1) assms(2) Cong3_def cong_inner_transitivity not_cong_3412)


[STATEMENT]
lemma int_gauss_norm_smult:
  assumes "g \<in> carrier (UP Q\<^sub>p)"
  assumes "g \<noteq> \<zero>\<^bsub>UP Q\<^sub>p\<^esub>"
  assumes "a \<in> nonzero Q\<^sub>p"
  shows "int_gauss_norm (a \<odot>\<^bsub>UP Q\<^sub>p\<^esub> g) = ord a + int_gauss_norm g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. int_gauss_norm (a \<odot>\<^bsub>UP Q\<^sub>p\<^esub> g) = ord a + int_gauss_norm g
[PROOF STEP]
using gauss_norm_smult[of g a] int_gauss_norm_eq val_ord assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>g \<in> carrier (UP Q\<^sub>p); a \<in> carrier Q\<^sub>p\<rbrakk> \<Longrightarrow> gauss_norm (a \<odot>\<^bsub>UP Q\<^sub>p\<^esub> g) = val a + gauss_norm g
\<lbrakk>?g \<in> carrier (UP Q\<^sub>p); ?g \<noteq> \<zero>\<^bsub>UP Q\<^sub>p\<^esub>\<rbrakk> \<Longrightarrow> eint (int_gauss_norm ?g) = gauss_norm ?g
?a \<in> nonzero Q\<^sub>p \<Longrightarrow> val ?a = eint (ord ?a)
g \<in> carrier (UP Q\<^sub>p)
g \<noteq> \<zero>\<^bsub>UP Q\<^sub>p\<^esub>
a \<in> nonzero Q\<^sub>p

goal (1 subgoal):
 1. int_gauss_norm (a \<odot>\<^bsub>UP Q\<^sub>p\<^esub> g) = ord a + int_gauss_norm g
[PROOF STEP]
by (metis (no_types, opaque_lifting) Qp.nonzero_closed UPQ.UP_smult_closed UPQ.cfs_zero
      eint.distinct(2) eint.inject gauss_norm_coeff_norm local.val_zero plus_eint_simps(1))


[STATEMENT]
lemma closed_lsorted': "(\<And>x. isCont f x) \<Longrightarrow> closed {xs. lsorted (f xs)}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>x. isCont f x) \<Longrightarrow> closed {xs. lsorted (f xs)}
[PROOF STEP]
using continuous_closed_vimage[of _ f, OF closed_lsorted]
[PROOF STATE]
proof (prove)
using this:
(\<And>x. isCont f x) \<Longrightarrow> closed (f -` {xs. lsorted xs})

goal (1 subgoal):
 1. (\<And>x. isCont f x) \<Longrightarrow> closed {xs. lsorted (f xs)}
[PROOF STEP]
by auto


[STATEMENT]
lemma plus_interval_tendsto:
  fixes x y :: "'a :: topological_monoid_add"
  assumes "X \<longlonglongrightarrow>\<^sub>i x" "Y \<longlonglongrightarrow>\<^sub>i y"
  shows "(\<lambda> i. X i + Y i) \<longlonglongrightarrow>\<^sub>i x + y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>i. X i + Y i) \<longlonglongrightarrow>\<^sub>i x + y
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<lambda>i. X i + Y i) \<longlonglongrightarrow>\<^sub>i x + y
[PROOF STEP]
have *: "X i + Y i = Interval (interval.lower (X i) + interval.lower (Y i)) (interval.upper (X i) + interval.upper (Y i))" for i
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. X i + Y i = Interval (interval.lower (X i) + interval.lower (Y i)) (interval.upper (X i) + interval.upper (Y i))
[PROOF STEP]
by (cases "X i"; cases "Y i", auto)
[PROOF STATE]
proof (state)
this:
X ?i + Y ?i = Interval (interval.lower (X ?i) + interval.lower (Y ?i)) (interval.upper (X ?i) + interval.upper (Y ?i))

goal (1 subgoal):
 1. (\<lambda>i. X i + Y i) \<longlonglongrightarrow>\<^sub>i x + y
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
X \<longlonglongrightarrow>\<^sub>i x
Y \<longlonglongrightarrow>\<^sub>i y
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
X \<longlonglongrightarrow>\<^sub>i x
Y \<longlonglongrightarrow>\<^sub>i y

goal (1 subgoal):
 1. (\<lambda>i. X i + Y i) \<longlonglongrightarrow>\<^sub>i x + y
[PROOF STEP]
unfolding * interval_tendsto_def o_def
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. interval.upper (X x)) \<longlonglongrightarrow> x \<and> (\<lambda>x. interval.lower (X x)) \<longlonglongrightarrow> x
(\<lambda>x. interval.upper (Y x)) \<longlonglongrightarrow> y \<and> (\<lambda>x. interval.lower (Y x)) \<longlonglongrightarrow> y

goal (1 subgoal):
 1. (\<lambda>x. interval.upper (Interval (interval.lower (X x) + interval.lower (Y x)) (interval.upper (X x) + interval.upper (Y x)))) \<longlonglongrightarrow> x + y \<and> (\<lambda>x. interval.lower (Interval (interval.lower (X x) + interval.lower (Y x)) (interval.upper (X x) + interval.upper (Y x)))) \<longlonglongrightarrow> x + y
[PROOF STEP]
by (auto intro: tendsto_intros)
[PROOF STATE]
proof (state)
this:
(\<lambda>i. X i + Y i) \<longlonglongrightarrow>\<^sub>i x + y

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma sum_image_mset_sum_map[simp]: "sum_mset (image_mset f (mset xs)) = sum_list (map f xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Sum>\<^sub># (image_mset f (mset xs)) = sum_list (map f xs)
[PROOF STEP]
by (metis mset_map sum_mset_sum_list)


[STATEMENT]
lemma tree_rank_estimate_lower:
  "tree_invar (Node e a r ts) \<Longrightarrow>
   size (tree_to_multiset (Node e a r ts)) \<ge> (2::nat)^r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. tree_invar (Node e a r ts) \<Longrightarrow> 2 ^ r \<le> size (tree_to_multiset (Node e a r ts))
[PROOF STEP]
proof (induct r arbitrary: e a ts)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>e a ts. tree_invar (Node e a 0 ts) \<Longrightarrow> 2 ^ 0 \<le> size (tree_to_multiset (Node e a 0 ts))
 2. \<And>r e a ts. \<lbrakk>\<And>e a ts. tree_invar (Node e a r ts) \<Longrightarrow> 2 ^ r \<le> size (tree_to_multiset (Node e a r ts)); tree_invar (Node e a (Suc r) ts)\<rbrakk> \<Longrightarrow> 2 ^ Suc r \<le> size (tree_to_multiset (Node e a (Suc r) ts))
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:
tree_invar (Node e a 0 ts)

goal (2 subgoals):
 1. \<And>e a ts. tree_invar (Node e a 0 ts) \<Longrightarrow> 2 ^ 0 \<le> size (tree_to_multiset (Node e a 0 ts))
 2. \<And>r e a ts. \<lbrakk>\<And>e a ts. tree_invar (Node e a r ts) \<Longrightarrow> 2 ^ r \<le> size (tree_to_multiset (Node e a r ts)); tree_invar (Node e a (Suc r) ts)\<rbrakk> \<Longrightarrow> 2 ^ Suc r \<le> size (tree_to_multiset (Node e a (Suc r) ts))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
tree_invar (Node e a 0 ts)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
tree_invar (Node e a 0 ts)

goal (1 subgoal):
 1. 2 ^ 0 \<le> size (tree_to_multiset (Node e a 0 ts))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
2 ^ 0 \<le> size (tree_to_multiset (Node e a 0 ts))

goal (1 subgoal):
 1. \<And>r e a ts. \<lbrakk>\<And>e a ts. tree_invar (Node e a r ts) \<Longrightarrow> 2 ^ r \<le> size (tree_to_multiset (Node e a r ts)); tree_invar (Node e a (Suc r) ts)\<rbrakk> \<Longrightarrow> 2 ^ Suc r \<le> size (tree_to_multiset (Node e a (Suc r) ts))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>r e a ts. \<lbrakk>\<And>e a ts. tree_invar (Node e a r ts) \<Longrightarrow> 2 ^ r \<le> size (tree_to_multiset (Node e a r ts)); tree_invar (Node e a (Suc r) ts)\<rbrakk> \<Longrightarrow> 2 ^ Suc r \<le> size (tree_to_multiset (Node e a (Suc r) ts))
[PROOF STEP]
case (Suc r)
[PROOF STATE]
proof (state)
this:
tree_invar (Node ?e ?a r ?ts) \<Longrightarrow> 2 ^ r \<le> size (tree_to_multiset (Node ?e ?a r ?ts))
tree_invar (Node e a (Suc r) ts)

goal (1 subgoal):
 1. \<And>r e a ts. \<lbrakk>\<And>e a ts. tree_invar (Node e a r ts) \<Longrightarrow> 2 ^ r \<le> size (tree_to_multiset (Node e a r ts)); tree_invar (Node e a (Suc r) ts)\<rbrakk> \<Longrightarrow> 2 ^ Suc r \<le> size (tree_to_multiset (Node e a (Suc r) ts))
[PROOF STEP]
from Suc(2)
[PROOF STATE]
proof (chain)
picking this:
tree_invar (Node e a (Suc r) ts)
[PROOF STEP]
obtain e1 a1 ts1 e2 a2 ts2 e' a' where
    link:
      "(Node e a (Suc r) ts) = link (Node e1 a1 r ts1) (Node e2 a2 r ts2) \<or>
       (Node e a (Suc r) ts) = skewlink e' a' (Node e1 a1 r ts1) (Node e2 a2 r ts2)"
    and inv1: "tree_invar (Node e1 a1 r ts1)"
    and inv2: "tree_invar (Node e2 a2 r ts2)"
[PROOF STATE]
proof (prove)
using this:
tree_invar (Node e a (Suc r) ts)

goal (1 subgoal):
 1. (\<And>e1 a1 ts1 e2 a2 ts2 e' a'. \<lbrakk>Node e a (Suc r) ts = link (Node e1 a1 r ts1) (Node e2 a2 r ts2) \<or> Node e a (Suc r) ts = skewlink e' a' (Node e1 a1 r ts1) (Node e2 a2 r ts2); tree_invar (Node e1 a1 r ts1); tree_invar (Node e2 a2 r ts2)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by simp blast
[PROOF STATE]
proof (state)
this:
Node e a (Suc r) ts = link (Node e1 a1 r ts1) (Node e2 a2 r ts2) \<or> Node e a (Suc r) ts = skewlink e' a' (Node e1 a1 r ts1) (Node e2 a2 r ts2)
tree_invar (Node e1 a1 r ts1)
tree_invar (Node e2 a2 r ts2)

goal (1 subgoal):
 1. \<And>r e a ts. \<lbrakk>\<And>e a ts. tree_invar (Node e a r ts) \<Longrightarrow> 2 ^ r \<le> size (tree_to_multiset (Node e a r ts)); tree_invar (Node e a (Suc r) ts)\<rbrakk> \<Longrightarrow> 2 ^ Suc r \<le> size (tree_to_multiset (Node e a (Suc r) ts))
[PROOF STEP]
note iv1 = Suc(1)[OF inv1]
[PROOF STATE]
proof (state)
this:
2 ^ r \<le> size (tree_to_multiset (Node e1 a1 r ts1))

goal (1 subgoal):
 1. \<And>r e a ts. \<lbrakk>\<And>e a ts. tree_invar (Node e a r ts) \<Longrightarrow> 2 ^ r \<le> size (tree_to_multiset (Node e a r ts)); tree_invar (Node e a (Suc r) ts)\<rbrakk> \<Longrightarrow> 2 ^ Suc r \<le> size (tree_to_multiset (Node e a (Suc r) ts))
[PROOF STEP]
note iv2 = Suc(1)[OF inv2]
[PROOF STATE]
proof (state)
this:
2 ^ r \<le> size (tree_to_multiset (Node e2 a2 r ts2))

goal (1 subgoal):
 1. \<And>r e a ts. \<lbrakk>\<And>e a ts. tree_invar (Node e a r ts) \<Longrightarrow> 2 ^ r \<le> size (tree_to_multiset (Node e a r ts)); tree_invar (Node e a (Suc r) ts)\<rbrakk> \<Longrightarrow> 2 ^ Suc r \<le> size (tree_to_multiset (Node e a (Suc r) ts))
[PROOF STEP]
have "(2::nat)^r - 1 + (2::nat)^r - 1 \<le> (2::nat)^(Suc r) - 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 ^ r - 1 + 2 ^ r - 1 \<le> 2 ^ Suc r - 1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
2 ^ r - 1 + 2 ^ r - 1 \<le> 2 ^ Suc r - 1

goal (1 subgoal):
 1. \<And>r e a ts. \<lbrakk>\<And>e a ts. tree_invar (Node e a r ts) \<Longrightarrow> 2 ^ r \<le> size (tree_to_multiset (Node e a r ts)); tree_invar (Node e a (Suc r) ts)\<rbrakk> \<Longrightarrow> 2 ^ Suc r \<le> size (tree_to_multiset (Node e a (Suc r) ts))
[PROOF STEP]
with link Suc
[PROOF STATE]
proof (chain)
picking this:
Node e a (Suc r) ts = link (Node e1 a1 r ts1) (Node e2 a2 r ts2) \<or> Node e a (Suc r) ts = skewlink e' a' (Node e1 a1 r ts1) (Node e2 a2 r ts2)
tree_invar (Node ?e ?a r ?ts) \<Longrightarrow> 2 ^ r \<le> size (tree_to_multiset (Node ?e ?a r ?ts))
tree_invar (Node e a (Suc r) ts)
2 ^ r - 1 + 2 ^ r - 1 \<le> 2 ^ Suc r - 1
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
Node e a (Suc r) ts = link (Node e1 a1 r ts1) (Node e2 a2 r ts2) \<or> Node e a (Suc r) ts = skewlink e' a' (Node e1 a1 r ts1) (Node e2 a2 r ts2)
tree_invar (Node ?e ?a r ?ts) \<Longrightarrow> 2 ^ r \<le> size (tree_to_multiset (Node ?e ?a r ?ts))
tree_invar (Node e a (Suc r) ts)
2 ^ r - 1 + 2 ^ r - 1 \<le> 2 ^ Suc r - 1

goal (1 subgoal):
 1. 2 ^ Suc r \<le> size (tree_to_multiset (Node e a (Suc r) ts))
[PROOF STEP]
apply (cases "Node e a (Suc r) ts = link (Node e1 a1 r ts1) (Node e2 a2 r ts2)")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>Node e a (Suc r) ts = link (Node e1 a1 r ts1) (Node e2 a2 r ts2) \<or> Node e a (Suc r) ts = skewlink e' a' (Node e1 a1 r ts1) (Node e2 a2 r ts2); \<And>e a ts. tree_invar (Node e a r ts) \<Longrightarrow> 2 ^ r \<le> size (tree_to_multiset (Node e a r ts)); tree_invar (Node e a (Suc r) ts); 2 ^ r - 1 + 2 ^ r - 1 \<le> 2 ^ Suc r - 1; Node e a (Suc r) ts = link (Node e1 a1 r ts1) (Node e2 a2 r ts2)\<rbrakk> \<Longrightarrow> 2 ^ Suc r \<le> size (tree_to_multiset (Node e a (Suc r) ts))
 2. \<lbrakk>Node e a (Suc r) ts = link (Node e1 a1 r ts1) (Node e2 a2 r ts2) \<or> Node e a (Suc r) ts = skewlink e' a' (Node e1 a1 r ts1) (Node e2 a2 r ts2); \<And>e a ts. tree_invar (Node e a r ts) \<Longrightarrow> 2 ^ r \<le> size (tree_to_multiset (Node e a r ts)); tree_invar (Node e a (Suc r) ts); 2 ^ r - 1 + 2 ^ r - 1 \<le> 2 ^ Suc r - 1; Node e a (Suc r) ts \<noteq> link (Node e1 a1 r ts1) (Node e2 a2 r ts2)\<rbrakk> \<Longrightarrow> 2 ^ Suc r \<le> size (tree_to_multiset (Node e a (Suc r) ts))
[PROOF STEP]
using iv1 iv2
[PROOF STATE]
proof (prove)
using this:
2 ^ r \<le> size (tree_to_multiset (Node e1 a1 r ts1))
2 ^ r \<le> size (tree_to_multiset (Node e2 a2 r ts2))

goal (2 subgoals):
 1. \<lbrakk>Node e a (Suc r) ts = link (Node e1 a1 r ts1) (Node e2 a2 r ts2) \<or> Node e a (Suc r) ts = skewlink e' a' (Node e1 a1 r ts1) (Node e2 a2 r ts2); \<And>e a ts. tree_invar (Node e a r ts) \<Longrightarrow> 2 ^ r \<le> size (tree_to_multiset (Node e a r ts)); tree_invar (Node e a (Suc r) ts); 2 ^ r - 1 + 2 ^ r - 1 \<le> 2 ^ Suc r - 1; Node e a (Suc r) ts = link (Node e1 a1 r ts1) (Node e2 a2 r ts2)\<rbrakk> \<Longrightarrow> 2 ^ Suc r \<le> size (tree_to_multiset (Node e a (Suc r) ts))
 2. \<lbrakk>Node e a (Suc r) ts = link (Node e1 a1 r ts1) (Node e2 a2 r ts2) \<or> Node e a (Suc r) ts = skewlink e' a' (Node e1 a1 r ts1) (Node e2 a2 r ts2); \<And>e a ts. tree_invar (Node e a r ts) \<Longrightarrow> 2 ^ r \<le> size (tree_to_multiset (Node e a r ts)); tree_invar (Node e a (Suc r) ts); 2 ^ r - 1 + 2 ^ r - 1 \<le> 2 ^ Suc r - 1; Node e a (Suc r) ts \<noteq> link (Node e1 a1 r ts1) (Node e2 a2 r ts2)\<rbrakk> \<Longrightarrow> 2 ^ Suc r \<le> size (tree_to_multiset (Node e a (Suc r) ts))
[PROOF STEP]
apply (simp del: link.simps)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Node e a (Suc r) ts = link (Node e1 a1 r ts1) (Node e2 a2 r ts2) \<or> Node e a (Suc r) ts = skewlink e' a' (Node e1 a1 r ts1) (Node e2 a2 r ts2); \<And>e a ts. tree_invar (Node e a r ts) \<Longrightarrow> 2 ^ r \<le> size (tree_to_multiset (Node e a r ts)); tree_invar (Node e a (Suc r) ts); 2 ^ r - 1 + 2 ^ r - 1 \<le> 2 ^ Suc r - 1; Node e a (Suc r) ts \<noteq> link (Node e1 a1 r ts1) (Node e2 a2 r ts2)\<rbrakk> \<Longrightarrow> 2 ^ Suc r \<le> size (tree_to_multiset (Node e a (Suc r) ts))
[PROOF STEP]
using iv1 iv2
[PROOF STATE]
proof (prove)
using this:
2 ^ r \<le> size (tree_to_multiset (Node e1 a1 r ts1))
2 ^ r \<le> size (tree_to_multiset (Node e2 a2 r ts2))

goal (1 subgoal):
 1. \<lbrakk>Node e a (Suc r) ts = link (Node e1 a1 r ts1) (Node e2 a2 r ts2) \<or> Node e a (Suc r) ts = skewlink e' a' (Node e1 a1 r ts1) (Node e2 a2 r ts2); \<And>e a ts. tree_invar (Node e a r ts) \<Longrightarrow> 2 ^ r \<le> size (tree_to_multiset (Node e a r ts)); tree_invar (Node e a (Suc r) ts); 2 ^ r - 1 + 2 ^ r - 1 \<le> 2 ^ Suc r - 1; Node e a (Suc r) ts \<noteq> link (Node e1 a1 r ts1) (Node e2 a2 r ts2)\<rbrakk> \<Longrightarrow> 2 ^ Suc r \<le> size (tree_to_multiset (Node e a (Suc r) ts))
[PROOF STEP]
apply (simp del: skewlink.simps)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
2 ^ Suc r \<le> size (tree_to_multiset (Node e a (Suc r) ts))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma openin_Int_Inter:
  assumes "finite \<F>" "openin T U" "\<And>X. X \<in> \<F> \<Longrightarrow> openin T X" shows "openin T (U \<inter> \<Inter>\<F>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. openin T (U \<inter> \<Inter> \<F>)
[PROOF STEP]
using openin_Inter [of "insert U \<F>"] assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>finite (insert U \<F>); insert U \<F> \<noteq> {}; \<And>X. X \<in> insert U \<F> \<Longrightarrow> openin ?T X\<rbrakk> \<Longrightarrow> openin ?T (\<Inter> (insert U \<F>))
finite \<F>
openin T U
?X \<in> \<F> \<Longrightarrow> openin T ?X

goal (1 subgoal):
 1. openin T (U \<inter> \<Inter> \<F>)
[PROOF STEP]
by auto


[STATEMENT]
lemma (in Ring) ring_tOp_rel:"\<lbrakk>x\<in>carrier R; xa\<in>carrier R; y\<in>carrier R;
ya \<in> carrier R \<rbrakk> \<Longrightarrow> (x \<cdot>\<^sub>r xa) \<cdot>\<^sub>r (y \<cdot>\<^sub>r ya) = (x \<cdot>\<^sub>r y) \<cdot>\<^sub>r (xa \<cdot>\<^sub>r ya)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<in> carrier R; xa \<in> carrier R; y \<in> carrier R; ya \<in> carrier R\<rbrakk> \<Longrightarrow> x \<cdot>\<^sub>r xa \<cdot>\<^sub>r (y \<cdot>\<^sub>r ya) = x \<cdot>\<^sub>r y \<cdot>\<^sub>r (xa \<cdot>\<^sub>r ya)
[PROOF STEP]
apply (frule ring_tOp_closed[of "y" "ya"], assumption+,
       simp add:ring_tOp_assoc[of "x" "xa"])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<in> carrier R; xa \<in> carrier R; y \<in> carrier R; ya \<in> carrier R; y \<cdot>\<^sub>r ya \<in> carrier R\<rbrakk> \<Longrightarrow> x \<cdot>\<^sub>r (xa \<cdot>\<^sub>r (y \<cdot>\<^sub>r ya)) = x \<cdot>\<^sub>r y \<cdot>\<^sub>r (xa \<cdot>\<^sub>r ya)
[PROOF STEP]
apply (simp add:ring_tOp_assoc[THEN sym, of "xa" "y" "ya"],
       simp add:ring_tOp_commute[of "xa" "y"],
       simp add:ring_tOp_assoc[of "y" "xa" "ya"])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<in> carrier R; xa \<in> carrier R; y \<in> carrier R; ya \<in> carrier R; y \<cdot>\<^sub>r ya \<in> carrier R\<rbrakk> \<Longrightarrow> x \<cdot>\<^sub>r (y \<cdot>\<^sub>r (xa \<cdot>\<^sub>r ya)) = x \<cdot>\<^sub>r y \<cdot>\<^sub>r (xa \<cdot>\<^sub>r ya)
[PROOF STEP]
apply (frule ring_tOp_closed[of "xa" "ya"], assumption+,
       simp add:ring_tOp_assoc[THEN sym, of "x" "y"])
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma dvd_finite_3_unfold:
  "x dvd y \<longleftrightarrow> x = a\<^sub>2 \<or> x = a\<^sub>3 \<or> y = a\<^sub>1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x dvd y) = (x = a\<^sub>2 \<or> x = a\<^sub>3 \<or> y = a\<^sub>1)
[PROOF STEP]
by (cases x) (auto simp add: dvd_def times_finite_3_def split: finite_3.splits)


[STATEMENT]
lemma del_edge_undirected_degree_plus: "finite (edges g) \<Longrightarrow> (v,e,v') \<in> edges g
    \<Longrightarrow> (v',e,v) \<in> edges g  \<Longrightarrow> degree v (del_unEdge v e v' g) + 1=degree v g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite (edges g); (v, e, v') \<in> edges g; (v', e, v) \<in> edges g\<rbrakk> \<Longrightarrow> degree v (del_unEdge v e v' g) + 1 = degree v g
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>finite (edges g); (v, e, v') \<in> edges g; (v', e, v) \<in> edges g\<rbrakk> \<Longrightarrow> degree v (del_unEdge v e v' g) + 1 = degree v g
[PROOF STEP]
assume assms: "finite (edges g)" "(v,e,v') \<in> edges g" "(v',e,v) \<in> edges g "
[PROOF STATE]
proof (state)
this:
finite (edges g)
(v, e, v') \<in> edges g
(v', e, v) \<in> edges g

goal (1 subgoal):
 1. \<lbrakk>finite (edges g); (v, e, v') \<in> edges g; (v', e, v) \<in> edges g\<rbrakk> \<Longrightarrow> degree v (del_unEdge v e v' g) + 1 = degree v g
[PROOF STEP]
have "degree v (del_unEdge v e v' g) + 1
          = card ({ea \<in>  edges g - {(v, e, v'), (v', e, v)}. fst ea = v}) + 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree v (del_unEdge v e v' g) + 1 = card {ea \<in> edges g - {(v, e, v'), (v', e, v)}. fst ea = v} + 1
[PROOF STEP]
unfolding del_unEdge_def degree_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card {ea \<in> edges \<lparr>nodes = nodes g, edges = edges g - {(v, e, v'), (v', e, v)}\<rparr>. fst ea = v} + 1 = card {ea \<in> edges g - {(v, e, v'), (v', e, v)}. fst ea = v} + 1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
degree v (del_unEdge v e v' g) + 1 = card {ea \<in> edges g - {(v, e, v'), (v', e, v)}. fst ea = v} + 1

goal (1 subgoal):
 1. \<lbrakk>finite (edges g); (v, e, v') \<in> edges g; (v', e, v) \<in> edges g\<rbrakk> \<Longrightarrow> degree v (del_unEdge v e v' g) + 1 = degree v g
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
degree v (del_unEdge v e v' g) + 1 = card {ea \<in> edges g - {(v, e, v'), (v', e, v)}. fst ea = v} + 1

goal (1 subgoal):
 1. \<lbrakk>finite (edges g); (v, e, v') \<in> edges g; (v', e, v) \<in> edges g\<rbrakk> \<Longrightarrow> degree v (del_unEdge v e v' g) + 1 = degree v g
[PROOF STEP]
have "...=card ({ea \<in>  edges g. fst ea = v} - {ea \<in> {(v, e, v'), (v', e, v)}.
      fst ea = v})+1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card {ea \<in> edges g - {(v, e, v'), (v', e, v)}. fst ea = v} + 1 = card ({ea \<in> edges g. fst ea = v} - {ea \<in> {(v, e, v'), (v', e, v)}. fst ea = v}) + 1
[PROOF STEP]
by (metis set_compre_diff)
[PROOF STATE]
proof (state)
this:
card {ea \<in> edges g - {(v, e, v'), (v', e, v)}. fst ea = v} + 1 = card ({ea \<in> edges g. fst ea = v} - {ea \<in> {(v, e, v'), (v', e, v)}. fst ea = v}) + 1

goal (1 subgoal):
 1. \<lbrakk>finite (edges g); (v, e, v') \<in> edges g; (v', e, v) \<in> edges g\<rbrakk> \<Longrightarrow> degree v (del_unEdge v e v' g) + 1 = degree v g
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
card {ea \<in> edges g - {(v, e, v'), (v', e, v)}. fst ea = v} + 1 = card ({ea \<in> edges g. fst ea = v} - {ea \<in> {(v, e, v'), (v', e, v)}. fst ea = v}) + 1

goal (1 subgoal):
 1. \<lbrakk>finite (edges g); (v, e, v') \<in> edges g; (v', e, v) \<in> edges g\<rbrakk> \<Longrightarrow> degree v (del_unEdge v e v' g) + 1 = degree v g
[PROOF STEP]
have "...=card ({ea \<in>  edges g. fst ea = v}) - card({ea \<in> {(v, e, v'), (v', e, v)}.
      fst ea = v})+1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card ({ea \<in> edges g. fst ea = v} - {ea \<in> {(v, e, v'), (v', e, v)}. fst ea = v}) + 1 = card {ea \<in> edges g. fst ea = v} - card {ea \<in> {(v, e, v'), (v', e, v)}. fst ea = v} + 1
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. card ({ea \<in> edges g. fst ea = v} - {ea \<in> {(v, e, v'), (v', e, v)}. fst ea = v}) + 1 = card {ea \<in> edges g. fst ea = v} - card {ea \<in> {(v, e, v'), (v', e, v)}. fst ea = v} + 1
[PROOF STEP]
have "{(v, e, v'), (v', e, v)} \<subseteq> edges g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {(v, e, v'), (v', e, v)} \<subseteq> edges g
[PROOF STEP]
using \<open>(v,e,v') \<in> edges g\<close> \<open>(v',e,v) \<in> edges g\<close>
[PROOF STATE]
proof (prove)
using this:
(v, e, v') \<in> edges g
(v', e, v) \<in> edges g

goal (1 subgoal):
 1. {(v, e, v'), (v', e, v)} \<subseteq> edges g
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{(v, e, v'), (v', e, v)} \<subseteq> edges g

goal (1 subgoal):
 1. card ({ea \<in> edges g. fst ea = v} - {ea \<in> {(v, e, v'), (v', e, v)}. fst ea = v}) + 1 = card {ea \<in> edges g. fst ea = v} - card {ea \<in> {(v, e, v'), (v', e, v)}. fst ea = v} + 1
[PROOF STEP]
hence "{ea \<in> {(v, e, v'), (v', e, v)}. fst ea = v} \<subseteq> {ea \<in>  edges g. fst ea = v}"
[PROOF STATE]
proof (prove)
using this:
{(v, e, v'), (v', e, v)} \<subseteq> edges g

goal (1 subgoal):
 1. {ea \<in> {(v, e, v'), (v', e, v)}. fst ea = v} \<subseteq> {ea \<in> edges g. fst ea = v}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{ea \<in> {(v, e, v'), (v', e, v)}. fst ea = v} \<subseteq> {ea \<in> edges g. fst ea = v}

goal (1 subgoal):
 1. card ({ea \<in> edges g. fst ea = v} - {ea \<in> {(v, e, v'), (v', e, v)}. fst ea = v}) + 1 = card {ea \<in> edges g. fst ea = v} - card {ea \<in> {(v, e, v'), (v', e, v)}. fst ea = v} + 1
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
{ea \<in> {(v, e, v'), (v', e, v)}. fst ea = v} \<subseteq> {ea \<in> edges g. fst ea = v}

goal (1 subgoal):
 1. card ({ea \<in> edges g. fst ea = v} - {ea \<in> {(v, e, v'), (v', e, v)}. fst ea = v}) + 1 = card {ea \<in> edges g. fst ea = v} - card {ea \<in> {(v, e, v'), (v', e, v)}. fst ea = v} + 1
[PROOF STEP]
have "finite {ea \<in> {(v, e, v'), (v', e, v)}. fst ea = v}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {ea \<in> {(v, e, v'), (v', e, v)}. fst ea = v}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
finite {ea \<in> {(v, e, v'), (v', e, v)}. fst ea = v}

goal (1 subgoal):
 1. card ({ea \<in> edges g. fst ea = v} - {ea \<in> {(v, e, v'), (v', e, v)}. fst ea = v}) + 1 = card {ea \<in> edges g. fst ea = v} - card {ea \<in> {(v, e, v'), (v', e, v)}. fst ea = v} + 1
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
{ea \<in> {(v, e, v'), (v', e, v)}. fst ea = v} \<subseteq> {ea \<in> edges g. fst ea = v}
finite {ea \<in> {(v, e, v'), (v', e, v)}. fst ea = v}
[PROOF STEP]
have "card ({ea \<in> edges g. fst ea = v} - {ea \<in> {(v, e, v'), (v', e, v)}.
          fst ea = v})=card {ea \<in> edges g. fst ea = v} - card {ea \<in> {(v, e, v'), (v', e, v)}.
          fst ea = v}"
[PROOF STATE]
proof (prove)
using this:
{ea \<in> {(v, e, v'), (v', e, v)}. fst ea = v} \<subseteq> {ea \<in> edges g. fst ea = v}
finite {ea \<in> {(v, e, v'), (v', e, v)}. fst ea = v}

goal (1 subgoal):
 1. card ({ea \<in> edges g. fst ea = v} - {ea \<in> {(v, e, v'), (v', e, v)}. fst ea = v}) = card {ea \<in> edges g. fst ea = v} - card {ea \<in> {(v, e, v'), (v', e, v)}. fst ea = v}
[PROOF STEP]
using card_Diff_subset
[PROOF STATE]
proof (prove)
using this:
{ea \<in> {(v, e, v'), (v', e, v)}. fst ea = v} \<subseteq> {ea \<in> edges g. fst ea = v}
finite {ea \<in> {(v, e, v'), (v', e, v)}. fst ea = v}
\<lbrakk>finite ?B; ?B \<subseteq> ?A\<rbrakk> \<Longrightarrow> card (?A - ?B) = card ?A - card ?B

goal (1 subgoal):
 1. card ({ea \<in> edges g. fst ea = v} - {ea \<in> {(v, e, v'), (v', e, v)}. fst ea = v}) = card {ea \<in> edges g. fst ea = v} - card {ea \<in> {(v, e, v'), (v', e, v)}. fst ea = v}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
card ({ea \<in> edges g. fst ea = v} - {ea \<in> {(v, e, v'), (v', e, v)}. fst ea = v}) = card {ea \<in> edges g. fst ea = v} - card {ea \<in> {(v, e, v'), (v', e, v)}. fst ea = v}

goal (1 subgoal):
 1. card ({ea \<in> edges g. fst ea = v} - {ea \<in> {(v, e, v'), (v', e, v)}. fst ea = v}) + 1 = card {ea \<in> edges g. fst ea = v} - card {ea \<in> {(v, e, v'), (v', e, v)}. fst ea = v} + 1
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
card ({ea \<in> edges g. fst ea = v} - {ea \<in> {(v, e, v'), (v', e, v)}. fst ea = v}) = card {ea \<in> edges g. fst ea = v} - card {ea \<in> {(v, e, v'), (v', e, v)}. fst ea = v}

goal (1 subgoal):
 1. card ({ea \<in> edges g. fst ea = v} - {ea \<in> {(v, e, v'), (v', e, v)}. fst ea = v}) + 1 = card {ea \<in> edges g. fst ea = v} - card {ea \<in> {(v, e, v'), (v', e, v)}. fst ea = v} + 1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
card ({ea \<in> edges g. fst ea = v} - {ea \<in> {(v, e, v'), (v', e, v)}. fst ea = v}) + 1 = card {ea \<in> edges g. fst ea = v} - card {ea \<in> {(v, e, v'), (v', e, v)}. fst ea = v} + 1

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
card ({ea \<in> edges g. fst ea = v} - {ea \<in> {(v, e, v'), (v', e, v)}. fst ea = v}) + 1 = card {ea \<in> edges g. fst ea = v} - card {ea \<in> {(v, e, v'), (v', e, v)}. fst ea = v} + 1

goal (1 subgoal):
 1. \<lbrakk>finite (edges g); (v, e, v') \<in> edges g; (v', e, v) \<in> edges g\<rbrakk> \<Longrightarrow> degree v (del_unEdge v e v' g) + 1 = degree v g
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
card ({ea \<in> edges g. fst ea = v} - {ea \<in> {(v, e, v'), (v', e, v)}. fst ea = v}) + 1 = card {ea \<in> edges g. fst ea = v} - card {ea \<in> {(v, e, v'), (v', e, v)}. fst ea = v} + 1

goal (1 subgoal):
 1. \<lbrakk>finite (edges g); (v, e, v') \<in> edges g; (v', e, v) \<in> edges g\<rbrakk> \<Longrightarrow> degree v (del_unEdge v e v' g) + 1 = degree v g
[PROOF STEP]
have "...=card ({ea \<in>  edges g. fst ea = v})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card {ea \<in> edges g. fst ea = v} - card {ea \<in> {(v, e, v'), (v', e, v)}. fst ea = v} + 1 = card {ea \<in> edges g. fst ea = v}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. card {ea \<in> edges g. fst ea = v} - card {ea \<in> {(v, e, v'), (v', e, v)}. fst ea = v} + 1 = card {ea \<in> edges g. fst ea = v}
[PROOF STEP]
have "{ea \<in> {(v, e, v'), (v', e, v)}. fst ea = v}={(v,e,v')}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {ea \<in> {(v, e, v'), (v', e, v)}. fst ea = v} = {(v, e, v')}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{ea \<in> {(v, e, v'), (v', e, v)}. fst ea = v} = {(v, e, v')}

goal (1 subgoal):
 1. card {ea \<in> edges g. fst ea = v} - card {ea \<in> {(v, e, v'), (v', e, v)}. fst ea = v} + 1 = card {ea \<in> edges g. fst ea = v}
[PROOF STEP]
hence "card {ea \<in> {(v, e, v'), (v', e, v)}. fst ea = v} = 1"
[PROOF STATE]
proof (prove)
using this:
{ea \<in> {(v, e, v'), (v', e, v)}. fst ea = v} = {(v, e, v')}

goal (1 subgoal):
 1. card {ea \<in> {(v, e, v'), (v', e, v)}. fst ea = v} = 1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
card {ea \<in> {(v, e, v'), (v', e, v)}. fst ea = v} = 1

goal (1 subgoal):
 1. card {ea \<in> edges g. fst ea = v} - card {ea \<in> {(v, e, v'), (v', e, v)}. fst ea = v} + 1 = card {ea \<in> edges g. fst ea = v}
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
card {ea \<in> {(v, e, v'), (v', e, v)}. fst ea = v} = 1

goal (1 subgoal):
 1. card {ea \<in> edges g. fst ea = v} - card {ea \<in> {(v, e, v'), (v', e, v)}. fst ea = v} + 1 = card {ea \<in> edges g. fst ea = v}
[PROOF STEP]
have "card {ea \<in> edges g. fst ea = v}\<noteq>0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card {ea \<in> edges g. fst ea = v} \<noteq> 0
[PROOF STEP]
by (metis (lifting, mono_tags) Collect_empty_eq assms(1) assms(2)
          card_eq_0_iff fst_conv mem_Collect_eq rev_finite_subset subsetI)
[PROOF STATE]
proof (state)
this:
card {ea \<in> edges g. fst ea = v} \<noteq> 0

goal (1 subgoal):
 1. card {ea \<in> edges g. fst ea = v} - card {ea \<in> {(v, e, v'), (v', e, v)}. fst ea = v} + 1 = card {ea \<in> edges g. fst ea = v}
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
card {ea \<in> {(v, e, v'), (v', e, v)}. fst ea = v} = 1
card {ea \<in> edges g. fst ea = v} \<noteq> 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
card {ea \<in> {(v, e, v'), (v', e, v)}. fst ea = v} = 1
card {ea \<in> edges g. fst ea = v} \<noteq> 0

goal (1 subgoal):
 1. card {ea \<in> edges g. fst ea = v} - card {ea \<in> {(v, e, v'), (v', e, v)}. fst ea = v} + 1 = card {ea \<in> edges g. fst ea = v}
[PROOF STEP]
by arith
[PROOF STATE]
proof (state)
this:
card {ea \<in> edges g. fst ea = v} - card {ea \<in> {(v, e, v'), (v', e, v)}. fst ea = v} + 1 = card {ea \<in> edges g. fst ea = v}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
card {ea \<in> edges g. fst ea = v} - card {ea \<in> {(v, e, v'), (v', e, v)}. fst ea = v} + 1 = card {ea \<in> edges g. fst ea = v}

goal (1 subgoal):
 1. \<lbrakk>finite (edges g); (v, e, v') \<in> edges g; (v', e, v) \<in> edges g\<rbrakk> \<Longrightarrow> degree v (del_unEdge v e v' g) + 1 = degree v g
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
degree v (del_unEdge v e v' g) + 1 = card {ea \<in> edges g. fst ea = v}
[PROOF STEP]
have "degree v (del_unEdge v e v' g) + 1=card ({ea \<in>  edges g. fst ea = v})"
[PROOF STATE]
proof (prove)
using this:
degree v (del_unEdge v e v' g) + 1 = card {ea \<in> edges g. fst ea = v}

goal (1 subgoal):
 1. degree v (del_unEdge v e v' g) + 1 = card {ea \<in> edges g. fst ea = v}
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
degree v (del_unEdge v e v' g) + 1 = card {ea \<in> edges g. fst ea = v}

goal (1 subgoal):
 1. \<lbrakk>finite (edges g); (v, e, v') \<in> edges g; (v', e, v) \<in> edges g\<rbrakk> \<Longrightarrow> degree v (del_unEdge v e v' g) + 1 = degree v g
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
degree v (del_unEdge v e v' g) + 1 = card {ea \<in> edges g. fst ea = v}

goal (1 subgoal):
 1. degree v (del_unEdge v e v' g) + 1 = degree v g
[PROOF STEP]
unfolding degree_def
[PROOF STATE]
proof (prove)
using this:
card {ea \<in> edges (del_unEdge v e v' g). fst ea = v} + 1 = card {ea \<in> edges g. fst ea = v}

goal (1 subgoal):
 1. card {ea \<in> edges (del_unEdge v e v' g). fst ea = v} + 1 = card {e \<in> edges g. fst e = v}
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
degree v (del_unEdge v e v' g) + 1 = degree v g

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma card_injective_functions_range_permutation:
  assumes "finite A" "finite B"
  shows "card ({f \<in> A \<rightarrow>\<^sub>E B. inj_on f A} // range_permutation A B) = iverson (card A \<le> card B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card ({f \<in> A \<rightarrow>\<^sub>E B. inj_on f A} // range_permutation A B) = iverson (card A \<le> card B)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. card ({f \<in> A \<rightarrow>\<^sub>E B. inj_on f A} // range_permutation A B) = iverson (card A \<le> card B)
[PROOF STEP]
obtain enum where "bij_betw enum {0..<card A} A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>enum. bij_betw enum {0..<card A} A \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using \<open>finite A\<close> ex_bij_betw_nat_finite
[PROOF STATE]
proof (prove)
using this:
finite A
finite ?M \<Longrightarrow> \<exists>h. bij_betw h {0..<card ?M} ?M

goal (1 subgoal):
 1. (\<And>enum. bij_betw enum {0..<card A} A \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
bij_betw enum {0..<card A} A

goal (1 subgoal):
 1. card ({f \<in> A \<rightarrow>\<^sub>E B. inj_on f A} // range_permutation A B) = iverson (card A \<le> card B)
[PROOF STEP]
have "bij_betw (partitions_of A B) ({f \<in> A \<rightarrow>\<^sub>E B. inj_on f A} // range_permutation A B) {P. partition_on A P \<and> card P \<le> card B \<and> (\<forall>X\<in>P. card X = 1)}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bij_betw (partitions_of A B) ({f \<in> A \<rightarrow>\<^sub>E B. inj_on f A} // range_permutation A B) {P. partition_on A P \<and> card P \<le> card B \<and> (\<forall>X\<in>P. card X = 1)}
[PROOF STEP]
using \<open>finite A\<close> \<open>finite B\<close>
[PROOF STATE]
proof (prove)
using this:
finite A
finite B

goal (1 subgoal):
 1. bij_betw (partitions_of A B) ({f \<in> A \<rightarrow>\<^sub>E B. inj_on f A} // range_permutation A B) {P. partition_on A P \<and> card P \<le> card B \<and> (\<forall>X\<in>P. card X = 1)}
[PROOF STEP]
by (rule bij_betw_partitions_of)
[PROOF STATE]
proof (state)
this:
bij_betw (partitions_of A B) ({f \<in> A \<rightarrow>\<^sub>E B. inj_on f A} // range_permutation A B) {P. partition_on A P \<and> card P \<le> card B \<and> (\<forall>X\<in>P. card X = 1)}

goal (1 subgoal):
 1. card ({f \<in> A \<rightarrow>\<^sub>E B. inj_on f A} // range_permutation A B) = iverson (card A \<le> card B)
[PROOF STEP]
from this
[PROOF STATE]
proof (chain)
picking this:
bij_betw (partitions_of A B) ({f \<in> A \<rightarrow>\<^sub>E B. inj_on f A} // range_permutation A B) {P. partition_on A P \<and> card P \<le> card B \<and> (\<forall>X\<in>P. card X = 1)}
[PROOF STEP]
have "card ({f \<in> A \<rightarrow>\<^sub>E B. inj_on f A} // range_permutation A B) = card {P. partition_on A P \<and> card P \<le> card B \<and> (\<forall>X\<in>P. card X = 1)}"
[PROOF STATE]
proof (prove)
using this:
bij_betw (partitions_of A B) ({f \<in> A \<rightarrow>\<^sub>E B. inj_on f A} // range_permutation A B) {P. partition_on A P \<and> card P \<le> card B \<and> (\<forall>X\<in>P. card X = 1)}

goal (1 subgoal):
 1. card ({f \<in> A \<rightarrow>\<^sub>E B. inj_on f A} // range_permutation A B) = card {P. partition_on A P \<and> card P \<le> card B \<and> (\<forall>X\<in>P. card X = 1)}
[PROOF STEP]
by (rule bij_betw_same_card)
[PROOF STATE]
proof (state)
this:
card ({f \<in> A \<rightarrow>\<^sub>E B. inj_on f A} // range_permutation A B) = card {P. partition_on A P \<and> card P \<le> card B \<and> (\<forall>X\<in>P. card X = 1)}

goal (1 subgoal):
 1. card ({f \<in> A \<rightarrow>\<^sub>E B. inj_on f A} // range_permutation A B) = iverson (card A \<le> card B)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
card ({f \<in> A \<rightarrow>\<^sub>E B. inj_on f A} // range_permutation A B) = card {P. partition_on A P \<and> card P \<le> card B \<and> (\<forall>X\<in>P. card X = 1)}

goal (1 subgoal):
 1. card ({f \<in> A \<rightarrow>\<^sub>E B. inj_on f A} // range_permutation A B) = iverson (card A \<le> card B)
[PROOF STEP]
have "card {P. partition_on A P \<and> card P \<le> card B \<and> (\<forall>X\<in>P. card X = 1)} = iverson (card A \<le> card B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card {P. partition_on A P \<and> card P \<le> card B \<and> (\<forall>X\<in>P. card X = 1)} = iverson (card A \<le> card B)
[PROOF STEP]
using \<open>finite A\<close>
[PROOF STATE]
proof (prove)
using this:
finite A

goal (1 subgoal):
 1. card {P. partition_on A P \<and> card P \<le> card B \<and> (\<forall>X\<in>P. card X = 1)} = iverson (card A \<le> card B)
[PROOF STEP]
by (rule card_partition_on_size1_eq_iverson)
[PROOF STATE]
proof (state)
this:
card {P. partition_on A P \<and> card P \<le> card B \<and> (\<forall>X\<in>P. card X = 1)} = iverson (card A \<le> card B)

goal (1 subgoal):
 1. card ({f \<in> A \<rightarrow>\<^sub>E B. inj_on f A} // range_permutation A B) = iverson (card A \<le> card B)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
card ({f \<in> A \<rightarrow>\<^sub>E B. inj_on f A} // range_permutation A B) = iverson (card A \<le> card B)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
card ({f \<in> A \<rightarrow>\<^sub>E B. inj_on f A} // range_permutation A B) = iverson (card A \<le> card B)

goal (1 subgoal):
 1. card ({f \<in> A \<rightarrow>\<^sub>E B. inj_on f A} // range_permutation A B) = iverson (card A \<le> card B)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
card ({f \<in> A \<rightarrow>\<^sub>E B. inj_on f A} // range_permutation A B) = iverson (card A \<le> card B)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ceiling_less_iff: "\<lceil>x\<rceil> < z \<longleftrightarrow> x \<le> of_int z - 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lceil>x\<rceil> < z) = (x \<le> of_int z - (1::'a))
[PROOF STEP]
using ceiling_le_iff [of x "z - 1"]
[PROOF STATE]
proof (prove)
using this:
(\<lceil>x\<rceil> \<le> z - 1) = (x \<le> of_int (z - 1))

goal (1 subgoal):
 1. (\<lceil>x\<rceil> < z) = (x \<le> of_int z - (1::'a))
[PROOF STEP]
by simp


[STATEMENT]
lemma size_of_lhs_R:
  fixes p:: "real poly"
  fixes qs :: "real poly list"
  fixes signs :: "rat list list"
  shows "dim_vec (construct_lhs_vector_R p qs signs) = length signs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_vec (w_vec_R p qs signs) = length signs
[PROOF STEP]
unfolding construct_lhs_vector_R_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_vec (vec_of_list (map (\<lambda>w. rat_of_int (int (length (filter (\<lambda>v. v = w) (map (consistent_sign_vec qs) (characterize_root_list_p p)))))) signs)) = length signs
[PROOF STEP]
by simp


[STATEMENT]
lemma integrable_mult_right_iff [simp]:
  fixes f :: "'a \<Rightarrow> real"
  shows "integrable M (\<lambda>x. f x * c) \<longleftrightarrow> c = 0 \<or> integrable M f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integrable M (\<lambda>x. f x * c) = (c = 0 \<or> integrable M f)
[PROOF STEP]
using integrable_mult_left_iff [of M c f]
[PROOF STATE]
proof (prove)
using this:
integrable M (\<lambda>x. c * f x) = (c = 0 \<or> integrable M f)

goal (1 subgoal):
 1. integrable M (\<lambda>x. f x * c) = (c = 0 \<or> integrable M f)
[PROOF STEP]
by (simp add: mult.commute)


[STATEMENT]
lemma diamond_d_import_iff_2:
  "d(x) * d(y) \<le> |z>w \<longleftrightarrow> d(x) * d(y) \<le> |d(y) * z>w"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (d x * d y \<le> | z > w) = (d x * d y \<le> | d y * z > w)
[PROOF STEP]
apply (rule iffI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. d x * d y \<le> | z > w \<Longrightarrow> d x * d y \<le> | d y * z > w
 2. d x * d y \<le> | d y * z > w \<Longrightarrow> d x * d y \<le> | z > w
[PROOF STEP]
apply (metis diamond_associative d_export d_mult_greatest_lower_bound diamond_def order.refl)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d x * d y \<le> | d y * z > w \<Longrightarrow> d x * d y \<le> | z > w
[PROOF STEP]
by (metis diamond_d_y d_mult_greatest_lower_bound diamond_def mult_assoc)


[STATEMENT]
lemma countable_subset: "A \<subseteq> B \<Longrightarrow> countable B \<Longrightarrow> countable A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>A \<subseteq> B; countable B\<rbrakk> \<Longrightarrow> countable A
[PROOF STEP]
by (auto simp: countable_def intro: subset_inj_on)


[STATEMENT]
lemma divisor_sigma_1_left_nat: "divisor_sigma (Suc 0) n = divisor_sum n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. divisor_sigma (Suc 0) n = divisor_sum n
[PROOF STEP]
by (simp add: divisor_sum_def divisor_sigma_def)


[STATEMENT]
theorem p30: "\<forall>x. F(x) \<or> G(x) \<longrightarrow> \<not>H(x) \<Longrightarrow>
  \<forall>x. (G(x) \<longrightarrow> \<not>I(x)) \<longrightarrow> F(x) \<and> H(x) \<Longrightarrow> \<forall>x. I(x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>x. F x \<or> G x \<longrightarrow> \<not> H x; \<forall>x. (G x \<longrightarrow> \<not> I x) \<longrightarrow> F x \<and> H x\<rbrakk> \<Longrightarrow> \<forall>x. I x
[PROOF STEP]
@proof
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>x. F x \<or> G x \<longrightarrow> \<not> H x; \<forall>x. (G x \<longrightarrow> \<not> I x) \<longrightarrow> F x \<and> H x\<rbrakk> \<Longrightarrow> \<forall>x. I x
[PROOF STEP]
@have "\<forall>x. I(x)" @with
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>x. F x \<or> G x \<longrightarrow> \<not> H x; \<forall>x. (G x \<longrightarrow> \<not> I x) \<longrightarrow> F x \<and> H x\<rbrakk> \<Longrightarrow> \<forall>x. I x
[PROOF STEP]
@case "F(x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>x. F x \<or> G x \<longrightarrow> \<not> H x; \<forall>x. (G x \<longrightarrow> \<not> I x) \<longrightarrow> F x \<and> H x\<rbrakk> \<Longrightarrow> \<forall>x. I x
[PROOF STEP]
@end
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>x. F x \<or> G x \<longrightarrow> \<not> H x; \<forall>x. (G x \<longrightarrow> \<not> I x) \<longrightarrow> F x \<and> H x\<rbrakk> \<Longrightarrow> \<forall>x. I x
[PROOF STEP]
@qed


[STATEMENT]
lemma orthogonal_complement_UNIV[simp]:
  "orthogonal_complement UNIV = {0}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. orthogonal_complement UNIV = {0::'a}
[PROOF STEP]
by (metis Int_UNIV_left complex_vector.subspace_UNIV complex_vector.subspace_def orthogonal_complement_zero_intersection)


[STATEMENT]
lemma butlast_drop: "butlast (drop n xs) = drop n (butlast xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. butlast (drop n xs) = drop n (butlast xs)
[PROOF STEP]
by (simp add: butlast_conv_take drop_take ac_simps)


[STATEMENT]
lemma unat_is_aligned_add:
  "\<lbrakk> is_aligned p n; unat d < 2 ^ n \<rbrakk>
   \<Longrightarrow> unat (p + d AND mask n) = unat d \<and> unat (p + d AND NOT(mask n)) = unat p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>is_aligned p n; unat d < 2 ^ n\<rbrakk> \<Longrightarrow> unat (p + d AND mask n) = unat d \<and> unat (p + d AND NOT (mask n)) = unat p
[PROOF STEP]
by (metis add.right_neutral and_mask_eq_iff_le_mask and_not_mask le_mask_iff mask_add_aligned
            mask_out_add_aligned mult_zero_right shiftl_t2n shiftr_le_0)


[STATEMENT]
lemma parts_UN_subset1: "(\<Union>x\<in>A. parts(H x)) \<subseteq> parts(\<Union>x\<in>A. H x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Union>x\<in>A. parts (H x)) \<subseteq> parts (\<Union> (H ` A))
[PROOF STEP]
by (intro UN_least parts_mono UN_upper)


[STATEMENT]
lemma bisum_outside :
  "(bisum (\<lambda> x y. f1 x - f2 x y + f3 y) lst :: 'a :: field)
  = sum_list (map f1 lst) + f1 0 - bisum f2 lst + sum_list (map f3 lst) + f3 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bisum (\<lambda>x y. f1 x - f2 x y + f3 y) lst = sum_list (map f1 lst) + f1 (0::'b) - bisum f2 lst + sum_list (map f3 lst) + f3 (0::'b)
[PROOF STEP]
proof(cases lst)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. lst = [] \<Longrightarrow> bisum (\<lambda>x y. f1 x - f2 x y + f3 y) lst = sum_list (map f1 lst) + f1 (0::'b) - bisum f2 lst + sum_list (map f3 lst) + f3 (0::'b)
 2. \<And>a list. lst = a # list \<Longrightarrow> bisum (\<lambda>x y. f1 x - f2 x y + f3 y) lst = sum_list (map f1 lst) + f1 (0::'b) - bisum f2 lst + sum_list (map f3 lst) + f3 (0::'b)
[PROOF STEP]
case (Cons a lst)
[PROOF STATE]
proof (state)
this:
lst = a # lst

goal (2 subgoals):
 1. lst = [] \<Longrightarrow> bisum (\<lambda>x y. f1 x - f2 x y + f3 y) lst = sum_list (map f1 lst) + f1 (0::'b) - bisum f2 lst + sum_list (map f3 lst) + f3 (0::'b)
 2. \<And>a list. lst = a # list \<Longrightarrow> bisum (\<lambda>x y. f1 x - f2 x y + f3 y) lst = sum_list (map f1 lst) + f1 (0::'b) - bisum f2 lst + sum_list (map f3 lst) + f3 (0::'b)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bisum (\<lambda>x y. f1 x - f2 x y + f3 y) lst = sum_list (map f1 lst) + f1 (0::'b) - bisum f2 lst + sum_list (map f3 lst) + f3 (0::'b)
[PROOF STEP]
unfolding map_zip_is_bisum Cons
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum_list (map2 (\<lambda>x y. f1 x - f2 x y + f3 y) ((0::'b) # a # lst) ((a # lst) @ [0::'b])) = sum_list (map f1 (a # lst)) + f1 (0::'b) - sum_list (map2 f2 ((0::'b) # a # lst) ((a # lst) @ [0::'b])) + sum_list (map f3 (a # lst)) + f3 (0::'b)
[PROOF STEP]
by(induct lst arbitrary:a,auto)
[PROOF STATE]
proof (state)
this:
bisum (\<lambda>x y. f1 x - f2 x y + f3 y) lst = sum_list (map f1 lst) + f1 (0::'b) - bisum f2 lst + sum_list (map f3 lst) + f3 (0::'b)

goal (1 subgoal):
 1. lst = [] \<Longrightarrow> bisum (\<lambda>x y. f1 x - f2 x y + f3 y) lst = sum_list (map f1 lst) + f1 (0::'b) - bisum f2 lst + sum_list (map f3 lst) + f3 (0::'b)
[PROOF STEP]
qed auto


[STATEMENT]
lemma lex_ext_iff: "(lex_ext f m xs ys) = (
  (length xs = length ys \<or> length ys \<le> m) \<and> ((\<exists> i < length xs. i < length ys \<and> (\<forall> j < i. snd (f (xs ! j) (ys ! j))) \<and> fst (f (xs ! i) (ys !i))) \<or>
  (\<forall> i < length ys. snd (f (xs ! i) (ys ! i))) \<and> length xs > length ys),
  (length xs = length ys \<or> length ys \<le> m) \<and>
  ((\<exists> i < length xs. i < length ys \<and> (\<forall> j < i. snd (f (xs ! j) (ys ! j))) \<and> fst (f (xs ! i) (ys !i))) \<or>
  (\<forall> i < length ys. snd (f (xs ! i) (ys ! i))) \<and> length xs \<ge> length ys))
  "
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lex_ext f m xs ys = ((length xs = length ys \<or> length ys \<le> m) \<and> ((\<exists>i<length xs. i < length ys \<and> (\<forall>j<i. snd (f (xs ! j) (ys ! j))) \<and> fst (f (xs ! i) (ys ! i))) \<or> (\<forall>i<length ys. snd (f (xs ! i) (ys ! i))) \<and> length ys < length xs), (length xs = length ys \<or> length ys \<le> m) \<and> ((\<exists>i<length xs. i < length ys \<and> (\<forall>j<i. snd (f (xs ! j) (ys ! j))) \<and> fst (f (xs ! i) (ys ! i))) \<or> (\<forall>i<length ys. snd (f (xs ! i) (ys ! i))) \<and> length ys \<le> length xs))
[PROOF STEP]
unfolding lex_ext_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (let lts = length ys in if length xs = lts \<or> lts \<le> m then lex_ext_unbounded f xs ys else (False, False)) = ((length xs = length ys \<or> length ys \<le> m) \<and> ((\<exists>i<length xs. i < length ys \<and> (\<forall>j<i. snd (f (xs ! j) (ys ! j))) \<and> fst (f (xs ! i) (ys ! i))) \<or> (\<forall>i<length ys. snd (f (xs ! i) (ys ! i))) \<and> length ys < length xs), (length xs = length ys \<or> length ys \<le> m) \<and> ((\<exists>i<length xs. i < length ys \<and> (\<forall>j<i. snd (f (xs ! j) (ys ! j))) \<and> fst (f (xs ! i) (ys ! i))) \<or> (\<forall>i<length ys. snd (f (xs ! i) (ys ! i))) \<and> length ys \<le> length xs))
[PROOF STEP]
by (simp only: lex_ext_unbounded_iff Let_def, auto)


[STATEMENT]
lemma delete_edge_correct: "FiniteGraph.delete_edge v v' (list_graph_to_graph G) = list_graph_to_graph (delete_edge v v' G)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. FiniteGraph.delete_edge v v' (list_graph_to_graph G) = list_graph_to_graph (FiniteListGraph.delete_edge v v' G)
[PROOF STEP]
unfolding FiniteGraph.delete_edge_def delete_edge_def list_graph_to_graph_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lparr>nodes = nodes \<lparr>nodes = set (nodesL G), edges = set (edgesL G)\<rparr>, edges = {(e1, e2). (e1, e2) \<in> edges \<lparr>nodes = set (nodesL G), edges = set (edgesL G)\<rparr> \<and> (e1, e2) \<noteq> (v, v')}\<rparr> = \<lparr>nodes = set (nodesL \<lparr>nodesL = nodesL G, edgesL = filter (\<lambda>(e1, e2). e1 \<noteq> v \<or> e2 \<noteq> v') (edgesL G)\<rparr>), edges = set (edgesL \<lparr>nodesL = nodesL G, edgesL = filter (\<lambda>(e1, e2). e1 \<noteq> v \<or> e2 \<noteq> v') (edgesL G)\<rparr>)\<rparr>
[PROOF STEP]
by auto


[STATEMENT]
theorem RPO_S_ctxt: "(s,t) \<in> RPO_S \<Longrightarrow> (Fun f (bef @ s # aft), Fun f (bef @ t # aft)) \<in> RPO_S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (s, t) \<in> RPO_S \<Longrightarrow> (Fun f (bef @ s # aft), Fun f (bef @ t # aft)) \<in> RPO_S
[PROOF STEP]
using WPO_S_ctxt
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<And>f k. set (\<sigma> (f, k)) = {0..<k}; (?s, ?t) \<in> WPO_S\<rbrakk> \<Longrightarrow> (Fun ?f (?bef @ ?s # ?aft), Fun ?f (?bef @ ?t # ?aft)) \<in> WPO_S

goal (1 subgoal):
 1. (s, t) \<in> RPO_S \<Longrightarrow> (Fun f (bef @ s # aft), Fun f (bef @ t # aft)) \<in> RPO_S
[PROOF STEP]
unfolding rpo_eq_wpo
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<And>f k. set (\<sigma> (f, k)) = {0..<k}; (?s, ?t) \<in> WPO_S\<rbrakk> \<Longrightarrow> (Fun ?f (?bef @ ?s # ?aft), Fun ?f (?bef @ ?t # ?aft)) \<in> WPO_S

goal (1 subgoal):
 1. (s, t) \<in> WPO_S \<Longrightarrow> (Fun f (bef @ s # aft), Fun f (bef @ t # aft)) \<in> WPO_S
[PROOF STEP]
by auto


[STATEMENT]
lemma "!!a::real. a \<le> b ==> b + b \<le> c ==> a + a \<le> c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a. \<lbrakk>a \<le> b; b + b \<le> c\<rbrakk> \<Longrightarrow> a + a \<le> c
[PROOF STEP]
by linarith


[STATEMENT]
lemma finite_set_union: "\<lbrakk>finite ys; \<forall>y \<in> ys. finite y\<rbrakk> \<Longrightarrow> finite (\<Union>y \<in> ys. y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite ys; \<forall>y\<in>ys. finite y\<rbrakk> \<Longrightarrow> finite (\<Union>y\<in>ys. y)
[PROOF STEP]
by simp


[STATEMENT]
lemma register_Fst_register_Snd[simp]:
  assumes \<open>register F\<close>
  shows \<open>(F o Fst; F o Snd) = F\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (F \<circ> Fst;F \<circ> Snd) = F
[PROOF STEP]
apply (rule tensor_extensionality)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. clinear (F \<circ> Fst;F \<circ> Snd)
 2. clinear F
 3. \<And>a b. (F \<circ> Fst;F \<circ> Snd) (a \<otimes>\<^sub>u b) = F (a \<otimes>\<^sub>u b)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
register F

goal (3 subgoals):
 1. clinear (F \<circ> Fst;F \<circ> Snd)
 2. clinear F
 3. \<And>a b. (F \<circ> Fst;F \<circ> Snd) (a \<otimes>\<^sub>u b) = F (a \<otimes>\<^sub>u b)
[PROOF STEP]
by (auto simp: register_pair_apply Fst_def Snd_def register_mult comp_tensor_op)


[STATEMENT]
lemma matrix_inv_unique:
  fixes A::"'a::{semiring_1}^'n^'n"
  assumes AB: "A ** B = mat 1" and BA: "B ** A = mat 1"
  shows "matrix_inv A = B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. matrix_inv A = B
[PROOF STEP]
by (metis AB BA invertible_def matrix_inv_right matrix_mul_assoc matrix_mul_lid)


[STATEMENT]
lemma poly_of_pm_one [simp]: "poly_of_pm x 1 = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly_of_pm x 1 = 1
[PROOF STEP]
by (simp add: poly_of_pm_monomial zero_in_PPs flip: single_one monom_eq_1)


[STATEMENT]
lemma DERIV_mult':
  "(f has_field_derivative D) (at x within s) \<Longrightarrow> (g has_field_derivative E) (at x within s) \<Longrightarrow>
    ((\<lambda>x. f x * g x) has_field_derivative f x * E + D * g x) (at x within s)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(f has_field_derivative D) (at x within s); (g has_field_derivative E) (at x within s)\<rbrakk> \<Longrightarrow> ((\<lambda>x. f x * g x) has_field_derivative f x * E + D * g x) (at x within s)
[PROOF STEP]
by (rule has_derivative_imp_has_field_derivative[OF has_derivative_mult])
     (auto simp: field_simps mult_commute_abs dest: has_field_derivative_imp_has_derivative)


[STATEMENT]
lemma majoritiesE':
  assumes S: "card (S::('a::finite) set) > (card (UNIV::'a set)) div 2"
  and T: "card (T::'a set) > (card (UNIV::'a set)) div 2"
  obtains p where "p \<in> S" and "p \<in> T"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>p. \<lbrakk>p \<in> S; p \<in> T\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (rule abs_majoritiesE'[OF S T]) auto


[STATEMENT]
lemma alg_dvd_add [intro]:
  fixes x y z :: "'a :: field_char_0"
  shows "x alg_dvd y \<Longrightarrow> x alg_dvd z \<Longrightarrow> x alg_dvd (y + z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x alg_dvd y; x alg_dvd z\<rbrakk> \<Longrightarrow> x alg_dvd y + z
[PROOF STEP]
unfolding alg_dvd_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(x = (0::'a) \<longrightarrow> y = (0::'a)) \<and> algebraic_int (y / x); (x = (0::'a) \<longrightarrow> z = (0::'a)) \<and> algebraic_int (z / x)\<rbrakk> \<Longrightarrow> (x = (0::'a) \<longrightarrow> y + z = (0::'a)) \<and> algebraic_int ((y + z) / x)
[PROOF STEP]
by (auto simp: add_divide_distrib)


[STATEMENT]
lemma Mu_Sim:
  assumes A: "\<And> X Y. X \<preceq>S Y \<Longrightarrow> (P X) \<preceq>S (Q Y)"
  and B: "mono P" and C: "mono Q"
  shows "(lfp P) \<preceq>S (lfp Q) "
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lfp P \<preceq>S lfp Q
[PROOF STEP]
apply (rule lfp_Siml, drule A)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>X. P X \<preceq>S Q (lfp Q) \<Longrightarrow> P X \<preceq>S lfp Q
 2. mono P
[PROOF STEP]
apply (subst lfp_unfold, simp_all add: B C)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done