[STATEMENT]
theorem no_interleaving:
  assumes "insert_ops ops"
    and "insert_seq start xs" and "insert_ops xs"
    and "insert_seq start ys" and "insert_ops ys"
    and "set xs \<subseteq> set ops" and "set ys \<subseteq> set ops"
    and "distinct (map fst xs @ map fst ys)"
    and "start = None \<or> (\<exists>r. start = Some r \<and> r \<in> set (interp_ins ops))"
  shows "(\<forall>x \<in> set (map fst xs). \<forall>y \<in> set (map fst ys). list_order ops x y) \<or>
         (\<forall>x \<in> set (map fst xs). \<forall>y \<in> set (map fst ys). list_order ops y x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>x\<in>set (map fst xs). \<forall>y\<in>set (map fst ys). list_order ops x y) \<or> (\<forall>x\<in>set (map fst xs). \<forall>y\<in>set (map fst ys). list_order ops y x)
[PROOF STEP]
proof(cases "fst (hd xs) < fst (hd ys)")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. fst (hd xs) < fst (hd ys) \<Longrightarrow> (\<forall>x\<in>set (map fst xs). \<forall>y\<in>set (map fst ys). list_order ops x y) \<or> (\<forall>x\<in>set (map fst xs). \<forall>y\<in>set (map fst ys). list_order ops y x)
 2. \<not> fst (hd xs) < fst (hd ys) \<Longrightarrow> (\<forall>x\<in>set (map fst xs). \<forall>y\<in>set (map fst ys). list_order ops x y) \<or> (\<forall>x\<in>set (map fst xs). \<forall>y\<in>set (map fst ys). list_order ops y x)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
fst (hd xs) < fst (hd ys)

goal (2 subgoals):
 1. fst (hd xs) < fst (hd ys) \<Longrightarrow> (\<forall>x\<in>set (map fst xs). \<forall>y\<in>set (map fst ys). list_order ops x y) \<or> (\<forall>x\<in>set (map fst xs). \<forall>y\<in>set (map fst ys). list_order ops y x)
 2. \<not> fst (hd xs) < fst (hd ys) \<Longrightarrow> (\<forall>x\<in>set (map fst xs). \<forall>y\<in>set (map fst ys). list_order ops x y) \<or> (\<forall>x\<in>set (map fst xs). \<forall>y\<in>set (map fst ys). list_order ops y x)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
fst (hd xs) < fst (hd ys)

goal (2 subgoals):
 1. fst (hd xs) < fst (hd ys) \<Longrightarrow> (\<forall>x\<in>set (map fst xs). \<forall>y\<in>set (map fst ys). list_order ops x y) \<or> (\<forall>x\<in>set (map fst xs). \<forall>y\<in>set (map fst ys). list_order ops y x)
 2. \<not> fst (hd xs) < fst (hd ys) \<Longrightarrow> (\<forall>x\<in>set (map fst xs). \<forall>y\<in>set (map fst ys). list_order ops x y) \<or> (\<forall>x\<in>set (map fst xs). \<forall>y\<in>set (map fst ys). list_order ops y x)
[PROOF STEP]
have "\<And>r. start = Some r \<Longrightarrow> r \<in> set (interp_ins ops)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>r. start = Some r \<Longrightarrow> r \<in> set (interp_ins ops)
[PROOF STEP]
using assms(9)
[PROOF STATE]
proof (prove)
using this:
start = None \<or> (\<exists>r. start = Some r \<and> r \<in> set (interp_ins ops))

goal (1 subgoal):
 1. \<And>r. start = Some r \<Longrightarrow> r \<in> set (interp_ins ops)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
start = Some ?r \<Longrightarrow> ?r \<in> set (interp_ins ops)

goal (2 subgoals):
 1. fst (hd xs) < fst (hd ys) \<Longrightarrow> (\<forall>x\<in>set (map fst xs). \<forall>y\<in>set (map fst ys). list_order ops x y) \<or> (\<forall>x\<in>set (map fst xs). \<forall>y\<in>set (map fst ys). list_order ops y x)
 2. \<not> fst (hd xs) < fst (hd ys) \<Longrightarrow> (\<forall>x\<in>set (map fst xs). \<forall>y\<in>set (map fst ys). list_order ops x y) \<or> (\<forall>x\<in>set (map fst xs). \<forall>y\<in>set (map fst ys). list_order ops y x)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
fst (hd xs) < fst (hd ys)
start = Some ?r \<Longrightarrow> ?r \<in> set (interp_ins ops)
[PROOF STEP]
have "\<forall>x\<in>set (map fst xs). \<forall>y\<in>set (map fst ys). list_order ops y x"
[PROOF STATE]
proof (prove)
using this:
fst (hd xs) < fst (hd ys)
start = Some ?r \<Longrightarrow> ?r \<in> set (interp_ins ops)

goal (1 subgoal):
 1. \<forall>x\<in>set (map fst xs). \<forall>y\<in>set (map fst ys). list_order ops y x
[PROOF STEP]
using assms no_interleaving_ordered
[PROOF STATE]
proof (prove)
using this:
fst (hd xs) < fst (hd ys)
start = Some ?r \<Longrightarrow> ?r \<in> set (interp_ins ops)
insert_ops ops
insert_seq start xs
insert_ops xs
insert_seq start ys
insert_ops ys
set xs \<subseteq> set ops
set ys \<subseteq> set ops
distinct (map fst xs @ map fst ys)
start = None \<or> (\<exists>r. start = Some r \<and> r \<in> set (interp_ins ops))
\<lbrakk>insert_ops ?ops; insert_seq ?start ?xs; insert_ops ?xs; insert_seq ?start ?ys; insert_ops ?ys; set ?xs \<subseteq> set ?ops; set ?ys \<subseteq> set ?ops; distinct (map fst ?xs @ map fst ?ys); fst (hd ?xs) < fst (hd ?ys); \<And>r. ?start = Some r \<Longrightarrow> r \<in> set (interp_ins ?ops)\<rbrakk> \<Longrightarrow> (\<forall>x\<in>set (map fst ?xs). \<forall>y\<in>set (map fst ?ys). list_order ?ops y x) \<and> (\<forall>r. ?start = Some r \<longrightarrow> (\<forall>x\<in>set (map fst ?xs). list_order ?ops r x) \<and> (\<forall>y\<in>set (map fst ?ys). list_order ?ops r y))

goal (1 subgoal):
 1. \<forall>x\<in>set (map fst xs). \<forall>y\<in>set (map fst ys). list_order ops y x
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<forall>x\<in>set (map fst xs). \<forall>y\<in>set (map fst ys). list_order ops y x

goal (2 subgoals):
 1. fst (hd xs) < fst (hd ys) \<Longrightarrow> (\<forall>x\<in>set (map fst xs). \<forall>y\<in>set (map fst ys). list_order ops x y) \<or> (\<forall>x\<in>set (map fst xs). \<forall>y\<in>set (map fst ys). list_order ops y x)
 2. \<not> fst (hd xs) < fst (hd ys) \<Longrightarrow> (\<forall>x\<in>set (map fst xs). \<forall>y\<in>set (map fst ys). list_order ops x y) \<or> (\<forall>x\<in>set (map fst xs). \<forall>y\<in>set (map fst ys). list_order ops y x)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>x\<in>set (map fst xs). \<forall>y\<in>set (map fst ys). list_order ops y x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>set (map fst xs). \<forall>y\<in>set (map fst ys). list_order ops y x

goal (1 subgoal):
 1. (\<forall>x\<in>set (map fst xs). \<forall>y\<in>set (map fst ys). list_order ops x y) \<or> (\<forall>x\<in>set (map fst xs). \<forall>y\<in>set (map fst ys). list_order ops y x)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(\<forall>x\<in>set (map fst xs). \<forall>y\<in>set (map fst ys). list_order ops x y) \<or> (\<forall>x\<in>set (map fst xs). \<forall>y\<in>set (map fst ys). list_order ops y x)

goal (1 subgoal):
 1. \<not> fst (hd xs) < fst (hd ys) \<Longrightarrow> (\<forall>x\<in>set (map fst xs). \<forall>y\<in>set (map fst ys). list_order ops x y) \<or> (\<forall>x\<in>set (map fst xs). \<forall>y\<in>set (map fst ys). list_order ops y x)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> fst (hd xs) < fst (hd ys) \<Longrightarrow> (\<forall>x\<in>set (map fst xs). \<forall>y\<in>set (map fst ys). list_order ops x y) \<or> (\<forall>x\<in>set (map fst xs). \<forall>y\<in>set (map fst ys). list_order ops y x)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> fst (hd xs) < fst (hd ys)

goal (1 subgoal):
 1. \<not> fst (hd xs) < fst (hd ys) \<Longrightarrow> (\<forall>x\<in>set (map fst xs). \<forall>y\<in>set (map fst ys). list_order ops x y) \<or> (\<forall>x\<in>set (map fst xs). \<forall>y\<in>set (map fst ys). list_order ops y x)
[PROOF STEP]
hence "fst (hd ys) < fst (hd xs)"
[PROOF STATE]
proof (prove)
using this:
\<not> fst (hd xs) < fst (hd ys)

goal (1 subgoal):
 1. fst (hd ys) < fst (hd xs)
[PROOF STEP]
using assms(2) assms(4) assms(8) insert_seq_nonempty distinct_fst_append
[PROOF STATE]
proof (prove)
using this:
\<not> fst (hd xs) < fst (hd ys)
insert_seq start xs
insert_seq start ys
distinct (map fst xs @ map fst ys)
insert_seq ?start ?xs \<Longrightarrow> ?xs \<noteq> []
\<lbrakk>?x \<in> set (map fst ?xs); distinct (map fst (?xs @ ?ys))\<rbrakk> \<Longrightarrow> ?x \<notin> set (map fst ?ys)

goal (1 subgoal):
 1. fst (hd ys) < fst (hd xs)
[PROOF STEP]
by (metis (no_types, lifting) hd_in_set hd_map list.map_disc_iff map_append neqE)
[PROOF STATE]
proof (state)
this:
fst (hd ys) < fst (hd xs)

goal (1 subgoal):
 1. \<not> fst (hd xs) < fst (hd ys) \<Longrightarrow> (\<forall>x\<in>set (map fst xs). \<forall>y\<in>set (map fst ys). list_order ops x y) \<or> (\<forall>x\<in>set (map fst xs). \<forall>y\<in>set (map fst ys). list_order ops y x)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
fst (hd ys) < fst (hd xs)

goal (1 subgoal):
 1. \<not> fst (hd xs) < fst (hd ys) \<Longrightarrow> (\<forall>x\<in>set (map fst xs). \<forall>y\<in>set (map fst ys). list_order ops x y) \<or> (\<forall>x\<in>set (map fst xs). \<forall>y\<in>set (map fst ys). list_order ops y x)
[PROOF STEP]
have "distinct (map fst ys @ map fst xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distinct (map fst ys @ map fst xs)
[PROOF STEP]
using assms(8) distinct_append_swap
[PROOF STATE]
proof (prove)
using this:
distinct (map fst xs @ map fst ys)
distinct (?xs @ ?ys) \<Longrightarrow> distinct (?ys @ ?xs)

goal (1 subgoal):
 1. distinct (map fst ys @ map fst xs)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
distinct (map fst ys @ map fst xs)

goal (1 subgoal):
 1. \<not> fst (hd xs) < fst (hd ys) \<Longrightarrow> (\<forall>x\<in>set (map fst xs). \<forall>y\<in>set (map fst ys). list_order ops x y) \<or> (\<forall>x\<in>set (map fst xs). \<forall>y\<in>set (map fst ys). list_order ops y x)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
distinct (map fst ys @ map fst xs)

goal (1 subgoal):
 1. \<not> fst (hd xs) < fst (hd ys) \<Longrightarrow> (\<forall>x\<in>set (map fst xs). \<forall>y\<in>set (map fst ys). list_order ops x y) \<or> (\<forall>x\<in>set (map fst xs). \<forall>y\<in>set (map fst ys). list_order ops y x)
[PROOF STEP]
have "\<And>r. start = Some r \<Longrightarrow> r \<in> set (interp_ins ops)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>r. start = Some r \<Longrightarrow> r \<in> set (interp_ins ops)
[PROOF STEP]
using assms(9)
[PROOF STATE]
proof (prove)
using this:
start = None \<or> (\<exists>r. start = Some r \<and> r \<in> set (interp_ins ops))

goal (1 subgoal):
 1. \<And>r. start = Some r \<Longrightarrow> r \<in> set (interp_ins ops)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
start = Some ?r \<Longrightarrow> ?r \<in> set (interp_ins ops)

goal (1 subgoal):
 1. \<not> fst (hd xs) < fst (hd ys) \<Longrightarrow> (\<forall>x\<in>set (map fst xs). \<forall>y\<in>set (map fst ys). list_order ops x y) \<or> (\<forall>x\<in>set (map fst xs). \<forall>y\<in>set (map fst ys). list_order ops y x)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
fst (hd ys) < fst (hd xs)
distinct (map fst ys @ map fst xs)
start = Some ?r \<Longrightarrow> ?r \<in> set (interp_ins ops)
[PROOF STEP]
have "\<forall>x\<in>set (map fst ys). \<forall>y\<in>set (map fst xs). list_order ops y x"
[PROOF STATE]
proof (prove)
using this:
fst (hd ys) < fst (hd xs)
distinct (map fst ys @ map fst xs)
start = Some ?r \<Longrightarrow> ?r \<in> set (interp_ins ops)

goal (1 subgoal):
 1. \<forall>x\<in>set (map fst ys). \<forall>y\<in>set (map fst xs). list_order ops y x
[PROOF STEP]
using assms no_interleaving_ordered
[PROOF STATE]
proof (prove)
using this:
fst (hd ys) < fst (hd xs)
distinct (map fst ys @ map fst xs)
start = Some ?r \<Longrightarrow> ?r \<in> set (interp_ins ops)
insert_ops ops
insert_seq start xs
insert_ops xs
insert_seq start ys
insert_ops ys
set xs \<subseteq> set ops
set ys \<subseteq> set ops
distinct (map fst xs @ map fst ys)
start = None \<or> (\<exists>r. start = Some r \<and> r \<in> set (interp_ins ops))
\<lbrakk>insert_ops ?ops; insert_seq ?start ?xs; insert_ops ?xs; insert_seq ?start ?ys; insert_ops ?ys; set ?xs \<subseteq> set ?ops; set ?ys \<subseteq> set ?ops; distinct (map fst ?xs @ map fst ?ys); fst (hd ?xs) < fst (hd ?ys); \<And>r. ?start = Some r \<Longrightarrow> r \<in> set (interp_ins ?ops)\<rbrakk> \<Longrightarrow> (\<forall>x\<in>set (map fst ?xs). \<forall>y\<in>set (map fst ?ys). list_order ?ops y x) \<and> (\<forall>r. ?start = Some r \<longrightarrow> (\<forall>x\<in>set (map fst ?xs). list_order ?ops r x) \<and> (\<forall>y\<in>set (map fst ?ys). list_order ?ops r y))

goal (1 subgoal):
 1. \<forall>x\<in>set (map fst ys). \<forall>y\<in>set (map fst xs). list_order ops y x
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<forall>x\<in>set (map fst ys). \<forall>y\<in>set (map fst xs). list_order ops y x

goal (1 subgoal):
 1. \<not> fst (hd xs) < fst (hd ys) \<Longrightarrow> (\<forall>x\<in>set (map fst xs). \<forall>y\<in>set (map fst ys). list_order ops x y) \<or> (\<forall>x\<in>set (map fst xs). \<forall>y\<in>set (map fst ys). list_order ops y x)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>x\<in>set (map fst ys). \<forall>y\<in>set (map fst xs). list_order ops y x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>set (map fst ys). \<forall>y\<in>set (map fst xs). list_order ops y x

goal (1 subgoal):
 1. (\<forall>x\<in>set (map fst xs). \<forall>y\<in>set (map fst ys). list_order ops x y) \<or> (\<forall>x\<in>set (map fst xs). \<forall>y\<in>set (map fst ys). list_order ops y x)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(\<forall>x\<in>set (map fst xs). \<forall>y\<in>set (map fst ys). list_order ops x y) \<or> (\<forall>x\<in>set (map fst xs). \<forall>y\<in>set (map fst ys). list_order ops y x)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma filter_mset_is_empty_iff: "filter_mset P A = {#} \<longleftrightarrow> (\<forall>x. x \<in># A \<longrightarrow> \<not>P x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (filter_mset P A = {#}) = (\<forall>x. x \<in># A \<longrightarrow> \<not> P x)
[PROOF STEP]
by (auto simp: multiset_eq_iff count_eq_zero_iff)


[STATEMENT]
lemma hd_drop[simp]:
    assumes "n < length xs"
    shows "hd (drop n xs) = xs ! n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. hd (drop n xs) = xs ! n
[PROOF STEP]
using hd_drop_conv_nth assms
[PROOF STATE]
proof (prove)
using this:
?n < length ?xs \<Longrightarrow> hd (drop ?n ?xs) = ?xs ! ?n
n < length xs

goal (1 subgoal):
 1. hd (drop n xs) = xs ! n
[PROOF STEP]
by this


[STATEMENT]
lemma tanh_real_bounds: "tanh (x :: real) \<in> {-1<..<1}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. tanh x \<in> {- 1<..<1}
[PROOF STEP]
using tanh_real_lt_1 tanh_real_gt_neg1
[PROOF STATE]
proof (prove)
using this:
tanh ?x < 1
- 1 < tanh ?x

goal (1 subgoal):
 1. tanh x \<in> {- 1<..<1}
[PROOF STEP]
by simp


[STATEMENT]
lemma word_shiftl_add_distrib:
  fixes x :: "'a :: len word"
  shows "(x + y) << n = (x << n) + (y << n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x + y << n = (x << n) + (y << n)
[PROOF STEP]
by (simp add: shiftl_t2n ring_distribs)