[STATEMENT]
lemma closed_lift2_sup:
  "\<lbrakk> closed (err A) (lift2 f); closed (err B) (lift2 g) \<rbrakk> \<Longrightarrow>
  closed (err(A\<times>B)) (lift2(sup f g))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>closed (err A) (lift2 f); closed (err B) (lift2 g)\<rbrakk> \<Longrightarrow> closed (err (A \<times> B)) (lift2 (Product.sup f g))
[PROOF STEP]
apply (unfold closed_def plussub_def lift2_def err_def sup_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>x\<in>insert Err {x. \<exists>y\<in>A. x = OK y}. \<forall>y\<in>insert Err {x. \<exists>y\<in>A. x = OK y}. (case x of Err \<Rightarrow> Err | OK x \<Rightarrow> case y of Err \<Rightarrow> Err | OK y \<Rightarrow> f x y) \<in> insert Err {x. \<exists>y\<in>A. x = OK y}; \<forall>x\<in>insert Err {x. \<exists>y\<in>B. x = OK y}. \<forall>y\<in>insert Err {x. \<exists>y\<in>B. x = OK y}. (case x of Err \<Rightarrow> Err | OK x \<Rightarrow> case y of Err \<Rightarrow> Err | OK y \<Rightarrow> g x y) \<in> insert Err {x. \<exists>y\<in>B. x = OK y}\<rbrakk> \<Longrightarrow> \<forall>x\<in>insert Err {x. \<exists>y\<in>A \<times> B. x = OK y}. \<forall>y\<in>insert Err {x. \<exists>y\<in>A \<times> B. x = OK y}. (case x of Err \<Rightarrow> Err | OK x \<Rightarrow> case y of Err \<Rightarrow> Err | OK y \<Rightarrow> (case x of (a1, b1) \<Rightarrow> \<lambda>(a2, b2). Err.sup Pair (f a1 a2) (g b1 b2)) y) \<in> insert Err {x. \<exists>y\<in>A \<times> B. x = OK y}
[PROOF STEP]
apply (simp split: err.split)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>y\<in>A. \<forall>ya\<in>A. f y ya = Err \<or> (\<exists>yb\<in>A. f y ya = OK yb); \<forall>y\<in>B. \<forall>ya\<in>B. g y ya = Err \<or> (\<exists>yb\<in>B. g y ya = OK yb)\<rbrakk> \<Longrightarrow> \<forall>a b. a \<in> A \<and> b \<in> B \<longrightarrow> (\<forall>aa ba. aa \<in> A \<and> ba \<in> B \<longrightarrow> f a aa = Err \<or> g b ba = Err \<or> (\<exists>x\<in>A. f a aa = OK x) \<and> (\<exists>y\<in>B. g b ba = OK y))
[PROOF STEP]
apply blast
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma (in sigma_algebra) countably_additive_eq:
  "(\<And>a. a \<in> M \<Longrightarrow> \<mu>' a = \<mu> a) \<Longrightarrow> countably_additive M \<mu>' = countably_additive M \<mu>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>a. a \<in> M \<Longrightarrow> \<mu>' a = \<mu> a) \<Longrightarrow> countably_additive M \<mu>' = countably_additive M \<mu>
[PROOF STEP]
unfolding countably_additive_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>a. a \<in> M \<Longrightarrow> \<mu>' a = \<mu> a) \<Longrightarrow> (\<forall>A. range A \<subseteq> M \<longrightarrow> disjoint_family A \<longrightarrow> \<Union> (range A) \<in> M \<longrightarrow> (\<Sum>i. \<mu>' (A i)) = \<mu>' (\<Union> (range A))) = (\<forall>A. range A \<subseteq> M \<longrightarrow> disjoint_family A \<longrightarrow> \<Union> (range A) \<in> M \<longrightarrow> (\<Sum>i. \<mu> (A i)) = \<mu> (\<Union> (range A)))
[PROOF STEP]
by (intro arg_cong[where f=All] ext) (auto simp add: countably_additive_def subset_eq)


[STATEMENT]
lemma llcp_ltake1: "llcp (ltake n xs) ys = min n (llcp xs ys)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. llcp (ltake n xs) ys = min n (llcp xs ys)
[PROOF STEP]
by(coinduction arbitrary: n xs ys rule: enat_coinduct)(auto simp add: llcp_eq_0_iff enat_min_eq_0_iff epred_llcp ltl_ltake)


[STATEMENT]
lemma dverts_combine_sub_not_combined:
  "wf_dlverts (Node r {|(t1,e1)|}) \<Longrightarrow> dverts (Node (r @ Dtree.root t1) (sucs t1))
  \<subseteq> {r@Dtree.root t1} \<union> {x. x \<in> dverts (Node r {|(t1,e1)|}) \<and> x \<noteq> r \<and> x \<noteq> Dtree.root t1}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wf_dlverts (Node r {|(t1, e1)|}) \<Longrightarrow> dverts (Node (r @ dtree.root t1) (sucs t1)) \<subseteq> {r @ dtree.root t1} \<union> {x \<in> dverts (Node r {|(t1, e1)|}). x \<noteq> r \<and> x \<noteq> dtree.root t1}
[PROOF STEP]
using dverts_combine_orig_not_combined
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>wf_dlverts (Node ?r {|(?t1.0, ?e1.0)|}); ?x \<in> dverts (Node (?r @ dtree.root ?t1.0) (sucs ?t1.0)); ?x \<noteq> ?r @ dtree.root ?t1.0\<rbrakk> \<Longrightarrow> ?x \<in> dverts (Node ?r {|(?t1.0, ?e1.0)|}) \<and> ?x \<noteq> ?r \<and> ?x \<noteq> dtree.root ?t1.0

goal (1 subgoal):
 1. wf_dlverts (Node r {|(t1, e1)|}) \<Longrightarrow> dverts (Node (r @ dtree.root t1) (sucs t1)) \<subseteq> {r @ dtree.root t1} \<union> {x \<in> dverts (Node r {|(t1, e1)|}). x \<noteq> r \<and> x \<noteq> dtree.root t1}
[PROOF STEP]
by fast


[STATEMENT]
lemma sums_Suc:
  assumes "(\<lambda>n. f (Suc n)) sums l"
  shows "f sums (l + f 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f sums (l + f 0)
[PROOF STEP]
proof  -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. f sums (l + f 0)
[PROOF STEP]
have "(\<lambda>n. (\<Sum>i<n. f (Suc i)) + f 0) \<longlonglongrightarrow> l + f 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. (\<Sum>i<n. f (Suc i)) + f 0) \<longlonglongrightarrow> l + f 0
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. f (Suc n)) sums l

goal (1 subgoal):
 1. (\<lambda>n. (\<Sum>i<n. f (Suc i)) + f 0) \<longlonglongrightarrow> l + f 0
[PROOF STEP]
by (auto intro!: tendsto_add simp: sums_def)
[PROOF STATE]
proof (state)
this:
(\<lambda>n. (\<Sum>i<n. f (Suc i)) + f 0) \<longlonglongrightarrow> l + f 0

goal (1 subgoal):
 1. f sums (l + f 0)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(\<lambda>n. (\<Sum>i<n. f (Suc i)) + f 0) \<longlonglongrightarrow> l + f 0

goal (1 subgoal):
 1. f sums (l + f 0)
[PROOF STEP]
have "(\<Sum>i<n. f (Suc i)) + f 0 = (\<Sum>i<Suc n. f i)" for n
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i<n. f (Suc i)) + f 0 = sum f {..<Suc n}
[PROOF STEP]
unfolding lessThan_Suc_eq_insert_0
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i<n. f (Suc i)) + f 0 = sum f (insert 0 (Suc ` {..<n}))
[PROOF STEP]
by (simp add: ac_simps sum.atLeast1_atMost_eq image_Suc_lessThan)
[PROOF STATE]
proof (state)
this:
(\<Sum>i<?n. f (Suc i)) + f 0 = sum f {..<Suc ?n}

goal (1 subgoal):
 1. f sums (l + f 0)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>n. (\<Sum>i<n. f (Suc i)) + f 0) \<longlonglongrightarrow> l + f 0
(\<Sum>i<?n. f (Suc i)) + f 0 = sum f {..<Suc ?n}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. (\<Sum>i<n. f (Suc i)) + f 0) \<longlonglongrightarrow> l + f 0
(\<Sum>i<?n. f (Suc i)) + f 0 = sum f {..<Suc ?n}

goal (1 subgoal):
 1. f sums (l + f 0)
[PROOF STEP]
by (auto simp: sums_def simp del: sum.lessThan_Suc intro: filterlim_sequentially_Suc[THEN iffD1])
[PROOF STATE]
proof (state)
this:
f sums (l + f 0)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma upset_Inf_id: "id \<le> \<up> \<circ> Inf"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. id \<le> \<up> \<circ> Inf
[PROOF STEP]
by (simp add: Inf_lower le_funI subsetI upset_prop)


[STATEMENT]
lemma atms_of_plus[simp]: "atms_of (C + D) = atms_of C \<union> atms_of D"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. atms_of (C + D) = atms_of C \<union> atms_of D
[PROOF STEP]
unfolding atms_of_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. atm_of ` set_mset (C + D) = atm_of ` set_mset C \<union> atm_of ` set_mset D
[PROOF STEP]
by auto


[STATEMENT]
lemma inv\<^sub>L_cancel_iff:
  assumes "invertible\<^sub>L f"
  shows "f x = y \<longleftrightarrow> x = inv\<^sub>L f y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (blinfun_apply f x = y) = (x = blinfun_apply (inv\<^sub>L f) y)
[PROOF STEP]
by (auto simp add: assms)


[STATEMENT]
lemma cut_greater_Min_greater: "
  I \<down>> t \<noteq> {} \<Longrightarrow> iMin (I \<down>> t) > t"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. I \<down>> t \<noteq> {} \<Longrightarrow> t < iMin (I \<down>> t)
[PROOF STEP]
by (rule cut_greater_bound[OF iMinI_ex2])


[STATEMENT]
lemma power_sq_power: "power_sq x n = p_power (1\<^sub>\<sigma> + x) n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. power_sq x n = p_power (1\<^sub>\<sigma> + x) n
[PROOF STEP]
apply (induct n)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. power_sq x 0 = p_power (1\<^sub>\<sigma> + x) 0
 2. \<And>n. power_sq x n = p_power (1\<^sub>\<sigma> + x) n \<Longrightarrow> power_sq x (Suc n) = p_power (1\<^sub>\<sigma> + x) (Suc n)
[PROOF STEP]
apply (simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. power_sq x n = p_power (1\<^sub>\<sigma> + x) n \<Longrightarrow> power_sq x (Suc n) = p_power (1\<^sub>\<sigma> + x) (Suc n)
[PROOF STEP]
using Suc_eq_plus1 pow_prop power_sq.simps(2)
[PROOF STATE]
proof (prove)
using this:
Suc ?n = ?n + 1
p_power (1\<^sub>\<sigma> + ?x) (?n + 1) = 1\<^sub>\<sigma> + ?x \<cdot> p_power (1\<^sub>\<sigma> + ?x) ?n
power_sq ?x (Suc ?n) = 1\<^sub>\<sigma> + ?x \<cdot> power_sq ?x ?n

goal (1 subgoal):
 1. \<And>n. power_sq x n = p_power (1\<^sub>\<sigma> + x) n \<Longrightarrow> power_sq x (Suc n) = p_power (1\<^sub>\<sigma> + x) (Suc n)
[PROOF STEP]
by simp


[STATEMENT]
lemma Lcm_fin_least:
  "Lcm\<^sub>f\<^sub>i\<^sub>n A dvd a" if "finite A" and "\<And>b. b \<in> A \<Longrightarrow> b dvd a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Lcm\<^sub>f\<^sub>i\<^sub>n A dvd a
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
finite A
?b1 \<in> A \<Longrightarrow> ?b1 dvd a

goal (1 subgoal):
 1. Lcm\<^sub>f\<^sub>i\<^sub>n A dvd a
[PROOF STEP]
by (induct A) simp_all


[STATEMENT]
lemma advantage\<^sub>1_nonneg: "advantage\<^sub>1 \<A> \<eta> \<ge> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> advantage\<^sub>1 \<A> \<eta>
[PROOF STEP]
by(simp add: advantage\<^sub>1_def pmf_nonneg)


[STATEMENT]
lemma inside_outside: "inside S = (- (S \<union> outside S))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inside S = - (S \<union> outside S)
[PROOF STEP]
by (force simp: inside_def outside)


[STATEMENT]
lemma bfun_pos_eq_nonneg: "bfun_pos n = bfun_nonneg n + bfun_nonneg (-n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bfun_pos n = bfun_nonneg n + bfun_nonneg (- n)
[PROOF STEP]
by (auto simp: bfun_pos.rep_eq bfun_nonneg.rep_eq)


[STATEMENT]
lemma continuous_within_cos: "continuous (at z within s) cos"
  for z :: "'a::{real_normed_field,banach}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous (at z within s) cos
[PROOF STEP]
by (simp add: continuous_within tendsto_cos)


[STATEMENT]
lemma of_int_round_ge: "of_int (round x) \<ge> x - 1/2"
  and of_int_round_le: "of_int (round x) \<le> x + 1/2"
  and of_int_round_abs_le: "\<bar>of_int (round x) - x\<bar> \<le> 1/2"
  and of_int_round_gt: "of_int (round x) > x - 1/2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x - (1::'a) / (2::'a) \<le> of_int (round x) &&& of_int (round x) \<le> x + (1::'a) / (2::'a)) &&& \<bar>of_int (round x) - x\<bar> \<le> (1::'a) / (2::'a) &&& x - (1::'a) / (2::'a) < of_int (round x)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. x - (1::'a) / (2::'a) \<le> of_int (round x)
 2. of_int (round x) \<le> x + (1::'a) / (2::'a)
 3. \<bar>of_int (round x) - x\<bar> \<le> (1::'a) / (2::'a)
 4. x - (1::'a) / (2::'a) < of_int (round x)
[PROOF STEP]
from floor_correct[of "x + 1/2"]
[PROOF STATE]
proof (chain)
picking this:
of_int \<lfloor>x + (1::'a) / (2::'a)\<rfloor> \<le> x + (1::'a) / (2::'a) \<and> x + (1::'a) / (2::'a) < of_int (\<lfloor>x + (1::'a) / (2::'a)\<rfloor> + 1)
[PROOF STEP]
have "x + 1/2 < of_int (round x) + 1"
[PROOF STATE]
proof (prove)
using this:
of_int \<lfloor>x + (1::'a) / (2::'a)\<rfloor> \<le> x + (1::'a) / (2::'a) \<and> x + (1::'a) / (2::'a) < of_int (\<lfloor>x + (1::'a) / (2::'a)\<rfloor> + 1)

goal (1 subgoal):
 1. x + (1::'a) / (2::'a) < of_int (round x) + (1::'a)
[PROOF STEP]
by (simp add: round_def)
[PROOF STATE]
proof (state)
this:
x + (1::'a) / (2::'a) < of_int (round x) + (1::'a)

goal (4 subgoals):
 1. x - (1::'a) / (2::'a) \<le> of_int (round x)
 2. of_int (round x) \<le> x + (1::'a) / (2::'a)
 3. \<bar>of_int (round x) - x\<bar> \<le> (1::'a) / (2::'a)
 4. x - (1::'a) / (2::'a) < of_int (round x)
[PROOF STEP]
from add_strict_right_mono[OF this, of "-1"]
[PROOF STATE]
proof (chain)
picking this:
x + (1::'a) / (2::'a) + - (1::'a) < of_int (round x) + (1::'a) + - (1::'a)
[PROOF STEP]
show A: "of_int (round x) > x - 1/2"
[PROOF STATE]
proof (prove)
using this:
x + (1::'a) / (2::'a) + - (1::'a) < of_int (round x) + (1::'a) + - (1::'a)

goal (1 subgoal):
 1. x - (1::'a) / (2::'a) < of_int (round x)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
x - (1::'a) / (2::'a) < of_int (round x)

goal (3 subgoals):
 1. x - (1::'a) / (2::'a) \<le> of_int (round x)
 2. of_int (round x) \<le> x + (1::'a) / (2::'a)
 3. \<bar>of_int (round x) - x\<bar> \<le> (1::'a) / (2::'a)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x - (1::'a) / (2::'a) < of_int (round x)
[PROOF STEP]
show "of_int (round x) \<ge> x - 1/2"
[PROOF STATE]
proof (prove)
using this:
x - (1::'a) / (2::'a) < of_int (round x)

goal (1 subgoal):
 1. x - (1::'a) / (2::'a) \<le> of_int (round x)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
x - (1::'a) / (2::'a) \<le> of_int (round x)

goal (2 subgoals):
 1. of_int (round x) \<le> x + (1::'a) / (2::'a)
 2. \<bar>of_int (round x) - x\<bar> \<le> (1::'a) / (2::'a)
[PROOF STEP]
from floor_correct[of "x + 1/2"]
[PROOF STATE]
proof (chain)
picking this:
of_int \<lfloor>x + (1::'a) / (2::'a)\<rfloor> \<le> x + (1::'a) / (2::'a) \<and> x + (1::'a) / (2::'a) < of_int (\<lfloor>x + (1::'a) / (2::'a)\<rfloor> + 1)
[PROOF STEP]
show "of_int (round x) \<le> x + 1/2"
[PROOF STATE]
proof (prove)
using this:
of_int \<lfloor>x + (1::'a) / (2::'a)\<rfloor> \<le> x + (1::'a) / (2::'a) \<and> x + (1::'a) / (2::'a) < of_int (\<lfloor>x + (1::'a) / (2::'a)\<rfloor> + 1)

goal (1 subgoal):
 1. of_int (round x) \<le> x + (1::'a) / (2::'a)
[PROOF STEP]
by (simp add: round_def)
[PROOF STATE]
proof (state)
this:
of_int (round x) \<le> x + (1::'a) / (2::'a)

goal (1 subgoal):
 1. \<bar>of_int (round x) - x\<bar> \<le> (1::'a) / (2::'a)
[PROOF STEP]
with A
[PROOF STATE]
proof (chain)
picking this:
x - (1::'a) / (2::'a) < of_int (round x)
of_int (round x) \<le> x + (1::'a) / (2::'a)
[PROOF STEP]
show "\<bar>of_int (round x) - x\<bar> \<le> 1/2"
[PROOF STATE]
proof (prove)
using this:
x - (1::'a) / (2::'a) < of_int (round x)
of_int (round x) \<le> x + (1::'a) / (2::'a)

goal (1 subgoal):
 1. \<bar>of_int (round x) - x\<bar> \<le> (1::'a) / (2::'a)
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
\<bar>of_int (round x) - x\<bar> \<le> (1::'a) / (2::'a)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma in_arcs_app_iso_eq:
  assumes "digraph_isomorphism hom" and "u \<in> verts G"
  shows "in_arcs (app_iso hom G) (iso_verts hom u) = iso_arcs hom ` in_arcs G u"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. in_arcs (app_iso hom G) (iso_verts hom u) = iso_arcs hom ` in_arcs G u
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
digraph_isomorphism hom
u \<in> verts G

goal (1 subgoal):
 1. in_arcs (app_iso hom G) (iso_verts hom u) = iso_arcs hom ` in_arcs G u
[PROOF STEP]
unfolding in_arcs_def
[PROOF STATE]
proof (prove)
using this:
digraph_isomorphism hom
u \<in> verts G

goal (1 subgoal):
 1. {e \<in> arcs (app_iso hom G). head (app_iso hom G) e = iso_verts hom u} = iso_arcs hom ` {e \<in> arcs G. head G e = u}
[PROOF STEP]
by (auto simp: iso_verts_head)


[STATEMENT]
lemma lastAssertedLiteralIsUniq:
  fixes literal :: Literal and literal' :: Literal and literalList :: "Literal list" and valuation :: Valuation
  assumes
  lastL: "isLastAssertedLiteral literal  literalList valuation" and
  lastL': "isLastAssertedLiteral literal' literalList valuation"
  shows "literal = literal'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. literal = literal'
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
isLastAssertedLiteral literal literalList valuation
isLastAssertedLiteral literal' literalList valuation

goal (1 subgoal):
 1. literal = literal'
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>isLastAssertedLiteral literal literalList valuation; isLastAssertedLiteral literal' literalList valuation\<rbrakk> \<Longrightarrow> literal = literal'
[PROOF STEP]
from lastL
[PROOF STATE]
proof (chain)
picking this:
isLastAssertedLiteral literal literalList valuation
[PROOF STEP]
have *:
    "literal el literalList"
    "\<forall> l. l el literalList \<and> l \<noteq> literal \<longrightarrow> \<not>  precedes literal l valuation"
    and
    "literalTrue literal valuation"
[PROOF STATE]
proof (prove)
using this:
isLastAssertedLiteral literal literalList valuation

goal (1 subgoal):
 1. (literal el literalList &&& \<forall>l. l el literalList \<and> l \<noteq> literal \<longrightarrow> \<not> precedes literal l valuation) &&& literalTrue literal valuation
[PROOF STEP]
by (auto simp add: isLastAssertedLiteral_def)
[PROOF STATE]
proof (state)
this:
literal el literalList
\<forall>l. l el literalList \<and> l \<noteq> literal \<longrightarrow> \<not> precedes literal l valuation
literalTrue literal valuation

goal (1 subgoal):
 1. \<lbrakk>isLastAssertedLiteral literal literalList valuation; isLastAssertedLiteral literal' literalList valuation\<rbrakk> \<Longrightarrow> literal = literal'
[PROOF STEP]
from lastL'
[PROOF STATE]
proof (chain)
picking this:
isLastAssertedLiteral literal' literalList valuation
[PROOF STEP]
have **:
    "literal' el literalList"
    "\<forall> l. l el literalList \<and> l \<noteq> literal' \<longrightarrow> \<not>  precedes literal' l valuation"
    and
    "literalTrue literal' valuation"
[PROOF STATE]
proof (prove)
using this:
isLastAssertedLiteral literal' literalList valuation

goal (1 subgoal):
 1. (literal' el literalList &&& \<forall>l. l el literalList \<and> l \<noteq> literal' \<longrightarrow> \<not> precedes literal' l valuation) &&& literalTrue literal' valuation
[PROOF STEP]
by (auto simp add: isLastAssertedLiteral_def)
[PROOF STATE]
proof (state)
this:
literal' el literalList
\<forall>l. l el literalList \<and> l \<noteq> literal' \<longrightarrow> \<not> precedes literal' l valuation
literalTrue literal' valuation

goal (1 subgoal):
 1. \<lbrakk>isLastAssertedLiteral literal literalList valuation; isLastAssertedLiteral literal' literalList valuation\<rbrakk> \<Longrightarrow> literal = literal'
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
literal' el literalList
\<forall>l. l el literalList \<and> l \<noteq> literal' \<longrightarrow> \<not> precedes literal' l valuation
literalTrue literal' valuation

goal (1 subgoal):
 1. \<lbrakk>isLastAssertedLiteral literal literalList valuation; isLastAssertedLiteral literal' literalList valuation\<rbrakk> \<Longrightarrow> literal = literal'
[PROOF STEP]
assume "literal' \<noteq> literal"
[PROOF STATE]
proof (state)
this:
literal' \<noteq> literal

goal (1 subgoal):
 1. \<lbrakk>isLastAssertedLiteral literal literalList valuation; isLastAssertedLiteral literal' literalList valuation\<rbrakk> \<Longrightarrow> literal = literal'
[PROOF STEP]
with * **
[PROOF STATE]
proof (chain)
picking this:
literal el literalList
\<forall>l. l el literalList \<and> l \<noteq> literal \<longrightarrow> \<not> precedes literal l valuation
literal' el literalList
\<forall>l. l el literalList \<and> l \<noteq> literal' \<longrightarrow> \<not> precedes literal' l valuation
literal' \<noteq> literal
[PROOF STEP]
have "\<not> precedes literal literal' valuation" and "\<not> precedes literal' literal valuation"
[PROOF STATE]
proof (prove)
using this:
literal el literalList
\<forall>l. l el literalList \<and> l \<noteq> literal \<longrightarrow> \<not> precedes literal l valuation
literal' el literalList
\<forall>l. l el literalList \<and> l \<noteq> literal' \<longrightarrow> \<not> precedes literal' l valuation
literal' \<noteq> literal

goal (1 subgoal):
 1. \<not> precedes literal literal' valuation &&& \<not> precedes literal' literal valuation
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<not> precedes literal literal' valuation
\<not> precedes literal' literal valuation

goal (1 subgoal):
 1. \<lbrakk>isLastAssertedLiteral literal literalList valuation; isLastAssertedLiteral literal' literalList valuation\<rbrakk> \<Longrightarrow> literal = literal'
[PROOF STEP]
with \<open>literalTrue literal valuation\<close> \<open>literalTrue literal' valuation\<close>
[PROOF STATE]
proof (chain)
picking this:
literalTrue literal valuation
literalTrue literal' valuation
\<not> precedes literal literal' valuation
\<not> precedes literal' literal valuation
[PROOF STEP]
have "False"
[PROOF STATE]
proof (prove)
using this:
literalTrue literal valuation
literalTrue literal' valuation
\<not> precedes literal literal' valuation
\<not> precedes literal' literal valuation

goal (1 subgoal):
 1. False
[PROOF STEP]
using precedesTotalOrder[of "literal" "valuation" "literal'"]
[PROOF STATE]
proof (prove)
using this:
literalTrue literal valuation
literalTrue literal' valuation
\<not> precedes literal literal' valuation
\<not> precedes literal' literal valuation
\<lbrakk>literal \<in> set valuation; literal' \<in> set valuation\<rbrakk> \<Longrightarrow> literal = literal' \<or> precedes literal literal' valuation \<or> precedes literal' literal valuation

goal (1 subgoal):
 1. False
[PROOF STEP]
unfolding precedes_def
[PROOF STATE]
proof (prove)
using this:
literalTrue literal valuation
literalTrue literal' valuation
\<not> (literal \<in> set valuation \<and> literal' \<in> set valuation \<and> firstPos literal valuation \<le> firstPos literal' valuation)
\<not> (literal' \<in> set valuation \<and> literal \<in> set valuation \<and> firstPos literal' valuation \<le> firstPos literal valuation)
\<lbrakk>literal \<in> set valuation; literal' \<in> set valuation\<rbrakk> \<Longrightarrow> literal = literal' \<or> literal \<in> set valuation \<and> literal' \<in> set valuation \<and> firstPos literal valuation \<le> firstPos literal' valuation \<or> literal' \<in> set valuation \<and> literal \<in> set valuation \<and> firstPos literal' valuation \<le> firstPos literal valuation

goal (1 subgoal):
 1. False
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
False

goal (1 subgoal):
 1. \<lbrakk>isLastAssertedLiteral literal literalList valuation; isLastAssertedLiteral literal' literalList valuation\<rbrakk> \<Longrightarrow> literal = literal'
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
literal' \<noteq> literal \<Longrightarrow> False

goal (1 subgoal):
 1. \<lbrakk>isLastAssertedLiteral literal literalList valuation; isLastAssertedLiteral literal' literalList valuation\<rbrakk> \<Longrightarrow> literal = literal'
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
literal' \<noteq> literal \<Longrightarrow> False

goal (1 subgoal):
 1. literal = literal'
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
literal = literal'

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma prob_space_exponential_escape_rate: "prob_space (exponential (escape_rate x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prob_space (exponential (escape_rate x))
[PROOF STEP]
using escape_rate_pos
[PROOF STATE]
proof (prove)
using this:
0 < escape_rate ?x

goal (1 subgoal):
 1. prob_space (exponential (escape_rate x))
[PROOF STEP]
by (rule prob_space_exponential)


[STATEMENT]
lemma rbt_set_rbt_baliR: "set (RBT_Impl.keys (rbt_baliR l a b r)) =
  set (RBT_Impl.keys l) \<union> {a} \<union> set (RBT_Impl.keys r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (keys (rbt_baliR l a b r)) = set (keys l) \<union> {a} \<union> set (keys r)
[PROOF STEP]
by (cases "(l,a,b,r)" rule: rbt_baliR.cases) auto


[STATEMENT]
lemma ord_dvd_Carmichael:
  assumes "n > 1" "coprime n k"
  shows   "ord n k dvd Carmichael n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ord n k dvd Carmichael n
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ord n k dvd Carmichael n
[PROOF STEP]
have "k mod n \<in> totatives n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. k mod n \<in> totatives n
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
1 < n
coprime n k

goal (1 subgoal):
 1. k mod n \<in> totatives n
[PROOF STEP]
by (auto simp: totatives_def coprime_commute intro!: Nat.gr0I)
[PROOF STATE]
proof (state)
this:
k mod n \<in> totatives n

goal (1 subgoal):
 1. ord n k dvd Carmichael n
[PROOF STEP]
hence "ord n (k mod n) dvd Carmichael n"
[PROOF STATE]
proof (prove)
using this:
k mod n \<in> totatives n

goal (1 subgoal):
 1. ord n (k mod n) dvd Carmichael n
[PROOF STEP]
by (simp add: Carmichael_def del: ord_mod)
[PROOF STATE]
proof (state)
this:
ord n (k mod n) dvd Carmichael n

goal (1 subgoal):
 1. ord n k dvd Carmichael n
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
ord n (k mod n) dvd Carmichael n

goal (1 subgoal):
 1. ord n k dvd Carmichael n
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
ord n k dvd Carmichael n

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma eventually_not_in_closed:
  assumes "closed P"
  assumes "f t \<notin> P" "t \<in> T"
  assumes "continuous_on T f"
  shows "\<forall>\<^sub>F t in at t within T. f t \<notin> P"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F t in at t within T. f t \<notin> P
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
closed P
f t \<notin> P
t \<in> T
continuous_on T f

goal (1 subgoal):
 1. \<forall>\<^sub>F t in at t within T. f t \<notin> P
[PROOF STEP]
unfolding Compl_iff[symmetric] closed_def continuous_on_topological eventually_at_topological
[PROOF STATE]
proof (prove)
using this:
open (- P)
f t \<in> - P
t \<in> T
\<forall>x\<in>T. \<forall>B. open B \<longrightarrow> f x \<in> B \<longrightarrow> (\<exists>A. open A \<and> x \<in> A \<and> (\<forall>y\<in>T. y \<in> A \<longrightarrow> f y \<in> B))

goal (1 subgoal):
 1. \<exists>S. open S \<and> t \<in> S \<and> (\<forall>x\<in>S. x \<noteq> t \<longrightarrow> x \<in> T \<longrightarrow> f x \<in> - P)
[PROOF STEP]
by metis


[STATEMENT]
lemma inf_prefix_length_maximality1[rule_format]: "
  inf_prefix_length xs ys \<noteq> min (length xs) (length ys) \<Longrightarrow>
  xs ! (inf_prefix_length xs ys) \<noteq> ys ! (inf_prefix_length xs ys)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inf_prefix_length xs ys \<noteq> min (length xs) (length ys) \<Longrightarrow> xs ! inf_prefix_length xs ys \<noteq> ys ! inf_prefix_length xs ys
[PROOF STEP]
apply (insert equal_pair_count_maximality1b[of "zip xs ys", folded inf_prefix_length_def], simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>inf_prefix_length xs ys \<noteq> min (length xs) (length ys); \<not> equal_pair (zip xs ys ! inf_prefix_length xs ys)\<rbrakk> \<Longrightarrow> xs ! inf_prefix_length xs ys \<noteq> ys ! inf_prefix_length xs ys
[PROOF STEP]
apply (drule neq_le_trans)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<not> equal_pair (zip xs ys ! inf_prefix_length xs ys) \<Longrightarrow> inf_prefix_length xs ys \<le> min (length xs) (length ys)
 2. \<lbrakk>\<not> equal_pair (zip xs ys ! inf_prefix_length xs ys); inf_prefix_length xs ys < min (length xs) (length ys)\<rbrakk> \<Longrightarrow> xs ! inf_prefix_length xs ys \<noteq> ys ! inf_prefix_length xs ys
[PROOF STEP]
apply (simp add: inf_prefix_length_le)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<not> equal_pair (zip xs ys ! inf_prefix_length xs ys); inf_prefix_length xs ys < min (length xs) (length ys)\<rbrakk> \<Longrightarrow> xs ! inf_prefix_length xs ys \<noteq> ys ! inf_prefix_length xs ys
[PROOF STEP]
apply (simp add:  inf_prefix_length_def equal_pair_def)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma norm_rot: "norm (rot v) = norm v" for v::'a
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (rot v) = norm v
[PROOF STEP]
unfolding rot_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (eucl_of_list [v $\<^sub>e 1, - v $\<^sub>e 0]) = norm v
[PROOF STEP]
by (simp add:vec_simps norm_nth_eucl L2_set_def)


[STATEMENT]
lemma has_real_derivative_neg_dec_left:
  fixes f :: "real \<Rightarrow> real"
  assumes der: "(f has_real_derivative l) (at x within S)"
    and "l < 0"
  shows "\<exists>d > 0. \<forall>h > 0. x - h \<in> S \<longrightarrow> h < d \<longrightarrow> f x < f (x - h)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>d>0. \<forall>h>0. x - h \<in> S \<longrightarrow> h < d \<longrightarrow> f x < f (x - h)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>d>0. \<forall>h>0. x - h \<in> S \<longrightarrow> h < d \<longrightarrow> f x < f (x - h)
[PROOF STEP]
from \<open>l < 0\<close>
[PROOF STATE]
proof (chain)
picking this:
l < 0
[PROOF STEP]
have l: "- l > 0"
[PROOF STATE]
proof (prove)
using this:
l < 0

goal (1 subgoal):
 1. 0 < - l
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
0 < - l

goal (1 subgoal):
 1. \<exists>d>0. \<forall>h>0. x - h \<in> S \<longrightarrow> h < d \<longrightarrow> f x < f (x - h)
[PROOF STEP]
from der [THEN has_field_derivativeD, THEN tendstoD, OF l, unfolded eventually_at]
[PROOF STATE]
proof (chain)
picking this:
\<exists>d>0. \<forall>xa\<in>S. xa \<noteq> x \<and> dist xa x < d \<longrightarrow> dist ((f xa - f x) / (xa - x)) l < - l
[PROOF STEP]
obtain s where s: "0 < s"
    and all: "\<And>xa. xa\<in>S \<Longrightarrow> xa \<noteq> x \<and> dist xa x < s \<longrightarrow> \<bar>(f xa - f x) / (xa - x) - l\<bar> < - l"
[PROOF STATE]
proof (prove)
using this:
\<exists>d>0. \<forall>xa\<in>S. xa \<noteq> x \<and> dist xa x < d \<longrightarrow> dist ((f xa - f x) / (xa - x)) l < - l

goal (1 subgoal):
 1. (\<And>s. \<lbrakk>0 < s; \<And>xa. xa \<in> S \<Longrightarrow> xa \<noteq> x \<and> dist xa x < s \<longrightarrow> \<bar>(f xa - f x) / (xa - x) - l\<bar> < - l\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp: dist_real_def)
[PROOF STATE]
proof (state)
this:
0 < s
?xa \<in> S \<Longrightarrow> ?xa \<noteq> x \<and> dist ?xa x < s \<longrightarrow> \<bar>(f ?xa - f x) / (?xa - x) - l\<bar> < - l

goal (1 subgoal):
 1. \<exists>d>0. \<forall>h>0. x - h \<in> S \<longrightarrow> h < d \<longrightarrow> f x < f (x - h)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 < s
?xa \<in> S \<Longrightarrow> ?xa \<noteq> x \<and> dist ?xa x < s \<longrightarrow> \<bar>(f ?xa - f x) / (?xa - x) - l\<bar> < - l
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
0 < s
?xa \<in> S \<Longrightarrow> ?xa \<noteq> x \<and> dist ?xa x < s \<longrightarrow> \<bar>(f ?xa - f x) / (?xa - x) - l\<bar> < - l

goal (1 subgoal):
 1. \<exists>d>0. \<forall>h>0. x - h \<in> S \<longrightarrow> h < d \<longrightarrow> f x < f (x - h)
[PROOF STEP]
proof (intro exI conjI strip)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>0 < s; \<And>xa. xa \<in> S \<Longrightarrow> xa \<noteq> x \<and> dist xa x < s \<longrightarrow> \<bar>(f xa - f x) / (xa - x) - l\<bar> < - l\<rbrakk> \<Longrightarrow> 0 < ?d3
 2. \<And>h. \<lbrakk>0 < s; \<And>xa. xa \<in> S \<Longrightarrow> xa \<noteq> x \<and> dist xa x < s \<longrightarrow> \<bar>(f xa - f x) / (xa - x) - l\<bar> < - l; 0 < h; x - h \<in> S; h < ?d3\<rbrakk> \<Longrightarrow> f x < f (x - h)
[PROOF STEP]
show "0 < s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < s
[PROOF STEP]
by (rule s)
[PROOF STATE]
proof (state)
this:
0 < s

goal (1 subgoal):
 1. \<And>h. \<lbrakk>0 < s; \<And>xa. xa \<in> S \<Longrightarrow> xa \<noteq> x \<and> dist xa x < s \<longrightarrow> \<bar>(f xa - f x) / (xa - x) - l\<bar> < - l; 0 < h; x - h \<in> S; h < s\<rbrakk> \<Longrightarrow> f x < f (x - h)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>h. \<lbrakk>0 < s; \<And>xa. xa \<in> S \<Longrightarrow> xa \<noteq> x \<and> dist xa x < s \<longrightarrow> \<bar>(f xa - f x) / (xa - x) - l\<bar> < - l; 0 < h; x - h \<in> S; h < s\<rbrakk> \<Longrightarrow> f x < f (x - h)
[PROOF STEP]
fix h :: real
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>h. \<lbrakk>0 < s; \<And>xa. xa \<in> S \<Longrightarrow> xa \<noteq> x \<and> dist xa x < s \<longrightarrow> \<bar>(f xa - f x) / (xa - x) - l\<bar> < - l; 0 < h; x - h \<in> S; h < s\<rbrakk> \<Longrightarrow> f x < f (x - h)
[PROOF STEP]
assume "0 < h" "h < s" "x - h \<in> S"
[PROOF STATE]
proof (state)
this:
0 < h
h < s
x - h \<in> S

goal (1 subgoal):
 1. \<And>h. \<lbrakk>0 < s; \<And>xa. xa \<in> S \<Longrightarrow> xa \<noteq> x \<and> dist xa x < s \<longrightarrow> \<bar>(f xa - f x) / (xa - x) - l\<bar> < - l; 0 < h; x - h \<in> S; h < s\<rbrakk> \<Longrightarrow> f x < f (x - h)
[PROOF STEP]
with all [of "x - h"]
[PROOF STATE]
proof (chain)
picking this:
x - h \<in> S \<Longrightarrow> x - h \<noteq> x \<and> dist (x - h) x < s \<longrightarrow> \<bar>(f (x - h) - f x) / (x - h - x) - l\<bar> < - l
0 < h
h < s
x - h \<in> S
[PROOF STEP]
show "f x < f (x-h)"
[PROOF STATE]
proof (prove)
using this:
x - h \<in> S \<Longrightarrow> x - h \<noteq> x \<and> dist (x - h) x < s \<longrightarrow> \<bar>(f (x - h) - f x) / (x - h - x) - l\<bar> < - l
0 < h
h < s
x - h \<in> S

goal (1 subgoal):
 1. f x < f (x - h)
[PROOF STEP]
proof (simp add: abs_if pos_less_divide_eq dist_real_def split: if_split_asm)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>0 < h; h < s; x - h \<in> S; - ((f (x - h) - f x) / h) < l; 2 * l + (f (x - h) - f x) / h < 0\<rbrakk> \<Longrightarrow> f x < f (x - h)
[PROOF STEP]
assume "- ((f (x-h) - f x) / h) < l" and h: "0 < h"
[PROOF STATE]
proof (state)
this:
- ((f (x - h) - f x) / h) < l
0 < h

goal (1 subgoal):
 1. \<lbrakk>0 < h; h < s; x - h \<in> S; - ((f (x - h) - f x) / h) < l; 2 * l + (f (x - h) - f x) / h < 0\<rbrakk> \<Longrightarrow> f x < f (x - h)
[PROOF STEP]
with l
[PROOF STATE]
proof (chain)
picking this:
0 < - l
- ((f (x - h) - f x) / h) < l
0 < h
[PROOF STEP]
have "0 < (f (x-h) - f x) / h"
[PROOF STATE]
proof (prove)
using this:
0 < - l
- ((f (x - h) - f x) / h) < l
0 < h

goal (1 subgoal):
 1. 0 < (f (x - h) - f x) / h
[PROOF STEP]
by arith
[PROOF STATE]
proof (state)
this:
0 < (f (x - h) - f x) / h

goal (1 subgoal):
 1. \<lbrakk>0 < h; h < s; x - h \<in> S; - ((f (x - h) - f x) / h) < l; 2 * l + (f (x - h) - f x) / h < 0\<rbrakk> \<Longrightarrow> f x < f (x - h)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 < (f (x - h) - f x) / h
[PROOF STEP]
show "f x < f (x - h)"
[PROOF STATE]
proof (prove)
using this:
0 < (f (x - h) - f x) / h

goal (1 subgoal):
 1. f x < f (x - h)
[PROOF STEP]
by (simp add: pos_less_divide_eq h)
[PROOF STATE]
proof (state)
this:
f x < f (x - h)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
f x < f (x - h)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<exists>d>0. \<forall>h>0. x - h \<in> S \<longrightarrow> h < d \<longrightarrow> f x < f (x - h)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ereal_strict_mono2 [mono_intros]:
  assumes "x < y"
  shows "ereal x < ereal y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ereal x < ereal y
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
x < y

goal (1 subgoal):
 1. ereal x < ereal y
[PROOF STEP]
by auto


[STATEMENT]
lemma col_addcol[simp]:
  "k < dim_col A \<Longrightarrow> l < dim_col A \<Longrightarrow> col (addcol a k l A) k = a \<cdot>\<^sub>v col A l + col A k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>k < dim_col A; l < dim_col A\<rbrakk> \<Longrightarrow> col (addcol a k l A) k = a \<cdot>\<^sub>v col A l + col A k
[PROOF STEP]
by (rule eq_vecI;simp)


[STATEMENT]
lemma lookup_tensor_prod[simp]:
  assumes is1_valid:"is1 \<lhd> dims A" and is2_valid:"is2 \<lhd> dims B"
  shows "lookup (A \<otimes> B) (is1 @ is2) = lookup A is1 * lookup B is2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lookup (local.tensor_prod_otimes A B) (is1 @ is2) = lookup A is1 * lookup B is2
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
is1 \<lhd> dims A
is2 \<lhd> dims B

goal (1 subgoal):
 1. lookup (local.tensor_prod_otimes A B) (is1 @ is2) = lookup A is1 * lookup B is2
[PROOF STEP]
proof (induction A arbitrary:is1 rule:subtensor_induct)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>A is1. \<lbrakk>dims A = []; is1 \<lhd> dims A; is2 \<lhd> dims B\<rbrakk> \<Longrightarrow> lookup (local.tensor_prod_otimes A B) (is1 @ is2) = lookup A is1 * lookup B is2
 2. \<And>A is1. \<lbrakk>dims A \<noteq> []; \<And>i is1. \<lbrakk>i < hd (dims A); is1 \<lhd> dims (subtensor A i); is2 \<lhd> dims B\<rbrakk> \<Longrightarrow> lookup (local.tensor_prod_otimes (subtensor A i) B) (is1 @ is2) = lookup (subtensor A i) is1 * lookup B is2; is1 \<lhd> dims A; is2 \<lhd> dims B\<rbrakk> \<Longrightarrow> lookup (local.tensor_prod_otimes A B) (is1 @ is2) = lookup A is1 * lookup B is2
[PROOF STEP]
case (order_0 A is1)
[PROOF STATE]
proof (state)
this:
dims A = []
is1 \<lhd> dims A
is2 \<lhd> dims B

goal (2 subgoals):
 1. \<And>A is1. \<lbrakk>dims A = []; is1 \<lhd> dims A; is2 \<lhd> dims B\<rbrakk> \<Longrightarrow> lookup (local.tensor_prod_otimes A B) (is1 @ is2) = lookup A is1 * lookup B is2
 2. \<And>A is1. \<lbrakk>dims A \<noteq> []; \<And>i is1. \<lbrakk>i < hd (dims A); is1 \<lhd> dims (subtensor A i); is2 \<lhd> dims B\<rbrakk> \<Longrightarrow> lookup (local.tensor_prod_otimes (subtensor A i) B) (is1 @ is2) = lookup (subtensor A i) is1 * lookup B is2; is1 \<lhd> dims A; is2 \<lhd> dims B\<rbrakk> \<Longrightarrow> lookup (local.tensor_prod_otimes A B) (is1 @ is2) = lookup A is1 * lookup B is2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
dims A = []
is1 \<lhd> dims A
is2 \<lhd> dims B
[PROOF STEP]
obtain a where "vec A = [a]"
[PROOF STATE]
proof (prove)
using this:
dims A = []
is1 \<lhd> dims A
is2 \<lhd> dims B

goal (1 subgoal):
 1. (\<And>a. vec A = [a] \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using Suc_length_conv Tensor.tensor_vec_from_lookup_Nil length_0_conv length_tensor_vec_from_lookup length_vec
[PROOF STATE]
proof (prove)
using this:
dims A = []
is1 \<lhd> dims A
is2 \<lhd> dims B
(Suc ?n = length ?xs) = (\<exists>y ys. ?xs = y # ys \<and> length ys = ?n)
tensor_vec_from_lookup [] ?e = [?e []]
(length ?xs = 0) = (?xs = [])
length (tensor_vec_from_lookup ?ds ?e) = prod_list ?ds
length (vec ?A) = prod_list (dims ?A)

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

goal (2 subgoals):
 1. \<And>A is1. \<lbrakk>dims A = []; is1 \<lhd> dims A; is2 \<lhd> dims B\<rbrakk> \<Longrightarrow> lookup (local.tensor_prod_otimes A B) (is1 @ is2) = lookup A is1 * lookup B is2
 2. \<And>A is1. \<lbrakk>dims A \<noteq> []; \<And>i is1. \<lbrakk>i < hd (dims A); is1 \<lhd> dims (subtensor A i); is2 \<lhd> dims B\<rbrakk> \<Longrightarrow> lookup (local.tensor_prod_otimes (subtensor A i) B) (is1 @ is2) = lookup (subtensor A i) is1 * lookup B is2; is1 \<lhd> dims A; is2 \<lhd> dims B\<rbrakk> \<Longrightarrow> lookup (local.tensor_prod_otimes A B) (is1 @ is2) = lookup A is1 * lookup B is2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
vec A = [a]
[PROOF STEP]
have "A \<otimes> B = a \<cdot> B"
[PROOF STATE]
proof (prove)
using this:
vec A = [a]

goal (1 subgoal):
 1. local.tensor_prod_otimes A B = a \<cdot> B
[PROOF STEP]
unfolding tensor_prod_def smult_def
[PROOF STATE]
proof (prove)
using this:
vec A = [a]

goal (1 subgoal):
 1. tensor_from_vec (dims A @ dims B) (concat (map (\<lambda>a. vec_smult a (vec B)) (vec A))) = tensor_from_vec (dims B) (vec_smult a (vec B))
[PROOF STEP]
using order_0
[PROOF STATE]
proof (prove)
using this:
vec A = [a]
dims A = []
is1 \<lhd> dims A
is2 \<lhd> dims B

goal (1 subgoal):
 1. tensor_from_vec (dims A @ dims B) (concat (map (\<lambda>a. vec_smult a (vec B)) (vec A))) = tensor_from_vec (dims B) (vec_smult a (vec B))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
local.tensor_prod_otimes A B = a \<cdot> B

goal (2 subgoals):
 1. \<And>A is1. \<lbrakk>dims A = []; is1 \<lhd> dims A; is2 \<lhd> dims B\<rbrakk> \<Longrightarrow> lookup (local.tensor_prod_otimes A B) (is1 @ is2) = lookup A is1 * lookup B is2
 2. \<And>A is1. \<lbrakk>dims A \<noteq> []; \<And>i is1. \<lbrakk>i < hd (dims A); is1 \<lhd> dims (subtensor A i); is2 \<lhd> dims B\<rbrakk> \<Longrightarrow> lookup (local.tensor_prod_otimes (subtensor A i) B) (is1 @ is2) = lookup (subtensor A i) is1 * lookup B is2; is1 \<lhd> dims A; is2 \<lhd> dims B\<rbrakk> \<Longrightarrow> lookup (local.tensor_prod_otimes A B) (is1 @ is2) = lookup A is1 * lookup B is2
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
local.tensor_prod_otimes A B = a \<cdot> B

goal (2 subgoals):
 1. \<And>A is1. \<lbrakk>dims A = []; is1 \<lhd> dims A; is2 \<lhd> dims B\<rbrakk> \<Longrightarrow> lookup (local.tensor_prod_otimes A B) (is1 @ is2) = lookup A is1 * lookup B is2
 2. \<And>A is1. \<lbrakk>dims A \<noteq> []; \<And>i is1. \<lbrakk>i < hd (dims A); is1 \<lhd> dims (subtensor A i); is2 \<lhd> dims B\<rbrakk> \<Longrightarrow> lookup (local.tensor_prod_otimes (subtensor A i) B) (is1 @ is2) = lookup (subtensor A i) is1 * lookup B is2; is1 \<lhd> dims A; is2 \<lhd> dims B\<rbrakk> \<Longrightarrow> lookup (local.tensor_prod_otimes A B) (is1 @ is2) = lookup A is1 * lookup B is2
[PROOF STEP]
have "lookup A [] = a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lookup A [] = a
[PROOF STEP]
by (simp add: \<open>Tensor.vec A = [a]\<close> lookup_def order_0.hyps)
[PROOF STATE]
proof (state)
this:
lookup A [] = a

goal (2 subgoals):
 1. \<And>A is1. \<lbrakk>dims A = []; is1 \<lhd> dims A; is2 \<lhd> dims B\<rbrakk> \<Longrightarrow> lookup (local.tensor_prod_otimes A B) (is1 @ is2) = lookup A is1 * lookup B is2
 2. \<And>A is1. \<lbrakk>dims A \<noteq> []; \<And>i is1. \<lbrakk>i < hd (dims A); is1 \<lhd> dims (subtensor A i); is2 \<lhd> dims B\<rbrakk> \<Longrightarrow> lookup (local.tensor_prod_otimes (subtensor A i) B) (is1 @ is2) = lookup (subtensor A i) is1 * lookup B is2; is1 \<lhd> dims A; is2 \<lhd> dims B\<rbrakk> \<Longrightarrow> lookup (local.tensor_prod_otimes A B) (is1 @ is2) = lookup A is1 * lookup B is2
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
local.tensor_prod_otimes A B = a \<cdot> B
lookup A [] = a
[PROOF STEP]
have "lookup (A \<otimes> B) (is2) = a * lookup B is2"
[PROOF STATE]
proof (prove)
using this:
local.tensor_prod_otimes A B = a \<cdot> B
lookup A [] = a

goal (1 subgoal):
 1. lookup (local.tensor_prod_otimes A B) is2 = a * lookup B is2
[PROOF STEP]
by (simp add: lookup_smult is2_valid)
[PROOF STATE]
proof (state)
this:
lookup (local.tensor_prod_otimes A B) is2 = a * lookup B is2

goal (2 subgoals):
 1. \<And>A is1. \<lbrakk>dims A = []; is1 \<lhd> dims A; is2 \<lhd> dims B\<rbrakk> \<Longrightarrow> lookup (local.tensor_prod_otimes A B) (is1 @ is2) = lookup A is1 * lookup B is2
 2. \<And>A is1. \<lbrakk>dims A \<noteq> []; \<And>i is1. \<lbrakk>i < hd (dims A); is1 \<lhd> dims (subtensor A i); is2 \<lhd> dims B\<rbrakk> \<Longrightarrow> lookup (local.tensor_prod_otimes (subtensor A i) B) (is1 @ is2) = lookup (subtensor A i) is1 * lookup B is2; is1 \<lhd> dims A; is2 \<lhd> dims B\<rbrakk> \<Longrightarrow> lookup (local.tensor_prod_otimes A B) (is1 @ is2) = lookup A is1 * lookup B is2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
lookup (local.tensor_prod_otimes A B) is2 = a * lookup B is2
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
lookup (local.tensor_prod_otimes A B) is2 = a * lookup B is2

goal (1 subgoal):
 1. lookup (local.tensor_prod_otimes A B) (is1 @ is2) = lookup A is1 * lookup B is2
[PROOF STEP]
using \<open>lookup A [] = a\<close> null_rec(1) order_0.hyps order_0.prems(1)
[PROOF STATE]
proof (prove)
using this:
lookup (local.tensor_prod_otimes A B) is2 = a * lookup B is2
lookup A [] = a
List.null (?x # ?xs) = False
dims A = []
is1 \<lhd> dims A

goal (1 subgoal):
 1. lookup (local.tensor_prod_otimes A B) (is1 @ is2) = lookup A is1 * lookup B is2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
lookup (local.tensor_prod_otimes A B) (is1 @ is2) = lookup A is1 * lookup B is2

goal (1 subgoal):
 1. \<And>A is1. \<lbrakk>dims A \<noteq> []; \<And>i is1. \<lbrakk>i < hd (dims A); is1 \<lhd> dims (subtensor A i); is2 \<lhd> dims B\<rbrakk> \<Longrightarrow> lookup (local.tensor_prod_otimes (subtensor A i) B) (is1 @ is2) = lookup (subtensor A i) is1 * lookup B is2; is1 \<lhd> dims A; is2 \<lhd> dims B\<rbrakk> \<Longrightarrow> lookup (local.tensor_prod_otimes A B) (is1 @ is2) = lookup A is1 * lookup B is2
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>A is1. \<lbrakk>dims A \<noteq> []; \<And>i is1. \<lbrakk>i < hd (dims A); is1 \<lhd> dims (subtensor A i); is2 \<lhd> dims B\<rbrakk> \<Longrightarrow> lookup (local.tensor_prod_otimes (subtensor A i) B) (is1 @ is2) = lookup (subtensor A i) is1 * lookup B is2; is1 \<lhd> dims A; is2 \<lhd> dims B\<rbrakk> \<Longrightarrow> lookup (local.tensor_prod_otimes A B) (is1 @ is2) = lookup A is1 * lookup B is2
[PROOF STEP]
case (order_step A is1)
[PROOF STATE]
proof (state)
this:
dims A \<noteq> []
\<lbrakk>?i < hd (dims A); ?is1.0 \<lhd> dims (subtensor A ?i); is2 \<lhd> dims B\<rbrakk> \<Longrightarrow> lookup (local.tensor_prod_otimes (subtensor A ?i) B) (?is1.0 @ is2) = lookup (subtensor A ?i) ?is1.0 * lookup B is2
is1 \<lhd> dims A
is2 \<lhd> dims B

goal (1 subgoal):
 1. \<And>A is1. \<lbrakk>dims A \<noteq> []; \<And>i is1. \<lbrakk>i < hd (dims A); is1 \<lhd> dims (subtensor A i); is2 \<lhd> dims B\<rbrakk> \<Longrightarrow> lookup (local.tensor_prod_otimes (subtensor A i) B) (is1 @ is2) = lookup (subtensor A i) is1 * lookup B is2; is1 \<lhd> dims A; is2 \<lhd> dims B\<rbrakk> \<Longrightarrow> lookup (local.tensor_prod_otimes A B) (is1 @ is2) = lookup A is1 * lookup B is2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
dims A \<noteq> []
\<lbrakk>?i < hd (dims A); ?is1.0 \<lhd> dims (subtensor A ?i); is2 \<lhd> dims B\<rbrakk> \<Longrightarrow> lookup (local.tensor_prod_otimes (subtensor A ?i) B) (?is1.0 @ is2) = lookup (subtensor A ?i) ?is1.0 * lookup B is2
is1 \<lhd> dims A
is2 \<lhd> dims B
[PROOF STEP]
obtain i is1' where "i # is1' = is1"
[PROOF STATE]
proof (prove)
using this:
dims A \<noteq> []
\<lbrakk>?i < hd (dims A); ?is1.0 \<lhd> dims (subtensor A ?i); is2 \<lhd> dims B\<rbrakk> \<Longrightarrow> lookup (local.tensor_prod_otimes (subtensor A ?i) B) (?is1.0 @ is2) = lookup (subtensor A ?i) ?is1.0 * lookup B is2
is1 \<lhd> dims A
is2 \<lhd> dims B

goal (1 subgoal):
 1. (\<And>i is1'. i # is1' = is1 \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
i # is1' = is1

goal (1 subgoal):
 1. \<And>A is1. \<lbrakk>dims A \<noteq> []; \<And>i is1. \<lbrakk>i < hd (dims A); is1 \<lhd> dims (subtensor A i); is2 \<lhd> dims B\<rbrakk> \<Longrightarrow> lookup (local.tensor_prod_otimes (subtensor A i) B) (is1 @ is2) = lookup (subtensor A i) is1 * lookup B is2; is1 \<lhd> dims A; is2 \<lhd> dims B\<rbrakk> \<Longrightarrow> lookup (local.tensor_prod_otimes A B) (is1 @ is2) = lookup A is1 * lookup B is2
[PROOF STEP]
have "lookup (subtensor A i \<otimes> B) (is1' @ is2) = lookup (subtensor A i) is1' * lookup B is2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lookup (local.tensor_prod_otimes (subtensor A i) B) (is1' @ is2) = lookup (subtensor A i) is1' * lookup B is2
[PROOF STEP]
using order_step
[PROOF STATE]
proof (prove)
using this:
dims A \<noteq> []
\<lbrakk>?i < hd (dims A); ?is1.0 \<lhd> dims (subtensor A ?i); is2 \<lhd> dims B\<rbrakk> \<Longrightarrow> lookup (local.tensor_prod_otimes (subtensor A ?i) B) (?is1.0 @ is2) = lookup (subtensor A ?i) ?is1.0 * lookup B is2
is1 \<lhd> dims A
is2 \<lhd> dims B

goal (1 subgoal):
 1. lookup (local.tensor_prod_otimes (subtensor A i) B) (is1' @ is2) = lookup (subtensor A i) is1' * lookup B is2
[PROOF STEP]
by (metis \<open>i # is1' = is1\<close> dims_subtensor list.sel(1) list.sel(3) valid_index_dimsE)
[PROOF STATE]
proof (state)
this:
lookup (local.tensor_prod_otimes (subtensor A i) B) (is1' @ is2) = lookup (subtensor A i) is1' * lookup B is2

goal (1 subgoal):
 1. \<And>A is1. \<lbrakk>dims A \<noteq> []; \<And>i is1. \<lbrakk>i < hd (dims A); is1 \<lhd> dims (subtensor A i); is2 \<lhd> dims B\<rbrakk> \<Longrightarrow> lookup (local.tensor_prod_otimes (subtensor A i) B) (is1 @ is2) = lookup (subtensor A i) is1 * lookup B is2; is1 \<lhd> dims A; is2 \<lhd> dims B\<rbrakk> \<Longrightarrow> lookup (local.tensor_prod_otimes A B) (is1 @ is2) = lookup A is1 * lookup B is2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
lookup (local.tensor_prod_otimes (subtensor A i) B) (is1' @ is2) = lookup (subtensor A i) is1' * lookup B is2
[PROOF STEP]
show "lookup (A \<otimes> B) (is1 @ is2) = lookup A is1 * lookup B is2"
[PROOF STATE]
proof (prove)
using this:
lookup (local.tensor_prod_otimes (subtensor A i) B) (is1' @ is2) = lookup (subtensor A i) is1' * lookup B is2

goal (1 subgoal):
 1. lookup (local.tensor_prod_otimes A B) (is1 @ is2) = lookup A is1 * lookup B is2
[PROOF STEP]
using lookup_subtensor1[of i is1' A] lookup_subtensor1[of i "is1' @ is2" "A\<otimes>B"] subtensor_tensor_prod[of A i B]
      Cons_eq_appendI \<open>i # is1' = is1\<close> dims_tensor_prod is2_valid list.sel(1) order_step.hyps order_step.prems(1) valid_index_append valid_index_dimsE
[PROOF STATE]
proof (prove)
using this:
lookup (local.tensor_prod_otimes (subtensor A i) B) (is1' @ is2) = lookup (subtensor A i) is1' * lookup B is2
i # is1' \<lhd> dims A \<Longrightarrow> lookup (subtensor A i) is1' = lookup A (i # is1')
i # is1' @ is2 \<lhd> dims (local.tensor_prod_otimes A B) \<Longrightarrow> lookup (subtensor (local.tensor_prod_otimes A B) i) (is1' @ is2) = lookup (local.tensor_prod_otimes A B) (i # is1' @ is2)
\<lbrakk>dims A \<noteq> []; i < hd (dims A)\<rbrakk> \<Longrightarrow> subtensor (local.tensor_prod_otimes A B) i = local.tensor_prod_otimes (subtensor A i) B
\<lbrakk>?x # ?xs1.0 = ?ys; ?xs = ?xs1.0 @ ?zs\<rbrakk> \<Longrightarrow> ?x # ?xs = ?ys @ ?zs
i # is1' = is1
dims (local.tensor_prod_otimes ?A ?B) = dims ?A @ dims ?B
is2 \<lhd> dims B
hd (?x21.0 # ?x22.0) = ?x21.0
dims A \<noteq> []
is1 \<lhd> dims A
\<lbrakk>?is1.0 \<lhd> ?ds1.0; ?is2.0 \<lhd> ?ds2.0\<rbrakk> \<Longrightarrow> ?is1.0 @ ?is2.0 \<lhd> ?ds1.0 @ ?ds2.0
\<lbrakk>?is \<lhd> dims ?A; \<lbrakk>?is = []; dims ?A = []\<rbrakk> \<Longrightarrow> ?P; \<And>is ds i d. \<lbrakk>?is = i # is; dims ?A = d # ds; is \<lhd> ds; i < d\<rbrakk> \<Longrightarrow> ?P\<rbrakk> \<Longrightarrow> ?P

goal (1 subgoal):
 1. lookup (local.tensor_prod_otimes A B) (is1 @ is2) = lookup A is1 * lookup B is2
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
lookup (local.tensor_prod_otimes A B) (is1 @ is2) = lookup A is1 * lookup B is2

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma interpretation_subst_idem:
  "interpretation\<^sub>s\<^sub>u\<^sub>b\<^sub>s\<^sub>t \<theta> \<Longrightarrow> subst_idem \<theta>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. interpretation\<^sub>s\<^sub>u\<^sub>b\<^sub>s\<^sub>t \<theta> \<Longrightarrow> subst_idem \<theta>
[PROOF STEP]
unfolding subst_idem_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. interpretation\<^sub>s\<^sub>u\<^sub>b\<^sub>s\<^sub>t \<theta> \<Longrightarrow> \<theta> \<circ>\<^sub>s \<theta> = \<theta>
[PROOF STEP]
using interpretation_grounds_all[of \<theta>] trm_subst_ident subst_eq_if_eq_vars
[PROOF STATE]
proof (prove)
using this:
interpretation\<^sub>s\<^sub>u\<^sub>b\<^sub>s\<^sub>t \<theta> \<Longrightarrow> fv (\<theta> ?v) = {}
fv ?t \<inter> subst_domain ?\<theta> = {} \<Longrightarrow> ?t \<cdot> ?\<theta> = ?t
(\<And>v. Var v \<cdot> ?\<theta> = Var v \<cdot> ?\<sigma>) \<Longrightarrow> ?\<theta> = ?\<sigma>

goal (1 subgoal):
 1. interpretation\<^sub>s\<^sub>u\<^sub>b\<^sub>s\<^sub>t \<theta> \<Longrightarrow> \<theta> \<circ>\<^sub>s \<theta> = \<theta>
[PROOF STEP]
by fastforce


[STATEMENT]
lemma accept_eps_iff_accept:
  assumes "wf_regex r" "IH r q0 qf phis transs bss bs i"
  shows "NFA.accept_eps q0 qf transs R bs = NFA.accept q0 qf transs R"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. NFA.accept_eps q0 qf transs R bs = NFA.accept q0 qf transs R
[PROOF STEP]
using step_eps_closure_set_empty_list[OF assms] step_eps_closure_set_mono'
[PROOF STATE]
proof (prove)
using this:
NFA.step_eps_closure q0 transs bs ?q qf \<Longrightarrow> NFA.step_eps_closure q0 transs [] ?q qf
NFA.step_eps_closure_set ?q0.0 ?transs ?R [] \<subseteq> NFA.step_eps_closure_set ?q0.0 ?transs ?R ?bs

goal (1 subgoal):
 1. NFA.accept_eps q0 qf transs R bs = NFA.accept q0 qf transs R
[PROOF STEP]
unfolding NFA.accept_eps_def NFA.accept_def
[PROOF STATE]
proof (prove)
using this:
NFA.step_eps_closure q0 transs bs ?q qf \<Longrightarrow> NFA.step_eps_closure q0 transs [] ?q qf
NFA.step_eps_closure_set ?q0.0 ?transs ?R [] \<subseteq> NFA.step_eps_closure_set ?q0.0 ?transs ?R ?bs

goal (1 subgoal):
 1. (qf \<in> NFA.step_eps_closure_set q0 transs R bs) = (qf \<in> NFA.step_eps_closure_set q0 transs R [])
[PROOF STEP]
by (fastforce simp: NFA.accept_eps_def NFA.accept_def NFA.step_eps_closure_set_def)


[STATEMENT]
lemma sums_Suc:
  assumes "(\<lambda>n. f (Suc n)) sums l"
  shows "f sums (l + f 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f sums (l + f 0)
[PROOF STEP]
proof  -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. f sums (l + f 0)
[PROOF STEP]
have "(\<lambda>n. (\<Sum>i<n. f (Suc i)) + f 0) \<longlonglongrightarrow> l + f 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. (\<Sum>i<n. f (Suc i)) + f 0) \<longlonglongrightarrow> l + f 0
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. f (Suc n)) sums l

goal (1 subgoal):
 1. (\<lambda>n. (\<Sum>i<n. f (Suc i)) + f 0) \<longlonglongrightarrow> l + f 0
[PROOF STEP]
by (auto intro!: tendsto_add simp: sums_def)
[PROOF STATE]
proof (state)
this:
(\<lambda>n. (\<Sum>i<n. f (Suc i)) + f 0) \<longlonglongrightarrow> l + f 0

goal (1 subgoal):
 1. f sums (l + f 0)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(\<lambda>n. (\<Sum>i<n. f (Suc i)) + f 0) \<longlonglongrightarrow> l + f 0

goal (1 subgoal):
 1. f sums (l + f 0)
[PROOF STEP]
have "(\<Sum>i<n. f (Suc i)) + f 0 = (\<Sum>i<Suc n. f i)" for n
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i<n. f (Suc i)) + f 0 = sum f {..<Suc n}
[PROOF STEP]
unfolding lessThan_Suc_eq_insert_0
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i<n. f (Suc i)) + f 0 = sum f (insert 0 (Suc ` {..<n}))
[PROOF STEP]
by (simp add: ac_simps sum.atLeast1_atMost_eq image_Suc_lessThan)
[PROOF STATE]
proof (state)
this:
(\<Sum>i<?n. f (Suc i)) + f 0 = sum f {..<Suc ?n}

goal (1 subgoal):
 1. f sums (l + f 0)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>n. (\<Sum>i<n. f (Suc i)) + f 0) \<longlonglongrightarrow> l + f 0
(\<Sum>i<?n. f (Suc i)) + f 0 = sum f {..<Suc ?n}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. (\<Sum>i<n. f (Suc i)) + f 0) \<longlonglongrightarrow> l + f 0
(\<Sum>i<?n. f (Suc i)) + f 0 = sum f {..<Suc ?n}

goal (1 subgoal):
 1. f sums (l + f 0)
[PROOF STEP]
by (auto simp: sums_def simp del: sum.lessThan_Suc intro: filterlim_sequentially_Suc[THEN iffD1])
[PROOF STATE]
proof (state)
this:
f sums (l + f 0)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma hSuc_hSuc_eq [iff]: "\<And>m n. hSuc m = hSuc n \<longleftrightarrow> m = n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>m n. (hSuc m = hSuc n) = (m = n)
[PROOF STEP]
by transfer (rule nat.inject)


[STATEMENT]
lemma mem_lists_non_Nil: "xss \<in> lists (- {[]}) \<longleftrightarrow> (\<forall>x \<in> list.set xss. x \<noteq> [])"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (xss \<in> lists (- {[]})) = (\<forall>x\<in>list.set xss. x \<noteq> [])
[PROOF STEP]
by auto


[STATEMENT]
lemma Nset2_finiteTr:"\<forall>A. (finite A \<and>(card A = Suc n) \<longrightarrow>
     (\<exists>f. f \<in> {i. i \<le> n} \<rightarrow> A \<and> surj_to f {i. i \<le> n} A))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>A. finite A \<and> card A = Suc n \<longrightarrow> (\<exists>f. f \<in> {i. i \<le> n} \<rightarrow> A \<and> surj_to f {i. i \<le> n} A)
[PROOF STEP]
apply (induct_tac n, rule allI, rule impI, erule conjE)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>A. \<lbrakk>finite A; card A = Suc 0\<rbrakk> \<Longrightarrow> \<exists>f. f \<in> {i. i \<le> 0} \<rightarrow> A \<and> surj_to f {i. i \<le> 0} A
 2. \<And>n. \<forall>A. finite A \<and> card A = Suc n \<longrightarrow> (\<exists>f. f \<in> {i. i \<le> n} \<rightarrow> A \<and> surj_to f {i. i \<le> n} A) \<Longrightarrow> \<forall>A. finite A \<and> card A = Suc (Suc n) \<longrightarrow> (\<exists>f. f \<in> {i. i \<le> Suc n} \<rightarrow> A \<and> surj_to f {i. i \<le> Suc n} A)
[PROOF STEP]
apply (simp add: card1_Tr2 del: Pi_split_insert_domain)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. \<forall>A. finite A \<and> card A = Suc n \<longrightarrow> (\<exists>f. f \<in> {i. i \<le> n} \<rightarrow> A \<and> surj_to f {i. i \<le> n} A) \<Longrightarrow> \<forall>A. finite A \<and> card A = Suc (Suc n) \<longrightarrow> (\<exists>f. f \<in> {i. i \<le> Suc n} \<rightarrow> A \<and> surj_to f {i. i \<le> Suc n} A)
[PROOF STEP]
(* n *)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. \<forall>A. finite A \<and> card A = Suc n \<longrightarrow> (\<exists>f. f \<in> {i. i \<le> n} \<rightarrow> A \<and> surj_to f {i. i \<le> n} A) \<Longrightarrow> \<forall>A. finite A \<and> card A = Suc (Suc n) \<longrightarrow> (\<exists>f. f \<in> {i. i \<le> Suc n} \<rightarrow> A \<and> surj_to f {i. i \<le> Suc n} A)
[PROOF STEP]
apply (rule allI, rule impI, erule conjE, frule Nset2_prep1, assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n A. \<lbrakk>\<forall>A. finite A \<and> card A = Suc n \<longrightarrow> (\<exists>f. f \<in> {i. i \<le> n} \<rightarrow> A \<and> surj_to f {i. i \<le> n} A); finite A; card A = Suc (Suc n); \<exists>x. x \<in> A\<rbrakk> \<Longrightarrow> \<exists>f. f \<in> {i. i \<le> Suc n} \<rightarrow> A \<and> surj_to f {i. i \<le> Suc n} A
[PROOF STEP]
apply (erule exE)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n A x. \<lbrakk>\<forall>A. finite A \<and> card A = Suc n \<longrightarrow> (\<exists>f. f \<in> {i. i \<le> n} \<rightarrow> A \<and> surj_to f {i. i \<le> n} A); finite A; card A = Suc (Suc n); x \<in> A\<rbrakk> \<Longrightarrow> \<exists>f. f \<in> {i. i \<le> Suc n} \<rightarrow> A \<and> surj_to f {i. i \<le> Suc n} A
[PROOF STEP]
apply(drule_tac a = "A - {x}" in forall_spec)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>n A x. \<lbrakk>finite A; card A = Suc (Suc n); x \<in> A\<rbrakk> \<Longrightarrow> finite (A - {x}) \<and> card (A - {x}) = Suc n
 2. \<And>n A x. \<lbrakk>finite A; card A = Suc (Suc n); x \<in> A; \<exists>f. f \<in> {i. i \<le> n} \<rightarrow> A - {x} \<and> surj_to f {i. i \<le> n} (A - {x})\<rbrakk> \<Longrightarrow> \<exists>f. f \<in> {i. i \<le> Suc n} \<rightarrow> A \<and> surj_to f {i. i \<le> Suc n} A
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n A x. \<lbrakk>finite A; card A = Suc (Suc n); x \<in> A; \<exists>f. f \<in> {i. i \<le> n} \<rightarrow> A - {x} \<and> surj_to f {i. i \<le> n} (A - {x})\<rbrakk> \<Longrightarrow> \<exists>f. f \<in> {i. i \<le> Suc n} \<rightarrow> A \<and> surj_to f {i. i \<le> Suc n} A
[PROOF STEP]
apply (erule exE)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n A x f. \<lbrakk>finite A; card A = Suc (Suc n); x \<in> A; f \<in> {i. i \<le> n} \<rightarrow> A - {x} \<and> surj_to f {i. i \<le> n} (A - {x})\<rbrakk> \<Longrightarrow> \<exists>f. f \<in> {i. i \<le> Suc n} \<rightarrow> A \<and> surj_to f {i. i \<le> Suc n} A
[PROOF STEP]
apply (cut_tac x = x in card1_tr1, (erule conjE)+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n A x f. \<lbrakk>finite A; card A = Suc (Suc n); x \<in> A; f \<in> {i. i \<le> n} \<rightarrow> A - {x}; surj_to f {i. i \<le> n} (A - {x}); constmap {0} {x} \<in> {0} \<rightarrow> {x}; surj_to (constmap {0} {x}) {0} {x}\<rbrakk> \<Longrightarrow> \<exists>f. f \<in> {i. i \<le> Suc n} \<rightarrow> A \<and> surj_to f {i. i \<le> Suc n} A
[PROOF STEP]
apply (frule_tac f = f and n = n and A = "A - {x}" and
       g = "constmap {0} {x}" and m = 0 and B = "{x}" in jointfun_surj,
       assumption+)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>n A x f. \<lbrakk>finite A; card A = Suc (Suc n); x \<in> A; f \<in> {i. i \<le> n} \<rightarrow> A - {x}; surj_to f {i. i \<le> n} (A - {x}); constmap {0} {x} \<in> {0} \<rightarrow> {x}; surj_to (constmap {0} {x}) {0} {x}\<rbrakk> \<Longrightarrow> constmap {0} {x} \<in> {j. j \<le> 0} \<rightarrow> {x}
 2. \<And>n A x f. \<lbrakk>finite A; card A = Suc (Suc n); x \<in> A; f \<in> {i. i \<le> n} \<rightarrow> A - {x}; surj_to f {i. i \<le> n} (A - {x}); constmap {0} {x} \<in> {0} \<rightarrow> {x}; surj_to (constmap {0} {x}) {0} {x}\<rbrakk> \<Longrightarrow> surj_to (constmap {0} {x}) {j. j \<le> 0} {x}
 3. \<And>n A x f. \<lbrakk>finite A; card A = Suc (Suc n); x \<in> A; f \<in> {i. i \<le> n} \<rightarrow> A - {x}; surj_to f {i. i \<le> n} (A - {x}); constmap {0} {x} \<in> {0} \<rightarrow> {x}; surj_to (constmap {0} {x}) {0} {x}; surj_to (jointfun n f 0 (constmap {0} {x})) {j. j \<le> Suc (n + 0)} (A - {x} \<union> {x})\<rbrakk> \<Longrightarrow> \<exists>f. f \<in> {i. i \<le> Suc n} \<rightarrow> A \<and> surj_to f {i. i \<le> Suc n} A
[PROOF STEP]
apply simp+
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n A x f. \<lbrakk>finite A; card A = Suc (Suc n); x \<in> A; f \<in> {i. i \<le> n} \<rightarrow> A - {x}; surj_to f {i. i \<le> n} (A - {x}); constmap {0} {x} 0 = x; surj_to (constmap {0} {x}) {0} {x}; surj_to (jointfun n f 0 (constmap {0} {x})) {j. j \<le> Suc n} (insert x A)\<rbrakk> \<Longrightarrow> \<exists>f. f \<in> {i. i \<le> Suc n} \<rightarrow> A \<and> surj_to f {i. i \<le> Suc n} A
[PROOF STEP]
apply (frule_tac f = f and n = n and A = "A - {x}" and
        g = "constmap {0} {x}" and m = 0 and B = "{x}" in jointfun_hom0,
        simp,
        frule_tac x = x and A = A in Nset2_prep2, simp, blast)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma inter_fset [simp]:
  shows "fset (xs |\<inter>| ys) = fset xs \<inter> fset ys"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fset (xs |\<inter>| ys) = fset xs \<inter> fset ys
[PROOF STEP]
by (descending) (auto)


[STATEMENT]
lemma always_is_listall : "(\<box> \<guillemotleft>p\<guillemotright>) (t) = list_all (p) (t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<box> \<guillemotleft>p\<guillemotright> t = list_all p t
[PROOF STEP]
by(induct "t", simp_all)


[STATEMENT]
lemma ev_blocks_leD:
  "ev_blocks A \<Longrightarrow> i \<le> j \<Longrightarrow> j \<le> k \<Longrightarrow> k < n \<Longrightarrow> A $$ (k,k) = A $$ (i,i) \<Longrightarrow> A $$ (j,j) = A $$ (i,i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>local.ev_blocks A; i \<le> j; j \<le> k; k < n; A $$ (k, k) = A $$ (i, i)\<rbrakk> \<Longrightarrow> A $$ (j, j) = A $$ (i, i)
[PROOF STEP]
unfolding ev_blocks_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>local.ev_blocks_part n A; i \<le> j; j \<le> k; k < n; A $$ (k, k) = A $$ (i, i)\<rbrakk> \<Longrightarrow> A $$ (j, j) = A $$ (i, i)
[PROOF STEP]
by (rule ev_blocks_part_leD)


[STATEMENT]
lemma bbw_not_dist:
  "NOT (x OR y) = (NOT x) AND (NOT y)"
  "NOT (x AND y) = (NOT x) OR (NOT y)"
  for x y :: int
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. NOT (x OR y) = NOT x AND NOT y &&& NOT (x AND y) = NOT x OR NOT y
[PROOF STEP]
by (auto simp add: bin_eq_iff bin_nth_ops)


[STATEMENT]
lemma "w < x \<and> y \<le> z ==> w + y < x + (z::real)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. w < x \<and> y \<le> z \<Longrightarrow> w + y < x + z
[PROOF STEP]
by arith


[STATEMENT]
lemma sconcatMap_bottom_iff[simp]: "(sconcatMap\<cdot>f\<cdot>xs = \<bottom>) \<longleftrightarrow> (xs = \<bottom> \<or> (\<exists>x\<in>sset xs. f\<cdot>x = \<bottom>))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (sconcatMap\<cdot>f\<cdot>xs = \<bottom>) = (xs = \<bottom> \<or> (\<exists>x\<in>sset xs. f\<cdot>x = \<bottom>))
[PROOF STEP]
by (induct xs) simp_all


[STATEMENT]
lemma derivative_quotient_bound_left:
  assumes g_deriv_on: "(g has_vderiv_on g') {a .. b}"
  assumes frac_ge: "\<And>t. t \<in> {a .. b} \<Longrightarrow> K \<le> g' t / g t"
  assumes g'_cont: "continuous_on {a .. b} g'"
  assumes g_pos: "\<And>t. t \<in> {a .. b} \<Longrightarrow> g t > 0"
  assumes t_in: "t \<in> {a..b}"
  shows "g t \<le> g b * exp (K * (t - b))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. g t \<le> g b * exp (K * (t - b))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. g t \<le> g b * exp (K * (t - b))
[PROOF STEP]
have g_deriv: "\<And>t. t \<in> {a .. b} \<Longrightarrow> (g has_real_derivative g' t) (at t within {a .. b})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>t. t \<in> {a..b} \<Longrightarrow> (g has_real_derivative g' t) (at t within {a..b})
[PROOF STEP]
using g_deriv_on
[PROOF STATE]
proof (prove)
using this:
(g has_vderiv_on g') {a..b}

goal (1 subgoal):
 1. \<And>t. t \<in> {a..b} \<Longrightarrow> (g has_real_derivative g' t) (at t within {a..b})
[PROOF STEP]
by (auto simp: has_vderiv_on_def has_real_derivative_iff_has_vector_derivative[symmetric])
[PROOF STATE]
proof (state)
this:
?t \<in> {a..b} \<Longrightarrow> (g has_real_derivative g' ?t) (at ?t within {a..b})

goal (1 subgoal):
 1. g t \<le> g b * exp (K * (t - b))
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
(g has_vderiv_on g') {a..b}
?t \<in> {a..b} \<Longrightarrow> K \<le> g' ?t / g ?t
continuous_on {a..b} g'
?t \<in> {a..b} \<Longrightarrow> 0 < g ?t
t \<in> {a..b}
[PROOF STEP]
have g_nonzero: "\<And>t. t \<in> {a..b} \<Longrightarrow> g t \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
(g has_vderiv_on g') {a..b}
?t \<in> {a..b} \<Longrightarrow> K \<le> g' ?t / g ?t
continuous_on {a..b} g'
?t \<in> {a..b} \<Longrightarrow> 0 < g ?t
t \<in> {a..b}

goal (1 subgoal):
 1. \<And>t. t \<in> {a..b} \<Longrightarrow> g t \<noteq> 0
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
?t \<in> {a..b} \<Longrightarrow> g ?t \<noteq> 0

goal (1 subgoal):
 1. g t \<le> g b * exp (K * (t - b))
[PROOF STEP]
have frac_integrable: "\<And>t. t \<in> {a .. b} \<Longrightarrow> (\<lambda>t. g' t / g t) integrable_on {t..b}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>t. t \<in> {a..b} \<Longrightarrow> (\<lambda>t. g' t / g t) integrable_on {t..b}
[PROOF STEP]
by (force simp: g_nonzero intro: assms has_field_derivative_subset[OF g_deriv]
      continuous_on_subset[OF g'_cont] continuous_intros integrable_continuous_real
      continuous_on_subset[OF vderiv_on_continuous_on[OF g_deriv_on]])
[PROOF STATE]
proof (state)
this:
?t \<in> {a..b} \<Longrightarrow> (\<lambda>t. g' t / g t) integrable_on {?t..b}

goal (1 subgoal):
 1. g t \<le> g b * exp (K * (t - b))
[PROOF STEP]
have "\<And>t. t \<in> {a..b} \<Longrightarrow> ((\<lambda>t. g' t / g t) has_integral ln (g b) - ln (g t)) {t..b}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>t. t \<in> {a..b} \<Longrightarrow> ((\<lambda>t. g' t / g t) has_integral ln (g b) - ln (g t)) {t..b}
[PROOF STEP]
by (rule fundamental_theorem_of_calculus)
      (auto intro!: derivative_eq_intros assms has_field_derivative_subset[OF g_deriv]
        simp: has_real_derivative_iff_has_vector_derivative[symmetric])
[PROOF STATE]
proof (state)
this:
?t \<in> {a..b} \<Longrightarrow> ((\<lambda>t. g' t / g t) has_integral ln (g b) - ln (g ?t)) {?t..b}

goal (1 subgoal):
 1. g t \<le> g b * exp (K * (t - b))
[PROOF STEP]
hence *: "\<And>t. t \<in> {a..b} \<Longrightarrow> ln (g b) - ln (g t) = integral {t..b} (\<lambda>t. g' t / g t)"
[PROOF STATE]
proof (prove)
using this:
?t \<in> {a..b} \<Longrightarrow> ((\<lambda>t. g' t / g t) has_integral ln (g b) - ln (g ?t)) {?t..b}

goal (1 subgoal):
 1. \<And>t. t \<in> {a..b} \<Longrightarrow> ln (g b) - ln (g t) = integral {t..b} (\<lambda>t. g' t / g t)
[PROOF STEP]
using integrable_integral[OF frac_integrable]
[PROOF STATE]
proof (prove)
using this:
?t \<in> {a..b} \<Longrightarrow> ((\<lambda>t. g' t / g t) has_integral ln (g b) - ln (g ?t)) {?t..b}
?t1 \<in> {a..b} \<Longrightarrow> ((\<lambda>t. g' t / g t) has_integral integral {?t1..b} (\<lambda>t. g' t / g t)) {?t1..b}

goal (1 subgoal):
 1. \<And>t. t \<in> {a..b} \<Longrightarrow> ln (g b) - ln (g t) = integral {t..b} (\<lambda>t. g' t / g t)
[PROOF STEP]
by (rule has_integral_unique[where f = "\<lambda>t. g' t / g t"])
[PROOF STATE]
proof (state)
this:
?t \<in> {a..b} \<Longrightarrow> ln (g b) - ln (g ?t) = integral {?t..b} (\<lambda>t. g' t / g t)

goal (1 subgoal):
 1. g t \<le> g b * exp (K * (t - b))
[PROOF STEP]
have "K * (b - t) = integral {t..b} (\<lambda>_. K)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. K * (b - t) = integral {t..b} (\<lambda>_. K)
[PROOF STEP]
using \<open>t \<in> {a..b}\<close>
[PROOF STATE]
proof (prove)
using this:
t \<in> {a..b}

goal (1 subgoal):
 1. K * (b - t) = integral {t..b} (\<lambda>_. K)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
K * (b - t) = integral {t..b} (\<lambda>_. K)

goal (1 subgoal):
 1. g t \<le> g b * exp (K * (t - b))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
K * (b - t) = integral {t..b} (\<lambda>_. K)

goal (1 subgoal):
 1. g t \<le> g b * exp (K * (t - b))
[PROOF STEP]
have "... \<le> integral {t..b} (\<lambda>t. g' t / g t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral {t..b} (\<lambda>_. K) \<le> integral {t..b} (\<lambda>t. g' t / g t)
[PROOF STEP]
using \<open>t \<in> {a..b}\<close>
[PROOF STATE]
proof (prove)
using this:
t \<in> {a..b}

goal (1 subgoal):
 1. integral {t..b} (\<lambda>_. K) \<le> integral {t..b} (\<lambda>t. g' t / g t)
[PROOF STEP]
by (intro integral_le) (auto intro!: frac_integrable frac_ge integral_le)
[PROOF STATE]
proof (state)
this:
integral {t..b} (\<lambda>_. K) \<le> integral {t..b} (\<lambda>t. g' t / g t)

goal (1 subgoal):
 1. g t \<le> g b * exp (K * (t - b))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
integral {t..b} (\<lambda>_. K) \<le> integral {t..b} (\<lambda>t. g' t / g t)

goal (1 subgoal):
 1. g t \<le> g b * exp (K * (t - b))
[PROOF STEP]
have "... = ln (g b) - ln (g t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral {t..b} (\<lambda>t. g' t / g t) = ln (g b) - ln (g t)
[PROOF STEP]
using * t_in
[PROOF STATE]
proof (prove)
using this:
?t \<in> {a..b} \<Longrightarrow> ln (g b) - ln (g ?t) = integral {?t..b} (\<lambda>t. g' t / g t)
t \<in> {a..b}

goal (1 subgoal):
 1. integral {t..b} (\<lambda>t. g' t / g t) = ln (g b) - ln (g t)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
integral {t..b} (\<lambda>t. g' t / g t) = ln (g b) - ln (g t)

goal (1 subgoal):
 1. g t \<le> g b * exp (K * (t - b))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
K * (b - t) \<le> ln (g b) - ln (g t)
[PROOF STEP]
have "K * (b - t) + ln (g t) \<le> ln (g b)" (is "?lhs \<le> ?rhs")
[PROOF STATE]
proof (prove)
using this:
K * (b - t) \<le> ln (g b) - ln (g t)

goal (1 subgoal):
 1. K * (b - t) + ln (g t) \<le> ln (g b)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
K * (b - t) + ln (g t) \<le> ln (g b)

goal (1 subgoal):
 1. g t \<le> g b * exp (K * (t - b))
[PROOF STEP]
hence "exp ?lhs \<le> exp ?rhs"
[PROOF STATE]
proof (prove)
using this:
K * (b - t) + ln (g t) \<le> ln (g b)

goal (1 subgoal):
 1. exp (K * (b - t) + ln (g t)) \<le> exp (ln (g b))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
exp (K * (b - t) + ln (g t)) \<le> exp (ln (g b))

goal (1 subgoal):
 1. g t \<le> g b * exp (K * (t - b))
[PROOF STEP]
hence "g t * exp (K * (b - t)) \<le> g b"
[PROOF STATE]
proof (prove)
using this:
exp (K * (b - t) + ln (g t)) \<le> exp (ln (g b))

goal (1 subgoal):
 1. g t * exp (K * (b - t)) \<le> g b
[PROOF STEP]
using \<open>t \<in> {a..b}\<close> g_pos
[PROOF STATE]
proof (prove)
using this:
exp (K * (b - t) + ln (g t)) \<le> exp (ln (g b))
t \<in> {a..b}
?t \<in> {a..b} \<Longrightarrow> 0 < g ?t

goal (1 subgoal):
 1. g t * exp (K * (b - t)) \<le> g b
[PROOF STEP]
by (simp add: ac_simps exp_add del: exp_le_cancel_iff)
[PROOF STATE]
proof (state)
this:
g t * exp (K * (b - t)) \<le> g b

goal (1 subgoal):
 1. g t \<le> g b * exp (K * (t - b))
[PROOF STEP]
hence "g t / exp (K * (t - b)) \<le> g b"
[PROOF STATE]
proof (prove)
using this:
g t * exp (K * (b - t)) \<le> g b

goal (1 subgoal):
 1. g t / exp (K * (t - b)) \<le> g b
[PROOF STEP]
by (simp add: algebra_simps exp_diff)
[PROOF STATE]
proof (state)
this:
g t / exp (K * (t - b)) \<le> g b

goal (1 subgoal):
 1. g t \<le> g b * exp (K * (t - b))
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
g t / exp (K * (t - b)) \<le> g b

goal (1 subgoal):
 1. g t \<le> g b * exp (K * (t - b))
[PROOF STEP]
by (simp add: field_simps)
[PROOF STATE]
proof (state)
this:
g t \<le> g b * exp (K * (t - b))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma fps_gcd_altdef: "gcd f g =
  (if f = 0 \<and> g = 0 then 0 else
   if f = 0 then fps_X ^ subdegree g else
   if g = 0 then fps_X ^ subdegree f else
     fps_X ^ min (subdegree f) (subdegree g))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. gcd f g = (if f = 0 \<and> g = 0 then 0 else if f = 0 then fps_X ^ subdegree g else if g = 0 then fps_X ^ subdegree f else fps_X ^ min (subdegree f) (subdegree g))
[PROOF STEP]
by (simp add: fps_gcd)


[STATEMENT]
lemma (in wf_digraph) spanning_tree_imp_connected:
  assumes "spanning_tree H G"
  shows "connected G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Digraph_Component.connected G
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
spanning_tree H G

goal (1 subgoal):
 1. Digraph_Component.connected G
[PROOF STEP]
by (auto intro: connected_spanning_imp_connected)


[STATEMENT]
lemma "\<turnstile>\<^sub>t
{\<lambda>s. \<exists>n. n = nat(s ''x'')}
 WHILE Less (N 0) (V ''x'')
 DO (''x'' ::= Plus (V ''x'') (N (-1));;
    (''y'' ::= V ''x'';;
     WHILE Less (N 0) (V ''y'') DO ''y'' ::= Plus (V ''y'') (N (-1))))
{\<lambda>s. s ''x'' \<le> 0}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<turnstile>\<^sub>t {\<lambda>s. \<exists>n. n = nat (s ''x'')} WHILE Less (N 0) (V ''x'') DO (''x'' ::= Plus (V ''x'') (N (- 1));; (''y'' ::= V ''x'';; WHILE Less (N 0) (V ''y'') DO ''y'' ::= Plus (V ''y'') (N (- 1)))) {\<lambda>s. s ''x'' \<le> 0}
[PROOF STEP]
apply(rule weaken_post)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<turnstile>\<^sub>t {\<lambda>s. \<exists>n. n = nat (s ''x'')} WHILE Less (N 0) (V ''x'') DO (''x'' ::= Plus (V ''x'') (N (- 1));; (''y'' ::= V ''x'';; WHILE Less (N 0) (V ''y'') DO ''y'' ::= Plus (V ''y'') (N (- 1)))) {?Q}
 2. \<forall>s. ?Q s \<longrightarrow> s ''x'' \<le> 0
[PROOF STEP]
apply(rule While)
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<And>n. \<turnstile>\<^sub>t {\<lambda>s. Suc n = nat (s ''x'')} ''x'' ::= Plus (V ''x'') (N (- 1));; (''y'' ::= V ''x'';; WHILE Less (N 0) (V ''y'') DO ''y'' ::= Plus (V ''y'') (N (- 1))) {\<lambda>s. n = nat (s ''x'')}
 2. \<forall>n s. Suc n = nat (s ''x'') \<longrightarrow> bval (Less (N 0) (V ''x'')) s
 3. \<forall>s. 0 = nat (s ''x'') \<longrightarrow> \<not> bval (Less (N 0) (V ''x'')) s
 4. \<forall>s. 0 = nat (s ''x'') \<longrightarrow> s ''x'' \<le> 0
[PROOF STEP]
defer
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<forall>n s. Suc n = nat (s ''x'') \<longrightarrow> bval (Less (N 0) (V ''x'')) s
 2. \<forall>s. 0 = nat (s ''x'') \<longrightarrow> \<not> bval (Less (N 0) (V ''x'')) s
 3. \<forall>s. 0 = nat (s ''x'') \<longrightarrow> s ''x'' \<le> 0
 4. \<And>n. \<turnstile>\<^sub>t {\<lambda>s. Suc n = nat (s ''x'')} ''x'' ::= Plus (V ''x'') (N (- 1));; (''y'' ::= V ''x'';; WHILE Less (N 0) (V ''y'') DO ''y'' ::= Plus (V ''y'') (N (- 1))) {\<lambda>s. n = nat (s ''x'')}
[PROOF STEP]
apply auto[3]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. \<turnstile>\<^sub>t {\<lambda>s. Suc n = nat (s ''x'')} ''x'' ::= Plus (V ''x'') (N (- 1));; (''y'' ::= V ''x'';; WHILE Less (N 0) (V ''y'') DO ''y'' ::= Plus (V ''y'') (N (- 1))) {\<lambda>s. n = nat (s ''x'')}
[PROOF STEP]
apply(rule Seq)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>n. \<turnstile>\<^sub>t {\<lambda>s. Suc n = nat (s ''x'')} ''x'' ::= Plus (V ''x'') (N (- 1)) {?P\<^sub>229 n}
 2. \<And>n. \<turnstile>\<^sub>t {?P\<^sub>229 n} ''y'' ::= V ''x'';; WHILE Less (N 0) (V ''y'') DO ''y'' ::= Plus (V ''y'') (N (- 1)) {\<lambda>s. n = nat (s ''x'')}
[PROOF STEP]
prefer 2
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>n. \<turnstile>\<^sub>t {?P\<^sub>229 n} ''y'' ::= V ''x'';; WHILE Less (N 0) (V ''y'') DO ''y'' ::= Plus (V ''y'') (N (- 1)) {\<lambda>s. n = nat (s ''x'')}
 2. \<And>n. \<turnstile>\<^sub>t {\<lambda>s. Suc n = nat (s ''x'')} ''x'' ::= Plus (V ''x'') (N (- 1)) {?P\<^sub>229 n}
[PROOF STEP]
apply(rule Seq)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>n. \<turnstile>\<^sub>t {?P\<^sub>229 n} ''y'' ::= V ''x'' {?P\<^sub>232 n}
 2. \<And>n. \<turnstile>\<^sub>t {?P\<^sub>232 n} WHILE Less (N 0) (V ''y'') DO ''y'' ::= Plus (V ''y'') (N (- 1)) {\<lambda>s. n = nat (s ''x'')}
 3. \<And>n. \<turnstile>\<^sub>t {\<lambda>s. Suc n = nat (s ''x'')} ''x'' ::= Plus (V ''x'') (N (- 1)) {?P\<^sub>229 n}
[PROOF STEP]
prefer 2
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>n. \<turnstile>\<^sub>t {?P\<^sub>232 n} WHILE Less (N 0) (V ''y'') DO ''y'' ::= Plus (V ''y'') (N (- 1)) {\<lambda>s. n = nat (s ''x'')}
 2. \<And>n. \<turnstile>\<^sub>t {?P\<^sub>229 n} ''y'' ::= V ''x'' {?P\<^sub>232 n}
 3. \<And>n. \<turnstile>\<^sub>t {\<lambda>s. Suc n = nat (s ''x'')} ''x'' ::= Plus (V ''x'') (N (- 1)) {?P\<^sub>229 n}
[PROOF STEP]
apply(rule weaken_post)
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<And>n. \<turnstile>\<^sub>t {?P\<^sub>232 n} WHILE Less (N 0) (V ''y'') DO ''y'' ::= Plus (V ''y'') (N (- 1)) {?Q35 n}
 2. \<And>n. \<forall>s. ?Q35 n s \<longrightarrow> n = nat (s ''x'')
 3. \<And>n. \<turnstile>\<^sub>t {?P\<^sub>229 n} ''y'' ::= V ''x'' {?P\<^sub>232 n}
 4. \<And>n. \<turnstile>\<^sub>t {\<lambda>s. Suc n = nat (s ''x'')} ''x'' ::= Plus (V ''x'') (N (- 1)) {?P\<^sub>229 n}
[PROOF STEP]
apply(rule_tac P = "\<lambda>m s. n = nat(s ''x'') \<and> m = nat(s ''y'')" in While)
[PROOF STATE]
proof (prove)
goal (6 subgoals):
 1. \<And>n na. \<turnstile>\<^sub>t {\<lambda>s. n = nat (s ''x'') \<and> Suc na = nat (s ''y'')} ''y'' ::= Plus (V ''y'') (N (- 1)) {\<lambda>s. n = nat (s ''x'') \<and> na = nat (s ''y'')}
 2. \<And>n. \<forall>na s. n = nat (s ''x'') \<and> Suc na = nat (s ''y'') \<longrightarrow> bval (Less (N 0) (V ''y'')) s
 3. \<And>n. \<forall>s. n = nat (s ''x'') \<and> 0 = nat (s ''y'') \<longrightarrow> \<not> bval (Less (N 0) (V ''y'')) s
 4. \<And>n. \<forall>s. n = nat (s ''x'') \<and> 0 = nat (s ''y'') \<longrightarrow> n = nat (s ''x'')
 5. \<And>n. \<turnstile>\<^sub>t {?P\<^sub>229 n} ''y'' ::= V ''x'' {\<lambda>s. \<exists>na. n = nat (s ''x'') \<and> na = nat (s ''y'')}
 6. \<And>n. \<turnstile>\<^sub>t {\<lambda>s. Suc n = nat (s ''x'')} ''x'' ::= Plus (V ''x'') (N (- 1)) {?P\<^sub>229 n}
[PROOF STEP]
apply(rule Assign')
[PROOF STATE]
proof (prove)
goal (6 subgoals):
 1. \<And>n na. \<forall>s. n = nat (s ''x'') \<and> Suc na = nat (s ''y'') \<longrightarrow> n = nat ((s[Plus (V ''y'') (N (- 1))/''y'']) ''x'') \<and> na = nat ((s[Plus (V ''y'') (N (- 1))/''y'']) ''y'')
 2. \<And>n. \<forall>na s. n = nat (s ''x'') \<and> Suc na = nat (s ''y'') \<longrightarrow> bval (Less (N 0) (V ''y'')) s
 3. \<And>n. \<forall>s. n = nat (s ''x'') \<and> 0 = nat (s ''y'') \<longrightarrow> \<not> bval (Less (N 0) (V ''y'')) s
 4. \<And>n. \<forall>s. n = nat (s ''x'') \<and> 0 = nat (s ''y'') \<longrightarrow> n = nat (s ''x'')
 5. \<And>n. \<turnstile>\<^sub>t {?P\<^sub>229 n} ''y'' ::= V ''x'' {\<lambda>s. \<exists>na. n = nat (s ''x'') \<and> na = nat (s ''y'')}
 6. \<And>n. \<turnstile>\<^sub>t {\<lambda>s. Suc n = nat (s ''x'')} ''x'' ::= Plus (V ''x'') (N (- 1)) {?P\<^sub>229 n}
[PROOF STEP]
apply auto[4]
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>n. \<turnstile>\<^sub>t {?P\<^sub>229 n} ''y'' ::= V ''x'' {\<lambda>s. \<exists>na. n = nat (s ''x'') \<and> na = nat (s ''y'')}
 2. \<And>n. \<turnstile>\<^sub>t {\<lambda>s. Suc n = nat (s ''x'')} ''x'' ::= Plus (V ''x'') (N (- 1)) {?P\<^sub>229 n}
[PROOF STEP]
apply(rule Assign)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. \<turnstile>\<^sub>t {\<lambda>s. Suc n = nat (s ''x'')} ''x'' ::= Plus (V ''x'') (N (- 1)) {\<lambda>s. \<exists>na. n = nat ((s[V ''x''/''y'']) ''x'') \<and> na = nat ((s[V ''x''/''y'']) ''y'')}
[PROOF STEP]
apply(rule Assign')
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. \<forall>s. Suc n = nat (s ''x'') \<longrightarrow> (\<exists>na. n = nat (((s[Plus (V ''x'') (N (- 1))/''x''])[V ''x''/''y'']) ''x'') \<and> na = nat (((s[Plus (V ''x'') (N (- 1))/''x''])[V ''x''/''y'']) ''y''))
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
theorem radical_sqrt_normal_form:
  "radicals e \<noteq> {} \<Longrightarrow>
   \<exists> r \<in> radicals e.
        \<exists> a b. \<lbrace>e\<rbrace> = \<lbrace>Addition a (Multiplication b (Sqrt r))\<rbrace> \<and> \<lbrace>r\<rbrace> \<ge> 0 \<and>
               radicals a \<union> radicals b \<union> radicals r \<subseteq> radicals e &
               r \<notin> radicals a \<union> radicals b \<union> radicals r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. radicals e \<noteq> {} \<Longrightarrow> \<exists>r\<in>radicals e. \<exists>a b. \<lbrace>e\<rbrace> = \<lbrace>Addition a (Multiplication b (Sqrt r))\<rbrace> \<and> 0 \<le> \<lbrace>r\<rbrace> \<and> radicals a \<union> radicals b \<union> radicals r \<subseteq> radicals e \<and> r \<notin> radicals a \<union> radicals b \<union> radicals r
[PROOF STEP]
using upmost_radical_sqrt2 [of e] radical_sqrt_normal_form_lemma
[PROOF STATE]
proof (prove)
using this:
radicals e \<noteq> {} \<Longrightarrow> \<exists>r\<in>radicals e. \<forall>s\<in>radicals e. r \<notin> radicals s
\<lbrakk>radicals ?e \<noteq> {}; \<forall>s\<in>radicals ?e. ?r \<notin> radicals s; ?r \<in> radicals ?e\<rbrakk> \<Longrightarrow> \<exists>a b. 0 \<le> \<lbrace>?r\<rbrace> \<and> \<lbrace>?e\<rbrace> = \<lbrace>a\<rbrace> + \<lbrace>b\<rbrace> * sqrt \<lbrace>?r\<rbrace> \<and> radicals a \<union> radicals b \<union> radicals ?r \<subseteq> radicals ?e \<and> ?r \<notin> radicals a \<union> radicals b

goal (1 subgoal):
 1. radicals e \<noteq> {} \<Longrightarrow> \<exists>r\<in>radicals e. \<exists>a b. \<lbrace>e\<rbrace> = \<lbrace>Addition a (Multiplication b (Sqrt r))\<rbrace> \<and> 0 \<le> \<lbrace>r\<rbrace> \<and> radicals a \<union> radicals b \<union> radicals r \<subseteq> radicals e \<and> r \<notin> radicals a \<union> radicals b \<union> radicals r
[PROOF STEP]
by auto (metis all_not_in_conv leD)


[STATEMENT]
lemma partition_on_mset_set:
  assumes "finite A"
  assumes "partition_on A P"
  shows "partition_on_mset (mset_set A) (mset_set (image (\<lambda> x. mset_set x) P))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. partition_on_mset (mset_set A) (mset_set (mset_set ` P))
[PROOF STEP]
proof (intro partition_on_msetI)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<Sum>\<^sub># (mset_set (mset_set ` P)) = mset_set A
 2. {#} \<notin># mset_set (mset_set ` P)
[PROOF STEP]
have partd1: "\<Union>P = A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union> P = A
[PROOF STEP]
using assms partition_onD1
[PROOF STATE]
proof (prove)
using this:
finite A
partition_on A P
partition_on ?A ?P \<Longrightarrow> ?A = \<Union> ?P

goal (1 subgoal):
 1. \<Union> P = A
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<Union> P = A

goal (2 subgoals):
 1. \<Sum>\<^sub># (mset_set (mset_set ` P)) = mset_set A
 2. {#} \<notin># mset_set (mset_set ` P)
[PROOF STEP]
have imp: "\<And>x. x \<in># \<Sum>\<^sub># (mset_set (mset_set ` P)) \<Longrightarrow> x \<in># mset_set A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. x \<in># \<Sum>\<^sub># (mset_set (mset_set ` P)) \<Longrightarrow> x \<in># mset_set A
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in># \<Sum>\<^sub># (mset_set (mset_set ` P)) \<Longrightarrow> x \<in># mset_set A
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in># \<Sum>\<^sub># (mset_set (mset_set ` P)) \<Longrightarrow> x \<in># mset_set A
[PROOF STEP]
assume "x \<in># \<Sum>\<^sub># (mset_set (mset_set ` P))"
[PROOF STATE]
proof (state)
this:
x \<in># \<Sum>\<^sub># (mset_set (mset_set ` P))

goal (1 subgoal):
 1. \<And>x. x \<in># \<Sum>\<^sub># (mset_set (mset_set ` P)) \<Longrightarrow> x \<in># mset_set A
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<in># \<Sum>\<^sub># (mset_set (mset_set ` P))
[PROOF STEP]
obtain p where "p \<in> (mset_set ` P)" and xin: "x \<in># p"
[PROOF STATE]
proof (prove)
using this:
x \<in># \<Sum>\<^sub># (mset_set (mset_set ` P))

goal (1 subgoal):
 1. (\<And>p. \<lbrakk>p \<in> mset_set ` P; x \<in># p\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis elem_mset_set equals0D infinite_set_mset_mset_set mset_big_union_obtain)
[PROOF STATE]
proof (state)
this:
p \<in> mset_set ` P
x \<in># p

goal (1 subgoal):
 1. \<And>x. x \<in># \<Sum>\<^sub># (mset_set (mset_set ` P)) \<Longrightarrow> x \<in># mset_set A
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
p \<in> mset_set ` P
x \<in># p
[PROOF STEP]
have "set_mset p \<in> P"
[PROOF STATE]
proof (prove)
using this:
p \<in> mset_set ` P
x \<in># p

goal (1 subgoal):
 1. set_mset p \<in> P
[PROOF STEP]
by (metis empty_iff finite_set_mset_mset_set image_iff infinite_set_mset_mset_set)
[PROOF STATE]
proof (state)
this:
set_mset p \<in> P

goal (1 subgoal):
 1. \<And>x. x \<in># \<Sum>\<^sub># (mset_set (mset_set ` P)) \<Longrightarrow> x \<in># mset_set A
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
set_mset p \<in> P
[PROOF STEP]
show "x \<in># mset_set A"
[PROOF STATE]
proof (prove)
using this:
set_mset p \<in> P

goal (1 subgoal):
 1. x \<in># mset_set A
[PROOF STEP]
using partd1 xin assms(1)
[PROOF STATE]
proof (prove)
using this:
set_mset p \<in> P
\<Union> P = A
x \<in># p
finite A

goal (1 subgoal):
 1. x \<in># mset_set A
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x \<in># mset_set A

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
?x \<in># \<Sum>\<^sub># (mset_set (mset_set ` P)) \<Longrightarrow> ?x \<in># mset_set A

goal (2 subgoals):
 1. \<Sum>\<^sub># (mset_set (mset_set ` P)) = mset_set A
 2. {#} \<notin># mset_set (mset_set ` P)
[PROOF STEP]
have imp2: "\<And>x . x \<in># mset_set A \<Longrightarrow> x \<in># \<Sum>\<^sub># (mset_set (mset_set ` P))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. x \<in># mset_set A \<Longrightarrow> x \<in># \<Sum>\<^sub># (mset_set (mset_set ` P))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in># mset_set A \<Longrightarrow> x \<in># \<Sum>\<^sub># (mset_set (mset_set ` P))
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in># mset_set A \<Longrightarrow> x \<in># \<Sum>\<^sub># (mset_set (mset_set ` P))
[PROOF STEP]
assume "x \<in># mset_set A"
[PROOF STATE]
proof (state)
this:
x \<in># mset_set A

goal (1 subgoal):
 1. \<And>x. x \<in># mset_set A \<Longrightarrow> x \<in># \<Sum>\<^sub># (mset_set (mset_set ` P))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<in># mset_set A
[PROOF STEP]
have "x \<in> A"
[PROOF STATE]
proof (prove)
using this:
x \<in># mset_set A

goal (1 subgoal):
 1. x \<in> A
[PROOF STEP]
by (simp add: assms(1))
[PROOF STATE]
proof (state)
this:
x \<in> A

goal (1 subgoal):
 1. \<And>x. x \<in># mset_set A \<Longrightarrow> x \<in># \<Sum>\<^sub># (mset_set (mset_set ` P))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<in> A
[PROOF STEP]
obtain p where "p \<in> P" and "x \<in> p"
[PROOF STATE]
proof (prove)
using this:
x \<in> A

goal (1 subgoal):
 1. (\<And>p. \<lbrakk>p \<in> P; x \<in> p\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms(2)
[PROOF STATE]
proof (prove)
using this:
x \<in> A
partition_on A P

goal (1 subgoal):
 1. (\<And>p. \<lbrakk>p \<in> P; x \<in> p\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using partd1
[PROOF STATE]
proof (prove)
using this:
x \<in> A
partition_on A P
\<Union> P = A

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

goal (1 subgoal):
 1. \<And>x. x \<in># mset_set A \<Longrightarrow> x \<in># \<Sum>\<^sub># (mset_set (mset_set ` P))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
p \<in> P
x \<in> p
[PROOF STEP]
obtain p' where "p' \<in> (mset_set ` P)" and "p' = mset_set p"
[PROOF STATE]
proof (prove)
using this:
p \<in> P
x \<in> p

goal (1 subgoal):
 1. (\<And>p'. \<lbrakk>p' \<in> mset_set ` P; p' = mset_set p\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
p' \<in> mset_set ` P
p' = mset_set p

goal (1 subgoal):
 1. \<And>x. x \<in># mset_set A \<Longrightarrow> x \<in># \<Sum>\<^sub># (mset_set (mset_set ` P))
[PROOF STEP]
thus "x \<in># \<Sum>\<^sub># (mset_set (mset_set ` P))"
[PROOF STATE]
proof (prove)
using this:
p' \<in> mset_set ` P
p' = mset_set p

goal (1 subgoal):
 1. x \<in># \<Sum>\<^sub># (mset_set (mset_set ` P))
[PROOF STEP]
using assms \<open>p \<in> P\<close> \<open>x \<in> p\<close> finite_elements partd1
[PROOF STATE]
proof (prove)
using this:
p' \<in> mset_set ` P
p' = mset_set p
finite A
partition_on A P
p \<in> P
x \<in> p
\<lbrakk>finite ?A; partition_on ?A ?P\<rbrakk> \<Longrightarrow> finite ?P
\<Union> P = A

goal (1 subgoal):
 1. x \<in># \<Sum>\<^sub># (mset_set (mset_set ` P))
[PROOF STEP]
by (metis Sup_upper finite_imageI finite_set_mset_mset_set in_Union_mset_iff rev_finite_subset)
[PROOF STATE]
proof (state)
this:
x \<in># \<Sum>\<^sub># (mset_set (mset_set ` P))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
?x \<in># mset_set A \<Longrightarrow> ?x \<in># \<Sum>\<^sub># (mset_set (mset_set ` P))

goal (2 subgoals):
 1. \<Sum>\<^sub># (mset_set (mset_set ` P)) = mset_set A
 2. {#} \<notin># mset_set (mset_set ` P)
[PROOF STEP]
have a1: "\<And> x . x \<in># mset_set A \<Longrightarrow> count (mset_set A) x = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. x \<in># mset_set A \<Longrightarrow> count (mset_set A) x = 1
[PROOF STEP]
using assms(1)
[PROOF STATE]
proof (prove)
using this:
finite A

goal (1 subgoal):
 1. \<And>x. x \<in># mset_set A \<Longrightarrow> count (mset_set A) x = 1
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
?x \<in># mset_set A \<Longrightarrow> count (mset_set A) ?x = 1

goal (2 subgoals):
 1. \<Sum>\<^sub># (mset_set (mset_set ` P)) = mset_set A
 2. {#} \<notin># mset_set (mset_set ` P)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
?x \<in># mset_set A \<Longrightarrow> count (mset_set A) ?x = 1
[PROOF STEP]
show "\<Sum>\<^sub># (mset_set (mset_set ` P)) = mset_set A"
[PROOF STATE]
proof (prove)
using this:
?x \<in># mset_set A \<Longrightarrow> count (mset_set A) ?x = 1

goal (1 subgoal):
 1. \<Sum>\<^sub># (mset_set (mset_set ` P)) = mset_set A
[PROOF STEP]
using imp imp2 a1
[PROOF STATE]
proof (prove)
using this:
?x \<in># mset_set A \<Longrightarrow> count (mset_set A) ?x = 1
?x \<in># \<Sum>\<^sub># (mset_set (mset_set ` P)) \<Longrightarrow> ?x \<in># mset_set A
?x \<in># mset_set A \<Longrightarrow> ?x \<in># \<Sum>\<^sub># (mset_set (mset_set ` P))
?x \<in># mset_set A \<Longrightarrow> count (mset_set A) ?x = 1

goal (1 subgoal):
 1. \<Sum>\<^sub># (mset_set (mset_set ` P)) = mset_set A
[PROOF STEP]
by (metis assms(1) assms(2) count_eq_zero_iff multiset_eqI sigma_over_set_partition_count)
[PROOF STATE]
proof (state)
this:
\<Sum>\<^sub># (mset_set (mset_set ` P)) = mset_set A

goal (1 subgoal):
 1. {#} \<notin># mset_set (mset_set ` P)
[PROOF STEP]
have "\<And> p. p \<in> P \<Longrightarrow>  p \<noteq> {} "
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>p. p \<in> P \<Longrightarrow> p \<noteq> {}
[PROOF STEP]
using assms partition_onD3
[PROOF STATE]
proof (prove)
using this:
finite A
partition_on A P
partition_on ?A ?P \<Longrightarrow> {} \<notin> ?P

goal (1 subgoal):
 1. \<And>p. p \<in> P \<Longrightarrow> p \<noteq> {}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
?p \<in> P \<Longrightarrow> ?p \<noteq> {}

goal (1 subgoal):
 1. {#} \<notin># mset_set (mset_set ` P)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
?p \<in> P \<Longrightarrow> ?p \<noteq> {}
[PROOF STEP]
have "\<And> p. p \<in> P \<Longrightarrow>  mset_set p \<noteq> {#}"
[PROOF STATE]
proof (prove)
using this:
?p \<in> P \<Longrightarrow> ?p \<noteq> {}

goal (1 subgoal):
 1. \<And>p. p \<in> P \<Longrightarrow> mset_set p \<noteq> {#}
[PROOF STEP]
using mset_set_empty_iff
[PROOF STATE]
proof (prove)
using this:
?p \<in> P \<Longrightarrow> ?p \<noteq> {}
(mset_set ?A = {#}) = (?A = {} \<or> infinite ?A)

goal (1 subgoal):
 1. \<And>p. p \<in> P \<Longrightarrow> mset_set p \<noteq> {#}
[PROOF STEP]
by (metis Union_upper assms(1) partd1 rev_finite_subset)
[PROOF STATE]
proof (state)
this:
?p \<in> P \<Longrightarrow> mset_set ?p \<noteq> {#}

goal (1 subgoal):
 1. {#} \<notin># mset_set (mset_set ` P)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
?p \<in> P \<Longrightarrow> mset_set ?p \<noteq> {#}
[PROOF STEP]
show "{#} \<notin># mset_set (mset_set ` P)"
[PROOF STATE]
proof (prove)
using this:
?p \<in> P \<Longrightarrow> mset_set ?p \<noteq> {#}

goal (1 subgoal):
 1. {#} \<notin># mset_set (mset_set ` P)
[PROOF STEP]
by (metis elem_mset_set equals0D image_iff infinite_set_mset_mset_set)
[PROOF STATE]
proof (state)
this:
{#} \<notin># mset_set (mset_set ` P)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma steps'_snoc: "length rs = length as \<Longrightarrow> n = (length as)
       \<Longrightarrow> steps' init (rs@[r]) (as@[a]) (Suc n) = step (steps' init rs as n) r a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>length rs = length as; n = length as\<rbrakk> \<Longrightarrow> steps' init (rs @ [r]) (as @ [a]) (Suc n) = step (steps' init rs as n) r a
[PROOF STEP]
apply(induct rs as arbitrary: init n r a rule: list_induct2)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>init n r a. n = length [] \<Longrightarrow> steps' init ([] @ [r]) ([] @ [a]) (Suc n) = step (steps' init [] [] n) r a
 2. \<And>x xs y ys init n r a. \<lbrakk>length xs = length ys; \<And>init n r a. n = length ys \<Longrightarrow> steps' init (xs @ [r]) (ys @ [a]) (Suc n) = step (steps' init xs ys n) r a; n = length (y # ys)\<rbrakk> \<Longrightarrow> steps' init ((x # xs) @ [r]) ((y # ys) @ [a]) (Suc n) = step (steps' init (x # xs) (y # ys) n) r a
[PROOF STEP]
by (simp_all)