[STATEMENT]
lemma quadratic_eq_factoring:
  assumes D: "D = b\<^sup>2 - 4 * a * c"
  assumes nn: "0 \<le> D"
  assumes x1: "x\<^sub>1 = (-b + sqrt D) / (2 * a)"
  assumes x2: "x\<^sub>2 = (-b - sqrt D) / (2 * a)"
  assumes a: "a \<noteq> 0"
  shows "a * x\<^sup>2 + b * x + c = a * (x - x\<^sub>1) * (x - x\<^sub>2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a * x\<^sup>2 + b * x + c = a * (x - x\<^sub>1) * (x - x\<^sub>2)
[PROOF STEP]
using nn
[PROOF STATE]
proof (prove)
using this:
0 \<le> D

goal (1 subgoal):
 1. a * x\<^sup>2 + b * x + c = a * (x - x\<^sub>1) * (x - x\<^sub>2)
[PROOF STEP]
by (simp add: D x1 x2)
    (simp add: assms algebra_simps power2_eq_square power3_eq_cube divide_simps)


[STATEMENT]
lemma of_real_open_segment [simp]:
  "of_real x \<in> open_segment (of_real a) (of_real b) \<longleftrightarrow> x \<in> open_segment a b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (of_real x \<in> open_segment (of_real a) (of_real b)) = (x \<in> open_segment a b)
[PROOF STEP]
apply (auto simp: in_segment scaleR_conv_of_real elim!: ex_forward del: exE)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>u. \<lbrakk>a \<noteq> b; 0 < u; u < 1; of_real x = ((1::'a) - of_real u) * of_real a + of_real u * of_real b\<rbrakk> \<Longrightarrow> x = (1 - u) * a + u * b
[PROOF STEP]
using of_real_eq_iff
[PROOF STATE]
proof (prove)
using this:
(of_real ?x = of_real ?y) = (?x = ?y)

goal (1 subgoal):
 1. \<And>u. \<lbrakk>a \<noteq> b; 0 < u; u < 1; of_real x = ((1::'a) - of_real u) * of_real a + of_real u * of_real b\<rbrakk> \<Longrightarrow> x = (1 - u) * a + u * b
[PROOF STEP]
by fastforce


[STATEMENT]
lemma ineq_dfa_accepts:
  assumes bss: "list_all (is_alph n) bss"
  shows "dfa_accepts (ineq_dfa n ks l) bss = (eval_dioph ks (nats_of_boolss n bss) \<le> l)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dfa_accepts (ineq_dfa n ks l) bss = (eval_dioph ks (nats_of_boolss n bss) \<le> l)
[PROOF STEP]
by (simp add: accepts_def)
    (rule ineq_dfa_accepting [of l l n ks, OF _ bss, simplified dioph_ineq_dfs_start, simplified])


[STATEMENT]
lemma ab: "CARD('a) \<ge> CARD('b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. CARD('b) \<le> CARD('a)
[PROOF STEP]
by (rule dvd_imp_le[OF dvd], auto)


[STATEMENT]
lemma sin_Arcsin [simp]: "sin(Arcsin z) = z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sin (Arcsin z) = z
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. sin (Arcsin z) = z
[PROOF STEP]
have "\<i>*z*2 + csqrt (1 - z\<^sup>2)*2 = 0 \<longleftrightarrow> (\<i>*z)*2 + csqrt (1 - z\<^sup>2)*2 = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<i> * z * 2 + csqrt (1 - z\<^sup>2) * 2 = 0) = (\<i> * z * 2 + csqrt (1 - z\<^sup>2) * 2 = 0)
[PROOF STEP]
by (simp add: algebra_simps)  \<comment> \<open>Cancelling a factor of 2\<close>
[PROOF STATE]
proof (state)
this:
(\<i> * z * 2 + csqrt (1 - z\<^sup>2) * 2 = 0) = (\<i> * z * 2 + csqrt (1 - z\<^sup>2) * 2 = 0)

goal (1 subgoal):
 1. sin (Arcsin z) = z
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(\<i> * z * 2 + csqrt (1 - z\<^sup>2) * 2 = 0) = (\<i> * z * 2 + csqrt (1 - z\<^sup>2) * 2 = 0)

goal (1 subgoal):
 1. sin (Arcsin z) = z
[PROOF STEP]
have "\<dots> \<longleftrightarrow> (\<i>*z) + csqrt (1 - z\<^sup>2) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<i> * z * 2 + csqrt (1 - z\<^sup>2) * 2 = 0) = (\<i> * z + csqrt (1 - z\<^sup>2) = 0)
[PROOF STEP]
by (metis Arcsin_body_lemma distrib_right no_zero_divisors zero_neq_numeral)
[PROOF STATE]
proof (state)
this:
(\<i> * z * 2 + csqrt (1 - z\<^sup>2) * 2 = 0) = (\<i> * z + csqrt (1 - z\<^sup>2) = 0)

goal (1 subgoal):
 1. sin (Arcsin z) = z
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
(\<i> * z * 2 + csqrt (1 - z\<^sup>2) * 2 = 0) = (\<i> * z * 2 + csqrt (1 - z\<^sup>2) * 2 = 0)
(\<i> * z * 2 + csqrt (1 - z\<^sup>2) * 2 = 0) = (\<i> * z + csqrt (1 - z\<^sup>2) = 0)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<i> * z * 2 + csqrt (1 - z\<^sup>2) * 2 = 0) = (\<i> * z * 2 + csqrt (1 - z\<^sup>2) * 2 = 0)
(\<i> * z * 2 + csqrt (1 - z\<^sup>2) * 2 = 0) = (\<i> * z + csqrt (1 - z\<^sup>2) = 0)

goal (1 subgoal):
 1. sin (Arcsin z) = z
[PROOF STEP]
apply (simp add: sin_exp_eq Arcsin_def Arcsin_body_lemma exp_minus divide_simps)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<i> * z * 2 + csqrt (1 - z\<^sup>2) * 2 \<noteq> 0 \<Longrightarrow> - (\<i> * ((\<i> * z + csqrt (1 - z\<^sup>2)) * (\<i> * z + csqrt (1 - z\<^sup>2)) - 1)) = z * (\<i> * z * 2 + csqrt (1 - z\<^sup>2) * 2)
[PROOF STEP]
apply (simp add: algebra_simps)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<i> * (z * 2) + 2 * csqrt (1 - z\<^sup>2) \<noteq> 0 \<Longrightarrow> \<i> = \<i> * (z * z) + \<i> * (csqrt (1 - z\<^sup>2) * csqrt (1 - z\<^sup>2))
[PROOF STEP]
apply (simp add: power2_eq_square [symmetric] algebra_simps)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
sin (Arcsin z) = z

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma fps_XD'_prod: "fps_XD' a (b * c :: 'a :: comm_ring_1 fps) = fps_XD' a b * c + b * fps_XD' a c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fps_XD' a (b * c) = fps_XD' a b * c + b * fps_XD' a c
[PROOF STEP]
by (simp add: fps_XD'_def algebra_simps)


[STATEMENT]
lemma adj_surj_inj:
  fixes f :: "'a::order \<Rightarrow> 'b::order"
  shows "f \<stileturn> g \<Longrightarrow> ((surj f) = (inj g))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<stileturn> g \<Longrightarrow> top_pres ((`) f) = inj g
[PROOF STEP]
unfolding adj_def inj_def surj_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x y. (f x \<le> y) = (x \<le> g y) \<Longrightarrow> (\<forall>y. \<exists>x. y = f x) = (\<forall>x y. g x = g y \<longrightarrow> x = y)
[PROOF STEP]
by (metis eq_iff order_trans)


[STATEMENT]
lemma index_lem: "card M * card H = order G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card M * card H = order G
[PROOF STEP]
by (simp add: cardMeqIndexH lagrange H_is_subgroup)


[STATEMENT]
lemma  matrix_id [simp]: "det (matrix id) = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. det (matrix id) = (1::'a)
[PROOF STEP]
by (simp add: matrix_id_mat_1)


[STATEMENT]
lemma frontier_convex_hull_eq_rel_frontier:
  fixes S :: "'a::euclidean_space set"
  assumes "\<not> affine_dependent S"
  shows "frontier(convex hull S) =
           (if card S \<le> DIM ('a) then convex hull S else rel_frontier(convex hull S))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. frontier (convex hull S) = (if card S \<le> DIM('a) then convex hull S else rel_frontier (convex hull S))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<not> affine_dependent S

goal (1 subgoal):
 1. frontier (convex hull S) = (if card S \<le> DIM('a) then convex hull S else rel_frontier (convex hull S))
[PROOF STEP]
unfolding rel_frontier_def frontier_def
[PROOF STATE]
proof (prove)
using this:
\<not> affine_dependent S

goal (1 subgoal):
 1. closure (convex hull S) - interior (convex hull S) = (if card S \<le> DIM('a) then convex hull S else closure (convex hull S) - rel_interior (convex hull S))
[PROOF STEP]
by (simp add: affine_independent_span_gt rel_interior_interior
                finite_imp_compact empty_interior_convex_hull aff_independent_finite)


[STATEMENT]
lemma (in prob_space) distributed_variance:
  fixes f::"real \<Rightarrow> real"
  assumes D: "distributed M lborel X f" and [simp]: "\<And>x. 0 \<le> f x"
  shows "variance X = (\<integral>x. x\<^sup>2 * f (x + expectation X) \<partial>lborel)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. expectation (\<lambda>x. (X x - expectation X)\<^sup>2) = LBINT x. x\<^sup>2 * f (x + expectation X)
[PROOF STEP]
proof (subst distributed_integral[OF D, symmetric])
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. (\<lambda>a. (a - expectation X)\<^sup>2) \<in> borel_measurable lborel
 2. \<And>x. x \<in> space lborel \<Longrightarrow> 0 \<le> f x
 3. LBINT x. f x * (x - expectation X)\<^sup>2 = LBINT x. x\<^sup>2 * f (x + expectation X)
[PROOF STEP]
show "(\<integral> x. f x * (x - expectation X)\<^sup>2 \<partial>lborel) = (\<integral> x. x\<^sup>2 * f (x + expectation X) \<partial>lborel)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. LBINT x. f x * (x - expectation X)\<^sup>2 = LBINT x. x\<^sup>2 * f (x + expectation X)
[PROOF STEP]
by (subst lborel_integral_real_affine[where c=1 and t="expectation X"])  (auto simp: ac_simps)
[PROOF STATE]
proof (state)
this:
LBINT x. f x * (x - expectation X)\<^sup>2 = LBINT x. x\<^sup>2 * f (x + expectation X)

goal (2 subgoals):
 1. (\<lambda>a. (a - expectation X)\<^sup>2) \<in> borel_measurable lborel
 2. \<And>x. x \<in> space lborel \<Longrightarrow> 0 \<le> f x
[PROOF STEP]
qed simp_all


[STATEMENT]
lemma reversepath_joinpaths:
    "pathfinish g1 = pathstart g2 \<Longrightarrow> reversepath(g1 +++ g2) = reversepath g2 +++ reversepath g1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pathfinish g1 = pathstart g2 \<Longrightarrow> reversepath (g1 +++ g2) = reversepath g2 +++ reversepath g1
[PROOF STEP]
unfolding reversepath_def pathfinish_def pathstart_def joinpaths_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. g1 1 = g2 0 \<Longrightarrow> (\<lambda>x. if 1 - x \<le> 1 / 2 then g1 (2 * (1 - x)) else g2 (2 * (1 - x) - 1)) = (\<lambda>x. if x \<le> 1 / 2 then g2 (1 - 2 * x) else g1 (1 - (2 * x - 1)))
[PROOF STEP]
by (rule ext) (auto simp: mult.commute)


[STATEMENT]
lemma arccos_eq_iff: "\<bar>x\<bar> \<le> 1 \<and> \<bar>y\<bar> \<le> 1 \<Longrightarrow> arccos x = arccos y \<longleftrightarrow> x = y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>x\<bar> \<le> 1 \<and> \<bar>y\<bar> \<le> 1 \<Longrightarrow> (arccos x = arccos y) = (x = y)
[PROOF STEP]
using cos_arccos_abs
[PROOF STATE]
proof (prove)
using this:
\<bar>?y\<bar> \<le> 1 \<Longrightarrow> cos (arccos ?y) = ?y

goal (1 subgoal):
 1. \<bar>x\<bar> \<le> 1 \<and> \<bar>y\<bar> \<le> 1 \<Longrightarrow> (arccos x = arccos y) = (x = y)
[PROOF STEP]
by fastforce


[STATEMENT]
lemma wf_finite_greater:
  assumes "finite (C :: 'a::order set)"
  shows "wf {(x, y). {x, y} \<subseteq> C \<and> y < x}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wf {(x, y). {x, y} \<subseteq> C \<and> y < x}
[PROOF STEP]
by (rule wf_measure[where f="\<lambda>b. card {a. a \<in> C \<and> b < a}", THEN wf_subset])
   (fastforce simp: less_eq assms intro: psubset_card_mono)


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


[STATEMENT]
lemma diff_monom: "monom a n - monom b n = monom (a - b) n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. monom a n - monom b n = monom (a - b) n
[PROOF STEP]
by (rule poly_eqI) simp


[STATEMENT]
lemma poly_of_vec_scalar_mult:
  assumes "degree b<n"
  shows "poly_of_vec (a \<cdot>\<^sub>v (vec_of_poly_n b n)) = smult a b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly_of_vec (a \<cdot>\<^sub>v vec_of_poly_n b n) = smult a b
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
degree b < n

goal (1 subgoal):
 1. poly_of_vec (a \<cdot>\<^sub>v vec_of_poly_n b n) = smult a b
[PROOF STEP]
by (auto simp add: poly_eq_iff coeff_poly_of_vec vec_of_poly_n_def coeff_eq_0)


[STATEMENT]
lemma asymptotics3: "eventually (\<lambda>x. (1 + (ln x powr (-e/2))) / 2 \<le> 1) at_top"
  (is "eventually (\<lambda>x. ?f x \<le> 1) _")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. (1 + ln x powr (- e / 2)) / 2 \<le> 1
[PROOF STEP]
proof (rule eventually_mp[OF always_eventually], clarify)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x. ?P x \<Longrightarrow> (1 + ln x powr (- e / 2)) / 2 \<le> 1
 2. eventually ?P at_top
[PROOF STEP]
from bep
[PROOF STATE]
proof (chain)
picking this:
0 < b
b < 1
0 < e
0 < hb
[PROOF STEP]
have "(?f \<longlongrightarrow> 1/2) at_top"
[PROOF STATE]
proof (prove)
using this:
0 < b
b < 1
0 < e
0 < hb

goal (1 subgoal):
 1. ((\<lambda>x. (1 + ln x powr (- e / 2)) / 2) \<longlongrightarrow> 1 / 2) at_top
[PROOF STEP]
by (force intro: tendsto_eq_intros tendsto_neg_powr ln_at_top)
[PROOF STATE]
proof (state)
this:
((\<lambda>x. (1 + ln x powr (- e / 2)) / 2) \<longlongrightarrow> 1 / 2) at_top

goal (2 subgoals):
 1. \<And>x. ?P x \<Longrightarrow> (1 + ln x powr (- e / 2)) / 2 \<le> 1
 2. eventually ?P at_top
[PROOF STEP]
hence "\<And>e. e>0 \<Longrightarrow> eventually (\<lambda>x. \<bar>?f x - 0.5\<bar> < e) at_top"
[PROOF STATE]
proof (prove)
using this:
((\<lambda>x. (1 + ln x powr (- e / 2)) / 2) \<longlongrightarrow> 1 / 2) at_top

goal (1 subgoal):
 1. \<And>ea. 0 < ea \<Longrightarrow> \<forall>\<^sub>F x in at_top. \<bar>(1 + ln x powr (- e / 2)) / 2 - 5 / 10\<bar> < ea
[PROOF STEP]
by (subst (asm) tendsto_iff) (simp add: dist_real_def)
[PROOF STATE]
proof (state)
this:
0 < ?e \<Longrightarrow> \<forall>\<^sub>F x in at_top. \<bar>(1 + ln x powr (- e / 2)) / 2 - 5 / 10\<bar> < ?e

goal (2 subgoals):
 1. \<And>x. ?P x \<Longrightarrow> (1 + ln x powr (- e / 2)) / 2 \<le> 1
 2. eventually ?P at_top
[PROOF STEP]
from this[of "0.5"]
[PROOF STATE]
proof (chain)
picking this:
0 < 5 / 10 \<Longrightarrow> \<forall>\<^sub>F x in at_top. \<bar>(1 + ln x powr (- e / 2)) / 2 - 5 / 10\<bar> < 5 / 10
[PROOF STEP]
show "eventually (\<lambda>x. \<bar>?f x - 0.5\<bar> < 0.5) at_top"
[PROOF STATE]
proof (prove)
using this:
0 < 5 / 10 \<Longrightarrow> \<forall>\<^sub>F x in at_top. \<bar>(1 + ln x powr (- e / 2)) / 2 - 5 / 10\<bar> < 5 / 10

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. \<bar>(1 + ln x powr (- e / 2)) / 2 - 5 / 10\<bar> < 5 / 10
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in at_top. \<bar>(1 + ln x powr (- e / 2)) / 2 - 5 / 10\<bar> < 5 / 10

goal (1 subgoal):
 1. \<And>x. \<bar>(1 + ln x powr (- e / 2)) / 2 - 5 / 10\<bar> < 5 / 10 \<Longrightarrow> (1 + ln x powr (- e / 2)) / 2 \<le> 1
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. \<bar>(1 + ln x powr (- e / 2)) / 2 - 5 / 10\<bar> < 5 / 10 \<Longrightarrow> (1 + ln x powr (- e / 2)) / 2 \<le> 1
[PROOF STEP]
assume "\<bar>?f x - 0.5\<bar> < 0.5"
[PROOF STATE]
proof (state)
this:
\<bar>(1 + ln x powr (- e / 2)) / 2 - 5 / 10\<bar> < 5 / 10

goal (1 subgoal):
 1. \<And>x. \<bar>(1 + ln x powr (- e / 2)) / 2 - 5 / 10\<bar> < 5 / 10 \<Longrightarrow> (1 + ln x powr (- e / 2)) / 2 \<le> 1
[PROOF STEP]
thus "?f x \<le> 1"
[PROOF STATE]
proof (prove)
using this:
\<bar>(1 + ln x powr (- e / 2)) / 2 - 5 / 10\<bar> < 5 / 10

goal (1 subgoal):
 1. (1 + ln x powr (- e / 2)) / 2 \<le> 1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(1 + ln x powr (- e / 2)) / 2 \<le> 1

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma disjoint_right_eq:
  assumes a: "A \<union> B1 = A \<union> B2"
  and     b: "A \<inter> B1 = {}" "A \<inter> B2 = {}"
  shows "B1 = B2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. B1 = B2
[PROOF STEP]
using a b
[PROOF STATE]
proof (prove)
using this:
A \<union> B1 = A \<union> B2
A \<inter> B1 = {}
A \<inter> B2 = {}

goal (1 subgoal):
 1. B1 = B2
[PROOF STEP]
by (metis Int_Un_distrib2 Int_absorb2 Int_commute Un_upper2)


[STATEMENT]
lemma t_def: "t seq obs = length (filter ((=) obs) seq)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. t seq obs = length (filter ((=) obs) seq)
[PROOF STEP]
unfolding t_def2 length_filter_conv_card
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card {i. i < length seq \<and> seq ! i = obs} = card {i. i < length seq \<and> obs = seq ! i}
[PROOF STEP]
by (subst eq_commute) simp


[STATEMENT]
theorem times_elements:
 "\<forall>i.((i<(length v)) \<longrightarrow> (times a v)!i = f a (v!i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>i<length v. local.times a v ! i = a * v ! i
[PROOF STEP]
apply(rule allI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i. i < length v \<longrightarrow> local.times a v ! i = a * v ! i
[PROOF STEP]
proof(induct v)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>i. i < length [] \<longrightarrow> local.times a [] ! i = a * [] ! i
 2. \<And>aa v i. (\<And>i. i < length v \<longrightarrow> local.times a v ! i = a * v ! i) \<Longrightarrow> i < length (aa # v) \<longrightarrow> local.times a (aa # v) ! i = a * (aa # v) ! i
[PROOF STEP]
case Nil
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. \<And>i. i < length [] \<longrightarrow> local.times a [] ! i = a * [] ! i
 2. \<And>aa v i. (\<And>i. i < length v \<longrightarrow> local.times a v ! i = a * v ! i) \<Longrightarrow> i < length (aa # v) \<longrightarrow> local.times a (aa # v) ! i = a * (aa # v) ! i
[PROOF STEP]
have "(length [] = 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length [] = 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
length [] = 0

goal (2 subgoals):
 1. \<And>i. i < length [] \<longrightarrow> local.times a [] ! i = a * [] ! i
 2. \<And>aa v i. (\<And>i. i < length v \<longrightarrow> local.times a v ! i = a * v ! i) \<Longrightarrow> i < length (aa # v) \<longrightarrow> local.times a (aa # v) ! i = a * (aa # v) ! i
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
length [] = 0
[PROOF STEP]
have "i <(length []) \<Longrightarrow> False"
[PROOF STATE]
proof (prove)
using this:
length [] = 0

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

goal (2 subgoals):
 1. \<And>i. i < length [] \<longrightarrow> local.times a [] ! i = a * [] ! i
 2. \<And>aa v i. (\<And>i. i < length v \<longrightarrow> local.times a v ! i = a * v ! i) \<Longrightarrow> i < length (aa # v) \<longrightarrow> local.times a (aa # v) ! i = a * (aa # v) ! i
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
i < length [] \<Longrightarrow> False

goal (2 subgoals):
 1. \<And>i. i < length [] \<longrightarrow> local.times a [] ! i = a * [] ! i
 2. \<And>aa v i. (\<And>i. i < length v \<longrightarrow> local.times a v ! i = a * v ! i) \<Longrightarrow> i < length (aa # v) \<longrightarrow> local.times a (aa # v) ! i = a * (aa # v) ! i
[PROOF STEP]
have "(times a []) = []"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. local.times a [] = []
[PROOF STEP]
using times.simps(1)
[PROOF STATE]
proof (prove)
using this:
local.times ?n [] = []

goal (1 subgoal):
 1. local.times a [] = []
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
local.times a [] = []

goal (2 subgoals):
 1. \<And>i. i < length [] \<longrightarrow> local.times a [] ! i = a * [] ! i
 2. \<And>aa v i. (\<And>i. i < length v \<longrightarrow> local.times a v ! i = a * v ! i) \<Longrightarrow> i < length (aa # v) \<longrightarrow> local.times a (aa # v) ! i = a * (aa # v) ! i
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
i < length [] \<Longrightarrow> False
local.times a [] = []
[PROOF STEP]
have "(i<(length [])) \<longrightarrow> (times a [])!i = f a ([]!i)"
[PROOF STATE]
proof (prove)
using this:
i < length [] \<Longrightarrow> False
local.times a [] = []

goal (1 subgoal):
 1. i < length [] \<longrightarrow> local.times a [] ! i = a * [] ! i
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
i < length [] \<longrightarrow> local.times a [] ! i = a * [] ! i

goal (2 subgoals):
 1. \<And>i. i < length [] \<longrightarrow> local.times a [] ! i = a * [] ! i
 2. \<And>aa v i. (\<And>i. i < length v \<longrightarrow> local.times a v ! i = a * v ! i) \<Longrightarrow> i < length (aa # v) \<longrightarrow> local.times a (aa # v) ! i = a * (aa # v) ! i
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
i < length [] \<longrightarrow> local.times a [] ! i = a * [] ! i
[PROOF STEP]
have "\<forall>i. ((i<(length [])) \<longrightarrow> (times a [])!i = f a ([]!i))"
[PROOF STATE]
proof (prove)
using this:
i < length [] \<longrightarrow> local.times a [] ! i = a * [] ! i

goal (1 subgoal):
 1. \<forall>i<length []. local.times a [] ! i = a * [] ! i
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>i<length []. local.times a [] ! i = a * [] ! i

goal (2 subgoals):
 1. \<And>i. i < length [] \<longrightarrow> local.times a [] ! i = a * [] ! i
 2. \<And>aa v i. (\<And>i. i < length v \<longrightarrow> local.times a v ! i = a * v ! i) \<Longrightarrow> i < length (aa # v) \<longrightarrow> local.times a (aa # v) ! i = a * (aa # v) ! i
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>i<length []. local.times a [] ! i = a * [] ! i
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
\<forall>i<length []. local.times a [] ! i = a * [] ! i

goal (1 subgoal):
 1. i < length [] \<longrightarrow> local.times a [] ! i = a * [] ! i
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
i < length [] \<longrightarrow> local.times a [] ! i = a * [] ! i

goal (1 subgoal):
 1. \<And>aa v i. (\<And>i. i < length v \<longrightarrow> local.times a v ! i = a * v ! i) \<Longrightarrow> i < length (aa # v) \<longrightarrow> local.times a (aa # v) ! i = a * (aa # v) ! i
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>aa v i. (\<And>i. i < length v \<longrightarrow> local.times a v ! i = a * v ! i) \<Longrightarrow> i < length (aa # v) \<longrightarrow> local.times a (aa # v) ! i = a * (aa # v) ! i
[PROOF STEP]
case (Cons x xs)
[PROOF STATE]
proof (state)
this:
?i < length xs \<longrightarrow> local.times a xs ! ?i = a * xs ! ?i

goal (1 subgoal):
 1. \<And>aa v i. (\<And>i. i < length v \<longrightarrow> local.times a v ! i = a * v ! i) \<Longrightarrow> i < length (aa # v) \<longrightarrow> local.times a (aa # v) ! i = a * (aa # v) ! i
[PROOF STEP]
have "\<forall>i.((x#xs)!(i+1) = (xs)!i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>i. (x # xs) ! (i + 1) = xs ! i
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>i. (x # xs) ! (i + 1) = xs ! i

goal (1 subgoal):
 1. \<And>aa v i. (\<And>i. i < length v \<longrightarrow> local.times a v ! i = a * v ! i) \<Longrightarrow> i < length (aa # v) \<longrightarrow> local.times a (aa # v) ! i = a * (aa # v) ! i
[PROOF STEP]
have 0:"((i<length (x#xs))\<longrightarrow> ((i<(length xs)) \<or> (i = (length xs))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i < length (x # xs) \<longrightarrow> i < length xs \<or> i = length xs
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
i < length (x # xs) \<longrightarrow> i < length xs \<or> i = length xs

goal (1 subgoal):
 1. \<And>aa v i. (\<And>i. i < length v \<longrightarrow> local.times a v ! i = a * v ! i) \<Longrightarrow> i < length (aa # v) \<longrightarrow> local.times a (aa # v) ! i = a * (aa # v) ! i
[PROOF STEP]
have 1:" ((i<length xs) \<longrightarrow>((times a xs)!i = f a (xs!i)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i < length xs \<longrightarrow> local.times a xs ! i = a * xs ! i
[PROOF STEP]
by (metis Cons.hyps)
[PROOF STATE]
proof (state)
this:
i < length xs \<longrightarrow> local.times a xs ! i = a * xs ! i

goal (1 subgoal):
 1. \<And>aa v i. (\<And>i. i < length v \<longrightarrow> local.times a v ! i = a * v ! i) \<Longrightarrow> i < length (aa # v) \<longrightarrow> local.times a (aa # v) ! i = a * (aa # v) ! i
[PROOF STEP]
have "\<forall>i.((x#xs)!(i+1) = (xs)!i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>i. (x # xs) ! (i + 1) = xs ! i
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>i. (x # xs) ! (i + 1) = xs ! i

goal (1 subgoal):
 1. \<And>aa v i. (\<And>i. i < length v \<longrightarrow> local.times a v ! i = a * v ! i) \<Longrightarrow> i < length (aa # v) \<longrightarrow> local.times a (aa # v) ! i = a * (aa # v) ! i
[PROOF STEP]
have "((i <length (x#xs)) \<longrightarrow>(times a (x#xs))!i = f a ((x#xs)!i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i < length (x # xs) \<longrightarrow> local.times a (x # xs) ! i = a * (x # xs) ! i
[PROOF STEP]
proof(cases i)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. i = 0 \<Longrightarrow> i < length (x # xs) \<longrightarrow> local.times a (x # xs) ! i = a * (x # xs) ! i
 2. \<And>nat. i = Suc nat \<Longrightarrow> i < length (x # xs) \<longrightarrow> local.times a (x # xs) ! i = a * (x # xs) ! i
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:
i = 0

goal (2 subgoals):
 1. i = 0 \<Longrightarrow> i < length (x # xs) \<longrightarrow> local.times a (x # xs) ! i = a * (x # xs) ! i
 2. \<And>nat. i = Suc nat \<Longrightarrow> i < length (x # xs) \<longrightarrow> local.times a (x # xs) ! i = a * (x # xs) ! i
[PROOF STEP]
have "((times a (x#xs))!i) = f a x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. local.times a (x # xs) ! i = a * x
[PROOF STEP]
using 0 times.simps(2)
[PROOF STATE]
proof (prove)
using this:
i = 0
local.times ?n (?y # ?ys) = (?n * ?y) # local.times ?n ?ys

goal (1 subgoal):
 1. local.times a (x # xs) ! i = a * x
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
local.times a (x # xs) ! i = a * x

goal (2 subgoals):
 1. i = 0 \<Longrightarrow> i < length (x # xs) \<longrightarrow> local.times a (x # xs) ! i = a * (x # xs) ! i
 2. \<And>nat. i = Suc nat \<Longrightarrow> i < length (x # xs) \<longrightarrow> local.times a (x # xs) ! i = a * (x # xs) ! i
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
local.times a (x # xs) ! i = a * x
[PROOF STEP]
have "(times a (x#xs))!i = f a ((x#xs)!i)"
[PROOF STATE]
proof (prove)
using this:
local.times a (x # xs) ! i = a * x

goal (1 subgoal):
 1. local.times a (x # xs) ! i = a * (x # xs) ! i
[PROOF STEP]
using 0
[PROOF STATE]
proof (prove)
using this:
local.times a (x # xs) ! i = a * x
i = 0

goal (1 subgoal):
 1. local.times a (x # xs) ! i = a * (x # xs) ! i
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
local.times a (x # xs) ! i = a * (x # xs) ! i

goal (2 subgoals):
 1. i = 0 \<Longrightarrow> i < length (x # xs) \<longrightarrow> local.times a (x # xs) ! i = a * (x # xs) ! i
 2. \<And>nat. i = Suc nat \<Longrightarrow> i < length (x # xs) \<longrightarrow> local.times a (x # xs) ! i = a * (x # xs) ! i
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
local.times a (x # xs) ! i = a * (x # xs) ! i
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
local.times a (x # xs) ! i = a * (x # xs) ! i

goal (1 subgoal):
 1. i < length (x # xs) \<longrightarrow> local.times a (x # xs) ! i = a * (x # xs) ! i
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
i < length (x # xs) \<longrightarrow> local.times a (x # xs) ! i = a * (x # xs) ! i

goal (1 subgoal):
 1. \<And>nat. i = Suc nat \<Longrightarrow> i < length (x # xs) \<longrightarrow> local.times a (x # xs) ! i = a * (x # xs) ! i
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>nat. i = Suc nat \<Longrightarrow> i < length (x # xs) \<longrightarrow> local.times a (x # xs) ! i = a * (x # xs) ! i
[PROOF STEP]
case (Suc j)
[PROOF STATE]
proof (state)
this:
i = Suc j

goal (1 subgoal):
 1. \<And>nat. i = Suc nat \<Longrightarrow> i < length (x # xs) \<longrightarrow> local.times a (x # xs) ! i = a * (x # xs) ! i
[PROOF STEP]
have 1:"(times a (x#xs))!i = ((f a x)#(times a xs))!i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. local.times a (x # xs) ! i = ((a * x) # local.times a xs) ! i
[PROOF STEP]
using times.simps(2)
[PROOF STATE]
proof (prove)
using this:
local.times ?n (?y # ?ys) = (?n * ?y) # local.times ?n ?ys

goal (1 subgoal):
 1. local.times a (x # xs) ! i = ((a * x) # local.times a xs) ! i
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
local.times a (x # xs) ! i = ((a * x) # local.times a xs) ! i

goal (1 subgoal):
 1. \<And>nat. i = Suc nat \<Longrightarrow> i < length (x # xs) \<longrightarrow> local.times a (x # xs) ! i = a * (x # xs) ! i
[PROOF STEP]
have 2:"((f a x)#(times a xs))!i = (times a xs)!j"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((a * x) # local.times a xs) ! i = local.times a xs ! j
[PROOF STEP]
using Suc
[PROOF STATE]
proof (prove)
using this:
i = Suc j

goal (1 subgoal):
 1. ((a * x) # local.times a xs) ! i = local.times a xs ! j
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
((a * x) # local.times a xs) ! i = local.times a xs ! j

goal (1 subgoal):
 1. \<And>nat. i = Suc nat \<Longrightarrow> i < length (x # xs) \<longrightarrow> local.times a (x # xs) ! i = a * (x # xs) ! i
[PROOF STEP]
have 3:"(i <length (x#xs)) \<longrightarrow> (j<length xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i < length (x # xs) \<longrightarrow> j < length xs
[PROOF STEP]
using One_nat_def Suc Suc_eq_plus1 list.size(4) not_less_eq
[PROOF STATE]
proof (prove)
using this:
1 = Suc 0
i = Suc j
Suc ?n = ?n + 1
length (?x21.0 # ?x22.0) = length ?x22.0 + Suc 0
(\<not> ?m < ?n) = (?n < Suc ?m)

goal (1 subgoal):
 1. i < length (x # xs) \<longrightarrow> j < length xs
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
i < length (x # xs) \<longrightarrow> j < length xs

goal (1 subgoal):
 1. \<And>nat. i = Suc nat \<Longrightarrow> i < length (x # xs) \<longrightarrow> local.times a (x # xs) ! i = a * (x # xs) ! i
[PROOF STEP]
have 4:"(j<length xs) \<longrightarrow> ((times a xs)!j = (f a (xs!j)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. j < length xs \<longrightarrow> local.times a xs ! j = a * xs ! j
[PROOF STEP]
using 1
[PROOF STATE]
proof (prove)
using this:
local.times a (x # xs) ! i = ((a * x) # local.times a xs) ! i

goal (1 subgoal):
 1. j < length xs \<longrightarrow> local.times a xs ! j = a * xs ! j
[PROOF STEP]
by (metis Cons.hyps)
[PROOF STATE]
proof (state)
this:
j < length xs \<longrightarrow> local.times a xs ! j = a * xs ! j

goal (1 subgoal):
 1. \<And>nat. i = Suc nat \<Longrightarrow> i < length (x # xs) \<longrightarrow> local.times a (x # xs) ! i = a * (x # xs) ! i
[PROOF STEP]
have 5:"(x#xs)!i = (xs!j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x # xs) ! i = xs ! j
[PROOF STEP]
using Suc
[PROOF STATE]
proof (prove)
using this:
i = Suc j

goal (1 subgoal):
 1. (x # xs) ! i = xs ! j
[PROOF STEP]
by (metis nth_Cons_Suc)
[PROOF STATE]
proof (state)
this:
(x # xs) ! i = xs ! j

goal (1 subgoal):
 1. \<And>nat. i = Suc nat \<Longrightarrow> i < length (x # xs) \<longrightarrow> local.times a (x # xs) ! i = a * (x # xs) ! i
[PROOF STEP]
with 1 2 4
[PROOF STATE]
proof (chain)
picking this:
local.times a (x # xs) ! i = ((a * x) # local.times a xs) ! i
((a * x) # local.times a xs) ! i = local.times a xs ! j
j < length xs \<longrightarrow> local.times a xs ! j = a * xs ! j
(x # xs) ! i = xs ! j
[PROOF STEP]
have "(j<length xs)
                            \<longrightarrow> ((times a (x#xs))!i = (f a ((x#xs)!i)))"
[PROOF STATE]
proof (prove)
using this:
local.times a (x # xs) ! i = ((a * x) # local.times a xs) ! i
((a * x) # local.times a xs) ! i = local.times a xs ! j
j < length xs \<longrightarrow> local.times a xs ! j = a * xs ! j
(x # xs) ! i = xs ! j

goal (1 subgoal):
 1. j < length xs \<longrightarrow> local.times a (x # xs) ! i = a * (x # xs) ! i
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
j < length xs \<longrightarrow> local.times a (x # xs) ! i = a * (x # xs) ! i

goal (1 subgoal):
 1. \<And>nat. i = Suc nat \<Longrightarrow> i < length (x # xs) \<longrightarrow> local.times a (x # xs) ! i = a * (x # xs) ! i
[PROOF STEP]
with 3
[PROOF STATE]
proof (chain)
picking this:
i < length (x # xs) \<longrightarrow> j < length xs
j < length xs \<longrightarrow> local.times a (x # xs) ! i = a * (x # xs) ! i
[PROOF STEP]
have "(i <length (x#xs))
                            \<longrightarrow> ((times a (x#xs))!i = (f a ((x#xs)!i)))"
[PROOF STATE]
proof (prove)
using this:
i < length (x # xs) \<longrightarrow> j < length xs
j < length xs \<longrightarrow> local.times a (x # xs) ! i = a * (x # xs) ! i

goal (1 subgoal):
 1. i < length (x # xs) \<longrightarrow> local.times a (x # xs) ! i = a * (x # xs) ! i
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
i < length (x # xs) \<longrightarrow> local.times a (x # xs) ! i = a * (x # xs) ! i

goal (1 subgoal):
 1. \<And>nat. i = Suc nat \<Longrightarrow> i < length (x # xs) \<longrightarrow> local.times a (x # xs) ! i = a * (x # xs) ! i
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
i < length (x # xs) \<longrightarrow> local.times a (x # xs) ! i = a * (x # xs) ! i
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
i < length (x # xs) \<longrightarrow> local.times a (x # xs) ! i = a * (x # xs) ! i

goal (1 subgoal):
 1. i < length (x # xs) \<longrightarrow> local.times a (x # xs) ! i = a * (x # xs) ! i
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
i < length (x # xs) \<longrightarrow> local.times a (x # xs) ! i = a * (x # xs) ! i

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
i < length (x # xs) \<longrightarrow> local.times a (x # xs) ! i = a * (x # xs) ! i

goal (1 subgoal):
 1. \<And>aa v i. (\<And>i. i < length v \<longrightarrow> local.times a v ! i = a * v ! i) \<Longrightarrow> i < length (aa # v) \<longrightarrow> local.times a (aa # v) ! i = a * (aa # v) ! i
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
i < length (x # xs) \<longrightarrow> local.times a (x # xs) ! i = a * (x # xs) ! i
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
i < length (x # xs) \<longrightarrow> local.times a (x # xs) ! i = a * (x # xs) ! i

goal (1 subgoal):
 1. i < length (x # xs) \<longrightarrow> local.times a (x # xs) ! i = a * (x # xs) ! i
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
i < length (x # xs) \<longrightarrow> local.times a (x # xs) ! i = a * (x # xs) ! i

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma mono_infI':
  "mono f \<Longrightarrow> mono g \<Longrightarrow> mono (\<lambda>x. inf (f x) (g x) :: 'b::lattice)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>mono f; mono g\<rbrakk> \<Longrightarrow> mono (\<lambda>x. inf (f x) (g x))
[PROOF STEP]
by (rule mono_infI[unfolded inf_fun_def])


[STATEMENT]
lemma divisor_count_dvd_mono:
  assumes "a dvd b" "b \<noteq> 0"
  shows   "divisor_count a \<le> divisor_count b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. divisor_count a \<le> divisor_count b
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
a dvd b
b \<noteq> 0

goal (1 subgoal):
 1. divisor_count a \<le> divisor_count b
[PROOF STEP]
by (auto simp: divisor_count_def intro!: card_mono intro: dvd_trans)


[STATEMENT]
lemma smult_fixed_length_sublist:
assumes "length xs = l * c" "i<c"
shows "fixed_length_sublist (vec_smult \<alpha> xs) l i = vec_smult \<alpha> (fixed_length_sublist xs l i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fixed_length_sublist (vec_smult \<alpha> xs) l i = vec_smult \<alpha> (fixed_length_sublist xs l i)
[PROOF STEP]
unfolding fixed_length_sublist_def vec_smult_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. take l (drop (l * i) (map ((*) \<alpha>) xs)) = map ((*) \<alpha>) (take l (drop (l * i) xs))
[PROOF STEP]
by (simp add: drop_map take_map)


[STATEMENT]
lemma degree_monic_mult: assumes monic: "monic (p :: 'a :: comm_semiring_1 poly)"
  and q: "q \<noteq> 0"
  shows "degree (p * q) = degree p + degree q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree (p * q) = degree p + degree q
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. degree (p * q) = degree p + degree q
[PROOF STEP]
have "degree p + degree q \<ge> degree (p * q)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree (p * q) \<le> degree p + degree q
[PROOF STEP]
by (rule degree_mult_le)
[PROOF STATE]
proof (state)
this:
degree (p * q) \<le> degree p + degree q

goal (1 subgoal):
 1. degree (p * q) = degree p + degree q
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
degree (p * q) \<le> degree p + degree q

goal (1 subgoal):
 1. degree (p * q) = degree p + degree q
[PROOF STEP]
have "degree p + degree q \<le> degree (p * q)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree p + degree q \<le> degree (p * q)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. degree p + degree q \<le> degree (p * q)
[PROOF STEP]
from q
[PROOF STATE]
proof (chain)
picking this:
q \<noteq> 0
[PROOF STEP]
have cq: "coeff q (degree q) \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
q \<noteq> 0

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

goal (1 subgoal):
 1. degree p + degree q \<le> degree (p * q)
[PROOF STEP]
hence "coeff (p * q) (degree p + degree q) \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
lead_coeff q \<noteq> (0::'a)

goal (1 subgoal):
 1. coeff (p * q) (degree p + degree q) \<noteq> (0::'a)
[PROOF STEP]
unfolding lcoeff_monic_mult[OF monic]
[PROOF STATE]
proof (prove)
using this:
lead_coeff q \<noteq> (0::'a)

goal (1 subgoal):
 1. lead_coeff q \<noteq> (0::'a)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
coeff (p * q) (degree p + degree q) \<noteq> (0::'a)

goal (1 subgoal):
 1. degree p + degree q \<le> degree (p * q)
[PROOF STEP]
thus "degree (p * q) \<ge> degree p + degree q"
[PROOF STATE]
proof (prove)
using this:
coeff (p * q) (degree p + degree q) \<noteq> (0::'a)

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
degree p + degree q \<le> degree (p * q)

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

goal (1 subgoal):
 1. degree (p * q) = degree p + degree q
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
degree (p * q) = degree p + degree q

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Re_zeta_ge_1:
  assumes "x > 1"
  shows   "Re (zeta (of_real x)) \<ge> 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 \<le> Re (zeta (complex_of_real x))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 1 \<le> Re (zeta (complex_of_real x))
[PROOF STEP]
have *: "(\<lambda>n. real (Suc n) powr -x) sums Re (zeta (complex_of_real x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. real (Suc n) powr - x) sums Re (zeta (complex_of_real x))
[PROOF STEP]
using sums_Re[OF sums_zeta[of "of_real x"]] assms
[PROOF STATE]
proof (prove)
using this:
1 < Re (complex_of_real x) \<Longrightarrow> (\<lambda>n. Re (of_nat (Suc n) powr - complex_of_real x)) sums Re (zeta (complex_of_real x))
1 < x

goal (1 subgoal):
 1. (\<lambda>n. real (Suc n) powr - x) sums Re (zeta (complex_of_real x))
[PROOF STEP]
by (simp add: powr_Reals_eq)
[PROOF STATE]
proof (state)
this:
(\<lambda>n. real (Suc n) powr - x) sums Re (zeta (complex_of_real x))

goal (1 subgoal):
 1. 1 \<le> Re (zeta (complex_of_real x))
[PROOF STEP]
show "Re (zeta (of_real x)) \<ge> 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 \<le> Re (zeta (complex_of_real x))
[PROOF STEP]
proof (rule sums_le[OF _ _ *])
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>n. ?f n \<le> real (Suc n) powr - x
 2. ?f sums 1
[PROOF STEP]
show "(\<lambda>n. if n = 0 then 1 else 0) sums 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. if n = 0 then 1::'a else (0::'a)) sums (1::'a)
[PROOF STEP]
by (rule sums_single)
[PROOF STATE]
proof (state)
this:
(\<lambda>n. if n = 0 then 1::?'a1 else (0::?'a1)) sums (1::?'a1)

goal (1 subgoal):
 1. \<And>n. (if n = 0 then 1 else 0) \<le> real (Suc n) powr - x
[PROOF STEP]
qed auto
[PROOF STATE]
proof (state)
this:
1 \<le> Re (zeta (complex_of_real x))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma norm_nth_le: "norm (x \<bullet> i) \<le> norm x" if "i \<in> Basis"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (x \<bullet> i) \<le> norm x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. norm (x \<bullet> i) \<le> norm x
[PROOF STEP]
have "(x \<bullet> i)\<^sup>2 = (\<Sum>i\<in>{i}. (x \<bullet> i)\<^sup>2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<bullet> i)\<^sup>2 = (\<Sum>i\<in>{i}. (x \<bullet> i)\<^sup>2)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(x \<bullet> i)\<^sup>2 = (\<Sum>i\<in>{i}. (x \<bullet> i)\<^sup>2)

goal (1 subgoal):
 1. norm (x \<bullet> i) \<le> norm x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(x \<bullet> i)\<^sup>2 = (\<Sum>i\<in>{i}. (x \<bullet> i)\<^sup>2)

goal (1 subgoal):
 1. norm (x \<bullet> i) \<le> norm x
[PROOF STEP]
have "\<dots> \<le> (\<Sum>i\<in>Basis. (x \<bullet> i)\<^sup>2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i\<in>{i}. (x \<bullet> i)\<^sup>2) \<le> (\<Sum>i\<in>Basis. (x \<bullet> i)\<^sup>2)
[PROOF STEP]
by (intro sum_mono2) (auto simp: that)
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<in>{i}. (x \<bullet> i)\<^sup>2) \<le> (\<Sum>i\<in>Basis. (x \<bullet> i)\<^sup>2)

goal (1 subgoal):
 1. norm (x \<bullet> i) \<le> norm x
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(x \<bullet> i)\<^sup>2 \<le> (\<Sum>i\<in>Basis. (x \<bullet> i)\<^sup>2)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(x \<bullet> i)\<^sup>2 \<le> (\<Sum>i\<in>Basis. (x \<bullet> i)\<^sup>2)

goal (1 subgoal):
 1. norm (x \<bullet> i) \<le> norm x
[PROOF STEP]
unfolding norm_conv_dist euclidean_dist_l2[of x] L2_set_def
[PROOF STATE]
proof (prove)
using this:
(x \<bullet> i)\<^sup>2 \<le> (\<Sum>i\<in>Basis. (x \<bullet> i)\<^sup>2)

goal (1 subgoal):
 1. dist (x \<bullet> i) 0 \<le> sqrt (\<Sum>i\<in>Basis. (dist (x \<bullet> i) ((0::'a) \<bullet> i))\<^sup>2)
[PROOF STEP]
by (auto intro!: real_le_rsqrt)
[PROOF STATE]
proof (state)
this:
norm (x \<bullet> i) \<le> norm x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma length_remdups_less_eq:
  assumes "set xs \<subseteq> set ys"
  shows "length (remdups xs) \<le> length (remdups ys)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (remdups xs) \<le> length (remdups ys)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
set xs \<subseteq> set ys

goal (1 subgoal):
 1. length (remdups xs) \<le> length (remdups ys)
[PROOF STEP]
by (auto simp: length_remdups_card_conv card_mono)


[STATEMENT]
lemma is_increasingI:
  assumes "\<And> n m::nat. n>m \<Longrightarrow> (f n) > (f m)"
  shows "is_increasing f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_increasing f
[PROOF STEP]
unfolding is_increasing_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>n m. m < n \<longrightarrow> f m < f n
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
?m2 < ?n2 \<Longrightarrow> f ?m2 < f ?n2

goal (1 subgoal):
 1. \<forall>n m. m < n \<longrightarrow> f m < f n
[PROOF STEP]
by blast


[STATEMENT]
lemma smult_distrib_right_diff :
  "\<lbrakk> r \<in> R; s \<in> R; m \<in> M \<rbrakk> \<Longrightarrow> (r - s) \<cdot> m = r \<cdot> m - s \<cdot> m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>r \<in> R; s \<in> R; m \<in> M\<rbrakk> \<Longrightarrow> (r - s) \<cdot> m = r \<cdot> m - s \<cdot> m
[PROOF STEP]
using R_scalars.neg_closed smult_distrib_right[of r "-s"] neg_smult
[PROOF STATE]
proof (prove)
using this:
?g \<in> R \<Longrightarrow> - ?g \<in> R
\<lbrakk>r \<in> R; - s \<in> R; ?m \<in> M\<rbrakk> \<Longrightarrow> (r + - s) \<cdot> ?m = r \<cdot> ?m + - s \<cdot> ?m
\<lbrakk>?r \<in> R; ?m \<in> M\<rbrakk> \<Longrightarrow> - ?r \<cdot> ?m = - (?r \<cdot> ?m)

goal (1 subgoal):
 1. \<lbrakk>r \<in> R; s \<in> R; m \<in> M\<rbrakk> \<Longrightarrow> (r - s) \<cdot> m = r \<cdot> m - s \<cdot> m
[PROOF STEP]
by    (simp add: algebra_simps)


[STATEMENT]
lemma prime_square_sum_nat_decomp_correct:
  assumes "prime p" "p = 2 \<or> [p = 1] (mod 4)"
  defines "z \<equiv> prime_square_sum_nat_decomp p"
  shows "fst z ^ 2 + snd z ^ 2 = p" "fst z \<le> snd z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (fst z)\<^sup>2 + (snd z)\<^sup>2 = p &&& fst z \<le> snd z
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (fst z)\<^sup>2 + (snd z)\<^sup>2 = p
 2. fst z \<le> snd z
[PROOF STEP]
define z' where "z' = (THE (x,y). x \<le> y \<and> x ^ 2 + y ^ 2 = p)"
[PROOF STATE]
proof (state)
this:
z' = (THE (x, y). x \<le> y \<and> x\<^sup>2 + y\<^sup>2 = p)

goal (2 subgoals):
 1. (fst z)\<^sup>2 + (snd z)\<^sup>2 = p
 2. fst z \<le> snd z
[PROOF STEP]
have "z = z'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. z = z'
[PROOF STEP]
unfolding z_def z'_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prime_square_sum_nat_decomp p = (THE (x, y). x \<le> y \<and> x\<^sup>2 + y\<^sup>2 = p)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
prime p
p = 2 \<or> [p = 1] (mod 4)
z \<equiv> prime_square_sum_nat_decomp p

goal (1 subgoal):
 1. prime_square_sum_nat_decomp p = (THE (x, y). x \<le> y \<and> x\<^sup>2 + y\<^sup>2 = p)
[PROOF STEP]
by (simp add: prime_square_sum_nat_decomp_def)
[PROOF STATE]
proof (state)
this:
z = z'

goal (2 subgoals):
 1. (fst z)\<^sup>2 + (snd z)\<^sup>2 = p
 2. fst z \<le> snd z
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
z = z'

goal (2 subgoals):
 1. (fst z)\<^sup>2 + (snd z)\<^sup>2 = p
 2. fst z \<le> snd z
[PROOF STEP]
have"\<exists>!(x,y). x \<le> y \<and> x ^ 2 + y ^ 2 = p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>!(x, y). x \<le> y \<and> x\<^sup>2 + y\<^sup>2 = p
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
prime p
p = 2 \<or> [p = 1] (mod 4)
z \<equiv> prime_square_sum_nat_decomp p

goal (1 subgoal):
 1. \<exists>!(x, y). x \<le> y \<and> x\<^sup>2 + y\<^sup>2 = p
[PROOF STEP]
by (intro prime_sum_of_squares_unique)
[PROOF STATE]
proof (state)
this:
\<exists>!(x, y). x \<le> y \<and> x\<^sup>2 + y\<^sup>2 = p

goal (2 subgoals):
 1. (fst z)\<^sup>2 + (snd z)\<^sup>2 = p
 2. fst z \<le> snd z
[PROOF STEP]
hence "case z' of (x, y) \<Rightarrow> x \<le> y \<and> x ^ 2 + y ^ 2 = p"
[PROOF STATE]
proof (prove)
using this:
\<exists>!(x, y). x \<le> y \<and> x\<^sup>2 + y\<^sup>2 = p

goal (1 subgoal):
 1. case z' of (x, y) \<Rightarrow> x \<le> y \<and> x\<^sup>2 + y\<^sup>2 = p
[PROOF STEP]
unfolding z'_def
[PROOF STATE]
proof (prove)
using this:
\<exists>!(x, y). x \<le> y \<and> x\<^sup>2 + y\<^sup>2 = p

goal (1 subgoal):
 1. case THE (x, y). x \<le> y \<and> x\<^sup>2 + y\<^sup>2 = p of (x, y) \<Rightarrow> x \<le> y \<and> x\<^sup>2 + y\<^sup>2 = p
[PROOF STEP]
by (rule theI')
[PROOF STATE]
proof (state)
this:
case z' of (x, y) \<Rightarrow> x \<le> y \<and> x\<^sup>2 + y\<^sup>2 = p

goal (2 subgoals):
 1. (fst z)\<^sup>2 + (snd z)\<^sup>2 = p
 2. fst z \<le> snd z
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
case z of (x, y) \<Rightarrow> x \<le> y \<and> x\<^sup>2 + y\<^sup>2 = p
[PROOF STEP]
show "fst z ^ 2 + snd z ^ 2 = p" "fst z \<le> snd z"
[PROOF STATE]
proof (prove)
using this:
case z of (x, y) \<Rightarrow> x \<le> y \<and> x\<^sup>2 + y\<^sup>2 = p

goal (1 subgoal):
 1. (fst z)\<^sup>2 + (snd z)\<^sup>2 = p &&& fst z \<le> snd z
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(fst z)\<^sup>2 + (snd z)\<^sup>2 = p
fst z \<le> snd z

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma imp_chain_zip_eq:
  "equal_length l l' \<Longrightarrow>
      semantics e f g (foldr Imp (zip_eq l l') p) \<longleftrightarrow>
      semantics_list e f l = semantics_list e f l' \<longrightarrow> semantics e f g p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. equal_length l l' \<Longrightarrow> semantics e f g (foldr Imp (zip_eq l l') p) = (semantics_list e f l = semantics_list e f l' \<longrightarrow> semantics e f g p)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. equal_length l l' \<Longrightarrow> semantics e f g (foldr Imp (zip_eq l l') p) = (semantics_list e f l = semantics_list e f l' \<longrightarrow> semantics e f g p)
[PROOF STEP]
assume "equal_length l l'"
[PROOF STATE]
proof (state)
this:
equal_length l l'

goal (1 subgoal):
 1. equal_length l l' \<Longrightarrow> semantics e f g (foldr Imp (zip_eq l l') p) = (semantics_list e f l = semantics_list e f l' \<longrightarrow> semantics e f g p)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
equal_length l l'
[PROOF STEP]
have "(\<forall>q \<in> set (zip_eq l l'). semantics e f g q) \<longleftrightarrow>
      semantics_list e f l = semantics_list e f l'"
[PROOF STATE]
proof (prove)
using this:
equal_length l l'

goal (1 subgoal):
 1. (\<forall>q\<in>set (zip_eq l l'). semantics e f g q) = (semantics_list e f l = semantics_list e f l')
[PROOF STEP]
unfolding zip_eq_def
[PROOF STATE]
proof (prove)
using this:
equal_length l l'

goal (1 subgoal):
 1. (\<forall>q\<in>set (map2 (\<lambda>t t'. Atom (Rl STR ''='' [t, t'])) l l'). semantics e f g q) = (semantics_list e f l = semantics_list e f l')
[PROOF STEP]
using length2_def
[PROOF STATE]
proof (prove)
using this:
equal_length l l'
length2 ?l \<equiv> case ?l of [] \<Rightarrow> False | [x] \<Rightarrow> False | [x, xa] \<Rightarrow> True | x # xa # ab # list \<Rightarrow> False

goal (1 subgoal):
 1. (\<forall>q\<in>set (map2 (\<lambda>t t'. Atom (Rl STR ''='' [t, t'])) l l'). semantics e f g q) = (semantics_list e f l = semantics_list e f l')
[PROOF STEP]
by (induct l l' rule: list_induct2') simp_all
[PROOF STATE]
proof (state)
this:
(\<forall>q\<in>set (zip_eq l l'). semantics e f g q) = (semantics_list e f l = semantics_list e f l')

goal (1 subgoal):
 1. equal_length l l' \<Longrightarrow> semantics e f g (foldr Imp (zip_eq l l') p) = (semantics_list e f l = semantics_list e f l' \<longrightarrow> semantics e f g p)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<forall>q\<in>set (zip_eq l l'). semantics e f g q) = (semantics_list e f l = semantics_list e f l')
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<forall>q\<in>set (zip_eq l l'). semantics e f g q) = (semantics_list e f l = semantics_list e f l')

goal (1 subgoal):
 1. semantics e f g (foldr Imp (zip_eq l l') p) = (semantics_list e f l = semantics_list e f l' \<longrightarrow> semantics e f g p)
[PROOF STEP]
using imp_chain_equiv
[PROOF STATE]
proof (prove)
using this:
(\<forall>q\<in>set (zip_eq l l'). semantics e f g q) = (semantics_list e f l = semantics_list e f l')
semantics ?e ?f ?g (foldr Imp ?l ?p) = ((\<forall>q\<in>set ?l. semantics ?e ?f ?g q) \<longrightarrow> semantics ?e ?f ?g ?p)

goal (1 subgoal):
 1. semantics e f g (foldr Imp (zip_eq l l') p) = (semantics_list e f l = semantics_list e f l' \<longrightarrow> semantics e f g p)
[PROOF STEP]
by iprover
[PROOF STATE]
proof (state)
this:
semantics e f g (foldr Imp (zip_eq l l') p) = (semantics_list e f l = semantics_list e f l' \<longrightarrow> semantics e f g p)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma tendsto_mult_left: "(f \<longlongrightarrow> l) F \<Longrightarrow> ((\<lambda>x. c * (f x)) \<longlongrightarrow> c * l) F"
  for c :: "'a::topological_semigroup_mult"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f \<longlongrightarrow> l) F \<Longrightarrow> ((\<lambda>x. c * f x) \<longlongrightarrow> c * l) F
[PROOF STEP]
by (rule tendsto_mult [OF tendsto_const])


[STATEMENT]
lemma fine_Union: "(\<And>p. p \<in> ps \<Longrightarrow> d fine p) \<Longrightarrow> d fine (\<Union>ps)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>p. p \<in> ps \<Longrightarrow> d fine p) \<Longrightarrow> d fine \<Union> ps
[PROOF STEP]
unfolding fine_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>p. p \<in> ps \<Longrightarrow> \<forall>(x, k)\<in>p. k \<subseteq> d x) \<Longrightarrow> \<forall>(x, k)\<in>\<Union> ps. k \<subseteq> d x
[PROOF STEP]
by auto


[STATEMENT]
lemma sum_not_less[simp, intro!]:
  "0\<le>b \<Longrightarrow> \<not> (a+b < a)"
  "0\<le>a \<Longrightarrow> \<not> (a+b < b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((0::'a) \<le> b \<Longrightarrow> \<not> a + b < a) &&& ((0::'a) \<le> a \<Longrightarrow> \<not> a + b < b)
[PROOF STEP]
apply (metis add_incr less_le_not_le)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0::'a) \<le> a \<Longrightarrow> \<not> a + b < b
[PROOF STEP]
apply (metis add_incr_left less_le_not_le)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma fls_mult_distrib_subdegree_ge_0:
  fixes   f g h :: "'a::semiring_0 fls"
  assumes "fls_subdegree f \<ge> 0" "fls_subdegree g \<ge> 0" "fls_subdegree h \<ge> 0"
  shows   "(f + g) * h = f * h + g * h"
  and     "h * (f + g) = h * f + h * g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f + g) * h = f * h + g * h &&& h * (f + g) = h * f + h * g
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (f + g) * h = f * h + g * h
 2. h * (f + g) = h * f + h * g
[PROOF STEP]
have "fls_subdegree (f+g) \<ge> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> fls_subdegree (f + g)
[PROOF STEP]
proof (cases "f+g = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. f + g = 0 \<Longrightarrow> 0 \<le> fls_subdegree (f + g)
 2. f + g \<noteq> 0 \<Longrightarrow> 0 \<le> fls_subdegree (f + g)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
f + g \<noteq> 0

goal (2 subgoals):
 1. f + g = 0 \<Longrightarrow> 0 \<le> fls_subdegree (f + g)
 2. f + g \<noteq> 0 \<Longrightarrow> 0 \<le> fls_subdegree (f + g)
[PROOF STEP]
with assms(1,2)
[PROOF STATE]
proof (chain)
picking this:
0 \<le> fls_subdegree f
0 \<le> fls_subdegree g
f + g \<noteq> 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
0 \<le> fls_subdegree f
0 \<le> fls_subdegree g
f + g \<noteq> 0

goal (1 subgoal):
 1. 0 \<le> fls_subdegree (f + g)
[PROOF STEP]
using fls_plus_subdegree
[PROOF STATE]
proof (prove)
using this:
0 \<le> fls_subdegree f
0 \<le> fls_subdegree g
f + g \<noteq> 0
?f + ?g \<noteq> 0 \<Longrightarrow> min (fls_subdegree ?f) (fls_subdegree ?g) \<le> fls_subdegree (?f + ?g)

goal (1 subgoal):
 1. 0 \<le> fls_subdegree (f + g)
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
0 \<le> fls_subdegree (f + g)

goal (1 subgoal):
 1. f + g = 0 \<Longrightarrow> 0 \<le> fls_subdegree (f + g)
[PROOF STEP]
qed simp
[PROOF STATE]
proof (state)
this:
0 \<le> fls_subdegree (f + g)

goal (2 subgoals):
 1. (f + g) * h = f * h + g * h
 2. h * (f + g) = h * f + h * g
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
0 \<le> fls_subdegree f
0 \<le> fls_subdegree g
0 \<le> fls_subdegree h
0 \<le> fls_subdegree (f + g)
[PROOF STEP]
show "(f + g) * h = f * h + g * h" "h * (f + g) = h * f + h * g"
[PROOF STATE]
proof (prove)
using this:
0 \<le> fls_subdegree f
0 \<le> fls_subdegree g
0 \<le> fls_subdegree h
0 \<le> fls_subdegree (f + g)

goal (1 subgoal):
 1. (f + g) * h = f * h + g * h &&& h * (f + g) = h * f + h * g
[PROOF STEP]
using distrib_right[of "fls_regpart f"] distrib_left[of "fls_regpart h"]
[PROOF STATE]
proof (prove)
using this:
0 \<le> fls_subdegree f
0 \<le> fls_subdegree g
0 \<le> fls_subdegree h
0 \<le> fls_subdegree (f + g)
(fls_regpart f + ?b) * ?c = fls_regpart f * ?c + ?b * ?c
fls_regpart h * (?b + ?c) = fls_regpart h * ?b + fls_regpart h * ?c

goal (1 subgoal):
 1. (f + g) * h = f * h + g * h &&& h * (f + g) = h * f + h * g
[PROOF STEP]
by    (simp_all add: fls_times_conv_fps_times)
[PROOF STATE]
proof (state)
this:
(f + g) * h = f * h + g * h
h * (f + g) = h * f + h * g

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma of_nat_add [simp]: "\<guillemotleft>m + n\<guillemotright>\<^sub>\<nat> = \<guillemotleft>m\<guillemotright>\<^sub>\<nat> \<oplus> \<guillemotleft>n\<guillemotright>\<^sub>\<nat>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<guillemotleft>m + n\<guillemotright>\<^sub>\<nat> = \<guillemotleft>m\<guillemotright>\<^sub>\<nat> \<oplus> \<guillemotleft>n\<guillemotright>\<^sub>\<nat>
[PROOF STEP]
by (induct m) (simp_all add: a_ac)


[STATEMENT]
lemma vcard_Aleph [simp]: "vcard (\<aleph>\<alpha>) = \<aleph>\<alpha>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vcard (\<aleph>\<alpha>) = \<aleph>\<alpha>
[PROOF STEP]
using Card_def InfCard_Aleph InfCard_def
[PROOF STATE]
proof (prove)
using this:
Card ?i \<equiv> ?i = vcard ?i
InfCard (\<aleph>?x)
InfCard ?\<kappa> \<equiv> Card ?\<kappa> \<and> \<omega> \<le> ?\<kappa>

goal (1 subgoal):
 1. vcard (\<aleph>\<alpha>) = \<aleph>\<alpha>
[PROOF STEP]
by auto


[STATEMENT]
lemma hom_nat_pow:
  "\<lbrakk>h \<in> hom G H; x \<in> carrier G; group G; group H\<rbrakk> \<Longrightarrow> h (x [^]\<^bsub>G\<^esub> (n :: nat)) = (h x) [^]\<^bsub>H\<^esub> n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>h \<in> hom G H; x \<in> carrier G; Group.group G; Group.group H\<rbrakk> \<Longrightarrow> h (x [^]\<^bsub>G\<^esub> n) = h x [^]\<^bsub>H\<^esub> n
[PROOF STEP]
by (simp add: group_hom.hom_nat_pow group_hom_axioms_def group_hom_def)


[STATEMENT]
lemma t1_space_alt:
   "t1_space X \<longleftrightarrow> (\<forall>x \<in> topspace X. \<forall>y \<in> topspace X. x\<noteq>y \<longrightarrow> (\<exists>U. closedin X U \<and> x \<in> U \<and> y \<notin> U))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. t1_space X = (\<forall>x\<in>topspace X. \<forall>y\<in>topspace X. x \<noteq> y \<longrightarrow> (\<exists>U. closedin X U \<and> x \<in> U \<and> y \<notin> U))
[PROOF STEP]
by (metis DiffE DiffI closedin_def openin_closedin_eq t1_space_def)


[STATEMENT]
lemma continuous_at_split:
  "continuous (at x) f \<longleftrightarrow> continuous (at_left x) f \<and> continuous (at_right x) f"
  for x :: "'a::linorder_topology"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. isCont f x = (continuous (at_left x) f \<and> continuous (at_right x) f)
[PROOF STEP]
by (simp add: continuous_within filterlim_at_split)


[STATEMENT]
theorem sum_lookup_costs:
  fixes t :: "'a :: linorder tree"
  assumes "bst t"
  shows   "(\<Sum>x\<in>set_tree t. lookup_cost x t) = ipl t"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>x\<in>set_tree t. lookup_cost x t) = ipl t
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
bst t

goal (1 subgoal):
 1. (\<Sum>x\<in>set_tree t. lookup_cost x t) = ipl t
[PROOF STEP]
proof (induction t)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. bst \<langle>\<rangle> \<Longrightarrow> (\<Sum>x\<in>set_tree \<langle>\<rangle>. lookup_cost x \<langle>\<rangle>) = ipl \<langle>\<rangle>
 2. \<And>t1 x2 t2. \<lbrakk>bst t1 \<Longrightarrow> (\<Sum>x\<in>set_tree t1. lookup_cost x t1) = ipl t1; bst t2 \<Longrightarrow> (\<Sum>x\<in>set_tree t2. lookup_cost x t2) = ipl t2; bst \<langle>t1, x2, t2\<rangle>\<rbrakk> \<Longrightarrow> (\<Sum>x\<in>set_tree \<langle>t1, x2, t2\<rangle>. lookup_cost x \<langle>t1, x2, t2\<rangle>) = ipl \<langle>t1, x2, t2\<rangle>
[PROOF STEP]
case (Node l x r)
[PROOF STATE]
proof (state)
this:
bst l \<Longrightarrow> (\<Sum>x\<in>set_tree l. lookup_cost x l) = ipl l
bst r \<Longrightarrow> (\<Sum>x\<in>set_tree r. lookup_cost x r) = ipl r
bst \<langle>l, x, r\<rangle>

goal (2 subgoals):
 1. bst \<langle>\<rangle> \<Longrightarrow> (\<Sum>x\<in>set_tree \<langle>\<rangle>. lookup_cost x \<langle>\<rangle>) = ipl \<langle>\<rangle>
 2. \<And>t1 x2 t2. \<lbrakk>bst t1 \<Longrightarrow> (\<Sum>x\<in>set_tree t1. lookup_cost x t1) = ipl t1; bst t2 \<Longrightarrow> (\<Sum>x\<in>set_tree t2. lookup_cost x t2) = ipl t2; bst \<langle>t1, x2, t2\<rangle>\<rbrakk> \<Longrightarrow> (\<Sum>x\<in>set_tree \<langle>t1, x2, t2\<rangle>. lookup_cost x \<langle>t1, x2, t2\<rangle>) = ipl \<langle>t1, x2, t2\<rangle>
[PROOF STEP]
from Node.prems
[PROOF STATE]
proof (chain)
picking this:
bst \<langle>l, x, r\<rangle>
[PROOF STEP]
have disj: "x \<notin> set_tree l" "x \<notin> set_tree r" "set_tree l \<inter> set_tree r = {}"
[PROOF STATE]
proof (prove)
using this:
bst \<langle>l, x, r\<rangle>

goal (1 subgoal):
 1. x \<notin> set_tree l &&& x \<notin> set_tree r &&& set_tree l \<inter> set_tree r = {}
[PROOF STEP]
by force+
[PROOF STATE]
proof (state)
this:
x \<notin> set_tree l
x \<notin> set_tree r
set_tree l \<inter> set_tree r = {}

goal (2 subgoals):
 1. bst \<langle>\<rangle> \<Longrightarrow> (\<Sum>x\<in>set_tree \<langle>\<rangle>. lookup_cost x \<langle>\<rangle>) = ipl \<langle>\<rangle>
 2. \<And>t1 x2 t2. \<lbrakk>bst t1 \<Longrightarrow> (\<Sum>x\<in>set_tree t1. lookup_cost x t1) = ipl t1; bst t2 \<Longrightarrow> (\<Sum>x\<in>set_tree t2. lookup_cost x t2) = ipl t2; bst \<langle>t1, x2, t2\<rangle>\<rbrakk> \<Longrightarrow> (\<Sum>x\<in>set_tree \<langle>t1, x2, t2\<rangle>. lookup_cost x \<langle>t1, x2, t2\<rangle>) = ipl \<langle>t1, x2, t2\<rangle>
[PROOF STEP]
have "set_tree (Node l x r) = insert x (set_tree l \<union> set_tree r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set_tree \<langle>l, x, r\<rangle> = insert x (set_tree l \<union> set_tree r)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
set_tree \<langle>l, x, r\<rangle> = insert x (set_tree l \<union> set_tree r)

goal (2 subgoals):
 1. bst \<langle>\<rangle> \<Longrightarrow> (\<Sum>x\<in>set_tree \<langle>\<rangle>. lookup_cost x \<langle>\<rangle>) = ipl \<langle>\<rangle>
 2. \<And>t1 x2 t2. \<lbrakk>bst t1 \<Longrightarrow> (\<Sum>x\<in>set_tree t1. lookup_cost x t1) = ipl t1; bst t2 \<Longrightarrow> (\<Sum>x\<in>set_tree t2. lookup_cost x t2) = ipl t2; bst \<langle>t1, x2, t2\<rangle>\<rbrakk> \<Longrightarrow> (\<Sum>x\<in>set_tree \<langle>t1, x2, t2\<rangle>. lookup_cost x \<langle>t1, x2, t2\<rangle>) = ipl \<langle>t1, x2, t2\<rangle>
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
set_tree \<langle>l, x, r\<rangle> = insert x (set_tree l \<union> set_tree r)

goal (2 subgoals):
 1. bst \<langle>\<rangle> \<Longrightarrow> (\<Sum>x\<in>set_tree \<langle>\<rangle>. lookup_cost x \<langle>\<rangle>) = ipl \<langle>\<rangle>
 2. \<And>t1 x2 t2. \<lbrakk>bst t1 \<Longrightarrow> (\<Sum>x\<in>set_tree t1. lookup_cost x t1) = ipl t1; bst t2 \<Longrightarrow> (\<Sum>x\<in>set_tree t2. lookup_cost x t2) = ipl t2; bst \<langle>t1, x2, t2\<rangle>\<rbrakk> \<Longrightarrow> (\<Sum>x\<in>set_tree \<langle>t1, x2, t2\<rangle>. lookup_cost x \<langle>t1, x2, t2\<rangle>) = ipl \<langle>t1, x2, t2\<rangle>
[PROOF STEP]
have "(\<Sum>y\<in>\<dots>. lookup_cost y (Node l x r)) = lookup_cost x \<langle>l, x, r\<rangle> +
               (\<Sum>y\<in>set_tree l. lookup_cost y \<langle>l, x, r\<rangle>) + (\<Sum>y\<in>set_tree r. lookup_cost y \<langle>l, x, r\<rangle>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>y\<in>insert x (set_tree l \<union> set_tree r). lookup_cost y \<langle>l, x, r\<rangle>) = lookup_cost x \<langle>l, x, r\<rangle> + (\<Sum>y\<in>set_tree l. lookup_cost y \<langle>l, x, r\<rangle>) + (\<Sum>y\<in>set_tree r. lookup_cost y \<langle>l, x, r\<rangle>)
[PROOF STEP]
using disj
[PROOF STATE]
proof (prove)
using this:
x \<notin> set_tree l
x \<notin> set_tree r
set_tree l \<inter> set_tree r = {}

goal (1 subgoal):
 1. (\<Sum>y\<in>insert x (set_tree l \<union> set_tree r). lookup_cost y \<langle>l, x, r\<rangle>) = lookup_cost x \<langle>l, x, r\<rangle> + (\<Sum>y\<in>set_tree l. lookup_cost y \<langle>l, x, r\<rangle>) + (\<Sum>y\<in>set_tree r. lookup_cost y \<langle>l, x, r\<rangle>)
[PROOF STEP]
by (simp add: sum.union_disjoint)
[PROOF STATE]
proof (state)
this:
(\<Sum>y\<in>insert x (set_tree l \<union> set_tree r). lookup_cost y \<langle>l, x, r\<rangle>) = lookup_cost x \<langle>l, x, r\<rangle> + (\<Sum>y\<in>set_tree l. lookup_cost y \<langle>l, x, r\<rangle>) + (\<Sum>y\<in>set_tree r. lookup_cost y \<langle>l, x, r\<rangle>)

goal (2 subgoals):
 1. bst \<langle>\<rangle> \<Longrightarrow> (\<Sum>x\<in>set_tree \<langle>\<rangle>. lookup_cost x \<langle>\<rangle>) = ipl \<langle>\<rangle>
 2. \<And>t1 x2 t2. \<lbrakk>bst t1 \<Longrightarrow> (\<Sum>x\<in>set_tree t1. lookup_cost x t1) = ipl t1; bst t2 \<Longrightarrow> (\<Sum>x\<in>set_tree t2. lookup_cost x t2) = ipl t2; bst \<langle>t1, x2, t2\<rangle>\<rbrakk> \<Longrightarrow> (\<Sum>x\<in>set_tree \<langle>t1, x2, t2\<rangle>. lookup_cost x \<langle>t1, x2, t2\<rangle>) = ipl \<langle>t1, x2, t2\<rangle>
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>y\<in>insert x (set_tree l \<union> set_tree r). lookup_cost y \<langle>l, x, r\<rangle>) = lookup_cost x \<langle>l, x, r\<rangle> + (\<Sum>y\<in>set_tree l. lookup_cost y \<langle>l, x, r\<rangle>) + (\<Sum>y\<in>set_tree r. lookup_cost y \<langle>l, x, r\<rangle>)

goal (2 subgoals):
 1. bst \<langle>\<rangle> \<Longrightarrow> (\<Sum>x\<in>set_tree \<langle>\<rangle>. lookup_cost x \<langle>\<rangle>) = ipl \<langle>\<rangle>
 2. \<And>t1 x2 t2. \<lbrakk>bst t1 \<Longrightarrow> (\<Sum>x\<in>set_tree t1. lookup_cost x t1) = ipl t1; bst t2 \<Longrightarrow> (\<Sum>x\<in>set_tree t2. lookup_cost x t2) = ipl t2; bst \<langle>t1, x2, t2\<rangle>\<rbrakk> \<Longrightarrow> (\<Sum>x\<in>set_tree \<langle>t1, x2, t2\<rangle>. lookup_cost x \<langle>t1, x2, t2\<rangle>) = ipl \<langle>t1, x2, t2\<rangle>
[PROOF STEP]
have "(\<Sum>y\<in>set_tree l. lookup_cost y \<langle>l, x, r\<rangle>) = (\<Sum>y\<in>set_tree l. 1 + lookup_cost y l)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>y\<in>set_tree l. lookup_cost y \<langle>l, x, r\<rangle>) = (\<Sum>y\<in>set_tree l. 1 + lookup_cost y l)
[PROOF STEP]
using disj and Node
[PROOF STATE]
proof (prove)
using this:
x \<notin> set_tree l
x \<notin> set_tree r
set_tree l \<inter> set_tree r = {}
bst l \<Longrightarrow> (\<Sum>x\<in>set_tree l. lookup_cost x l) = ipl l
bst r \<Longrightarrow> (\<Sum>x\<in>set_tree r. lookup_cost x r) = ipl r
bst \<langle>l, x, r\<rangle>

goal (1 subgoal):
 1. (\<Sum>y\<in>set_tree l. lookup_cost y \<langle>l, x, r\<rangle>) = (\<Sum>y\<in>set_tree l. 1 + lookup_cost y l)
[PROOF STEP]
by (intro sum.cong refl) auto
[PROOF STATE]
proof (state)
this:
(\<Sum>y\<in>set_tree l. lookup_cost y \<langle>l, x, r\<rangle>) = (\<Sum>y\<in>set_tree l. 1 + lookup_cost y l)

goal (2 subgoals):
 1. bst \<langle>\<rangle> \<Longrightarrow> (\<Sum>x\<in>set_tree \<langle>\<rangle>. lookup_cost x \<langle>\<rangle>) = ipl \<langle>\<rangle>
 2. \<And>t1 x2 t2. \<lbrakk>bst t1 \<Longrightarrow> (\<Sum>x\<in>set_tree t1. lookup_cost x t1) = ipl t1; bst t2 \<Longrightarrow> (\<Sum>x\<in>set_tree t2. lookup_cost x t2) = ipl t2; bst \<langle>t1, x2, t2\<rangle>\<rbrakk> \<Longrightarrow> (\<Sum>x\<in>set_tree \<langle>t1, x2, t2\<rangle>. lookup_cost x \<langle>t1, x2, t2\<rangle>) = ipl \<langle>t1, x2, t2\<rangle>
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>y\<in>set_tree l. lookup_cost y \<langle>l, x, r\<rangle>) = (\<Sum>y\<in>set_tree l. 1 + lookup_cost y l)

goal (2 subgoals):
 1. bst \<langle>\<rangle> \<Longrightarrow> (\<Sum>x\<in>set_tree \<langle>\<rangle>. lookup_cost x \<langle>\<rangle>) = ipl \<langle>\<rangle>
 2. \<And>t1 x2 t2. \<lbrakk>bst t1 \<Longrightarrow> (\<Sum>x\<in>set_tree t1. lookup_cost x t1) = ipl t1; bst t2 \<Longrightarrow> (\<Sum>x\<in>set_tree t2. lookup_cost x t2) = ipl t2; bst \<langle>t1, x2, t2\<rangle>\<rbrakk> \<Longrightarrow> (\<Sum>x\<in>set_tree \<langle>t1, x2, t2\<rangle>. lookup_cost x \<langle>t1, x2, t2\<rangle>) = ipl \<langle>t1, x2, t2\<rangle>
[PROOF STEP]
have "\<dots> = size l + ipl l"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>y\<in>set_tree l. 1 + lookup_cost y l) = size l + ipl l
[PROOF STEP]
using Node
[PROOF STATE]
proof (prove)
using this:
bst l \<Longrightarrow> (\<Sum>x\<in>set_tree l. lookup_cost x l) = ipl l
bst r \<Longrightarrow> (\<Sum>x\<in>set_tree r. lookup_cost x r) = ipl r
bst \<langle>l, x, r\<rangle>

goal (1 subgoal):
 1. (\<Sum>y\<in>set_tree l. 1 + lookup_cost y l) = size l + ipl l
[PROOF STEP]
by (subst sum.distrib) (simp_all add: card_set_tree_bst)
[PROOF STATE]
proof (state)
this:
(\<Sum>y\<in>set_tree l. 1 + lookup_cost y l) = size l + ipl l

goal (2 subgoals):
 1. bst \<langle>\<rangle> \<Longrightarrow> (\<Sum>x\<in>set_tree \<langle>\<rangle>. lookup_cost x \<langle>\<rangle>) = ipl \<langle>\<rangle>
 2. \<And>t1 x2 t2. \<lbrakk>bst t1 \<Longrightarrow> (\<Sum>x\<in>set_tree t1. lookup_cost x t1) = ipl t1; bst t2 \<Longrightarrow> (\<Sum>x\<in>set_tree t2. lookup_cost x t2) = ipl t2; bst \<langle>t1, x2, t2\<rangle>\<rbrakk> \<Longrightarrow> (\<Sum>x\<in>set_tree \<langle>t1, x2, t2\<rangle>. lookup_cost x \<langle>t1, x2, t2\<rangle>) = ipl \<langle>t1, x2, t2\<rangle>
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>y\<in>set_tree l. 1 + lookup_cost y l) = size l + ipl l

goal (2 subgoals):
 1. bst \<langle>\<rangle> \<Longrightarrow> (\<Sum>x\<in>set_tree \<langle>\<rangle>. lookup_cost x \<langle>\<rangle>) = ipl \<langle>\<rangle>
 2. \<And>t1 x2 t2. \<lbrakk>bst t1 \<Longrightarrow> (\<Sum>x\<in>set_tree t1. lookup_cost x t1) = ipl t1; bst t2 \<Longrightarrow> (\<Sum>x\<in>set_tree t2. lookup_cost x t2) = ipl t2; bst \<langle>t1, x2, t2\<rangle>\<rbrakk> \<Longrightarrow> (\<Sum>x\<in>set_tree \<langle>t1, x2, t2\<rangle>. lookup_cost x \<langle>t1, x2, t2\<rangle>) = ipl \<langle>t1, x2, t2\<rangle>
[PROOF STEP]
have "(\<Sum>y\<in>set_tree r. lookup_cost y \<langle>l, x, r\<rangle>) = (\<Sum>y\<in>set_tree r. 1 + lookup_cost y r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>y\<in>set_tree r. lookup_cost y \<langle>l, x, r\<rangle>) = (\<Sum>y\<in>set_tree r. 1 + lookup_cost y r)
[PROOF STEP]
using disj and Node
[PROOF STATE]
proof (prove)
using this:
x \<notin> set_tree l
x \<notin> set_tree r
set_tree l \<inter> set_tree r = {}
bst l \<Longrightarrow> (\<Sum>x\<in>set_tree l. lookup_cost x l) = ipl l
bst r \<Longrightarrow> (\<Sum>x\<in>set_tree r. lookup_cost x r) = ipl r
bst \<langle>l, x, r\<rangle>

goal (1 subgoal):
 1. (\<Sum>y\<in>set_tree r. lookup_cost y \<langle>l, x, r\<rangle>) = (\<Sum>y\<in>set_tree r. 1 + lookup_cost y r)
[PROOF STEP]
by (intro sum.cong refl) auto
[PROOF STATE]
proof (state)
this:
(\<Sum>y\<in>set_tree r. lookup_cost y \<langle>l, x, r\<rangle>) = (\<Sum>y\<in>set_tree r. 1 + lookup_cost y r)

goal (2 subgoals):
 1. bst \<langle>\<rangle> \<Longrightarrow> (\<Sum>x\<in>set_tree \<langle>\<rangle>. lookup_cost x \<langle>\<rangle>) = ipl \<langle>\<rangle>
 2. \<And>t1 x2 t2. \<lbrakk>bst t1 \<Longrightarrow> (\<Sum>x\<in>set_tree t1. lookup_cost x t1) = ipl t1; bst t2 \<Longrightarrow> (\<Sum>x\<in>set_tree t2. lookup_cost x t2) = ipl t2; bst \<langle>t1, x2, t2\<rangle>\<rbrakk> \<Longrightarrow> (\<Sum>x\<in>set_tree \<langle>t1, x2, t2\<rangle>. lookup_cost x \<langle>t1, x2, t2\<rangle>) = ipl \<langle>t1, x2, t2\<rangle>
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>y\<in>set_tree r. lookup_cost y \<langle>l, x, r\<rangle>) = (\<Sum>y\<in>set_tree r. 1 + lookup_cost y r)

goal (2 subgoals):
 1. bst \<langle>\<rangle> \<Longrightarrow> (\<Sum>x\<in>set_tree \<langle>\<rangle>. lookup_cost x \<langle>\<rangle>) = ipl \<langle>\<rangle>
 2. \<And>t1 x2 t2. \<lbrakk>bst t1 \<Longrightarrow> (\<Sum>x\<in>set_tree t1. lookup_cost x t1) = ipl t1; bst t2 \<Longrightarrow> (\<Sum>x\<in>set_tree t2. lookup_cost x t2) = ipl t2; bst \<langle>t1, x2, t2\<rangle>\<rbrakk> \<Longrightarrow> (\<Sum>x\<in>set_tree \<langle>t1, x2, t2\<rangle>. lookup_cost x \<langle>t1, x2, t2\<rangle>) = ipl \<langle>t1, x2, t2\<rangle>
[PROOF STEP]
have "\<dots> = size r + ipl r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>y\<in>set_tree r. 1 + lookup_cost y r) = size r + ipl r
[PROOF STEP]
using Node
[PROOF STATE]
proof (prove)
using this:
bst l \<Longrightarrow> (\<Sum>x\<in>set_tree l. lookup_cost x l) = ipl l
bst r \<Longrightarrow> (\<Sum>x\<in>set_tree r. lookup_cost x r) = ipl r
bst \<langle>l, x, r\<rangle>

goal (1 subgoal):
 1. (\<Sum>y\<in>set_tree r. 1 + lookup_cost y r) = size r + ipl r
[PROOF STEP]
by (subst sum.distrib) (simp_all add: card_set_tree_bst)
[PROOF STATE]
proof (state)
this:
(\<Sum>y\<in>set_tree r. 1 + lookup_cost y r) = size r + ipl r

goal (2 subgoals):
 1. bst \<langle>\<rangle> \<Longrightarrow> (\<Sum>x\<in>set_tree \<langle>\<rangle>. lookup_cost x \<langle>\<rangle>) = ipl \<langle>\<rangle>
 2. \<And>t1 x2 t2. \<lbrakk>bst t1 \<Longrightarrow> (\<Sum>x\<in>set_tree t1. lookup_cost x t1) = ipl t1; bst t2 \<Longrightarrow> (\<Sum>x\<in>set_tree t2. lookup_cost x t2) = ipl t2; bst \<langle>t1, x2, t2\<rangle>\<rbrakk> \<Longrightarrow> (\<Sum>x\<in>set_tree \<langle>t1, x2, t2\<rangle>. lookup_cost x \<langle>t1, x2, t2\<rangle>) = ipl \<langle>t1, x2, t2\<rangle>
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<Sum>y\<in>set_tree \<langle>l, x, r\<rangle>. lookup_cost y \<langle>l, x, r\<rangle>) = lookup_cost x \<langle>l, x, r\<rangle> + (size l + ipl l) + (size r + ipl r)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
(\<Sum>y\<in>set_tree \<langle>l, x, r\<rangle>. lookup_cost y \<langle>l, x, r\<rangle>) = lookup_cost x \<langle>l, x, r\<rangle> + (size l + ipl l) + (size r + ipl r)

goal (1 subgoal):
 1. (\<Sum>xa\<in>set_tree \<langle>l, x, r\<rangle>. lookup_cost xa \<langle>l, x, r\<rangle>) = ipl \<langle>l, x, r\<rangle>
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<Sum>xa\<in>set_tree \<langle>l, x, r\<rangle>. lookup_cost xa \<langle>l, x, r\<rangle>) = ipl \<langle>l, x, r\<rangle>

goal (1 subgoal):
 1. bst \<langle>\<rangle> \<Longrightarrow> (\<Sum>x\<in>set_tree \<langle>\<rangle>. lookup_cost x \<langle>\<rangle>) = ipl \<langle>\<rangle>
[PROOF STEP]
qed simp_all


[STATEMENT]
lemma if_subst: "(if indep (insert e T) then
              RETURN (insert e T)
            else
              RETURN T)
        = (if e\<notin> T \<and> indep (insert e T) then
              RETURN (insert e T)
            else
              RETURN T)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if indep (insert e T) then RETURN (insert e T) else RETURN T) = (if e \<notin> T \<and> indep (insert e T) then RETURN (insert e T) else RETURN T)
[PROOF STEP]
by auto


[STATEMENT]
lemma inverse_const_fds [simp]:
  "inverse (fds_const c :: 'a :: field fds) = fds_const (inverse c)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inverse (fds_const c) = fds_const (inverse c)
[PROOF STEP]
proof (cases "c = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. c = (0::'a) \<Longrightarrow> inverse (fds_const c) = fds_const (inverse c)
 2. c \<noteq> (0::'a) \<Longrightarrow> inverse (fds_const c) = fds_const (inverse c)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
c \<noteq> (0::'a)

goal (2 subgoals):
 1. c = (0::'a) \<Longrightarrow> inverse (fds_const c) = fds_const (inverse c)
 2. c \<noteq> (0::'a) \<Longrightarrow> inverse (fds_const c) = fds_const (inverse c)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
c \<noteq> (0::'a)

goal (1 subgoal):
 1. inverse (fds_const c) = fds_const (inverse c)
[PROOF STEP]
by (intro fds_right_inverse_unique[symmetric])
       (auto simp del: fds_const_mult simp: fds_const_mult [symmetric])
[PROOF STATE]
proof (state)
this:
inverse (fds_const c) = fds_const (inverse c)

goal (1 subgoal):
 1. c = (0::'a) \<Longrightarrow> inverse (fds_const c) = fds_const (inverse c)
[PROOF STEP]
qed auto


[STATEMENT]
lemma (in category) cat_cf_lcomp_Hom_ObjMap_vrange:
  assumes "\<FF> : \<BB> \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> \<CC>"
  shows "\<R>\<^sub>\<circ> (Hom\<^sub>O\<^sub>.\<^sub>C\<^bsub>\<alpha>\<^esub>\<CC>(\<FF>-,-)\<lparr>ObjMap\<rparr>) \<subseteq>\<^sub>\<circ> cat_Set \<alpha>\<lparr>Obj\<rparr>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<R>\<^sub>\<circ> (Hom\<^sub>O\<^sub>.\<^sub>C\<^bsub>\<alpha>\<^esub>\<CC>(\<FF>-,-)\<lparr>ObjMap\<rparr>) \<subseteq>\<^sub>\<circ> cat_Set \<alpha>\<lparr>Obj\<rparr>
[PROOF STEP]
using category_axioms assms
[PROOF STATE]
proof (prove)
using this:
category \<alpha> \<CC>
\<FF> : \<BB> \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> \<CC>

goal (1 subgoal):
 1. \<R>\<^sub>\<circ> (Hom\<^sub>O\<^sub>.\<^sub>C\<^bsub>\<alpha>\<^esub>\<CC>(\<FF>-,-)\<lparr>ObjMap\<rparr>) \<subseteq>\<^sub>\<circ> cat_Set \<alpha>\<lparr>Obj\<rparr>
[PROOF STEP]
unfolding cf_lcomp_Hom_def
[PROOF STATE]
proof (prove)
using this:
category \<alpha> \<CC>
\<FF> : \<BB> \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> \<CC>

goal (1 subgoal):
 1. \<R>\<^sub>\<circ> (cf_cn_cov_lcomp \<CC> Hom\<^sub>O\<^sub>.\<^sub>C\<^bsub>\<alpha>\<^esub>\<CC>(-,-) \<FF>\<lparr>ObjMap\<rparr>) \<subseteq>\<^sub>\<circ> cat_Set \<alpha>\<lparr>Obj\<rparr>
[PROOF STEP]
by (intro cf_cn_cov_lcomp_ObjMap_vrange)
    (cs_concl cs_shallow cs_intro: cat_cs_intros)


[STATEMENT]
lemma matrix_vector_mult_add_rdistrib [algebra_simps]:
  "(A + B) *v x = (A *v x) + (B *v x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (A + B) *v x = A *v x + B *v x
[PROOF STEP]
by (vector matrix_vector_mult_def sum.distrib distrib_right)


[STATEMENT]
lemma convex_hyperplane: "convex {x. inner a x = b}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. convex {x. a \<bullet> x = b}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. convex {x. a \<bullet> x = b}
[PROOF STEP]
have *: "{x. inner a x = b} = {x. inner a x \<le> b} \<inter> {x. inner a x \<ge> b}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {x. a \<bullet> x = b} = {x. a \<bullet> x \<le> b} \<inter> {x. b \<le> a \<bullet> x}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{x. a \<bullet> x = b} = {x. a \<bullet> x \<le> b} \<inter> {x. b \<le> a \<bullet> x}

goal (1 subgoal):
 1. convex {x. a \<bullet> x = b}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. convex {x. a \<bullet> x = b}
[PROOF STEP]
using convex_halfspace_le convex_halfspace_ge
[PROOF STATE]
proof (prove)
using this:
convex {x. ?a \<bullet> x \<le> ?b}
convex {x. ?b \<le> ?a \<bullet> x}

goal (1 subgoal):
 1. convex {x. a \<bullet> x = b}
[PROOF STEP]
by (auto intro!: convex_Int simp: *)
[PROOF STATE]
proof (state)
this:
convex {x. a \<bullet> x = b}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma nth_prime_partition'':
  assumes "x \<ge> (2 :: real)"
  shows "x \<in> {real (nth_prime (nat \<lfloor>\<pi> x\<rfloor> - 1))..<real (nth_prime (nat \<lfloor>\<pi> x\<rfloor>))}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> {real (nth_prime (nat \<lfloor>\<pi> x\<rfloor> - 1))..<real (nth_prime (nat \<lfloor>\<pi> x\<rfloor>))}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x \<in> {real (nth_prime (nat \<lfloor>\<pi> x\<rfloor> - 1))..<real (nth_prime (nat \<lfloor>\<pi> x\<rfloor>))}
[PROOF STEP]
obtain n where n: "x \<in> {nth_prime n..<nth_prime (Suc n)}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>n. x \<in> {real (nth_prime n)..<real (nth_prime (Suc n))} \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using nth_prime_partition' assms
[PROOF STATE]
proof (prove)
using this:
2 \<le> ?x \<Longrightarrow> \<exists>k. ?x \<in> {real (nth_prime k)..<real (nth_prime (Suc k))}
2 \<le> x

goal (1 subgoal):
 1. (\<And>n. x \<in> {real (nth_prime n)..<real (nth_prime (Suc n))} \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x \<in> {real (nth_prime n)..<real (nth_prime (Suc n))}

goal (1 subgoal):
 1. x \<in> {real (nth_prime (nat \<lfloor>\<pi> x\<rfloor> - 1))..<real (nth_prime (nat \<lfloor>\<pi> x\<rfloor>))}
[PROOF STEP]
have "\<pi> (nth_prime n) = \<pi> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<pi> (real (nth_prime n)) = \<pi> x
[PROOF STEP]
unfolding \<pi>_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prime_sum_upto (\<lambda>p. 1) (real (nth_prime n)) = prime_sum_upto (\<lambda>p. 1) x
[PROOF STEP]
using between_nth_primes_imp_nonprime n
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>nth_prime ?k < ?n; ?n < nth_prime (Suc ?k)\<rbrakk> \<Longrightarrow> \<not> prime ?n
x \<in> {real (nth_prime n)..<real (nth_prime (Suc n))}

goal (1 subgoal):
 1. prime_sum_upto (\<lambda>p. 1) (real (nth_prime n)) = prime_sum_upto (\<lambda>p. 1) x
[PROOF STEP]
by (intro prime_sum_upto_eqI) (auto simp: le_nat_iff le_floor_iff)
[PROOF STATE]
proof (state)
this:
\<pi> (real (nth_prime n)) = \<pi> x

goal (1 subgoal):
 1. x \<in> {real (nth_prime (nat \<lfloor>\<pi> x\<rfloor> - 1))..<real (nth_prime (nat \<lfloor>\<pi> x\<rfloor>))}
[PROOF STEP]
hence "real n = \<pi> x - 1"
[PROOF STATE]
proof (prove)
using this:
\<pi> (real (nth_prime n)) = \<pi> x

goal (1 subgoal):
 1. real n = \<pi> x - 1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
real n = \<pi> x - 1

goal (1 subgoal):
 1. x \<in> {real (nth_prime (nat \<lfloor>\<pi> x\<rfloor> - 1))..<real (nth_prime (nat \<lfloor>\<pi> x\<rfloor>))}
[PROOF STEP]
hence n_eq: "n = nat \<lfloor>\<pi> x\<rfloor> - 1" "Suc n = nat \<lfloor>\<pi> x\<rfloor>"
[PROOF STATE]
proof (prove)
using this:
real n = \<pi> x - 1

goal (1 subgoal):
 1. n = nat \<lfloor>\<pi> x\<rfloor> - 1 &&& Suc n = nat \<lfloor>\<pi> x\<rfloor>
[PROOF STEP]
by linarith+
[PROOF STATE]
proof (state)
this:
n = nat \<lfloor>\<pi> x\<rfloor> - 1
Suc n = nat \<lfloor>\<pi> x\<rfloor>

goal (1 subgoal):
 1. x \<in> {real (nth_prime (nat \<lfloor>\<pi> x\<rfloor> - 1))..<real (nth_prime (nat \<lfloor>\<pi> x\<rfloor>))}
[PROOF STEP]
with n
[PROOF STATE]
proof (chain)
picking this:
x \<in> {real (nth_prime n)..<real (nth_prime (Suc n))}
n = nat \<lfloor>\<pi> x\<rfloor> - 1
Suc n = nat \<lfloor>\<pi> x\<rfloor>
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
x \<in> {real (nth_prime n)..<real (nth_prime (Suc n))}
n = nat \<lfloor>\<pi> x\<rfloor> - 1
Suc n = nat \<lfloor>\<pi> x\<rfloor>

goal (1 subgoal):
 1. x \<in> {real (nth_prime (nat \<lfloor>\<pi> x\<rfloor> - 1))..<real (nth_prime (nat \<lfloor>\<pi> x\<rfloor>))}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
x \<in> {real (nth_prime (nat \<lfloor>\<pi> x\<rfloor> - 1))..<real (nth_prime (nat \<lfloor>\<pi> x\<rfloor>))}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ai_1_gt:
  assumes "\<And>n. a n \<in> {0,1}"
      and "a i = 1"
    shows "(1/2)^(Suc i) \<le> (\<Sum>n::nat. real (a (n+i)) * (1/2)^(Suc (n+i)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (1 / 2) ^ Suc i \<le> (\<Sum>n. real (a (n + i)) * (1 / 2) ^ Suc (n + i))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (1 / 2) ^ Suc i \<le> (\<Sum>n. real (a (n + i)) * (1 / 2) ^ Suc (n + i))
[PROOF STEP]
have 1:"(\<Sum>n::nat. real (a (n+i)) * (1/2)^(Suc (n+i))) = (1 / 2) ^ Suc (0 + i) + (\<Sum>n. real (a (Suc n + i)) * (1 / 2) ^ Suc (Suc n + i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>n. real (a (n + i)) * (1 / 2) ^ Suc (n + i)) = (1 / 2) ^ Suc (0 + i) + (\<Sum>n. real (a (Suc n + i)) * (1 / 2) ^ Suc (Suc n + i))
[PROOF STEP]
using suminf_split_head[of "\<lambda>n. real (a (n+i)) * (1/2)^(Suc (n+i))"] binary_expression_summable[of a] summable_iff_shift[of "\<lambda>n. real (a n) * (1 / 2) ^ Suc n" i] assms
[PROOF STATE]
proof (prove)
using this:
summable (\<lambda>n. real (a (n + i)) * (1 / 2) ^ Suc (n + i)) \<Longrightarrow> (\<Sum>n. real (a (Suc n + i)) * (1 / 2) ^ Suc (Suc n + i)) = (\<Sum>n. real (a (n + i)) * (1 / 2) ^ Suc (n + i)) - real (a (0 + i)) * (1 / 2) ^ Suc (0 + i)
(\<And>n. a n \<in> {0, 1}) \<Longrightarrow> summable (\<lambda>n. real (a n) * (1 / 2) ^ Suc n)
summable (\<lambda>n. real (a (n + i)) * (1 / 2) ^ Suc (n + i)) = summable (\<lambda>n. real (a n) * (1 / 2) ^ Suc n)
a ?n \<in> {0, 1}
a i = 1

goal (1 subgoal):
 1. (\<Sum>n. real (a (n + i)) * (1 / 2) ^ Suc (n + i)) = (1 / 2) ^ Suc (0 + i) + (\<Sum>n. real (a (Suc n + i)) * (1 / 2) ^ Suc (Suc n + i))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<Sum>n. real (a (n + i)) * (1 / 2) ^ Suc (n + i)) = (1 / 2) ^ Suc (0 + i) + (\<Sum>n. real (a (Suc n + i)) * (1 / 2) ^ Suc (Suc n + i))

goal (1 subgoal):
 1. (1 / 2) ^ Suc i \<le> (\<Sum>n. real (a (n + i)) * (1 / 2) ^ Suc (n + i))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (1 / 2) ^ Suc i \<le> (\<Sum>n. real (a (n + i)) * (1 / 2) ^ Suc (n + i))
[PROOF STEP]
using 1 binary_expression_gteq0[of a "Suc i"] assms(1)
[PROOF STATE]
proof (prove)
using this:
(\<Sum>n. real (a (n + i)) * (1 / 2) ^ Suc (n + i)) = (1 / 2) ^ Suc (0 + i) + (\<Sum>n. real (a (Suc n + i)) * (1 / 2) ^ Suc (Suc n + i))
(\<And>n. a n \<in> {0, 1}) \<Longrightarrow> 0 \<le> (\<Sum>n. real (a (n + Suc i)) * (1 / 2) ^ Suc (n + Suc i))
a ?n \<in> {0, 1}

goal (1 subgoal):
 1. (1 / 2) ^ Suc i \<le> (\<Sum>n. real (a (n + i)) * (1 / 2) ^ Suc (n + i))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(1 / 2) ^ Suc i \<le> (\<Sum>n. real (a (n + i)) * (1 / 2) ^ Suc (n + i))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma eq_designs_isomorphic:
  assumes "\<V> = \<V>'"
  assumes "\<B> = \<B>'"
  shows "(\<V>, \<B>) \<cong>\<^sub>D (\<V>', \<B>')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<V>, \<B>) \<cong>\<^sub>D (\<V>', \<B>')
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<V>, \<B>) \<cong>\<^sub>D (\<V>', \<B>')
[PROOF STEP]
interpret d1: design \<V> \<B>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. design \<V> \<B>
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<V> = \<V>'
\<B> = \<B>'

goal (1 subgoal):
 1. design \<V> \<B>
[PROOF STEP]
using wf_design
[PROOF STATE]
proof (prove)
using this:
\<V> = \<V>'
\<B> = \<B>'
design \<V> \<B>

goal (1 subgoal):
 1. design \<V> \<B>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<V>, \<B>) \<cong>\<^sub>D (\<V>', \<B>')
[PROOF STEP]
interpret d2: design \<V>' \<B>'
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. design \<V>' \<B>'
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<V> = \<V>'
\<B> = \<B>'

goal (1 subgoal):
 1. design \<V>' \<B>'
[PROOF STEP]
using wf_design
[PROOF STATE]
proof (prove)
using this:
\<V> = \<V>'
\<B> = \<B>'
design \<V> \<B>

goal (1 subgoal):
 1. design \<V>' \<B>'
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<V>, \<B>) \<cong>\<^sub>D (\<V>', \<B>')
[PROOF STEP]
have "design_isomorphism \<V> \<B> \<V>' \<B>' id"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. design_isomorphism \<V> \<B> \<V>' \<B>' id
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<V> = \<V>'
\<B> = \<B>'

goal (1 subgoal):
 1. design_isomorphism \<V> \<B> \<V>' \<B>' id
[PROOF STEP]
by (unfold_locales) simp_all
[PROOF STATE]
proof (state)
this:
design_isomorphism \<V> \<B> \<V>' \<B>' id

goal (1 subgoal):
 1. (\<V>, \<B>) \<cong>\<^sub>D (\<V>', \<B>')
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
design_isomorphism \<V> \<B> \<V>' \<B>' id

goal (1 subgoal):
 1. (\<V>, \<B>) \<cong>\<^sub>D (\<V>', \<B>')
[PROOF STEP]
unfolding isomorphic_designs_def
[PROOF STATE]
proof (prove)
using this:
design_isomorphism \<V> \<B> \<V>' \<B>' id

goal (1 subgoal):
 1. Ex (design_isomorphism (fst (\<V>, \<B>)) (snd (\<V>, \<B>)) (fst (\<V>', \<B>')) (snd (\<V>', \<B>')))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<V>, \<B>) \<cong>\<^sub>D (\<V>', \<B>')

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem nth_solution_sound' [intro]: "n > 0 \<Longrightarrow> nontriv_solution (nth_solution n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < n \<Longrightarrow> nontriv_solution (nth_solution n)
[PROOF STEP]
using fund_sol_is_nontriv_solution
[PROOF STATE]
proof (prove)
using this:
nontriv_solution fund_sol

goal (1 subgoal):
 1. 0 < n \<Longrightarrow> nontriv_solution (nth_solution n)
[PROOF STEP]
by (auto simp: nth_solution_def)


[STATEMENT]
lemma sqrt_le_iff: "Discrete.sqrt y \<le> x \<longleftrightarrow> (\<forall>z. z^2 \<le> y \<longrightarrow> z \<le> x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (local.sqrt y \<le> x) = (\<forall>z. z\<^sup>2 \<le> y \<longrightarrow> z \<le> x)
[PROOF STEP]
using Max.bounded_iff[OF Discrete.sqrt_aux]
[PROOF STATE]
proof (prove)
using this:
(Max {m. m\<^sup>2 \<le> ?n1} \<le> ?x) = (\<forall>a\<in>{m. m\<^sup>2 \<le> ?n1}. a \<le> ?x)

goal (1 subgoal):
 1. (local.sqrt y \<le> x) = (\<forall>z. z\<^sup>2 \<le> y \<longrightarrow> z \<le> x)
[PROOF STEP]
by (simp add: Discrete.sqrt_def)


[STATEMENT]
lemma (in Group) ZassenhausTr2_7:"\<lbrakk>a \<in> carrier G; x \<in> carrier G; y \<in> carrier G\<rbrakk>
        \<Longrightarrow> a \<cdot> ( x \<cdot> y) \<cdot> (\<rho> a) = a \<cdot> x \<cdot> (\<rho> a) \<cdot> (a \<cdot> y \<cdot> (\<rho> a))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<in> carrier G; x \<in> carrier G; y \<in> carrier G\<rbrakk> \<Longrightarrow> a \<cdot> (x \<cdot> y) \<cdot> \<rho> a = a \<cdot> x \<cdot> \<rho> a \<cdot> (a \<cdot> y \<cdot> \<rho> a)
[PROOF STEP]
apply (frule i_closed[of "a"],
       frule mult_closed[of "a" "y"], assumption+,
       frule mult_closed[of "a \<cdot> y" "\<rho> a"], assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<in> carrier G; x \<in> carrier G; y \<in> carrier G; \<rho> a \<in> carrier G; a \<cdot> y \<in> carrier G; a \<cdot> y \<cdot> \<rho> a \<in> carrier G\<rbrakk> \<Longrightarrow> a \<cdot> (x \<cdot> y) \<cdot> \<rho> a = a \<cdot> x \<cdot> \<rho> a \<cdot> (a \<cdot> y \<cdot> \<rho> a)
[PROOF STEP]
apply (simp add:tOp_assocTr41[of "a" "x" "\<rho> a" "a \<cdot> y \<cdot> (\<rho> a)"],
       simp add:tassoc[THEN sym, of "\<rho> a" "a \<cdot> y" "\<rho> a"],
       simp add:tassoc[THEN sym, of "\<rho> a" "a" "y"] l_i l_unit,
       simp add:tOp_assocTr41[THEN sym],
       simp add:tOp_assocTr42[THEN sym])
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma hom_paired:
   "(\<lambda>x. (f x,g x)) \<in> hom G (DirProd H K) \<longleftrightarrow> f \<in> hom G H \<and> g \<in> hom G K"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. (f x, g x)) \<in> hom G (H \<times>\<times> K)) = (f \<in> hom G H \<and> g \<in> hom G K)
[PROOF STEP]
by (simp add: hom_pairwise o_def)


[STATEMENT]
lemma positively_invariant_eq_rev: "positively_invariant M = rev.negatively_invariant M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. positively_invariant M = rev.negatively_invariant M
[PROOF STEP]
unfolding positively_invariant_def rev.negatively_invariant_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>x\<in>M. trapped_forward x M) = (\<forall>x\<in>M. rev.trapped_backward x M)
[PROOF STEP]
by (simp add: rev.trapped_backward_iff_rev_trapped_forward)


[STATEMENT]
lemma integral_cos_Z' [simp]:
  assumes "n \<in> \<int>"
  shows "integral\<^sup>L (lebesgue_on {-pi..pi}) (\<lambda>x. cos(n * x)) = (if n = 0 then 2 * pi else 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. LINT x|lebesgue_on {- pi..pi}. cos (n * x) = (if n = 0 then 2 * pi else 0)
[PROOF STEP]
by (metis assms integral_cos_Z mult_commute_abs)


[STATEMENT]
lemma "(\<lambda>x. (2 * x^3 - 128) / (sqrt x - 2)) \<midarrow>4\<rightarrow> 384"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. (2 * x ^ 3 - 128) / (sqrt x - 2)) \<midarrow>4\<rightarrow> 384
[PROOF STEP]
by real_asymp


[STATEMENT]
lemma "OAlist_tc_lookup (oalist_tc_of_list [(0::nat, 4::nat), (1, 3), (0, 2), (1, 1)]) 1 = 3"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. OAlist_tc_lookup (oalist_tc_of_list [(0, 4), (1, 3), (0, 2), (1, 1)]) 1 = 3
[PROOF STEP]
by eval