[STATEMENT]
lemma contradicting_in_cp: assumes leq:\<open>\<sigma> =\<^sub>L \<sigma>'\<close> and cseq: \<open>cs\<^bsup>path \<sigma>\<^esup> k = cs\<^bsup>path \<sigma>'\<^esup> k'\<close>
and readv: \<open>v\<in>reads(path \<sigma> k)\<close> and vneq: \<open>(\<sigma>\<^bsup>k\<^esup>) v \<noteq> (\<sigma>'\<^bsup>k'\<^esup>) v\<close> shows \<open>((\<sigma>,k),(\<sigma>',k')) \<in> cp\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
using cseq readv vneq
[PROOF STATE]
proof (prove)
using this:
cs\<^bsup>path \<sigma>\<^esup> k = cs\<^bsup>path \<sigma>'\<^esup> k'
v \<in> local.reads (path \<sigma> k)
(\<sigma>\<^bsup>k\<^esup>) v \<noteq> (\<sigma>'\<^bsup>k'\<^esup>) v

goal (1 subgoal):
 1. ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
proof(induction \<open>k+k'\<close> arbitrary: \<open>k\<close> \<open>k'\<close> \<open>v\<close> rule: less_induct)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>k k' v. \<lbrakk>\<And>ka k'a v. \<lbrakk>ka + k'a < k + k'; cs\<^bsup>path \<sigma>\<^esup> ka = cs\<^bsup>path \<sigma>'\<^esup> k'a; v \<in> local.reads (path \<sigma> ka); (\<sigma>\<^bsup>ka\<^esup>) v \<noteq> (\<sigma>'\<^bsup>k'a\<^esup>) v\<rbrakk> \<Longrightarrow> ((\<sigma>, ka), \<sigma>', k'a) \<in> cp; cs\<^bsup>path \<sigma>\<^esup> k = cs\<^bsup>path \<sigma>'\<^esup> k'; v \<in> local.reads (path \<sigma> k); (\<sigma>\<^bsup>k\<^esup>) v \<noteq> (\<sigma>'\<^bsup>k'\<^esup>) v\<rbrakk> \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
fix k k' v
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>k k' v. \<lbrakk>\<And>ka k'a v. \<lbrakk>ka + k'a < k + k'; cs\<^bsup>path \<sigma>\<^esup> ka = cs\<^bsup>path \<sigma>'\<^esup> k'a; v \<in> local.reads (path \<sigma> ka); (\<sigma>\<^bsup>ka\<^esup>) v \<noteq> (\<sigma>'\<^bsup>k'a\<^esup>) v\<rbrakk> \<Longrightarrow> ((\<sigma>, ka), \<sigma>', k'a) \<in> cp; cs\<^bsup>path \<sigma>\<^esup> k = cs\<^bsup>path \<sigma>'\<^esup> k'; v \<in> local.reads (path \<sigma> k); (\<sigma>\<^bsup>k\<^esup>) v \<noteq> (\<sigma>'\<^bsup>k'\<^esup>) v\<rbrakk> \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
assume csk: \<open>cs\<^bsup>path \<sigma>\<^esup> k = cs\<^bsup>path \<sigma>'\<^esup> k'\<close>
[PROOF STATE]
proof (state)
this:
cs\<^bsup>path \<sigma>\<^esup> k = cs\<^bsup>path \<sigma>'\<^esup> k'

goal (1 subgoal):
 1. \<And>k k' v. \<lbrakk>\<And>ka k'a v. \<lbrakk>ka + k'a < k + k'; cs\<^bsup>path \<sigma>\<^esup> ka = cs\<^bsup>path \<sigma>'\<^esup> k'a; v \<in> local.reads (path \<sigma> ka); (\<sigma>\<^bsup>ka\<^esup>) v \<noteq> (\<sigma>'\<^bsup>k'a\<^esup>) v\<rbrakk> \<Longrightarrow> ((\<sigma>, ka), \<sigma>', k'a) \<in> cp; cs\<^bsup>path \<sigma>\<^esup> k = cs\<^bsup>path \<sigma>'\<^esup> k'; v \<in> local.reads (path \<sigma> k); (\<sigma>\<^bsup>k\<^esup>) v \<noteq> (\<sigma>'\<^bsup>k'\<^esup>) v\<rbrakk> \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
assume vread: \<open>v \<in> reads (path \<sigma> k)\<close>
[PROOF STATE]
proof (state)
this:
v \<in> local.reads (path \<sigma> k)

goal (1 subgoal):
 1. \<And>k k' v. \<lbrakk>\<And>ka k'a v. \<lbrakk>ka + k'a < k + k'; cs\<^bsup>path \<sigma>\<^esup> ka = cs\<^bsup>path \<sigma>'\<^esup> k'a; v \<in> local.reads (path \<sigma> ka); (\<sigma>\<^bsup>ka\<^esup>) v \<noteq> (\<sigma>'\<^bsup>k'a\<^esup>) v\<rbrakk> \<Longrightarrow> ((\<sigma>, ka), \<sigma>', k'a) \<in> cp; cs\<^bsup>path \<sigma>\<^esup> k = cs\<^bsup>path \<sigma>'\<^esup> k'; v \<in> local.reads (path \<sigma> k); (\<sigma>\<^bsup>k\<^esup>) v \<noteq> (\<sigma>'\<^bsup>k'\<^esup>) v\<rbrakk> \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
assume vneq: \<open>(\<sigma>\<^bsup>k\<^esup>) v \<noteq> (\<sigma>'\<^bsup>k'\<^esup>) v\<close>
[PROOF STATE]
proof (state)
this:
(\<sigma>\<^bsup>k\<^esup>) v \<noteq> (\<sigma>'\<^bsup>k'\<^esup>) v

goal (1 subgoal):
 1. \<And>k k' v. \<lbrakk>\<And>ka k'a v. \<lbrakk>ka + k'a < k + k'; cs\<^bsup>path \<sigma>\<^esup> ka = cs\<^bsup>path \<sigma>'\<^esup> k'a; v \<in> local.reads (path \<sigma> ka); (\<sigma>\<^bsup>ka\<^esup>) v \<noteq> (\<sigma>'\<^bsup>k'a\<^esup>) v\<rbrakk> \<Longrightarrow> ((\<sigma>, ka), \<sigma>', k'a) \<in> cp; cs\<^bsup>path \<sigma>\<^esup> k = cs\<^bsup>path \<sigma>'\<^esup> k'; v \<in> local.reads (path \<sigma> k); (\<sigma>\<^bsup>k\<^esup>) v \<noteq> (\<sigma>'\<^bsup>k'\<^esup>) v\<rbrakk> \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
assume IH: \<open>\<And>ka k'a v. ka + k'a < k + k' \<Longrightarrow> cs\<^bsup>path \<sigma>\<^esup> ka = cs\<^bsup>path \<sigma>'\<^esup> k'a \<Longrightarrow> v \<in> reads (path \<sigma> ka) \<Longrightarrow> (\<sigma>\<^bsup>ka\<^esup>) v \<noteq> (\<sigma>'\<^bsup>k'a\<^esup>) v \<Longrightarrow> ((\<sigma>, ka), \<sigma>', k'a) \<in> cp\<close>
[PROOF STATE]
proof (state)
this:
\<lbrakk>?ka1 + ?k'a1 < k + k'; cs\<^bsup>path \<sigma>\<^esup> ?ka1 = cs\<^bsup>path \<sigma>'\<^esup> ?k'a1; ?v1 \<in> local.reads (path \<sigma> ?ka1); (\<sigma>\<^bsup>?ka1\<^esup>) ?v1 \<noteq> (\<sigma>'\<^bsup>?k'a1\<^esup>) ?v1\<rbrakk> \<Longrightarrow> ((\<sigma>, ?ka1), \<sigma>', ?k'a1) \<in> cp

goal (1 subgoal):
 1. \<And>k k' v. \<lbrakk>\<And>ka k'a v. \<lbrakk>ka + k'a < k + k'; cs\<^bsup>path \<sigma>\<^esup> ka = cs\<^bsup>path \<sigma>'\<^esup> k'a; v \<in> local.reads (path \<sigma> ka); (\<sigma>\<^bsup>ka\<^esup>) v \<noteq> (\<sigma>'\<^bsup>k'a\<^esup>) v\<rbrakk> \<Longrightarrow> ((\<sigma>, ka), \<sigma>', k'a) \<in> cp; cs\<^bsup>path \<sigma>\<^esup> k = cs\<^bsup>path \<sigma>'\<^esup> k'; v \<in> local.reads (path \<sigma> k); (\<sigma>\<^bsup>k\<^esup>) v \<noteq> (\<sigma>'\<^bsup>k'\<^esup>) v\<rbrakk> \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
define \<pi> where  \<open>\<pi> \<equiv> path \<sigma>\<close>
[PROOF STATE]
proof (state)
this:
\<pi> \<equiv> path \<sigma>

goal (1 subgoal):
 1. \<And>k k' v. \<lbrakk>\<And>ka k'a v. \<lbrakk>ka + k'a < k + k'; cs\<^bsup>path \<sigma>\<^esup> ka = cs\<^bsup>path \<sigma>'\<^esup> k'a; v \<in> local.reads (path \<sigma> ka); (\<sigma>\<^bsup>ka\<^esup>) v \<noteq> (\<sigma>'\<^bsup>k'a\<^esup>) v\<rbrakk> \<Longrightarrow> ((\<sigma>, ka), \<sigma>', k'a) \<in> cp; cs\<^bsup>path \<sigma>\<^esup> k = cs\<^bsup>path \<sigma>'\<^esup> k'; v \<in> local.reads (path \<sigma> k); (\<sigma>\<^bsup>k\<^esup>) v \<noteq> (\<sigma>'\<^bsup>k'\<^esup>) v\<rbrakk> \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
define \<pi>' where \<open>\<pi>' \<equiv> path \<sigma>'\<close>
[PROOF STATE]
proof (state)
this:
\<pi>' \<equiv> path \<sigma>'

goal (1 subgoal):
 1. \<And>k k' v. \<lbrakk>\<And>ka k'a v. \<lbrakk>ka + k'a < k + k'; cs\<^bsup>path \<sigma>\<^esup> ka = cs\<^bsup>path \<sigma>'\<^esup> k'a; v \<in> local.reads (path \<sigma> ka); (\<sigma>\<^bsup>ka\<^esup>) v \<noteq> (\<sigma>'\<^bsup>k'a\<^esup>) v\<rbrakk> \<Longrightarrow> ((\<sigma>, ka), \<sigma>', k'a) \<in> cp; cs\<^bsup>path \<sigma>\<^esup> k = cs\<^bsup>path \<sigma>'\<^esup> k'; v \<in> local.reads (path \<sigma> k); (\<sigma>\<^bsup>k\<^esup>) v \<noteq> (\<sigma>'\<^bsup>k'\<^esup>) v\<rbrakk> \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
have path: \<open>\<pi> = path \<sigma>\<close> \<open>\<pi>' = path \<sigma>'\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<pi> = path \<sigma> &&& \<pi>' = path \<sigma>'
[PROOF STEP]
using \<pi>_def \<pi>'_def path_is_path
[PROOF STATE]
proof (prove)
using this:
\<pi> \<equiv> path \<sigma>
\<pi>' \<equiv> path \<sigma>'
is_path (path ?\<sigma>)

goal (1 subgoal):
 1. \<pi> = path \<sigma> &&& \<pi>' = path \<sigma>'
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<pi> = path \<sigma>
\<pi>' = path \<sigma>'

goal (1 subgoal):
 1. \<And>k k' v. \<lbrakk>\<And>ka k'a v. \<lbrakk>ka + k'a < k + k'; cs\<^bsup>path \<sigma>\<^esup> ka = cs\<^bsup>path \<sigma>'\<^esup> k'a; v \<in> local.reads (path \<sigma> ka); (\<sigma>\<^bsup>ka\<^esup>) v \<noteq> (\<sigma>'\<^bsup>k'a\<^esup>) v\<rbrakk> \<Longrightarrow> ((\<sigma>, ka), \<sigma>', k'a) \<in> cp; cs\<^bsup>path \<sigma>\<^esup> k = cs\<^bsup>path \<sigma>'\<^esup> k'; v \<in> local.reads (path \<sigma> k); (\<sigma>\<^bsup>k\<^esup>) v \<noteq> (\<sigma>'\<^bsup>k'\<^esup>) v\<rbrakk> \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
have ip: \<open>is_path \<pi>\<close> \<open>is_path \<pi>'\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_path \<pi> &&& is_path \<pi>'
[PROOF STEP]
using path path_is_path
[PROOF STATE]
proof (prove)
using this:
\<pi> = path \<sigma>
\<pi>' = path \<sigma>'
is_path (path ?\<sigma>)

goal (1 subgoal):
 1. is_path \<pi> &&& is_path \<pi>'
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
is_path \<pi>
is_path \<pi>'

goal (1 subgoal):
 1. \<And>k k' v. \<lbrakk>\<And>ka k'a v. \<lbrakk>ka + k'a < k + k'; cs\<^bsup>path \<sigma>\<^esup> ka = cs\<^bsup>path \<sigma>'\<^esup> k'a; v \<in> local.reads (path \<sigma> ka); (\<sigma>\<^bsup>ka\<^esup>) v \<noteq> (\<sigma>'\<^bsup>k'a\<^esup>) v\<rbrakk> \<Longrightarrow> ((\<sigma>, ka), \<sigma>', k'a) \<in> cp; cs\<^bsup>path \<sigma>\<^esup> k = cs\<^bsup>path \<sigma>'\<^esup> k'; v \<in> local.reads (path \<sigma> k); (\<sigma>\<^bsup>k\<^esup>) v \<noteq> (\<sigma>'\<^bsup>k'\<^esup>) v\<rbrakk> \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
have \<pi>0: \<open>\<pi>' 0 = \<pi> 0\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<pi>' 0 = \<pi> 0
[PROOF STEP]
unfolding path path_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fst ((local.step ^^ 0) (local.entry, \<sigma>')) = fst ((local.step ^^ 0) (local.entry, \<sigma>))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<pi>' 0 = \<pi> 0

goal (1 subgoal):
 1. \<And>k k' v. \<lbrakk>\<And>ka k'a v. \<lbrakk>ka + k'a < k + k'; cs\<^bsup>path \<sigma>\<^esup> ka = cs\<^bsup>path \<sigma>'\<^esup> k'a; v \<in> local.reads (path \<sigma> ka); (\<sigma>\<^bsup>ka\<^esup>) v \<noteq> (\<sigma>'\<^bsup>k'a\<^esup>) v\<rbrakk> \<Longrightarrow> ((\<sigma>, ka), \<sigma>', k'a) \<in> cp; cs\<^bsup>path \<sigma>\<^esup> k = cs\<^bsup>path \<sigma>'\<^esup> k'; v \<in> local.reads (path \<sigma> k); (\<sigma>\<^bsup>k\<^esup>) v \<noteq> (\<sigma>'\<^bsup>k'\<^esup>) v\<rbrakk> \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
have vread': \<open>v \<in> reads (path \<sigma>' k')\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. v \<in> local.reads (path \<sigma>' k')
[PROOF STEP]
using csk vread
[PROOF STATE]
proof (prove)
using this:
cs\<^bsup>path \<sigma>\<^esup> k = cs\<^bsup>path \<sigma>'\<^esup> k'
v \<in> local.reads (path \<sigma> k)

goal (1 subgoal):
 1. v \<in> local.reads (path \<sigma>' k')
[PROOF STEP]
by (metis last_cs)
[PROOF STATE]
proof (state)
this:
v \<in> local.reads (path \<sigma>' k')

goal (1 subgoal):
 1. \<And>k k' v. \<lbrakk>\<And>ka k'a v. \<lbrakk>ka + k'a < k + k'; cs\<^bsup>path \<sigma>\<^esup> ka = cs\<^bsup>path \<sigma>'\<^esup> k'a; v \<in> local.reads (path \<sigma> ka); (\<sigma>\<^bsup>ka\<^esup>) v \<noteq> (\<sigma>'\<^bsup>k'a\<^esup>) v\<rbrakk> \<Longrightarrow> ((\<sigma>, ka), \<sigma>', k'a) \<in> cp; cs\<^bsup>path \<sigma>\<^esup> k = cs\<^bsup>path \<sigma>'\<^esup> k'; v \<in> local.reads (path \<sigma> k); (\<sigma>\<^bsup>k\<^esup>) v \<noteq> (\<sigma>'\<^bsup>k'\<^esup>) v\<rbrakk> \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
have cseq: \<open>cs\<^bsup>\<pi>'\<^esup> k' = cs\<^bsup>\<pi>\<^esup> k\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cs\<^bsup>\<pi>'\<^esup> k' = cs\<^bsup>\<pi>\<^esup> k
[PROOF STEP]
using csk path
[PROOF STATE]
proof (prove)
using this:
cs\<^bsup>path \<sigma>\<^esup> k = cs\<^bsup>path \<sigma>'\<^esup> k'
\<pi> = path \<sigma>
\<pi>' = path \<sigma>'

goal (1 subgoal):
 1. cs\<^bsup>\<pi>'\<^esup> k' = cs\<^bsup>\<pi>\<^esup> k
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
cs\<^bsup>\<pi>'\<^esup> k' = cs\<^bsup>\<pi>\<^esup> k

goal (1 subgoal):
 1. \<And>k k' v. \<lbrakk>\<And>ka k'a v. \<lbrakk>ka + k'a < k + k'; cs\<^bsup>path \<sigma>\<^esup> ka = cs\<^bsup>path \<sigma>'\<^esup> k'a; v \<in> local.reads (path \<sigma> ka); (\<sigma>\<^bsup>ka\<^esup>) v \<noteq> (\<sigma>'\<^bsup>k'a\<^esup>) v\<rbrakk> \<Longrightarrow> ((\<sigma>, ka), \<sigma>', k'a) \<in> cp; cs\<^bsup>path \<sigma>\<^esup> k = cs\<^bsup>path \<sigma>'\<^esup> k'; v \<in> local.reads (path \<sigma> k); (\<sigma>\<^bsup>k\<^esup>) v \<noteq> (\<sigma>'\<^bsup>k'\<^esup>) v\<rbrakk> \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
show \<open>((\<sigma>, k), \<sigma>', k') \<in> cp\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
proof cases
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
 2. \<not> ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
assume vnw: \<open>\<forall> l < k. v\<notin>writes (\<pi> l)\<close>
[PROOF STATE]
proof (state)
this:
\<forall>l<k. v \<notin> local.writes (\<pi> l)

goal (2 subgoals):
 1. ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
 2. \<not> ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
hence \<sigma>v: \<open>(\<sigma>\<^bsup>k\<^esup>) v = \<sigma> v\<close>
[PROOF STATE]
proof (prove)
using this:
\<forall>l<k. v \<notin> local.writes (\<pi> l)

goal (1 subgoal):
 1. (\<sigma>\<^bsup>k\<^esup>) v = \<sigma> v
[PROOF STEP]
by (metis no_writes_unchanged0 path(1))
[PROOF STATE]
proof (state)
this:
(\<sigma>\<^bsup>k\<^esup>) v = \<sigma> v

goal (2 subgoals):
 1. ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
 2. \<not> ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
show \<open>?thesis\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
proof cases
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
 2. \<not> ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
assume vnw': \<open>\<forall> l < k'. v\<notin>writes (\<pi>' l)\<close>
[PROOF STATE]
proof (state)
this:
\<forall>l<k'. v \<notin> local.writes (\<pi>' l)

goal (2 subgoals):
 1. ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
 2. \<not> ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
hence \<sigma>v': \<open>(\<sigma>'\<^bsup>k'\<^esup>) v = \<sigma>' v\<close>
[PROOF STATE]
proof (prove)
using this:
\<forall>l<k'. v \<notin> local.writes (\<pi>' l)

goal (1 subgoal):
 1. (\<sigma>'\<^bsup>k'\<^esup>) v = \<sigma>' v
[PROOF STEP]
by (metis no_writes_unchanged0 path(2))
[PROOF STATE]
proof (state)
this:
(\<sigma>'\<^bsup>k'\<^esup>) v = \<sigma>' v

goal (2 subgoals):
 1. ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
 2. \<not> ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
with \<sigma>v vneq
[PROOF STATE]
proof (chain)
picking this:
(\<sigma>\<^bsup>k\<^esup>) v = \<sigma> v
(\<sigma>\<^bsup>k\<^esup>) v \<noteq> (\<sigma>'\<^bsup>k'\<^esup>) v
(\<sigma>'\<^bsup>k'\<^esup>) v = \<sigma>' v
[PROOF STEP]
have \<open>\<sigma> v \<noteq> \<sigma>' v\<close>
[PROOF STATE]
proof (prove)
using this:
(\<sigma>\<^bsup>k\<^esup>) v = \<sigma> v
(\<sigma>\<^bsup>k\<^esup>) v \<noteq> (\<sigma>'\<^bsup>k'\<^esup>) v
(\<sigma>'\<^bsup>k'\<^esup>) v = \<sigma>' v

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

goal (2 subgoals):
 1. ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
 2. \<not> ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
hence vhigh: \<open>v \<in> hvars\<close>
[PROOF STATE]
proof (prove)
using this:
\<sigma> v \<noteq> \<sigma>' v

goal (1 subgoal):
 1. v \<in> local.hvars
[PROOF STEP]
using leq
[PROOF STATE]
proof (prove)
using this:
\<sigma> v \<noteq> \<sigma>' v
\<sigma> =\<^sub>L \<sigma>'

goal (1 subgoal):
 1. v \<in> local.hvars
[PROOF STEP]
unfolding loweq_def restrict_def
[PROOF STATE]
proof (prove)
using this:
\<sigma> v \<noteq> \<sigma>' v
(\<lambda>n. if n \<in> - local.hvars then \<sigma> n else undefined) = (\<lambda>n. if n \<in> - local.hvars then \<sigma>' n else undefined)

goal (1 subgoal):
 1. v \<in> local.hvars
[PROOF STEP]
by (auto,metis)
[PROOF STATE]
proof (state)
this:
v \<in> local.hvars

goal (2 subgoals):
 1. ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
 2. \<not> ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
thus \<open>?thesis\<close>
[PROOF STATE]
proof (prove)
using this:
v \<in> local.hvars

goal (1 subgoal):
 1. ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
using cp.intros(1)[OF leq csk vread vneq] vnw vnw' path
[PROOF STATE]
proof (prove)
using this:
v \<in> local.hvars
\<lbrakk>\<forall>k<k. v \<notin> local.writes (path \<sigma> k); \<forall>k'<k'. v \<notin> local.writes (path \<sigma>' k')\<rbrakk> \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
\<forall>l<k. v \<notin> local.writes (\<pi> l)
\<forall>l<k'. v \<notin> local.writes (\<pi>' l)
\<pi> = path \<sigma>
\<pi>' = path \<sigma>'

goal (1 subgoal):
 1. ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
((\<sigma>, k), \<sigma>', k') \<in> cp

goal (1 subgoal):
 1. \<not> (\<forall>l<k'. v \<notin> local.writes (\<pi>' l)) \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> (\<forall>l<k'. v \<notin> local.writes (\<pi>' l)) \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
assume \<open>\<not>(\<forall> l < k'. v\<notin>writes (\<pi>' l))\<close>
[PROOF STATE]
proof (state)
this:
\<not> (\<forall>l<k'. v \<notin> local.writes (\<pi>' l))

goal (1 subgoal):
 1. \<not> (\<forall>l<k'. v \<notin> local.writes (\<pi>' l)) \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> (\<forall>l<k'. v \<notin> local.writes (\<pi>' l))
[PROOF STEP]
obtain l' where kddl': \<open>k' dd\<^bsup>\<pi>',v\<^esup>\<rightarrow> l'\<close>
[PROOF STATE]
proof (prove)
using this:
\<not> (\<forall>l<k'. v \<notin> local.writes (\<pi>' l))

goal (1 subgoal):
 1. (\<And>l'. k' dd\<^bsup>\<pi>',v\<^esup>\<rightarrow> l' \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using path(2) path_is_path written_read_dd vread'
[PROOF STATE]
proof (prove)
using this:
\<not> (\<forall>l<k'. v \<notin> local.writes (\<pi>' l))
\<pi>' = path \<sigma>'
is_path (path ?\<sigma>)
\<lbrakk>is_path ?\<pi>; ?v \<in> local.reads (?\<pi> ?k); ?v \<in> local.writes (?\<pi> ?j); ?j < ?k; \<And>l. ?k dd\<^bsup>?\<pi>,?v\<^esup>\<rightarrow> l \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis
v \<in> local.reads (path \<sigma>' k')

goal (1 subgoal):
 1. (\<And>l'. k' dd\<^bsup>\<pi>',v\<^esup>\<rightarrow> l' \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
k' dd\<^bsup>\<pi>',v\<^esup>\<rightarrow> l'

goal (1 subgoal):
 1. \<not> (\<forall>l<k'. v \<notin> local.writes (\<pi>' l)) \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
hence lv': \<open>v \<in> writes (\<pi>' l')\<close>
[PROOF STATE]
proof (prove)
using this:
k' dd\<^bsup>\<pi>',v\<^esup>\<rightarrow> l'

goal (1 subgoal):
 1. v \<in> local.writes (\<pi>' l')
[PROOF STEP]
unfolding is_ddi_def
[PROOF STATE]
proof (prove)
using this:
is_path \<pi>' \<and> l' < k' \<and> v \<in> local.reads (\<pi>' k') \<inter> local.writes (\<pi>' l') \<and> (\<forall>l\<in>{l'<..<k'}. v \<notin> local.writes (\<pi>' l))

goal (1 subgoal):
 1. v \<in> local.writes (\<pi>' l')
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
v \<in> local.writes (\<pi>' l')

goal (1 subgoal):
 1. \<not> (\<forall>l<k'. v \<notin> local.writes (\<pi>' l)) \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
have lk': \<open>l' < k'\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. l' < k'
[PROOF STEP]
by (metis is_ddi_def kddl')
[PROOF STATE]
proof (state)
this:
l' < k'

goal (1 subgoal):
 1. \<not> (\<forall>l<k'. v \<notin> local.writes (\<pi>' l)) \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
have nret: \<open>\<pi>' l' \<noteq> return\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<pi>' l' \<noteq> local.return
[PROOF STEP]
using lv' writes_return
[PROOF STATE]
proof (prove)
using this:
v \<in> local.writes (\<pi>' l')
local.writes local.return = {}

goal (1 subgoal):
 1. \<pi>' l' \<noteq> local.return
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<pi>' l' \<noteq> local.return

goal (1 subgoal):
 1. \<not> (\<forall>l<k'. v \<notin> local.writes (\<pi>' l)) \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
have notin\<pi>: \<open>\<not> (\<exists>l. cs\<^bsup>\<pi>'\<^esup> l' = cs\<^bsup>\<pi>\<^esup> l)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<nexists>l. cs\<^bsup>\<pi>'\<^esup> l' = cs\<^bsup>\<pi>\<^esup> l
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>l. cs\<^bsup>\<pi>'\<^esup> l' = cs\<^bsup>\<pi>\<^esup> l \<Longrightarrow> False
[PROOF STEP]
assume \<open>\<exists>l. cs\<^bsup>\<pi>'\<^esup> l' = cs\<^bsup>\<pi>\<^esup> l\<close>
[PROOF STATE]
proof (state)
this:
\<exists>l. cs\<^bsup>\<pi>'\<^esup> l' = cs\<^bsup>\<pi>\<^esup> l

goal (1 subgoal):
 1. \<exists>l. cs\<^bsup>\<pi>'\<^esup> l' = cs\<^bsup>\<pi>\<^esup> l \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>l. cs\<^bsup>\<pi>'\<^esup> l' = cs\<^bsup>\<pi>\<^esup> l
[PROOF STEP]
obtain l where "cs\<^bsup>\<pi>'\<^esup> l' = cs\<^bsup>\<pi>\<^esup> l"
[PROOF STATE]
proof (prove)
using this:
\<exists>l. cs\<^bsup>\<pi>'\<^esup> l' = cs\<^bsup>\<pi>\<^esup> l

goal (1 subgoal):
 1. (\<And>l. cs\<^bsup>\<pi>'\<^esup> l' = cs\<^bsup>\<pi>\<^esup> l \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
cs\<^bsup>\<pi>'\<^esup> l' = cs\<^bsup>\<pi>\<^esup> l

goal (1 subgoal):
 1. \<exists>l. cs\<^bsup>\<pi>'\<^esup> l' = cs\<^bsup>\<pi>\<^esup> l \<Longrightarrow> False
[PROOF STEP]
note csl = \<open>cs\<^bsup>\<pi>'\<^esup> l' = cs\<^bsup>\<pi>\<^esup> l\<close>
[PROOF STATE]
proof (state)
this:
cs\<^bsup>\<pi>'\<^esup> l' = cs\<^bsup>\<pi>\<^esup> l

goal (1 subgoal):
 1. \<exists>l. cs\<^bsup>\<pi>'\<^esup> l' = cs\<^bsup>\<pi>\<^esup> l \<Longrightarrow> False
[PROOF STEP]
have lk: \<open>l < k\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. l < k
[PROOF STEP]
using lk' cseq ip cs_order[of \<open>\<pi>'\<close> \<open>\<pi>\<close> \<open>l'\<close> \<open>l\<close> \<open>k'\<close> \<open>k\<close>] csl nret path
[PROOF STATE]
proof (prove)
using this:
l' < k'
cs\<^bsup>\<pi>'\<^esup> k' = cs\<^bsup>\<pi>\<^esup> k
is_path \<pi>
is_path \<pi>'
\<lbrakk>is_path \<pi>'; is_path \<pi>; cs\<^bsup>\<pi>'\<^esup> l' = cs\<^bsup>\<pi>\<^esup> l; cs\<^bsup>\<pi>'\<^esup> k' = cs\<^bsup>\<pi>\<^esup> k; \<pi>' l' \<noteq> local.return; l' < k'\<rbrakk> \<Longrightarrow> l < k
cs\<^bsup>\<pi>'\<^esup> l' = cs\<^bsup>\<pi>\<^esup> l
\<pi>' l' \<noteq> local.return
\<pi> = path \<sigma>
\<pi>' = path \<sigma>'

goal (1 subgoal):
 1. l < k
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
l < k

goal (1 subgoal):
 1. \<exists>l. cs\<^bsup>\<pi>'\<^esup> l' = cs\<^bsup>\<pi>\<^esup> l \<Longrightarrow> False
[PROOF STEP]
have \<open>v \<in> writes (\<pi> l)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. v \<in> local.writes (\<pi> l)
[PROOF STEP]
using csl lv' last_cs
[PROOF STATE]
proof (prove)
using this:
cs\<^bsup>\<pi>'\<^esup> l' = cs\<^bsup>\<pi>\<^esup> l
v \<in> local.writes (\<pi>' l')
last (cs\<^bsup>?\<pi>\<^esup> ?i) = ?\<pi> ?i

goal (1 subgoal):
 1. v \<in> local.writes (\<pi> l)
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
v \<in> local.writes (\<pi> l)

goal (1 subgoal):
 1. \<exists>l. cs\<^bsup>\<pi>'\<^esup> l' = cs\<^bsup>\<pi>\<^esup> l \<Longrightarrow> False
[PROOF STEP]
thus \<open>False\<close>
[PROOF STATE]
proof (prove)
using this:
v \<in> local.writes (\<pi> l)

goal (1 subgoal):
 1. False
[PROOF STEP]
using lk vnw
[PROOF STATE]
proof (prove)
using this:
v \<in> local.writes (\<pi> l)
l < k
\<forall>l<k. v \<notin> local.writes (\<pi> l)

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<nexists>l. cs\<^bsup>\<pi>'\<^esup> l' = cs\<^bsup>\<pi>\<^esup> l

goal (1 subgoal):
 1. \<not> (\<forall>l<k'. v \<notin> local.writes (\<pi>' l)) \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
from converged_cd_diverge[OF ip(2,1) \<pi>0 notin\<pi> lk' cseq]
[PROOF STATE]
proof (chain)
picking this:
(\<And>k k'. \<lbrakk>cs\<^bsup>\<pi>'\<^esup> k = cs\<^bsup>\<pi>\<^esup> k'; l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> k; \<pi>' (Suc k) \<noteq> \<pi> (Suc k')\<rbrakk> \<Longrightarrow> ?thesis) \<Longrightarrow> ?thesis
[PROOF STEP]
obtain i i' where  csi: \<open>cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i\<close> and lcdi: \<open>l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> i'\<close>  and div: \<open>\<pi>' (Suc i') \<noteq> \<pi> (Suc i)\<close>
[PROOF STATE]
proof (prove)
using this:
(\<And>k k'. \<lbrakk>cs\<^bsup>\<pi>'\<^esup> k = cs\<^bsup>\<pi>\<^esup> k'; l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> k; \<pi>' (Suc k) \<noteq> \<pi> (Suc k')\<rbrakk> \<Longrightarrow> ?thesis) \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. (\<And>i' i. \<lbrakk>cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i; l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> i'; \<pi>' (Suc i') \<noteq> \<pi> (Suc i)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i
l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> i'
\<pi>' (Suc i') \<noteq> \<pi> (Suc i)

goal (1 subgoal):
 1. \<not> (\<forall>l<k'. v \<notin> local.writes (\<pi>' l)) \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
have 1: \<open>\<pi> (Suc i) = suc (\<pi> i) (\<sigma>\<^bsup>i\<^esup>)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<pi> (Suc i) = suc (\<pi> i) (\<sigma>\<^bsup>i\<^esup>)
[PROOF STEP]
by (metis step_suc_sem fst_conv path(1) path_suc)
[PROOF STATE]
proof (state)
this:
\<pi> (Suc i) = suc (\<pi> i) (\<sigma>\<^bsup>i\<^esup>)

goal (1 subgoal):
 1. \<not> (\<forall>l<k'. v \<notin> local.writes (\<pi>' l)) \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
have 2: \<open>\<pi>' (Suc i') = suc (\<pi>' i') (\<sigma>'\<^bsup>i'\<^esup>)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<pi>' (Suc i') = suc (\<pi>' i') (\<sigma>'\<^bsup>i'\<^esup>)
[PROOF STEP]
by (metis step_suc_sem fst_conv path(2) path_suc)
[PROOF STATE]
proof (state)
this:
\<pi>' (Suc i') = suc (\<pi>' i') (\<sigma>'\<^bsup>i'\<^esup>)

goal (1 subgoal):
 1. \<not> (\<forall>l<k'. v \<notin> local.writes (\<pi>' l)) \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
have 3: \<open>\<pi>' i' = \<pi> i\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<pi>' i' = \<pi> i
[PROOF STEP]
using csi last_cs
[PROOF STATE]
proof (prove)
using this:
cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i
last (cs\<^bsup>?\<pi>\<^esup> ?i) = ?\<pi> ?i

goal (1 subgoal):
 1. \<pi>' i' = \<pi> i
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
\<pi>' i' = \<pi> i

goal (1 subgoal):
 1. \<not> (\<forall>l<k'. v \<notin> local.writes (\<pi>' l)) \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
have nreads: \<open>\<sigma>\<^bsup>i\<^esup> \<restriction> reads (\<pi> i) \<noteq> \<sigma>'\<^bsup>i'\<^esup> \<restriction> reads (\<pi> i)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<sigma>\<^bsup>i\<^esup> \<restriction> local.reads (\<pi> i) \<noteq> \<sigma>'\<^bsup>i'\<^esup> \<restriction> local.reads (\<pi> i)
[PROOF STEP]
by (metis 1 2 3 div reads_restr_suc)
[PROOF STATE]
proof (state)
this:
\<sigma>\<^bsup>i\<^esup> \<restriction> local.reads (\<pi> i) \<noteq> \<sigma>'\<^bsup>i'\<^esup> \<restriction> local.reads (\<pi> i)

goal (1 subgoal):
 1. \<not> (\<forall>l<k'. v \<notin> local.writes (\<pi>' l)) \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<sigma>\<^bsup>i\<^esup> \<restriction> local.reads (\<pi> i) \<noteq> \<sigma>'\<^bsup>i'\<^esup> \<restriction> local.reads (\<pi> i)
[PROOF STEP]
obtain v' where v'read: \<open>v'\<in> reads(path \<sigma> i)\<close> \<open>(\<sigma>\<^bsup>i\<^esup>) v' \<noteq> (\<sigma>'\<^bsup>i'\<^esup>) v'\<close>
[PROOF STATE]
proof (prove)
using this:
\<sigma>\<^bsup>i\<^esup> \<restriction> local.reads (\<pi> i) \<noteq> \<sigma>'\<^bsup>i'\<^esup> \<restriction> local.reads (\<pi> i)

goal (1 subgoal):
 1. (\<And>v'. \<lbrakk>v' \<in> local.reads (path \<sigma> i); (\<sigma>\<^bsup>i\<^esup>) v' \<noteq> (\<sigma>'\<^bsup>i'\<^esup>) v'\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding path
[PROOF STATE]
proof (prove)
using this:
\<sigma>\<^bsup>i\<^esup> \<restriction> local.reads (path \<sigma> i) \<noteq> \<sigma>'\<^bsup>i'\<^esup> \<restriction> local.reads (path \<sigma> i)

goal (1 subgoal):
 1. (\<And>v'. \<lbrakk>v' \<in> local.reads (path \<sigma> i); (\<sigma>\<^bsup>i\<^esup>) v' \<noteq> (\<sigma>'\<^bsup>i'\<^esup>) v'\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis reads_restrict)
[PROOF STATE]
proof (state)
this:
v' \<in> local.reads (path \<sigma> i)
(\<sigma>\<^bsup>i\<^esup>) v' \<noteq> (\<sigma>'\<^bsup>i'\<^esup>) v'

goal (1 subgoal):
 1. \<not> (\<forall>l<k'. v \<notin> local.writes (\<pi>' l)) \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
have nreti: \<open>\<pi>' i' \<noteq> return\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<pi>' i' \<noteq> local.return
[PROOF STEP]
by (metis csi div ip(1) ip(2) last_cs lessI term_path_stable less_imp_le)
[PROOF STATE]
proof (state)
this:
\<pi>' i' \<noteq> local.return

goal (1 subgoal):
 1. \<not> (\<forall>l<k'. v \<notin> local.writes (\<pi>' l)) \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
have ik': \<open>i' < k'\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i' < k'
[PROOF STEP]
using lcdi lk' is_cdi_def
[PROOF STATE]
proof (prove)
using this:
l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> i'
l' < k'
(?i cd\<^bsup>?\<pi>\<^esup>\<rightarrow> ?k) = (is_path ?\<pi> \<and> ?k < ?i \<and> ?\<pi> ?i \<noteq> local.return \<and> (\<forall>j\<in>{?k..?i}. ?\<pi> j \<noteq> ipd (?\<pi> ?k)))

goal (1 subgoal):
 1. i' < k'
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
i' < k'

goal (1 subgoal):
 1. \<not> (\<forall>l<k'. v \<notin> local.writes (\<pi>' l)) \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
have ik: \<open>i < k\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i < k
[PROOF STEP]
using cs_order[OF ip(2,1) csi cseq nreti ik']
[PROOF STATE]
proof (prove)
using this:
i < k

goal (1 subgoal):
 1. i < k
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
i < k

goal (1 subgoal):
 1. \<not> (\<forall>l<k'. v \<notin> local.writes (\<pi>' l)) \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
have cpi: \<open>((\<sigma>, i), (\<sigma>', i')) \<in> cp\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<sigma>, i), \<sigma>', i') \<in> cp
[PROOF STEP]
using IH[of \<open>i\<close> \<open>i'\<close>] v'read csi ik ik' path
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>i + i' < k + k'; cs\<^bsup>path \<sigma>\<^esup> i = cs\<^bsup>path \<sigma>'\<^esup> i'; ?v1 \<in> local.reads (path \<sigma> i); (\<sigma>\<^bsup>i\<^esup>) ?v1 \<noteq> (\<sigma>'\<^bsup>i'\<^esup>) ?v1\<rbrakk> \<Longrightarrow> ((\<sigma>, i), \<sigma>', i') \<in> cp
v' \<in> local.reads (path \<sigma> i)
(\<sigma>\<^bsup>i\<^esup>) v' \<noteq> (\<sigma>'\<^bsup>i'\<^esup>) v'
cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i
i < k
i' < k'
\<pi> = path \<sigma>
\<pi>' = path \<sigma>'

goal (1 subgoal):
 1. ((\<sigma>, i), \<sigma>', i') \<in> cp
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
((\<sigma>, i), \<sigma>', i') \<in> cp

goal (1 subgoal):
 1. \<not> (\<forall>l<k'. v \<notin> local.writes (\<pi>' l)) \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
hence cpi': \<open>((\<sigma>', i'), (\<sigma>, i)) \<in> cp\<close>
[PROOF STATE]
proof (prove)
using this:
((\<sigma>, i), \<sigma>', i') \<in> cp

goal (1 subgoal):
 1. ((\<sigma>', i'), \<sigma>, i) \<in> cp
[PROOF STEP]
using cp.intros(4)
[PROOF STATE]
proof (prove)
using this:
((\<sigma>, i), \<sigma>', i') \<in> cp
((?\<sigma>, ?k), ?\<sigma>', ?k') \<in> cp \<Longrightarrow> ((?\<sigma>', ?k'), ?\<sigma>, ?k) \<in> cp

goal (1 subgoal):
 1. ((\<sigma>', i'), \<sigma>, i) \<in> cp
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
((\<sigma>', i'), \<sigma>, i) \<in> cp

goal (1 subgoal):
 1. \<not> (\<forall>l<k'. v \<notin> local.writes (\<pi>' l)) \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
have nwvi: \<open>\<forall>j'\<in>{LEAST i'. i < i' \<and> (\<exists>i. cs\<^bsup>path \<sigma>'\<^esup> i = cs\<^bsup>path \<sigma>\<^esup> i')..<k}. v \<notin> writes (path \<sigma> j')\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>j'\<in>{LEAST i'. i < i' \<and> (\<exists>i. cs\<^bsup>path \<sigma>'\<^esup> i = cs\<^bsup>path \<sigma>\<^esup> i')..<k}. v \<notin> local.writes (path \<sigma> j')
[PROOF STEP]
using vnw[unfolded path]
[PROOF STATE]
proof (prove)
using this:
\<forall>l<k. v \<notin> local.writes (path \<sigma> l)

goal (1 subgoal):
 1. \<forall>j'\<in>{LEAST i'. i < i' \<and> (\<exists>i. cs\<^bsup>path \<sigma>'\<^esup> i = cs\<^bsup>path \<sigma>\<^esup> i')..<k}. v \<notin> local.writes (path \<sigma> j')
[PROOF STEP]
by (metis (poly_guards_query) atLeastLessThan_iff)
[PROOF STATE]
proof (state)
this:
\<forall>j'\<in>{LEAST i'. i < i' \<and> (\<exists>i. cs\<^bsup>path \<sigma>'\<^esup> i = cs\<^bsup>path \<sigma>\<^esup> i')..<k}. v \<notin> local.writes (path \<sigma> j')

goal (1 subgoal):
 1. \<not> (\<forall>l<k'. v \<notin> local.writes (\<pi>' l)) \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
from cp.intros(3)[OF cpi' kddl'[unfolded path] lcdi[unfolded path] csk[symmetric] div[unfolded path] vneq[symmetric] nwvi]
[PROOF STATE]
proof (chain)
picking this:
((\<sigma>', k'), \<sigma>, k) \<in> cp
[PROOF STEP]
show \<open>?thesis\<close>
[PROOF STATE]
proof (prove)
using this:
((\<sigma>', k'), \<sigma>, k) \<in> cp

goal (1 subgoal):
 1. ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
using cp.intros(4)
[PROOF STATE]
proof (prove)
using this:
((\<sigma>', k'), \<sigma>, k) \<in> cp
((?\<sigma>, ?k), ?\<sigma>', ?k') \<in> cp \<Longrightarrow> ((?\<sigma>', ?k'), ?\<sigma>, ?k) \<in> cp

goal (1 subgoal):
 1. ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
((\<sigma>, k), \<sigma>', k') \<in> cp

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
((\<sigma>, k), \<sigma>', k') \<in> cp

goal (1 subgoal):
 1. \<not> (\<forall>l<k. v \<notin> local.writes (\<pi> l)) \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> (\<forall>l<k. v \<notin> local.writes (\<pi> l)) \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
assume wv: \<open>\<not> (\<forall> l<k. v \<notin> writes (\<pi> l))\<close>
[PROOF STATE]
proof (state)
this:
\<not> (\<forall>l<k. v \<notin> local.writes (\<pi> l))

goal (1 subgoal):
 1. \<not> (\<forall>l<k. v \<notin> local.writes (\<pi> l)) \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> (\<forall>l<k. v \<notin> local.writes (\<pi> l))
[PROOF STEP]
obtain l where kddl: \<open>k dd\<^bsup>\<pi>,v\<^esup>\<rightarrow> l\<close>
[PROOF STATE]
proof (prove)
using this:
\<not> (\<forall>l<k. v \<notin> local.writes (\<pi> l))

goal (1 subgoal):
 1. (\<And>l. k dd\<^bsup>\<pi>,v\<^esup>\<rightarrow> l \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using path(1) path_is_path written_read_dd vread
[PROOF STATE]
proof (prove)
using this:
\<not> (\<forall>l<k. v \<notin> local.writes (\<pi> l))
\<pi> = path \<sigma>
is_path (path ?\<sigma>)
\<lbrakk>is_path ?\<pi>; ?v \<in> local.reads (?\<pi> ?k); ?v \<in> local.writes (?\<pi> ?j); ?j < ?k; \<And>l. ?k dd\<^bsup>?\<pi>,?v\<^esup>\<rightarrow> l \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis
v \<in> local.reads (path \<sigma> k)

goal (1 subgoal):
 1. (\<And>l. k dd\<^bsup>\<pi>,v\<^esup>\<rightarrow> l \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
k dd\<^bsup>\<pi>,v\<^esup>\<rightarrow> l

goal (1 subgoal):
 1. \<not> (\<forall>l<k. v \<notin> local.writes (\<pi> l)) \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
hence lv: \<open>v \<in> writes (\<pi> l)\<close>
[PROOF STATE]
proof (prove)
using this:
k dd\<^bsup>\<pi>,v\<^esup>\<rightarrow> l

goal (1 subgoal):
 1. v \<in> local.writes (\<pi> l)
[PROOF STEP]
unfolding is_ddi_def
[PROOF STATE]
proof (prove)
using this:
is_path \<pi> \<and> l < k \<and> v \<in> local.reads (\<pi> k) \<inter> local.writes (\<pi> l) \<and> (\<forall>l\<in>{l<..<k}. v \<notin> local.writes (\<pi> l))

goal (1 subgoal):
 1. v \<in> local.writes (\<pi> l)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
v \<in> local.writes (\<pi> l)

goal (1 subgoal):
 1. \<not> (\<forall>l<k. v \<notin> local.writes (\<pi> l)) \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
have lk: \<open>l < k\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. l < k
[PROOF STEP]
by (metis is_ddi_def kddl)
[PROOF STATE]
proof (state)
this:
l < k

goal (1 subgoal):
 1. \<not> (\<forall>l<k. v \<notin> local.writes (\<pi> l)) \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
have nret: \<open>\<pi> l \<noteq> return\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<pi> l \<noteq> local.return
[PROOF STEP]
using lv writes_return
[PROOF STATE]
proof (prove)
using this:
v \<in> local.writes (\<pi> l)
local.writes local.return = {}

goal (1 subgoal):
 1. \<pi> l \<noteq> local.return
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<pi> l \<noteq> local.return

goal (1 subgoal):
 1. \<not> (\<forall>l<k. v \<notin> local.writes (\<pi> l)) \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
have nwb: \<open>\<forall> i \<in> {Suc l..< k}. v\<notin>writes(\<pi> i)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>i\<in>{Suc l..<k}. v \<notin> local.writes (\<pi> i)
[PROOF STEP]
using kddl
[PROOF STATE]
proof (prove)
using this:
k dd\<^bsup>\<pi>,v\<^esup>\<rightarrow> l

goal (1 subgoal):
 1. \<forall>i\<in>{Suc l..<k}. v \<notin> local.writes (\<pi> i)
[PROOF STEP]
unfolding is_ddi_def
[PROOF STATE]
proof (prove)
using this:
is_path \<pi> \<and> l < k \<and> v \<in> local.reads (\<pi> k) \<inter> local.writes (\<pi> l) \<and> (\<forall>l\<in>{l<..<k}. v \<notin> local.writes (\<pi> l))

goal (1 subgoal):
 1. \<forall>i\<in>{Suc l..<k}. v \<notin> local.writes (\<pi> i)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>i\<in>{Suc l..<k}. v \<notin> local.writes (\<pi> i)

goal (1 subgoal):
 1. \<not> (\<forall>l<k. v \<notin> local.writes (\<pi> l)) \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
have \<sigma>vk: \<open>(\<sigma>\<^bsup>k\<^esup>) v = (\<sigma>\<^bsup>Suc l\<^esup> ) v\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<sigma>\<^bsup>k\<^esup>) v = (\<sigma>\<^bsup>Suc l\<^esup>) v
[PROOF STEP]
using kddl ddi_value path(1)
[PROOF STATE]
proof (prove)
using this:
k dd\<^bsup>\<pi>,v\<^esup>\<rightarrow> l
?l dd\<^bsup>path ?\<sigma>,?v\<^esup>\<rightarrow> ?k \<Longrightarrow> (?\<sigma>\<^bsup>?l\<^esup>) ?v = (?\<sigma>\<^bsup>Suc ?k\<^esup>) ?v
\<pi> = path \<sigma>

goal (1 subgoal):
 1. (\<sigma>\<^bsup>k\<^esup>) v = (\<sigma>\<^bsup>Suc l\<^esup>) v
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<sigma>\<^bsup>k\<^esup>) v = (\<sigma>\<^bsup>Suc l\<^esup>) v

goal (1 subgoal):
 1. \<not> (\<forall>l<k. v \<notin> local.writes (\<pi> l)) \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
show \<open>?thesis\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
proof cases
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
 2. \<not> ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
assume vnw': \<open>\<forall> l < k'. v\<notin>writes (\<pi>' l)\<close>
[PROOF STATE]
proof (state)
this:
\<forall>l<k'. v \<notin> local.writes (\<pi>' l)

goal (2 subgoals):
 1. ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
 2. \<not> ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
hence \<sigma>v': \<open>(\<sigma>'\<^bsup>k'\<^esup>) v = \<sigma>' v\<close>
[PROOF STATE]
proof (prove)
using this:
\<forall>l<k'. v \<notin> local.writes (\<pi>' l)

goal (1 subgoal):
 1. (\<sigma>'\<^bsup>k'\<^esup>) v = \<sigma>' v
[PROOF STEP]
by (metis no_writes_unchanged0 path(2))
[PROOF STATE]
proof (state)
this:
(\<sigma>'\<^bsup>k'\<^esup>) v = \<sigma>' v

goal (2 subgoals):
 1. ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
 2. \<not> ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
have notin\<pi>': \<open>\<not> (\<exists>l'. cs\<^bsup>\<pi>\<^esup> l = cs\<^bsup>\<pi>'\<^esup> l')\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<nexists>l'. cs\<^bsup>\<pi>\<^esup> l = cs\<^bsup>\<pi>'\<^esup> l'
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>l'. cs\<^bsup>\<pi>\<^esup> l = cs\<^bsup>\<pi>'\<^esup> l' \<Longrightarrow> False
[PROOF STEP]
assume \<open>\<exists>l'. cs\<^bsup>\<pi>\<^esup> l = cs\<^bsup>\<pi>'\<^esup> l'\<close>
[PROOF STATE]
proof (state)
this:
\<exists>l'. cs\<^bsup>\<pi>\<^esup> l = cs\<^bsup>\<pi>'\<^esup> l'

goal (1 subgoal):
 1. \<exists>l'. cs\<^bsup>\<pi>\<^esup> l = cs\<^bsup>\<pi>'\<^esup> l' \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>l'. cs\<^bsup>\<pi>\<^esup> l = cs\<^bsup>\<pi>'\<^esup> l'
[PROOF STEP]
obtain l' where "cs\<^bsup>\<pi>\<^esup> l = cs\<^bsup>\<pi>'\<^esup> l'"
[PROOF STATE]
proof (prove)
using this:
\<exists>l'. cs\<^bsup>\<pi>\<^esup> l = cs\<^bsup>\<pi>'\<^esup> l'

goal (1 subgoal):
 1. (\<And>l'. cs\<^bsup>\<pi>\<^esup> l = cs\<^bsup>\<pi>'\<^esup> l' \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
cs\<^bsup>\<pi>\<^esup> l = cs\<^bsup>\<pi>'\<^esup> l'

goal (1 subgoal):
 1. \<exists>l'. cs\<^bsup>\<pi>\<^esup> l = cs\<^bsup>\<pi>'\<^esup> l' \<Longrightarrow> False
[PROOF STEP]
note csl = \<open>cs\<^bsup>\<pi>\<^esup> l = cs\<^bsup>\<pi>'\<^esup> l'\<close>
[PROOF STATE]
proof (state)
this:
cs\<^bsup>\<pi>\<^esup> l = cs\<^bsup>\<pi>'\<^esup> l'

goal (1 subgoal):
 1. \<exists>l'. cs\<^bsup>\<pi>\<^esup> l = cs\<^bsup>\<pi>'\<^esup> l' \<Longrightarrow> False
[PROOF STEP]
have lk: \<open>l' < k'\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. l' < k'
[PROOF STEP]
using lk cseq ip cs_order[of \<open>\<pi>\<close> \<open>\<pi>'\<close> \<open>l\<close> \<open>l'\<close> \<open>k\<close> \<open>k'\<close>] csl nret
[PROOF STATE]
proof (prove)
using this:
l < k
cs\<^bsup>\<pi>'\<^esup> k' = cs\<^bsup>\<pi>\<^esup> k
is_path \<pi>
is_path \<pi>'
\<lbrakk>is_path \<pi>; is_path \<pi>'; cs\<^bsup>\<pi>\<^esup> l = cs\<^bsup>\<pi>'\<^esup> l'; cs\<^bsup>\<pi>\<^esup> k = cs\<^bsup>\<pi>'\<^esup> k'; \<pi> l \<noteq> local.return; l < k\<rbrakk> \<Longrightarrow> l' < k'
cs\<^bsup>\<pi>\<^esup> l = cs\<^bsup>\<pi>'\<^esup> l'
\<pi> l \<noteq> local.return

goal (1 subgoal):
 1. l' < k'
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
l' < k'

goal (1 subgoal):
 1. \<exists>l'. cs\<^bsup>\<pi>\<^esup> l = cs\<^bsup>\<pi>'\<^esup> l' \<Longrightarrow> False
[PROOF STEP]
have \<open>v \<in> writes (\<pi>' l')\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. v \<in> local.writes (\<pi>' l')
[PROOF STEP]
using csl lv last_cs
[PROOF STATE]
proof (prove)
using this:
cs\<^bsup>\<pi>\<^esup> l = cs\<^bsup>\<pi>'\<^esup> l'
v \<in> local.writes (\<pi> l)
last (cs\<^bsup>?\<pi>\<^esup> ?i) = ?\<pi> ?i

goal (1 subgoal):
 1. v \<in> local.writes (\<pi>' l')
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
v \<in> local.writes (\<pi>' l')

goal (1 subgoal):
 1. \<exists>l'. cs\<^bsup>\<pi>\<^esup> l = cs\<^bsup>\<pi>'\<^esup> l' \<Longrightarrow> False
[PROOF STEP]
thus \<open>False\<close>
[PROOF STATE]
proof (prove)
using this:
v \<in> local.writes (\<pi>' l')

goal (1 subgoal):
 1. False
[PROOF STEP]
using lk vnw'
[PROOF STATE]
proof (prove)
using this:
v \<in> local.writes (\<pi>' l')
l' < k'
\<forall>l<k'. v \<notin> local.writes (\<pi>' l)

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<nexists>l'. cs\<^bsup>\<pi>\<^esup> l = cs\<^bsup>\<pi>'\<^esup> l'

goal (2 subgoals):
 1. ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
 2. \<not> ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
from converged_cd_diverge[OF ip(1,2) \<pi>0[symmetric] notin\<pi>' lk cseq[symmetric]]
[PROOF STATE]
proof (chain)
picking this:
(\<And>k k'. \<lbrakk>cs\<^bsup>\<pi>\<^esup> k = cs\<^bsup>\<pi>'\<^esup> k'; l cd\<^bsup>\<pi>\<^esup>\<rightarrow> k; \<pi> (Suc k) \<noteq> \<pi>' (Suc k')\<rbrakk> \<Longrightarrow> ?thesis) \<Longrightarrow> ?thesis
[PROOF STEP]
obtain i i' where  csi: \<open>cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i\<close> and lcdi: \<open>l cd\<^bsup>\<pi>\<^esup>\<rightarrow> i\<close>  and div: \<open>\<pi> (Suc i) \<noteq> \<pi>' (Suc i')\<close>
[PROOF STATE]
proof (prove)
using this:
(\<And>k k'. \<lbrakk>cs\<^bsup>\<pi>\<^esup> k = cs\<^bsup>\<pi>'\<^esup> k'; l cd\<^bsup>\<pi>\<^esup>\<rightarrow> k; \<pi> (Suc k) \<noteq> \<pi>' (Suc k')\<rbrakk> \<Longrightarrow> ?thesis) \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. (\<And>i' i. \<lbrakk>cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i; l cd\<^bsup>\<pi>\<^esup>\<rightarrow> i; \<pi> (Suc i) \<noteq> \<pi>' (Suc i')\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i
l cd\<^bsup>\<pi>\<^esup>\<rightarrow> i
\<pi> (Suc i) \<noteq> \<pi>' (Suc i')

goal (2 subgoals):
 1. ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
 2. \<not> ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
have 1: \<open>\<pi> (Suc i) = suc (\<pi> i) (\<sigma>\<^bsup>i\<^esup>)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<pi> (Suc i) = suc (\<pi> i) (\<sigma>\<^bsup>i\<^esup>)
[PROOF STEP]
by (metis step_suc_sem fst_conv path(1) path_suc)
[PROOF STATE]
proof (state)
this:
\<pi> (Suc i) = suc (\<pi> i) (\<sigma>\<^bsup>i\<^esup>)

goal (2 subgoals):
 1. ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
 2. \<not> ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
have 2: \<open>\<pi>' (Suc i') = suc (\<pi>' i') (\<sigma>'\<^bsup>i'\<^esup>)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<pi>' (Suc i') = suc (\<pi>' i') (\<sigma>'\<^bsup>i'\<^esup>)
[PROOF STEP]
by (metis step_suc_sem fst_conv path(2) path_suc)
[PROOF STATE]
proof (state)
this:
\<pi>' (Suc i') = suc (\<pi>' i') (\<sigma>'\<^bsup>i'\<^esup>)

goal (2 subgoals):
 1. ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
 2. \<not> ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
have 3: \<open>\<pi>' i' = \<pi> i\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<pi>' i' = \<pi> i
[PROOF STEP]
using csi last_cs
[PROOF STATE]
proof (prove)
using this:
cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i
last (cs\<^bsup>?\<pi>\<^esup> ?i) = ?\<pi> ?i

goal (1 subgoal):
 1. \<pi>' i' = \<pi> i
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
\<pi>' i' = \<pi> i

goal (2 subgoals):
 1. ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
 2. \<not> ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
have nreads: \<open>\<sigma>\<^bsup>i\<^esup> \<restriction> reads (\<pi> i) \<noteq> \<sigma>'\<^bsup>i'\<^esup> \<restriction> reads (\<pi> i)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<sigma>\<^bsup>i\<^esup> \<restriction> local.reads (\<pi> i) \<noteq> \<sigma>'\<^bsup>i'\<^esup> \<restriction> local.reads (\<pi> i)
[PROOF STEP]
by (metis 1 2 3 div reads_restr_suc)
[PROOF STATE]
proof (state)
this:
\<sigma>\<^bsup>i\<^esup> \<restriction> local.reads (\<pi> i) \<noteq> \<sigma>'\<^bsup>i'\<^esup> \<restriction> local.reads (\<pi> i)

goal (2 subgoals):
 1. ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
 2. \<not> ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
have contri: \<open>(\<sigma>',i') \<cc> (\<sigma>,i)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<sigma>', i') \<cc> (\<sigma>, i)
[PROOF STEP]
using contradicts.intros(2)[OF csi path nreads]
[PROOF STATE]
proof (prove)
using this:
(\<sigma>', i') \<cc> (\<sigma>, i)

goal (1 subgoal):
 1. (\<sigma>', i') \<cc> (\<sigma>, i)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(\<sigma>', i') \<cc> (\<sigma>, i)

goal (2 subgoals):
 1. ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
 2. \<not> ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
have nreti: \<open>\<pi> i \<noteq> return\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<pi> i \<noteq> local.return
[PROOF STEP]
by (metis csi div ip(1) ip(2) last_cs lessI term_path_stable less_imp_le)
[PROOF STATE]
proof (state)
this:
\<pi> i \<noteq> local.return

goal (2 subgoals):
 1. ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
 2. \<not> ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
have ik: \<open>i < k\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i < k
[PROOF STEP]
using lcdi lk is_cdi_def
[PROOF STATE]
proof (prove)
using this:
l cd\<^bsup>\<pi>\<^esup>\<rightarrow> i
l < k
(?i cd\<^bsup>?\<pi>\<^esup>\<rightarrow> ?k) = (is_path ?\<pi> \<and> ?k < ?i \<and> ?\<pi> ?i \<noteq> local.return \<and> (\<forall>j\<in>{?k..?i}. ?\<pi> j \<noteq> ipd (?\<pi> ?k)))

goal (1 subgoal):
 1. i < k
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
i < k

goal (2 subgoals):
 1. ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
 2. \<not> ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
have ik': \<open>i' < k'\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i' < k'
[PROOF STEP]
using cs_order[OF ip(1,2) csi[symmetric] cseq[symmetric] nreti ik]
[PROOF STATE]
proof (prove)
using this:
i' < k'

goal (1 subgoal):
 1. i' < k'
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
i' < k'

goal (2 subgoals):
 1. ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
 2. \<not> ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
have nreads: \<open>\<sigma>\<^bsup>i\<^esup> \<restriction> reads (\<pi> i) \<noteq> \<sigma>'\<^bsup>i'\<^esup> \<restriction> reads (\<pi> i)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<sigma>\<^bsup>i\<^esup> \<restriction> local.reads (\<pi> i) \<noteq> \<sigma>'\<^bsup>i'\<^esup> \<restriction> local.reads (\<pi> i)
[PROOF STEP]
by (metis 1 2 3 div reads_restr_suc)
[PROOF STATE]
proof (state)
this:
\<sigma>\<^bsup>i\<^esup> \<restriction> local.reads (\<pi> i) \<noteq> \<sigma>'\<^bsup>i'\<^esup> \<restriction> local.reads (\<pi> i)

goal (2 subgoals):
 1. ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
 2. \<not> ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<sigma>\<^bsup>i\<^esup> \<restriction> local.reads (\<pi> i) \<noteq> \<sigma>'\<^bsup>i'\<^esup> \<restriction> local.reads (\<pi> i)
[PROOF STEP]
obtain v' where v'read: \<open>v'\<in> reads(path \<sigma> i)\<close> \<open>(\<sigma>\<^bsup>i\<^esup>) v' \<noteq> (\<sigma>'\<^bsup>i'\<^esup>) v'\<close>
[PROOF STATE]
proof (prove)
using this:
\<sigma>\<^bsup>i\<^esup> \<restriction> local.reads (\<pi> i) \<noteq> \<sigma>'\<^bsup>i'\<^esup> \<restriction> local.reads (\<pi> i)

goal (1 subgoal):
 1. (\<And>v'. \<lbrakk>v' \<in> local.reads (path \<sigma> i); (\<sigma>\<^bsup>i\<^esup>) v' \<noteq> (\<sigma>'\<^bsup>i'\<^esup>) v'\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding path
[PROOF STATE]
proof (prove)
using this:
\<sigma>\<^bsup>i\<^esup> \<restriction> local.reads (path \<sigma> i) \<noteq> \<sigma>'\<^bsup>i'\<^esup> \<restriction> local.reads (path \<sigma> i)

goal (1 subgoal):
 1. (\<And>v'. \<lbrakk>v' \<in> local.reads (path \<sigma> i); (\<sigma>\<^bsup>i\<^esup>) v' \<noteq> (\<sigma>'\<^bsup>i'\<^esup>) v'\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis reads_restrict)
[PROOF STATE]
proof (state)
this:
v' \<in> local.reads (path \<sigma> i)
(\<sigma>\<^bsup>i\<^esup>) v' \<noteq> (\<sigma>'\<^bsup>i'\<^esup>) v'

goal (2 subgoals):
 1. ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
 2. \<not> ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
have cpi: \<open>((\<sigma>, i), (\<sigma>', i')) \<in> cp\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<sigma>, i), \<sigma>', i') \<in> cp
[PROOF STEP]
using IH[of \<open>i\<close> \<open>i'\<close>] v'read csi ik ik' path
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>i + i' < k + k'; cs\<^bsup>path \<sigma>\<^esup> i = cs\<^bsup>path \<sigma>'\<^esup> i'; ?v1 \<in> local.reads (path \<sigma> i); (\<sigma>\<^bsup>i\<^esup>) ?v1 \<noteq> (\<sigma>'\<^bsup>i'\<^esup>) ?v1\<rbrakk> \<Longrightarrow> ((\<sigma>, i), \<sigma>', i') \<in> cp
v' \<in> local.reads (path \<sigma> i)
(\<sigma>\<^bsup>i\<^esup>) v' \<noteq> (\<sigma>'\<^bsup>i'\<^esup>) v'
cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i
i < k
i' < k'
\<pi> = path \<sigma>
\<pi>' = path \<sigma>'

goal (1 subgoal):
 1. ((\<sigma>, i), \<sigma>', i') \<in> cp
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
((\<sigma>, i), \<sigma>', i') \<in> cp

goal (2 subgoals):
 1. ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
 2. \<not> ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
hence cpi': \<open>((\<sigma>', i'), (\<sigma>, i)) \<in> cp\<close>
[PROOF STATE]
proof (prove)
using this:
((\<sigma>, i), \<sigma>', i') \<in> cp

goal (1 subgoal):
 1. ((\<sigma>', i'), \<sigma>, i) \<in> cp
[PROOF STEP]
using cp.intros(4)
[PROOF STATE]
proof (prove)
using this:
((\<sigma>, i), \<sigma>', i') \<in> cp
((?\<sigma>, ?k), ?\<sigma>', ?k') \<in> cp \<Longrightarrow> ((?\<sigma>', ?k'), ?\<sigma>, ?k) \<in> cp

goal (1 subgoal):
 1. ((\<sigma>', i'), \<sigma>, i) \<in> cp
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
((\<sigma>', i'), \<sigma>, i) \<in> cp

goal (2 subgoals):
 1. ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
 2. \<not> ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
have vnwi: \<open>\<forall>j'\<in>{LEAST i'a. i' < i'a \<and> (\<exists>i. cs\<^bsup>path \<sigma>\<^esup> i = cs\<^bsup>path \<sigma>'\<^esup> i'a)..<k'}. v \<notin> writes (path \<sigma>' j')\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>j'\<in>{LEAST i'a. i' < i'a \<and> (\<exists>i. cs\<^bsup>path \<sigma>\<^esup> i = cs\<^bsup>path \<sigma>'\<^esup> i'a)..<k'}. v \<notin> local.writes (path \<sigma>' j')
[PROOF STEP]
using vnw'[unfolded path]
[PROOF STATE]
proof (prove)
using this:
\<forall>l<k'. v \<notin> local.writes (path \<sigma>' l)

goal (1 subgoal):
 1. \<forall>j'\<in>{LEAST i'a. i' < i'a \<and> (\<exists>i. cs\<^bsup>path \<sigma>\<^esup> i = cs\<^bsup>path \<sigma>'\<^esup> i'a)..<k'}. v \<notin> local.writes (path \<sigma>' j')
[PROOF STEP]
by (metis (poly_guards_query) atLeastLessThan_iff)
[PROOF STATE]
proof (state)
this:
\<forall>j'\<in>{LEAST i'a. i' < i'a \<and> (\<exists>i. cs\<^bsup>path \<sigma>\<^esup> i = cs\<^bsup>path \<sigma>'\<^esup> i'a)..<k'}. v \<notin> local.writes (path \<sigma>' j')

goal (2 subgoals):
 1. ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
 2. \<not> ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
from cp.intros(3)[OF cpi kddl[unfolded path] lcdi[unfolded path] csk div[unfolded path] vneq vnwi]
[PROOF STATE]
proof (chain)
picking this:
((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
show \<open>?thesis\<close>
[PROOF STATE]
proof (prove)
using this:
((\<sigma>, k), \<sigma>', k') \<in> cp

goal (1 subgoal):
 1. ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
using cp.intros(4)
[PROOF STATE]
proof (prove)
using this:
((\<sigma>, k), \<sigma>', k') \<in> cp
((?\<sigma>, ?k), ?\<sigma>', ?k') \<in> cp \<Longrightarrow> ((?\<sigma>', ?k'), ?\<sigma>, ?k) \<in> cp

goal (1 subgoal):
 1. ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
((\<sigma>, k), \<sigma>', k') \<in> cp

goal (1 subgoal):
 1. \<not> (\<forall>l<k'. v \<notin> local.writes (\<pi>' l)) \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> (\<forall>l<k'. v \<notin> local.writes (\<pi>' l)) \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
assume \<open>\<not> (\<forall> l<k'. v \<notin> writes (\<pi>' l))\<close>
[PROOF STATE]
proof (state)
this:
\<not> (\<forall>l<k'. v \<notin> local.writes (\<pi>' l))

goal (1 subgoal):
 1. \<not> (\<forall>l<k'. v \<notin> local.writes (\<pi>' l)) \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> (\<forall>l<k'. v \<notin> local.writes (\<pi>' l))
[PROOF STEP]
obtain l' where kddl': \<open>k' dd\<^bsup>\<pi>',v\<^esup>\<rightarrow> l'\<close>
[PROOF STATE]
proof (prove)
using this:
\<not> (\<forall>l<k'. v \<notin> local.writes (\<pi>' l))

goal (1 subgoal):
 1. (\<And>l'. k' dd\<^bsup>\<pi>',v\<^esup>\<rightarrow> l' \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using path(2) path_is_path written_read_dd vread'
[PROOF STATE]
proof (prove)
using this:
\<not> (\<forall>l<k'. v \<notin> local.writes (\<pi>' l))
\<pi>' = path \<sigma>'
is_path (path ?\<sigma>)
\<lbrakk>is_path ?\<pi>; ?v \<in> local.reads (?\<pi> ?k); ?v \<in> local.writes (?\<pi> ?j); ?j < ?k; \<And>l. ?k dd\<^bsup>?\<pi>,?v\<^esup>\<rightarrow> l \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis
v \<in> local.reads (path \<sigma>' k')

goal (1 subgoal):
 1. (\<And>l'. k' dd\<^bsup>\<pi>',v\<^esup>\<rightarrow> l' \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
k' dd\<^bsup>\<pi>',v\<^esup>\<rightarrow> l'

goal (1 subgoal):
 1. \<not> (\<forall>l<k'. v \<notin> local.writes (\<pi>' l)) \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
hence lv': \<open>v \<in> writes (\<pi>' l')\<close>
[PROOF STATE]
proof (prove)
using this:
k' dd\<^bsup>\<pi>',v\<^esup>\<rightarrow> l'

goal (1 subgoal):
 1. v \<in> local.writes (\<pi>' l')
[PROOF STEP]
unfolding is_ddi_def
[PROOF STATE]
proof (prove)
using this:
is_path \<pi>' \<and> l' < k' \<and> v \<in> local.reads (\<pi>' k') \<inter> local.writes (\<pi>' l') \<and> (\<forall>l\<in>{l'<..<k'}. v \<notin> local.writes (\<pi>' l))

goal (1 subgoal):
 1. v \<in> local.writes (\<pi>' l')
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
v \<in> local.writes (\<pi>' l')

goal (1 subgoal):
 1. \<not> (\<forall>l<k'. v \<notin> local.writes (\<pi>' l)) \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
have lk': \<open>l' < k'\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. l' < k'
[PROOF STEP]
by (metis is_ddi_def kddl')
[PROOF STATE]
proof (state)
this:
l' < k'

goal (1 subgoal):
 1. \<not> (\<forall>l<k'. v \<notin> local.writes (\<pi>' l)) \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
have nretl': \<open>\<pi>' l' \<noteq> return\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<pi>' l' \<noteq> local.return
[PROOF STEP]
using lv' writes_return
[PROOF STATE]
proof (prove)
using this:
v \<in> local.writes (\<pi>' l')
local.writes local.return = {}

goal (1 subgoal):
 1. \<pi>' l' \<noteq> local.return
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<pi>' l' \<noteq> local.return

goal (1 subgoal):
 1. \<not> (\<forall>l<k'. v \<notin> local.writes (\<pi>' l)) \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
have nwb': \<open>\<forall> i' \<in> {Suc l'..< k'}. v\<notin>writes(\<pi>' i')\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>i'\<in>{Suc l'..<k'}. v \<notin> local.writes (\<pi>' i')
[PROOF STEP]
using kddl'
[PROOF STATE]
proof (prove)
using this:
k' dd\<^bsup>\<pi>',v\<^esup>\<rightarrow> l'

goal (1 subgoal):
 1. \<forall>i'\<in>{Suc l'..<k'}. v \<notin> local.writes (\<pi>' i')
[PROOF STEP]
unfolding is_ddi_def
[PROOF STATE]
proof (prove)
using this:
is_path \<pi>' \<and> l' < k' \<and> v \<in> local.reads (\<pi>' k') \<inter> local.writes (\<pi>' l') \<and> (\<forall>l\<in>{l'<..<k'}. v \<notin> local.writes (\<pi>' l))

goal (1 subgoal):
 1. \<forall>i'\<in>{Suc l'..<k'}. v \<notin> local.writes (\<pi>' i')
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>i'\<in>{Suc l'..<k'}. v \<notin> local.writes (\<pi>' i')

goal (1 subgoal):
 1. \<not> (\<forall>l<k'. v \<notin> local.writes (\<pi>' l)) \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
have \<sigma>vk': \<open>(\<sigma>'\<^bsup>k'\<^esup>) v = (\<sigma>'\<^bsup>Suc l'\<^esup> ) v\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<sigma>'\<^bsup>k'\<^esup>) v = (\<sigma>'\<^bsup>Suc l'\<^esup>) v
[PROOF STEP]
using kddl' ddi_value path(2)
[PROOF STATE]
proof (prove)
using this:
k' dd\<^bsup>\<pi>',v\<^esup>\<rightarrow> l'
?l dd\<^bsup>path ?\<sigma>,?v\<^esup>\<rightarrow> ?k \<Longrightarrow> (?\<sigma>\<^bsup>?l\<^esup>) ?v = (?\<sigma>\<^bsup>Suc ?k\<^esup>) ?v
\<pi>' = path \<sigma>'

goal (1 subgoal):
 1. (\<sigma>'\<^bsup>k'\<^esup>) v = (\<sigma>'\<^bsup>Suc l'\<^esup>) v
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<sigma>'\<^bsup>k'\<^esup>) v = (\<sigma>'\<^bsup>Suc l'\<^esup>) v

goal (1 subgoal):
 1. \<not> (\<forall>l<k'. v \<notin> local.writes (\<pi>' l)) \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
show \<open>?thesis\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
proof cases
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
 2. \<not> ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
assume csl: \<open>cs\<^bsup>\<pi>\<^esup> l = cs\<^bsup>\<pi>'\<^esup> l'\<close>
[PROOF STATE]
proof (state)
this:
cs\<^bsup>\<pi>\<^esup> l = cs\<^bsup>\<pi>'\<^esup> l'

goal (2 subgoals):
 1. ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
 2. \<not> ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
hence \<pi>l: \<open>\<pi> l = \<pi>' l'\<close>
[PROOF STATE]
proof (prove)
using this:
cs\<^bsup>\<pi>\<^esup> l = cs\<^bsup>\<pi>'\<^esup> l'

goal (1 subgoal):
 1. \<pi> l = \<pi>' l'
[PROOF STEP]
by (metis last_cs)
[PROOF STATE]
proof (state)
this:
\<pi> l = \<pi>' l'

goal (2 subgoals):
 1. ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
 2. \<not> ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
have \<sigma>vls: \<open>(\<sigma>\<^bsup>Suc l\<^esup> ) v \<noteq> (\<sigma>'\<^bsup>Suc l'\<^esup> ) v\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<sigma>\<^bsup>Suc l\<^esup>) v \<noteq> (\<sigma>'\<^bsup>Suc l'\<^esup>) v
[PROOF STEP]
by (metis \<sigma>vk \<sigma>vk' vneq)
[PROOF STATE]
proof (state)
this:
(\<sigma>\<^bsup>Suc l\<^esup>) v \<noteq> (\<sigma>'\<^bsup>Suc l'\<^esup>) v

goal (2 subgoals):
 1. ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
 2. \<not> ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
have r\<sigma>: \<open>\<sigma>\<^bsup>l\<^esup> \<restriction> reads (\<pi> l) \<noteq> \<sigma>'\<^bsup>l'\<^esup> \<restriction> reads (\<pi> l)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<sigma>\<^bsup>l\<^esup> \<restriction> local.reads (\<pi> l) \<noteq> \<sigma>'\<^bsup>l'\<^esup> \<restriction> local.reads (\<pi> l)
[PROOF STEP]
using path \<pi>l \<sigma>vls written_value lv
[PROOF STATE]
proof (prove)
using this:
\<pi> = path \<sigma>
\<pi>' = path \<sigma>'
\<pi> l = \<pi>' l'
(\<sigma>\<^bsup>Suc l\<^esup>) v \<noteq> (\<sigma>'\<^bsup>Suc l'\<^esup>) v
\<lbrakk>path ?\<sigma> ?l = path ?\<sigma>' ?l'; ?\<sigma>\<^bsup>?l\<^esup> \<restriction> local.reads (path ?\<sigma> ?l) = ?\<sigma>'\<^bsup>?l'\<^esup> \<restriction> local.reads (path ?\<sigma> ?l); ?v \<in> local.writes (path ?\<sigma> ?l)\<rbrakk> \<Longrightarrow> (?\<sigma>\<^bsup>Suc ?l\<^esup>) ?v = (?\<sigma>'\<^bsup>Suc ?l'\<^esup>) ?v
v \<in> local.writes (\<pi> l)

goal (1 subgoal):
 1. \<sigma>\<^bsup>l\<^esup> \<restriction> local.reads (\<pi> l) \<noteq> \<sigma>'\<^bsup>l'\<^esup> \<restriction> local.reads (\<pi> l)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<sigma>\<^bsup>l\<^esup> \<restriction> local.reads (\<pi> l) \<noteq> \<sigma>'\<^bsup>l'\<^esup> \<restriction> local.reads (\<pi> l)

goal (2 subgoals):
 1. ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
 2. \<not> ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<sigma>\<^bsup>l\<^esup> \<restriction> local.reads (\<pi> l) \<noteq> \<sigma>'\<^bsup>l'\<^esup> \<restriction> local.reads (\<pi> l)
[PROOF STEP]
obtain v' where v'read: \<open>v'\<in> reads(path \<sigma> l)\<close> \<open>(\<sigma>\<^bsup>l\<^esup>) v' \<noteq> (\<sigma>'\<^bsup>l'\<^esup>) v'\<close>
[PROOF STATE]
proof (prove)
using this:
\<sigma>\<^bsup>l\<^esup> \<restriction> local.reads (\<pi> l) \<noteq> \<sigma>'\<^bsup>l'\<^esup> \<restriction> local.reads (\<pi> l)

goal (1 subgoal):
 1. (\<And>v'. \<lbrakk>v' \<in> local.reads (path \<sigma> l); (\<sigma>\<^bsup>l\<^esup>) v' \<noteq> (\<sigma>'\<^bsup>l'\<^esup>) v'\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding path
[PROOF STATE]
proof (prove)
using this:
\<sigma>\<^bsup>l\<^esup> \<restriction> local.reads (path \<sigma> l) \<noteq> \<sigma>'\<^bsup>l'\<^esup> \<restriction> local.reads (path \<sigma> l)

goal (1 subgoal):
 1. (\<And>v'. \<lbrakk>v' \<in> local.reads (path \<sigma> l); (\<sigma>\<^bsup>l\<^esup>) v' \<noteq> (\<sigma>'\<^bsup>l'\<^esup>) v'\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis reads_restrict)
[PROOF STATE]
proof (state)
this:
v' \<in> local.reads (path \<sigma> l)
(\<sigma>\<^bsup>l\<^esup>) v' \<noteq> (\<sigma>'\<^bsup>l'\<^esup>) v'

goal (2 subgoals):
 1. ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
 2. \<not> ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
have cpl: \<open>((\<sigma>, l), (\<sigma>', l')) \<in> cp\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<sigma>, l), \<sigma>', l') \<in> cp
[PROOF STEP]
using IH[of \<open>l\<close> \<open>l'\<close>] v'read csl lk lk' path
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>l + l' < k + k'; cs\<^bsup>path \<sigma>\<^esup> l = cs\<^bsup>path \<sigma>'\<^esup> l'; ?v1 \<in> local.reads (path \<sigma> l); (\<sigma>\<^bsup>l\<^esup>) ?v1 \<noteq> (\<sigma>'\<^bsup>l'\<^esup>) ?v1\<rbrakk> \<Longrightarrow> ((\<sigma>, l), \<sigma>', l') \<in> cp
v' \<in> local.reads (path \<sigma> l)
(\<sigma>\<^bsup>l\<^esup>) v' \<noteq> (\<sigma>'\<^bsup>l'\<^esup>) v'
cs\<^bsup>\<pi>\<^esup> l = cs\<^bsup>\<pi>'\<^esup> l'
l < k
l' < k'
\<pi> = path \<sigma>
\<pi>' = path \<sigma>'

goal (1 subgoal):
 1. ((\<sigma>, l), \<sigma>', l') \<in> cp
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
((\<sigma>, l), \<sigma>', l') \<in> cp

goal (2 subgoals):
 1. ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
 2. \<not> ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
show \<open>((\<sigma>, k), (\<sigma>', k')) \<in> cp\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
using cp.intros(2)[OF cpl kddl[unfolded path] kddl'[unfolded path] csk vneq]
[PROOF STATE]
proof (prove)
using this:
((\<sigma>, k), \<sigma>', k') \<in> cp

goal (1 subgoal):
 1. ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
((\<sigma>, k), \<sigma>', k') \<in> cp

goal (1 subgoal):
 1. cs\<^bsup>\<pi>\<^esup> l \<noteq> cs\<^bsup>\<pi>'\<^esup> l' \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. cs\<^bsup>\<pi>\<^esup> l \<noteq> cs\<^bsup>\<pi>'\<^esup> l' \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
assume csl: \<open>cs\<^bsup>\<pi>\<^esup> l \<noteq> cs\<^bsup>\<pi>'\<^esup> l'\<close>
[PROOF STATE]
proof (state)
this:
cs\<^bsup>\<pi>\<^esup> l \<noteq> cs\<^bsup>\<pi>'\<^esup> l'

goal (1 subgoal):
 1. cs\<^bsup>\<pi>\<^esup> l \<noteq> cs\<^bsup>\<pi>'\<^esup> l' \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
show \<open>?thesis\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
proof cases
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
 2. \<not> ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
assume \<open>\<exists> i'. cs\<^bsup>\<pi>\<^esup> l = cs\<^bsup>\<pi>'\<^esup> i'\<close>
[PROOF STATE]
proof (state)
this:
\<exists>i'. cs\<^bsup>\<pi>\<^esup> l = cs\<^bsup>\<pi>'\<^esup> i'

goal (2 subgoals):
 1. ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
 2. \<not> ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>i'. cs\<^bsup>\<pi>\<^esup> l = cs\<^bsup>\<pi>'\<^esup> i'
[PROOF STEP]
obtain i' where csli': \<open>cs\<^bsup>\<pi>\<^esup> l = cs\<^bsup>\<pi>'\<^esup> i'\<close>
[PROOF STATE]
proof (prove)
using this:
\<exists>i'. cs\<^bsup>\<pi>\<^esup> l = cs\<^bsup>\<pi>'\<^esup> i'

goal (1 subgoal):
 1. (\<And>i'. cs\<^bsup>\<pi>\<^esup> l = cs\<^bsup>\<pi>'\<^esup> i' \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
cs\<^bsup>\<pi>\<^esup> l = cs\<^bsup>\<pi>'\<^esup> i'

goal (2 subgoals):
 1. ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
 2. \<not> ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
have ilne': \<open>i' \<noteq> l'\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i' \<noteq> l'
[PROOF STEP]
using csl csli'
[PROOF STATE]
proof (prove)
using this:
cs\<^bsup>\<pi>\<^esup> l \<noteq> cs\<^bsup>\<pi>'\<^esup> l'
cs\<^bsup>\<pi>\<^esup> l = cs\<^bsup>\<pi>'\<^esup> i'

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

goal (2 subgoals):
 1. ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
 2. \<not> ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
have ij': \<open>i' < k'\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i' < k'
[PROOF STEP]
using cs_order[OF ip csli' cseq[symmetric] nret lk]
[PROOF STATE]
proof (prove)
using this:
i' < k'

goal (1 subgoal):
 1. i' < k'
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
i' < k'

goal (2 subgoals):
 1. ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
 2. \<not> ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
have iv': \<open>v \<in> writes(\<pi>' i')\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. v \<in> local.writes (\<pi>' i')
[PROOF STEP]
using lv csli' last_cs
[PROOF STATE]
proof (prove)
using this:
v \<in> local.writes (\<pi> l)
cs\<^bsup>\<pi>\<^esup> l = cs\<^bsup>\<pi>'\<^esup> i'
last (cs\<^bsup>?\<pi>\<^esup> ?i) = ?\<pi> ?i

goal (1 subgoal):
 1. v \<in> local.writes (\<pi>' i')
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
v \<in> local.writes (\<pi>' i')

goal (2 subgoals):
 1. ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
 2. \<not> ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
have il': \<open>i' < l'\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i' < l'
[PROOF STEP]
using kddl' ilne' ij' iv'
[PROOF STATE]
proof (prove)
using this:
k' dd\<^bsup>\<pi>',v\<^esup>\<rightarrow> l'
i' \<noteq> l'
i' < k'
v \<in> local.writes (\<pi>' i')

goal (1 subgoal):
 1. i' < l'
[PROOF STEP]
unfolding is_ddi_def
[PROOF STATE]
proof (prove)
using this:
is_path \<pi>' \<and> l' < k' \<and> v \<in> local.reads (\<pi>' k') \<inter> local.writes (\<pi>' l') \<and> (\<forall>l\<in>{l'<..<k'}. v \<notin> local.writes (\<pi>' l))
i' \<noteq> l'
i' < k'
v \<in> local.writes (\<pi>' i')

goal (1 subgoal):
 1. i' < l'
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
i' < l'

goal (2 subgoals):
 1. ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
 2. \<not> ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
have nreti': \<open>\<pi>' i' \<noteq> return\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<pi>' i' \<noteq> local.return
[PROOF STEP]
using csli' nret last_cs
[PROOF STATE]
proof (prove)
using this:
cs\<^bsup>\<pi>\<^esup> l = cs\<^bsup>\<pi>'\<^esup> i'
\<pi> l \<noteq> local.return
last (cs\<^bsup>?\<pi>\<^esup> ?i) = ?\<pi> ?i

goal (1 subgoal):
 1. \<pi>' i' \<noteq> local.return
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
\<pi>' i' \<noteq> local.return

goal (2 subgoals):
 1. ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
 2. \<not> ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
have l'notin\<pi>: \<open>\<not>(\<exists>i. cs\<^bsup>\<pi>'\<^esup> l' = cs\<^bsup>\<pi>\<^esup> i )\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<nexists>i. cs\<^bsup>\<pi>'\<^esup> l' = cs\<^bsup>\<pi>\<^esup> i
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>i. cs\<^bsup>\<pi>'\<^esup> l' = cs\<^bsup>\<pi>\<^esup> i \<Longrightarrow> False
[PROOF STEP]
assume \<open>\<exists>i. cs\<^bsup>\<pi>'\<^esup> l' = cs\<^bsup>\<pi>\<^esup> i\<close>
[PROOF STATE]
proof (state)
this:
\<exists>i. cs\<^bsup>\<pi>'\<^esup> l' = cs\<^bsup>\<pi>\<^esup> i

goal (1 subgoal):
 1. \<exists>i. cs\<^bsup>\<pi>'\<^esup> l' = cs\<^bsup>\<pi>\<^esup> i \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>i. cs\<^bsup>\<pi>'\<^esup> l' = cs\<^bsup>\<pi>\<^esup> i
[PROOF STEP]
obtain i where csil: \<open>cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> l'\<close>
[PROOF STATE]
proof (prove)
using this:
\<exists>i. cs\<^bsup>\<pi>'\<^esup> l' = cs\<^bsup>\<pi>\<^esup> i

goal (1 subgoal):
 1. (\<And>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> l' \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> l'

goal (1 subgoal):
 1. \<exists>i. cs\<^bsup>\<pi>'\<^esup> l' = cs\<^bsup>\<pi>\<^esup> i \<Longrightarrow> False
[PROOF STEP]
have ik: \<open>i < k\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i < k
[PROOF STEP]
using cs_order[OF ip(2,1) csil[symmetric] cseq nretl' lk']
[PROOF STATE]
proof (prove)
using this:
i < k

goal (1 subgoal):
 1. i < k
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
i < k

goal (1 subgoal):
 1. \<exists>i. cs\<^bsup>\<pi>'\<^esup> l' = cs\<^bsup>\<pi>\<^esup> i \<Longrightarrow> False
[PROOF STEP]
have li: \<open>l < i\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. l < i
[PROOF STEP]
using cs_order[OF ip(2,1) csli'[symmetric] csil[symmetric] nreti' il']
[PROOF STATE]
proof (prove)
using this:
l < i

goal (1 subgoal):
 1. l < i
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
l < i

goal (1 subgoal):
 1. \<exists>i. cs\<^bsup>\<pi>'\<^esup> l' = cs\<^bsup>\<pi>\<^esup> i \<Longrightarrow> False
[PROOF STEP]
have iv: \<open>v \<in> writes(\<pi> i)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. v \<in> local.writes (\<pi> i)
[PROOF STEP]
using lv' csil last_cs
[PROOF STATE]
proof (prove)
using this:
v \<in> local.writes (\<pi>' l')
cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> l'
last (cs\<^bsup>?\<pi>\<^esup> ?i) = ?\<pi> ?i

goal (1 subgoal):
 1. v \<in> local.writes (\<pi> i)
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
v \<in> local.writes (\<pi> i)

goal (1 subgoal):
 1. \<exists>i. cs\<^bsup>\<pi>'\<^esup> l' = cs\<^bsup>\<pi>\<^esup> i \<Longrightarrow> False
[PROOF STEP]
show \<open>False\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. False
[PROOF STEP]
using kddl ik li iv is_ddi_def
[PROOF STATE]
proof (prove)
using this:
k dd\<^bsup>\<pi>,v\<^esup>\<rightarrow> l
i < k
l < i
v \<in> local.writes (\<pi> i)
(?n dd\<^bsup>?\<pi>,?v\<^esup>\<rightarrow> ?m) = (is_path ?\<pi> \<and> ?m < ?n \<and> ?v \<in> local.reads (?\<pi> ?n) \<inter> local.writes (?\<pi> ?m) \<and> (\<forall>l\<in>{?m<..<?n}. ?v \<notin> local.writes (?\<pi> l)))

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<nexists>i. cs\<^bsup>\<pi>'\<^esup> l' = cs\<^bsup>\<pi>\<^esup> i

goal (2 subgoals):
 1. ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
 2. \<not> ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
obtain n n' where csn: \<open>cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n'\<close> and lcdn': \<open>l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n'\<close>  and sucn: \<open>\<pi> (Suc n) \<noteq> \<pi>' (Suc n')\<close> and in': \<open>i' \<le> n'\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>n n'. \<lbrakk>cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n'; l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n'; \<pi> (Suc n) \<noteq> \<pi>' (Suc n'); i' \<le> n'\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using converged_cd_diverge_cs [OF ip(2,1) csli'[symmetric] il' l'notin\<pi> lk' cseq]
[PROOF STATE]
proof (prove)
using this:
(\<And>k k'. \<lbrakk>i' \<le> k; cs\<^bsup>\<pi>'\<^esup> k = cs\<^bsup>\<pi>\<^esup> k'; l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> k; \<pi>' (Suc k) \<noteq> \<pi> (Suc k')\<rbrakk> \<Longrightarrow> ?thesis) \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. (\<And>n n'. \<lbrakk>cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n'; l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n'; \<pi> (Suc n) \<noteq> \<pi>' (Suc n'); i' \<le> n'\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by metis

          \<comment> \<open>Can apply the IH to n and n'\<close>
[PROOF STATE]
proof (state)
this:
cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n'
l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n'
\<pi> (Suc n) \<noteq> \<pi>' (Suc n')
i' \<le> n'

goal (2 subgoals):
 1. ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
 2. \<not> ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
have 1: \<open>\<pi> (Suc n) = suc (\<pi> n) (\<sigma>\<^bsup>n\<^esup>)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<pi> (Suc n) = suc (\<pi> n) (\<sigma>\<^bsup>n\<^esup>)
[PROOF STEP]
by (metis step_suc_sem fst_conv path(1) path_suc)
[PROOF STATE]
proof (state)
this:
\<pi> (Suc n) = suc (\<pi> n) (\<sigma>\<^bsup>n\<^esup>)

goal (2 subgoals):
 1. ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
 2. \<not> ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
have 2: \<open>\<pi>' (Suc n') = suc (\<pi>' n') (\<sigma>'\<^bsup>n'\<^esup>)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<pi>' (Suc n') = suc (\<pi>' n') (\<sigma>'\<^bsup>n'\<^esup>)
[PROOF STEP]
by (metis step_suc_sem fst_conv path(2) path_suc)
[PROOF STATE]
proof (state)
this:
\<pi>' (Suc n') = suc (\<pi>' n') (\<sigma>'\<^bsup>n'\<^esup>)

goal (2 subgoals):
 1. ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
 2. \<not> ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
have 3: \<open>\<pi>' n' = \<pi> n\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<pi>' n' = \<pi> n
[PROOF STEP]
using csn last_cs
[PROOF STATE]
proof (prove)
using this:
cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n'
last (cs\<^bsup>?\<pi>\<^esup> ?i) = ?\<pi> ?i

goal (1 subgoal):
 1. \<pi>' n' = \<pi> n
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
\<pi>' n' = \<pi> n

goal (2 subgoals):
 1. ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
 2. \<not> ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
have nreads: \<open>\<sigma>\<^bsup>n\<^esup> \<restriction> reads (\<pi> n) \<noteq> \<sigma>'\<^bsup>n'\<^esup> \<restriction> reads (\<pi> n)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<sigma>\<^bsup>n\<^esup> \<restriction> local.reads (\<pi> n) \<noteq> \<sigma>'\<^bsup>n'\<^esup> \<restriction> local.reads (\<pi> n)
[PROOF STEP]
by (metis 1 2 3 sucn reads_restr_suc)
[PROOF STATE]
proof (state)
this:
\<sigma>\<^bsup>n\<^esup> \<restriction> local.reads (\<pi> n) \<noteq> \<sigma>'\<^bsup>n'\<^esup> \<restriction> local.reads (\<pi> n)

goal (2 subgoals):
 1. ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
 2. \<not> ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<sigma>\<^bsup>n\<^esup> \<restriction> local.reads (\<pi> n) \<noteq> \<sigma>'\<^bsup>n'\<^esup> \<restriction> local.reads (\<pi> n)
[PROOF STEP]
obtain v' where v'read: \<open>v'\<in>reads (path \<sigma> n)\<close> \<open>(\<sigma>\<^bsup>n\<^esup>) v' \<noteq> (\<sigma>'\<^bsup>n'\<^esup>) v'\<close>
[PROOF STATE]
proof (prove)
using this:
\<sigma>\<^bsup>n\<^esup> \<restriction> local.reads (\<pi> n) \<noteq> \<sigma>'\<^bsup>n'\<^esup> \<restriction> local.reads (\<pi> n)

goal (1 subgoal):
 1. (\<And>v'. \<lbrakk>v' \<in> local.reads (path \<sigma> n); (\<sigma>\<^bsup>n\<^esup>) v' \<noteq> (\<sigma>'\<^bsup>n'\<^esup>) v'\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis path(1) reads_restrict)
[PROOF STATE]
proof (state)
this:
v' \<in> local.reads (path \<sigma> n)
(\<sigma>\<^bsup>n\<^esup>) v' \<noteq> (\<sigma>'\<^bsup>n'\<^esup>) v'

goal (2 subgoals):
 1. ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
 2. \<not> ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
v' \<in> local.reads (path \<sigma> n)
(\<sigma>\<^bsup>n\<^esup>) v' \<noteq> (\<sigma>'\<^bsup>n'\<^esup>) v'

goal (2 subgoals):
 1. ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
 2. \<not> ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
have nl': \<open>n' < l'\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n' < l'
[PROOF STEP]
using lcdn' is_cdi_def
[PROOF STATE]
proof (prove)
using this:
l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n'
(?i cd\<^bsup>?\<pi>\<^esup>\<rightarrow> ?k) = (is_path ?\<pi> \<and> ?k < ?i \<and> ?\<pi> ?i \<noteq> local.return \<and> (\<forall>j\<in>{?k..?i}. ?\<pi> j \<noteq> ipd (?\<pi> ?k)))

goal (1 subgoal):
 1. n' < l'
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
n' < l'

goal (2 subgoals):
 1. ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
 2. \<not> ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
have nk': \<open>n' < k'\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n' < k'
[PROOF STEP]
using nl' lk'
[PROOF STATE]
proof (prove)
using this:
n' < l'
l' < k'

goal (1 subgoal):
 1. n' < k'
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
n' < k'

goal (2 subgoals):
 1. ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
 2. \<not> ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
have nretn': \<open>\<pi>' n' \<noteq> return\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<pi>' n' \<noteq> local.return
[PROOF STEP]
by (metis ip(2) nl' nretl' term_path_stable less_imp_le)
[PROOF STATE]
proof (state)
this:
\<pi>' n' \<noteq> local.return

goal (2 subgoals):
 1. ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
 2. \<not> ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
have nk: \<open>n < k\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n < k
[PROOF STEP]
using cs_order[OF ip(2,1) csn[symmetric] cseq nretn' nk']
[PROOF STATE]
proof (prove)
using this:
n < k

goal (1 subgoal):
 1. n < k
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
n < k

goal (2 subgoals):
 1. ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
 2. \<not> ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
hence lenn: \<open>n+n' < k+k'\<close>
[PROOF STATE]
proof (prove)
using this:
n < k

goal (1 subgoal):
 1. n + n' < k + k'
[PROOF STEP]
using nk'
[PROOF STATE]
proof (prove)
using this:
n < k
n' < k'

goal (1 subgoal):
 1. n + n' < k + k'
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
n + n' < k + k'

goal (2 subgoals):
 1. ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
 2. \<not> ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
v' \<in> local.reads (path \<sigma> n)
(\<sigma>\<^bsup>n\<^esup>) v' \<noteq> (\<sigma>'\<^bsup>n'\<^esup>) v'
n + n' < k + k'
[PROOF STEP]
have \<open>((\<sigma>, n), (\<sigma>', n')) \<in> cp\<close>
[PROOF STATE]
proof (prove)
using this:
v' \<in> local.reads (path \<sigma> n)
(\<sigma>\<^bsup>n\<^esup>) v' \<noteq> (\<sigma>'\<^bsup>n'\<^esup>) v'
n + n' < k + k'

goal (1 subgoal):
 1. ((\<sigma>, n), \<sigma>', n') \<in> cp
[PROOF STEP]
using IH csn path
[PROOF STATE]
proof (prove)
using this:
v' \<in> local.reads (path \<sigma> n)
(\<sigma>\<^bsup>n\<^esup>) v' \<noteq> (\<sigma>'\<^bsup>n'\<^esup>) v'
n + n' < k + k'
\<lbrakk>?ka1 + ?k'a1 < k + k'; cs\<^bsup>path \<sigma>\<^esup> ?ka1 = cs\<^bsup>path \<sigma>'\<^esup> ?k'a1; ?v1 \<in> local.reads (path \<sigma> ?ka1); (\<sigma>\<^bsup>?ka1\<^esup>) ?v1 \<noteq> (\<sigma>'\<^bsup>?k'a1\<^esup>) ?v1\<rbrakk> \<Longrightarrow> ((\<sigma>, ?ka1), \<sigma>', ?k'a1) \<in> cp
cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n'
\<pi> = path \<sigma>
\<pi>' = path \<sigma>'

goal (1 subgoal):
 1. ((\<sigma>, n), \<sigma>', n') \<in> cp
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
((\<sigma>, n), \<sigma>', n') \<in> cp

goal (2 subgoals):
 1. ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
 2. \<not> ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
hence ncp: \<open>((\<sigma>', n'), (\<sigma>, n)) \<in> cp\<close>
[PROOF STATE]
proof (prove)
using this:
((\<sigma>, n), \<sigma>', n') \<in> cp

goal (1 subgoal):
 1. ((\<sigma>', n'), \<sigma>, n) \<in> cp
[PROOF STEP]
using cp.intros(4)
[PROOF STATE]
proof (prove)
using this:
((\<sigma>, n), \<sigma>', n') \<in> cp
((?\<sigma>, ?k), ?\<sigma>', ?k') \<in> cp \<Longrightarrow> ((?\<sigma>', ?k'), ?\<sigma>, ?k) \<in> cp

goal (1 subgoal):
 1. ((\<sigma>', n'), \<sigma>, n) \<in> cp
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
((\<sigma>', n'), \<sigma>, n) \<in> cp

goal (2 subgoals):
 1. ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
 2. \<not> ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
have nles: \<open>n < (LEAST i'. n < i' \<and> (\<exists>i. cs\<^bsup>\<pi>'\<^esup> i = cs\<^bsup>\<pi>\<^esup> i'))\<close> (is \<open>_ < (LEAST i. ?P i)\<close>)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n < (LEAST i'. n < i' \<and> (\<exists>i. cs\<^bsup>\<pi>'\<^esup> i = cs\<^bsup>\<pi>\<^esup> i'))
[PROOF STEP]
using nk cseq LeastI[of \<open>?P\<close> \<open>k\<close>]
[PROOF STATE]
proof (prove)
using this:
n < k
cs\<^bsup>\<pi>'\<^esup> k' = cs\<^bsup>\<pi>\<^esup> k
n < k \<and> (\<exists>i. cs\<^bsup>\<pi>'\<^esup> i = cs\<^bsup>\<pi>\<^esup> k) \<Longrightarrow> n < (LEAST x. n < x \<and> (\<exists>i. cs\<^bsup>\<pi>'\<^esup> i = cs\<^bsup>\<pi>\<^esup> x)) \<and> (\<exists>i. cs\<^bsup>\<pi>'\<^esup> i = cs\<^bsup>\<pi>\<^esup> (LEAST x. n < x \<and> (\<exists>i. cs\<^bsup>\<pi>'\<^esup> i = cs\<^bsup>\<pi>\<^esup> x)))

goal (1 subgoal):
 1. n < (LEAST i'. n < i' \<and> (\<exists>i. cs\<^bsup>\<pi>'\<^esup> i = cs\<^bsup>\<pi>\<^esup> i'))
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
n < (LEAST i'. n < i' \<and> (\<exists>i. cs\<^bsup>\<pi>'\<^esup> i = cs\<^bsup>\<pi>\<^esup> i'))

goal (2 subgoals):
 1. ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
 2. \<not> ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
n < (LEAST i'. n < i' \<and> (\<exists>i. cs\<^bsup>\<pi>'\<^esup> i = cs\<^bsup>\<pi>\<^esup> i'))

goal (2 subgoals):
 1. ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
 2. \<not> ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
have ln: \<open>l \<le> n\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. l \<le> n
[PROOF STEP]
using cs_order_le[OF ip(2,1) csli'[symmetric] csn[symmetric] nreti' in']
[PROOF STATE]
proof (prove)
using this:
l \<le> n

goal (1 subgoal):
 1. l \<le> n
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
l \<le> n

goal (2 subgoals):
 1. ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
 2. \<not> ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
n < (LEAST i'. n < i' \<and> (\<exists>i. cs\<^bsup>\<pi>'\<^esup> i = cs\<^bsup>\<pi>\<^esup> i'))
l \<le> n
[PROOF STEP]
have lles: \<open>Suc l \<le> (LEAST i'. n < i' \<and> (\<exists>i. cs\<^bsup>\<pi>'\<^esup> i = cs\<^bsup>\<pi>\<^esup> i'))\<close>
[PROOF STATE]
proof (prove)
using this:
n < (LEAST i'. n < i' \<and> (\<exists>i. cs\<^bsup>\<pi>'\<^esup> i = cs\<^bsup>\<pi>\<^esup> i'))
l \<le> n

goal (1 subgoal):
 1. Suc l \<le> (LEAST i'. n < i' \<and> (\<exists>i. cs\<^bsup>\<pi>'\<^esup> i = cs\<^bsup>\<pi>\<^esup> i'))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Suc l \<le> (LEAST i'. n < i' \<and> (\<exists>i. cs\<^bsup>\<pi>'\<^esup> i = cs\<^bsup>\<pi>\<^esup> i'))

goal (2 subgoals):
 1. ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
 2. \<not> ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
have nwcseq: \<open>\<forall>j'\<in>{LEAST i'. n < i' \<and> (\<exists>i. cs\<^bsup>\<pi>'\<^esup> i = cs\<^bsup>\<pi>\<^esup> i')..<k}. v \<notin> writes (\<pi> j')\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>j'\<in>{LEAST i'. n < i' \<and> (\<exists>i. cs\<^bsup>\<pi>'\<^esup> i = cs\<^bsup>\<pi>\<^esup> i')..<k}. v \<notin> local.writes (\<pi> j')
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>j'. j' \<in> {LEAST i'. n < i' \<and> (\<exists>i. cs\<^bsup>\<pi>'\<^esup> i = cs\<^bsup>\<pi>\<^esup> i')..<k} \<Longrightarrow> v \<notin> local.writes (\<pi> j')
[PROOF STEP]
fix j'
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>j'. j' \<in> {LEAST i'. n < i' \<and> (\<exists>i. cs\<^bsup>\<pi>'\<^esup> i = cs\<^bsup>\<pi>\<^esup> i')..<k} \<Longrightarrow> v \<notin> local.writes (\<pi> j')
[PROOF STEP]
assume *: \<open>j' \<in> {LEAST i'. n < i' \<and> (\<exists>i. cs\<^bsup>\<pi>'\<^esup> i = cs\<^bsup>\<pi>\<^esup> i')..<k}\<close>
[PROOF STATE]
proof (state)
this:
j' \<in> {LEAST i'. n < i' \<and> (\<exists>i. cs\<^bsup>\<pi>'\<^esup> i = cs\<^bsup>\<pi>\<^esup> i')..<k}

goal (1 subgoal):
 1. \<And>j'. j' \<in> {LEAST i'. n < i' \<and> (\<exists>i. cs\<^bsup>\<pi>'\<^esup> i = cs\<^bsup>\<pi>\<^esup> i')..<k} \<Longrightarrow> v \<notin> local.writes (\<pi> j')
[PROOF STEP]
hence \<open>(LEAST i'. n < i' \<and> (\<exists>i. cs\<^bsup>\<pi>'\<^esup> i = cs\<^bsup>\<pi>\<^esup> i')) \<le> j'\<close>
[PROOF STATE]
proof (prove)
using this:
j' \<in> {LEAST i'. n < i' \<and> (\<exists>i. cs\<^bsup>\<pi>'\<^esup> i = cs\<^bsup>\<pi>\<^esup> i')..<k}

goal (1 subgoal):
 1. (LEAST i'. n < i' \<and> (\<exists>i. cs\<^bsup>\<pi>'\<^esup> i = cs\<^bsup>\<pi>\<^esup> i')) \<le> j'
[PROOF STEP]
by (metis (poly_guards_query) atLeastLessThan_iff)
[PROOF STATE]
proof (state)
this:
(LEAST i'. n < i' \<and> (\<exists>i. cs\<^bsup>\<pi>'\<^esup> i = cs\<^bsup>\<pi>\<^esup> i')) \<le> j'

goal (1 subgoal):
 1. \<And>j'. j' \<in> {LEAST i'. n < i' \<and> (\<exists>i. cs\<^bsup>\<pi>'\<^esup> i = cs\<^bsup>\<pi>\<^esup> i')..<k} \<Longrightarrow> v \<notin> local.writes (\<pi> j')
[PROOF STEP]
hence \<open>Suc l \<le> j'\<close>
[PROOF STATE]
proof (prove)
using this:
(LEAST i'. n < i' \<and> (\<exists>i. cs\<^bsup>\<pi>'\<^esup> i = cs\<^bsup>\<pi>\<^esup> i')) \<le> j'

goal (1 subgoal):
 1. Suc l \<le> j'
[PROOF STEP]
using lles
[PROOF STATE]
proof (prove)
using this:
(LEAST i'. n < i' \<and> (\<exists>i. cs\<^bsup>\<pi>'\<^esup> i = cs\<^bsup>\<pi>\<^esup> i')) \<le> j'
Suc l \<le> (LEAST i'. n < i' \<and> (\<exists>i. cs\<^bsup>\<pi>'\<^esup> i = cs\<^bsup>\<pi>\<^esup> i'))

goal (1 subgoal):
 1. Suc l \<le> j'
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Suc l \<le> j'

goal (1 subgoal):
 1. \<And>j'. j' \<in> {LEAST i'. n < i' \<and> (\<exists>i. cs\<^bsup>\<pi>'\<^esup> i = cs\<^bsup>\<pi>\<^esup> i')..<k} \<Longrightarrow> v \<notin> local.writes (\<pi> j')
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
Suc l \<le> j'

goal (1 subgoal):
 1. \<And>j'. j' \<in> {LEAST i'. n < i' \<and> (\<exists>i. cs\<^bsup>\<pi>'\<^esup> i = cs\<^bsup>\<pi>\<^esup> i')..<k} \<Longrightarrow> v \<notin> local.writes (\<pi> j')
[PROOF STEP]
have \<open>j' < k\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. j' < k
[PROOF STEP]
using *
[PROOF STATE]
proof (prove)
using this:
j' \<in> {LEAST i'. n < i' \<and> (\<exists>i. cs\<^bsup>\<pi>'\<^esup> i = cs\<^bsup>\<pi>\<^esup> i')..<k}

goal (1 subgoal):
 1. j' < k
[PROOF STEP]
by (metis (poly_guards_query) atLeastLessThan_iff)
[PROOF STATE]
proof (state)
this:
j' < k

goal (1 subgoal):
 1. \<And>j'. j' \<in> {LEAST i'. n < i' \<and> (\<exists>i. cs\<^bsup>\<pi>'\<^esup> i = cs\<^bsup>\<pi>\<^esup> i')..<k} \<Longrightarrow> v \<notin> local.writes (\<pi> j')
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
Suc l \<le> j'
j' < k
[PROOF STEP]
have \<open>j'\<in> {Suc l..<k}\<close>
[PROOF STATE]
proof (prove)
using this:
Suc l \<le> j'
j' < k

goal (1 subgoal):
 1. j' \<in> {Suc l..<k}
[PROOF STEP]
by (metis (poly_guards_query) atLeastLessThan_iff)
[PROOF STATE]
proof (state)
this:
j' \<in> {Suc l..<k}

goal (1 subgoal):
 1. \<And>j'. j' \<in> {LEAST i'. n < i' \<and> (\<exists>i. cs\<^bsup>\<pi>'\<^esup> i = cs\<^bsup>\<pi>\<^esup> i')..<k} \<Longrightarrow> v \<notin> local.writes (\<pi> j')
[PROOF STEP]
thus \<open>v\<notin>writes (\<pi> j')\<close>
[PROOF STATE]
proof (prove)
using this:
j' \<in> {Suc l..<k}

goal (1 subgoal):
 1. v \<notin> local.writes (\<pi> j')
[PROOF STEP]
using nwb
[PROOF STATE]
proof (prove)
using this:
j' \<in> {Suc l..<k}
\<forall>i\<in>{Suc l..<k}. v \<notin> local.writes (\<pi> i)

goal (1 subgoal):
 1. v \<notin> local.writes (\<pi> j')
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
v \<notin> local.writes (\<pi> j')

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>j'\<in>{LEAST i'. n < i' \<and> (\<exists>i. cs\<^bsup>\<pi>'\<^esup> i = cs\<^bsup>\<pi>\<^esup> i')..<k}. v \<notin> local.writes (\<pi> j')

goal (2 subgoals):
 1. ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
 2. \<not> ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
from cp.intros(3)[OF ncp,folded path,OF kddl' lcdn' cseq sucn[symmetric] vneq[symmetric] nwcseq]
[PROOF STATE]
proof (chain)
picking this:
((\<sigma>', k'), \<sigma>, k) \<in> cp
[PROOF STEP]
have \<open>((\<sigma>', k'), \<sigma>, k) \<in> cp\<close>
[PROOF STATE]
proof (prove)
using this:
((\<sigma>', k'), \<sigma>, k) \<in> cp

goal (1 subgoal):
 1. ((\<sigma>', k'), \<sigma>, k) \<in> cp
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
((\<sigma>', k'), \<sigma>, k) \<in> cp

goal (2 subgoals):
 1. ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
 2. \<not> ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
thus \<open>((\<sigma>, k), (\<sigma>', k')) \<in> cp\<close>
[PROOF STATE]
proof (prove)
using this:
((\<sigma>', k'), \<sigma>, k) \<in> cp

goal (1 subgoal):
 1. ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
using cp.intros(4)
[PROOF STATE]
proof (prove)
using this:
((\<sigma>', k'), \<sigma>, k) \<in> cp
((?\<sigma>, ?k), ?\<sigma>', ?k') \<in> cp \<Longrightarrow> ((?\<sigma>', ?k'), ?\<sigma>, ?k) \<in> cp

goal (1 subgoal):
 1. ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
((\<sigma>, k), \<sigma>', k') \<in> cp

goal (1 subgoal):
 1. \<nexists>i'. cs\<^bsup>\<pi>\<^esup> l = cs\<^bsup>\<pi>'\<^esup> i' \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<nexists>i'. cs\<^bsup>\<pi>\<^esup> l = cs\<^bsup>\<pi>'\<^esup> i' \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
assume lnotin\<pi>': \<open>\<not> (\<exists>i'. cs\<^bsup>\<pi>\<^esup> l = cs\<^bsup>\<pi>'\<^esup> i')\<close>
[PROOF STATE]
proof (state)
this:
\<nexists>i'. cs\<^bsup>\<pi>\<^esup> l = cs\<^bsup>\<pi>'\<^esup> i'

goal (1 subgoal):
 1. \<nexists>i'. cs\<^bsup>\<pi>\<^esup> l = cs\<^bsup>\<pi>'\<^esup> i' \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
show \<open>?thesis\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
proof cases
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
 2. \<not> ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
assume \<open>\<exists> i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> l'\<close>
[PROOF STATE]
proof (state)
this:
\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> l'

goal (2 subgoals):
 1. ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
 2. \<not> ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> l'
[PROOF STEP]
obtain i where csli: \<open>cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> l'\<close>
[PROOF STATE]
proof (prove)
using this:
\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> l'

goal (1 subgoal):
 1. (\<And>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> l' \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> l'

goal (2 subgoals):
 1. ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
 2. \<not> ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
have ilne: \<open>i \<noteq> l\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i \<noteq> l
[PROOF STEP]
using csl csli
[PROOF STATE]
proof (prove)
using this:
cs\<^bsup>\<pi>\<^esup> l \<noteq> cs\<^bsup>\<pi>'\<^esup> l'
cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> l'

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

goal (2 subgoals):
 1. ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
 2. \<not> ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
have ij: \<open>i < k\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i < k
[PROOF STEP]
using cs_order[OF ip(2,1) csli[symmetric] cseq nretl' lk']
[PROOF STATE]
proof (prove)
using this:
i < k

goal (1 subgoal):
 1. i < k
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
i < k

goal (2 subgoals):
 1. ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
 2. \<not> ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
have iv: \<open>v \<in> writes(\<pi> i)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. v \<in> local.writes (\<pi> i)
[PROOF STEP]
using lv' csli last_cs
[PROOF STATE]
proof (prove)
using this:
v \<in> local.writes (\<pi>' l')
cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> l'
last (cs\<^bsup>?\<pi>\<^esup> ?i) = ?\<pi> ?i

goal (1 subgoal):
 1. v \<in> local.writes (\<pi> i)
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
v \<in> local.writes (\<pi> i)

goal (2 subgoals):
 1. ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
 2. \<not> ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
have il: \<open>i < l\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i < l
[PROOF STEP]
using kddl ilne ij iv
[PROOF STATE]
proof (prove)
using this:
k dd\<^bsup>\<pi>,v\<^esup>\<rightarrow> l
i \<noteq> l
i < k
v \<in> local.writes (\<pi> i)

goal (1 subgoal):
 1. i < l
[PROOF STEP]
unfolding is_ddi_def
[PROOF STATE]
proof (prove)
using this:
is_path \<pi> \<and> l < k \<and> v \<in> local.reads (\<pi> k) \<inter> local.writes (\<pi> l) \<and> (\<forall>l\<in>{l<..<k}. v \<notin> local.writes (\<pi> l))
i \<noteq> l
i < k
v \<in> local.writes (\<pi> i)

goal (1 subgoal):
 1. i < l
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
i < l

goal (2 subgoals):
 1. ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
 2. \<not> ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
have nreti: \<open>\<pi> i \<noteq> return\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<pi> i \<noteq> local.return
[PROOF STEP]
using csli nretl' last_cs
[PROOF STATE]
proof (prove)
using this:
cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> l'
\<pi>' l' \<noteq> local.return
last (cs\<^bsup>?\<pi>\<^esup> ?i) = ?\<pi> ?i

goal (1 subgoal):
 1. \<pi> i \<noteq> local.return
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
\<pi> i \<noteq> local.return

goal (2 subgoals):
 1. ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
 2. \<not> ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
obtain n n' where csn: \<open>cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n'\<close> and lcdn: \<open>l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n\<close>  and sucn: \<open>\<pi> (Suc n) \<noteq> \<pi>' (Suc n')\<close> and ilen: \<open>i \<le> n\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>n n'. \<lbrakk>cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n'; l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n; \<pi> (Suc n) \<noteq> \<pi>' (Suc n'); i \<le> n\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using converged_cd_diverge_cs [OF ip csli il lnotin\<pi>' lk cseq[symmetric]]
[PROOF STATE]
proof (prove)
using this:
(\<And>k k'. \<lbrakk>i \<le> k; cs\<^bsup>\<pi>\<^esup> k = cs\<^bsup>\<pi>'\<^esup> k'; l cd\<^bsup>\<pi>\<^esup>\<rightarrow> k; \<pi> (Suc k) \<noteq> \<pi>' (Suc k')\<rbrakk> \<Longrightarrow> ?thesis) \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. (\<And>n n'. \<lbrakk>cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n'; l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n; \<pi> (Suc n) \<noteq> \<pi>' (Suc n'); i \<le> n\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by metis

            \<comment> \<open>Can apply the IH to n and n'\<close>
[PROOF STATE]
proof (state)
this:
cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n'
l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n
\<pi> (Suc n) \<noteq> \<pi>' (Suc n')
i \<le> n

goal (2 subgoals):
 1. ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
 2. \<not> ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
have 1: \<open>\<pi> (Suc n) = suc (\<pi> n) (\<sigma>\<^bsup>n\<^esup>)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<pi> (Suc n) = suc (\<pi> n) (\<sigma>\<^bsup>n\<^esup>)
[PROOF STEP]
by (metis step_suc_sem fst_conv path(1) path_suc)
[PROOF STATE]
proof (state)
this:
\<pi> (Suc n) = suc (\<pi> n) (\<sigma>\<^bsup>n\<^esup>)

goal (2 subgoals):
 1. ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
 2. \<not> ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
have 2: \<open>\<pi>' (Suc n') = suc (\<pi>' n') (\<sigma>'\<^bsup>n'\<^esup>)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<pi>' (Suc n') = suc (\<pi>' n') (\<sigma>'\<^bsup>n'\<^esup>)
[PROOF STEP]
by (metis step_suc_sem fst_conv path(2) path_suc)
[PROOF STATE]
proof (state)
this:
\<pi>' (Suc n') = suc (\<pi>' n') (\<sigma>'\<^bsup>n'\<^esup>)

goal (2 subgoals):
 1. ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
 2. \<not> ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
have 3: \<open>\<pi>' n' = \<pi> n\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<pi>' n' = \<pi> n
[PROOF STEP]
using csn last_cs
[PROOF STATE]
proof (prove)
using this:
cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n'
last (cs\<^bsup>?\<pi>\<^esup> ?i) = ?\<pi> ?i

goal (1 subgoal):
 1. \<pi>' n' = \<pi> n
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
\<pi>' n' = \<pi> n

goal (2 subgoals):
 1. ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
 2. \<not> ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
have nreads: \<open>\<sigma>\<^bsup>n\<^esup> \<restriction> reads (\<pi> n) \<noteq> \<sigma>'\<^bsup>n'\<^esup> \<restriction> reads (\<pi> n)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<sigma>\<^bsup>n\<^esup> \<restriction> local.reads (\<pi> n) \<noteq> \<sigma>'\<^bsup>n'\<^esup> \<restriction> local.reads (\<pi> n)
[PROOF STEP]
by (metis 1 2 3 sucn reads_restr_suc)
[PROOF STATE]
proof (state)
this:
\<sigma>\<^bsup>n\<^esup> \<restriction> local.reads (\<pi> n) \<noteq> \<sigma>'\<^bsup>n'\<^esup> \<restriction> local.reads (\<pi> n)

goal (2 subgoals):
 1. ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
 2. \<not> ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<sigma>\<^bsup>n\<^esup> \<restriction> local.reads (\<pi> n) \<noteq> \<sigma>'\<^bsup>n'\<^esup> \<restriction> local.reads (\<pi> n)
[PROOF STEP]
obtain v' where v'read: \<open>v'\<in>reads (path \<sigma> n)\<close> \<open>(\<sigma>\<^bsup>n\<^esup>) v' \<noteq> (\<sigma>'\<^bsup>n'\<^esup>) v'\<close>
[PROOF STATE]
proof (prove)
using this:
\<sigma>\<^bsup>n\<^esup> \<restriction> local.reads (\<pi> n) \<noteq> \<sigma>'\<^bsup>n'\<^esup> \<restriction> local.reads (\<pi> n)

goal (1 subgoal):
 1. (\<And>v'. \<lbrakk>v' \<in> local.reads (path \<sigma> n); (\<sigma>\<^bsup>n\<^esup>) v' \<noteq> (\<sigma>'\<^bsup>n'\<^esup>) v'\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis path(1) reads_restrict)
[PROOF STATE]
proof (state)
this:
v' \<in> local.reads (path \<sigma> n)
(\<sigma>\<^bsup>n\<^esup>) v' \<noteq> (\<sigma>'\<^bsup>n'\<^esup>) v'

goal (2 subgoals):
 1. ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
 2. \<not> ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
v' \<in> local.reads (path \<sigma> n)
(\<sigma>\<^bsup>n\<^esup>) v' \<noteq> (\<sigma>'\<^bsup>n'\<^esup>) v'

goal (2 subgoals):
 1. ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
 2. \<not> ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
have nl: \<open>n < l\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n < l
[PROOF STEP]
using lcdn is_cdi_def
[PROOF STATE]
proof (prove)
using this:
l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n
(?i cd\<^bsup>?\<pi>\<^esup>\<rightarrow> ?k) = (is_path ?\<pi> \<and> ?k < ?i \<and> ?\<pi> ?i \<noteq> local.return \<and> (\<forall>j\<in>{?k..?i}. ?\<pi> j \<noteq> ipd (?\<pi> ?k)))

goal (1 subgoal):
 1. n < l
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
n < l

goal (2 subgoals):
 1. ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
 2. \<not> ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
have nk: \<open>n < k\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n < k
[PROOF STEP]
using nl lk
[PROOF STATE]
proof (prove)
using this:
n < l
l < k

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

goal (2 subgoals):
 1. ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
 2. \<not> ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
have nretn: \<open>\<pi> n \<noteq> return\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<pi> n \<noteq> local.return
[PROOF STEP]
by (metis ip(1) nl nret term_path_stable less_imp_le)
[PROOF STATE]
proof (state)
this:
\<pi> n \<noteq> local.return

goal (2 subgoals):
 1. ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
 2. \<not> ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
have nk': \<open>n' < k'\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n' < k'
[PROOF STEP]
using cs_order[OF ip csn cseq[symmetric] nretn nk]
[PROOF STATE]
proof (prove)
using this:
n' < k'

goal (1 subgoal):
 1. n' < k'
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
n' < k'

goal (2 subgoals):
 1. ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
 2. \<not> ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
hence lenn: \<open>n+n' < k+k'\<close>
[PROOF STATE]
proof (prove)
using this:
n' < k'

goal (1 subgoal):
 1. n + n' < k + k'
[PROOF STEP]
using nk
[PROOF STATE]
proof (prove)
using this:
n' < k'
n < k

goal (1 subgoal):
 1. n + n' < k + k'
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
n + n' < k + k'

goal (2 subgoals):
 1. ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
 2. \<not> ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
v' \<in> local.reads (path \<sigma> n)
(\<sigma>\<^bsup>n\<^esup>) v' \<noteq> (\<sigma>'\<^bsup>n'\<^esup>) v'
n + n' < k + k'
[PROOF STEP]
have ncp: \<open>((\<sigma>, n), (\<sigma>', n')) \<in> cp\<close>
[PROOF STATE]
proof (prove)
using this:
v' \<in> local.reads (path \<sigma> n)
(\<sigma>\<^bsup>n\<^esup>) v' \<noteq> (\<sigma>'\<^bsup>n'\<^esup>) v'
n + n' < k + k'

goal (1 subgoal):
 1. ((\<sigma>, n), \<sigma>', n') \<in> cp
[PROOF STEP]
using IH csn path
[PROOF STATE]
proof (prove)
using this:
v' \<in> local.reads (path \<sigma> n)
(\<sigma>\<^bsup>n\<^esup>) v' \<noteq> (\<sigma>'\<^bsup>n'\<^esup>) v'
n + n' < k + k'
\<lbrakk>?ka1 + ?k'a1 < k + k'; cs\<^bsup>path \<sigma>\<^esup> ?ka1 = cs\<^bsup>path \<sigma>'\<^esup> ?k'a1; ?v1 \<in> local.reads (path \<sigma> ?ka1); (\<sigma>\<^bsup>?ka1\<^esup>) ?v1 \<noteq> (\<sigma>'\<^bsup>?k'a1\<^esup>) ?v1\<rbrakk> \<Longrightarrow> ((\<sigma>, ?ka1), \<sigma>', ?k'a1) \<in> cp
cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n'
\<pi> = path \<sigma>
\<pi>' = path \<sigma>'

goal (1 subgoal):
 1. ((\<sigma>, n), \<sigma>', n') \<in> cp
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
((\<sigma>, n), \<sigma>', n') \<in> cp

goal (2 subgoals):
 1. ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
 2. \<not> ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
have nles': \<open>n' < (LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i'))\<close> (is \<open>_ < (LEAST i. ?P i)\<close>)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n' < (LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i'))
[PROOF STEP]
using nk' cseq LeastI[of \<open>?P\<close> \<open>k'\<close>]
[PROOF STATE]
proof (prove)
using this:
n' < k'
cs\<^bsup>\<pi>'\<^esup> k' = cs\<^bsup>\<pi>\<^esup> k
n' < k' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> k') \<Longrightarrow> n' < (LEAST x. n' < x \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> x)) \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> (LEAST x. n' < x \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> x)))

goal (1 subgoal):
 1. n' < (LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i'))
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
n' < (LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i'))

goal (2 subgoals):
 1. ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
 2. \<not> ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
n' < (LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i'))

goal (2 subgoals):
 1. ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
 2. \<not> ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
have ln': \<open>l' \<le> n'\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. l' \<le> n'
[PROOF STEP]
using cs_order_le[OF ip csli csn nreti ilen]
[PROOF STATE]
proof (prove)
using this:
l' \<le> n'

goal (1 subgoal):
 1. l' \<le> n'
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
l' \<le> n'

goal (2 subgoals):
 1. ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
 2. \<not> ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
n' < (LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i'))
l' \<le> n'
[PROOF STEP]
have lles': \<open>Suc l' \<le> (LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i'))\<close>
[PROOF STATE]
proof (prove)
using this:
n' < (LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i'))
l' \<le> n'

goal (1 subgoal):
 1. Suc l' \<le> (LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i'))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Suc l' \<le> (LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i'))

goal (2 subgoals):
 1. ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
 2. \<not> ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
have nwcseq': \<open>\<forall>j'\<in>{(LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i'))..<k'}. v \<notin> writes (\<pi>' j')\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>j'. j' \<in> {LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'} \<Longrightarrow> v \<notin> local.writes (\<pi>' j')
[PROOF STEP]
fix j'
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>j'. j' \<in> {LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'} \<Longrightarrow> v \<notin> local.writes (\<pi>' j')
[PROOF STEP]
assume *: \<open>j' \<in> {(LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i'))..<k'}\<close>
[PROOF STATE]
proof (state)
this:
j' \<in> {LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}

goal (1 subgoal):
 1. \<And>j'. j' \<in> {LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'} \<Longrightarrow> v \<notin> local.writes (\<pi>' j')
[PROOF STEP]
hence \<open>(LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')) \<le> j'\<close>
[PROOF STATE]
proof (prove)
using this:
j' \<in> {LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}

goal (1 subgoal):
 1. (LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')) \<le> j'
[PROOF STEP]
by (metis (poly_guards_query) atLeastLessThan_iff)
[PROOF STATE]
proof (state)
this:
(LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')) \<le> j'

goal (1 subgoal):
 1. \<And>j'. j' \<in> {LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'} \<Longrightarrow> v \<notin> local.writes (\<pi>' j')
[PROOF STEP]
hence \<open>Suc l' \<le> j'\<close>
[PROOF STATE]
proof (prove)
using this:
(LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')) \<le> j'

goal (1 subgoal):
 1. Suc l' \<le> j'
[PROOF STEP]
using lles'
[PROOF STATE]
proof (prove)
using this:
(LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')) \<le> j'
Suc l' \<le> (LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i'))

goal (1 subgoal):
 1. Suc l' \<le> j'
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Suc l' \<le> j'

goal (1 subgoal):
 1. \<And>j'. j' \<in> {LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'} \<Longrightarrow> v \<notin> local.writes (\<pi>' j')
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
Suc l' \<le> j'

goal (1 subgoal):
 1. \<And>j'. j' \<in> {LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'} \<Longrightarrow> v \<notin> local.writes (\<pi>' j')
[PROOF STEP]
have \<open>j' < k'\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. j' < k'
[PROOF STEP]
using *
[PROOF STATE]
proof (prove)
using this:
j' \<in> {LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}

goal (1 subgoal):
 1. j' < k'
[PROOF STEP]
by (metis (poly_guards_query) atLeastLessThan_iff)
[PROOF STATE]
proof (state)
this:
j' < k'

goal (1 subgoal):
 1. \<And>j'. j' \<in> {LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'} \<Longrightarrow> v \<notin> local.writes (\<pi>' j')
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
Suc l' \<le> j'
j' < k'
[PROOF STEP]
have \<open>j'\<in> {Suc l'..<k'}\<close>
[PROOF STATE]
proof (prove)
using this:
Suc l' \<le> j'
j' < k'

goal (1 subgoal):
 1. j' \<in> {Suc l'..<k'}
[PROOF STEP]
by (metis (poly_guards_query) atLeastLessThan_iff)
[PROOF STATE]
proof (state)
this:
j' \<in> {Suc l'..<k'}

goal (1 subgoal):
 1. \<And>j'. j' \<in> {LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'} \<Longrightarrow> v \<notin> local.writes (\<pi>' j')
[PROOF STEP]
thus \<open>v\<notin>writes (\<pi>' j')\<close>
[PROOF STATE]
proof (prove)
using this:
j' \<in> {Suc l'..<k'}

goal (1 subgoal):
 1. v \<notin> local.writes (\<pi>' j')
[PROOF STEP]
using nwb'
[PROOF STATE]
proof (prove)
using this:
j' \<in> {Suc l'..<k'}
\<forall>i'\<in>{Suc l'..<k'}. v \<notin> local.writes (\<pi>' i')

goal (1 subgoal):
 1. v \<notin> local.writes (\<pi>' j')
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
v \<notin> local.writes (\<pi>' j')

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')

goal (2 subgoals):
 1. ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
 2. \<not> ?P \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
from cp.intros(3)[OF ncp,folded path, OF kddl lcdn cseq[symmetric] sucn vneq nwcseq']
[PROOF STATE]
proof (chain)
picking this:
((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
show \<open>((\<sigma>, k), (\<sigma>', k')) \<in> cp\<close>
[PROOF STATE]
proof (prove)
using this:
((\<sigma>, k), \<sigma>', k') \<in> cp

goal (1 subgoal):
 1. ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
((\<sigma>, k), \<sigma>', k') \<in> cp

goal (1 subgoal):
 1. \<nexists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> l' \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<nexists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> l' \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
assume l'notin\<pi>: \<open>\<not> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> l')\<close>
[PROOF STATE]
proof (state)
this:
\<nexists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> l'

goal (1 subgoal):
 1. \<nexists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> l' \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
define m where \<open>m \<equiv> 0::nat\<close>
[PROOF STATE]
proof (state)
this:
m \<equiv> 0

goal (1 subgoal):
 1. \<nexists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> l' \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
define m' where \<open>m' \<equiv> 0::nat\<close>
[PROOF STATE]
proof (state)
this:
m' \<equiv> 0

goal (1 subgoal):
 1. \<nexists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> l' \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
have csm: \<open>cs\<^bsup>\<pi>\<^esup> m = cs\<^bsup>\<pi>'\<^esup> m'\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cs\<^bsup>\<pi>\<^esup> m = cs\<^bsup>\<pi>'\<^esup> m'
[PROOF STEP]
unfolding m_def m'_def cs_0
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [\<pi> 0] = [\<pi>' 0]
[PROOF STEP]
by (metis \<pi>0)
[PROOF STATE]
proof (state)
this:
cs\<^bsup>\<pi>\<^esup> m = cs\<^bsup>\<pi>'\<^esup> m'

goal (1 subgoal):
 1. \<nexists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> l' \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
have ml: \<open>m<l \<or> m'<l'\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. m < l \<or> m' < l'
[PROOF STEP]
using csm csl
[PROOF STATE]
proof (prove)
using this:
cs\<^bsup>\<pi>\<^esup> m = cs\<^bsup>\<pi>'\<^esup> m'
cs\<^bsup>\<pi>\<^esup> l \<noteq> cs\<^bsup>\<pi>'\<^esup> l'

goal (1 subgoal):
 1. m < l \<or> m' < l'
[PROOF STEP]
unfolding m_def m'_def
[PROOF STATE]
proof (prove)
using this:
cs\<^bsup>\<pi>\<^esup> 0 = cs\<^bsup>\<pi>'\<^esup> 0
cs\<^bsup>\<pi>\<^esup> l \<noteq> cs\<^bsup>\<pi>'\<^esup> l'

goal (1 subgoal):
 1. 0 < l \<or> 0 < l'
[PROOF STEP]
by (metis neq0_conv)
[PROOF STATE]
proof (state)
this:
m < l \<or> m' < l'

goal (1 subgoal):
 1. \<nexists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> l' \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
have \<open>\<exists> n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and>
            (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{(LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i'))..<k'}. v\<notin>writes (\<pi>' j'))
            \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{(LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i))..<k}. v\<notin>writes (\<pi> j)))\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))
[PROOF STEP]
using csm ml
[PROOF STATE]
proof (prove)
using this:
cs\<^bsup>\<pi>\<^esup> m = cs\<^bsup>\<pi>'\<^esup> m'
m < l \<or> m' < l'

goal (1 subgoal):
 1. \<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))
[PROOF STEP]
proof (induction \<open>k+k'-(m+m')\<close> arbitrary: \<open>m\<close> \<open>m'\<close> rule: less_induct)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>m m'. \<lbrakk>\<And>ma m'a. \<lbrakk>k + k' - (ma + m'a) < k + k' - (m + m'); cs\<^bsup>\<pi>\<^esup> ma = cs\<^bsup>\<pi>'\<^esup> m'a; ma < l \<or> m'a < l'\<rbrakk> \<Longrightarrow> \<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j))); cs\<^bsup>\<pi>\<^esup> m = cs\<^bsup>\<pi>'\<^esup> m'; m < l \<or> m' < l'\<rbrakk> \<Longrightarrow> \<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))
[PROOF STEP]
case (less m m')
[PROOF STATE]
proof (state)
this:
\<lbrakk>k + k' - (?m1 + ?m'1) < k + k' - (m + m'); cs\<^bsup>\<pi>\<^esup> ?m1 = cs\<^bsup>\<pi>'\<^esup> ?m'1; ?m1 < l \<or> ?m'1 < l'\<rbrakk> \<Longrightarrow> \<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))
cs\<^bsup>\<pi>\<^esup> m = cs\<^bsup>\<pi>'\<^esup> m'
m < l \<or> m' < l'

goal (1 subgoal):
 1. \<And>m m'. \<lbrakk>\<And>ma m'a. \<lbrakk>k + k' - (ma + m'a) < k + k' - (m + m'); cs\<^bsup>\<pi>\<^esup> ma = cs\<^bsup>\<pi>'\<^esup> m'a; ma < l \<or> m'a < l'\<rbrakk> \<Longrightarrow> \<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j))); cs\<^bsup>\<pi>\<^esup> m = cs\<^bsup>\<pi>'\<^esup> m'; m < l \<or> m' < l'\<rbrakk> \<Longrightarrow> \<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))
[PROOF STEP]
note csm = \<open>cs\<^bsup>\<pi>\<^esup> m = cs\<^bsup>\<pi>'\<^esup> m'\<close>
[PROOF STATE]
proof (state)
this:
cs\<^bsup>\<pi>\<^esup> m = cs\<^bsup>\<pi>'\<^esup> m'

goal (1 subgoal):
 1. \<And>m m'. \<lbrakk>\<And>ma m'a. \<lbrakk>k + k' - (ma + m'a) < k + k' - (m + m'); cs\<^bsup>\<pi>\<^esup> ma = cs\<^bsup>\<pi>'\<^esup> m'a; ma < l \<or> m'a < l'\<rbrakk> \<Longrightarrow> \<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j))); cs\<^bsup>\<pi>\<^esup> m = cs\<^bsup>\<pi>'\<^esup> m'; m < l \<or> m' < l'\<rbrakk> \<Longrightarrow> \<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))
[PROOF STEP]
note lm = \<open>m < l \<or> m' < l'\<close>
[PROOF STATE]
proof (state)
this:
m < l \<or> m' < l'

goal (1 subgoal):
 1. \<And>m m'. \<lbrakk>\<And>ma m'a. \<lbrakk>k + k' - (ma + m'a) < k + k' - (m + m'); cs\<^bsup>\<pi>\<^esup> ma = cs\<^bsup>\<pi>'\<^esup> m'a; ma < l \<or> m'a < l'\<rbrakk> \<Longrightarrow> \<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j))); cs\<^bsup>\<pi>\<^esup> m = cs\<^bsup>\<pi>'\<^esup> m'; m < l \<or> m' < l'\<rbrakk> \<Longrightarrow> \<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))
[PROOF STEP]
note IH = \<open>\<And> n n'.
                k + k' - (n + n') < k + k' - (m + m') \<Longrightarrow>
                cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<Longrightarrow>
                n < l \<or> n' < l' \<Longrightarrow> ?thesis\<close>
[PROOF STATE]
proof (state)
this:
\<lbrakk>k + k' - (?n + ?n') < k + k' - (m + m'); cs\<^bsup>\<pi>\<^esup> ?n = cs\<^bsup>\<pi>'\<^esup> ?n'; ?n < l \<or> ?n' < l'\<rbrakk> \<Longrightarrow> \<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))

goal (1 subgoal):
 1. \<And>m m'. \<lbrakk>\<And>ma m'a. \<lbrakk>k + k' - (ma + m'a) < k + k' - (m + m'); cs\<^bsup>\<pi>\<^esup> ma = cs\<^bsup>\<pi>'\<^esup> m'a; ma < l \<or> m'a < l'\<rbrakk> \<Longrightarrow> \<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j))); cs\<^bsup>\<pi>\<^esup> m = cs\<^bsup>\<pi>'\<^esup> m'; m < l \<or> m' < l'\<rbrakk> \<Longrightarrow> \<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))
[PROOF STEP]
show \<open>?thesis\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))
[PROOF STEP]
using lm
[PROOF STATE]
proof (prove)
using this:
m < l \<or> m' < l'

goal (1 subgoal):
 1. \<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. m < l \<Longrightarrow> \<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))
 2. m' < l' \<Longrightarrow> \<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))
[PROOF STEP]
assume ml: \<open>m < l\<close>
[PROOF STATE]
proof (state)
this:
m < l

goal (2 subgoals):
 1. m < l \<Longrightarrow> \<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))
 2. m' < l' \<Longrightarrow> \<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))
[PROOF STEP]
obtain n n' where mn: \<open>m \<le> n\<close> and csn: \<open> cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n'\<close> and lcdn: \<open>l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n\<close> and suc: \<open>\<pi> (Suc n) \<noteq> \<pi>' (Suc n')\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>n n'. \<lbrakk>m \<le> n; cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n'; l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n; \<pi> (Suc n) \<noteq> \<pi>' (Suc n')\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using  converged_cd_diverge_cs[OF ip csm ml lnotin\<pi>' lk cseq[symmetric]]
[PROOF STATE]
proof (prove)
using this:
(\<And>k k'. \<lbrakk>m \<le> k; cs\<^bsup>\<pi>\<^esup> k = cs\<^bsup>\<pi>'\<^esup> k'; l cd\<^bsup>\<pi>\<^esup>\<rightarrow> k; \<pi> (Suc k) \<noteq> \<pi>' (Suc k')\<rbrakk> \<Longrightarrow> ?thesis) \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. (\<And>n n'. \<lbrakk>m \<le> n; cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n'; l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n; \<pi> (Suc n) \<noteq> \<pi>' (Suc n')\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
m \<le> n
cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n'
l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n
\<pi> (Suc n) \<noteq> \<pi>' (Suc n')

goal (2 subgoals):
 1. m < l \<Longrightarrow> \<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))
 2. m' < l' \<Longrightarrow> \<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))
[PROOF STEP]
have nl: \<open>n < l\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n < l
[PROOF STEP]
using lcdn is_cdi_def
[PROOF STATE]
proof (prove)
using this:
l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n
(?i cd\<^bsup>?\<pi>\<^esup>\<rightarrow> ?k) = (is_path ?\<pi> \<and> ?k < ?i \<and> ?\<pi> ?i \<noteq> local.return \<and> (\<forall>j\<in>{?k..?i}. ?\<pi> j \<noteq> ipd (?\<pi> ?k)))

goal (1 subgoal):
 1. n < l
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
n < l

goal (2 subgoals):
 1. m < l \<Longrightarrow> \<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))
 2. m' < l' \<Longrightarrow> \<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))
[PROOF STEP]
hence nk: \<open>n<k\<close>
[PROOF STATE]
proof (prove)
using this:
n < l

goal (1 subgoal):
 1. n < k
[PROOF STEP]
using lk
[PROOF STATE]
proof (prove)
using this:
n < l
l < k

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

goal (2 subgoals):
 1. m < l \<Longrightarrow> \<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))
 2. m' < l' \<Longrightarrow> \<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))
[PROOF STEP]
have nretn: \<open>\<pi> n \<noteq> return\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<pi> n \<noteq> local.return
[PROOF STEP]
using lcdn
[PROOF STATE]
proof (prove)
using this:
l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n

goal (1 subgoal):
 1. \<pi> n \<noteq> local.return
[PROOF STEP]
by (metis cd_not_ret)
[PROOF STATE]
proof (state)
this:
\<pi> n \<noteq> local.return

goal (2 subgoals):
 1. m < l \<Longrightarrow> \<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))
 2. m' < l' \<Longrightarrow> \<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))
[PROOF STEP]
have nk': \<open>n'<k'\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n' < k'
[PROOF STEP]
using cs_order[OF ip csn cseq[symmetric] nretn nk]
[PROOF STATE]
proof (prove)
using this:
n' < k'

goal (1 subgoal):
 1. n' < k'
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
n' < k'

goal (2 subgoals):
 1. m < l \<Longrightarrow> \<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))
 2. m' < l' \<Longrightarrow> \<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))
[PROOF STEP]
show \<open>?thesis\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))
[PROOF STEP]
proof cases
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. ?P \<Longrightarrow> \<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))
 2. \<not> ?P \<Longrightarrow> \<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))
[PROOF STEP]
assume \<open>\<forall>j'\<in>{(LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i'))..<k'}. v\<notin>writes (\<pi>' j')\<close>
[PROOF STATE]
proof (state)
this:
\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')

goal (2 subgoals):
 1. ?P \<Longrightarrow> \<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))
 2. \<not> ?P \<Longrightarrow> \<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))
[PROOF STEP]
thus \<open>?thesis\<close>
[PROOF STATE]
proof (prove)
using this:
\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')

goal (1 subgoal):
 1. \<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))
[PROOF STEP]
using lcdn csn suc
[PROOF STATE]
proof (prove)
using this:
\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')
l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n
cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n'
\<pi> (Suc n) \<noteq> \<pi>' (Suc n')

goal (1 subgoal):
 1. \<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))

goal (1 subgoal):
 1. \<not> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<Longrightarrow> \<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<Longrightarrow> \<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))
[PROOF STEP]
assume \<open>\<not>(\<forall>j'\<in>{(LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i'))..<k'}. v\<notin>writes (\<pi>' j'))\<close>
[PROOF STATE]
proof (state)
this:
\<not> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j'))

goal (1 subgoal):
 1. \<not> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<Longrightarrow> \<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j'))
[PROOF STEP]
obtain j' where jin': \<open>j'\<in>{(LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i'))..<k'}\<close> and vwrite: \<open>v\<in>writes (\<pi>' j')\<close>
[PROOF STATE]
proof (prove)
using this:
\<not> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j'))

goal (1 subgoal):
 1. (\<And>j'. \<lbrakk>j' \<in> {LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}; v \<in> local.writes (\<pi>' j')\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
j' \<in> {LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}
v \<in> local.writes (\<pi>' j')

goal (1 subgoal):
 1. \<not> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<Longrightarrow> \<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))
[PROOF STEP]
define i' where \<open>i' \<equiv> LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')\<close>
[PROOF STATE]
proof (state)
this:
i' \<equiv> LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')

goal (1 subgoal):
 1. \<not> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<Longrightarrow> \<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))
[PROOF STEP]
have Pk': \<open>n' < k' \<and> (\<exists> k. cs\<^bsup>\<pi>\<^esup> k = cs\<^bsup>\<pi>'\<^esup> k')\<close> (is \<open>?P k'\<close>)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n' < k' \<and> (\<exists>k. cs\<^bsup>\<pi>\<^esup> k = cs\<^bsup>\<pi>'\<^esup> k')
[PROOF STEP]
using nk' cseq[symmetric]
[PROOF STATE]
proof (prove)
using this:
n' < k'
cs\<^bsup>\<pi>\<^esup> k = cs\<^bsup>\<pi>'\<^esup> k'

goal (1 subgoal):
 1. n' < k' \<and> (\<exists>k. cs\<^bsup>\<pi>\<^esup> k = cs\<^bsup>\<pi>'\<^esup> k')
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
n' < k' \<and> (\<exists>k. cs\<^bsup>\<pi>\<^esup> k = cs\<^bsup>\<pi>'\<^esup> k')

goal (1 subgoal):
 1. \<not> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<Longrightarrow> \<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))
[PROOF STEP]
have ni': \<open>n' < i'\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n' < i'
[PROOF STEP]
using LeastI[of \<open>?P\<close>, OF Pk'] i'_def
[PROOF STATE]
proof (prove)
using this:
n' < (LEAST x. n' < x \<and> (\<exists>k. cs\<^bsup>\<pi>\<^esup> k = cs\<^bsup>\<pi>'\<^esup> x)) \<and> (\<exists>k. cs\<^bsup>\<pi>\<^esup> k = cs\<^bsup>\<pi>'\<^esup> (LEAST x. n' < x \<and> (\<exists>k. cs\<^bsup>\<pi>\<^esup> k = cs\<^bsup>\<pi>'\<^esup> x)))
i' \<equiv> LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')

goal (1 subgoal):
 1. n' < i'
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
n' < i'

goal (1 subgoal):
 1. \<not> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<Longrightarrow> \<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))
[PROOF STEP]
obtain i where csi: \<open>cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i'\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i' \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using LeastI[of \<open>?P\<close>, OF Pk'] i'_def
[PROOF STATE]
proof (prove)
using this:
n' < (LEAST x. n' < x \<and> (\<exists>k. cs\<^bsup>\<pi>\<^esup> k = cs\<^bsup>\<pi>'\<^esup> x)) \<and> (\<exists>k. cs\<^bsup>\<pi>\<^esup> k = cs\<^bsup>\<pi>'\<^esup> (LEAST x. n' < x \<and> (\<exists>k. cs\<^bsup>\<pi>\<^esup> k = cs\<^bsup>\<pi>'\<^esup> x)))
i' \<equiv> LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')

goal (1 subgoal):
 1. (\<And>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i' \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i'

goal (1 subgoal):
 1. \<not> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<Longrightarrow> \<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))
[PROOF STEP]
have ij': \<open>i'\<le>j'\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i' \<le> j'
[PROOF STEP]
using jin'[folded i'_def]
[PROOF STATE]
proof (prove)
using this:
j' \<in> {i'..<k'}

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

goal (1 subgoal):
 1. \<not> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<Longrightarrow> \<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))
[PROOF STEP]
have jk': \<open>j'<k'\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. j' < k'
[PROOF STEP]
using jin'[folded i'_def]
[PROOF STATE]
proof (prove)
using this:
j' \<in> {i'..<k'}

goal (1 subgoal):
 1. j' < k'
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
j' < k'

goal (1 subgoal):
 1. \<not> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<Longrightarrow> \<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))
[PROOF STEP]
have jl': \<open>j' \<le> l'\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. j' \<le> l'
[PROOF STEP]
using kddl' jk' vwrite
[PROOF STATE]
proof (prove)
using this:
k' dd\<^bsup>\<pi>',v\<^esup>\<rightarrow> l'
j' < k'
v \<in> local.writes (\<pi>' j')

goal (1 subgoal):
 1. j' \<le> l'
[PROOF STEP]
unfolding is_ddi_def
[PROOF STATE]
proof (prove)
using this:
is_path \<pi>' \<and> l' < k' \<and> v \<in> local.reads (\<pi>' k') \<inter> local.writes (\<pi>' l') \<and> (\<forall>l\<in>{l'<..<k'}. v \<notin> local.writes (\<pi>' l))
j' < k'
v \<in> local.writes (\<pi>' j')

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

goal (1 subgoal):
 1. \<not> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<Longrightarrow> \<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))
[PROOF STEP]
have nretn': \<open>\<pi>' n' \<noteq> return\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<pi>' n' \<noteq> local.return
[PROOF STEP]
using nretn csn last_cs
[PROOF STATE]
proof (prove)
using this:
\<pi> n \<noteq> local.return
cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n'
last (cs\<^bsup>?\<pi>\<^esup> ?i) = ?\<pi> ?i

goal (1 subgoal):
 1. \<pi>' n' \<noteq> local.return
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
\<pi>' n' \<noteq> local.return

goal (1 subgoal):
 1. \<not> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<Longrightarrow> \<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))
[PROOF STEP]
have iln: \<open>n<i\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n < i
[PROOF STEP]
using cs_order[OF ip(2,1) csn[symmetric] csi[symmetric] nretn' ni']
[PROOF STATE]
proof (prove)
using this:
n < i

goal (1 subgoal):
 1. n < i
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
n < i

goal (1 subgoal):
 1. \<not> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<Longrightarrow> \<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))
[PROOF STEP]
hence mi: \<open>m < i\<close>
[PROOF STATE]
proof (prove)
using this:
n < i

goal (1 subgoal):
 1. m < i
[PROOF STEP]
using mn
[PROOF STATE]
proof (prove)
using this:
n < i
m \<le> n

goal (1 subgoal):
 1. m < i
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
m < i

goal (1 subgoal):
 1. \<not> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<Longrightarrow> \<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))
[PROOF STEP]
have nretm: \<open>\<pi> m \<noteq> return\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<pi> m \<noteq> local.return
[PROOF STEP]
by (metis ip(1) mn nretn term_path_stable)
[PROOF STATE]
proof (state)
this:
\<pi> m \<noteq> local.return

goal (1 subgoal):
 1. \<not> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<Longrightarrow> \<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))
[PROOF STEP]
have mi': \<open>m'<i'\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. m' < i'
[PROOF STEP]
using cs_order[OF ip csm csi nretm mi]
[PROOF STATE]
proof (prove)
using this:
m' < i'

goal (1 subgoal):
 1. m' < i'
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
m' < i'

goal (1 subgoal):
 1. \<not> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<Longrightarrow> \<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))
[PROOF STEP]
have ik': \<open>i' < k'\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i' < k'
[PROOF STEP]
using ij' jk'
[PROOF STATE]
proof (prove)
using this:
i' \<le> j'
j' < k'

goal (1 subgoal):
 1. i' < k'
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
i' < k'

goal (1 subgoal):
 1. \<not> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<Longrightarrow> \<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))
[PROOF STEP]
have nreti': \<open>\<pi>' i' \<noteq> return\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<pi>' i' \<noteq> local.return
[PROOF STEP]
by (metis ij' jl' nretl' ip(2) term_path_stable)
[PROOF STATE]
proof (state)
this:
\<pi>' i' \<noteq> local.return

goal (1 subgoal):
 1. \<not> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<Longrightarrow> \<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))
[PROOF STEP]
have ik: \<open>i < k\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i < k
[PROOF STEP]
using cs_order[OF ip(2,1) csi[symmetric] cseq nreti' ik']
[PROOF STATE]
proof (prove)
using this:
i < k

goal (1 subgoal):
 1. i < k
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
i < k

goal (1 subgoal):
 1. \<not> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<Longrightarrow> \<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))
[PROOF STEP]
show \<open>?thesis\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))
[PROOF STEP]
proof cases
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. ?P \<Longrightarrow> \<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))
 2. \<not> ?P \<Longrightarrow> \<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))
[PROOF STEP]
assume il:\<open>i < l\<close>
[PROOF STATE]
proof (state)
this:
i < l

goal (2 subgoals):
 1. ?P \<Longrightarrow> \<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))
 2. \<not> ?P \<Longrightarrow> \<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))
[PROOF STEP]
have le: \<open>k + k' - (i +i') < k+k' - (m+m')\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. k + k' - (i + i') < k + k' - (m + m')
[PROOF STEP]
using mi mi' ik ik'
[PROOF STATE]
proof (prove)
using this:
m < i
m' < i'
i < k
i' < k'

goal (1 subgoal):
 1. k + k' - (i + i') < k + k' - (m + m')
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
k + k' - (i + i') < k + k' - (m + m')

goal (2 subgoals):
 1. ?P \<Longrightarrow> \<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))
 2. \<not> ?P \<Longrightarrow> \<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))
[PROOF STEP]
show \<open>?thesis\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))
[PROOF STEP]
using IH[OF le]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i'; i < l \<or> i' < l'\<rbrakk> \<Longrightarrow> \<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))

goal (1 subgoal):
 1. \<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))
[PROOF STEP]
using csi il
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i'; i < l \<or> i' < l'\<rbrakk> \<Longrightarrow> \<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))
cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i'
i < l

goal (1 subgoal):
 1. \<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))

goal (1 subgoal):
 1. \<not> i < l \<Longrightarrow> \<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> i < l \<Longrightarrow> \<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))
[PROOF STEP]
assume \<open>\<not> i < l\<close>
[PROOF STATE]
proof (state)
this:
\<not> i < l

goal (1 subgoal):
 1. \<not> i < l \<Longrightarrow> \<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))
[PROOF STEP]
hence li: \<open>l \<le> i\<close>
[PROOF STATE]
proof (prove)
using this:
\<not> i < l

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

goal (1 subgoal):
 1. \<not> i < l \<Longrightarrow> \<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))
[PROOF STEP]
have \<open>i' \<le> l'\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i' \<le> l'
[PROOF STEP]
using ij' jl'
[PROOF STATE]
proof (prove)
using this:
i' \<le> j'
j' \<le> l'

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

goal (1 subgoal):
 1. \<not> i < l \<Longrightarrow> \<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))
[PROOF STEP]
hence il': \<open>i' < l'\<close>
[PROOF STATE]
proof (prove)
using this:
i' \<le> l'

goal (1 subgoal):
 1. i' < l'
[PROOF STEP]
using  csi l'notin\<pi>
[PROOF STATE]
proof (prove)
using this:
i' \<le> l'
cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i'
\<nexists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> l'

goal (1 subgoal):
 1. i' < l'
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
i' < l'

goal (1 subgoal):
 1. \<not> i < l \<Longrightarrow> \<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))
[PROOF STEP]
obtain n n' where in': \<open>i' \<le> n'\<close> and csn: \<open> cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n'\<close> and lcdn': \<open>l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n'\<close> and suc: \<open>\<pi> (Suc n) \<noteq> \<pi>' (Suc n')\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>n' n. \<lbrakk>i' \<le> n'; cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n'; l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n'; \<pi> (Suc n) \<noteq> \<pi>' (Suc n')\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using  converged_cd_diverge_cs[OF ip(2,1) csi[symmetric] il' _ lk' cseq] l'notin\<pi>
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<nexists>l'a. cs\<^bsup>\<pi>'\<^esup> l' = cs\<^bsup>\<pi>\<^esup> l'a; \<And>k k'. \<lbrakk>i' \<le> k; cs\<^bsup>\<pi>'\<^esup> k = cs\<^bsup>\<pi>\<^esup> k'; l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> k; \<pi>' (Suc k) \<noteq> \<pi> (Suc k')\<rbrakk> \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis
\<nexists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> l'

goal (1 subgoal):
 1. (\<And>n' n. \<lbrakk>i' \<le> n'; cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n'; l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n'; \<pi> (Suc n) \<noteq> \<pi>' (Suc n')\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
i' \<le> n'
cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n'
l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n'
\<pi> (Suc n) \<noteq> \<pi>' (Suc n')

goal (1 subgoal):
 1. \<not> i < l \<Longrightarrow> \<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))
[PROOF STEP]
have nk': \<open>n' < k'\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n' < k'
[PROOF STEP]
using lcdn' is_cdi_def lk'
[PROOF STATE]
proof (prove)
using this:
l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n'
(?i cd\<^bsup>?\<pi>\<^esup>\<rightarrow> ?k) = (is_path ?\<pi> \<and> ?k < ?i \<and> ?\<pi> ?i \<noteq> local.return \<and> (\<forall>j\<in>{?k..?i}. ?\<pi> j \<noteq> ipd (?\<pi> ?k)))
l' < k'

goal (1 subgoal):
 1. n' < k'
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
n' < k'

goal (1 subgoal):
 1. \<not> i < l \<Longrightarrow> \<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))
[PROOF STEP]
have nretn': \<open>\<pi>' n' \<noteq> return\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<pi>' n' \<noteq> local.return
[PROOF STEP]
by (metis cd_not_ret lcdn')
[PROOF STATE]
proof (state)
this:
\<pi>' n' \<noteq> local.return

goal (1 subgoal):
 1. \<not> i < l \<Longrightarrow> \<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))
[PROOF STEP]
have nk: \<open>n < k\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n < k
[PROOF STEP]
using cs_order[OF ip(2,1) csn[symmetric] cseq nretn' nk']
[PROOF STATE]
proof (prove)
using this:
n < k

goal (1 subgoal):
 1. n < k
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
n < k

goal (1 subgoal):
 1. \<not> i < l \<Longrightarrow> \<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))
[PROOF STEP]
define j where \<open>j \<equiv> LEAST j. n < j \<and> (\<exists>j'. cs\<^bsup>\<pi>'\<^esup> j' = cs\<^bsup>\<pi>\<^esup> j)\<close>
[PROOF STATE]
proof (state)
this:
j \<equiv> LEAST j. n < j \<and> (\<exists>j'. cs\<^bsup>\<pi>'\<^esup> j' = cs\<^bsup>\<pi>\<^esup> j)

goal (1 subgoal):
 1. \<not> i < l \<Longrightarrow> \<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))
[PROOF STEP]
have Pk: \<open>n < k \<and> (\<exists>j'. cs\<^bsup>\<pi>'\<^esup> j' = cs\<^bsup>\<pi>\<^esup> k)\<close> (is \<open>?P k\<close>)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n < k \<and> (\<exists>j'. cs\<^bsup>\<pi>'\<^esup> j' = cs\<^bsup>\<pi>\<^esup> k)
[PROOF STEP]
using nk cseq
[PROOF STATE]
proof (prove)
using this:
n < k
cs\<^bsup>\<pi>'\<^esup> k' = cs\<^bsup>\<pi>\<^esup> k

goal (1 subgoal):
 1. n < k \<and> (\<exists>j'. cs\<^bsup>\<pi>'\<^esup> j' = cs\<^bsup>\<pi>\<^esup> k)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
n < k \<and> (\<exists>j'. cs\<^bsup>\<pi>'\<^esup> j' = cs\<^bsup>\<pi>\<^esup> k)

goal (1 subgoal):
 1. \<not> i < l \<Longrightarrow> \<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))
[PROOF STEP]
have nj: \<open>n<j\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n < j
[PROOF STEP]
using LeastI[of \<open>?P\<close>, OF Pk] j_def
[PROOF STATE]
proof (prove)
using this:
n < (LEAST x. n < x \<and> (\<exists>j'. cs\<^bsup>\<pi>'\<^esup> j' = cs\<^bsup>\<pi>\<^esup> x)) \<and> (\<exists>j'. cs\<^bsup>\<pi>'\<^esup> j' = cs\<^bsup>\<pi>\<^esup> (LEAST x. n < x \<and> (\<exists>j'. cs\<^bsup>\<pi>'\<^esup> j' = cs\<^bsup>\<pi>\<^esup> x)))
j \<equiv> LEAST j. n < j \<and> (\<exists>j'. cs\<^bsup>\<pi>'\<^esup> j' = cs\<^bsup>\<pi>\<^esup> j)

goal (1 subgoal):
 1. n < j
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
n < j

goal (1 subgoal):
 1. \<not> i < l \<Longrightarrow> \<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))
[PROOF STEP]
have ilen: \<open>i \<le> n\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i \<le> n
[PROOF STEP]
using cs_order_le[OF ip(2,1) csi[symmetric] csn[symmetric] nreti' in']
[PROOF STATE]
proof (prove)
using this:
i \<le> n

goal (1 subgoal):
 1. i \<le> n
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
i \<le> n

goal (1 subgoal):
 1. \<not> i < l \<Longrightarrow> \<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))
[PROOF STEP]
hence lj: \<open>l<j\<close>
[PROOF STATE]
proof (prove)
using this:
i \<le> n

goal (1 subgoal):
 1. l < j
[PROOF STEP]
using li nj
[PROOF STATE]
proof (prove)
using this:
i \<le> n
l \<le> i
n < j

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

goal (1 subgoal):
 1. \<not> i < l \<Longrightarrow> \<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))
[PROOF STEP]
have \<open>\<forall>l\<in>{l<..<k}. v \<notin> writes (\<pi> l)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>l\<in>{l<..<k}. v \<notin> local.writes (\<pi> l)
[PROOF STEP]
using  kddl
[PROOF STATE]
proof (prove)
using this:
k dd\<^bsup>\<pi>,v\<^esup>\<rightarrow> l

goal (1 subgoal):
 1. \<forall>l\<in>{l<..<k}. v \<notin> local.writes (\<pi> l)
[PROOF STEP]
unfolding is_ddi_def
[PROOF STATE]
proof (prove)
using this:
is_path \<pi> \<and> l < k \<and> v \<in> local.reads (\<pi> k) \<inter> local.writes (\<pi> l) \<and> (\<forall>l\<in>{l<..<k}. v \<notin> local.writes (\<pi> l))

goal (1 subgoal):
 1. \<forall>l\<in>{l<..<k}. v \<notin> local.writes (\<pi> l)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<forall>l\<in>{l<..<k}. v \<notin> local.writes (\<pi> l)

goal (1 subgoal):
 1. \<not> i < l \<Longrightarrow> \<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))
[PROOF STEP]
hence nw: \<open>\<forall>l\<in>{j..<k}. v \<notin> writes (\<pi> l)\<close>
[PROOF STATE]
proof (prove)
using this:
\<forall>l\<in>{l<..<k}. v \<notin> local.writes (\<pi> l)

goal (1 subgoal):
 1. \<forall>l\<in>{j..<k}. v \<notin> local.writes (\<pi> l)
[PROOF STEP]
using lj
[PROOF STATE]
proof (prove)
using this:
\<forall>l\<in>{l<..<k}. v \<notin> local.writes (\<pi> l)
l < j

goal (1 subgoal):
 1. \<forall>l\<in>{j..<k}. v \<notin> local.writes (\<pi> l)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>l\<in>{j..<k}. v \<notin> local.writes (\<pi> l)

goal (1 subgoal):
 1. \<not> i < l \<Longrightarrow> \<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))
[PROOF STEP]
show \<open>?thesis\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))
[PROOF STEP]
using csn lcdn' suc nw[unfolded j_def]
[PROOF STATE]
proof (prove)
using this:
cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n'
l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n'
\<pi> (Suc n) \<noteq> \<pi>' (Suc n')
\<forall>l\<in>{LEAST j. n < j \<and> (\<exists>j'. cs\<^bsup>\<pi>'\<^esup> j' = cs\<^bsup>\<pi>\<^esup> j)..<k}. v \<notin> local.writes (\<pi> l)

goal (1 subgoal):
 1. \<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))

goal (1 subgoal):
 1. m' < l' \<Longrightarrow> \<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. m' < l' \<Longrightarrow> \<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))
[PROOF STEP]
assume ml': \<open>m' < l'\<close>
[PROOF STATE]
proof (state)
this:
m' < l'

goal (1 subgoal):
 1. m' < l' \<Longrightarrow> \<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))
[PROOF STEP]
obtain n n' where mn': \<open>m' \<le> n'\<close> and csn: \<open> cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n'\<close> and lcdn': \<open>l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n'\<close> and suc: \<open>\<pi> (Suc n) \<noteq> \<pi>' (Suc n')\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>n' n. \<lbrakk>m' \<le> n'; cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n'; l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n'; \<pi> (Suc n) \<noteq> \<pi>' (Suc n')\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using  converged_cd_diverge_cs[OF ip(2,1) csm[symmetric] ml' _ lk' cseq] l'notin\<pi>
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<nexists>l'a. cs\<^bsup>\<pi>'\<^esup> l' = cs\<^bsup>\<pi>\<^esup> l'a; \<And>k k'. \<lbrakk>m' \<le> k; cs\<^bsup>\<pi>'\<^esup> k = cs\<^bsup>\<pi>\<^esup> k'; l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> k; \<pi>' (Suc k) \<noteq> \<pi> (Suc k')\<rbrakk> \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis
\<nexists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> l'

goal (1 subgoal):
 1. (\<And>n' n. \<lbrakk>m' \<le> n'; cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n'; l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n'; \<pi> (Suc n) \<noteq> \<pi>' (Suc n')\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
m' \<le> n'
cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n'
l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n'
\<pi> (Suc n) \<noteq> \<pi>' (Suc n')

goal (1 subgoal):
 1. m' < l' \<Longrightarrow> \<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))
[PROOF STEP]
have nl': \<open>n' < l'\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n' < l'
[PROOF STEP]
using lcdn' is_cdi_def
[PROOF STATE]
proof (prove)
using this:
l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n'
(?i cd\<^bsup>?\<pi>\<^esup>\<rightarrow> ?k) = (is_path ?\<pi> \<and> ?k < ?i \<and> ?\<pi> ?i \<noteq> local.return \<and> (\<forall>j\<in>{?k..?i}. ?\<pi> j \<noteq> ipd (?\<pi> ?k)))

goal (1 subgoal):
 1. n' < l'
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
n' < l'

goal (1 subgoal):
 1. m' < l' \<Longrightarrow> \<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))
[PROOF STEP]
hence nk': \<open>n'<k'\<close>
[PROOF STATE]
proof (prove)
using this:
n' < l'

goal (1 subgoal):
 1. n' < k'
[PROOF STEP]
using lk'
[PROOF STATE]
proof (prove)
using this:
n' < l'
l' < k'

goal (1 subgoal):
 1. n' < k'
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
n' < k'

goal (1 subgoal):
 1. m' < l' \<Longrightarrow> \<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))
[PROOF STEP]
have nretn': \<open>\<pi>' n' \<noteq> return\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<pi>' n' \<noteq> local.return
[PROOF STEP]
using lcdn'
[PROOF STATE]
proof (prove)
using this:
l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n'

goal (1 subgoal):
 1. \<pi>' n' \<noteq> local.return
[PROOF STEP]
by (metis cd_not_ret)
[PROOF STATE]
proof (state)
this:
\<pi>' n' \<noteq> local.return

goal (1 subgoal):
 1. m' < l' \<Longrightarrow> \<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))
[PROOF STEP]
have nk: \<open>n<k\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n < k
[PROOF STEP]
using cs_order[OF ip(2,1) csn[symmetric] cseq nretn' nk']
[PROOF STATE]
proof (prove)
using this:
n < k

goal (1 subgoal):
 1. n < k
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
n < k

goal (1 subgoal):
 1. m' < l' \<Longrightarrow> \<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))
[PROOF STEP]
show \<open>?thesis\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))
[PROOF STEP]
proof cases
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. ?P \<Longrightarrow> \<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))
 2. \<not> ?P \<Longrightarrow> \<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))
[PROOF STEP]
assume \<open>\<forall>j\<in>{(LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i))..<k}. v\<notin>writes (\<pi> j)\<close>
[PROOF STATE]
proof (state)
this:
\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)

goal (2 subgoals):
 1. ?P \<Longrightarrow> \<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))
 2. \<not> ?P \<Longrightarrow> \<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))
[PROOF STEP]
thus \<open>?thesis\<close>
[PROOF STATE]
proof (prove)
using this:
\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)

goal (1 subgoal):
 1. \<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))
[PROOF STEP]
using lcdn' csn suc
[PROOF STATE]
proof (prove)
using this:
\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)
l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n'
cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n'
\<pi> (Suc n) \<noteq> \<pi>' (Suc n')

goal (1 subgoal):
 1. \<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))

goal (1 subgoal):
 1. \<not> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)) \<Longrightarrow> \<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)) \<Longrightarrow> \<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))
[PROOF STEP]
assume \<open>\<not>(\<forall>j\<in>{(LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i))..<k}. v\<notin>writes (\<pi> j))\<close>
[PROOF STATE]
proof (state)
this:
\<not> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j))

goal (1 subgoal):
 1. \<not> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)) \<Longrightarrow> \<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j))
[PROOF STEP]
obtain j where jin: \<open>j\<in>{(LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i))..<k}\<close> and vwrite: \<open>v\<in>writes (\<pi> j)\<close>
[PROOF STATE]
proof (prove)
using this:
\<not> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j))

goal (1 subgoal):
 1. (\<And>j. \<lbrakk>j \<in> {LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}; v \<in> local.writes (\<pi> j)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
j \<in> {LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}
v \<in> local.writes (\<pi> j)

goal (1 subgoal):
 1. \<not> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)) \<Longrightarrow> \<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))
[PROOF STEP]
define i where \<open>i \<equiv> LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)\<close>
[PROOF STATE]
proof (state)
this:
i \<equiv> LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)

goal (1 subgoal):
 1. \<not> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)) \<Longrightarrow> \<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))
[PROOF STEP]
have Pk: \<open>n < k \<and> (\<exists> k'. cs\<^bsup>\<pi>'\<^esup> k' = cs\<^bsup>\<pi>\<^esup> k)\<close> (is \<open>?P k\<close>)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n < k \<and> (\<exists>k'. cs\<^bsup>\<pi>'\<^esup> k' = cs\<^bsup>\<pi>\<^esup> k)
[PROOF STEP]
using nk cseq
[PROOF STATE]
proof (prove)
using this:
n < k
cs\<^bsup>\<pi>'\<^esup> k' = cs\<^bsup>\<pi>\<^esup> k

goal (1 subgoal):
 1. n < k \<and> (\<exists>k'. cs\<^bsup>\<pi>'\<^esup> k' = cs\<^bsup>\<pi>\<^esup> k)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
n < k \<and> (\<exists>k'. cs\<^bsup>\<pi>'\<^esup> k' = cs\<^bsup>\<pi>\<^esup> k)

goal (1 subgoal):
 1. \<not> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)) \<Longrightarrow> \<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))
[PROOF STEP]
have ni: \<open>n < i\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n < i
[PROOF STEP]
using LeastI[of \<open>?P\<close>, OF Pk] i_def
[PROOF STATE]
proof (prove)
using this:
n < (LEAST x. n < x \<and> (\<exists>k'. cs\<^bsup>\<pi>'\<^esup> k' = cs\<^bsup>\<pi>\<^esup> x)) \<and> (\<exists>k'. cs\<^bsup>\<pi>'\<^esup> k' = cs\<^bsup>\<pi>\<^esup> (LEAST x. n < x \<and> (\<exists>k'. cs\<^bsup>\<pi>'\<^esup> k' = cs\<^bsup>\<pi>\<^esup> x)))
i \<equiv> LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)

goal (1 subgoal):
 1. n < i
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
n < i

goal (1 subgoal):
 1. \<not> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)) \<Longrightarrow> \<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))
[PROOF STEP]
obtain i' where csi: \<open>cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i'\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>i'. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i' \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using LeastI[of \<open>?P\<close>, OF Pk] i_def
[PROOF STATE]
proof (prove)
using this:
n < (LEAST x. n < x \<and> (\<exists>k'. cs\<^bsup>\<pi>'\<^esup> k' = cs\<^bsup>\<pi>\<^esup> x)) \<and> (\<exists>k'. cs\<^bsup>\<pi>'\<^esup> k' = cs\<^bsup>\<pi>\<^esup> (LEAST x. n < x \<and> (\<exists>k'. cs\<^bsup>\<pi>'\<^esup> k' = cs\<^bsup>\<pi>\<^esup> x)))
i \<equiv> LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)

goal (1 subgoal):
 1. (\<And>i'. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i' \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i'

goal (1 subgoal):
 1. \<not> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)) \<Longrightarrow> \<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))
[PROOF STEP]
have ij: \<open>i\<le>j\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i \<le> j
[PROOF STEP]
using jin[folded i_def]
[PROOF STATE]
proof (prove)
using this:
j \<in> {i..<k}

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

goal (1 subgoal):
 1. \<not> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)) \<Longrightarrow> \<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))
[PROOF STEP]
have jk: \<open>j<k\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. j < k
[PROOF STEP]
using jin[folded i_def]
[PROOF STATE]
proof (prove)
using this:
j \<in> {i..<k}

goal (1 subgoal):
 1. j < k
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
j < k

goal (1 subgoal):
 1. \<not> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)) \<Longrightarrow> \<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))
[PROOF STEP]
have jl: \<open>j \<le> l\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. j \<le> l
[PROOF STEP]
using kddl jk vwrite
[PROOF STATE]
proof (prove)
using this:
k dd\<^bsup>\<pi>,v\<^esup>\<rightarrow> l
j < k
v \<in> local.writes (\<pi> j)

goal (1 subgoal):
 1. j \<le> l
[PROOF STEP]
unfolding is_ddi_def
[PROOF STATE]
proof (prove)
using this:
is_path \<pi> \<and> l < k \<and> v \<in> local.reads (\<pi> k) \<inter> local.writes (\<pi> l) \<and> (\<forall>l\<in>{l<..<k}. v \<notin> local.writes (\<pi> l))
j < k
v \<in> local.writes (\<pi> j)

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

goal (1 subgoal):
 1. \<not> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)) \<Longrightarrow> \<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))
[PROOF STEP]
have nretn: \<open>\<pi> n \<noteq> return\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<pi> n \<noteq> local.return
[PROOF STEP]
using nretn' csn last_cs
[PROOF STATE]
proof (prove)
using this:
\<pi>' n' \<noteq> local.return
cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n'
last (cs\<^bsup>?\<pi>\<^esup> ?i) = ?\<pi> ?i

goal (1 subgoal):
 1. \<pi> n \<noteq> local.return
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
\<pi> n \<noteq> local.return

goal (1 subgoal):
 1. \<not> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)) \<Longrightarrow> \<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))
[PROOF STEP]
have iln': \<open>n'<i'\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n' < i'
[PROOF STEP]
using cs_order[OF ip csn csi nretn ni]
[PROOF STATE]
proof (prove)
using this:
n' < i'

goal (1 subgoal):
 1. n' < i'
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
n' < i'

goal (1 subgoal):
 1. \<not> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)) \<Longrightarrow> \<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))
[PROOF STEP]
hence mi': \<open>m' < i'\<close>
[PROOF STATE]
proof (prove)
using this:
n' < i'

goal (1 subgoal):
 1. m' < i'
[PROOF STEP]
using mn'
[PROOF STATE]
proof (prove)
using this:
n' < i'
m' \<le> n'

goal (1 subgoal):
 1. m' < i'
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
m' < i'

goal (1 subgoal):
 1. \<not> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)) \<Longrightarrow> \<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))
[PROOF STEP]
have nretm': \<open>\<pi>' m' \<noteq> return\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<pi>' m' \<noteq> local.return
[PROOF STEP]
by (metis ip(2) mn' nretn' term_path_stable)
[PROOF STATE]
proof (state)
this:
\<pi>' m' \<noteq> local.return

goal (1 subgoal):
 1. \<not> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)) \<Longrightarrow> \<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))
[PROOF STEP]
have mi: \<open>m<i\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. m < i
[PROOF STEP]
using cs_order[OF ip(2,1) csm[symmetric] csi[symmetric] nretm' mi']
[PROOF STATE]
proof (prove)
using this:
m < i

goal (1 subgoal):
 1. m < i
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
m < i

goal (1 subgoal):
 1. \<not> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)) \<Longrightarrow> \<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))
[PROOF STEP]
have ik: \<open>i < k\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i < k
[PROOF STEP]
using ij jk
[PROOF STATE]
proof (prove)
using this:
i \<le> j
j < k

goal (1 subgoal):
 1. i < k
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
i < k

goal (1 subgoal):
 1. \<not> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)) \<Longrightarrow> \<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))
[PROOF STEP]
have nreti: \<open>\<pi> i \<noteq> return\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<pi> i \<noteq> local.return
[PROOF STEP]
by (metis ij ip(1) jl nret term_path_stable)
[PROOF STATE]
proof (state)
this:
\<pi> i \<noteq> local.return

goal (1 subgoal):
 1. \<not> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)) \<Longrightarrow> \<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))
[PROOF STEP]
have ik': \<open>i' < k'\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i' < k'
[PROOF STEP]
using cs_order[OF ip csi cseq[symmetric] nreti ik]
[PROOF STATE]
proof (prove)
using this:
i' < k'

goal (1 subgoal):
 1. i' < k'
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
i' < k'

goal (1 subgoal):
 1. \<not> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)) \<Longrightarrow> \<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))
[PROOF STEP]
show \<open>?thesis\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))
[PROOF STEP]
proof cases
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. ?P \<Longrightarrow> \<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))
 2. \<not> ?P \<Longrightarrow> \<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))
[PROOF STEP]
assume il':\<open>i' < l'\<close>
[PROOF STATE]
proof (state)
this:
i' < l'

goal (2 subgoals):
 1. ?P \<Longrightarrow> \<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))
 2. \<not> ?P \<Longrightarrow> \<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))
[PROOF STEP]
have le: \<open>k + k' - (i +i') < k+k' - (m+m')\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. k + k' - (i + i') < k + k' - (m + m')
[PROOF STEP]
using mi mi' ik ik'
[PROOF STATE]
proof (prove)
using this:
m < i
m' < i'
i < k
i' < k'

goal (1 subgoal):
 1. k + k' - (i + i') < k + k' - (m + m')
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
k + k' - (i + i') < k + k' - (m + m')

goal (2 subgoals):
 1. ?P \<Longrightarrow> \<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))
 2. \<not> ?P \<Longrightarrow> \<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))
[PROOF STEP]
show \<open>?thesis\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))
[PROOF STEP]
using IH[OF le]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i'; i < l \<or> i' < l'\<rbrakk> \<Longrightarrow> \<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))

goal (1 subgoal):
 1. \<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))
[PROOF STEP]
using csi il'
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i'; i < l \<or> i' < l'\<rbrakk> \<Longrightarrow> \<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))
cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i'
i' < l'

goal (1 subgoal):
 1. \<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))

goal (1 subgoal):
 1. \<not> i' < l' \<Longrightarrow> \<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> i' < l' \<Longrightarrow> \<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))
[PROOF STEP]
assume \<open>\<not> i' < l'\<close>
[PROOF STATE]
proof (state)
this:
\<not> i' < l'

goal (1 subgoal):
 1. \<not> i' < l' \<Longrightarrow> \<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))
[PROOF STEP]
hence li': \<open>l' \<le> i'\<close>
[PROOF STATE]
proof (prove)
using this:
\<not> i' < l'

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

goal (1 subgoal):
 1. \<not> i' < l' \<Longrightarrow> \<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))
[PROOF STEP]
have \<open>i \<le> l\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i \<le> l
[PROOF STEP]
using ij jl
[PROOF STATE]
proof (prove)
using this:
i \<le> j
j \<le> l

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

goal (1 subgoal):
 1. \<not> i' < l' \<Longrightarrow> \<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))
[PROOF STEP]
hence il: \<open>i < l\<close>
[PROOF STATE]
proof (prove)
using this:
i \<le> l

goal (1 subgoal):
 1. i < l
[PROOF STEP]
using  csi lnotin\<pi>'
[PROOF STATE]
proof (prove)
using this:
i \<le> l
cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i'
\<nexists>i'. cs\<^bsup>\<pi>\<^esup> l = cs\<^bsup>\<pi>'\<^esup> i'

goal (1 subgoal):
 1. i < l
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
i < l

goal (1 subgoal):
 1. \<not> i' < l' \<Longrightarrow> \<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))
[PROOF STEP]
obtain n n' where ilen: \<open>i \<le> n\<close> and csn: \<open> cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n'\<close> and lcdn: \<open>l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n\<close> and suc: \<open>\<pi> (Suc n) \<noteq> \<pi>' (Suc n')\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>n n'. \<lbrakk>i \<le> n; cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n'; l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n; \<pi> (Suc n) \<noteq> \<pi>' (Suc n')\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using  converged_cd_diverge_cs[OF ip csi il _ lk cseq[symmetric]] lnotin\<pi>'
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<nexists>l'. cs\<^bsup>\<pi>\<^esup> l = cs\<^bsup>\<pi>'\<^esup> l'; \<And>k k'. \<lbrakk>i \<le> k; cs\<^bsup>\<pi>\<^esup> k = cs\<^bsup>\<pi>'\<^esup> k'; l cd\<^bsup>\<pi>\<^esup>\<rightarrow> k; \<pi> (Suc k) \<noteq> \<pi>' (Suc k')\<rbrakk> \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis
\<nexists>i'. cs\<^bsup>\<pi>\<^esup> l = cs\<^bsup>\<pi>'\<^esup> i'

goal (1 subgoal):
 1. (\<And>n n'. \<lbrakk>i \<le> n; cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n'; l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n; \<pi> (Suc n) \<noteq> \<pi>' (Suc n')\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
i \<le> n
cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n'
l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n
\<pi> (Suc n) \<noteq> \<pi>' (Suc n')

goal (1 subgoal):
 1. \<not> i' < l' \<Longrightarrow> \<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))
[PROOF STEP]
have nk: \<open>n < k\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n < k
[PROOF STEP]
using lcdn is_cdi_def lk
[PROOF STATE]
proof (prove)
using this:
l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n
(?i cd\<^bsup>?\<pi>\<^esup>\<rightarrow> ?k) = (is_path ?\<pi> \<and> ?k < ?i \<and> ?\<pi> ?i \<noteq> local.return \<and> (\<forall>j\<in>{?k..?i}. ?\<pi> j \<noteq> ipd (?\<pi> ?k)))
l < k

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

goal (1 subgoal):
 1. \<not> i' < l' \<Longrightarrow> \<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))
[PROOF STEP]
have nretn: \<open>\<pi> n \<noteq> return\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<pi> n \<noteq> local.return
[PROOF STEP]
by (metis cd_not_ret lcdn)
[PROOF STATE]
proof (state)
this:
\<pi> n \<noteq> local.return

goal (1 subgoal):
 1. \<not> i' < l' \<Longrightarrow> \<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))
[PROOF STEP]
have nk': \<open>n' < k'\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n' < k'
[PROOF STEP]
using cs_order[OF ip csn cseq[symmetric] nretn nk]
[PROOF STATE]
proof (prove)
using this:
n' < k'

goal (1 subgoal):
 1. n' < k'
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
n' < k'

goal (1 subgoal):
 1. \<not> i' < l' \<Longrightarrow> \<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))
[PROOF STEP]
define j' where \<open>j' \<equiv> LEAST j'. n' < j' \<and> (\<exists>j. cs\<^bsup>\<pi>\<^esup> j = cs\<^bsup>\<pi>'\<^esup> j')\<close>
[PROOF STATE]
proof (state)
this:
j' \<equiv> LEAST j'. n' < j' \<and> (\<exists>j. cs\<^bsup>\<pi>\<^esup> j = cs\<^bsup>\<pi>'\<^esup> j')

goal (1 subgoal):
 1. \<not> i' < l' \<Longrightarrow> \<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))
[PROOF STEP]
have Pk': \<open>n' < k' \<and> (\<exists>j. cs\<^bsup>\<pi>\<^esup> j = cs\<^bsup>\<pi>'\<^esup> k')\<close> (is \<open>?P k'\<close>)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n' < k' \<and> (\<exists>j. cs\<^bsup>\<pi>\<^esup> j = cs\<^bsup>\<pi>'\<^esup> k')
[PROOF STEP]
using nk' cseq[symmetric]
[PROOF STATE]
proof (prove)
using this:
n' < k'
cs\<^bsup>\<pi>\<^esup> k = cs\<^bsup>\<pi>'\<^esup> k'

goal (1 subgoal):
 1. n' < k' \<and> (\<exists>j. cs\<^bsup>\<pi>\<^esup> j = cs\<^bsup>\<pi>'\<^esup> k')
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
n' < k' \<and> (\<exists>j. cs\<^bsup>\<pi>\<^esup> j = cs\<^bsup>\<pi>'\<^esup> k')

goal (1 subgoal):
 1. \<not> i' < l' \<Longrightarrow> \<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))
[PROOF STEP]
have nj': \<open>n'<j'\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n' < j'
[PROOF STEP]
using LeastI[of \<open>?P\<close>, OF Pk'] j'_def
[PROOF STATE]
proof (prove)
using this:
n' < (LEAST x. n' < x \<and> (\<exists>j. cs\<^bsup>\<pi>\<^esup> j = cs\<^bsup>\<pi>'\<^esup> x)) \<and> (\<exists>j. cs\<^bsup>\<pi>\<^esup> j = cs\<^bsup>\<pi>'\<^esup> (LEAST x. n' < x \<and> (\<exists>j. cs\<^bsup>\<pi>\<^esup> j = cs\<^bsup>\<pi>'\<^esup> x)))
j' \<equiv> LEAST j'. n' < j' \<and> (\<exists>j. cs\<^bsup>\<pi>\<^esup> j = cs\<^bsup>\<pi>'\<^esup> j')

goal (1 subgoal):
 1. n' < j'
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
n' < j'

goal (1 subgoal):
 1. \<not> i' < l' \<Longrightarrow> \<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))
[PROOF STEP]
have in': \<open>i' \<le> n'\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i' \<le> n'
[PROOF STEP]
using cs_order_le[OF ip csi csn nreti ilen]
[PROOF STATE]
proof (prove)
using this:
i' \<le> n'

goal (1 subgoal):
 1. i' \<le> n'
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
i' \<le> n'

goal (1 subgoal):
 1. \<not> i' < l' \<Longrightarrow> \<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))
[PROOF STEP]
hence lj': \<open>l'<j'\<close>
[PROOF STATE]
proof (prove)
using this:
i' \<le> n'

goal (1 subgoal):
 1. l' < j'
[PROOF STEP]
using li' nj'
[PROOF STATE]
proof (prove)
using this:
i' \<le> n'
l' \<le> i'
n' < j'

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

goal (1 subgoal):
 1. \<not> i' < l' \<Longrightarrow> \<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))
[PROOF STEP]
have \<open>\<forall>l\<in>{l'<..<k'}. v \<notin> writes (\<pi>' l)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>l\<in>{l'<..<k'}. v \<notin> local.writes (\<pi>' l)
[PROOF STEP]
using  kddl'
[PROOF STATE]
proof (prove)
using this:
k' dd\<^bsup>\<pi>',v\<^esup>\<rightarrow> l'

goal (1 subgoal):
 1. \<forall>l\<in>{l'<..<k'}. v \<notin> local.writes (\<pi>' l)
[PROOF STEP]
unfolding is_ddi_def
[PROOF STATE]
proof (prove)
using this:
is_path \<pi>' \<and> l' < k' \<and> v \<in> local.reads (\<pi>' k') \<inter> local.writes (\<pi>' l') \<and> (\<forall>l\<in>{l'<..<k'}. v \<notin> local.writes (\<pi>' l))

goal (1 subgoal):
 1. \<forall>l\<in>{l'<..<k'}. v \<notin> local.writes (\<pi>' l)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<forall>l\<in>{l'<..<k'}. v \<notin> local.writes (\<pi>' l)

goal (1 subgoal):
 1. \<not> i' < l' \<Longrightarrow> \<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))
[PROOF STEP]
hence nw': \<open>\<forall>l\<in>{j'..<k'}. v \<notin> writes (\<pi>' l)\<close>
[PROOF STATE]
proof (prove)
using this:
\<forall>l\<in>{l'<..<k'}. v \<notin> local.writes (\<pi>' l)

goal (1 subgoal):
 1. \<forall>l\<in>{j'..<k'}. v \<notin> local.writes (\<pi>' l)
[PROOF STEP]
using lj'
[PROOF STATE]
proof (prove)
using this:
\<forall>l\<in>{l'<..<k'}. v \<notin> local.writes (\<pi>' l)
l' < j'

goal (1 subgoal):
 1. \<forall>l\<in>{j'..<k'}. v \<notin> local.writes (\<pi>' l)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>l\<in>{j'..<k'}. v \<notin> local.writes (\<pi>' l)

goal (1 subgoal):
 1. \<not> i' < l' \<Longrightarrow> \<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))
[PROOF STEP]
show \<open>?thesis\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))
[PROOF STEP]
using csn lcdn suc nw'[unfolded j'_def]
[PROOF STATE]
proof (prove)
using this:
cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n'
l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n
\<pi> (Suc n) \<noteq> \<pi>' (Suc n')
\<forall>l\<in>{LEAST j'. n' < j' \<and> (\<exists>j. cs\<^bsup>\<pi>\<^esup> j = cs\<^bsup>\<pi>'\<^esup> j')..<k'}. v \<notin> local.writes (\<pi>' l)

goal (1 subgoal):
 1. \<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))

goal (1 subgoal):
 1. \<nexists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> l' \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))
[PROOF STEP]
obtain n n' where csn: \<open> cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n'\<close> and suc: \<open>\<pi> (Suc n) \<noteq> \<pi>' (Suc n')\<close>
            and cdor:
            \<open>(l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{(LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i'))..<k'}. v\<notin>writes (\<pi>' j'))
            \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{(LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i))..<k}. v\<notin>writes (\<pi> j)))\<close>
[PROOF STATE]
proof (prove)
using this:
\<exists>n n'. cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n' \<and> \<pi> (Suc n) \<noteq> \<pi>' (Suc n') \<and> (l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)))

goal (1 subgoal):
 1. (\<And>n n'. \<lbrakk>cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n'; \<pi> (Suc n) \<noteq> \<pi>' (Suc n'); l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j))\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n'
\<pi> (Suc n) \<noteq> \<pi>' (Suc n')
l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j))

goal (1 subgoal):
 1. \<nexists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> l' \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
show \<open>?thesis\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
using cdor
[PROOF STATE]
proof (prove)
using this:
l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<or> l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j))

goal (1 subgoal):
 1. ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
 2. l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)) \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
assume *: \<open>l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j'))\<close>
[PROOF STATE]
proof (state)
this:
l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j'))

goal (2 subgoals):
 1. l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
 2. l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)) \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
hence lcdn: \<open>l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n\<close>
[PROOF STATE]
proof (prove)
using this:
l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j'))

goal (1 subgoal):
 1. l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n

goal (2 subgoals):
 1. l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
 2. l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)) \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
have nowrite: \<open>\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')
[PROOF STEP]
using *
[PROOF STATE]
proof (prove)
using this:
l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j'))

goal (1 subgoal):
 1. \<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')

goal (2 subgoals):
 1. l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n \<and> (\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')) \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
 2. l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)) \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
show \<open>?thesis\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
proof (rule cp.intros(3)[of \<open>\<sigma>\<close> \<open>n\<close> \<open>\<sigma>'\<close> \<open>n'\<close>,folded path])
[PROOF STATE]
proof (state)
goal (7 subgoals):
 1. ((\<sigma>, n), \<sigma>', n') \<in> cp
 2. k dd\<^bsup>\<pi>,?v\<^esup>\<rightarrow> ?l
 3. ?l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n
 4. cs\<^bsup>\<pi>\<^esup> k = cs\<^bsup>\<pi>'\<^esup> k'
 5. \<pi> (Suc n) \<noteq> \<pi>' (Suc n')
 6. (\<sigma>\<^bsup>k\<^esup>) ?v \<noteq> (\<sigma>'\<^bsup>k'\<^esup>) ?v
 7. \<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. ?v \<notin> local.writes (\<pi>' j')
[PROOF STEP]
show \<open>l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n
[PROOF STEP]
using lcdn
[PROOF STATE]
proof (prove)
using this:
l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n

goal (1 subgoal):
 1. l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n

goal (6 subgoals):
 1. ((\<sigma>, n), \<sigma>', n') \<in> cp
 2. k dd\<^bsup>\<pi>,?v\<^esup>\<rightarrow> l
 3. cs\<^bsup>\<pi>\<^esup> k = cs\<^bsup>\<pi>'\<^esup> k'
 4. \<pi> (Suc n) \<noteq> \<pi>' (Suc n')
 5. (\<sigma>\<^bsup>k\<^esup>) ?v \<noteq> (\<sigma>'\<^bsup>k'\<^esup>) ?v
 6. \<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. ?v \<notin> local.writes (\<pi>' j')
[PROOF STEP]
show \<open>k dd\<^bsup>\<pi>,v\<^esup>\<rightarrow> l\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. k dd\<^bsup>\<pi>,v\<^esup>\<rightarrow> l
[PROOF STEP]
using kddl
[PROOF STATE]
proof (prove)
using this:
k dd\<^bsup>\<pi>,v\<^esup>\<rightarrow> l

goal (1 subgoal):
 1. k dd\<^bsup>\<pi>,v\<^esup>\<rightarrow> l
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
k dd\<^bsup>\<pi>,v\<^esup>\<rightarrow> l

goal (5 subgoals):
 1. ((\<sigma>, n), \<sigma>', n') \<in> cp
 2. cs\<^bsup>\<pi>\<^esup> k = cs\<^bsup>\<pi>'\<^esup> k'
 3. \<pi> (Suc n) \<noteq> \<pi>' (Suc n')
 4. (\<sigma>\<^bsup>k\<^esup>) v \<noteq> (\<sigma>'\<^bsup>k'\<^esup>) v
 5. \<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')
[PROOF STEP]
show \<open>cs\<^bsup>\<pi>\<^esup> k = cs\<^bsup>\<pi>'\<^esup> k'\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cs\<^bsup>\<pi>\<^esup> k = cs\<^bsup>\<pi>'\<^esup> k'
[PROOF STEP]
using cseq
[PROOF STATE]
proof (prove)
using this:
cs\<^bsup>\<pi>'\<^esup> k' = cs\<^bsup>\<pi>\<^esup> k

goal (1 subgoal):
 1. cs\<^bsup>\<pi>\<^esup> k = cs\<^bsup>\<pi>'\<^esup> k'
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
cs\<^bsup>\<pi>\<^esup> k = cs\<^bsup>\<pi>'\<^esup> k'

goal (4 subgoals):
 1. ((\<sigma>, n), \<sigma>', n') \<in> cp
 2. \<pi> (Suc n) \<noteq> \<pi>' (Suc n')
 3. (\<sigma>\<^bsup>k\<^esup>) v \<noteq> (\<sigma>'\<^bsup>k'\<^esup>) v
 4. \<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')
[PROOF STEP]
show \<open>\<pi> (Suc n) \<noteq> \<pi>' (Suc n')\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<pi> (Suc n) \<noteq> \<pi>' (Suc n')
[PROOF STEP]
using suc
[PROOF STATE]
proof (prove)
using this:
\<pi> (Suc n) \<noteq> \<pi>' (Suc n')

goal (1 subgoal):
 1. \<pi> (Suc n) \<noteq> \<pi>' (Suc n')
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<pi> (Suc n) \<noteq> \<pi>' (Suc n')

goal (3 subgoals):
 1. ((\<sigma>, n), \<sigma>', n') \<in> cp
 2. (\<sigma>\<^bsup>k\<^esup>) v \<noteq> (\<sigma>'\<^bsup>k'\<^esup>) v
 3. \<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')
[PROOF STEP]
show \<open>\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')
[PROOF STEP]
using nowrite
[PROOF STATE]
proof (prove)
using this:
\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')

goal (1 subgoal):
 1. \<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
\<forall>j'\<in>{LEAST i'. n' < i' \<and> (\<exists>i. cs\<^bsup>\<pi>\<^esup> i = cs\<^bsup>\<pi>'\<^esup> i')..<k'}. v \<notin> local.writes (\<pi>' j')

goal (2 subgoals):
 1. ((\<sigma>, n), \<sigma>', n') \<in> cp
 2. (\<sigma>\<^bsup>k\<^esup>) v \<noteq> (\<sigma>'\<^bsup>k'\<^esup>) v
[PROOF STEP]
show \<open>(\<sigma>\<^bsup>k\<^esup>) v \<noteq> (\<sigma>'\<^bsup>k'\<^esup>) v\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<sigma>\<^bsup>k\<^esup>) v \<noteq> (\<sigma>'\<^bsup>k'\<^esup>) v
[PROOF STEP]
using vneq
[PROOF STATE]
proof (prove)
using this:
(\<sigma>\<^bsup>k\<^esup>) v \<noteq> (\<sigma>'\<^bsup>k'\<^esup>) v

goal (1 subgoal):
 1. (\<sigma>\<^bsup>k\<^esup>) v \<noteq> (\<sigma>'\<^bsup>k'\<^esup>) v
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(\<sigma>\<^bsup>k\<^esup>) v \<noteq> (\<sigma>'\<^bsup>k'\<^esup>) v

goal (1 subgoal):
 1. ((\<sigma>, n), \<sigma>', n') \<in> cp
[PROOF STEP]
have nk: \<open>n < k\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n < k
[PROOF STEP]
using lcdn lk is_cdi_def
[PROOF STATE]
proof (prove)
using this:
l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n
l < k
(?i cd\<^bsup>?\<pi>\<^esup>\<rightarrow> ?k) = (is_path ?\<pi> \<and> ?k < ?i \<and> ?\<pi> ?i \<noteq> local.return \<and> (\<forall>j\<in>{?k..?i}. ?\<pi> j \<noteq> ipd (?\<pi> ?k)))

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

goal (1 subgoal):
 1. ((\<sigma>, n), \<sigma>', n') \<in> cp
[PROOF STEP]
have nretn: \<open>\<pi> n \<noteq> return\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<pi> n \<noteq> local.return
[PROOF STEP]
using cd_not_ret lcdn
[PROOF STATE]
proof (prove)
using this:
?i cd\<^bsup>?\<pi>\<^esup>\<rightarrow> ?k \<Longrightarrow> ?\<pi> ?k \<noteq> local.return
l cd\<^bsup>\<pi>\<^esup>\<rightarrow> n

goal (1 subgoal):
 1. \<pi> n \<noteq> local.return
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
\<pi> n \<noteq> local.return

goal (1 subgoal):
 1. ((\<sigma>, n), \<sigma>', n') \<in> cp
[PROOF STEP]
have nk': \<open>n' < k'\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n' < k'
[PROOF STEP]
using cs_order[OF ip csn cseq[symmetric] nretn nk]
[PROOF STATE]
proof (prove)
using this:
n' < k'

goal (1 subgoal):
 1. n' < k'
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
n' < k'

goal (1 subgoal):
 1. ((\<sigma>, n), \<sigma>', n') \<in> cp
[PROOF STEP]
hence le: \<open>n + n' < k + k'\<close>
[PROOF STATE]
proof (prove)
using this:
n' < k'

goal (1 subgoal):
 1. n + n' < k + k'
[PROOF STEP]
using nk
[PROOF STATE]
proof (prove)
using this:
n' < k'
n < k

goal (1 subgoal):
 1. n + n' < k + k'
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
n + n' < k + k'

goal (1 subgoal):
 1. ((\<sigma>, n), \<sigma>', n') \<in> cp
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
n + n' < k + k'

goal (1 subgoal):
 1. ((\<sigma>, n), \<sigma>', n') \<in> cp
[PROOF STEP]
have 1: \<open>\<pi> (Suc n) = suc (\<pi> n) (\<sigma>\<^bsup>n\<^esup>)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<pi> (Suc n) = suc (\<pi> n) (\<sigma>\<^bsup>n\<^esup>)
[PROOF STEP]
by (metis step_suc_sem fst_conv path(1) path_suc)
[PROOF STATE]
proof (state)
this:
\<pi> (Suc n) = suc (\<pi> n) (\<sigma>\<^bsup>n\<^esup>)

goal (1 subgoal):
 1. ((\<sigma>, n), \<sigma>', n') \<in> cp
[PROOF STEP]
have 2: \<open>\<pi>' (Suc n') = suc (\<pi>' n') (\<sigma>'\<^bsup>n'\<^esup>)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<pi>' (Suc n') = suc (\<pi>' n') (\<sigma>'\<^bsup>n'\<^esup>)
[PROOF STEP]
by (metis step_suc_sem fst_conv path(2) path_suc)
[PROOF STATE]
proof (state)
this:
\<pi>' (Suc n') = suc (\<pi>' n') (\<sigma>'\<^bsup>n'\<^esup>)

goal (1 subgoal):
 1. ((\<sigma>, n), \<sigma>', n') \<in> cp
[PROOF STEP]
have 3: \<open>\<pi>' n' = \<pi> n\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<pi>' n' = \<pi> n
[PROOF STEP]
using csn last_cs
[PROOF STATE]
proof (prove)
using this:
cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n'
last (cs\<^bsup>?\<pi>\<^esup> ?i) = ?\<pi> ?i

goal (1 subgoal):
 1. \<pi>' n' = \<pi> n
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
\<pi>' n' = \<pi> n

goal (1 subgoal):
 1. ((\<sigma>, n), \<sigma>', n') \<in> cp
[PROOF STEP]
have nreads: \<open>\<sigma>\<^bsup>n\<^esup> \<restriction> reads (\<pi> n) \<noteq> \<sigma>'\<^bsup>n'\<^esup> \<restriction> reads (\<pi> n)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<sigma>\<^bsup>n\<^esup> \<restriction> local.reads (\<pi> n) \<noteq> \<sigma>'\<^bsup>n'\<^esup> \<restriction> local.reads (\<pi> n)
[PROOF STEP]
by (metis 1 2 3 suc reads_restr_suc)
[PROOF STATE]
proof (state)
this:
\<sigma>\<^bsup>n\<^esup> \<restriction> local.reads (\<pi> n) \<noteq> \<sigma>'\<^bsup>n'\<^esup> \<restriction> local.reads (\<pi> n)

goal (1 subgoal):
 1. ((\<sigma>, n), \<sigma>', n') \<in> cp
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<sigma>\<^bsup>n\<^esup> \<restriction> local.reads (\<pi> n) \<noteq> \<sigma>'\<^bsup>n'\<^esup> \<restriction> local.reads (\<pi> n)
[PROOF STEP]
obtain v' where v'read: \<open>v'\<in>reads (path \<sigma> n)\<close> \<open>(\<sigma>\<^bsup>n\<^esup>) v' \<noteq> (\<sigma>'\<^bsup>n'\<^esup>) v'\<close>
[PROOF STATE]
proof (prove)
using this:
\<sigma>\<^bsup>n\<^esup> \<restriction> local.reads (\<pi> n) \<noteq> \<sigma>'\<^bsup>n'\<^esup> \<restriction> local.reads (\<pi> n)

goal (1 subgoal):
 1. (\<And>v'. \<lbrakk>v' \<in> local.reads (path \<sigma> n); (\<sigma>\<^bsup>n\<^esup>) v' \<noteq> (\<sigma>'\<^bsup>n'\<^esup>) v'\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis path(1) reads_restrict)
[PROOF STATE]
proof (state)
this:
v' \<in> local.reads (path \<sigma> n)
(\<sigma>\<^bsup>n\<^esup>) v' \<noteq> (\<sigma>'\<^bsup>n'\<^esup>) v'

goal (1 subgoal):
 1. ((\<sigma>, n), \<sigma>', n') \<in> cp
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
n + n' < k + k'
v' \<in> local.reads (path \<sigma> n)
(\<sigma>\<^bsup>n\<^esup>) v' \<noteq> (\<sigma>'\<^bsup>n'\<^esup>) v'
[PROOF STEP]
show \<open>((\<sigma>, n), (\<sigma>', n')) \<in> cp\<close>
[PROOF STATE]
proof (prove)
using this:
n + n' < k + k'
v' \<in> local.reads (path \<sigma> n)
(\<sigma>\<^bsup>n\<^esup>) v' \<noteq> (\<sigma>'\<^bsup>n'\<^esup>) v'

goal (1 subgoal):
 1. ((\<sigma>, n), \<sigma>', n') \<in> cp
[PROOF STEP]
using IH csn path
[PROOF STATE]
proof (prove)
using this:
n + n' < k + k'
v' \<in> local.reads (path \<sigma> n)
(\<sigma>\<^bsup>n\<^esup>) v' \<noteq> (\<sigma>'\<^bsup>n'\<^esup>) v'
\<lbrakk>?ka1 + ?k'a1 < k + k'; cs\<^bsup>path \<sigma>\<^esup> ?ka1 = cs\<^bsup>path \<sigma>'\<^esup> ?k'a1; ?v1 \<in> local.reads (path \<sigma> ?ka1); (\<sigma>\<^bsup>?ka1\<^esup>) ?v1 \<noteq> (\<sigma>'\<^bsup>?k'a1\<^esup>) ?v1\<rbrakk> \<Longrightarrow> ((\<sigma>, ?ka1), \<sigma>', ?k'a1) \<in> cp
cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n'
\<pi> = path \<sigma>
\<pi>' = path \<sigma>'

goal (1 subgoal):
 1. ((\<sigma>, n), \<sigma>', n') \<in> cp
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
((\<sigma>, n), \<sigma>', n') \<in> cp

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
((\<sigma>, k), \<sigma>', k') \<in> cp

goal (1 subgoal):
 1. l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)) \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)) \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
assume *: \<open>l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{(LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i))..<k}. v\<notin>writes (\<pi> j))\<close>
[PROOF STATE]
proof (state)
this:
l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j))

goal (1 subgoal):
 1. l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)) \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
hence lcdn': \<open>l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n'\<close>
[PROOF STATE]
proof (prove)
using this:
l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j))

goal (1 subgoal):
 1. l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n'
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n'

goal (1 subgoal):
 1. l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)) \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
have nowrite: \<open>\<forall>j\<in>{(LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i))..<k}. v\<notin>writes (\<pi> j)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)
[PROOF STEP]
using *
[PROOF STATE]
proof (prove)
using this:
l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j))

goal (1 subgoal):
 1. \<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)

goal (1 subgoal):
 1. l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n' \<and> (\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)) \<Longrightarrow> ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
show \<open>?thesis\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<sigma>, k), \<sigma>', k') \<in> cp
[PROOF STEP]
proof (rule cp.intros(4), rule cp.intros(3)[of \<open>\<sigma>'\<close> \<open>n'\<close> \<open>\<sigma>\<close> \<open>n\<close>,folded path])
[PROOF STATE]
proof (state)
goal (7 subgoals):
 1. ((\<sigma>', n'), \<sigma>, n) \<in> cp
 2. k' dd\<^bsup>\<pi>',?v2\<^esup>\<rightarrow> ?l2
 3. ?l2 cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n'
 4. cs\<^bsup>\<pi>'\<^esup> k' = cs\<^bsup>\<pi>\<^esup> k
 5. \<pi>' (Suc n') \<noteq> \<pi> (Suc n)
 6. (\<sigma>'\<^bsup>k'\<^esup>) ?v2 \<noteq> (\<sigma>\<^bsup>k\<^esup>) ?v2
 7. \<forall>j'\<in>{LEAST i'. n < i' \<and> (\<exists>i. cs\<^bsup>\<pi>'\<^esup> i = cs\<^bsup>\<pi>\<^esup> i')..<k}. ?v2 \<notin> local.writes (\<pi> j')
[PROOF STEP]
show \<open>l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n'\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n'
[PROOF STEP]
using lcdn'
[PROOF STATE]
proof (prove)
using this:
l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n'

goal (1 subgoal):
 1. l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n'
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n'

goal (6 subgoals):
 1. ((\<sigma>', n'), \<sigma>, n) \<in> cp
 2. k' dd\<^bsup>\<pi>',?v2\<^esup>\<rightarrow> l'
 3. cs\<^bsup>\<pi>'\<^esup> k' = cs\<^bsup>\<pi>\<^esup> k
 4. \<pi>' (Suc n') \<noteq> \<pi> (Suc n)
 5. (\<sigma>'\<^bsup>k'\<^esup>) ?v2 \<noteq> (\<sigma>\<^bsup>k\<^esup>) ?v2
 6. \<forall>j'\<in>{LEAST i'. n < i' \<and> (\<exists>i. cs\<^bsup>\<pi>'\<^esup> i = cs\<^bsup>\<pi>\<^esup> i')..<k}. ?v2 \<notin> local.writes (\<pi> j')
[PROOF STEP]
show \<open>k' dd\<^bsup>\<pi>',v\<^esup>\<rightarrow> l'\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. k' dd\<^bsup>\<pi>',v\<^esup>\<rightarrow> l'
[PROOF STEP]
using kddl'
[PROOF STATE]
proof (prove)
using this:
k' dd\<^bsup>\<pi>',v\<^esup>\<rightarrow> l'

goal (1 subgoal):
 1. k' dd\<^bsup>\<pi>',v\<^esup>\<rightarrow> l'
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
k' dd\<^bsup>\<pi>',v\<^esup>\<rightarrow> l'

goal (5 subgoals):
 1. ((\<sigma>', n'), \<sigma>, n) \<in> cp
 2. cs\<^bsup>\<pi>'\<^esup> k' = cs\<^bsup>\<pi>\<^esup> k
 3. \<pi>' (Suc n') \<noteq> \<pi> (Suc n)
 4. (\<sigma>'\<^bsup>k'\<^esup>) v \<noteq> (\<sigma>\<^bsup>k\<^esup>) v
 5. \<forall>j'\<in>{LEAST i'. n < i' \<and> (\<exists>i. cs\<^bsup>\<pi>'\<^esup> i = cs\<^bsup>\<pi>\<^esup> i')..<k}. v \<notin> local.writes (\<pi> j')
[PROOF STEP]
show \<open>cs\<^bsup>\<pi>'\<^esup> k' = cs\<^bsup>\<pi>\<^esup> k\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cs\<^bsup>\<pi>'\<^esup> k' = cs\<^bsup>\<pi>\<^esup> k
[PROOF STEP]
using cseq
[PROOF STATE]
proof (prove)
using this:
cs\<^bsup>\<pi>'\<^esup> k' = cs\<^bsup>\<pi>\<^esup> k

goal (1 subgoal):
 1. cs\<^bsup>\<pi>'\<^esup> k' = cs\<^bsup>\<pi>\<^esup> k
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
cs\<^bsup>\<pi>'\<^esup> k' = cs\<^bsup>\<pi>\<^esup> k

goal (4 subgoals):
 1. ((\<sigma>', n'), \<sigma>, n) \<in> cp
 2. \<pi>' (Suc n') \<noteq> \<pi> (Suc n)
 3. (\<sigma>'\<^bsup>k'\<^esup>) v \<noteq> (\<sigma>\<^bsup>k\<^esup>) v
 4. \<forall>j'\<in>{LEAST i'. n < i' \<and> (\<exists>i. cs\<^bsup>\<pi>'\<^esup> i = cs\<^bsup>\<pi>\<^esup> i')..<k}. v \<notin> local.writes (\<pi> j')
[PROOF STEP]
show \<open>\<pi>' (Suc n') \<noteq> \<pi> (Suc n)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<pi>' (Suc n') \<noteq> \<pi> (Suc n)
[PROOF STEP]
using suc
[PROOF STATE]
proof (prove)
using this:
\<pi> (Suc n) \<noteq> \<pi>' (Suc n')

goal (1 subgoal):
 1. \<pi>' (Suc n') \<noteq> \<pi> (Suc n)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<pi>' (Suc n') \<noteq> \<pi> (Suc n)

goal (3 subgoals):
 1. ((\<sigma>', n'), \<sigma>, n) \<in> cp
 2. (\<sigma>'\<^bsup>k'\<^esup>) v \<noteq> (\<sigma>\<^bsup>k\<^esup>) v
 3. \<forall>j'\<in>{LEAST i'. n < i' \<and> (\<exists>i. cs\<^bsup>\<pi>'\<^esup> i = cs\<^bsup>\<pi>\<^esup> i')..<k}. v \<notin> local.writes (\<pi> j')
[PROOF STEP]
show \<open>\<forall>j\<in>{(LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i))..<k}. v\<notin>writes (\<pi> j)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)
[PROOF STEP]
using nowrite
[PROOF STATE]
proof (prove)
using this:
\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)

goal (1 subgoal):
 1. \<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
\<forall>j\<in>{LEAST i. n < i \<and> (\<exists>i'. cs\<^bsup>\<pi>'\<^esup> i' = cs\<^bsup>\<pi>\<^esup> i)..<k}. v \<notin> local.writes (\<pi> j)

goal (2 subgoals):
 1. ((\<sigma>', n'), \<sigma>, n) \<in> cp
 2. (\<sigma>'\<^bsup>k'\<^esup>) v \<noteq> (\<sigma>\<^bsup>k\<^esup>) v
[PROOF STEP]
show \<open>(\<sigma>'\<^bsup>k'\<^esup>) v \<noteq> (\<sigma>\<^bsup>k\<^esup>) v\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<sigma>'\<^bsup>k'\<^esup>) v \<noteq> (\<sigma>\<^bsup>k\<^esup>) v
[PROOF STEP]
using vneq
[PROOF STATE]
proof (prove)
using this:
(\<sigma>\<^bsup>k\<^esup>) v \<noteq> (\<sigma>'\<^bsup>k'\<^esup>) v

goal (1 subgoal):
 1. (\<sigma>'\<^bsup>k'\<^esup>) v \<noteq> (\<sigma>\<^bsup>k\<^esup>) v
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<sigma>'\<^bsup>k'\<^esup>) v \<noteq> (\<sigma>\<^bsup>k\<^esup>) v

goal (1 subgoal):
 1. ((\<sigma>', n'), \<sigma>, n) \<in> cp
[PROOF STEP]
have nk': \<open>n' < k'\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n' < k'
[PROOF STEP]
using lcdn' lk' is_cdi_def
[PROOF STATE]
proof (prove)
using this:
l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n'
l' < k'
(?i cd\<^bsup>?\<pi>\<^esup>\<rightarrow> ?k) = (is_path ?\<pi> \<and> ?k < ?i \<and> ?\<pi> ?i \<noteq> local.return \<and> (\<forall>j\<in>{?k..?i}. ?\<pi> j \<noteq> ipd (?\<pi> ?k)))

goal (1 subgoal):
 1. n' < k'
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
n' < k'

goal (1 subgoal):
 1. ((\<sigma>', n'), \<sigma>, n) \<in> cp
[PROOF STEP]
have nretn': \<open>\<pi>' n' \<noteq> return\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<pi>' n' \<noteq> local.return
[PROOF STEP]
using cd_not_ret lcdn'
[PROOF STATE]
proof (prove)
using this:
?i cd\<^bsup>?\<pi>\<^esup>\<rightarrow> ?k \<Longrightarrow> ?\<pi> ?k \<noteq> local.return
l' cd\<^bsup>\<pi>'\<^esup>\<rightarrow> n'

goal (1 subgoal):
 1. \<pi>' n' \<noteq> local.return
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
\<pi>' n' \<noteq> local.return

goal (1 subgoal):
 1. ((\<sigma>', n'), \<sigma>, n) \<in> cp
[PROOF STEP]
have nk: \<open>n < k\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n < k
[PROOF STEP]
using cs_order[OF ip(2,1) csn[symmetric] cseq nretn' nk']
[PROOF STATE]
proof (prove)
using this:
n < k

goal (1 subgoal):
 1. n < k
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
n < k

goal (1 subgoal):
 1. ((\<sigma>', n'), \<sigma>, n) \<in> cp
[PROOF STEP]
hence le: \<open>n + n' < k + k'\<close>
[PROOF STATE]
proof (prove)
using this:
n < k

goal (1 subgoal):
 1. n + n' < k + k'
[PROOF STEP]
using nk'
[PROOF STATE]
proof (prove)
using this:
n < k
n' < k'

goal (1 subgoal):
 1. n + n' < k + k'
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
n + n' < k + k'

goal (1 subgoal):
 1. ((\<sigma>', n'), \<sigma>, n) \<in> cp
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
n + n' < k + k'

goal (1 subgoal):
 1. ((\<sigma>', n'), \<sigma>, n) \<in> cp
[PROOF STEP]
have 1: \<open>\<pi> (Suc n) = suc (\<pi> n) (\<sigma>\<^bsup>n\<^esup>)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<pi> (Suc n) = suc (\<pi> n) (\<sigma>\<^bsup>n\<^esup>)
[PROOF STEP]
by (metis step_suc_sem fst_conv path(1) path_suc)
[PROOF STATE]
proof (state)
this:
\<pi> (Suc n) = suc (\<pi> n) (\<sigma>\<^bsup>n\<^esup>)

goal (1 subgoal):
 1. ((\<sigma>', n'), \<sigma>, n) \<in> cp
[PROOF STEP]
have 2: \<open>\<pi>' (Suc n') = suc (\<pi>' n') (\<sigma>'\<^bsup>n'\<^esup>)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<pi>' (Suc n') = suc (\<pi>' n') (\<sigma>'\<^bsup>n'\<^esup>)
[PROOF STEP]
by (metis step_suc_sem fst_conv path(2) path_suc)
[PROOF STATE]
proof (state)
this:
\<pi>' (Suc n') = suc (\<pi>' n') (\<sigma>'\<^bsup>n'\<^esup>)

goal (1 subgoal):
 1. ((\<sigma>', n'), \<sigma>, n) \<in> cp
[PROOF STEP]
have 3: \<open>\<pi>' n' = \<pi> n\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<pi>' n' = \<pi> n
[PROOF STEP]
using csn last_cs
[PROOF STATE]
proof (prove)
using this:
cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n'
last (cs\<^bsup>?\<pi>\<^esup> ?i) = ?\<pi> ?i

goal (1 subgoal):
 1. \<pi>' n' = \<pi> n
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
\<pi>' n' = \<pi> n

goal (1 subgoal):
 1. ((\<sigma>', n'), \<sigma>, n) \<in> cp
[PROOF STEP]
have nreads: \<open>\<sigma>\<^bsup>n\<^esup> \<restriction> reads (\<pi> n) \<noteq> \<sigma>'\<^bsup>n'\<^esup> \<restriction> reads (\<pi> n)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<sigma>\<^bsup>n\<^esup> \<restriction> local.reads (\<pi> n) \<noteq> \<sigma>'\<^bsup>n'\<^esup> \<restriction> local.reads (\<pi> n)
[PROOF STEP]
by (metis 1 2 3 suc reads_restr_suc)
[PROOF STATE]
proof (state)
this:
\<sigma>\<^bsup>n\<^esup> \<restriction> local.reads (\<pi> n) \<noteq> \<sigma>'\<^bsup>n'\<^esup> \<restriction> local.reads (\<pi> n)

goal (1 subgoal):
 1. ((\<sigma>', n'), \<sigma>, n) \<in> cp
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<sigma>\<^bsup>n\<^esup> \<restriction> local.reads (\<pi> n) \<noteq> \<sigma>'\<^bsup>n'\<^esup> \<restriction> local.reads (\<pi> n)
[PROOF STEP]
obtain v' where v'read: \<open>v'\<in>reads (path \<sigma> n)\<close> \<open>(\<sigma>\<^bsup>n\<^esup>) v' \<noteq> (\<sigma>'\<^bsup>n'\<^esup>) v'\<close>
[PROOF STATE]
proof (prove)
using this:
\<sigma>\<^bsup>n\<^esup> \<restriction> local.reads (\<pi> n) \<noteq> \<sigma>'\<^bsup>n'\<^esup> \<restriction> local.reads (\<pi> n)

goal (1 subgoal):
 1. (\<And>v'. \<lbrakk>v' \<in> local.reads (path \<sigma> n); (\<sigma>\<^bsup>n\<^esup>) v' \<noteq> (\<sigma>'\<^bsup>n'\<^esup>) v'\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis path(1) reads_restrict)
[PROOF STATE]
proof (state)
this:
v' \<in> local.reads (path \<sigma> n)
(\<sigma>\<^bsup>n\<^esup>) v' \<noteq> (\<sigma>'\<^bsup>n'\<^esup>) v'

goal (1 subgoal):
 1. ((\<sigma>', n'), \<sigma>, n) \<in> cp
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
n + n' < k + k'
v' \<in> local.reads (path \<sigma> n)
(\<sigma>\<^bsup>n\<^esup>) v' \<noteq> (\<sigma>'\<^bsup>n'\<^esup>) v'
[PROOF STEP]
have \<open>((\<sigma>, n), (\<sigma>', n')) \<in> cp\<close>
[PROOF STATE]
proof (prove)
using this:
n + n' < k + k'
v' \<in> local.reads (path \<sigma> n)
(\<sigma>\<^bsup>n\<^esup>) v' \<noteq> (\<sigma>'\<^bsup>n'\<^esup>) v'

goal (1 subgoal):
 1. ((\<sigma>, n), \<sigma>', n') \<in> cp
[PROOF STEP]
using IH csn path
[PROOF STATE]
proof (prove)
using this:
n + n' < k + k'
v' \<in> local.reads (path \<sigma> n)
(\<sigma>\<^bsup>n\<^esup>) v' \<noteq> (\<sigma>'\<^bsup>n'\<^esup>) v'
\<lbrakk>?ka1 + ?k'a1 < k + k'; cs\<^bsup>path \<sigma>\<^esup> ?ka1 = cs\<^bsup>path \<sigma>'\<^esup> ?k'a1; ?v1 \<in> local.reads (path \<sigma> ?ka1); (\<sigma>\<^bsup>?ka1\<^esup>) ?v1 \<noteq> (\<sigma>'\<^bsup>?k'a1\<^esup>) ?v1\<rbrakk> \<Longrightarrow> ((\<sigma>, ?ka1), \<sigma>', ?k'a1) \<in> cp
cs\<^bsup>\<pi>\<^esup> n = cs\<^bsup>\<pi>'\<^esup> n'
\<pi> = path \<sigma>
\<pi>' = path \<sigma>'

goal (1 subgoal):
 1. ((\<sigma>, n), \<sigma>', n') \<in> cp
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
((\<sigma>, n), \<sigma>', n') \<in> cp

goal (1 subgoal):
 1. ((\<sigma>', n'), \<sigma>, n) \<in> cp
[PROOF STEP]
thus \<open>((\<sigma>', n'), \<sigma>, n) \<in> cp\<close>
[PROOF STATE]
proof (prove)
using this:
((\<sigma>, n), \<sigma>', n') \<in> cp

goal (1 subgoal):
 1. ((\<sigma>', n'), \<sigma>, n) \<in> cp
[PROOF STEP]
using cp.intros(4)
[PROOF STATE]
proof (prove)
using this:
((\<sigma>, n), \<sigma>', n') \<in> cp
((?\<sigma>, ?k), ?\<sigma>', ?k') \<in> cp \<Longrightarrow> ((?\<sigma>', ?k'), ?\<sigma>, ?k) \<in> cp

goal (1 subgoal):
 1. ((\<sigma>', n'), \<sigma>, n) \<in> cp
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
((\<sigma>', n'), \<sigma>, n) \<in> cp

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
((\<sigma>, k), \<sigma>', k') \<in> cp

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
((\<sigma>, k), \<sigma>', k') \<in> cp

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
((\<sigma>, k), \<sigma>', k') \<in> cp

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
((\<sigma>, k), \<sigma>', k') \<in> cp

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
((\<sigma>, k), \<sigma>', k') \<in> cp

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
((\<sigma>, k), \<sigma>', k') \<in> cp

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
((\<sigma>, k), \<sigma>', k') \<in> cp

goal:
No subgoals!
[PROOF STEP]
qed