[STATEMENT]
lemma taq_smult_pos:
  assumes "a>0"
  shows "taq s (smult a p) = taq s p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. taq s (smult a p) = taq s p
[PROOF STEP]
unfolding taq_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>x\<in>s. sign (poly (smult a p) x)) = (\<Sum>x\<in>s. sign (poly p x))
[PROOF STEP]
by (simp add: assms sign_times)


[STATEMENT]
lemma distinct_remdups_wrt_rev: "distinct (map f (remdups_wrt_rev f xs vs))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distinct (map f (remdups_wrt_rev f xs vs))
[PROOF STEP]
proof (induct xs arbitrary: vs)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>vs. distinct (map f (remdups_wrt_rev f [] vs))
 2. \<And>a xs vs. (\<And>vs. distinct (map f (remdups_wrt_rev f xs vs))) \<Longrightarrow> distinct (map f (remdups_wrt_rev f (a # xs) vs))
[PROOF STEP]
case Nil
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. \<And>vs. distinct (map f (remdups_wrt_rev f [] vs))
 2. \<And>a xs vs. (\<And>vs. distinct (map f (remdups_wrt_rev f xs vs))) \<Longrightarrow> distinct (map f (remdups_wrt_rev f (a # xs) vs))
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distinct (map f (remdups_wrt_rev f [] vs))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
distinct (map f (remdups_wrt_rev f [] vs))

goal (1 subgoal):
 1. \<And>a xs vs. (\<And>vs. distinct (map f (remdups_wrt_rev f xs vs))) \<Longrightarrow> distinct (map f (remdups_wrt_rev f (a # xs) vs))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a xs vs. (\<And>vs. distinct (map f (remdups_wrt_rev f xs vs))) \<Longrightarrow> distinct (map f (remdups_wrt_rev f (a # xs) vs))
[PROOF STEP]
case (Cons x xs)
[PROOF STATE]
proof (state)
this:
distinct (map f (remdups_wrt_rev f xs ?vs))

goal (1 subgoal):
 1. \<And>a xs vs. (\<And>vs. distinct (map f (remdups_wrt_rev f xs vs))) \<Longrightarrow> distinct (map f (remdups_wrt_rev f (a # xs) vs))
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distinct (map f (remdups_wrt_rev f (x # xs) vs))
[PROOF STEP]
by (simp add: Let_def Cons(1) remdups_wrt_rev_notin)
[PROOF STATE]
proof (state)
this:
distinct (map f (remdups_wrt_rev f (x # xs) vs))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma PiE_cong: "(\<And>i. i\<in>I \<Longrightarrow> A i = B i) \<Longrightarrow> Pi\<^sub>E I A = Pi\<^sub>E I B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>i. i \<in> I \<Longrightarrow> A i = B i) \<Longrightarrow> Pi\<^sub>E I A = Pi\<^sub>E I B
[PROOF STEP]
unfolding PiE_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>i. i \<in> I \<Longrightarrow> A i = B i) \<Longrightarrow> Pi I A \<inter> extensional I = Pi I B \<inter> extensional I
[PROOF STEP]
by (auto simp: Pi_cong)


[STATEMENT]
lemma pred_finite[simp, intro]: "finite (edges G) \<Longrightarrow> finite (pred G v)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (edges G) \<Longrightarrow> finite (pred G v)
[PROOF STEP]
unfolding pred_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (edges G) \<Longrightarrow> finite {(v', w). (v', w, v) \<in> edges G}
[PROOF STEP]
by (rule finite_subset[where B="(\<lambda>(v,w,v'). (v,w))`edges G"]) force+


[STATEMENT]
lemma scalar_prod_uminus_left[simp]: assumes dim: "dim_vec v = dim_vec (w :: 'a :: ring vec)"
  shows "- v \<bullet> w = - (v \<bullet> w)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - v \<bullet> w = - (v \<bullet> w)
[PROOF STEP]
unfolding scalar_prod_def dim[symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i = 0..<dim_vec v. (- v) $ i * w $ i) = - (\<Sum>i = 0..<dim_vec v. v $ i * w $ i)
[PROOF STEP]
by (subst sum_negf[symmetric], rule sum.cong, auto)


[STATEMENT]
lemma ereal_add_strict_mono:
  fixes a b c d :: ereal
  assumes "a \<le> b"
    and "0 \<le> a"
    and "a \<noteq> \<infinity>"
    and "c < d"
  shows "a + c < b + d"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a + c < b + d
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
a \<le> b
0 \<le> a
a \<noteq> \<infinity>
c < d

goal (1 subgoal):
 1. a + c < b + d
[PROOF STEP]
by (cases rule: ereal3_cases[case_product ereal_cases, of a b c d]) auto


[STATEMENT]
lemma col_lta__out:
  assumes "Col A B C" and
    "A B C LtA X Y Z"
  shows "B Out A C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. B Out A C
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. B Out A C
[PROOF STEP]
have "A B C LeA X Y Z \<and> \<not> A B C CongA X Y Z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A B C LeA X Y Z \<and> \<not> A B C CongA X Y Z
[PROOF STEP]
using LtA_def assms(2)
[PROOF STATE]
proof (prove)
using this:
?A ?B ?C LtA ?D ?E ?F \<equiv> ?A ?B ?C LeA ?D ?E ?F \<and> \<not> ?A ?B ?C CongA ?D ?E ?F
A B C LtA X Y Z

goal (1 subgoal):
 1. A B C LeA X Y Z \<and> \<not> A B C CongA X Y Z
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
A B C LeA X Y Z \<and> \<not> A B C CongA X Y Z

goal (1 subgoal):
 1. B Out A C
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
A B C LeA X Y Z \<and> \<not> A B C CongA X Y Z

goal (1 subgoal):
 1. B Out A C
[PROOF STEP]
by (metis assms(1) l11_31_2 lea_asym lea_distincts or_bet_out)
[PROOF STATE]
proof (state)
this:
B Out A C

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Field_rel_restrict:
  "Field (rel_restrict R A) \<subseteq> Field R - A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Field (rel_restrict R A) \<subseteq> Field R - A
[PROOF STEP]
unfolding rel_restrict_def Field_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Domain {(v, w). (v, w) \<in> R \<and> v \<notin> A \<and> w \<notin> A} \<union> Range {(v, w). (v, w) \<in> R \<and> v \<notin> A \<and> w \<notin> A} \<subseteq> Domain R \<union> Range R - A
[PROOF STEP]
by auto


[STATEMENT]
lemma Maclaurin_sin_bound: "\<bar>sin x - (\<Sum>m<n. sin_coeff m * x ^ m)\<bar> \<le> inverse (fact n) * \<bar>x\<bar> ^ n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>sin x - (\<Sum>m<n. sin_coeff m * x ^ m)\<bar> \<le> inverse (fact n) * \<bar>x\<bar> ^ n
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<bar>sin x - (\<Sum>m<n. sin_coeff m * x ^ m)\<bar> \<le> inverse (fact n) * \<bar>x\<bar> ^ n
[PROOF STEP]
have est: "x \<le> 1 \<Longrightarrow> 0 \<le> y \<Longrightarrow> x * y \<le> 1 * y" for x y :: real
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<le> 1; 0 \<le> y\<rbrakk> \<Longrightarrow> x * y \<le> 1 * y
[PROOF STEP]
by (rule mult_right_mono) simp_all
[PROOF STATE]
proof (state)
this:
\<lbrakk>?x \<le> 1; 0 \<le> ?y\<rbrakk> \<Longrightarrow> ?x * ?y \<le> 1 * ?y

goal (1 subgoal):
 1. \<bar>sin x - (\<Sum>m<n. sin_coeff m * x ^ m)\<bar> \<le> inverse (fact n) * \<bar>x\<bar> ^ n
[PROOF STEP]
let ?diff = "\<lambda>(n::nat) (x::real).
    if n mod 4 = 0 then sin x
    else if n mod 4 = 1 then cos x
    else if n mod 4 = 2 then - sin x
    else - cos x"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<bar>sin x - (\<Sum>m<n. sin_coeff m * x ^ m)\<bar> \<le> inverse (fact n) * \<bar>x\<bar> ^ n
[PROOF STEP]
have diff_0: "?diff 0 = sin"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. if 0 mod 4 = 0 then sin x else if 0 mod 4 = 1 then cos x else if 0 mod 4 = 2 then - sin x else - cos x) = sin
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<lambda>x. if 0 mod 4 = 0 then sin x else if 0 mod 4 = 1 then cos x else if 0 mod 4 = 2 then - sin x else - cos x) = sin

goal (1 subgoal):
 1. \<bar>sin x - (\<Sum>m<n. sin_coeff m * x ^ m)\<bar> \<le> inverse (fact n) * \<bar>x\<bar> ^ n
[PROOF STEP]
have "DERIV (?diff m) x :> ?diff (Suc m) x" for m and x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. if m mod 4 = 0 then sin x else if m mod 4 = 1 then cos x else if m mod 4 = 2 then - sin x else - cos x) has_real_derivative (if Suc m mod 4 = 0 then sin x else if Suc m mod 4 = 1 then cos x else if Suc m mod 4 = 2 then - sin x else - cos x)) (at x)
[PROOF STEP]
using mod_exhaust_less_4 [of m]
[PROOF STATE]
proof (prove)
using this:
m mod 4 = 0 \<or> m mod 4 = 1 \<or> m mod 4 = 2 \<or> m mod 4 = 3

goal (1 subgoal):
 1. ((\<lambda>x. if m mod 4 = 0 then sin x else if m mod 4 = 1 then cos x else if m mod 4 = 2 then - sin x else - cos x) has_real_derivative (if Suc m mod 4 = 0 then sin x else if Suc m mod 4 = 1 then cos x else if Suc m mod 4 = 2 then - sin x else - cos x)) (at x)
[PROOF STEP]
by (auto simp: mod_Suc intro!: derivative_eq_intros)
[PROOF STATE]
proof (state)
this:
((\<lambda>x. if ?m mod 4 = 0 then sin x else if ?m mod 4 = 1 then cos x else if ?m mod 4 = 2 then - sin x else - cos x) has_real_derivative (if Suc ?m mod 4 = 0 then sin ?x else if Suc ?m mod 4 = 1 then cos ?x else if Suc ?m mod 4 = 2 then - sin ?x else - cos ?x)) (at ?x)

goal (1 subgoal):
 1. \<bar>sin x - (\<Sum>m<n. sin_coeff m * x ^ m)\<bar> \<le> inverse (fact n) * \<bar>x\<bar> ^ n
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
((\<lambda>x. if ?m mod 4 = 0 then sin x else if ?m mod 4 = 1 then cos x else if ?m mod 4 = 2 then - sin x else - cos x) has_real_derivative (if Suc ?m mod 4 = 0 then sin ?x else if Suc ?m mod 4 = 1 then cos ?x else if Suc ?m mod 4 = 2 then - sin ?x else - cos ?x)) (at ?x)
[PROOF STEP]
have DERIV_diff: "\<forall>m x. DERIV (?diff m) x :> ?diff (Suc m) x"
[PROOF STATE]
proof (prove)
using this:
((\<lambda>x. if ?m mod 4 = 0 then sin x else if ?m mod 4 = 1 then cos x else if ?m mod 4 = 2 then - sin x else - cos x) has_real_derivative (if Suc ?m mod 4 = 0 then sin ?x else if Suc ?m mod 4 = 1 then cos ?x else if Suc ?m mod 4 = 2 then - sin ?x else - cos ?x)) (at ?x)

goal (1 subgoal):
 1. \<forall>m x. ((\<lambda>x. if m mod 4 = 0 then sin x else if m mod 4 = 1 then cos x else if m mod 4 = 2 then - sin x else - cos x) has_real_derivative (if Suc m mod 4 = 0 then sin x else if Suc m mod 4 = 1 then cos x else if Suc m mod 4 = 2 then - sin x else - cos x)) (at x)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<forall>m x. ((\<lambda>x. if m mod 4 = 0 then sin x else if m mod 4 = 1 then cos x else if m mod 4 = 2 then - sin x else - cos x) has_real_derivative (if Suc m mod 4 = 0 then sin x else if Suc m mod 4 = 1 then cos x else if Suc m mod 4 = 2 then - sin x else - cos x)) (at x)

goal (1 subgoal):
 1. \<bar>sin x - (\<Sum>m<n. sin_coeff m * x ^ m)\<bar> \<le> inverse (fact n) * \<bar>x\<bar> ^ n
[PROOF STEP]
from Maclaurin_all_le [OF diff_0 DERIV_diff]
[PROOF STATE]
proof (chain)
picking this:
\<exists>t. \<bar>t\<bar> \<le> \<bar>?x\<bar> \<and> sin ?x = (\<Sum>m<?n. (if m mod 4 = 0 then sin 0 else if m mod 4 = 1 then cos 0 else if m mod 4 = 2 then - sin 0 else - cos 0) / fact m * ?x ^ m) + (if ?n mod 4 = 0 then sin t else if ?n mod 4 = 1 then cos t else if ?n mod 4 = 2 then - sin t else - cos t) / fact ?n * ?x ^ ?n
[PROOF STEP]
obtain t where t1: "\<bar>t\<bar> \<le> \<bar>x\<bar>"
    and t2: "sin x = (\<Sum>m<n. ?diff m 0 / (fact m) * x ^ m) + ?diff n t / (fact n) * x ^ n"
[PROOF STATE]
proof (prove)
using this:
\<exists>t. \<bar>t\<bar> \<le> \<bar>?x\<bar> \<and> sin ?x = (\<Sum>m<?n. (if m mod 4 = 0 then sin 0 else if m mod 4 = 1 then cos 0 else if m mod 4 = 2 then - sin 0 else - cos 0) / fact m * ?x ^ m) + (if ?n mod 4 = 0 then sin t else if ?n mod 4 = 1 then cos t else if ?n mod 4 = 2 then - sin t else - cos t) / fact ?n * ?x ^ ?n

goal (1 subgoal):
 1. (\<And>t. \<lbrakk>\<bar>t\<bar> \<le> \<bar>x\<bar>; sin x = (\<Sum>m<n. (if m mod 4 = 0 then sin 0 else if m mod 4 = 1 then cos 0 else if m mod 4 = 2 then - sin 0 else - cos 0) / fact m * x ^ m) + (if n mod 4 = 0 then sin t else if n mod 4 = 1 then cos t else if n mod 4 = 2 then - sin t else - cos t) / fact n * x ^ n\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
\<bar>t\<bar> \<le> \<bar>x\<bar>
sin x = (\<Sum>m<n. (if m mod 4 = 0 then sin 0 else if m mod 4 = 1 then cos 0 else if m mod 4 = 2 then - sin 0 else - cos 0) / fact m * x ^ m) + (if n mod 4 = 0 then sin t else if n mod 4 = 1 then cos t else if n mod 4 = 2 then - sin t else - cos t) / fact n * x ^ n

goal (1 subgoal):
 1. \<bar>sin x - (\<Sum>m<n. sin_coeff m * x ^ m)\<bar> \<le> inverse (fact n) * \<bar>x\<bar> ^ n
[PROOF STEP]
have diff_m_0: "?diff m 0 = (if even m then 0 else (- 1) ^ ((m - Suc 0) div 2))" for m
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if m mod 4 = 0 then sin 0 else if m mod 4 = 1 then cos 0 else if m mod 4 = 2 then - sin 0 else - cos 0) = (if even m then 0 else (- 1) ^ ((m - Suc 0) div 2))
[PROOF STEP]
using mod_exhaust_less_4 [of m]
[PROOF STATE]
proof (prove)
using this:
m mod 4 = 0 \<or> m mod 4 = 1 \<or> m mod 4 = 2 \<or> m mod 4 = 3

goal (1 subgoal):
 1. (if m mod 4 = 0 then sin 0 else if m mod 4 = 1 then cos 0 else if m mod 4 = 2 then - sin 0 else - cos 0) = (if even m then 0 else (- 1) ^ ((m - Suc 0) div 2))
[PROOF STEP]
by (auto simp: minus_one_power_iff even_even_mod_4_iff [of m] dest: even_mod_4_div_2 odd_mod_4_div_2)
[PROOF STATE]
proof (state)
this:
(if ?m mod 4 = 0 then sin 0 else if ?m mod 4 = 1 then cos 0 else if ?m mod 4 = 2 then - sin 0 else - cos 0) = (if even ?m then 0 else (- 1) ^ ((?m - Suc 0) div 2))

goal (1 subgoal):
 1. \<bar>sin x - (\<Sum>m<n. sin_coeff m * x ^ m)\<bar> \<le> inverse (fact n) * \<bar>x\<bar> ^ n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>sin x - (\<Sum>m<n. sin_coeff m * x ^ m)\<bar> \<le> inverse (fact n) * \<bar>x\<bar> ^ n
[PROOF STEP]
unfolding sin_coeff_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>sin x - (\<Sum>m<n. (if even m then 0 else (- 1) ^ ((m - Suc 0) div 2) / fact m) * x ^ m)\<bar> \<le> inverse (fact n) * \<bar>x\<bar> ^ n
[PROOF STEP]
apply (subst t2)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>(\<Sum>m<n. (if m mod 4 = 0 then sin 0 else if m mod 4 = 1 then cos 0 else if m mod 4 = 2 then - sin 0 else - cos 0) / fact m * x ^ m) + (if n mod 4 = 0 then sin t else if n mod 4 = 1 then cos t else if n mod 4 = 2 then - sin t else - cos t) / fact n * x ^ n - (\<Sum>m<n. (if even m then 0 else (- 1) ^ ((m - Suc 0) div 2) / fact m) * x ^ m)\<bar> \<le> inverse (fact n) * \<bar>x\<bar> ^ n
[PROOF STEP]
apply (rule sin_bound_lemma)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. (\<Sum>m<n. (if m mod 4 = 0 then sin 0 else if m mod 4 = 1 then cos 0 else if m mod 4 = 2 then - sin 0 else - cos 0) / fact m * x ^ m) = (\<Sum>m<n. (if even m then 0 else (- 1) ^ ((m - Suc 0) div 2) / fact m) * x ^ m)
 2. \<bar>(if n mod 4 = 0 then sin t else if n mod 4 = 1 then cos t else if n mod 4 = 2 then - sin t else - cos t) / fact n * x ^ n\<bar> \<le> inverse (fact n) * \<bar>x\<bar> ^ n
[PROOF STEP]
apply (rule sum.cong[OF refl])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>xa. xa \<in> {..<n} \<Longrightarrow> (if xa mod 4 = 0 then sin 0 else if xa mod 4 = 1 then cos 0 else if xa mod 4 = 2 then - sin 0 else - cos 0) / fact xa * x ^ xa = (if even xa then 0 else (- 1) ^ ((xa - Suc 0) div 2) / fact xa) * x ^ xa
 2. \<bar>(if n mod 4 = 0 then sin t else if n mod 4 = 1 then cos t else if n mod 4 = 2 then - sin t else - cos t) / fact n * x ^ n\<bar> \<le> inverse (fact n) * \<bar>x\<bar> ^ n
[PROOF STEP]
apply (subst diff_m_0, simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>(if n mod 4 = 0 then sin t else if n mod 4 = 1 then cos t else if n mod 4 = 2 then - sin t else - cos t) / fact n * x ^ n\<bar> \<le> inverse (fact n) * \<bar>x\<bar> ^ n
[PROOF STEP]
using est
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?x \<le> 1; 0 \<le> ?y\<rbrakk> \<Longrightarrow> ?x * ?y \<le> 1 * ?y

goal (1 subgoal):
 1. \<bar>(if n mod 4 = 0 then sin t else if n mod 4 = 1 then cos t else if n mod 4 = 2 then - sin t else - cos t) / fact n * x ^ n\<bar> \<le> inverse (fact n) * \<bar>x\<bar> ^ n
[PROOF STEP]
apply (auto intro: mult_right_mono [where b=1, simplified] mult_right_mono
        simp: ac_simps divide_inverse power_abs [symmetric] abs_mult)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
\<bar>sin x - (\<Sum>m<n. sin_coeff m * x ^ m)\<bar> \<le> inverse (fact n) * \<bar>x\<bar> ^ n

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma hermitean_eigenval_real:
  assumes "hermitean H" and "eigenval k H"
  shows "is_real k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_real k
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. is_real k
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
hermitean H
eigenval k H
[PROOF STEP]
obtain v where "v \<noteq> vec_zero" "H *\<^sub>m\<^sub>v v = k *\<^sub>s\<^sub>v v"
[PROOF STATE]
proof (prove)
using this:
hermitean H
eigenval k H

goal (1 subgoal):
 1. (\<And>v. \<lbrakk>v \<noteq> vec_zero; H *\<^sub>m\<^sub>v v = k *\<^sub>s\<^sub>v v\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding eigenval_def
[PROOF STATE]
proof (prove)
using this:
hermitean H
\<exists>v. v \<noteq> vec_zero \<and> H *\<^sub>m\<^sub>v v = k *\<^sub>s\<^sub>v v

goal (1 subgoal):
 1. (\<And>v. \<lbrakk>v \<noteq> vec_zero; H *\<^sub>m\<^sub>v v = k *\<^sub>s\<^sub>v v\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
v \<noteq> vec_zero
H *\<^sub>m\<^sub>v v = k *\<^sub>s\<^sub>v v

goal (1 subgoal):
 1. is_real k
[PROOF STEP]
have "k * (v *\<^sub>v\<^sub>v vec_cnj v) = (k *\<^sub>s\<^sub>v v) *\<^sub>v\<^sub>v (vec_cnj v)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. k * v *\<^sub>v\<^sub>v vec_cnj v = k *\<^sub>s\<^sub>v v *\<^sub>v\<^sub>v vec_cnj v
[PROOF STEP]
by (simp add: mult_vv_scale_sv1)
[PROOF STATE]
proof (state)
this:
k * v *\<^sub>v\<^sub>v vec_cnj v = k *\<^sub>s\<^sub>v v *\<^sub>v\<^sub>v vec_cnj v

goal (1 subgoal):
 1. is_real k
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
k * v *\<^sub>v\<^sub>v vec_cnj v = k *\<^sub>s\<^sub>v v *\<^sub>v\<^sub>v vec_cnj v

goal (1 subgoal):
 1. is_real k
[PROOF STEP]
have "... = (H *\<^sub>m\<^sub>v v) *\<^sub>v\<^sub>v (vec_cnj v)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. k *\<^sub>s\<^sub>v v *\<^sub>v\<^sub>v vec_cnj v = H *\<^sub>m\<^sub>v v *\<^sub>v\<^sub>v vec_cnj v
[PROOF STEP]
using \<open>H *\<^sub>m\<^sub>v v = k *\<^sub>s\<^sub>v v\<close>
[PROOF STATE]
proof (prove)
using this:
H *\<^sub>m\<^sub>v v = k *\<^sub>s\<^sub>v v

goal (1 subgoal):
 1. k *\<^sub>s\<^sub>v v *\<^sub>v\<^sub>v vec_cnj v = H *\<^sub>m\<^sub>v v *\<^sub>v\<^sub>v vec_cnj v
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
k *\<^sub>s\<^sub>v v *\<^sub>v\<^sub>v vec_cnj v = H *\<^sub>m\<^sub>v v *\<^sub>v\<^sub>v vec_cnj v

goal (1 subgoal):
 1. is_real k
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
k *\<^sub>s\<^sub>v v *\<^sub>v\<^sub>v vec_cnj v = H *\<^sub>m\<^sub>v v *\<^sub>v\<^sub>v vec_cnj v

goal (1 subgoal):
 1. is_real k
[PROOF STEP]
have "... =  v *\<^sub>v\<^sub>v (mat_transpose H *\<^sub>m\<^sub>v (vec_cnj v))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. H *\<^sub>m\<^sub>v v *\<^sub>v\<^sub>v vec_cnj v = v *\<^sub>v\<^sub>v (mat_transpose H *\<^sub>m\<^sub>v vec_cnj v)
[PROOF STEP]
by (simp add: mult_mv_vv)
[PROOF STATE]
proof (state)
this:
H *\<^sub>m\<^sub>v v *\<^sub>v\<^sub>v vec_cnj v = v *\<^sub>v\<^sub>v (mat_transpose H *\<^sub>m\<^sub>v vec_cnj v)

goal (1 subgoal):
 1. is_real k
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
H *\<^sub>m\<^sub>v v *\<^sub>v\<^sub>v vec_cnj v = v *\<^sub>v\<^sub>v (mat_transpose H *\<^sub>m\<^sub>v vec_cnj v)

goal (1 subgoal):
 1. is_real k
[PROOF STEP]
have "... = v *\<^sub>v\<^sub>v (vec_cnj (mat_cnj (mat_transpose H) *\<^sub>m\<^sub>v v))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. v *\<^sub>v\<^sub>v (mat_transpose H *\<^sub>m\<^sub>v vec_cnj v) = v *\<^sub>v\<^sub>v vec_cnj (mat_cnj (mat_transpose H) *\<^sub>m\<^sub>v v)
[PROOF STEP]
by (simp add: vec_cnj_mult_mv)
[PROOF STATE]
proof (state)
this:
v *\<^sub>v\<^sub>v (mat_transpose H *\<^sub>m\<^sub>v vec_cnj v) = v *\<^sub>v\<^sub>v vec_cnj (mat_cnj (mat_transpose H) *\<^sub>m\<^sub>v v)

goal (1 subgoal):
 1. is_real k
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
v *\<^sub>v\<^sub>v (mat_transpose H *\<^sub>m\<^sub>v vec_cnj v) = v *\<^sub>v\<^sub>v vec_cnj (mat_cnj (mat_transpose H) *\<^sub>m\<^sub>v v)

goal (1 subgoal):
 1. is_real k
[PROOF STEP]
have "... = v *\<^sub>v\<^sub>v (vec_cnj (H *\<^sub>m\<^sub>v v))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. v *\<^sub>v\<^sub>v vec_cnj (mat_cnj (mat_transpose H) *\<^sub>m\<^sub>v v) = v *\<^sub>v\<^sub>v vec_cnj (H *\<^sub>m\<^sub>v v)
[PROOF STEP]
using \<open>hermitean H\<close>
[PROOF STATE]
proof (prove)
using this:
hermitean H

goal (1 subgoal):
 1. v *\<^sub>v\<^sub>v vec_cnj (mat_cnj (mat_transpose H) *\<^sub>m\<^sub>v v) = v *\<^sub>v\<^sub>v vec_cnj (H *\<^sub>m\<^sub>v v)
[PROOF STEP]
by (simp add: hermitean_def mat_adj_def)
[PROOF STATE]
proof (state)
this:
v *\<^sub>v\<^sub>v vec_cnj (mat_cnj (mat_transpose H) *\<^sub>m\<^sub>v v) = v *\<^sub>v\<^sub>v vec_cnj (H *\<^sub>m\<^sub>v v)

goal (1 subgoal):
 1. is_real k
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
v *\<^sub>v\<^sub>v vec_cnj (mat_cnj (mat_transpose H) *\<^sub>m\<^sub>v v) = v *\<^sub>v\<^sub>v vec_cnj (H *\<^sub>m\<^sub>v v)

goal (1 subgoal):
 1. is_real k
[PROOF STEP]
have "... = v *\<^sub>v\<^sub>v (vec_cnj (k *\<^sub>s\<^sub>v v))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. v *\<^sub>v\<^sub>v vec_cnj (H *\<^sub>m\<^sub>v v) = v *\<^sub>v\<^sub>v vec_cnj (k *\<^sub>s\<^sub>v v)
[PROOF STEP]
using \<open>H *\<^sub>m\<^sub>v v = k *\<^sub>s\<^sub>v v\<close>
[PROOF STATE]
proof (prove)
using this:
H *\<^sub>m\<^sub>v v = k *\<^sub>s\<^sub>v v

goal (1 subgoal):
 1. v *\<^sub>v\<^sub>v vec_cnj (H *\<^sub>m\<^sub>v v) = v *\<^sub>v\<^sub>v vec_cnj (k *\<^sub>s\<^sub>v v)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
v *\<^sub>v\<^sub>v vec_cnj (H *\<^sub>m\<^sub>v v) = v *\<^sub>v\<^sub>v vec_cnj (k *\<^sub>s\<^sub>v v)

goal (1 subgoal):
 1. is_real k
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
k * v *\<^sub>v\<^sub>v vec_cnj v = v *\<^sub>v\<^sub>v vec_cnj (k *\<^sub>s\<^sub>v v)
[PROOF STEP]
have "k * (v *\<^sub>v\<^sub>v vec_cnj v) = cnj k * (v *\<^sub>v\<^sub>v vec_cnj v)"
[PROOF STATE]
proof (prove)
using this:
k * v *\<^sub>v\<^sub>v vec_cnj v = v *\<^sub>v\<^sub>v vec_cnj (k *\<^sub>s\<^sub>v v)

goal (1 subgoal):
 1. k * v *\<^sub>v\<^sub>v vec_cnj v = cnj k * v *\<^sub>v\<^sub>v vec_cnj v
[PROOF STEP]
by (simp add: mult_vv_scale_sv2)
[PROOF STATE]
proof (state)
this:
k * v *\<^sub>v\<^sub>v vec_cnj v = cnj k * v *\<^sub>v\<^sub>v vec_cnj v

goal (1 subgoal):
 1. is_real k
[PROOF STEP]
hence "k = cnj k"
[PROOF STATE]
proof (prove)
using this:
k * v *\<^sub>v\<^sub>v vec_cnj v = cnj k * v *\<^sub>v\<^sub>v vec_cnj v

goal (1 subgoal):
 1. k = cnj k
[PROOF STEP]
using \<open>v \<noteq> vec_zero\<close>
[PROOF STATE]
proof (prove)
using this:
k * v *\<^sub>v\<^sub>v vec_cnj v = cnj k * v *\<^sub>v\<^sub>v vec_cnj v
v \<noteq> vec_zero

goal (1 subgoal):
 1. k = cnj k
[PROOF STEP]
using scalsquare_vv_zero[of v]
[PROOF STATE]
proof (prove)
using this:
k * v *\<^sub>v\<^sub>v vec_cnj v = cnj k * v *\<^sub>v\<^sub>v vec_cnj v
v \<noteq> vec_zero
(vec_cnj v *\<^sub>v\<^sub>v v = 0) = (v = vec_zero)

goal (1 subgoal):
 1. k = cnj k
[PROOF STEP]
by (simp add: mult_vv_commute)
[PROOF STATE]
proof (state)
this:
k = cnj k

goal (1 subgoal):
 1. is_real k
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
k = cnj k

goal (1 subgoal):
 1. is_real k
[PROOF STEP]
by (metis eq_cnj_iff_real)
[PROOF STATE]
proof (state)
this:
is_real k

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma const_list_cons_last:
  assumes "const_list (es@[e])"
  shows "const_list es"
        "is_const e"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. const_list es &&& is_const e
[PROOF STEP]
using assms list_all_append[of is_const es "[e]"]
[PROOF STATE]
proof (prove)
using this:
const_list (es @ [e])
list_all is_const (es @ [e]) = (list_all is_const es \<and> list_all is_const [e])

goal (1 subgoal):
 1. const_list es &&& is_const e
[PROOF STEP]
unfolding const_list_def
[PROOF STATE]
proof (prove)
using this:
list_all is_const (es @ [e])
list_all is_const (es @ [e]) = (list_all is_const es \<and> list_all is_const [e])

goal (1 subgoal):
 1. list_all is_const es &&& is_const e
[PROOF STEP]
by auto


[STATEMENT]
lemma Sbis_Sym: "c \<approx>s d \<Longrightarrow> d \<approx>s c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c \<approx>s d \<Longrightarrow> d \<approx>s c
[PROOF STEP]
using Sbis_sym
[PROOF STATE]
proof (prove)
using this:
sym Sbis

goal (1 subgoal):
 1. c \<approx>s d \<Longrightarrow> d \<approx>s c
[PROOF STEP]
unfolding sym_def
[PROOF STATE]
proof (prove)
using this:
\<forall>x y. x \<approx>s y \<longrightarrow> y \<approx>s x

goal (1 subgoal):
 1. c \<approx>s d \<Longrightarrow> d \<approx>s c
[PROOF STEP]
by blast


[STATEMENT]
lemma Nsetn_sub: "{j. j \<le> n} \<subseteq> {j. j \<le> (Suc n)}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {j. j \<le> n} \<subseteq> {j. j \<le> Suc n}
[PROOF STEP]
apply (rule subsetI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. x \<in> {j. j \<le> n} \<Longrightarrow> x \<in> {j. j \<le> Suc n}
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma sq_le_cancel:
  shows "(a::real) \<ge> 0 \<Longrightarrow> b \<ge> 0 \<Longrightarrow> a^2 \<le> b * a \<Longrightarrow> a \<le> b"
  and "(a::real) \<ge> 0 \<Longrightarrow> b \<ge> 0 \<Longrightarrow> a^2 \<le> a * b \<Longrightarrow> a \<le> b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lbrakk>0 \<le> a; 0 \<le> b; a\<^sup>2 \<le> b * a\<rbrakk> \<Longrightarrow> a \<le> b) &&& (\<lbrakk>0 \<le> a; 0 \<le> b; a\<^sup>2 \<le> a * b\<rbrakk> \<Longrightarrow> a \<le> b)
[PROOF STEP]
apply (metis less_eq_real_def mult.commute mult_le_cancel_left semiring_normalization_rules(29))
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 \<le> a; 0 \<le> b; a\<^sup>2 \<le> a * b\<rbrakk> \<Longrightarrow> a \<le> b
[PROOF STEP]
by (metis less_eq_real_def mult_le_cancel_left semiring_normalization_rules(29))


[STATEMENT]
lemma Node_left_inj2: "inj2 (\<lambda>r l. Node l e r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj2 (\<lambda>r l. \<langle>l, e, r\<rangle>)
[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. \<langle>y1, e, x1\<rangle> = \<langle>y2, e, x2\<rangle> \<longrightarrow> x1 = x2 \<and> y1 = y2
[PROOF STEP]
by simp


[STATEMENT]
lemma path_reversepath [simp]: "path (reversepath g) \<longleftrightarrow> path g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. path (reversepath g) = path g
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. path (reversepath g) = path g
[PROOF STEP]
have *: "\<And>g. path g \<Longrightarrow> path (reversepath g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>g. path g \<Longrightarrow> path (reversepath g)
[PROOF STEP]
unfolding path_def reversepath_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>g. continuous_on {0..1} g \<Longrightarrow> continuous_on {0..1} (\<lambda>x. g (1 - x))
[PROOF STEP]
apply (rule continuous_on_compose[unfolded o_def, of _ "\<lambda>x. 1 - x"])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>g. continuous_on {0..1} g \<Longrightarrow> continuous_on {0..1} ((-) 1)
 2. \<And>g. continuous_on {0..1} g \<Longrightarrow> continuous_on ((-) 1 ` {0..1}) g
[PROOF STEP]
apply (auto intro: continuous_intros continuous_on_subset[of "{0..1}"])
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
path ?g \<Longrightarrow> path (reversepath ?g)

goal (1 subgoal):
 1. path (reversepath g) = path g
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. path (reversepath g) = path g
[PROOF STEP]
using "*"
[PROOF STATE]
proof (prove)
using this:
path ?g \<Longrightarrow> path (reversepath ?g)

goal (1 subgoal):
 1. path (reversepath g) = path g
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
path (reversepath g) = path g

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma take_bit_nat_eq_self_iff:
  \<open>take_bit n m = m \<longleftrightarrow> m < 2 ^ n\<close> (is \<open>?P \<longleftrightarrow> ?Q\<close>)
  for n m :: nat
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (take_bit n m = m) = (m < 2 ^ n)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. take_bit n m = m \<Longrightarrow> m < 2 ^ n
 2. m < 2 ^ n \<Longrightarrow> take_bit n m = m
[PROOF STEP]
assume ?P
[PROOF STATE]
proof (state)
this:
take_bit n m = m

goal (2 subgoals):
 1. take_bit n m = m \<Longrightarrow> m < 2 ^ n
 2. m < 2 ^ n \<Longrightarrow> take_bit n m = m
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
take_bit n m = m

goal (2 subgoals):
 1. take_bit n m = m \<Longrightarrow> m < 2 ^ n
 2. m < 2 ^ n \<Longrightarrow> take_bit n m = m
[PROOF STEP]
note take_bit_nat_less_exp [of n m]
[PROOF STATE]
proof (state)
this:
take_bit n m < 2 ^ n

goal (2 subgoals):
 1. take_bit n m = m \<Longrightarrow> m < 2 ^ n
 2. m < 2 ^ n \<Longrightarrow> take_bit n m = m
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
take_bit n m = m
take_bit n m < 2 ^ n
[PROOF STEP]
show ?Q
[PROOF STATE]
proof (prove)
using this:
take_bit n m = m
take_bit n m < 2 ^ n

goal (1 subgoal):
 1. m < 2 ^ n
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
m < 2 ^ n

goal (1 subgoal):
 1. m < 2 ^ n \<Longrightarrow> take_bit n m = m
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. m < 2 ^ n \<Longrightarrow> take_bit n m = m
[PROOF STEP]
assume ?Q
[PROOF STATE]
proof (state)
this:
m < 2 ^ n

goal (1 subgoal):
 1. m < 2 ^ n \<Longrightarrow> take_bit n m = m
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
m < 2 ^ n
[PROOF STEP]
show ?P
[PROOF STATE]
proof (prove)
using this:
m < 2 ^ n

goal (1 subgoal):
 1. take_bit n m = m
[PROOF STEP]
by (simp add: take_bit_eq_mod)
[PROOF STATE]
proof (state)
this:
take_bit n m = m

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma sunflower_card_subset_lift: fixes F :: "'a set set"
  assumes sunflower: "\<And> G :: ('a + nat) set set.
     (\<forall> A \<in> G. finite A \<and> card A = k) \<Longrightarrow> card G > c
        \<Longrightarrow> \<exists> S. S \<subseteq> G \<and> sunflower S \<and> card S = r"
    and kF: "\<forall> A \<in> F. finite A \<and> card A \<le> k"
    and cardF: "card F > c"
  shows "\<exists> S. S \<subseteq> F \<and> sunflower S \<and> card S = r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>S\<subseteq>F. sunflower S \<and> card S = r
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>S\<subseteq>F. sunflower S \<and> card S = r
[PROOF STEP]
let ?n = "Suc c"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>S\<subseteq>F. sunflower S \<and> card S = r
[PROOF STEP]
from cardF
[PROOF STATE]
proof (chain)
picking this:
c < card F
[PROOF STEP]
have "card F \<ge> ?n"
[PROOF STATE]
proof (prove)
using this:
c < card F

goal (1 subgoal):
 1. Suc c \<le> card F
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Suc c \<le> card F

goal (1 subgoal):
 1. \<exists>S\<subseteq>F. sunflower S \<and> card S = r
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
Suc c \<le> card F
[PROOF STEP]
obtain FF where sub: "FF \<subseteq> F" and cardF: "card FF = ?n"
[PROOF STATE]
proof (prove)
using this:
Suc c \<le> card F

goal (1 subgoal):
 1. (\<And>FF. \<lbrakk>FF \<subseteq> F; card FF = Suc c\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (rule obtain_subset_with_card_n)
[PROOF STATE]
proof (state)
this:
FF \<subseteq> F
card FF = Suc c

goal (1 subgoal):
 1. \<exists>S\<subseteq>F. sunflower S \<and> card S = r
[PROOF STEP]
let ?N = "{0 ..< ?n}"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>S\<subseteq>F. sunflower S \<and> card S = r
[PROOF STEP]
from cardF
[PROOF STATE]
proof (chain)
picking this:
card FF = Suc c
[PROOF STEP]
have "finite FF"
[PROOF STATE]
proof (prove)
using this:
card FF = Suc c

goal (1 subgoal):
 1. finite FF
[PROOF STEP]
by (simp add: card_ge_0_finite)
[PROOF STATE]
proof (state)
this:
finite FF

goal (1 subgoal):
 1. \<exists>S\<subseteq>F. sunflower S \<and> card S = r
[PROOF STEP]
from ex_bij_betw_nat_finite[OF this, unfolded cardF]
[PROOF STATE]
proof (chain)
picking this:
\<exists>h. bij_betw h {0..<Suc c} FF
[PROOF STEP]
obtain f where f: "bij_betw f ?N FF"
[PROOF STATE]
proof (prove)
using this:
\<exists>h. bij_betw h {0..<Suc c} FF

goal (1 subgoal):
 1. (\<And>f. bij_betw f {0..<Suc c} FF \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
bij_betw f {0..<Suc c} FF

goal (1 subgoal):
 1. \<exists>S\<subseteq>F. sunflower S \<and> card S = r
[PROOF STEP]
hence injf: "inj_on f ?N"
[PROOF STATE]
proof (prove)
using this:
bij_betw f {0..<Suc c} FF

goal (1 subgoal):
 1. inj_on f {0..<Suc c}
[PROOF STEP]
by (rule bij_betw_imp_inj_on)
[PROOF STATE]
proof (state)
this:
inj_on f {0..<Suc c}

goal (1 subgoal):
 1. \<exists>S\<subseteq>F. sunflower S \<and> card S = r
[PROOF STEP]
have Ff: "FF = f ` ?N"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. FF = f ` {0..<Suc c}
[PROOF STEP]
by (metis bij_betw_imp_surj_on f)
[PROOF STATE]
proof (state)
this:
FF = f ` {0..<Suc c}

goal (1 subgoal):
 1. \<exists>S\<subseteq>F. sunflower S \<and> card S = r
[PROOF STEP]
define g where "g = (\<lambda> i. (Inl ` f i) \<union> (Inr ` {0 ..< (k - card (f i))}))"
[PROOF STATE]
proof (state)
this:
g = (\<lambda>i. Inl ` f i \<union> Inr ` {0..<k - card (f i)})

goal (1 subgoal):
 1. \<exists>S\<subseteq>F. sunflower S \<and> card S = r
[PROOF STEP]
have injg: "inj_on g ?N"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on g {0..<Suc c}
[PROOF STEP]
unfolding g_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on (\<lambda>i. Inl ` f i \<union> Inr ` {0..<k - card (f i)}) {0..<Suc c}
[PROOF STEP]
using f
[PROOF STATE]
proof (prove)
using this:
bij_betw f {0..<Suc c} FF

goal (1 subgoal):
 1. inj_on (\<lambda>i. Inl ` f i \<union> Inr ` {0..<k - card (f i)}) {0..<Suc c}
[PROOF STEP]
proof (intro inj_onI, goal_cases)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x y. \<lbrakk>bij_betw f {0..<Suc c} FF; x \<in> {0..<Suc c}; y \<in> {0..<Suc c}; Inl ` f x \<union> Inr ` {0..<k - card (f x)} = Inl ` f y \<union> Inr ` {0..<k - card (f y)}\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
case (1 x y)
[PROOF STATE]
proof (state)
this:
bij_betw f {0..<Suc c} FF
x \<in> {0..<Suc c}
y \<in> {0..<Suc c}
Inl ` f x \<union> Inr ` {0..<k - card (f x)} = Inl ` f y \<union> Inr ` {0..<k - card (f y)}

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>bij_betw f {0..<Suc c} FF; x \<in> {0..<Suc c}; y \<in> {0..<Suc c}; Inl ` f x \<union> Inr ` {0..<k - card (f x)} = Inl ` f y \<union> Inr ` {0..<k - card (f y)}\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
hence "f x = f y"
[PROOF STATE]
proof (prove)
using this:
bij_betw f {0..<Suc c} FF
x \<in> {0..<Suc c}
y \<in> {0..<Suc c}
Inl ` f x \<union> Inr ` {0..<k - card (f x)} = Inl ` f y \<union> Inr ` {0..<k - card (f y)}

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

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>bij_betw f {0..<Suc c} FF; x \<in> {0..<Suc c}; y \<in> {0..<Suc c}; Inl ` f x \<union> Inr ` {0..<k - card (f x)} = Inl ` f y \<union> Inr ` {0..<k - card (f y)}\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
with injf 1
[PROOF STATE]
proof (chain)
picking this:
inj_on f {0..<Suc c}
bij_betw f {0..<Suc c} FF
x \<in> {0..<Suc c}
y \<in> {0..<Suc c}
Inl ` f x \<union> Inr ` {0..<k - card (f x)} = Inl ` f y \<union> Inr ` {0..<k - card (f y)}
f x = f y
[PROOF STEP]
show "x = y"
[PROOF STATE]
proof (prove)
using this:
inj_on f {0..<Suc c}
bij_betw f {0..<Suc c} FF
x \<in> {0..<Suc c}
y \<in> {0..<Suc c}
Inl ` f x \<union> Inr ` {0..<k - card (f x)} = Inl ` f y \<union> Inr ` {0..<k - card (f y)}
f x = f y

goal (1 subgoal):
 1. x = y
[PROOF STEP]
by (meson inj_onD)
[PROOF STATE]
proof (state)
this:
x = y

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
inj_on g {0..<Suc c}

goal (1 subgoal):
 1. \<exists>S\<subseteq>F. sunflower S \<and> card S = r
[PROOF STEP]
hence cardgN: "card (g ` ?N) > c"
[PROOF STATE]
proof (prove)
using this:
inj_on g {0..<Suc c}

goal (1 subgoal):
 1. c < card (g ` {0..<Suc c})
[PROOF STEP]
by (simp add: card_image)
[PROOF STATE]
proof (state)
this:
c < card (g ` {0..<Suc c})

goal (1 subgoal):
 1. \<exists>S\<subseteq>F. sunflower S \<and> card S = r
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
c < card (g ` {0..<Suc c})

goal (1 subgoal):
 1. \<exists>S\<subseteq>F. sunflower S \<and> card S = r
[PROOF STEP]
fix i
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>S\<subseteq>F. sunflower S \<and> card S = r
[PROOF STEP]
assume "i \<in> ?N"
[PROOF STATE]
proof (state)
this:
i \<in> {0..<Suc c}

goal (1 subgoal):
 1. \<exists>S\<subseteq>F. sunflower S \<and> card S = r
[PROOF STEP]
hence "f i \<in> FF"
[PROOF STATE]
proof (prove)
using this:
i \<in> {0..<Suc c}

goal (1 subgoal):
 1. f i \<in> FF
[PROOF STEP]
unfolding Ff
[PROOF STATE]
proof (prove)
using this:
i \<in> {0..<Suc c}

goal (1 subgoal):
 1. f i \<in> f ` {0..<Suc c}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
f i \<in> FF

goal (1 subgoal):
 1. \<exists>S\<subseteq>F. sunflower S \<and> card S = r
[PROOF STEP]
with sub
[PROOF STATE]
proof (chain)
picking this:
FF \<subseteq> F
f i \<in> FF
[PROOF STEP]
have "f i \<in> F"
[PROOF STATE]
proof (prove)
using this:
FF \<subseteq> F
f i \<in> FF

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

goal (1 subgoal):
 1. \<exists>S\<subseteq>F. sunflower S \<and> card S = r
[PROOF STEP]
hence "card (f i) \<le> k" "finite (f i)"
[PROOF STATE]
proof (prove)
using this:
f i \<in> F

goal (1 subgoal):
 1. card (f i) \<le> k &&& finite (f i)
[PROOF STEP]
using kF
[PROOF STATE]
proof (prove)
using this:
f i \<in> F
\<forall>A\<in>F. finite A \<and> card A \<le> k

goal (1 subgoal):
 1. card (f i) \<le> k &&& finite (f i)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
card (f i) \<le> k
finite (f i)

goal (1 subgoal):
 1. \<exists>S\<subseteq>F. sunflower S \<and> card S = r
[PROOF STEP]
hence "card (g i) = k \<and> finite (g i)"
[PROOF STATE]
proof (prove)
using this:
card (f i) \<le> k
finite (f i)

goal (1 subgoal):
 1. card (g i) = k \<and> finite (g i)
[PROOF STEP]
unfolding g_def
[PROOF STATE]
proof (prove)
using this:
card (f i) \<le> k
finite (f i)

goal (1 subgoal):
 1. card (Inl ` f i \<union> Inr ` {0..<k - card (f i)}) = k \<and> finite (Inl ` f i \<union> Inr ` {0..<k - card (f i)})
[PROOF STEP]
by (subst card_Un_disjoint, auto, subst (1 2) card_image, auto intro: inj_onI)
[PROOF STATE]
proof (state)
this:
card (g i) = k \<and> finite (g i)

goal (1 subgoal):
 1. \<exists>S\<subseteq>F. sunflower S \<and> card S = r
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
?i2 \<in> {0..<Suc c} \<Longrightarrow> card (g ?i2) = k \<and> finite (g ?i2)

goal (1 subgoal):
 1. \<exists>S\<subseteq>F. sunflower S \<and> card S = r
[PROOF STEP]
hence "\<forall> A \<in> g ` ?N. finite A \<and> card A = k"
[PROOF STATE]
proof (prove)
using this:
?i2 \<in> {0..<Suc c} \<Longrightarrow> card (g ?i2) = k \<and> finite (g ?i2)

goal (1 subgoal):
 1. \<forall>A\<in>g ` {0..<Suc c}. finite A \<and> card A = k
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>A\<in>g ` {0..<Suc c}. finite A \<and> card A = k

goal (1 subgoal):
 1. \<exists>S\<subseteq>F. sunflower S \<and> card S = r
[PROOF STEP]
from sunflower[OF this cardgN]
[PROOF STATE]
proof (chain)
picking this:
\<exists>S\<subseteq>g ` {0..<Suc c}. sunflower S \<and> card S = r
[PROOF STEP]
obtain S where SgN: "S \<subseteq> g ` ?N" and sf: "sunflower S" and card: "card S = r"
[PROOF STATE]
proof (prove)
using this:
\<exists>S\<subseteq>g ` {0..<Suc c}. sunflower S \<and> card S = r

goal (1 subgoal):
 1. (\<And>S. \<lbrakk>S \<subseteq> g ` {0..<Suc c}; sunflower S; card S = r\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
S \<subseteq> g ` {0..<Suc c}
sunflower S
card S = r

goal (1 subgoal):
 1. \<exists>S\<subseteq>F. sunflower S \<and> card S = r
[PROOF STEP]
from SgN
[PROOF STATE]
proof (chain)
picking this:
S \<subseteq> g ` {0..<Suc c}
[PROOF STEP]
obtain N where NN: "N \<subseteq> ?N" and SgN: "S = g ` N"
[PROOF STATE]
proof (prove)
using this:
S \<subseteq> g ` {0..<Suc c}

goal (1 subgoal):
 1. (\<And>N. \<lbrakk>N \<subseteq> {0..<Suc c}; S = g ` N\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (meson subset_image_iff)
[PROOF STATE]
proof (state)
this:
N \<subseteq> {0..<Suc c}
S = g ` N

goal (1 subgoal):
 1. \<exists>S\<subseteq>F. sunflower S \<and> card S = r
[PROOF STEP]
from injg NN
[PROOF STATE]
proof (chain)
picking this:
inj_on g {0..<Suc c}
N \<subseteq> {0..<Suc c}
[PROOF STEP]
have inj_g: "inj_on g N"
[PROOF STATE]
proof (prove)
using this:
inj_on g {0..<Suc c}
N \<subseteq> {0..<Suc c}

goal (1 subgoal):
 1. inj_on g N
[PROOF STEP]
by (rule inj_on_subset)
[PROOF STATE]
proof (state)
this:
inj_on g N

goal (1 subgoal):
 1. \<exists>S\<subseteq>F. sunflower S \<and> card S = r
[PROOF STEP]
from injf NN
[PROOF STATE]
proof (chain)
picking this:
inj_on f {0..<Suc c}
N \<subseteq> {0..<Suc c}
[PROOF STEP]
have inj_f: "inj_on f N"
[PROOF STATE]
proof (prove)
using this:
inj_on f {0..<Suc c}
N \<subseteq> {0..<Suc c}

goal (1 subgoal):
 1. inj_on f N
[PROOF STEP]
by (rule inj_on_subset)
[PROOF STATE]
proof (state)
this:
inj_on f N

goal (1 subgoal):
 1. \<exists>S\<subseteq>F. sunflower S \<and> card S = r
[PROOF STEP]
from card_image[OF inj_g] SgN card
[PROOF STATE]
proof (chain)
picking this:
card (g ` N) = card N
S = g ` N
card S = r
[PROOF STEP]
have cardN: "card N = r"
[PROOF STATE]
proof (prove)
using this:
card (g ` N) = card N
S = g ` N
card S = r

goal (1 subgoal):
 1. card N = r
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
card N = r

goal (1 subgoal):
 1. \<exists>S\<subseteq>F. sunflower S \<and> card S = r
[PROOF STEP]
let ?S = "f ` N"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>S\<subseteq>F. sunflower S \<and> card S = r
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>S\<subseteq>F. sunflower S \<and> card S = r
[PROOF STEP]
proof (intro exI[of _ ?S] conjI)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. f ` N \<subseteq> F
 2. sunflower (f ` N)
 3. card (f ` N) = r
[PROOF STEP]
from NN
[PROOF STATE]
proof (chain)
picking this:
N \<subseteq> {0..<Suc c}
[PROOF STEP]
show "?S \<subseteq> F"
[PROOF STATE]
proof (prove)
using this:
N \<subseteq> {0..<Suc c}

goal (1 subgoal):
 1. f ` N \<subseteq> F
[PROOF STEP]
using Ff sub
[PROOF STATE]
proof (prove)
using this:
N \<subseteq> {0..<Suc c}
FF = f ` {0..<Suc c}
FF \<subseteq> F

goal (1 subgoal):
 1. f ` N \<subseteq> F
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
f ` N \<subseteq> F

goal (2 subgoals):
 1. sunflower (f ` N)
 2. card (f ` N) = r
[PROOF STEP]
from card_image[OF inj_f] cardN
[PROOF STATE]
proof (chain)
picking this:
card (f ` N) = card N
card N = r
[PROOF STEP]
show "card ?S = r"
[PROOF STATE]
proof (prove)
using this:
card (f ` N) = card N
card N = r

goal (1 subgoal):
 1. card (f ` N) = r
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
card (f ` N) = r

goal (1 subgoal):
 1. sunflower (f ` N)
[PROOF STEP]
show "sunflower ?S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sunflower (f ` N)
[PROOF STEP]
unfolding sunflower_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x. (\<exists>A B. A \<in> f ` N \<and> B \<in> f ` N \<and> A \<noteq> B \<and> x \<in> A \<and> x \<in> B) \<longrightarrow> (\<forall>A. A \<in> f ` N \<longrightarrow> x \<in> A)
[PROOF STEP]
proof (intro allI impI, elim exE conjE, goal_cases)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x A Aa B. \<lbrakk>A \<in> f ` N; Aa \<in> f ` N; B \<in> f ` N; Aa \<noteq> B; x \<in> Aa; x \<in> B\<rbrakk> \<Longrightarrow> x \<in> A
[PROOF STEP]
case (1 x C A B)
[PROOF STATE]
proof (state)
this:
C \<in> f ` N
A \<in> f ` N
B \<in> f ` N
A \<noteq> B
x \<in> A
x \<in> B

goal (1 subgoal):
 1. \<And>x A Aa B. \<lbrakk>A \<in> f ` N; Aa \<in> f ` N; B \<in> f ` N; Aa \<noteq> B; x \<in> Aa; x \<in> B\<rbrakk> \<Longrightarrow> x \<in> A
[PROOF STEP]
from \<open>A \<in> f ` N\<close>
[PROOF STATE]
proof (chain)
picking this:
A \<in> f ` N
[PROOF STEP]
obtain i where i: "i \<in> N" and A: "A = f i"
[PROOF STATE]
proof (prove)
using this:
A \<in> f ` N

goal (1 subgoal):
 1. (\<And>i. \<lbrakk>i \<in> N; A = f i\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
i \<in> N
A = f i

goal (1 subgoal):
 1. \<And>x A Aa B. \<lbrakk>A \<in> f ` N; Aa \<in> f ` N; B \<in> f ` N; Aa \<noteq> B; x \<in> Aa; x \<in> B\<rbrakk> \<Longrightarrow> x \<in> A
[PROOF STEP]
from \<open>B \<in> f ` N\<close>
[PROOF STATE]
proof (chain)
picking this:
B \<in> f ` N
[PROOF STEP]
obtain j where j: "j \<in> N" and B: "B = f j"
[PROOF STATE]
proof (prove)
using this:
B \<in> f ` N

goal (1 subgoal):
 1. (\<And>j. \<lbrakk>j \<in> N; B = f j\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
j \<in> N
B = f j

goal (1 subgoal):
 1. \<And>x A Aa B. \<lbrakk>A \<in> f ` N; Aa \<in> f ` N; B \<in> f ` N; Aa \<noteq> B; x \<in> Aa; x \<in> B\<rbrakk> \<Longrightarrow> x \<in> A
[PROOF STEP]
from \<open>C \<in> f ` N\<close>
[PROOF STATE]
proof (chain)
picking this:
C \<in> f ` N
[PROOF STEP]
obtain k where k: "k \<in> N" and C: "C = f k"
[PROOF STATE]
proof (prove)
using this:
C \<in> f ` N

goal (1 subgoal):
 1. (\<And>k. \<lbrakk>k \<in> N; C = f k\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
k \<in> N
C = f k

goal (1 subgoal):
 1. \<And>x A Aa B. \<lbrakk>A \<in> f ` N; Aa \<in> f ` N; B \<in> f ` N; Aa \<noteq> B; x \<in> Aa; x \<in> B\<rbrakk> \<Longrightarrow> x \<in> A
[PROOF STEP]
hence gk: "g k \<in> g ` N"
[PROOF STATE]
proof (prove)
using this:
k \<in> N
C = f k

goal (1 subgoal):
 1. g k \<in> g ` N
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
g k \<in> g ` N

goal (1 subgoal):
 1. \<And>x A Aa B. \<lbrakk>A \<in> f ` N; Aa \<in> f ` N; B \<in> f ` N; Aa \<noteq> B; x \<in> Aa; x \<in> B\<rbrakk> \<Longrightarrow> x \<in> A
[PROOF STEP]
from \<open>A \<noteq> B\<close> A B
[PROOF STATE]
proof (chain)
picking this:
A \<noteq> B
A = f i
B = f j
[PROOF STEP]
have ij: "i \<noteq> j"
[PROOF STATE]
proof (prove)
using this:
A \<noteq> B
A = f i
B = f j

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

goal (1 subgoal):
 1. \<And>x A Aa B. \<lbrakk>A \<in> f ` N; Aa \<in> f ` N; B \<in> f ` N; Aa \<noteq> B; x \<in> Aa; x \<in> B\<rbrakk> \<Longrightarrow> x \<in> A
[PROOF STEP]
from inj_g ij i j
[PROOF STATE]
proof (chain)
picking this:
inj_on g N
i \<noteq> j
i \<in> N
j \<in> N
[PROOF STEP]
have gij: "g i \<noteq> g j"
[PROOF STATE]
proof (prove)
using this:
inj_on g N
i \<noteq> j
i \<in> N
j \<in> N

goal (1 subgoal):
 1. g i \<noteq> g j
[PROOF STEP]
by (metis inj_on_contraD)
[PROOF STATE]
proof (state)
this:
g i \<noteq> g j

goal (1 subgoal):
 1. \<And>x A Aa B. \<lbrakk>A \<in> f ` N; Aa \<in> f ` N; B \<in> f ` N; Aa \<noteq> B; x \<in> Aa; x \<in> B\<rbrakk> \<Longrightarrow> x \<in> A
[PROOF STEP]
from \<open>x \<in> A\<close>
[PROOF STATE]
proof (chain)
picking this:
x \<in> A
[PROOF STEP]
have memi: "Inl x \<in> g i"
[PROOF STATE]
proof (prove)
using this:
x \<in> A

goal (1 subgoal):
 1. Inl x \<in> g i
[PROOF STEP]
unfolding A g_def
[PROOF STATE]
proof (prove)
using this:
x \<in> f i

goal (1 subgoal):
 1. Inl x \<in> Inl ` f i \<union> Inr ` {0..<k - card (f i)}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Inl x \<in> g i

goal (1 subgoal):
 1. \<And>x A Aa B. \<lbrakk>A \<in> f ` N; Aa \<in> f ` N; B \<in> f ` N; Aa \<noteq> B; x \<in> Aa; x \<in> B\<rbrakk> \<Longrightarrow> x \<in> A
[PROOF STEP]
from \<open>x \<in> B\<close>
[PROOF STATE]
proof (chain)
picking this:
x \<in> B
[PROOF STEP]
have memj: "Inl x \<in> g j"
[PROOF STATE]
proof (prove)
using this:
x \<in> B

goal (1 subgoal):
 1. Inl x \<in> g j
[PROOF STEP]
unfolding B g_def
[PROOF STATE]
proof (prove)
using this:
x \<in> f j

goal (1 subgoal):
 1. Inl x \<in> Inl ` f j \<union> Inr ` {0..<k - card (f j)}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Inl x \<in> g j

goal (1 subgoal):
 1. \<And>x A Aa B. \<lbrakk>A \<in> f ` N; Aa \<in> f ` N; B \<in> f ` N; Aa \<noteq> B; x \<in> Aa; x \<in> B\<rbrakk> \<Longrightarrow> x \<in> A
[PROOF STEP]
have "\<exists>A B. A \<in> g ` N \<and> B \<in> g ` N \<and> A \<noteq> B \<and> Inl x \<in> A \<and> Inl x \<in> B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>A B. A \<in> g ` N \<and> B \<in> g ` N \<and> A \<noteq> B \<and> Inl x \<in> A \<and> Inl x \<in> B
[PROOF STEP]
using memi memj gij i j
[PROOF STATE]
proof (prove)
using this:
Inl x \<in> g i
Inl x \<in> g j
g i \<noteq> g j
i \<in> N
j \<in> N

goal (1 subgoal):
 1. \<exists>A B. A \<in> g ` N \<and> B \<in> g ` N \<and> A \<noteq> B \<and> Inl x \<in> A \<and> Inl x \<in> B
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>A B. A \<in> g ` N \<and> B \<in> g ` N \<and> A \<noteq> B \<and> Inl x \<in> A \<and> Inl x \<in> B

goal (1 subgoal):
 1. \<And>x A Aa B. \<lbrakk>A \<in> f ` N; Aa \<in> f ` N; B \<in> f ` N; Aa \<noteq> B; x \<in> Aa; x \<in> B\<rbrakk> \<Longrightarrow> x \<in> A
[PROOF STEP]
from sf[unfolded sunflower_def SgN, rule_format, OF this gk]
[PROOF STATE]
proof (chain)
picking this:
Inl x \<in> g k
[PROOF STEP]
have "Inl x \<in> g k"
[PROOF STATE]
proof (prove)
using this:
Inl x \<in> g k

goal (1 subgoal):
 1. Inl x \<in> g k
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
Inl x \<in> g k

goal (1 subgoal):
 1. \<And>x A Aa B. \<lbrakk>A \<in> f ` N; Aa \<in> f ` N; B \<in> f ` N; Aa \<noteq> B; x \<in> Aa; x \<in> B\<rbrakk> \<Longrightarrow> x \<in> A
[PROOF STEP]
thus "x \<in> C"
[PROOF STATE]
proof (prove)
using this:
Inl x \<in> g k

goal (1 subgoal):
 1. x \<in> C
[PROOF STEP]
unfolding C g_def
[PROOF STATE]
proof (prove)
using this:
Inl x \<in> Inl ` f k \<union> Inr ` {0..<k - card (f k)}

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
sunflower (f ` N)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<exists>S\<subseteq>F. sunflower S \<and> card S = r

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma order_reflect_poly:
  fixes c :: "'a :: field"
  assumes "c \<noteq> 0" and "coeff p 0 \<noteq> 0"
  shows   "order c (reflect_poly p) = order (1 / c) p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. order c (reflect_poly p) = order ((1::'a) / c) p
[PROOF STEP]
proof (rule antisym)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. order c (reflect_poly p) \<le> order ((1::'a) / c) p
 2. order ((1::'a) / c) p \<le> order c (reflect_poly p)
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
c \<noteq> (0::'a)
constant_term p \<noteq> (0::'a)
[PROOF STEP]
show "order c (reflect_poly p) \<ge> order (1 / c) p"
[PROOF STATE]
proof (prove)
using this:
c \<noteq> (0::'a)
constant_term p \<noteq> (0::'a)

goal (1 subgoal):
 1. order ((1::'a) / c) p \<le> order c (reflect_poly p)
[PROOF STEP]
by (intro order_reflect_poly_ge) auto
[PROOF STATE]
proof (state)
this:
order ((1::'a) / c) p \<le> order c (reflect_poly p)

goal (1 subgoal):
 1. order c (reflect_poly p) \<le> order ((1::'a) / c) p
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. order c (reflect_poly p) \<le> order ((1::'a) / c) p
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
c \<noteq> (0::'a)
constant_term p \<noteq> (0::'a)
[PROOF STEP]
have "order (1 / (1 / c)) (reflect_poly p) \<le>
                     order (1 / c) (reflect_poly (reflect_poly p))"
[PROOF STATE]
proof (prove)
using this:
c \<noteq> (0::'a)
constant_term p \<noteq> (0::'a)

goal (1 subgoal):
 1. order ((1::'a) / ((1::'a) / c)) (reflect_poly p) \<le> order ((1::'a) / c) (reflect_poly (reflect_poly p))
[PROOF STEP]
by (intro order_reflect_poly_ge) auto
[PROOF STATE]
proof (state)
this:
order ((1::'a) / ((1::'a) / c)) (reflect_poly p) \<le> order ((1::'a) / c) (reflect_poly (reflect_poly p))

goal (1 subgoal):
 1. order c (reflect_poly p) \<le> order ((1::'a) / c) p
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
c \<noteq> (0::'a)
constant_term p \<noteq> (0::'a)
order ((1::'a) / ((1::'a) / c)) (reflect_poly p) \<le> order ((1::'a) / c) (reflect_poly (reflect_poly p))
[PROOF STEP]
show "order c (reflect_poly p) \<le> order (1 / c) p"
[PROOF STATE]
proof (prove)
using this:
c \<noteq> (0::'a)
constant_term p \<noteq> (0::'a)
order ((1::'a) / ((1::'a) / c)) (reflect_poly p) \<le> order ((1::'a) / c) (reflect_poly (reflect_poly p))

goal (1 subgoal):
 1. order c (reflect_poly p) \<le> order ((1::'a) / c) p
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
order c (reflect_poly p) \<le> order ((1::'a) / c) p

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma count_remove1:
  assumes "p partitions n"
  assumes "0 < p k"
  shows "(\<Sum>i\<le>n - k. (p(k := p k - 1)) i) = (\<Sum>i\<le>n. p i) - 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum (p(k := p k - 1)) {..n - k} = sum p {..n} - 1
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. sum (p(k := p k - 1)) {..n - k} = sum p {..n} - 1
[PROOF STEP]
have "k \<le> n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. k \<le> n
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
p partitions n
0 < p k

goal (1 subgoal):
 1. k \<le> n
[PROOF STEP]
by (auto elim: partitionsE)
[PROOF STATE]
proof (state)
this:
k \<le> n

goal (1 subgoal):
 1. sum (p(k := p k - 1)) {..n - k} = sum p {..n} - 1
[PROOF STEP]
have "(\<Sum>i\<le>n - k. (p(k := p k - 1)) i) = (\<Sum>i\<le>n. (p(k := p k - 1)) i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum (p(k := p k - 1)) {..n - k} = sum (p(k := p k - 1)) {..n}
[PROOF STEP]
using partitions_remove1_bounds assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?p partitions ?n; 0 < ?p ?k; (?p(?k := ?p ?k - 1)) ?i \<noteq> 0\<rbrakk> \<Longrightarrow> 1 \<le> ?i \<and> ?i \<le> ?n - ?k
p partitions n
0 < p k

goal (1 subgoal):
 1. sum (p(k := p k - 1)) {..n - k} = sum (p(k := p k - 1)) {..n}
[PROOF STEP]
by (auto intro!: sum.mono_neutral_left)
[PROOF STATE]
proof (state)
this:
sum (p(k := p k - 1)) {..n - k} = sum (p(k := p k - 1)) {..n}

goal (1 subgoal):
 1. sum (p(k := p k - 1)) {..n - k} = sum p {..n} - 1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
sum (p(k := p k - 1)) {..n - k} = sum (p(k := p k - 1)) {..n}

goal (1 subgoal):
 1. sum (p(k := p k - 1)) {..n - k} = sum p {..n} - 1
[PROOF STEP]
have "(\<Sum>i\<le>n. (p(k := p k - 1)) i) = p k + (\<Sum>i\<in>{..n} - {k}. p i) - 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum (p(k := p k - 1)) {..n} = p k + sum p ({..n} - {k}) - 1
[PROOF STEP]
using \<open>0 < p k\<close> \<open>k \<le> n\<close>
[PROOF STATE]
proof (prove)
using this:
0 < p k
k \<le> n

goal (1 subgoal):
 1. sum (p(k := p k - 1)) {..n} = p k + sum p ({..n} - {k}) - 1
[PROOF STEP]
by (simp add: sum_atMost_remove_nat[of k])
[PROOF STATE]
proof (state)
this:
sum (p(k := p k - 1)) {..n} = p k + sum p ({..n} - {k}) - 1

goal (1 subgoal):
 1. sum (p(k := p k - 1)) {..n - k} = sum p {..n} - 1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
sum (p(k := p k - 1)) {..n} = p k + sum p ({..n} - {k}) - 1

goal (1 subgoal):
 1. sum (p(k := p k - 1)) {..n - k} = sum p {..n} - 1
[PROOF STEP]
have "... = (\<Sum>i\<in>{..n}. p i) - 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p k + sum p ({..n} - {k}) - 1 = sum p {..n} - 1
[PROOF STEP]
using \<open>k \<le> n\<close>
[PROOF STATE]
proof (prove)
using this:
k \<le> n

goal (1 subgoal):
 1. p k + sum p ({..n} - {k}) - 1 = sum p {..n} - 1
[PROOF STEP]
by (simp add: sum_atMost_remove_nat[of k])
[PROOF STATE]
proof (state)
this:
p k + sum p ({..n} - {k}) - 1 = sum p {..n} - 1

goal (1 subgoal):
 1. sum (p(k := p k - 1)) {..n - k} = sum p {..n} - 1
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
sum (p(k := p k - 1)) {..n - k} = sum p {..n} - 1
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
sum (p(k := p k - 1)) {..n - k} = sum p {..n} - 1

goal (1 subgoal):
 1. sum (p(k := p k - 1)) {..n - k} = sum p {..n} - 1
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
sum (p(k := p k - 1)) {..n - k} = sum p {..n} - 1

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma card_of_UNION_Sigma2:
assumes
"!! i j. \<lbrakk>{i,j} <= I; i ~= j\<rbrakk> \<Longrightarrow> A i Int A j = {}"
shows
"|\<Union>i\<in>I. A i| =o |Sigma I A|"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. |\<Union> (A ` I)| =o |Sigma I A|
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. |\<Union> (A ` I)| =o |Sigma I A|
[PROOF STEP]
let ?L = "\<Union>i\<in>I. A i"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. |\<Union> (A ` I)| =o |Sigma I A|
[PROOF STEP]
let ?R = "Sigma I A"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. |\<Union> (A ` I)| =o |Sigma I A|
[PROOF STEP]
have "|?L| <=o |?R|"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. |\<Union> (A ` I)| \<le>o |Sigma I A|
[PROOF STEP]
using card_of_UNION_Sigma
[PROOF STATE]
proof (prove)
using this:
|\<Union> (?A ` ?I)| \<le>o |Sigma ?I ?A|

goal (1 subgoal):
 1. |\<Union> (A ` I)| \<le>o |Sigma I A|
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
|\<Union> (A ` I)| \<le>o |Sigma I A|

goal (1 subgoal):
 1. |\<Union> (A ` I)| =o |Sigma I A|
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
|\<Union> (A ` I)| \<le>o |Sigma I A|

goal (1 subgoal):
 1. |\<Union> (A ` I)| =o |Sigma I A|
[PROOF STEP]
have "|?R| <=o |?L|"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. |Sigma I A| \<le>o |\<Union> (A ` I)|
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. |Sigma I A| \<le>o |\<Union> (A ` I)|
[PROOF STEP]
have "inj_on snd ?R"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on snd (Sigma I A)
[PROOF STEP]
unfolding inj_on_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>Sigma I A. \<forall>y\<in>Sigma I A. snd x = snd y \<longrightarrow> x = y
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>{?i, ?j} \<subseteq> I; ?i \<noteq> ?j\<rbrakk> \<Longrightarrow> A ?i \<inter> A ?j = {}

goal (1 subgoal):
 1. \<forall>x\<in>Sigma I A. \<forall>y\<in>Sigma I A. snd x = snd y \<longrightarrow> x = y
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
inj_on snd (Sigma I A)

goal (1 subgoal):
 1. |Sigma I A| \<le>o |\<Union> (A ` I)|
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
inj_on snd (Sigma I A)

goal (1 subgoal):
 1. |Sigma I A| \<le>o |\<Union> (A ` I)|
[PROOF STEP]
have "snd ` ?R <= ?L"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. snd ` Sigma I A \<subseteq> \<Union> (A ` I)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
snd ` Sigma I A \<subseteq> \<Union> (A ` I)

goal (1 subgoal):
 1. |Sigma I A| \<le>o |\<Union> (A ` I)|
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
inj_on snd (Sigma I A)
snd ` Sigma I A \<subseteq> \<Union> (A ` I)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
inj_on snd (Sigma I A)
snd ` Sigma I A \<subseteq> \<Union> (A ` I)

goal (1 subgoal):
 1. |Sigma I A| \<le>o |\<Union> (A ` I)|
[PROOF STEP]
using card_of_ordLeq
[PROOF STATE]
proof (prove)
using this:
inj_on snd (Sigma I A)
snd ` Sigma I A \<subseteq> \<Union> (A ` I)
(\<exists>f. inj_on f ?A \<and> f ` ?A \<subseteq> ?B) = (|?A| \<le>o |?B|)

goal (1 subgoal):
 1. |Sigma I A| \<le>o |\<Union> (A ` I)|
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
|Sigma I A| \<le>o |\<Union> (A ` I)|

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
|Sigma I A| \<le>o |\<Union> (A ` I)|

goal (1 subgoal):
 1. |\<Union> (A ` I)| =o |Sigma I A|
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
|\<Union> (A ` I)| \<le>o |Sigma I A|
|Sigma I A| \<le>o |\<Union> (A ` I)|
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
|\<Union> (A ` I)| \<le>o |Sigma I A|
|Sigma I A| \<le>o |\<Union> (A ` I)|

goal (1 subgoal):
 1. |\<Union> (A ` I)| =o |Sigma I A|
[PROOF STEP]
by(simp add: ordIso_iff_ordLeq)
[PROOF STATE]
proof (state)
this:
|\<Union> (A ` I)| =o |Sigma I A|

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma DJ: assumes fdj: "\<forall> p q. f (Or p q) = Or (f p) (f q)"
  and fF: "f F = F"
  shows "Ifm bs (DJ f p) = Ifm bs (f p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Ifm bs (DJ f p) = Ifm bs (f p)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Ifm bs (DJ f p) = Ifm bs (f p)
[PROOF STEP]
have "Ifm bs (DJ f p) = (\<exists> q \<in> set (disjuncts p). Ifm bs (f q))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Ifm bs (DJ f p) = (\<exists>q\<in>set (disjuncts p). Ifm bs (f q))
[PROOF STEP]
by (simp add: DJ_def evaldjf_ex)
[PROOF STATE]
proof (state)
this:
Ifm bs (DJ f p) = (\<exists>q\<in>set (disjuncts p). Ifm bs (f q))

goal (1 subgoal):
 1. Ifm bs (DJ f p) = Ifm bs (f p)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
Ifm bs (DJ f p) = (\<exists>q\<in>set (disjuncts p). Ifm bs (f q))

goal (1 subgoal):
 1. Ifm bs (DJ f p) = Ifm bs (f p)
[PROOF STEP]
have "\<dots> = Ifm bs (f p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>q\<in>set (disjuncts p). Ifm bs (f q)) = Ifm bs (f p)
[PROOF STEP]
using fdj fF
[PROOF STATE]
proof (prove)
using this:
\<forall>p q. f (Or p q) = Or (f p) (f q)
f F = F

goal (1 subgoal):
 1. (\<exists>q\<in>set (disjuncts p). Ifm bs (f q)) = Ifm bs (f p)
[PROOF STEP]
by (induct p rule: disjuncts.induct, auto)
[PROOF STATE]
proof (state)
this:
(\<exists>q\<in>set (disjuncts p). Ifm bs (f q)) = Ifm bs (f p)

goal (1 subgoal):
 1. Ifm bs (DJ f p) = Ifm bs (f p)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
Ifm bs (DJ f p) = Ifm bs (f p)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
Ifm bs (DJ f p) = Ifm bs (f p)

goal (1 subgoal):
 1. Ifm bs (DJ f p) = Ifm bs (f p)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
Ifm bs (DJ f p) = Ifm bs (f p)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma content_ff_normalize_content_ff_1: assumes p0: "p \<noteq> 0"
  shows "content_ff (normalize_content_ff p) =dff 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. content_ff (normalize_content_ff p) =dff 1
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. content_ff (normalize_content_ff p) =dff 1
[PROOF STEP]
have "content_ff p = content_ff (smult (content_ff p) (normalize_content_ff p))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. content_ff p = content_ff (smult (content_ff p) (normalize_content_ff p))
[PROOF STEP]
unfolding smult_normalize_content_ff
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. content_ff p = content_ff p
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
content_ff p = content_ff (smult (content_ff p) (normalize_content_ff p))

goal (1 subgoal):
 1. content_ff (normalize_content_ff p) =dff 1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
content_ff p = content_ff (smult (content_ff p) (normalize_content_ff p))

goal (1 subgoal):
 1. content_ff (normalize_content_ff p) =dff 1
[PROOF STEP]
have "\<dots> =dff content_ff p * content_ff (normalize_content_ff p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. content_ff (smult (content_ff p) (normalize_content_ff p)) =dff content_ff p * content_ff (normalize_content_ff p)
[PROOF STEP]
by (rule content_ff_smult)
[PROOF STATE]
proof (state)
this:
content_ff (smult (content_ff p) (normalize_content_ff p)) =dff content_ff p * content_ff (normalize_content_ff p)

goal (1 subgoal):
 1. content_ff (normalize_content_ff p) =dff 1
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
content_ff p =dff content_ff p * content_ff (normalize_content_ff p)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
content_ff p =dff content_ff p * content_ff (normalize_content_ff p)

goal (1 subgoal):
 1. content_ff (normalize_content_ff p) =dff 1
[PROOF STEP]
unfolding eq_dff_def divides_ff_def
[PROOF STATE]
proof (prove)
using this:
(\<exists>r. content_ff p * content_ff (normalize_content_ff p) = content_ff p * to_fract r) \<and> (\<exists>r. content_ff p = content_ff p * content_ff (normalize_content_ff p) * to_fract r)

goal (1 subgoal):
 1. (\<exists>r. 1 = content_ff (normalize_content_ff p) * to_fract r) \<and> (\<exists>r. content_ff (normalize_content_ff p) = 1 * to_fract r)
[PROOF STEP]
using p0
[PROOF STATE]
proof (prove)
using this:
(\<exists>r. content_ff p * content_ff (normalize_content_ff p) = content_ff p * to_fract r) \<and> (\<exists>r. content_ff p = content_ff p * content_ff (normalize_content_ff p) * to_fract r)
p \<noteq> 0

goal (1 subgoal):
 1. (\<exists>r. 1 = content_ff (normalize_content_ff p) * to_fract r) \<and> (\<exists>r. content_ff (normalize_content_ff p) = 1 * to_fract r)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
content_ff (normalize_content_ff p) =dff 1

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma bij_betw_open_intervals:
  fixes a b c d :: real
  assumes "a < b" "c < d"
  shows "\<exists>f. bij_betw f {a<..<b} {c<..<d}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>f. bij_betw f {a<..<b} {c<..<d}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>f. bij_betw f {a<..<b} {c<..<d}
[PROOF STEP]
define f where "f a b c d x = (d - c)/(b - a) * (x - a) + c" for a b c d x :: real
[PROOF STATE]
proof (state)
this:
f ?a ?b ?c ?d ?x = (?d - ?c) / (?b - ?a) * (?x - ?a) + ?c

goal (1 subgoal):
 1. \<exists>f. bij_betw f {a<..<b} {c<..<d}
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
f ?a ?b ?c ?d ?x = (?d - ?c) / (?b - ?a) * (?x - ?a) + ?c

goal (1 subgoal):
 1. \<exists>f. bij_betw f {a<..<b} {c<..<d}
[PROOF STEP]
fix a b c d x :: real
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>f. bij_betw f {a<..<b} {c<..<d}
[PROOF STEP]
assume *: "a < b" "c < d" "a < x" "x < b"
[PROOF STATE]
proof (state)
this:
a < b
c < d
a < x
x < b

goal (1 subgoal):
 1. \<exists>f. bij_betw f {a<..<b} {c<..<d}
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
a < b
c < d
a < x
x < b

goal (1 subgoal):
 1. \<exists>f. bij_betw f {a<..<b} {c<..<d}
[PROOF STEP]
from *
[PROOF STATE]
proof (chain)
picking this:
a < b
c < d
a < x
x < b
[PROOF STEP]
have "(d - c) * (x - a) < (d - c) * (b - a)"
[PROOF STATE]
proof (prove)
using this:
a < b
c < d
a < x
x < b

goal (1 subgoal):
 1. (d - c) * (x - a) < (d - c) * (b - a)
[PROOF STEP]
by (intro mult_strict_left_mono) simp_all
[PROOF STATE]
proof (state)
this:
(d - c) * (x - a) < (d - c) * (b - a)

goal (1 subgoal):
 1. \<exists>f. bij_betw f {a<..<b} {c<..<d}
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(d - c) * (x - a) < (d - c) * (b - a)

goal (1 subgoal):
 1. \<exists>f. bij_betw f {a<..<b} {c<..<d}
[PROOF STEP]
from *
[PROOF STATE]
proof (chain)
picking this:
a < b
c < d
a < x
x < b
[PROOF STEP]
have "0 < (d - c) * (x - a) / (b - a)"
[PROOF STATE]
proof (prove)
using this:
a < b
c < d
a < x
x < b

goal (1 subgoal):
 1. 0 < (d - c) * (x - a) / (b - a)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
0 < (d - c) * (x - a) / (b - a)

goal (1 subgoal):
 1. \<exists>f. bij_betw f {a<..<b} {c<..<d}
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
a < b
c < d
a < x
x < b
(d - c) * (x - a) < (d - c) * (b - a)
0 < (d - c) * (x - a) / (b - a)
[PROOF STEP]
have "f a b c d x < d" "c < f a b c d x"
[PROOF STATE]
proof (prove)
using this:
a < b
c < d
a < x
x < b
(d - c) * (x - a) < (d - c) * (b - a)
0 < (d - c) * (x - a) / (b - a)

goal (1 subgoal):
 1. f a b c d x < d &&& c < f a b c d x
[PROOF STEP]
by (simp_all add: f_def field_simps)
[PROOF STATE]
proof (state)
this:
f a b c d x < d
c < f a b c d x

goal (1 subgoal):
 1. \<exists>f. bij_betw f {a<..<b} {c<..<d}
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
\<lbrakk>?aa2 < ?ba2; ?ca2 < ?da2; ?aa2 < ?x2; ?x2 < ?ba2\<rbrakk> \<Longrightarrow> f ?aa2 ?ba2 ?ca2 ?da2 ?x2 < ?da2
\<lbrakk>?aa2 < ?ba2; ?ca2 < ?da2; ?aa2 < ?x2; ?x2 < ?ba2\<rbrakk> \<Longrightarrow> ?ca2 < f ?aa2 ?ba2 ?ca2 ?da2 ?x2

goal (1 subgoal):
 1. \<exists>f. bij_betw f {a<..<b} {c<..<d}
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
a < b
c < d
\<lbrakk>?aa2 < ?ba2; ?ca2 < ?da2; ?aa2 < ?x2; ?x2 < ?ba2\<rbrakk> \<Longrightarrow> f ?aa2 ?ba2 ?ca2 ?da2 ?x2 < ?da2
\<lbrakk>?aa2 < ?ba2; ?ca2 < ?da2; ?aa2 < ?x2; ?x2 < ?ba2\<rbrakk> \<Longrightarrow> ?ca2 < f ?aa2 ?ba2 ?ca2 ?da2 ?x2
[PROOF STEP]
have "bij_betw (f a b c d) {a<..<b} {c<..<d}"
[PROOF STATE]
proof (prove)
using this:
a < b
c < d
\<lbrakk>?aa2 < ?ba2; ?ca2 < ?da2; ?aa2 < ?x2; ?x2 < ?ba2\<rbrakk> \<Longrightarrow> f ?aa2 ?ba2 ?ca2 ?da2 ?x2 < ?da2
\<lbrakk>?aa2 < ?ba2; ?ca2 < ?da2; ?aa2 < ?x2; ?x2 < ?ba2\<rbrakk> \<Longrightarrow> ?ca2 < f ?aa2 ?ba2 ?ca2 ?da2 ?x2

goal (1 subgoal):
 1. bij_betw (f a b c d) {a<..<b} {c<..<d}
[PROOF STEP]
by (intro bij_betw_byWitness[where f'="f c d a b"]) (auto simp: f_def)
[PROOF STATE]
proof (state)
this:
bij_betw (f a b c d) {a<..<b} {c<..<d}

goal (1 subgoal):
 1. \<exists>f. bij_betw f {a<..<b} {c<..<d}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
bij_betw (f a b c d) {a<..<b} {c<..<d}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
bij_betw (f a b c d) {a<..<b} {c<..<d}

goal (1 subgoal):
 1. \<exists>f. bij_betw f {a<..<b} {c<..<d}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>f. bij_betw f {a<..<b} {c<..<d}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma enum_idx_enum:
  assumes \<open>i < CARD('a::enum)\<close>
  shows \<open>enum_idx (enum_class.enum ! i :: 'a) = i\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. enum_idx (enum_class.enum ! i) = i
[PROOF STEP]
unfolding enum_idx_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. index_of (enum_class.enum ! i) enum_class.enum = i
[PROOF STEP]
apply (rule index_of_nth)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. distinct enum_class.enum
 2. i < length enum_class.enum
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
i < CARD('a)

goal (2 subgoals):
 1. distinct enum_class.enum
 2. i < length enum_class.enum
[PROOF STEP]
by (simp_all add: card_UNIV_length_enum enum_distinct)


[STATEMENT]
lemma imgTr7:"\<lbrakk>Group F; Group G; f \<in> gHom F G; u \<in> f `(carrier F)\<rbrakk>
  \<Longrightarrow> \<rho>\<^bsub>G\<^esub> u  \<in> f `(carrier F)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Group F; Group G; f \<in> gHom F G; u \<in> f ` carrier F\<rbrakk> \<Longrightarrow> \<rho>\<^bsub>G\<^esub> u \<in> f ` carrier F
[PROOF STEP]
apply (simp add:image_def, erule bexE, simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>Group F; Group G; f \<in> gHom F G; x \<in> carrier F; u = f x\<rbrakk> \<Longrightarrow> \<exists>xa\<in>carrier F. \<rho>\<^bsub>G\<^esub> f x = f xa
[PROOF STEP]
apply (subst ghom_inv_inv[THEN sym, of "F" "G" "f"], assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>Group F; Group G; f \<in> gHom F G; x \<in> carrier F; u = f x\<rbrakk> \<Longrightarrow> \<exists>xa\<in>carrier F. f (\<rho>\<^bsub>F\<^esub> x) = f xa
[PROOF STEP]
apply (frule_tac a = x in Group.i_closed[of "F"], assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>Group F; Group G; f \<in> gHom F G; x \<in> carrier F; u = f x; \<rho>\<^bsub>F\<^esub> x \<in> carrier F\<rbrakk> \<Longrightarrow> \<exists>xa\<in>carrier F. f (\<rho>\<^bsub>F\<^esub> x) = f xa
[PROOF STEP]
apply blast
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma diagonal_least_nonzero:
  fixes H :: "(('a :: {bezout_ring_div, normalization_euclidean_semiring, unique_euclidean_ring}, 'b :: mod_type) vec, 'b) vec"
  assumes H: "Hermite associates residues H"
  and inv_H: "invertible H" and up_H: "upper_triangular H"
  shows "(LEAST n. H $ i $ n \<noteq> 0) = i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (LEAST n. H $ i $ n \<noteq> (0::'a)) = i
[PROOF STEP]
proof (rule Least_equality)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. H $ i $ i \<noteq> (0::'a)
 2. \<And>y. H $ i $ y \<noteq> (0::'a) \<Longrightarrow> i \<le> y
[PROOF STEP]
show "H $ i $ i \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. H $ i $ i \<noteq> (0::'a)
[PROOF STEP]
by (metis (full_types) inv_H invertible_iff_is_unit is_unit_diagonal not_is_unit_0 up_H)
[PROOF STATE]
proof (state)
this:
H $ i $ i \<noteq> (0::'a)

goal (1 subgoal):
 1. \<And>y. H $ i $ y \<noteq> (0::'a) \<Longrightarrow> i \<le> y
[PROOF STEP]
fix y
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>y. H $ i $ y \<noteq> (0::'a) \<Longrightarrow> i \<le> y
[PROOF STEP]
assume Hiy: "H $ i $ y \<noteq> 0"
[PROOF STATE]
proof (state)
this:
H $ i $ y \<noteq> (0::'a)

goal (1 subgoal):
 1. \<And>y. H $ i $ y \<noteq> (0::'a) \<Longrightarrow> i \<le> y
[PROOF STEP]
show "i \<le> y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i \<le> y
[PROOF STEP]
using up_H
[PROOF STATE]
proof (prove)
using this:
upper_triangular H

goal (1 subgoal):
 1. i \<le> y
[PROOF STEP]
unfolding upper_triangular_def
[PROOF STATE]
proof (prove)
using this:
\<forall>i j. j < i \<longrightarrow> H $ i $ j = (0::'a)

goal (1 subgoal):
 1. i \<le> y
[PROOF STEP]
by (metis (poly_guards_query) Hiy not_less)
[PROOF STATE]
proof (state)
this:
i \<le> y

goal:
No subgoals!
[PROOF STEP]
qed