[STATEMENT]
lemma iter_properties[rule_format]: assumes "Semilat A r f"
shows "\<lbrakk> acc A r; pres_type step n A; mono r step n A;
     bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A;
     \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> stable r step ss0 p \<rbrakk> \<Longrightarrow>
   t_\<alpha> (iter f step ss0 w0) = (ss',w')
   \<longrightarrow>
   ss' \<in> list n A \<and> stables r step ss' \<and> ss0 [\<sqsubseteq>\<^sub>r] ss' \<and>
   (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^sub>r] ts \<and> stables r step ts \<longrightarrow> ss' [\<sqsubseteq>\<^sub>r] ts)"
(*<*) (is "PROP ?P")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p\<rbrakk> \<Longrightarrow> t_\<alpha> (iter f step ss0 w0) = (ss', w') \<longrightarrow> ss' \<in> list n A \<and> stables r step ss' \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss' \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> stables r step ts \<longrightarrow> ss' [\<sqsubseteq>\<^bsub>r\<^esub>] ts)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p\<rbrakk> \<Longrightarrow> t_\<alpha> (iter f step ss0 w0) = (ss', w') \<longrightarrow> ss' \<in> list n A \<and> stables r step ss' \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss' \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> stables r step ts \<longrightarrow> ss' [\<sqsubseteq>\<^bsub>r\<^esub>] ts)
[PROOF STEP]
interpret Semilat A r f
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Semilat A r f
[PROOF STEP]
by fact
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p\<rbrakk> \<Longrightarrow> t_\<alpha> (iter f step ss0 w0) = (ss', w') \<longrightarrow> ss' \<in> list n A \<and> stables r step ss' \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss' \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> stables r step ts \<longrightarrow> ss' [\<sqsubseteq>\<^bsub>r\<^esub>] ts)
[PROOF STEP]
show "PROP ?P"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p\<rbrakk> \<Longrightarrow> t_\<alpha> (iter f step ss0 w0) = (ss', w') \<longrightarrow> ss' \<in> list n A \<and> stables r step ss' \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss' \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> stables r step ts \<longrightarrow> ss' [\<sqsubseteq>\<^bsub>r\<^esub>] ts)
[PROOF STEP]
apply(insert semilat)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f)\<rbrakk> \<Longrightarrow> t_\<alpha> (iter f step ss0 w0) = (ss', w') \<longrightarrow> ss' \<in> list n A \<and> stables r step ss' \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss' \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> stables r step ts \<longrightarrow> ss' [\<sqsubseteq>\<^bsub>r\<^esub>] ts)
[PROOF STEP]
apply (unfold iter_def stables_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f)\<rbrakk> \<Longrightarrow> t_\<alpha> (while (\<lambda>(\<tau>s, w). \<not> s_is_empty w) (\<lambda>(\<tau>s, w). let p = s_choose w in propa f (step p (\<tau>s ! p)) \<tau>s (s_remove p w)) (ss0, w0)) = (ss', w') \<longrightarrow> ss' \<in> list n A \<and> (\<forall>p<length ss'. Typing_Framework.stable r step ss' p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss' \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<length ts. Typing_Framework.stable r step ts p) \<longrightarrow> ss' [\<sqsubseteq>\<^bsub>r\<^esub>] ts)
[PROOF STEP]
apply(unfold is_empty_spec)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f)\<rbrakk> \<Longrightarrow> t_\<alpha> (while (\<lambda>(\<tau>s, w). s_\<alpha> w \<noteq> {}) (\<lambda>(\<tau>s, w). let p = s_choose w in propa f (step p (\<tau>s ! p)) \<tau>s (s_remove p w)) (ss0, w0)) = (ss', w') \<longrightarrow> ss' \<in> list n A \<and> (\<forall>p<length ss'. Typing_Framework.stable r step ss' p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss' \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<length ts. Typing_Framework.stable r step ts p) \<longrightarrow> ss' [\<sqsubseteq>\<^bsub>r\<^esub>] ts)
[PROOF STEP]
apply (rule_tac P = "\<lambda>(ss,w).
   ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^sub>r] ss \<and>
   (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^sub>r] ts \<and> stables r step ts \<longrightarrow> ss [\<sqsubseteq>\<^sub>r] ts) \<and>
   (\<forall>p\<in> s_\<alpha> w. p < n)" and
   r = "{(ss',ss) . ss \<in> list n A \<and> ss' \<in> list n A \<and> ss [\<sqsubset>\<^sub>r] ss'} <*lex*> s_finite_psubset"
         in while_rule)

  \<comment> \<open>Invariant holds initially:\<close>
[PROOF STATE]
proof (prove)
goal (5 subgoals):
 1. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f)\<rbrakk> \<Longrightarrow> case (ss0, w0) of (ss, w) \<Rightarrow> ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> stables r step ts \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n)
 2. \<And>s. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); case s of (ss, w) \<Rightarrow> ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> stables r step ts \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); case s of (\<tau>s, w) \<Rightarrow> s_\<alpha> w \<noteq> {}\<rbrakk> \<Longrightarrow> case case s of (\<tau>s, w) \<Rightarrow> let p = s_choose w in propa f (step p (\<tau>s ! p)) \<tau>s (s_remove p w) of (ss, w) \<Rightarrow> ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> stables r step ts \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n)
 3. \<And>s. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); case s of (ss, w) \<Rightarrow> ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> stables r step ts \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); \<not> (case s of (\<tau>s, w) \<Rightarrow> s_\<alpha> w \<noteq> {})\<rbrakk> \<Longrightarrow> t_\<alpha> s = (ss', w') \<longrightarrow> ss' \<in> list n A \<and> (\<forall>p<length ss'. Typing_Framework.stable r step ss' p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss' \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<length ts. Typing_Framework.stable r step ts p) \<longrightarrow> ss' [\<sqsubseteq>\<^bsub>r\<^esub>] ts)
 4. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f)\<rbrakk> \<Longrightarrow> wf ({(ss', ss). ss \<in> list n A \<and> ss' \<in> list n A \<and> ss [\<sqsubset>\<^bsub>r\<^esub>] ss'} <*lex*> s_finite_psubset)
 5. \<And>s. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); case s of (ss, w) \<Rightarrow> ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> stables r step ts \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); case s of (\<tau>s, w) \<Rightarrow> s_\<alpha> w \<noteq> {}\<rbrakk> \<Longrightarrow> (case s of (\<tau>s, w) \<Rightarrow> let p = s_choose w in propa f (step p (\<tau>s ! p)) \<tau>s (s_remove p w), s) \<in> {(ss', ss). ss \<in> list n A \<and> ss' \<in> list n A \<and> ss [\<sqsubset>\<^bsub>r\<^esub>] ss'} <*lex*> s_finite_psubset
[PROOF STEP]
apply (simp add:stables_def)

  \<comment> \<open>Invariant is preserved:\<close>
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<And>s. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); case s of (ss, w) \<Rightarrow> ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> stables r step ts \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); case s of (\<tau>s, w) \<Rightarrow> s_\<alpha> w \<noteq> {}\<rbrakk> \<Longrightarrow> case case s of (\<tau>s, w) \<Rightarrow> let p = s_choose w in propa f (step p (\<tau>s ! p)) \<tau>s (s_remove p w) of (ss, w) \<Rightarrow> ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> stables r step ts \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n)
 2. \<And>s. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); case s of (ss, w) \<Rightarrow> ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> stables r step ts \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); \<not> (case s of (\<tau>s, w) \<Rightarrow> s_\<alpha> w \<noteq> {})\<rbrakk> \<Longrightarrow> t_\<alpha> s = (ss', w') \<longrightarrow> ss' \<in> list n A \<and> (\<forall>p<length ss'. Typing_Framework.stable r step ss' p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss' \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<length ts. Typing_Framework.stable r step ts p) \<longrightarrow> ss' [\<sqsubseteq>\<^bsub>r\<^esub>] ts)
 3. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f)\<rbrakk> \<Longrightarrow> wf ({(ss', ss). ss \<in> list n A \<and> ss' \<in> list n A \<and> ss [\<sqsubset>\<^bsub>r\<^esub>] ss'} <*lex*> s_finite_psubset)
 4. \<And>s. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); case s of (ss, w) \<Rightarrow> ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> stables r step ts \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); case s of (\<tau>s, w) \<Rightarrow> s_\<alpha> w \<noteq> {}\<rbrakk> \<Longrightarrow> (case s of (\<tau>s, w) \<Rightarrow> let p = s_choose w in propa f (step p (\<tau>s ! p)) \<tau>s (s_remove p w), s) \<in> {(ss', ss). ss \<in> list n A \<and> ss' \<in> list n A \<and> ss [\<sqsubset>\<^bsub>r\<^esub>] ss'} <*lex*> s_finite_psubset
[PROOF STEP]
apply(simp add: stables_def split_paired_all)
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<And>a b. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); a \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> b \<longrightarrow> Typing_Framework.stable r step a p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] a \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> a [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> b. p < n); s_\<alpha> b \<noteq> {}\<rbrakk> \<Longrightarrow> case propa f (step (s_choose b) (a ! s_choose b)) a (s_remove (s_choose b) b) of (ss, w) \<Rightarrow> ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n)
 2. \<And>s. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); case s of (ss, w) \<Rightarrow> ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> stables r step ts \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); \<not> (case s of (\<tau>s, w) \<Rightarrow> s_\<alpha> w \<noteq> {})\<rbrakk> \<Longrightarrow> t_\<alpha> s = (ss', w') \<longrightarrow> ss' \<in> list n A \<and> (\<forall>p<length ss'. Typing_Framework.stable r step ss' p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss' \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<length ts. Typing_Framework.stable r step ts p) \<longrightarrow> ss' [\<sqsubseteq>\<^bsub>r\<^esub>] ts)
 3. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f)\<rbrakk> \<Longrightarrow> wf ({(ss', ss). ss \<in> list n A \<and> ss' \<in> list n A \<and> ss [\<sqsubset>\<^bsub>r\<^esub>] ss'} <*lex*> s_finite_psubset)
 4. \<And>s. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); case s of (ss, w) \<Rightarrow> ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> stables r step ts \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); case s of (\<tau>s, w) \<Rightarrow> s_\<alpha> w \<noteq> {}\<rbrakk> \<Longrightarrow> (case s of (\<tau>s, w) \<Rightarrow> let p = s_choose w in propa f (step p (\<tau>s ! p)) \<tau>s (s_remove p w), s) \<in> {(ss', ss). ss \<in> list n A \<and> ss' \<in> list n A \<and> ss [\<sqsubset>\<^bsub>r\<^esub>] ss'} <*lex*> s_finite_psubset
[PROOF STEP]
apply(rename_tac ss w)
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<And>ss w. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); s_\<alpha> w \<noteq> {}\<rbrakk> \<Longrightarrow> case propa f (step (s_choose w) (ss ! s_choose w)) ss (s_remove (s_choose w) w) of (ss, w) \<Rightarrow> ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n)
 2. \<And>s. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); case s of (ss, w) \<Rightarrow> ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> stables r step ts \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); \<not> (case s of (\<tau>s, w) \<Rightarrow> s_\<alpha> w \<noteq> {})\<rbrakk> \<Longrightarrow> t_\<alpha> s = (ss', w') \<longrightarrow> ss' \<in> list n A \<and> (\<forall>p<length ss'. Typing_Framework.stable r step ss' p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss' \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<length ts. Typing_Framework.stable r step ts p) \<longrightarrow> ss' [\<sqsubseteq>\<^bsub>r\<^esub>] ts)
 3. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f)\<rbrakk> \<Longrightarrow> wf ({(ss', ss). ss \<in> list n A \<and> ss' \<in> list n A \<and> ss [\<sqsubset>\<^bsub>r\<^esub>] ss'} <*lex*> s_finite_psubset)
 4. \<And>s. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); case s of (ss, w) \<Rightarrow> ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> stables r step ts \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); case s of (\<tau>s, w) \<Rightarrow> s_\<alpha> w \<noteq> {}\<rbrakk> \<Longrightarrow> (case s of (\<tau>s, w) \<Rightarrow> let p = s_choose w in propa f (step p (\<tau>s ! p)) \<tau>s (s_remove p w), s) \<in> {(ss', ss). ss \<in> list n A \<and> ss' \<in> list n A \<and> ss [\<sqsubset>\<^bsub>r\<^esub>] ss'} <*lex*> s_finite_psubset
[PROOF STEP]
apply(subgoal_tac "s_choose w \<in> s_\<alpha> w")
[PROOF STATE]
proof (prove)
goal (5 subgoals):
 1. \<And>ss w. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); s_\<alpha> w \<noteq> {}; s_choose w \<in> s_\<alpha> w\<rbrakk> \<Longrightarrow> case propa f (step (s_choose w) (ss ! s_choose w)) ss (s_remove (s_choose w) w) of (ss, w) \<Rightarrow> ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n)
 2. \<And>ss w. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); s_\<alpha> w \<noteq> {}\<rbrakk> \<Longrightarrow> s_choose w \<in> s_\<alpha> w
 3. \<And>s. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); case s of (ss, w) \<Rightarrow> ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> stables r step ts \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); \<not> (case s of (\<tau>s, w) \<Rightarrow> s_\<alpha> w \<noteq> {})\<rbrakk> \<Longrightarrow> t_\<alpha> s = (ss', w') \<longrightarrow> ss' \<in> list n A \<and> (\<forall>p<length ss'. Typing_Framework.stable r step ss' p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss' \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<length ts. Typing_Framework.stable r step ts p) \<longrightarrow> ss' [\<sqsubseteq>\<^bsub>r\<^esub>] ts)
 4. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f)\<rbrakk> \<Longrightarrow> wf ({(ss', ss). ss \<in> list n A \<and> ss' \<in> list n A \<and> ss [\<sqsubset>\<^bsub>r\<^esub>] ss'} <*lex*> s_finite_psubset)
 5. \<And>s. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); case s of (ss, w) \<Rightarrow> ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> stables r step ts \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); case s of (\<tau>s, w) \<Rightarrow> s_\<alpha> w \<noteq> {}\<rbrakk> \<Longrightarrow> (case s of (\<tau>s, w) \<Rightarrow> let p = s_choose w in propa f (step p (\<tau>s ! p)) \<tau>s (s_remove p w), s) \<in> {(ss', ss). ss \<in> list n A \<and> ss' \<in> list n A \<and> ss [\<sqsubset>\<^bsub>r\<^esub>] ss'} <*lex*> s_finite_psubset
[PROOF STEP]
prefer 2
[PROOF STATE]
proof (prove)
goal (5 subgoals):
 1. \<And>ss w. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); s_\<alpha> w \<noteq> {}\<rbrakk> \<Longrightarrow> s_choose w \<in> s_\<alpha> w
 2. \<And>ss w. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); s_\<alpha> w \<noteq> {}; s_choose w \<in> s_\<alpha> w\<rbrakk> \<Longrightarrow> case propa f (step (s_choose w) (ss ! s_choose w)) ss (s_remove (s_choose w) w) of (ss, w) \<Rightarrow> ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n)
 3. \<And>s. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); case s of (ss, w) \<Rightarrow> ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> stables r step ts \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); \<not> (case s of (\<tau>s, w) \<Rightarrow> s_\<alpha> w \<noteq> {})\<rbrakk> \<Longrightarrow> t_\<alpha> s = (ss', w') \<longrightarrow> ss' \<in> list n A \<and> (\<forall>p<length ss'. Typing_Framework.stable r step ss' p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss' \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<length ts. Typing_Framework.stable r step ts p) \<longrightarrow> ss' [\<sqsubseteq>\<^bsub>r\<^esub>] ts)
 4. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f)\<rbrakk> \<Longrightarrow> wf ({(ss', ss). ss \<in> list n A \<and> ss' \<in> list n A \<and> ss [\<sqsubset>\<^bsub>r\<^esub>] ss'} <*lex*> s_finite_psubset)
 5. \<And>s. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); case s of (ss, w) \<Rightarrow> ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> stables r step ts \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); case s of (\<tau>s, w) \<Rightarrow> s_\<alpha> w \<noteq> {}\<rbrakk> \<Longrightarrow> (case s of (\<tau>s, w) \<Rightarrow> let p = s_choose w in propa f (step p (\<tau>s ! p)) \<tau>s (s_remove p w), s) \<in> {(ss', ss). ss \<in> list n A \<and> ss' \<in> list n A \<and> ss [\<sqsubset>\<^bsub>r\<^esub>] ss'} <*lex*> s_finite_psubset
[PROOF STEP]
apply(erule choose_spec)
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<And>ss w. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); s_\<alpha> w \<noteq> {}; s_choose w \<in> s_\<alpha> w\<rbrakk> \<Longrightarrow> case propa f (step (s_choose w) (ss ! s_choose w)) ss (s_remove (s_choose w) w) of (ss, w) \<Rightarrow> ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n)
 2. \<And>s. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); case s of (ss, w) \<Rightarrow> ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> stables r step ts \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); \<not> (case s of (\<tau>s, w) \<Rightarrow> s_\<alpha> w \<noteq> {})\<rbrakk> \<Longrightarrow> t_\<alpha> s = (ss', w') \<longrightarrow> ss' \<in> list n A \<and> (\<forall>p<length ss'. Typing_Framework.stable r step ss' p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss' \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<length ts. Typing_Framework.stable r step ts p) \<longrightarrow> ss' [\<sqsubseteq>\<^bsub>r\<^esub>] ts)
 3. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f)\<rbrakk> \<Longrightarrow> wf ({(ss', ss). ss \<in> list n A \<and> ss' \<in> list n A \<and> ss [\<sqsubset>\<^bsub>r\<^esub>] ss'} <*lex*> s_finite_psubset)
 4. \<And>s. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); case s of (ss, w) \<Rightarrow> ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> stables r step ts \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); case s of (\<tau>s, w) \<Rightarrow> s_\<alpha> w \<noteq> {}\<rbrakk> \<Longrightarrow> (case s of (\<tau>s, w) \<Rightarrow> let p = s_choose w in propa f (step p (\<tau>s ! p)) \<tau>s (s_remove p w), s) \<in> {(ss', ss). ss \<in> list n A \<and> ss' \<in> list n A \<and> ss [\<sqsubset>\<^bsub>r\<^esub>] ss'} <*lex*> s_finite_psubset
[PROOF STEP]
apply(subgoal_tac "\<forall>(q,t) \<in> set (step (s_choose w) (ss ! (s_choose w))). q < length ss \<and> t \<in> A")
[PROOF STATE]
proof (prove)
goal (5 subgoals):
 1. \<And>ss w. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); s_\<alpha> w \<noteq> {}; s_choose w \<in> s_\<alpha> w; \<forall>(q, t)\<in>set (step (s_choose w) (ss ! s_choose w)). q < length ss \<and> t \<in> A\<rbrakk> \<Longrightarrow> case propa f (step (s_choose w) (ss ! s_choose w)) ss (s_remove (s_choose w) w) of (ss, w) \<Rightarrow> ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n)
 2. \<And>ss w. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); s_\<alpha> w \<noteq> {}; s_choose w \<in> s_\<alpha> w\<rbrakk> \<Longrightarrow> \<forall>(q, t)\<in>set (step (s_choose w) (ss ! s_choose w)). q < length ss \<and> t \<in> A
 3. \<And>s. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); case s of (ss, w) \<Rightarrow> ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> stables r step ts \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); \<not> (case s of (\<tau>s, w) \<Rightarrow> s_\<alpha> w \<noteq> {})\<rbrakk> \<Longrightarrow> t_\<alpha> s = (ss', w') \<longrightarrow> ss' \<in> list n A \<and> (\<forall>p<length ss'. Typing_Framework.stable r step ss' p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss' \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<length ts. Typing_Framework.stable r step ts p) \<longrightarrow> ss' [\<sqsubseteq>\<^bsub>r\<^esub>] ts)
 4. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f)\<rbrakk> \<Longrightarrow> wf ({(ss', ss). ss \<in> list n A \<and> ss' \<in> list n A \<and> ss [\<sqsubset>\<^bsub>r\<^esub>] ss'} <*lex*> s_finite_psubset)
 5. \<And>s. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); case s of (ss, w) \<Rightarrow> ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> stables r step ts \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); case s of (\<tau>s, w) \<Rightarrow> s_\<alpha> w \<noteq> {}\<rbrakk> \<Longrightarrow> (case s of (\<tau>s, w) \<Rightarrow> let p = s_choose w in propa f (step p (\<tau>s ! p)) \<tau>s (s_remove p w), s) \<in> {(ss', ss). ss \<in> list n A \<and> ss' \<in> list n A \<and> ss [\<sqsubset>\<^bsub>r\<^esub>] ss'} <*lex*> s_finite_psubset
[PROOF STEP]
prefer 2
[PROOF STATE]
proof (prove)
goal (5 subgoals):
 1. \<And>ss w. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); s_\<alpha> w \<noteq> {}; s_choose w \<in> s_\<alpha> w\<rbrakk> \<Longrightarrow> \<forall>(q, t)\<in>set (step (s_choose w) (ss ! s_choose w)). q < length ss \<and> t \<in> A
 2. \<And>ss w. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); s_\<alpha> w \<noteq> {}; s_choose w \<in> s_\<alpha> w; \<forall>(q, t)\<in>set (step (s_choose w) (ss ! s_choose w)). q < length ss \<and> t \<in> A\<rbrakk> \<Longrightarrow> case propa f (step (s_choose w) (ss ! s_choose w)) ss (s_remove (s_choose w) w) of (ss, w) \<Rightarrow> ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n)
 3. \<And>s. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); case s of (ss, w) \<Rightarrow> ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> stables r step ts \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); \<not> (case s of (\<tau>s, w) \<Rightarrow> s_\<alpha> w \<noteq> {})\<rbrakk> \<Longrightarrow> t_\<alpha> s = (ss', w') \<longrightarrow> ss' \<in> list n A \<and> (\<forall>p<length ss'. Typing_Framework.stable r step ss' p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss' \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<length ts. Typing_Framework.stable r step ts p) \<longrightarrow> ss' [\<sqsubseteq>\<^bsub>r\<^esub>] ts)
 4. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f)\<rbrakk> \<Longrightarrow> wf ({(ss', ss). ss \<in> list n A \<and> ss' \<in> list n A \<and> ss [\<sqsubset>\<^bsub>r\<^esub>] ss'} <*lex*> s_finite_psubset)
 5. \<And>s. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); case s of (ss, w) \<Rightarrow> ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> stables r step ts \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); case s of (\<tau>s, w) \<Rightarrow> s_\<alpha> w \<noteq> {}\<rbrakk> \<Longrightarrow> (case s of (\<tau>s, w) \<Rightarrow> let p = s_choose w in propa f (step p (\<tau>s ! p)) \<tau>s (s_remove p w), s) \<in> {(ss', ss). ss \<in> list n A \<and> ss' \<in> list n A \<and> ss [\<sqsubset>\<^bsub>r\<^esub>] ss'} <*lex*> s_finite_psubset
[PROOF STEP]
apply clarify
[PROOF STATE]
proof (prove)
goal (5 subgoals):
 1. \<And>ss w a b. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); s_\<alpha> w \<noteq> {}; s_choose w \<in> s_\<alpha> w; (a, b) \<in> set (step (s_choose w) (ss ! s_choose w)); ss \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p; ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss; \<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts; \<forall>p\<in>s_\<alpha> w. p < n\<rbrakk> \<Longrightarrow> a < length ss \<and> b \<in> A
 2. \<And>ss w. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); s_\<alpha> w \<noteq> {}; s_choose w \<in> s_\<alpha> w; \<forall>(q, t)\<in>set (step (s_choose w) (ss ! s_choose w)). q < length ss \<and> t \<in> A\<rbrakk> \<Longrightarrow> case propa f (step (s_choose w) (ss ! s_choose w)) ss (s_remove (s_choose w) w) of (ss, w) \<Rightarrow> ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n)
 3. \<And>s. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); case s of (ss, w) \<Rightarrow> ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> stables r step ts \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); \<not> (case s of (\<tau>s, w) \<Rightarrow> s_\<alpha> w \<noteq> {})\<rbrakk> \<Longrightarrow> t_\<alpha> s = (ss', w') \<longrightarrow> ss' \<in> list n A \<and> (\<forall>p<length ss'. Typing_Framework.stable r step ss' p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss' \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<length ts. Typing_Framework.stable r step ts p) \<longrightarrow> ss' [\<sqsubseteq>\<^bsub>r\<^esub>] ts)
 4. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f)\<rbrakk> \<Longrightarrow> wf ({(ss', ss). ss \<in> list n A \<and> ss' \<in> list n A \<and> ss [\<sqsubset>\<^bsub>r\<^esub>] ss'} <*lex*> s_finite_psubset)
 5. \<And>s. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); case s of (ss, w) \<Rightarrow> ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> stables r step ts \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); case s of (\<tau>s, w) \<Rightarrow> s_\<alpha> w \<noteq> {}\<rbrakk> \<Longrightarrow> (case s of (\<tau>s, w) \<Rightarrow> let p = s_choose w in propa f (step p (\<tau>s ! p)) \<tau>s (s_remove p w), s) \<in> {(ss', ss). ss \<in> list n A \<and> ss' \<in> list n A \<and> ss [\<sqsubset>\<^bsub>r\<^esub>] ss'} <*lex*> s_finite_psubset
[PROOF STEP]
apply (rule conjI)
[PROOF STATE]
proof (prove)
goal (6 subgoals):
 1. \<And>ss w a b. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); s_\<alpha> w \<noteq> {}; s_choose w \<in> s_\<alpha> w; (a, b) \<in> set (step (s_choose w) (ss ! s_choose w)); ss \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p; ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss; \<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts; \<forall>p\<in>s_\<alpha> w. p < n\<rbrakk> \<Longrightarrow> a < length ss
 2. \<And>ss w a b. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); s_\<alpha> w \<noteq> {}; s_choose w \<in> s_\<alpha> w; (a, b) \<in> set (step (s_choose w) (ss ! s_choose w)); ss \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p; ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss; \<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts; \<forall>p\<in>s_\<alpha> w. p < n\<rbrakk> \<Longrightarrow> b \<in> A
 3. \<And>ss w. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); s_\<alpha> w \<noteq> {}; s_choose w \<in> s_\<alpha> w; \<forall>(q, t)\<in>set (step (s_choose w) (ss ! s_choose w)). q < length ss \<and> t \<in> A\<rbrakk> \<Longrightarrow> case propa f (step (s_choose w) (ss ! s_choose w)) ss (s_remove (s_choose w) w) of (ss, w) \<Rightarrow> ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n)
 4. \<And>s. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); case s of (ss, w) \<Rightarrow> ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> stables r step ts \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); \<not> (case s of (\<tau>s, w) \<Rightarrow> s_\<alpha> w \<noteq> {})\<rbrakk> \<Longrightarrow> t_\<alpha> s = (ss', w') \<longrightarrow> ss' \<in> list n A \<and> (\<forall>p<length ss'. Typing_Framework.stable r step ss' p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss' \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<length ts. Typing_Framework.stable r step ts p) \<longrightarrow> ss' [\<sqsubseteq>\<^bsub>r\<^esub>] ts)
 5. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f)\<rbrakk> \<Longrightarrow> wf ({(ss', ss). ss \<in> list n A \<and> ss' \<in> list n A \<and> ss [\<sqsubset>\<^bsub>r\<^esub>] ss'} <*lex*> s_finite_psubset)
 6. \<And>s. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); case s of (ss, w) \<Rightarrow> ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> stables r step ts \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); case s of (\<tau>s, w) \<Rightarrow> s_\<alpha> w \<noteq> {}\<rbrakk> \<Longrightarrow> (case s of (\<tau>s, w) \<Rightarrow> let p = s_choose w in propa f (step p (\<tau>s ! p)) \<tau>s (s_remove p w), s) \<in> {(ss', ss). ss \<in> list n A \<and> ss' \<in> list n A \<and> ss [\<sqsubset>\<^bsub>r\<^esub>] ss'} <*lex*> s_finite_psubset
[PROOF STEP]
apply(clarsimp, blast dest!: boundedD)
[PROOF STATE]
proof (prove)
goal (5 subgoals):
 1. \<And>ss w a b. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); s_\<alpha> w \<noteq> {}; s_choose w \<in> s_\<alpha> w; (a, b) \<in> set (step (s_choose w) (ss ! s_choose w)); ss \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p; ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss; \<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts; \<forall>p\<in>s_\<alpha> w. p < n\<rbrakk> \<Longrightarrow> b \<in> A
 2. \<And>ss w. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); s_\<alpha> w \<noteq> {}; s_choose w \<in> s_\<alpha> w; \<forall>(q, t)\<in>set (step (s_choose w) (ss ! s_choose w)). q < length ss \<and> t \<in> A\<rbrakk> \<Longrightarrow> case propa f (step (s_choose w) (ss ! s_choose w)) ss (s_remove (s_choose w) w) of (ss, w) \<Rightarrow> ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n)
 3. \<And>s. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); case s of (ss, w) \<Rightarrow> ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> stables r step ts \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); \<not> (case s of (\<tau>s, w) \<Rightarrow> s_\<alpha> w \<noteq> {})\<rbrakk> \<Longrightarrow> t_\<alpha> s = (ss', w') \<longrightarrow> ss' \<in> list n A \<and> (\<forall>p<length ss'. Typing_Framework.stable r step ss' p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss' \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<length ts. Typing_Framework.stable r step ts p) \<longrightarrow> ss' [\<sqsubseteq>\<^bsub>r\<^esub>] ts)
 4. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f)\<rbrakk> \<Longrightarrow> wf ({(ss', ss). ss \<in> list n A \<and> ss' \<in> list n A \<and> ss [\<sqsubset>\<^bsub>r\<^esub>] ss'} <*lex*> s_finite_psubset)
 5. \<And>s. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); case s of (ss, w) \<Rightarrow> ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> stables r step ts \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); case s of (\<tau>s, w) \<Rightarrow> s_\<alpha> w \<noteq> {}\<rbrakk> \<Longrightarrow> (case s of (\<tau>s, w) \<Rightarrow> let p = s_choose w in propa f (step p (\<tau>s ! p)) \<tau>s (s_remove p w), s) \<in> {(ss', ss). ss \<in> list n A \<and> ss' \<in> list n A \<and> ss [\<sqsubset>\<^bsub>r\<^esub>] ss'} <*lex*> s_finite_psubset
[PROOF STEP]
apply (erule pres_typeD)
[PROOF STATE]
proof (prove)
goal (7 subgoals):
 1. \<And>ss w a b. \<lbrakk>acc A r; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); s_\<alpha> w \<noteq> {}; s_choose w \<in> s_\<alpha> w; (a, b) \<in> set (step (s_choose w) (ss ! s_choose w)); ss \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p; ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss; \<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts; \<forall>p\<in>s_\<alpha> w. p < n\<rbrakk> \<Longrightarrow> ?s157 ss w a b \<in> A
 2. \<And>ss w a b. \<lbrakk>acc A r; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); s_\<alpha> w \<noteq> {}; s_choose w \<in> s_\<alpha> w; (a, b) \<in> set (step (s_choose w) (ss ! s_choose w)); ss \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p; ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss; \<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts; \<forall>p\<in>s_\<alpha> w. p < n\<rbrakk> \<Longrightarrow> ?p157 ss w a b < n
 3. \<And>ss w a b. \<lbrakk>acc A r; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); s_\<alpha> w \<noteq> {}; s_choose w \<in> s_\<alpha> w; (a, b) \<in> set (step (s_choose w) (ss ! s_choose w)); ss \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p; ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss; \<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts; \<forall>p\<in>s_\<alpha> w. p < n\<rbrakk> \<Longrightarrow> (?q157 ss w a b, b) \<in> set (step (?p157 ss w a b) (?s157 ss w a b))
 4. \<And>ss w. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); s_\<alpha> w \<noteq> {}; s_choose w \<in> s_\<alpha> w; \<forall>(q, t)\<in>set (step (s_choose w) (ss ! s_choose w)). q < length ss \<and> t \<in> A\<rbrakk> \<Longrightarrow> case propa f (step (s_choose w) (ss ! s_choose w)) ss (s_remove (s_choose w) w) of (ss, w) \<Rightarrow> ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n)
 5. \<And>s. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); case s of (ss, w) \<Rightarrow> ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> stables r step ts \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); \<not> (case s of (\<tau>s, w) \<Rightarrow> s_\<alpha> w \<noteq> {})\<rbrakk> \<Longrightarrow> t_\<alpha> s = (ss', w') \<longrightarrow> ss' \<in> list n A \<and> (\<forall>p<length ss'. Typing_Framework.stable r step ss' p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss' \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<length ts. Typing_Framework.stable r step ts p) \<longrightarrow> ss' [\<sqsubseteq>\<^bsub>r\<^esub>] ts)
 6. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f)\<rbrakk> \<Longrightarrow> wf ({(ss', ss). ss \<in> list n A \<and> ss' \<in> list n A \<and> ss [\<sqsubset>\<^bsub>r\<^esub>] ss'} <*lex*> s_finite_psubset)
 7. \<And>s. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); case s of (ss, w) \<Rightarrow> ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> stables r step ts \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); case s of (\<tau>s, w) \<Rightarrow> s_\<alpha> w \<noteq> {}\<rbrakk> \<Longrightarrow> (case s of (\<tau>s, w) \<Rightarrow> let p = s_choose w in propa f (step p (\<tau>s ! p)) \<tau>s (s_remove p w), s) \<in> {(ss', ss). ss \<in> list n A \<and> ss' \<in> list n A \<and> ss [\<sqsubset>\<^bsub>r\<^esub>] ss'} <*lex*> s_finite_psubset
[PROOF STEP]
prefer 3
[PROOF STATE]
proof (prove)
goal (7 subgoals):
 1. \<And>ss w a b. \<lbrakk>acc A r; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); s_\<alpha> w \<noteq> {}; s_choose w \<in> s_\<alpha> w; (a, b) \<in> set (step (s_choose w) (ss ! s_choose w)); ss \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p; ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss; \<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts; \<forall>p\<in>s_\<alpha> w. p < n\<rbrakk> \<Longrightarrow> (?q157 ss w a b, b) \<in> set (step (?p157 ss w a b) (?s157 ss w a b))
 2. \<And>ss w a b. \<lbrakk>acc A r; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); s_\<alpha> w \<noteq> {}; s_choose w \<in> s_\<alpha> w; (a, b) \<in> set (step (s_choose w) (ss ! s_choose w)); ss \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p; ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss; \<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts; \<forall>p\<in>s_\<alpha> w. p < n\<rbrakk> \<Longrightarrow> ?s157 ss w a b \<in> A
 3. \<And>ss w a b. \<lbrakk>acc A r; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); s_\<alpha> w \<noteq> {}; s_choose w \<in> s_\<alpha> w; (a, b) \<in> set (step (s_choose w) (ss ! s_choose w)); ss \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p; ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss; \<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts; \<forall>p\<in>s_\<alpha> w. p < n\<rbrakk> \<Longrightarrow> ?p157 ss w a b < n
 4. \<And>ss w. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); s_\<alpha> w \<noteq> {}; s_choose w \<in> s_\<alpha> w; \<forall>(q, t)\<in>set (step (s_choose w) (ss ! s_choose w)). q < length ss \<and> t \<in> A\<rbrakk> \<Longrightarrow> case propa f (step (s_choose w) (ss ! s_choose w)) ss (s_remove (s_choose w) w) of (ss, w) \<Rightarrow> ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n)
 5. \<And>s. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); case s of (ss, w) \<Rightarrow> ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> stables r step ts \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); \<not> (case s of (\<tau>s, w) \<Rightarrow> s_\<alpha> w \<noteq> {})\<rbrakk> \<Longrightarrow> t_\<alpha> s = (ss', w') \<longrightarrow> ss' \<in> list n A \<and> (\<forall>p<length ss'. Typing_Framework.stable r step ss' p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss' \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<length ts. Typing_Framework.stable r step ts p) \<longrightarrow> ss' [\<sqsubseteq>\<^bsub>r\<^esub>] ts)
 6. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f)\<rbrakk> \<Longrightarrow> wf ({(ss', ss). ss \<in> list n A \<and> ss' \<in> list n A \<and> ss [\<sqsubset>\<^bsub>r\<^esub>] ss'} <*lex*> s_finite_psubset)
 7. \<And>s. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); case s of (ss, w) \<Rightarrow> ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> stables r step ts \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); case s of (\<tau>s, w) \<Rightarrow> s_\<alpha> w \<noteq> {}\<rbrakk> \<Longrightarrow> (case s of (\<tau>s, w) \<Rightarrow> let p = s_choose w in propa f (step p (\<tau>s ! p)) \<tau>s (s_remove p w), s) \<in> {(ss', ss). ss \<in> list n A \<and> ss' \<in> list n A \<and> ss [\<sqsubset>\<^bsub>r\<^esub>] ss'} <*lex*> s_finite_psubset
[PROOF STEP]
apply assumption
[PROOF STATE]
proof (prove)
goal (6 subgoals):
 1. \<And>ss w a b. \<lbrakk>acc A r; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); s_\<alpha> w \<noteq> {}; s_choose w \<in> s_\<alpha> w; (a, b) \<in> set (step (s_choose w) (ss ! s_choose w)); ss \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p; ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss; \<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts; \<forall>p\<in>s_\<alpha> w. p < n\<rbrakk> \<Longrightarrow> ss ! s_choose w \<in> A
 2. \<And>ss w a b. \<lbrakk>acc A r; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); s_\<alpha> w \<noteq> {}; s_choose w \<in> s_\<alpha> w; (a, b) \<in> set (step (s_choose w) (ss ! s_choose w)); ss \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p; ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss; \<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts; \<forall>p\<in>s_\<alpha> w. p < n\<rbrakk> \<Longrightarrow> s_choose w < n
 3. \<And>ss w. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); s_\<alpha> w \<noteq> {}; s_choose w \<in> s_\<alpha> w; \<forall>(q, t)\<in>set (step (s_choose w) (ss ! s_choose w)). q < length ss \<and> t \<in> A\<rbrakk> \<Longrightarrow> case propa f (step (s_choose w) (ss ! s_choose w)) ss (s_remove (s_choose w) w) of (ss, w) \<Rightarrow> ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n)
 4. \<And>s. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); case s of (ss, w) \<Rightarrow> ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> stables r step ts \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); \<not> (case s of (\<tau>s, w) \<Rightarrow> s_\<alpha> w \<noteq> {})\<rbrakk> \<Longrightarrow> t_\<alpha> s = (ss', w') \<longrightarrow> ss' \<in> list n A \<and> (\<forall>p<length ss'. Typing_Framework.stable r step ss' p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss' \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<length ts. Typing_Framework.stable r step ts p) \<longrightarrow> ss' [\<sqsubseteq>\<^bsub>r\<^esub>] ts)
 5. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f)\<rbrakk> \<Longrightarrow> wf ({(ss', ss). ss \<in> list n A \<and> ss' \<in> list n A \<and> ss [\<sqsubset>\<^bsub>r\<^esub>] ss'} <*lex*> s_finite_psubset)
 6. \<And>s. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); case s of (ss, w) \<Rightarrow> ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> stables r step ts \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); case s of (\<tau>s, w) \<Rightarrow> s_\<alpha> w \<noteq> {}\<rbrakk> \<Longrightarrow> (case s of (\<tau>s, w) \<Rightarrow> let p = s_choose w in propa f (step p (\<tau>s ! p)) \<tau>s (s_remove p w), s) \<in> {(ss', ss). ss \<in> list n A \<and> ss' \<in> list n A \<and> ss [\<sqsubset>\<^bsub>r\<^esub>] ss'} <*lex*> s_finite_psubset
[PROOF STEP]
apply (erule listE_nth_in)
[PROOF STATE]
proof (prove)
goal (6 subgoals):
 1. \<And>ss w a b. \<lbrakk>acc A r; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); s_\<alpha> w \<noteq> {}; s_choose w \<in> s_\<alpha> w; (a, b) \<in> set (step (s_choose w) (ss ! s_choose w)); \<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p; ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss; \<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts; \<forall>p\<in>s_\<alpha> w. p < n\<rbrakk> \<Longrightarrow> s_choose w < n
 2. \<And>ss w a b. \<lbrakk>acc A r; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); s_\<alpha> w \<noteq> {}; s_choose w \<in> s_\<alpha> w; (a, b) \<in> set (step (s_choose w) (ss ! s_choose w)); ss \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p; ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss; \<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts; \<forall>p\<in>s_\<alpha> w. p < n\<rbrakk> \<Longrightarrow> s_choose w < n
 3. \<And>ss w. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); s_\<alpha> w \<noteq> {}; s_choose w \<in> s_\<alpha> w; \<forall>(q, t)\<in>set (step (s_choose w) (ss ! s_choose w)). q < length ss \<and> t \<in> A\<rbrakk> \<Longrightarrow> case propa f (step (s_choose w) (ss ! s_choose w)) ss (s_remove (s_choose w) w) of (ss, w) \<Rightarrow> ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n)
 4. \<And>s. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); case s of (ss, w) \<Rightarrow> ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> stables r step ts \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); \<not> (case s of (\<tau>s, w) \<Rightarrow> s_\<alpha> w \<noteq> {})\<rbrakk> \<Longrightarrow> t_\<alpha> s = (ss', w') \<longrightarrow> ss' \<in> list n A \<and> (\<forall>p<length ss'. Typing_Framework.stable r step ss' p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss' \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<length ts. Typing_Framework.stable r step ts p) \<longrightarrow> ss' [\<sqsubseteq>\<^bsub>r\<^esub>] ts)
 5. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f)\<rbrakk> \<Longrightarrow> wf ({(ss', ss). ss \<in> list n A \<and> ss' \<in> list n A \<and> ss [\<sqsubset>\<^bsub>r\<^esub>] ss'} <*lex*> s_finite_psubset)
 6. \<And>s. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); case s of (ss, w) \<Rightarrow> ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> stables r step ts \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); case s of (\<tau>s, w) \<Rightarrow> s_\<alpha> w \<noteq> {}\<rbrakk> \<Longrightarrow> (case s of (\<tau>s, w) \<Rightarrow> let p = s_choose w in propa f (step p (\<tau>s ! p)) \<tau>s (s_remove p w), s) \<in> {(ss', ss). ss \<in> list n A \<and> ss' \<in> list n A \<and> ss [\<sqsubset>\<^bsub>r\<^esub>] ss'} <*lex*> s_finite_psubset
[PROOF STEP]
apply blast
[PROOF STATE]
proof (prove)
goal (5 subgoals):
 1. \<And>ss w a b. \<lbrakk>acc A r; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); s_\<alpha> w \<noteq> {}; s_choose w \<in> s_\<alpha> w; (a, b) \<in> set (step (s_choose w) (ss ! s_choose w)); ss \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p; ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss; \<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts; \<forall>p\<in>s_\<alpha> w. p < n\<rbrakk> \<Longrightarrow> s_choose w < n
 2. \<And>ss w. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); s_\<alpha> w \<noteq> {}; s_choose w \<in> s_\<alpha> w; \<forall>(q, t)\<in>set (step (s_choose w) (ss ! s_choose w)). q < length ss \<and> t \<in> A\<rbrakk> \<Longrightarrow> case propa f (step (s_choose w) (ss ! s_choose w)) ss (s_remove (s_choose w) w) of (ss, w) \<Rightarrow> ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n)
 3. \<And>s. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); case s of (ss, w) \<Rightarrow> ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> stables r step ts \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); \<not> (case s of (\<tau>s, w) \<Rightarrow> s_\<alpha> w \<noteq> {})\<rbrakk> \<Longrightarrow> t_\<alpha> s = (ss', w') \<longrightarrow> ss' \<in> list n A \<and> (\<forall>p<length ss'. Typing_Framework.stable r step ss' p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss' \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<length ts. Typing_Framework.stable r step ts p) \<longrightarrow> ss' [\<sqsubseteq>\<^bsub>r\<^esub>] ts)
 4. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f)\<rbrakk> \<Longrightarrow> wf ({(ss', ss). ss \<in> list n A \<and> ss' \<in> list n A \<and> ss [\<sqsubset>\<^bsub>r\<^esub>] ss'} <*lex*> s_finite_psubset)
 5. \<And>s. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); case s of (ss, w) \<Rightarrow> ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> stables r step ts \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); case s of (\<tau>s, w) \<Rightarrow> s_\<alpha> w \<noteq> {}\<rbrakk> \<Longrightarrow> (case s of (\<tau>s, w) \<Rightarrow> let p = s_choose w in propa f (step p (\<tau>s ! p)) \<tau>s (s_remove p w), s) \<in> {(ss', ss). ss \<in> list n A \<and> ss' \<in> list n A \<and> ss [\<sqsubset>\<^bsub>r\<^esub>] ss'} <*lex*> s_finite_psubset
[PROOF STEP]
apply blast
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<And>ss w. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); s_\<alpha> w \<noteq> {}; s_choose w \<in> s_\<alpha> w; \<forall>(q, t)\<in>set (step (s_choose w) (ss ! s_choose w)). q < length ss \<and> t \<in> A\<rbrakk> \<Longrightarrow> case propa f (step (s_choose w) (ss ! s_choose w)) ss (s_remove (s_choose w) w) of (ss, w) \<Rightarrow> ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n)
 2. \<And>s. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); case s of (ss, w) \<Rightarrow> ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> stables r step ts \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); \<not> (case s of (\<tau>s, w) \<Rightarrow> s_\<alpha> w \<noteq> {})\<rbrakk> \<Longrightarrow> t_\<alpha> s = (ss', w') \<longrightarrow> ss' \<in> list n A \<and> (\<forall>p<length ss'. Typing_Framework.stable r step ss' p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss' \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<length ts. Typing_Framework.stable r step ts p) \<longrightarrow> ss' [\<sqsubseteq>\<^bsub>r\<^esub>] ts)
 3. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f)\<rbrakk> \<Longrightarrow> wf ({(ss', ss). ss \<in> list n A \<and> ss' \<in> list n A \<and> ss [\<sqsubset>\<^bsub>r\<^esub>] ss'} <*lex*> s_finite_psubset)
 4. \<And>s. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); case s of (ss, w) \<Rightarrow> ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> stables r step ts \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); case s of (\<tau>s, w) \<Rightarrow> s_\<alpha> w \<noteq> {}\<rbrakk> \<Longrightarrow> (case s of (\<tau>s, w) \<Rightarrow> let p = s_choose w in propa f (step p (\<tau>s ! p)) \<tau>s (s_remove p w), s) \<in> {(ss', ss). ss \<in> list n A \<and> ss' \<in> list n A \<and> ss [\<sqsubset>\<^bsub>r\<^esub>] ss'} <*lex*> s_finite_psubset
[PROOF STEP]
apply(subgoal_tac "(\<lambda>(ss, w).
              ss \<in> list n A \<and>
              (\<forall>p<n. p \<notin> w \<longrightarrow> stable r step ss p) \<and>
              ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and>
              (\<forall>ts\<in>list n A.
                  ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and>
              (\<forall>p\<in>w. p < n))
           (t_\<alpha> (propa f (step (s_choose w) (ss ! s_choose w)) ss
             (s_remove (s_choose w) w)))")
[PROOF STATE]
proof (prove)
goal (5 subgoals):
 1. \<And>ss w. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); s_\<alpha> w \<noteq> {}; s_choose w \<in> s_\<alpha> w; \<forall>(q, t)\<in>set (step (s_choose w) (ss ! s_choose w)). q < length ss \<and> t \<in> A; case t_\<alpha> (propa f (step (s_choose w) (ss ! s_choose w)) ss (s_remove (s_choose w) w)) of (ss, w) \<Rightarrow> ss \<in> list n A \<and> (\<forall>p<n. p \<notin> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>w. p < n)\<rbrakk> \<Longrightarrow> case propa f (step (s_choose w) (ss ! s_choose w)) ss (s_remove (s_choose w) w) of (ss, w) \<Rightarrow> ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n)
 2. \<And>ss w. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); s_\<alpha> w \<noteq> {}; s_choose w \<in> s_\<alpha> w; \<forall>(q, t)\<in>set (step (s_choose w) (ss ! s_choose w)). q < length ss \<and> t \<in> A\<rbrakk> \<Longrightarrow> case t_\<alpha> (propa f (step (s_choose w) (ss ! s_choose w)) ss (s_remove (s_choose w) w)) of (ss, w) \<Rightarrow> ss \<in> list n A \<and> (\<forall>p<n. p \<notin> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>w. p < n)
 3. \<And>s. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); case s of (ss, w) \<Rightarrow> ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> stables r step ts \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); \<not> (case s of (\<tau>s, w) \<Rightarrow> s_\<alpha> w \<noteq> {})\<rbrakk> \<Longrightarrow> t_\<alpha> s = (ss', w') \<longrightarrow> ss' \<in> list n A \<and> (\<forall>p<length ss'. Typing_Framework.stable r step ss' p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss' \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<length ts. Typing_Framework.stable r step ts p) \<longrightarrow> ss' [\<sqsubseteq>\<^bsub>r\<^esub>] ts)
 4. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f)\<rbrakk> \<Longrightarrow> wf ({(ss', ss). ss \<in> list n A \<and> ss' \<in> list n A \<and> ss [\<sqsubset>\<^bsub>r\<^esub>] ss'} <*lex*> s_finite_psubset)
 5. \<And>s. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); case s of (ss, w) \<Rightarrow> ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> stables r step ts \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); case s of (\<tau>s, w) \<Rightarrow> s_\<alpha> w \<noteq> {}\<rbrakk> \<Longrightarrow> (case s of (\<tau>s, w) \<Rightarrow> let p = s_choose w in propa f (step p (\<tau>s ! p)) \<tau>s (s_remove p w), s) \<in> {(ss', ss). ss \<in> list n A \<and> ss' \<in> list n A \<and> ss [\<sqsubset>\<^bsub>r\<^esub>] ss'} <*lex*> s_finite_psubset
[PROOF STEP]
apply(case_tac "propa f (step (s_choose w) (ss ! s_choose w)) ss (s_remove (s_choose w) w)")
[PROOF STATE]
proof (prove)
goal (5 subgoals):
 1. \<And>ss w a b. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); s_\<alpha> w \<noteq> {}; s_choose w \<in> s_\<alpha> w; \<forall>(q, t)\<in>set (step (s_choose w) (ss ! s_choose w)). q < length ss \<and> t \<in> A; case t_\<alpha> (propa f (step (s_choose w) (ss ! s_choose w)) ss (s_remove (s_choose w) w)) of (ss, w) \<Rightarrow> ss \<in> list n A \<and> (\<forall>p<n. p \<notin> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>w. p < n); propa f (step (s_choose w) (ss ! s_choose w)) ss (s_remove (s_choose w) w) = (a, b)\<rbrakk> \<Longrightarrow> case propa f (step (s_choose w) (ss ! s_choose w)) ss (s_remove (s_choose w) w) of (ss, w) \<Rightarrow> ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n)
 2. \<And>ss w. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); s_\<alpha> w \<noteq> {}; s_choose w \<in> s_\<alpha> w; \<forall>(q, t)\<in>set (step (s_choose w) (ss ! s_choose w)). q < length ss \<and> t \<in> A\<rbrakk> \<Longrightarrow> case t_\<alpha> (propa f (step (s_choose w) (ss ! s_choose w)) ss (s_remove (s_choose w) w)) of (ss, w) \<Rightarrow> ss \<in> list n A \<and> (\<forall>p<n. p \<notin> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>w. p < n)
 3. \<And>s. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); case s of (ss, w) \<Rightarrow> ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> stables r step ts \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); \<not> (case s of (\<tau>s, w) \<Rightarrow> s_\<alpha> w \<noteq> {})\<rbrakk> \<Longrightarrow> t_\<alpha> s = (ss', w') \<longrightarrow> ss' \<in> list n A \<and> (\<forall>p<length ss'. Typing_Framework.stable r step ss' p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss' \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<length ts. Typing_Framework.stable r step ts p) \<longrightarrow> ss' [\<sqsubseteq>\<^bsub>r\<^esub>] ts)
 4. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f)\<rbrakk> \<Longrightarrow> wf ({(ss', ss). ss \<in> list n A \<and> ss' \<in> list n A \<and> ss [\<sqsubset>\<^bsub>r\<^esub>] ss'} <*lex*> s_finite_psubset)
 5. \<And>s. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); case s of (ss, w) \<Rightarrow> ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> stables r step ts \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); case s of (\<tau>s, w) \<Rightarrow> s_\<alpha> w \<noteq> {}\<rbrakk> \<Longrightarrow> (case s of (\<tau>s, w) \<Rightarrow> let p = s_choose w in propa f (step p (\<tau>s ! p)) \<tau>s (s_remove p w), s) \<in> {(ss', ss). ss \<in> list n A \<and> ss' \<in> list n A \<and> ss [\<sqsubset>\<^bsub>r\<^esub>] ss'} <*lex*> s_finite_psubset
[PROOF STEP]
apply(simp)
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<And>ss w. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); s_\<alpha> w \<noteq> {}; s_choose w \<in> s_\<alpha> w; \<forall>(q, t)\<in>set (step (s_choose w) (ss ! s_choose w)). q < length ss \<and> t \<in> A\<rbrakk> \<Longrightarrow> case t_\<alpha> (propa f (step (s_choose w) (ss ! s_choose w)) ss (s_remove (s_choose w) w)) of (ss, w) \<Rightarrow> ss \<in> list n A \<and> (\<forall>p<n. p \<notin> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>w. p < n)
 2. \<And>s. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); case s of (ss, w) \<Rightarrow> ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> stables r step ts \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); \<not> (case s of (\<tau>s, w) \<Rightarrow> s_\<alpha> w \<noteq> {})\<rbrakk> \<Longrightarrow> t_\<alpha> s = (ss', w') \<longrightarrow> ss' \<in> list n A \<and> (\<forall>p<length ss'. Typing_Framework.stable r step ss' p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss' \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<length ts. Typing_Framework.stable r step ts p) \<longrightarrow> ss' [\<sqsubseteq>\<^bsub>r\<^esub>] ts)
 3. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f)\<rbrakk> \<Longrightarrow> wf ({(ss', ss). ss \<in> list n A \<and> ss' \<in> list n A \<and> ss [\<sqsubset>\<^bsub>r\<^esub>] ss'} <*lex*> s_finite_psubset)
 4. \<And>s. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); case s of (ss, w) \<Rightarrow> ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> stables r step ts \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); case s of (\<tau>s, w) \<Rightarrow> s_\<alpha> w \<noteq> {}\<rbrakk> \<Longrightarrow> (case s of (\<tau>s, w) \<Rightarrow> let p = s_choose w in propa f (step p (\<tau>s ! p)) \<tau>s (s_remove p w), s) \<in> {(ss', ss). ss \<in> list n A \<and> ss' \<in> list n A \<and> ss [\<sqsubset>\<^bsub>r\<^esub>] ss'} <*lex*> s_finite_psubset
[PROOF STEP]
apply (subst decomp_propa)
[PROOF STATE]
proof (prove)
goal (5 subgoals):
 1. \<And>ss w. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); s_\<alpha> w \<noteq> {}; s_choose w \<in> s_\<alpha> w; \<forall>(q, t)\<in>set (step (s_choose w) (ss ! s_choose w)). q < length ss \<and> t \<in> A\<rbrakk> \<Longrightarrow> \<forall>(q, t)\<in>set (step (s_choose w) (ss ! s_choose w)). q < length ss
 2. \<And>ss w. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); s_\<alpha> w \<noteq> {}; s_choose w \<in> s_\<alpha> w; \<forall>(q, t)\<in>set (step (s_choose w) (ss ! s_choose w)). q < length ss \<and> t \<in> A\<rbrakk> \<Longrightarrow> case (merges f (step (s_choose w) (ss ! s_choose w)) ss, {q. \<exists>t. (q, t) \<in> set (step (s_choose w) (ss ! s_choose w)) \<and> t \<squnion>\<^bsub>f\<^esub> ss ! q \<noteq> ss ! q} \<union> s_\<alpha> (s_remove (s_choose w) w)) of (ss, w) \<Rightarrow> ss \<in> list n A \<and> (\<forall>p<n. p \<notin> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>w. p < n)
 3. \<And>s. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); case s of (ss, w) \<Rightarrow> ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> stables r step ts \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); \<not> (case s of (\<tau>s, w) \<Rightarrow> s_\<alpha> w \<noteq> {})\<rbrakk> \<Longrightarrow> t_\<alpha> s = (ss', w') \<longrightarrow> ss' \<in> list n A \<and> (\<forall>p<length ss'. Typing_Framework.stable r step ss' p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss' \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<length ts. Typing_Framework.stable r step ts p) \<longrightarrow> ss' [\<sqsubseteq>\<^bsub>r\<^esub>] ts)
 4. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f)\<rbrakk> \<Longrightarrow> wf ({(ss', ss). ss \<in> list n A \<and> ss' \<in> list n A \<and> ss [\<sqsubset>\<^bsub>r\<^esub>] ss'} <*lex*> s_finite_psubset)
 5. \<And>s. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); case s of (ss, w) \<Rightarrow> ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> stables r step ts \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); case s of (\<tau>s, w) \<Rightarrow> s_\<alpha> w \<noteq> {}\<rbrakk> \<Longrightarrow> (case s of (\<tau>s, w) \<Rightarrow> let p = s_choose w in propa f (step p (\<tau>s ! p)) \<tau>s (s_remove p w), s) \<in> {(ss', ss). ss \<in> list n A \<and> ss' \<in> list n A \<and> ss [\<sqsubset>\<^bsub>r\<^esub>] ss'} <*lex*> s_finite_psubset
[PROOF STEP]
apply blast
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<And>ss w. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); s_\<alpha> w \<noteq> {}; s_choose w \<in> s_\<alpha> w; \<forall>(q, t)\<in>set (step (s_choose w) (ss ! s_choose w)). q < length ss \<and> t \<in> A\<rbrakk> \<Longrightarrow> case (merges f (step (s_choose w) (ss ! s_choose w)) ss, {q. \<exists>t. (q, t) \<in> set (step (s_choose w) (ss ! s_choose w)) \<and> t \<squnion>\<^bsub>f\<^esub> ss ! q \<noteq> ss ! q} \<union> s_\<alpha> (s_remove (s_choose w) w)) of (ss, w) \<Rightarrow> ss \<in> list n A \<and> (\<forall>p<n. p \<notin> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>w. p < n)
 2. \<And>s. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); case s of (ss, w) \<Rightarrow> ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> stables r step ts \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); \<not> (case s of (\<tau>s, w) \<Rightarrow> s_\<alpha> w \<noteq> {})\<rbrakk> \<Longrightarrow> t_\<alpha> s = (ss', w') \<longrightarrow> ss' \<in> list n A \<and> (\<forall>p<length ss'. Typing_Framework.stable r step ss' p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss' \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<length ts. Typing_Framework.stable r step ts p) \<longrightarrow> ss' [\<sqsubseteq>\<^bsub>r\<^esub>] ts)
 3. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f)\<rbrakk> \<Longrightarrow> wf ({(ss', ss). ss \<in> list n A \<and> ss' \<in> list n A \<and> ss [\<sqsubset>\<^bsub>r\<^esub>] ss'} <*lex*> s_finite_psubset)
 4. \<And>s. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); case s of (ss, w) \<Rightarrow> ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> stables r step ts \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); case s of (\<tau>s, w) \<Rightarrow> s_\<alpha> w \<noteq> {}\<rbrakk> \<Longrightarrow> (case s of (\<tau>s, w) \<Rightarrow> let p = s_choose w in propa f (step p (\<tau>s ! p)) \<tau>s (s_remove p w), s) \<in> {(ss', ss). ss \<in> list n A \<and> ss' \<in> list n A \<and> ss [\<sqsubset>\<^bsub>r\<^esub>] ss'} <*lex*> s_finite_psubset
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<And>ss w. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); s_\<alpha> w \<noteq> {}; s_choose w \<in> s_\<alpha> w; \<forall>x\<in>set (step (s_choose w) (ss ! s_choose w)). case x of (q, t) \<Rightarrow> q < length ss \<and> t \<in> A\<rbrakk> \<Longrightarrow> merges f (step (s_choose w) (ss ! s_choose w)) ss \<in> list n A \<and> (\<forall>p<n. (\<forall>t. (p, t) \<in> set (step (s_choose w) (ss ! s_choose w)) \<longrightarrow> t \<squnion>\<^bsub>f\<^esub> ss ! p = ss ! p) \<and> (p \<in> s_\<alpha> w \<longrightarrow> p = s_choose w) \<longrightarrow> Typing_Framework.stable r step (merges f (step (s_choose w) (ss ! s_choose w)) ss) p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] merges f (step (s_choose w) (ss ! s_choose w)) ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> merges f (step (s_choose w) (ss ! s_choose w)) ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>{q. \<exists>t. (q, t) \<in> set (step (s_choose w) (ss ! s_choose w)) \<and> t \<squnion>\<^bsub>f\<^esub> ss ! q \<noteq> ss ! q} \<union> (s_\<alpha> w - {s_choose w}). p < n)
 2. \<And>s. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); case s of (ss, w) \<Rightarrow> ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> stables r step ts \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); \<not> (case s of (\<tau>s, w) \<Rightarrow> s_\<alpha> w \<noteq> {})\<rbrakk> \<Longrightarrow> t_\<alpha> s = (ss', w') \<longrightarrow> ss' \<in> list n A \<and> (\<forall>p<length ss'. Typing_Framework.stable r step ss' p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss' \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<length ts. Typing_Framework.stable r step ts p) \<longrightarrow> ss' [\<sqsubseteq>\<^bsub>r\<^esub>] ts)
 3. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f)\<rbrakk> \<Longrightarrow> wf ({(ss', ss). ss \<in> list n A \<and> ss' \<in> list n A \<and> ss [\<sqsubset>\<^bsub>r\<^esub>] ss'} <*lex*> s_finite_psubset)
 4. \<And>s. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); case s of (ss, w) \<Rightarrow> ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> stables r step ts \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); case s of (\<tau>s, w) \<Rightarrow> s_\<alpha> w \<noteq> {}\<rbrakk> \<Longrightarrow> (case s of (\<tau>s, w) \<Rightarrow> let p = s_choose w in propa f (step p (\<tau>s ! p)) \<tau>s (s_remove p w), s) \<in> {(ss', ss). ss \<in> list n A \<and> ss' \<in> list n A \<and> ss [\<sqsubset>\<^bsub>r\<^esub>] ss'} <*lex*> s_finite_psubset
[PROOF STEP]
apply (rule conjI)
[PROOF STATE]
proof (prove)
goal (5 subgoals):
 1. \<And>ss w. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); s_\<alpha> w \<noteq> {}; s_choose w \<in> s_\<alpha> w; \<forall>x\<in>set (step (s_choose w) (ss ! s_choose w)). case x of (q, t) \<Rightarrow> q < length ss \<and> t \<in> A\<rbrakk> \<Longrightarrow> merges f (step (s_choose w) (ss ! s_choose w)) ss \<in> list n A
 2. \<And>ss w. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); s_\<alpha> w \<noteq> {}; s_choose w \<in> s_\<alpha> w; \<forall>x\<in>set (step (s_choose w) (ss ! s_choose w)). case x of (q, t) \<Rightarrow> q < length ss \<and> t \<in> A\<rbrakk> \<Longrightarrow> (\<forall>p<n. (\<forall>t. (p, t) \<in> set (step (s_choose w) (ss ! s_choose w)) \<longrightarrow> t \<squnion>\<^bsub>f\<^esub> ss ! p = ss ! p) \<and> (p \<in> s_\<alpha> w \<longrightarrow> p = s_choose w) \<longrightarrow> Typing_Framework.stable r step (merges f (step (s_choose w) (ss ! s_choose w)) ss) p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] merges f (step (s_choose w) (ss ! s_choose w)) ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> merges f (step (s_choose w) (ss ! s_choose w)) ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>{q. \<exists>t. (q, t) \<in> set (step (s_choose w) (ss ! s_choose w)) \<and> t \<squnion>\<^bsub>f\<^esub> ss ! q \<noteq> ss ! q} \<union> (s_\<alpha> w - {s_choose w}). p < n)
 3. \<And>s. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); case s of (ss, w) \<Rightarrow> ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> stables r step ts \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); \<not> (case s of (\<tau>s, w) \<Rightarrow> s_\<alpha> w \<noteq> {})\<rbrakk> \<Longrightarrow> t_\<alpha> s = (ss', w') \<longrightarrow> ss' \<in> list n A \<and> (\<forall>p<length ss'. Typing_Framework.stable r step ss' p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss' \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<length ts. Typing_Framework.stable r step ts p) \<longrightarrow> ss' [\<sqsubseteq>\<^bsub>r\<^esub>] ts)
 4. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f)\<rbrakk> \<Longrightarrow> wf ({(ss', ss). ss \<in> list n A \<and> ss' \<in> list n A \<and> ss [\<sqsubset>\<^bsub>r\<^esub>] ss'} <*lex*> s_finite_psubset)
 5. \<And>s. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); case s of (ss, w) \<Rightarrow> ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> stables r step ts \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); case s of (\<tau>s, w) \<Rightarrow> s_\<alpha> w \<noteq> {}\<rbrakk> \<Longrightarrow> (case s of (\<tau>s, w) \<Rightarrow> let p = s_choose w in propa f (step p (\<tau>s ! p)) \<tau>s (s_remove p w), s) \<in> {(ss', ss). ss \<in> list n A \<and> ss' \<in> list n A \<and> ss [\<sqsubset>\<^bsub>r\<^esub>] ss'} <*lex*> s_finite_psubset
[PROOF STEP]
apply (rule merges_preserves_type)
[PROOF STATE]
proof (prove)
goal (6 subgoals):
 1. \<And>ss w. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); s_\<alpha> w \<noteq> {}; s_choose w \<in> s_\<alpha> w; \<forall>x\<in>set (step (s_choose w) (ss ! s_choose w)). case x of (q, t) \<Rightarrow> q < length ss \<and> t \<in> A\<rbrakk> \<Longrightarrow> ss \<in> list n A
 2. \<And>ss w. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); s_\<alpha> w \<noteq> {}; s_choose w \<in> s_\<alpha> w; \<forall>x\<in>set (step (s_choose w) (ss ! s_choose w)). case x of (q, t) \<Rightarrow> q < length ss \<and> t \<in> A\<rbrakk> \<Longrightarrow> \<forall>(p, x)\<in>set (step (s_choose w) (ss ! s_choose w)). p < n \<and> x \<in> A
 3. \<And>ss w. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); s_\<alpha> w \<noteq> {}; s_choose w \<in> s_\<alpha> w; \<forall>x\<in>set (step (s_choose w) (ss ! s_choose w)). case x of (q, t) \<Rightarrow> q < length ss \<and> t \<in> A\<rbrakk> \<Longrightarrow> (\<forall>p<n. (\<forall>t. (p, t) \<in> set (step (s_choose w) (ss ! s_choose w)) \<longrightarrow> t \<squnion>\<^bsub>f\<^esub> ss ! p = ss ! p) \<and> (p \<in> s_\<alpha> w \<longrightarrow> p = s_choose w) \<longrightarrow> Typing_Framework.stable r step (merges f (step (s_choose w) (ss ! s_choose w)) ss) p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] merges f (step (s_choose w) (ss ! s_choose w)) ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> merges f (step (s_choose w) (ss ! s_choose w)) ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>{q. \<exists>t. (q, t) \<in> set (step (s_choose w) (ss ! s_choose w)) \<and> t \<squnion>\<^bsub>f\<^esub> ss ! q \<noteq> ss ! q} \<union> (s_\<alpha> w - {s_choose w}). p < n)
 4. \<And>s. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); case s of (ss, w) \<Rightarrow> ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> stables r step ts \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); \<not> (case s of (\<tau>s, w) \<Rightarrow> s_\<alpha> w \<noteq> {})\<rbrakk> \<Longrightarrow> t_\<alpha> s = (ss', w') \<longrightarrow> ss' \<in> list n A \<and> (\<forall>p<length ss'. Typing_Framework.stable r step ss' p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss' \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<length ts. Typing_Framework.stable r step ts p) \<longrightarrow> ss' [\<sqsubseteq>\<^bsub>r\<^esub>] ts)
 5. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f)\<rbrakk> \<Longrightarrow> wf ({(ss', ss). ss \<in> list n A \<and> ss' \<in> list n A \<and> ss [\<sqsubset>\<^bsub>r\<^esub>] ss'} <*lex*> s_finite_psubset)
 6. \<And>s. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); case s of (ss, w) \<Rightarrow> ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> stables r step ts \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); case s of (\<tau>s, w) \<Rightarrow> s_\<alpha> w \<noteq> {}\<rbrakk> \<Longrightarrow> (case s of (\<tau>s, w) \<Rightarrow> let p = s_choose w in propa f (step p (\<tau>s ! p)) \<tau>s (s_remove p w), s) \<in> {(ss', ss). ss \<in> list n A \<and> ss' \<in> list n A \<and> ss [\<sqsubset>\<^bsub>r\<^esub>] ss'} <*lex*> s_finite_psubset
[PROOF STEP]
apply blast
[PROOF STATE]
proof (prove)
goal (5 subgoals):
 1. \<And>ss w. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); s_\<alpha> w \<noteq> {}; s_choose w \<in> s_\<alpha> w; \<forall>x\<in>set (step (s_choose w) (ss ! s_choose w)). case x of (q, t) \<Rightarrow> q < length ss \<and> t \<in> A\<rbrakk> \<Longrightarrow> \<forall>(p, x)\<in>set (step (s_choose w) (ss ! s_choose w)). p < n \<and> x \<in> A
 2. \<And>ss w. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); s_\<alpha> w \<noteq> {}; s_choose w \<in> s_\<alpha> w; \<forall>x\<in>set (step (s_choose w) (ss ! s_choose w)). case x of (q, t) \<Rightarrow> q < length ss \<and> t \<in> A\<rbrakk> \<Longrightarrow> (\<forall>p<n. (\<forall>t. (p, t) \<in> set (step (s_choose w) (ss ! s_choose w)) \<longrightarrow> t \<squnion>\<^bsub>f\<^esub> ss ! p = ss ! p) \<and> (p \<in> s_\<alpha> w \<longrightarrow> p = s_choose w) \<longrightarrow> Typing_Framework.stable r step (merges f (step (s_choose w) (ss ! s_choose w)) ss) p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] merges f (step (s_choose w) (ss ! s_choose w)) ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> merges f (step (s_choose w) (ss ! s_choose w)) ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>{q. \<exists>t. (q, t) \<in> set (step (s_choose w) (ss ! s_choose w)) \<and> t \<squnion>\<^bsub>f\<^esub> ss ! q \<noteq> ss ! q} \<union> (s_\<alpha> w - {s_choose w}). p < n)
 3. \<And>s. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); case s of (ss, w) \<Rightarrow> ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> stables r step ts \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); \<not> (case s of (\<tau>s, w) \<Rightarrow> s_\<alpha> w \<noteq> {})\<rbrakk> \<Longrightarrow> t_\<alpha> s = (ss', w') \<longrightarrow> ss' \<in> list n A \<and> (\<forall>p<length ss'. Typing_Framework.stable r step ss' p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss' \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<length ts. Typing_Framework.stable r step ts p) \<longrightarrow> ss' [\<sqsubseteq>\<^bsub>r\<^esub>] ts)
 4. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f)\<rbrakk> \<Longrightarrow> wf ({(ss', ss). ss \<in> list n A \<and> ss' \<in> list n A \<and> ss [\<sqsubset>\<^bsub>r\<^esub>] ss'} <*lex*> s_finite_psubset)
 5. \<And>s. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); case s of (ss, w) \<Rightarrow> ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> stables r step ts \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); case s of (\<tau>s, w) \<Rightarrow> s_\<alpha> w \<noteq> {}\<rbrakk> \<Longrightarrow> (case s of (\<tau>s, w) \<Rightarrow> let p = s_choose w in propa f (step p (\<tau>s ! p)) \<tau>s (s_remove p w), s) \<in> {(ss', ss). ss \<in> list n A \<and> ss' \<in> list n A \<and> ss [\<sqsubset>\<^bsub>r\<^esub>] ss'} <*lex*> s_finite_psubset
[PROOF STEP]
apply clarify
[PROOF STATE]
proof (prove)
goal (5 subgoals):
 1. \<And>ss w a b. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); s_\<alpha> w \<noteq> {}; s_choose w \<in> s_\<alpha> w; \<forall>(q, t)\<in>set (step (s_choose w) (ss ! s_choose w)). q < length ss \<and> t \<in> A; (a, b) \<in> set (step (s_choose w) (ss ! s_choose w)); ss \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p; ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss; \<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts; \<forall>p\<in>s_\<alpha> w. p < n\<rbrakk> \<Longrightarrow> a < n \<and> b \<in> A
 2. \<And>ss w. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); s_\<alpha> w \<noteq> {}; s_choose w \<in> s_\<alpha> w; \<forall>x\<in>set (step (s_choose w) (ss ! s_choose w)). case x of (q, t) \<Rightarrow> q < length ss \<and> t \<in> A\<rbrakk> \<Longrightarrow> (\<forall>p<n. (\<forall>t. (p, t) \<in> set (step (s_choose w) (ss ! s_choose w)) \<longrightarrow> t \<squnion>\<^bsub>f\<^esub> ss ! p = ss ! p) \<and> (p \<in> s_\<alpha> w \<longrightarrow> p = s_choose w) \<longrightarrow> Typing_Framework.stable r step (merges f (step (s_choose w) (ss ! s_choose w)) ss) p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] merges f (step (s_choose w) (ss ! s_choose w)) ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> merges f (step (s_choose w) (ss ! s_choose w)) ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>{q. \<exists>t. (q, t) \<in> set (step (s_choose w) (ss ! s_choose w)) \<and> t \<squnion>\<^bsub>f\<^esub> ss ! q \<noteq> ss ! q} \<union> (s_\<alpha> w - {s_choose w}). p < n)
 3. \<And>s. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); case s of (ss, w) \<Rightarrow> ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> stables r step ts \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); \<not> (case s of (\<tau>s, w) \<Rightarrow> s_\<alpha> w \<noteq> {})\<rbrakk> \<Longrightarrow> t_\<alpha> s = (ss', w') \<longrightarrow> ss' \<in> list n A \<and> (\<forall>p<length ss'. Typing_Framework.stable r step ss' p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss' \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<length ts. Typing_Framework.stable r step ts p) \<longrightarrow> ss' [\<sqsubseteq>\<^bsub>r\<^esub>] ts)
 4. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f)\<rbrakk> \<Longrightarrow> wf ({(ss', ss). ss \<in> list n A \<and> ss' \<in> list n A \<and> ss [\<sqsubset>\<^bsub>r\<^esub>] ss'} <*lex*> s_finite_psubset)
 5. \<And>s. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); case s of (ss, w) \<Rightarrow> ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> stables r step ts \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); case s of (\<tau>s, w) \<Rightarrow> s_\<alpha> w \<noteq> {}\<rbrakk> \<Longrightarrow> (case s of (\<tau>s, w) \<Rightarrow> let p = s_choose w in propa f (step p (\<tau>s ! p)) \<tau>s (s_remove p w), s) \<in> {(ss', ss). ss \<in> list n A \<and> ss' \<in> list n A \<and> ss [\<sqsubset>\<^bsub>r\<^esub>] ss'} <*lex*> s_finite_psubset
[PROOF STEP]
apply (rule conjI)
[PROOF STATE]
proof (prove)
goal (6 subgoals):
 1. \<And>ss w a b. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); s_\<alpha> w \<noteq> {}; s_choose w \<in> s_\<alpha> w; \<forall>(q, t)\<in>set (step (s_choose w) (ss ! s_choose w)). q < length ss \<and> t \<in> A; (a, b) \<in> set (step (s_choose w) (ss ! s_choose w)); ss \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p; ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss; \<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts; \<forall>p\<in>s_\<alpha> w. p < n\<rbrakk> \<Longrightarrow> a < n
 2. \<And>ss w a b. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); s_\<alpha> w \<noteq> {}; s_choose w \<in> s_\<alpha> w; \<forall>(q, t)\<in>set (step (s_choose w) (ss ! s_choose w)). q < length ss \<and> t \<in> A; (a, b) \<in> set (step (s_choose w) (ss ! s_choose w)); ss \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p; ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss; \<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts; \<forall>p\<in>s_\<alpha> w. p < n\<rbrakk> \<Longrightarrow> b \<in> A
 3. \<And>ss w. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); s_\<alpha> w \<noteq> {}; s_choose w \<in> s_\<alpha> w; \<forall>x\<in>set (step (s_choose w) (ss ! s_choose w)). case x of (q, t) \<Rightarrow> q < length ss \<and> t \<in> A\<rbrakk> \<Longrightarrow> (\<forall>p<n. (\<forall>t. (p, t) \<in> set (step (s_choose w) (ss ! s_choose w)) \<longrightarrow> t \<squnion>\<^bsub>f\<^esub> ss ! p = ss ! p) \<and> (p \<in> s_\<alpha> w \<longrightarrow> p = s_choose w) \<longrightarrow> Typing_Framework.stable r step (merges f (step (s_choose w) (ss ! s_choose w)) ss) p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] merges f (step (s_choose w) (ss ! s_choose w)) ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> merges f (step (s_choose w) (ss ! s_choose w)) ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>{q. \<exists>t. (q, t) \<in> set (step (s_choose w) (ss ! s_choose w)) \<and> t \<squnion>\<^bsub>f\<^esub> ss ! q \<noteq> ss ! q} \<union> (s_\<alpha> w - {s_choose w}). p < n)
 4. \<And>s. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); case s of (ss, w) \<Rightarrow> ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> stables r step ts \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); \<not> (case s of (\<tau>s, w) \<Rightarrow> s_\<alpha> w \<noteq> {})\<rbrakk> \<Longrightarrow> t_\<alpha> s = (ss', w') \<longrightarrow> ss' \<in> list n A \<and> (\<forall>p<length ss'. Typing_Framework.stable r step ss' p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss' \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<length ts. Typing_Framework.stable r step ts p) \<longrightarrow> ss' [\<sqsubseteq>\<^bsub>r\<^esub>] ts)
 5. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f)\<rbrakk> \<Longrightarrow> wf ({(ss', ss). ss \<in> list n A \<and> ss' \<in> list n A \<and> ss [\<sqsubset>\<^bsub>r\<^esub>] ss'} <*lex*> s_finite_psubset)
 6. \<And>s. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); case s of (ss, w) \<Rightarrow> ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> stables r step ts \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); case s of (\<tau>s, w) \<Rightarrow> s_\<alpha> w \<noteq> {}\<rbrakk> \<Longrightarrow> (case s of (\<tau>s, w) \<Rightarrow> let p = s_choose w in propa f (step p (\<tau>s ! p)) \<tau>s (s_remove p w), s) \<in> {(ss', ss). ss \<in> list n A \<and> ss' \<in> list n A \<and> ss [\<sqsubset>\<^bsub>r\<^esub>] ss'} <*lex*> s_finite_psubset
[PROOF STEP]
apply(clarsimp, blast dest!: boundedD)
[PROOF STATE]
proof (prove)
goal (5 subgoals):
 1. \<And>ss w a b. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); s_\<alpha> w \<noteq> {}; s_choose w \<in> s_\<alpha> w; \<forall>(q, t)\<in>set (step (s_choose w) (ss ! s_choose w)). q < length ss \<and> t \<in> A; (a, b) \<in> set (step (s_choose w) (ss ! s_choose w)); ss \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p; ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss; \<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts; \<forall>p\<in>s_\<alpha> w. p < n\<rbrakk> \<Longrightarrow> b \<in> A
 2. \<And>ss w. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); s_\<alpha> w \<noteq> {}; s_choose w \<in> s_\<alpha> w; \<forall>x\<in>set (step (s_choose w) (ss ! s_choose w)). case x of (q, t) \<Rightarrow> q < length ss \<and> t \<in> A\<rbrakk> \<Longrightarrow> (\<forall>p<n. (\<forall>t. (p, t) \<in> set (step (s_choose w) (ss ! s_choose w)) \<longrightarrow> t \<squnion>\<^bsub>f\<^esub> ss ! p = ss ! p) \<and> (p \<in> s_\<alpha> w \<longrightarrow> p = s_choose w) \<longrightarrow> Typing_Framework.stable r step (merges f (step (s_choose w) (ss ! s_choose w)) ss) p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] merges f (step (s_choose w) (ss ! s_choose w)) ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> merges f (step (s_choose w) (ss ! s_choose w)) ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>{q. \<exists>t. (q, t) \<in> set (step (s_choose w) (ss ! s_choose w)) \<and> t \<squnion>\<^bsub>f\<^esub> ss ! q \<noteq> ss ! q} \<union> (s_\<alpha> w - {s_choose w}). p < n)
 3. \<And>s. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); case s of (ss, w) \<Rightarrow> ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> stables r step ts \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); \<not> (case s of (\<tau>s, w) \<Rightarrow> s_\<alpha> w \<noteq> {})\<rbrakk> \<Longrightarrow> t_\<alpha> s = (ss', w') \<longrightarrow> ss' \<in> list n A \<and> (\<forall>p<length ss'. Typing_Framework.stable r step ss' p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss' \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<length ts. Typing_Framework.stable r step ts p) \<longrightarrow> ss' [\<sqsubseteq>\<^bsub>r\<^esub>] ts)
 4. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f)\<rbrakk> \<Longrightarrow> wf ({(ss', ss). ss \<in> list n A \<and> ss' \<in> list n A \<and> ss [\<sqsubset>\<^bsub>r\<^esub>] ss'} <*lex*> s_finite_psubset)
 5. \<And>s. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); case s of (ss, w) \<Rightarrow> ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> stables r step ts \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); case s of (\<tau>s, w) \<Rightarrow> s_\<alpha> w \<noteq> {}\<rbrakk> \<Longrightarrow> (case s of (\<tau>s, w) \<Rightarrow> let p = s_choose w in propa f (step p (\<tau>s ! p)) \<tau>s (s_remove p w), s) \<in> {(ss', ss). ss \<in> list n A \<and> ss' \<in> list n A \<and> ss [\<sqsubset>\<^bsub>r\<^esub>] ss'} <*lex*> s_finite_psubset
[PROOF STEP]
apply (erule pres_typeD)
[PROOF STATE]
proof (prove)
goal (7 subgoals):
 1. \<And>ss w a b. \<lbrakk>acc A r; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); s_\<alpha> w \<noteq> {}; s_choose w \<in> s_\<alpha> w; \<forall>(q, t)\<in>set (step (s_choose w) (ss ! s_choose w)). q < length ss \<and> t \<in> A; (a, b) \<in> set (step (s_choose w) (ss ! s_choose w)); ss \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p; ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss; \<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts; \<forall>p\<in>s_\<alpha> w. p < n\<rbrakk> \<Longrightarrow> ?s1528 ss w a b \<in> A
 2. \<And>ss w a b. \<lbrakk>acc A r; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); s_\<alpha> w \<noteq> {}; s_choose w \<in> s_\<alpha> w; \<forall>(q, t)\<in>set (step (s_choose w) (ss ! s_choose w)). q < length ss \<and> t \<in> A; (a, b) \<in> set (step (s_choose w) (ss ! s_choose w)); ss \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p; ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss; \<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts; \<forall>p\<in>s_\<alpha> w. p < n\<rbrakk> \<Longrightarrow> ?p1528 ss w a b < n
 3. \<And>ss w a b. \<lbrakk>acc A r; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); s_\<alpha> w \<noteq> {}; s_choose w \<in> s_\<alpha> w; \<forall>(q, t)\<in>set (step (s_choose w) (ss ! s_choose w)). q < length ss \<and> t \<in> A; (a, b) \<in> set (step (s_choose w) (ss ! s_choose w)); ss \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p; ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss; \<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts; \<forall>p\<in>s_\<alpha> w. p < n\<rbrakk> \<Longrightarrow> (?q1528 ss w a b, b) \<in> set (step (?p1528 ss w a b) (?s1528 ss w a b))
 4. \<And>ss w. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); s_\<alpha> w \<noteq> {}; s_choose w \<in> s_\<alpha> w; \<forall>x\<in>set (step (s_choose w) (ss ! s_choose w)). case x of (q, t) \<Rightarrow> q < length ss \<and> t \<in> A\<rbrakk> \<Longrightarrow> (\<forall>p<n. (\<forall>t. (p, t) \<in> set (step (s_choose w) (ss ! s_choose w)) \<longrightarrow> t \<squnion>\<^bsub>f\<^esub> ss ! p = ss ! p) \<and> (p \<in> s_\<alpha> w \<longrightarrow> p = s_choose w) \<longrightarrow> Typing_Framework.stable r step (merges f (step (s_choose w) (ss ! s_choose w)) ss) p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] merges f (step (s_choose w) (ss ! s_choose w)) ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> merges f (step (s_choose w) (ss ! s_choose w)) ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>{q. \<exists>t. (q, t) \<in> set (step (s_choose w) (ss ! s_choose w)) \<and> t \<squnion>\<^bsub>f\<^esub> ss ! q \<noteq> ss ! q} \<union> (s_\<alpha> w - {s_choose w}). p < n)
 5. \<And>s. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); case s of (ss, w) \<Rightarrow> ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> stables r step ts \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); \<not> (case s of (\<tau>s, w) \<Rightarrow> s_\<alpha> w \<noteq> {})\<rbrakk> \<Longrightarrow> t_\<alpha> s = (ss', w') \<longrightarrow> ss' \<in> list n A \<and> (\<forall>p<length ss'. Typing_Framework.stable r step ss' p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss' \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<length ts. Typing_Framework.stable r step ts p) \<longrightarrow> ss' [\<sqsubseteq>\<^bsub>r\<^esub>] ts)
 6. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f)\<rbrakk> \<Longrightarrow> wf ({(ss', ss). ss \<in> list n A \<and> ss' \<in> list n A \<and> ss [\<sqsubset>\<^bsub>r\<^esub>] ss'} <*lex*> s_finite_psubset)
 7. \<And>s. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); case s of (ss, w) \<Rightarrow> ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> stables r step ts \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); case s of (\<tau>s, w) \<Rightarrow> s_\<alpha> w \<noteq> {}\<rbrakk> \<Longrightarrow> (case s of (\<tau>s, w) \<Rightarrow> let p = s_choose w in propa f (step p (\<tau>s ! p)) \<tau>s (s_remove p w), s) \<in> {(ss', ss). ss \<in> list n A \<and> ss' \<in> list n A \<and> ss [\<sqsubset>\<^bsub>r\<^esub>] ss'} <*lex*> s_finite_psubset
[PROOF STEP]
prefer 3
[PROOF STATE]
proof (prove)
goal (7 subgoals):
 1. \<And>ss w a b. \<lbrakk>acc A r; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); s_\<alpha> w \<noteq> {}; s_choose w \<in> s_\<alpha> w; \<forall>(q, t)\<in>set (step (s_choose w) (ss ! s_choose w)). q < length ss \<and> t \<in> A; (a, b) \<in> set (step (s_choose w) (ss ! s_choose w)); ss \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p; ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss; \<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts; \<forall>p\<in>s_\<alpha> w. p < n\<rbrakk> \<Longrightarrow> (?q1528 ss w a b, b) \<in> set (step (?p1528 ss w a b) (?s1528 ss w a b))
 2. \<And>ss w a b. \<lbrakk>acc A r; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); s_\<alpha> w \<noteq> {}; s_choose w \<in> s_\<alpha> w; \<forall>(q, t)\<in>set (step (s_choose w) (ss ! s_choose w)). q < length ss \<and> t \<in> A; (a, b) \<in> set (step (s_choose w) (ss ! s_choose w)); ss \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p; ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss; \<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts; \<forall>p\<in>s_\<alpha> w. p < n\<rbrakk> \<Longrightarrow> ?s1528 ss w a b \<in> A
 3. \<And>ss w a b. \<lbrakk>acc A r; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); s_\<alpha> w \<noteq> {}; s_choose w \<in> s_\<alpha> w; \<forall>(q, t)\<in>set (step (s_choose w) (ss ! s_choose w)). q < length ss \<and> t \<in> A; (a, b) \<in> set (step (s_choose w) (ss ! s_choose w)); ss \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p; ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss; \<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts; \<forall>p\<in>s_\<alpha> w. p < n\<rbrakk> \<Longrightarrow> ?p1528 ss w a b < n
 4. \<And>ss w. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); s_\<alpha> w \<noteq> {}; s_choose w \<in> s_\<alpha> w; \<forall>x\<in>set (step (s_choose w) (ss ! s_choose w)). case x of (q, t) \<Rightarrow> q < length ss \<and> t \<in> A\<rbrakk> \<Longrightarrow> (\<forall>p<n. (\<forall>t. (p, t) \<in> set (step (s_choose w) (ss ! s_choose w)) \<longrightarrow> t \<squnion>\<^bsub>f\<^esub> ss ! p = ss ! p) \<and> (p \<in> s_\<alpha> w \<longrightarrow> p = s_choose w) \<longrightarrow> Typing_Framework.stable r step (merges f (step (s_choose w) (ss ! s_choose w)) ss) p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] merges f (step (s_choose w) (ss ! s_choose w)) ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> merges f (step (s_choose w) (ss ! s_choose w)) ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>{q. \<exists>t. (q, t) \<in> set (step (s_choose w) (ss ! s_choose w)) \<and> t \<squnion>\<^bsub>f\<^esub> ss ! q \<noteq> ss ! q} \<union> (s_\<alpha> w - {s_choose w}). p < n)
 5. \<And>s. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); case s of (ss, w) \<Rightarrow> ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> stables r step ts \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); \<not> (case s of (\<tau>s, w) \<Rightarrow> s_\<alpha> w \<noteq> {})\<rbrakk> \<Longrightarrow> t_\<alpha> s = (ss', w') \<longrightarrow> ss' \<in> list n A \<and> (\<forall>p<length ss'. Typing_Framework.stable r step ss' p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss' \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<length ts. Typing_Framework.stable r step ts p) \<longrightarrow> ss' [\<sqsubseteq>\<^bsub>r\<^esub>] ts)
 6. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f)\<rbrakk> \<Longrightarrow> wf ({(ss', ss). ss \<in> list n A \<and> ss' \<in> list n A \<and> ss [\<sqsubset>\<^bsub>r\<^esub>] ss'} <*lex*> s_finite_psubset)
 7. \<And>s. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); case s of (ss, w) \<Rightarrow> ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> stables r step ts \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); case s of (\<tau>s, w) \<Rightarrow> s_\<alpha> w \<noteq> {}\<rbrakk> \<Longrightarrow> (case s of (\<tau>s, w) \<Rightarrow> let p = s_choose w in propa f (step p (\<tau>s ! p)) \<tau>s (s_remove p w), s) \<in> {(ss', ss). ss \<in> list n A \<and> ss' \<in> list n A \<and> ss [\<sqsubset>\<^bsub>r\<^esub>] ss'} <*lex*> s_finite_psubset
[PROOF STEP]
apply assumption
[PROOF STATE]
proof (prove)
goal (6 subgoals):
 1. \<And>ss w a b. \<lbrakk>acc A r; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); s_\<alpha> w \<noteq> {}; s_choose w \<in> s_\<alpha> w; \<forall>(q, t)\<in>set (step (s_choose w) (ss ! s_choose w)). q < length ss \<and> t \<in> A; (a, b) \<in> set (step (s_choose w) (ss ! s_choose w)); ss \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p; ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss; \<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts; \<forall>p\<in>s_\<alpha> w. p < n\<rbrakk> \<Longrightarrow> ss ! s_choose w \<in> A
 2. \<And>ss w a b. \<lbrakk>acc A r; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); s_\<alpha> w \<noteq> {}; s_choose w \<in> s_\<alpha> w; \<forall>(q, t)\<in>set (step (s_choose w) (ss ! s_choose w)). q < length ss \<and> t \<in> A; (a, b) \<in> set (step (s_choose w) (ss ! s_choose w)); ss \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p; ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss; \<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts; \<forall>p\<in>s_\<alpha> w. p < n\<rbrakk> \<Longrightarrow> s_choose w < n
 3. \<And>ss w. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); s_\<alpha> w \<noteq> {}; s_choose w \<in> s_\<alpha> w; \<forall>x\<in>set (step (s_choose w) (ss ! s_choose w)). case x of (q, t) \<Rightarrow> q < length ss \<and> t \<in> A\<rbrakk> \<Longrightarrow> (\<forall>p<n. (\<forall>t. (p, t) \<in> set (step (s_choose w) (ss ! s_choose w)) \<longrightarrow> t \<squnion>\<^bsub>f\<^esub> ss ! p = ss ! p) \<and> (p \<in> s_\<alpha> w \<longrightarrow> p = s_choose w) \<longrightarrow> Typing_Framework.stable r step (merges f (step (s_choose w) (ss ! s_choose w)) ss) p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] merges f (step (s_choose w) (ss ! s_choose w)) ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> merges f (step (s_choose w) (ss ! s_choose w)) ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>{q. \<exists>t. (q, t) \<in> set (step (s_choose w) (ss ! s_choose w)) \<and> t \<squnion>\<^bsub>f\<^esub> ss ! q \<noteq> ss ! q} \<union> (s_\<alpha> w - {s_choose w}). p < n)
 4. \<And>s. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); case s of (ss, w) \<Rightarrow> ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> stables r step ts \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); \<not> (case s of (\<tau>s, w) \<Rightarrow> s_\<alpha> w \<noteq> {})\<rbrakk> \<Longrightarrow> t_\<alpha> s = (ss', w') \<longrightarrow> ss' \<in> list n A \<and> (\<forall>p<length ss'. Typing_Framework.stable r step ss' p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss' \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<length ts. Typing_Framework.stable r step ts p) \<longrightarrow> ss' [\<sqsubseteq>\<^bsub>r\<^esub>] ts)
 5. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f)\<rbrakk> \<Longrightarrow> wf ({(ss', ss). ss \<in> list n A \<and> ss' \<in> list n A \<and> ss [\<sqsubset>\<^bsub>r\<^esub>] ss'} <*lex*> s_finite_psubset)
 6. \<And>s. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); case s of (ss, w) \<Rightarrow> ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> stables r step ts \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); case s of (\<tau>s, w) \<Rightarrow> s_\<alpha> w \<noteq> {}\<rbrakk> \<Longrightarrow> (case s of (\<tau>s, w) \<Rightarrow> let p = s_choose w in propa f (step p (\<tau>s ! p)) \<tau>s (s_remove p w), s) \<in> {(ss', ss). ss \<in> list n A \<and> ss' \<in> list n A \<and> ss [\<sqsubset>\<^bsub>r\<^esub>] ss'} <*lex*> s_finite_psubset
[PROOF STEP]
apply (erule listE_nth_in)
[PROOF STATE]
proof (prove)
goal (6 subgoals):
 1. \<And>ss w a b. \<lbrakk>acc A r; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); s_\<alpha> w \<noteq> {}; s_choose w \<in> s_\<alpha> w; \<forall>(q, t)\<in>set (step (s_choose w) (ss ! s_choose w)). q < length ss \<and> t \<in> A; (a, b) \<in> set (step (s_choose w) (ss ! s_choose w)); \<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p; ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss; \<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts; \<forall>p\<in>s_\<alpha> w. p < n\<rbrakk> \<Longrightarrow> s_choose w < n
 2. \<And>ss w a b. \<lbrakk>acc A r; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); s_\<alpha> w \<noteq> {}; s_choose w \<in> s_\<alpha> w; \<forall>(q, t)\<in>set (step (s_choose w) (ss ! s_choose w)). q < length ss \<and> t \<in> A; (a, b) \<in> set (step (s_choose w) (ss ! s_choose w)); ss \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p; ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss; \<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts; \<forall>p\<in>s_\<alpha> w. p < n\<rbrakk> \<Longrightarrow> s_choose w < n
 3. \<And>ss w. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); s_\<alpha> w \<noteq> {}; s_choose w \<in> s_\<alpha> w; \<forall>x\<in>set (step (s_choose w) (ss ! s_choose w)). case x of (q, t) \<Rightarrow> q < length ss \<and> t \<in> A\<rbrakk> \<Longrightarrow> (\<forall>p<n. (\<forall>t. (p, t) \<in> set (step (s_choose w) (ss ! s_choose w)) \<longrightarrow> t \<squnion>\<^bsub>f\<^esub> ss ! p = ss ! p) \<and> (p \<in> s_\<alpha> w \<longrightarrow> p = s_choose w) \<longrightarrow> Typing_Framework.stable r step (merges f (step (s_choose w) (ss ! s_choose w)) ss) p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] merges f (step (s_choose w) (ss ! s_choose w)) ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> merges f (step (s_choose w) (ss ! s_choose w)) ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>{q. \<exists>t. (q, t) \<in> set (step (s_choose w) (ss ! s_choose w)) \<and> t \<squnion>\<^bsub>f\<^esub> ss ! q \<noteq> ss ! q} \<union> (s_\<alpha> w - {s_choose w}). p < n)
 4. \<And>s. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); case s of (ss, w) \<Rightarrow> ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> stables r step ts \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); \<not> (case s of (\<tau>s, w) \<Rightarrow> s_\<alpha> w \<noteq> {})\<rbrakk> \<Longrightarrow> t_\<alpha> s = (ss', w') \<longrightarrow> ss' \<in> list n A \<and> (\<forall>p<length ss'. Typing_Framework.stable r step ss' p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss' \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<length ts. Typing_Framework.stable r step ts p) \<longrightarrow> ss' [\<sqsubseteq>\<^bsub>r\<^esub>] ts)
 5. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f)\<rbrakk> \<Longrightarrow> wf ({(ss', ss). ss \<in> list n A \<and> ss' \<in> list n A \<and> ss [\<sqsubset>\<^bsub>r\<^esub>] ss'} <*lex*> s_finite_psubset)
 6. \<And>s. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); case s of (ss, w) \<Rightarrow> ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> stables r step ts \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); case s of (\<tau>s, w) \<Rightarrow> s_\<alpha> w \<noteq> {}\<rbrakk> \<Longrightarrow> (case s of (\<tau>s, w) \<Rightarrow> let p = s_choose w in propa f (step p (\<tau>s ! p)) \<tau>s (s_remove p w), s) \<in> {(ss', ss). ss \<in> list n A \<and> ss' \<in> list n A \<and> ss [\<sqsubset>\<^bsub>r\<^esub>] ss'} <*lex*> s_finite_psubset
[PROOF STEP]
apply blast
[PROOF STATE]
proof (prove)
goal (5 subgoals):
 1. \<And>ss w a b. \<lbrakk>acc A r; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); s_\<alpha> w \<noteq> {}; s_choose w \<in> s_\<alpha> w; \<forall>(q, t)\<in>set (step (s_choose w) (ss ! s_choose w)). q < length ss \<and> t \<in> A; (a, b) \<in> set (step (s_choose w) (ss ! s_choose w)); ss \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p; ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss; \<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts; \<forall>p\<in>s_\<alpha> w. p < n\<rbrakk> \<Longrightarrow> s_choose w < n
 2. \<And>ss w. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); s_\<alpha> w \<noteq> {}; s_choose w \<in> s_\<alpha> w; \<forall>x\<in>set (step (s_choose w) (ss ! s_choose w)). case x of (q, t) \<Rightarrow> q < length ss \<and> t \<in> A\<rbrakk> \<Longrightarrow> (\<forall>p<n. (\<forall>t. (p, t) \<in> set (step (s_choose w) (ss ! s_choose w)) \<longrightarrow> t \<squnion>\<^bsub>f\<^esub> ss ! p = ss ! p) \<and> (p \<in> s_\<alpha> w \<longrightarrow> p = s_choose w) \<longrightarrow> Typing_Framework.stable r step (merges f (step (s_choose w) (ss ! s_choose w)) ss) p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] merges f (step (s_choose w) (ss ! s_choose w)) ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> merges f (step (s_choose w) (ss ! s_choose w)) ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>{q. \<exists>t. (q, t) \<in> set (step (s_choose w) (ss ! s_choose w)) \<and> t \<squnion>\<^bsub>f\<^esub> ss ! q \<noteq> ss ! q} \<union> (s_\<alpha> w - {s_choose w}). p < n)
 3. \<And>s. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); case s of (ss, w) \<Rightarrow> ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> stables r step ts \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); \<not> (case s of (\<tau>s, w) \<Rightarrow> s_\<alpha> w \<noteq> {})\<rbrakk> \<Longrightarrow> t_\<alpha> s = (ss', w') \<longrightarrow> ss' \<in> list n A \<and> (\<forall>p<length ss'. Typing_Framework.stable r step ss' p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss' \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<length ts. Typing_Framework.stable r step ts p) \<longrightarrow> ss' [\<sqsubseteq>\<^bsub>r\<^esub>] ts)
 4. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f)\<rbrakk> \<Longrightarrow> wf ({(ss', ss). ss \<in> list n A \<and> ss' \<in> list n A \<and> ss [\<sqsubset>\<^bsub>r\<^esub>] ss'} <*lex*> s_finite_psubset)
 5. \<And>s. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); case s of (ss, w) \<Rightarrow> ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> stables r step ts \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); case s of (\<tau>s, w) \<Rightarrow> s_\<alpha> w \<noteq> {}\<rbrakk> \<Longrightarrow> (case s of (\<tau>s, w) \<Rightarrow> let p = s_choose w in propa f (step p (\<tau>s ! p)) \<tau>s (s_remove p w), s) \<in> {(ss', ss). ss \<in> list n A \<and> ss' \<in> list n A \<and> ss [\<sqsubset>\<^bsub>r\<^esub>] ss'} <*lex*> s_finite_psubset
[PROOF STEP]
apply blast
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<And>ss w. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); s_\<alpha> w \<noteq> {}; s_choose w \<in> s_\<alpha> w; \<forall>x\<in>set (step (s_choose w) (ss ! s_choose w)). case x of (q, t) \<Rightarrow> q < length ss \<and> t \<in> A\<rbrakk> \<Longrightarrow> (\<forall>p<n. (\<forall>t. (p, t) \<in> set (step (s_choose w) (ss ! s_choose w)) \<longrightarrow> t \<squnion>\<^bsub>f\<^esub> ss ! p = ss ! p) \<and> (p \<in> s_\<alpha> w \<longrightarrow> p = s_choose w) \<longrightarrow> Typing_Framework.stable r step (merges f (step (s_choose w) (ss ! s_choose w)) ss) p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] merges f (step (s_choose w) (ss ! s_choose w)) ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> merges f (step (s_choose w) (ss ! s_choose w)) ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>{q. \<exists>t. (q, t) \<in> set (step (s_choose w) (ss ! s_choose w)) \<and> t \<squnion>\<^bsub>f\<^esub> ss ! q \<noteq> ss ! q} \<union> (s_\<alpha> w - {s_choose w}). p < n)
 2. \<And>s. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); case s of (ss, w) \<Rightarrow> ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> stables r step ts \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); \<not> (case s of (\<tau>s, w) \<Rightarrow> s_\<alpha> w \<noteq> {})\<rbrakk> \<Longrightarrow> t_\<alpha> s = (ss', w') \<longrightarrow> ss' \<in> list n A \<and> (\<forall>p<length ss'. Typing_Framework.stable r step ss' p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss' \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<length ts. Typing_Framework.stable r step ts p) \<longrightarrow> ss' [\<sqsubseteq>\<^bsub>r\<^esub>] ts)
 3. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f)\<rbrakk> \<Longrightarrow> wf ({(ss', ss). ss \<in> list n A \<and> ss' \<in> list n A \<and> ss [\<sqsubset>\<^bsub>r\<^esub>] ss'} <*lex*> s_finite_psubset)
 4. \<And>s. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); case s of (ss, w) \<Rightarrow> ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> stables r step ts \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); case s of (\<tau>s, w) \<Rightarrow> s_\<alpha> w \<noteq> {}\<rbrakk> \<Longrightarrow> (case s of (\<tau>s, w) \<Rightarrow> let p = s_choose w in propa f (step p (\<tau>s ! p)) \<tau>s (s_remove p w), s) \<in> {(ss', ss). ss \<in> list n A \<and> ss' \<in> list n A \<and> ss [\<sqsubset>\<^bsub>r\<^esub>] ss'} <*lex*> s_finite_psubset
[PROOF STEP]
apply (rule conjI)
[PROOF STATE]
proof (prove)
goal (5 subgoals):
 1. \<And>ss w. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); s_\<alpha> w \<noteq> {}; s_choose w \<in> s_\<alpha> w; \<forall>x\<in>set (step (s_choose w) (ss ! s_choose w)). case x of (q, t) \<Rightarrow> q < length ss \<and> t \<in> A\<rbrakk> \<Longrightarrow> \<forall>p<n. (\<forall>t. (p, t) \<in> set (step (s_choose w) (ss ! s_choose w)) \<longrightarrow> t \<squnion>\<^bsub>f\<^esub> ss ! p = ss ! p) \<and> (p \<in> s_\<alpha> w \<longrightarrow> p = s_choose w) \<longrightarrow> Typing_Framework.stable r step (merges f (step (s_choose w) (ss ! s_choose w)) ss) p
 2. \<And>ss w. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); s_\<alpha> w \<noteq> {}; s_choose w \<in> s_\<alpha> w; \<forall>x\<in>set (step (s_choose w) (ss ! s_choose w)). case x of (q, t) \<Rightarrow> q < length ss \<and> t \<in> A\<rbrakk> \<Longrightarrow> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] merges f (step (s_choose w) (ss ! s_choose w)) ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> merges f (step (s_choose w) (ss ! s_choose w)) ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>{q. \<exists>t. (q, t) \<in> set (step (s_choose w) (ss ! s_choose w)) \<and> t \<squnion>\<^bsub>f\<^esub> ss ! q \<noteq> ss ! q} \<union> (s_\<alpha> w - {s_choose w}). p < n)
 3. \<And>s. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); case s of (ss, w) \<Rightarrow> ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> stables r step ts \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); \<not> (case s of (\<tau>s, w) \<Rightarrow> s_\<alpha> w \<noteq> {})\<rbrakk> \<Longrightarrow> t_\<alpha> s = (ss', w') \<longrightarrow> ss' \<in> list n A \<and> (\<forall>p<length ss'. Typing_Framework.stable r step ss' p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss' \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<length ts. Typing_Framework.stable r step ts p) \<longrightarrow> ss' [\<sqsubseteq>\<^bsub>r\<^esub>] ts)
 4. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f)\<rbrakk> \<Longrightarrow> wf ({(ss', ss). ss \<in> list n A \<and> ss' \<in> list n A \<and> ss [\<sqsubset>\<^bsub>r\<^esub>] ss'} <*lex*> s_finite_psubset)
 5. \<And>s. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); case s of (ss, w) \<Rightarrow> ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> stables r step ts \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); case s of (\<tau>s, w) \<Rightarrow> s_\<alpha> w \<noteq> {}\<rbrakk> \<Longrightarrow> (case s of (\<tau>s, w) \<Rightarrow> let p = s_choose w in propa f (step p (\<tau>s ! p)) \<tau>s (s_remove p w), s) \<in> {(ss', ss). ss \<in> list n A \<and> ss' \<in> list n A \<and> ss [\<sqsubset>\<^bsub>r\<^esub>] ss'} <*lex*> s_finite_psubset
[PROOF STEP]
apply clarify
[PROOF STATE]
proof (prove)
goal (5 subgoals):
 1. \<And>ss w p. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); s_\<alpha> w \<noteq> {}; s_choose w \<in> s_\<alpha> w; \<forall>x\<in>set (step (s_choose w) (ss ! s_choose w)). case x of (q, t) \<Rightarrow> q < length ss \<and> t \<in> A; ss \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p; ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss; \<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts; \<forall>p\<in>s_\<alpha> w. p < n; p < n; \<forall>t. (p, t) \<in> set (step (s_choose w) (ss ! s_choose w)) \<longrightarrow> t \<squnion>\<^bsub>f\<^esub> ss ! p = ss ! p; p \<in> s_\<alpha> w \<longrightarrow> p = s_choose w\<rbrakk> \<Longrightarrow> Typing_Framework.stable r step (merges f (step (s_choose w) (ss ! s_choose w)) ss) p
 2. \<And>ss w. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); s_\<alpha> w \<noteq> {}; s_choose w \<in> s_\<alpha> w; \<forall>x\<in>set (step (s_choose w) (ss ! s_choose w)). case x of (q, t) \<Rightarrow> q < length ss \<and> t \<in> A\<rbrakk> \<Longrightarrow> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] merges f (step (s_choose w) (ss ! s_choose w)) ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> merges f (step (s_choose w) (ss ! s_choose w)) ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>{q. \<exists>t. (q, t) \<in> set (step (s_choose w) (ss ! s_choose w)) \<and> t \<squnion>\<^bsub>f\<^esub> ss ! q \<noteq> ss ! q} \<union> (s_\<alpha> w - {s_choose w}). p < n)
 3. \<And>s. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); case s of (ss, w) \<Rightarrow> ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> stables r step ts \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); \<not> (case s of (\<tau>s, w) \<Rightarrow> s_\<alpha> w \<noteq> {})\<rbrakk> \<Longrightarrow> t_\<alpha> s = (ss', w') \<longrightarrow> ss' \<in> list n A \<and> (\<forall>p<length ss'. Typing_Framework.stable r step ss' p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss' \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<length ts. Typing_Framework.stable r step ts p) \<longrightarrow> ss' [\<sqsubseteq>\<^bsub>r\<^esub>] ts)
 4. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f)\<rbrakk> \<Longrightarrow> wf ({(ss', ss). ss \<in> list n A \<and> ss' \<in> list n A \<and> ss [\<sqsubset>\<^bsub>r\<^esub>] ss'} <*lex*> s_finite_psubset)
 5. \<And>s. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); case s of (ss, w) \<Rightarrow> ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> stables r step ts \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); case s of (\<tau>s, w) \<Rightarrow> s_\<alpha> w \<noteq> {}\<rbrakk> \<Longrightarrow> (case s of (\<tau>s, w) \<Rightarrow> let p = s_choose w in propa f (step p (\<tau>s ! p)) \<tau>s (s_remove p w), s) \<in> {(ss', ss). ss \<in> list n A \<and> ss' \<in> list n A \<and> ss [\<sqsubset>\<^bsub>r\<^esub>] ss'} <*lex*> s_finite_psubset
[PROOF STEP]
apply (blast intro!: stable_pres_lemma)
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<And>ss w. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); s_\<alpha> w \<noteq> {}; s_choose w \<in> s_\<alpha> w; \<forall>x\<in>set (step (s_choose w) (ss ! s_choose w)). case x of (q, t) \<Rightarrow> q < length ss \<and> t \<in> A\<rbrakk> \<Longrightarrow> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] merges f (step (s_choose w) (ss ! s_choose w)) ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> merges f (step (s_choose w) (ss ! s_choose w)) ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>{q. \<exists>t. (q, t) \<in> set (step (s_choose w) (ss ! s_choose w)) \<and> t \<squnion>\<^bsub>f\<^esub> ss ! q \<noteq> ss ! q} \<union> (s_\<alpha> w - {s_choose w}). p < n)
 2. \<And>s. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); case s of (ss, w) \<Rightarrow> ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> stables r step ts \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); \<not> (case s of (\<tau>s, w) \<Rightarrow> s_\<alpha> w \<noteq> {})\<rbrakk> \<Longrightarrow> t_\<alpha> s = (ss', w') \<longrightarrow> ss' \<in> list n A \<and> (\<forall>p<length ss'. Typing_Framework.stable r step ss' p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss' \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<length ts. Typing_Framework.stable r step ts p) \<longrightarrow> ss' [\<sqsubseteq>\<^bsub>r\<^esub>] ts)
 3. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f)\<rbrakk> \<Longrightarrow> wf ({(ss', ss). ss \<in> list n A \<and> ss' \<in> list n A \<and> ss [\<sqsubset>\<^bsub>r\<^esub>] ss'} <*lex*> s_finite_psubset)
 4. \<And>s. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); case s of (ss, w) \<Rightarrow> ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> stables r step ts \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); case s of (\<tau>s, w) \<Rightarrow> s_\<alpha> w \<noteq> {}\<rbrakk> \<Longrightarrow> (case s of (\<tau>s, w) \<Rightarrow> let p = s_choose w in propa f (step p (\<tau>s ! p)) \<tau>s (s_remove p w), s) \<in> {(ss', ss). ss \<in> list n A \<and> ss' \<in> list n A \<and> ss [\<sqsubset>\<^bsub>r\<^esub>] ss'} <*lex*> s_finite_psubset
[PROOF STEP]
apply (rule conjI)
[PROOF STATE]
proof (prove)
goal (5 subgoals):
 1. \<And>ss w. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); s_\<alpha> w \<noteq> {}; s_choose w \<in> s_\<alpha> w; \<forall>x\<in>set (step (s_choose w) (ss ! s_choose w)). case x of (q, t) \<Rightarrow> q < length ss \<and> t \<in> A\<rbrakk> \<Longrightarrow> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] merges f (step (s_choose w) (ss ! s_choose w)) ss
 2. \<And>ss w. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); s_\<alpha> w \<noteq> {}; s_choose w \<in> s_\<alpha> w; \<forall>x\<in>set (step (s_choose w) (ss ! s_choose w)). case x of (q, t) \<Rightarrow> q < length ss \<and> t \<in> A\<rbrakk> \<Longrightarrow> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> merges f (step (s_choose w) (ss ! s_choose w)) ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>{q. \<exists>t. (q, t) \<in> set (step (s_choose w) (ss ! s_choose w)) \<and> t \<squnion>\<^bsub>f\<^esub> ss ! q \<noteq> ss ! q} \<union> (s_\<alpha> w - {s_choose w}). p < n)
 3. \<And>s. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); case s of (ss, w) \<Rightarrow> ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> stables r step ts \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); \<not> (case s of (\<tau>s, w) \<Rightarrow> s_\<alpha> w \<noteq> {})\<rbrakk> \<Longrightarrow> t_\<alpha> s = (ss', w') \<longrightarrow> ss' \<in> list n A \<and> (\<forall>p<length ss'. Typing_Framework.stable r step ss' p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss' \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<length ts. Typing_Framework.stable r step ts p) \<longrightarrow> ss' [\<sqsubseteq>\<^bsub>r\<^esub>] ts)
 4. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f)\<rbrakk> \<Longrightarrow> wf ({(ss', ss). ss \<in> list n A \<and> ss' \<in> list n A \<and> ss [\<sqsubset>\<^bsub>r\<^esub>] ss'} <*lex*> s_finite_psubset)
 5. \<And>s. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); case s of (ss, w) \<Rightarrow> ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> stables r step ts \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); case s of (\<tau>s, w) \<Rightarrow> s_\<alpha> w \<noteq> {}\<rbrakk> \<Longrightarrow> (case s of (\<tau>s, w) \<Rightarrow> let p = s_choose w in propa f (step p (\<tau>s ! p)) \<tau>s (s_remove p w), s) \<in> {(ss', ss). ss \<in> list n A \<and> ss' \<in> list n A \<and> ss [\<sqsubset>\<^bsub>r\<^esub>] ss'} <*lex*> s_finite_psubset
[PROOF STEP]
apply (blast intro!: merges_incr intro: le_list_trans)
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<And>ss w. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); s_\<alpha> w \<noteq> {}; s_choose w \<in> s_\<alpha> w; \<forall>x\<in>set (step (s_choose w) (ss ! s_choose w)). case x of (q, t) \<Rightarrow> q < length ss \<and> t \<in> A\<rbrakk> \<Longrightarrow> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> merges f (step (s_choose w) (ss ! s_choose w)) ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>{q. \<exists>t. (q, t) \<in> set (step (s_choose w) (ss ! s_choose w)) \<and> t \<squnion>\<^bsub>f\<^esub> ss ! q \<noteq> ss ! q} \<union> (s_\<alpha> w - {s_choose w}). p < n)
 2. \<And>s. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); case s of (ss, w) \<Rightarrow> ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> stables r step ts \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); \<not> (case s of (\<tau>s, w) \<Rightarrow> s_\<alpha> w \<noteq> {})\<rbrakk> \<Longrightarrow> t_\<alpha> s = (ss', w') \<longrightarrow> ss' \<in> list n A \<and> (\<forall>p<length ss'. Typing_Framework.stable r step ss' p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss' \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<length ts. Typing_Framework.stable r step ts p) \<longrightarrow> ss' [\<sqsubseteq>\<^bsub>r\<^esub>] ts)
 3. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f)\<rbrakk> \<Longrightarrow> wf ({(ss', ss). ss \<in> list n A \<and> ss' \<in> list n A \<and> ss [\<sqsubset>\<^bsub>r\<^esub>] ss'} <*lex*> s_finite_psubset)
 4. \<And>s. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); case s of (ss, w) \<Rightarrow> ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> stables r step ts \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); case s of (\<tau>s, w) \<Rightarrow> s_\<alpha> w \<noteq> {}\<rbrakk> \<Longrightarrow> (case s of (\<tau>s, w) \<Rightarrow> let p = s_choose w in propa f (step p (\<tau>s ! p)) \<tau>s (s_remove p w), s) \<in> {(ss', ss). ss \<in> list n A \<and> ss' \<in> list n A \<and> ss [\<sqsubset>\<^bsub>r\<^esub>] ss'} <*lex*> s_finite_psubset
[PROOF STEP]
apply (rule conjI)
[PROOF STATE]
proof (prove)
goal (5 subgoals):
 1. \<And>ss w. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); s_\<alpha> w \<noteq> {}; s_choose w \<in> s_\<alpha> w; \<forall>x\<in>set (step (s_choose w) (ss ! s_choose w)). case x of (q, t) \<Rightarrow> q < length ss \<and> t \<in> A\<rbrakk> \<Longrightarrow> \<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> merges f (step (s_choose w) (ss ! s_choose w)) ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts
 2. \<And>ss w. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); s_\<alpha> w \<noteq> {}; s_choose w \<in> s_\<alpha> w; \<forall>x\<in>set (step (s_choose w) (ss ! s_choose w)). case x of (q, t) \<Rightarrow> q < length ss \<and> t \<in> A\<rbrakk> \<Longrightarrow> \<forall>p\<in>{q. \<exists>t. (q, t) \<in> set (step (s_choose w) (ss ! s_choose w)) \<and> t \<squnion>\<^bsub>f\<^esub> ss ! q \<noteq> ss ! q} \<union> (s_\<alpha> w - {s_choose w}). p < n
 3. \<And>s. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); case s of (ss, w) \<Rightarrow> ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> stables r step ts \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); \<not> (case s of (\<tau>s, w) \<Rightarrow> s_\<alpha> w \<noteq> {})\<rbrakk> \<Longrightarrow> t_\<alpha> s = (ss', w') \<longrightarrow> ss' \<in> list n A \<and> (\<forall>p<length ss'. Typing_Framework.stable r step ss' p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss' \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<length ts. Typing_Framework.stable r step ts p) \<longrightarrow> ss' [\<sqsubseteq>\<^bsub>r\<^esub>] ts)
 4. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f)\<rbrakk> \<Longrightarrow> wf ({(ss', ss). ss \<in> list n A \<and> ss' \<in> list n A \<and> ss [\<sqsubset>\<^bsub>r\<^esub>] ss'} <*lex*> s_finite_psubset)
 5. \<And>s. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); case s of (ss, w) \<Rightarrow> ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> stables r step ts \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); case s of (\<tau>s, w) \<Rightarrow> s_\<alpha> w \<noteq> {}\<rbrakk> \<Longrightarrow> (case s of (\<tau>s, w) \<Rightarrow> let p = s_choose w in propa f (step p (\<tau>s ! p)) \<tau>s (s_remove p w), s) \<in> {(ss', ss). ss \<in> list n A \<and> ss' \<in> list n A \<and> ss [\<sqsubset>\<^bsub>r\<^esub>] ss'} <*lex*> s_finite_psubset
[PROOF STEP]
apply clarsimp
[PROOF STATE]
proof (prove)
goal (5 subgoals):
 1. \<And>ss w ts. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); s_\<alpha> w \<noteq> {}; s_choose w \<in> s_\<alpha> w; \<forall>x\<in>set (step (s_choose w) (ss ! s_choose w)). case x of (q, t) \<Rightarrow> q < n \<and> t \<in> A; ts \<in> list n A; ss \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p; ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss; \<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts; \<forall>p\<in>s_\<alpha> w. p < n; ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts; \<forall>p<n. Typing_Framework.stable r step ts p\<rbrakk> \<Longrightarrow> merges f (step (s_choose w) (ss ! s_choose w)) ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts
 2. \<And>ss w. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); s_\<alpha> w \<noteq> {}; s_choose w \<in> s_\<alpha> w; \<forall>x\<in>set (step (s_choose w) (ss ! s_choose w)). case x of (q, t) \<Rightarrow> q < length ss \<and> t \<in> A\<rbrakk> \<Longrightarrow> \<forall>p\<in>{q. \<exists>t. (q, t) \<in> set (step (s_choose w) (ss ! s_choose w)) \<and> t \<squnion>\<^bsub>f\<^esub> ss ! q \<noteq> ss ! q} \<union> (s_\<alpha> w - {s_choose w}). p < n
 3. \<And>s. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); case s of (ss, w) \<Rightarrow> ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> stables r step ts \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); \<not> (case s of (\<tau>s, w) \<Rightarrow> s_\<alpha> w \<noteq> {})\<rbrakk> \<Longrightarrow> t_\<alpha> s = (ss', w') \<longrightarrow> ss' \<in> list n A \<and> (\<forall>p<length ss'. Typing_Framework.stable r step ss' p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss' \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<length ts. Typing_Framework.stable r step ts p) \<longrightarrow> ss' [\<sqsubseteq>\<^bsub>r\<^esub>] ts)
 4. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f)\<rbrakk> \<Longrightarrow> wf ({(ss', ss). ss \<in> list n A \<and> ss' \<in> list n A \<and> ss [\<sqsubset>\<^bsub>r\<^esub>] ss'} <*lex*> s_finite_psubset)
 5. \<And>s. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); case s of (ss, w) \<Rightarrow> ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> stables r step ts \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); case s of (\<tau>s, w) \<Rightarrow> s_\<alpha> w \<noteq> {}\<rbrakk> \<Longrightarrow> (case s of (\<tau>s, w) \<Rightarrow> let p = s_choose w in propa f (step p (\<tau>s ! p)) \<tau>s (s_remove p w), s) \<in> {(ss', ss). ss \<in> list n A \<and> ss' \<in> list n A \<and> ss [\<sqsubset>\<^bsub>r\<^esub>] ss'} <*lex*> s_finite_psubset
[PROOF STEP]
apply (blast intro!: merges_bounded_lemma)
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<And>ss w. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); s_\<alpha> w \<noteq> {}; s_choose w \<in> s_\<alpha> w; \<forall>x\<in>set (step (s_choose w) (ss ! s_choose w)). case x of (q, t) \<Rightarrow> q < length ss \<and> t \<in> A\<rbrakk> \<Longrightarrow> \<forall>p\<in>{q. \<exists>t. (q, t) \<in> set (step (s_choose w) (ss ! s_choose w)) \<and> t \<squnion>\<^bsub>f\<^esub> ss ! q \<noteq> ss ! q} \<union> (s_\<alpha> w - {s_choose w}). p < n
 2. \<And>s. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); case s of (ss, w) \<Rightarrow> ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> stables r step ts \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); \<not> (case s of (\<tau>s, w) \<Rightarrow> s_\<alpha> w \<noteq> {})\<rbrakk> \<Longrightarrow> t_\<alpha> s = (ss', w') \<longrightarrow> ss' \<in> list n A \<and> (\<forall>p<length ss'. Typing_Framework.stable r step ss' p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss' \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<length ts. Typing_Framework.stable r step ts p) \<longrightarrow> ss' [\<sqsubseteq>\<^bsub>r\<^esub>] ts)
 3. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f)\<rbrakk> \<Longrightarrow> wf ({(ss', ss). ss \<in> list n A \<and> ss' \<in> list n A \<and> ss [\<sqsubset>\<^bsub>r\<^esub>] ss'} <*lex*> s_finite_psubset)
 4. \<And>s. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); case s of (ss, w) \<Rightarrow> ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> stables r step ts \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); case s of (\<tau>s, w) \<Rightarrow> s_\<alpha> w \<noteq> {}\<rbrakk> \<Longrightarrow> (case s of (\<tau>s, w) \<Rightarrow> let p = s_choose w in propa f (step p (\<tau>s ! p)) \<tau>s (s_remove p w), s) \<in> {(ss', ss). ss \<in> list n A \<and> ss' \<in> list n A \<and> ss [\<sqsubset>\<^bsub>r\<^esub>] ss'} <*lex*> s_finite_psubset
[PROOF STEP]
apply (blast dest!: boundedD)

  \<comment> \<open>Postcondition holds upon termination:\<close>
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>s. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); case s of (ss, w) \<Rightarrow> ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> stables r step ts \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); \<not> (case s of (\<tau>s, w) \<Rightarrow> s_\<alpha> w \<noteq> {})\<rbrakk> \<Longrightarrow> t_\<alpha> s = (ss', w') \<longrightarrow> ss' \<in> list n A \<and> (\<forall>p<length ss'. Typing_Framework.stable r step ss' p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss' \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<length ts. Typing_Framework.stable r step ts p) \<longrightarrow> ss' [\<sqsubseteq>\<^bsub>r\<^esub>] ts)
 2. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f)\<rbrakk> \<Longrightarrow> wf ({(ss', ss). ss \<in> list n A \<and> ss' \<in> list n A \<and> ss [\<sqsubset>\<^bsub>r\<^esub>] ss'} <*lex*> s_finite_psubset)
 3. \<And>s. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); case s of (ss, w) \<Rightarrow> ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> stables r step ts \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); case s of (\<tau>s, w) \<Rightarrow> s_\<alpha> w \<noteq> {}\<rbrakk> \<Longrightarrow> (case s of (\<tau>s, w) \<Rightarrow> let p = s_choose w in propa f (step p (\<tau>s ! p)) \<tau>s (s_remove p w), s) \<in> {(ss', ss). ss \<in> list n A \<and> ss' \<in> list n A \<and> ss [\<sqsubset>\<^bsub>r\<^esub>] ss'} <*lex*> s_finite_psubset
[PROOF STEP]
apply(clarsimp simp add: stables_def split_paired_all)

  \<comment> \<open>Well-foundedness of the termination relation:\<close>
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f)\<rbrakk> \<Longrightarrow> wf ({(ss', ss). ss \<in> list n A \<and> ss' \<in> list n A \<and> ss [\<sqsubset>\<^bsub>r\<^esub>] ss'} <*lex*> s_finite_psubset)
 2. \<And>s. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); case s of (ss, w) \<Rightarrow> ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> stables r step ts \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); case s of (\<tau>s, w) \<Rightarrow> s_\<alpha> w \<noteq> {}\<rbrakk> \<Longrightarrow> (case s of (\<tau>s, w) \<Rightarrow> let p = s_choose w in propa f (step p (\<tau>s ! p)) \<tau>s (s_remove p w), s) \<in> {(ss', ss). ss \<in> list n A \<and> ss' \<in> list n A \<and> ss [\<sqsubset>\<^bsub>r\<^esub>] ss'} <*lex*> s_finite_psubset
[PROOF STEP]
apply (rule wf_lex_prod)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f)\<rbrakk> \<Longrightarrow> wf {(ss', ss). ss \<in> list n A \<and> ss' \<in> list n A \<and> ss [\<sqsubset>\<^bsub>r\<^esub>] ss'}
 2. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f)\<rbrakk> \<Longrightarrow> wf s_finite_psubset
 3. \<And>s. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); case s of (ss, w) \<Rightarrow> ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> stables r step ts \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); case s of (\<tau>s, w) \<Rightarrow> s_\<alpha> w \<noteq> {}\<rbrakk> \<Longrightarrow> (case s of (\<tau>s, w) \<Rightarrow> let p = s_choose w in propa f (step p (\<tau>s ! p)) \<tau>s (s_remove p w), s) \<in> {(ss', ss). ss \<in> list n A \<and> ss' \<in> list n A \<and> ss [\<sqsubset>\<^bsub>r\<^esub>] ss'} <*lex*> s_finite_psubset
[PROOF STEP]
apply (insert orderI [THEN acc_le_listI])
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); \<And>A n. acc A r \<Longrightarrow> acc (list n A) (Listn.le r)\<rbrakk> \<Longrightarrow> wf {(ss', ss). ss \<in> list n A \<and> ss' \<in> list n A \<and> ss [\<sqsubset>\<^bsub>r\<^esub>] ss'}
 2. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); \<And>A n. acc A r \<Longrightarrow> acc (list n A) (Listn.le r)\<rbrakk> \<Longrightarrow> wf s_finite_psubset
 3. \<And>s. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); case s of (ss, w) \<Rightarrow> ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> stables r step ts \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); case s of (\<tau>s, w) \<Rightarrow> s_\<alpha> w \<noteq> {}; \<And>A n. acc A r \<Longrightarrow> acc (list n A) (Listn.le r)\<rbrakk> \<Longrightarrow> (case s of (\<tau>s, w) \<Rightarrow> let p = s_choose w in propa f (step p (\<tau>s ! p)) \<tau>s (s_remove p w), s) \<in> {(ss', ss). ss \<in> list n A \<and> ss' \<in> list n A \<and> ss [\<sqsubset>\<^bsub>r\<^esub>] ss'} <*lex*> s_finite_psubset
[PROOF STEP]
apply (simp only: acc_def lesssub_def)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); \<And>A n. acc A r \<Longrightarrow> acc (list n A) (Listn.le r)\<rbrakk> \<Longrightarrow> wf s_finite_psubset
 2. \<And>s. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); case s of (ss, w) \<Rightarrow> ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> stables r step ts \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); case s of (\<tau>s, w) \<Rightarrow> s_\<alpha> w \<noteq> {}; \<And>A n. acc A r \<Longrightarrow> acc (list n A) (Listn.le r)\<rbrakk> \<Longrightarrow> (case s of (\<tau>s, w) \<Rightarrow> let p = s_choose w in propa f (step p (\<tau>s ! p)) \<tau>s (s_remove p w), s) \<in> {(ss', ss). ss \<in> list n A \<and> ss' \<in> list n A \<and> ss [\<sqsubset>\<^bsub>r\<^esub>] ss'} <*lex*> s_finite_psubset
[PROOF STEP]
apply (rule wf_s_finite_psubset)

  \<comment> \<open>Loop decreases along termination relation:\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>s. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); case s of (ss, w) \<Rightarrow> ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> stables r step ts \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); case s of (\<tau>s, w) \<Rightarrow> s_\<alpha> w \<noteq> {}; \<And>A n. acc A r \<Longrightarrow> acc (list n A) (Listn.le r)\<rbrakk> \<Longrightarrow> (case s of (\<tau>s, w) \<Rightarrow> let p = s_choose w in propa f (step p (\<tau>s ! p)) \<tau>s (s_remove p w), s) \<in> {(ss', ss). ss \<in> list n A \<and> ss' \<in> list n A \<and> ss [\<sqsubset>\<^bsub>r\<^esub>] ss'} <*lex*> s_finite_psubset
[PROOF STEP]
apply(simp add: stables_def split_paired_all)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a b. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); a \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> b \<longrightarrow> Typing_Framework.stable r step a p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] a \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> a [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> b. p < n); s_\<alpha> b \<noteq> {}; \<And>A n. acc A r \<Longrightarrow> acc (list n A) (Listn.le r)\<rbrakk> \<Longrightarrow> (propa f (step (s_choose b) (a ! s_choose b)) a (s_remove (s_choose b) b), a, b) \<in> {(ss', ss). ss \<in> list n A \<and> ss' \<in> list n A \<and> ss [\<sqsubset>\<^bsub>r\<^esub>] ss'} <*lex*> s_finite_psubset
[PROOF STEP]
apply(rename_tac ss w)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>ss w. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); s_\<alpha> w \<noteq> {}; \<And>A n. acc A r \<Longrightarrow> acc (list n A) (Listn.le r)\<rbrakk> \<Longrightarrow> (propa f (step (s_choose w) (ss ! s_choose w)) ss (s_remove (s_choose w) w), ss, w) \<in> {(ss', ss). ss \<in> list n A \<and> ss' \<in> list n A \<and> ss [\<sqsubset>\<^bsub>r\<^esub>] ss'} <*lex*> s_finite_psubset
[PROOF STEP]
apply(subgoal_tac "s_choose w \<in> s_\<alpha> w")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>ss w. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); s_\<alpha> w \<noteq> {}; \<And>A n. acc A r \<Longrightarrow> acc (list n A) (Listn.le r); s_choose w \<in> s_\<alpha> w\<rbrakk> \<Longrightarrow> (propa f (step (s_choose w) (ss ! s_choose w)) ss (s_remove (s_choose w) w), ss, w) \<in> {(ss', ss). ss \<in> list n A \<and> ss' \<in> list n A \<and> ss [\<sqsubset>\<^bsub>r\<^esub>] ss'} <*lex*> s_finite_psubset
 2. \<And>ss w. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); s_\<alpha> w \<noteq> {}; \<And>A n. acc A r \<Longrightarrow> acc (list n A) (Listn.le r)\<rbrakk> \<Longrightarrow> s_choose w \<in> s_\<alpha> w
[PROOF STEP]
prefer 2
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>ss w. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); s_\<alpha> w \<noteq> {}; \<And>A n. acc A r \<Longrightarrow> acc (list n A) (Listn.le r)\<rbrakk> \<Longrightarrow> s_choose w \<in> s_\<alpha> w
 2. \<And>ss w. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); s_\<alpha> w \<noteq> {}; \<And>A n. acc A r \<Longrightarrow> acc (list n A) (Listn.le r); s_choose w \<in> s_\<alpha> w\<rbrakk> \<Longrightarrow> (propa f (step (s_choose w) (ss ! s_choose w)) ss (s_remove (s_choose w) w), ss, w) \<in> {(ss', ss). ss \<in> list n A \<and> ss' \<in> list n A \<and> ss [\<sqsubset>\<^bsub>r\<^esub>] ss'} <*lex*> s_finite_psubset
[PROOF STEP]
apply (erule choose_spec)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>ss w. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); s_\<alpha> w \<noteq> {}; \<And>A n. acc A r \<Longrightarrow> acc (list n A) (Listn.le r); s_choose w \<in> s_\<alpha> w\<rbrakk> \<Longrightarrow> (propa f (step (s_choose w) (ss ! s_choose w)) ss (s_remove (s_choose w) w), ss, w) \<in> {(ss', ss). ss \<in> list n A \<and> ss' \<in> list n A \<and> ss [\<sqsubset>\<^bsub>r\<^esub>] ss'} <*lex*> s_finite_psubset
[PROOF STEP]
apply(subgoal_tac "\<forall>(q,t) \<in> set (step (s_choose w) (ss ! (s_choose w))). q < length ss \<and> t \<in> A")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>ss w. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); s_\<alpha> w \<noteq> {}; \<And>A n. acc A r \<Longrightarrow> acc (list n A) (Listn.le r); s_choose w \<in> s_\<alpha> w; \<forall>(q, t)\<in>set (step (s_choose w) (ss ! s_choose w)). q < length ss \<and> t \<in> A\<rbrakk> \<Longrightarrow> (propa f (step (s_choose w) (ss ! s_choose w)) ss (s_remove (s_choose w) w), ss, w) \<in> {(ss', ss). ss \<in> list n A \<and> ss' \<in> list n A \<and> ss [\<sqsubset>\<^bsub>r\<^esub>] ss'} <*lex*> s_finite_psubset
 2. \<And>ss w. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); s_\<alpha> w \<noteq> {}; \<And>A n. acc A r \<Longrightarrow> acc (list n A) (Listn.le r); s_choose w \<in> s_\<alpha> w\<rbrakk> \<Longrightarrow> \<forall>(q, t)\<in>set (step (s_choose w) (ss ! s_choose w)). q < length ss \<and> t \<in> A
[PROOF STEP]
prefer 2
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>ss w. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); s_\<alpha> w \<noteq> {}; \<And>A n. acc A r \<Longrightarrow> acc (list n A) (Listn.le r); s_choose w \<in> s_\<alpha> w\<rbrakk> \<Longrightarrow> \<forall>(q, t)\<in>set (step (s_choose w) (ss ! s_choose w)). q < length ss \<and> t \<in> A
 2. \<And>ss w. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); s_\<alpha> w \<noteq> {}; \<And>A n. acc A r \<Longrightarrow> acc (list n A) (Listn.le r); s_choose w \<in> s_\<alpha> w; \<forall>(q, t)\<in>set (step (s_choose w) (ss ! s_choose w)). q < length ss \<and> t \<in> A\<rbrakk> \<Longrightarrow> (propa f (step (s_choose w) (ss ! s_choose w)) ss (s_remove (s_choose w) w), ss, w) \<in> {(ss', ss). ss \<in> list n A \<and> ss' \<in> list n A \<and> ss [\<sqsubset>\<^bsub>r\<^esub>] ss'} <*lex*> s_finite_psubset
[PROOF STEP]
apply clarify
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>ss w a b. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); s_\<alpha> w \<noteq> {}; \<And>A n. acc A r \<Longrightarrow> acc (list n A) (Listn.le r); s_choose w \<in> s_\<alpha> w; (a, b) \<in> set (step (s_choose w) (ss ! s_choose w)); ss \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p; ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss; \<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts; \<forall>p\<in>s_\<alpha> w. p < n\<rbrakk> \<Longrightarrow> a < length ss \<and> b \<in> A
 2. \<And>ss w. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); s_\<alpha> w \<noteq> {}; \<And>A n. acc A r \<Longrightarrow> acc (list n A) (Listn.le r); s_choose w \<in> s_\<alpha> w; \<forall>(q, t)\<in>set (step (s_choose w) (ss ! s_choose w)). q < length ss \<and> t \<in> A\<rbrakk> \<Longrightarrow> (propa f (step (s_choose w) (ss ! s_choose w)) ss (s_remove (s_choose w) w), ss, w) \<in> {(ss', ss). ss \<in> list n A \<and> ss' \<in> list n A \<and> ss [\<sqsubset>\<^bsub>r\<^esub>] ss'} <*lex*> s_finite_psubset
[PROOF STEP]
apply (rule conjI)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>ss w a b. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); s_\<alpha> w \<noteq> {}; \<And>A n. acc A r \<Longrightarrow> acc (list n A) (Listn.le r); s_choose w \<in> s_\<alpha> w; (a, b) \<in> set (step (s_choose w) (ss ! s_choose w)); ss \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p; ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss; \<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts; \<forall>p\<in>s_\<alpha> w. p < n\<rbrakk> \<Longrightarrow> a < length ss
 2. \<And>ss w a b. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); s_\<alpha> w \<noteq> {}; \<And>A n. acc A r \<Longrightarrow> acc (list n A) (Listn.le r); s_choose w \<in> s_\<alpha> w; (a, b) \<in> set (step (s_choose w) (ss ! s_choose w)); ss \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p; ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss; \<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts; \<forall>p\<in>s_\<alpha> w. p < n\<rbrakk> \<Longrightarrow> b \<in> A
 3. \<And>ss w. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); s_\<alpha> w \<noteq> {}; \<And>A n. acc A r \<Longrightarrow> acc (list n A) (Listn.le r); s_choose w \<in> s_\<alpha> w; \<forall>(q, t)\<in>set (step (s_choose w) (ss ! s_choose w)). q < length ss \<and> t \<in> A\<rbrakk> \<Longrightarrow> (propa f (step (s_choose w) (ss ! s_choose w)) ss (s_remove (s_choose w) w), ss, w) \<in> {(ss', ss). ss \<in> list n A \<and> ss' \<in> list n A \<and> ss [\<sqsubset>\<^bsub>r\<^esub>] ss'} <*lex*> s_finite_psubset
[PROOF STEP]
apply(clarsimp, blast dest!: boundedD)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>ss w a b. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); s_\<alpha> w \<noteq> {}; \<And>A n. acc A r \<Longrightarrow> acc (list n A) (Listn.le r); s_choose w \<in> s_\<alpha> w; (a, b) \<in> set (step (s_choose w) (ss ! s_choose w)); ss \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p; ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss; \<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts; \<forall>p\<in>s_\<alpha> w. p < n\<rbrakk> \<Longrightarrow> b \<in> A
 2. \<And>ss w. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); s_\<alpha> w \<noteq> {}; \<And>A n. acc A r \<Longrightarrow> acc (list n A) (Listn.le r); s_choose w \<in> s_\<alpha> w; \<forall>(q, t)\<in>set (step (s_choose w) (ss ! s_choose w)). q < length ss \<and> t \<in> A\<rbrakk> \<Longrightarrow> (propa f (step (s_choose w) (ss ! s_choose w)) ss (s_remove (s_choose w) w), ss, w) \<in> {(ss', ss). ss \<in> list n A \<and> ss' \<in> list n A \<and> ss [\<sqsubset>\<^bsub>r\<^esub>] ss'} <*lex*> s_finite_psubset
[PROOF STEP]
apply (erule pres_typeD)
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<And>ss w a b. \<lbrakk>acc A r; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); s_\<alpha> w \<noteq> {}; \<And>A n. acc A r \<Longrightarrow> acc (list n A) (Listn.le r); s_choose w \<in> s_\<alpha> w; (a, b) \<in> set (step (s_choose w) (ss ! s_choose w)); ss \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p; ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss; \<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts; \<forall>p\<in>s_\<alpha> w. p < n\<rbrakk> \<Longrightarrow> ?s3533 ss w a b \<in> A
 2. \<And>ss w a b. \<lbrakk>acc A r; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); s_\<alpha> w \<noteq> {}; \<And>A n. acc A r \<Longrightarrow> acc (list n A) (Listn.le r); s_choose w \<in> s_\<alpha> w; (a, b) \<in> set (step (s_choose w) (ss ! s_choose w)); ss \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p; ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss; \<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts; \<forall>p\<in>s_\<alpha> w. p < n\<rbrakk> \<Longrightarrow> ?p3533 ss w a b < n
 3. \<And>ss w a b. \<lbrakk>acc A r; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); s_\<alpha> w \<noteq> {}; \<And>A n. acc A r \<Longrightarrow> acc (list n A) (Listn.le r); s_choose w \<in> s_\<alpha> w; (a, b) \<in> set (step (s_choose w) (ss ! s_choose w)); ss \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p; ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss; \<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts; \<forall>p\<in>s_\<alpha> w. p < n\<rbrakk> \<Longrightarrow> (?q3533 ss w a b, b) \<in> set (step (?p3533 ss w a b) (?s3533 ss w a b))
 4. \<And>ss w. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); s_\<alpha> w \<noteq> {}; \<And>A n. acc A r \<Longrightarrow> acc (list n A) (Listn.le r); s_choose w \<in> s_\<alpha> w; \<forall>(q, t)\<in>set (step (s_choose w) (ss ! s_choose w)). q < length ss \<and> t \<in> A\<rbrakk> \<Longrightarrow> (propa f (step (s_choose w) (ss ! s_choose w)) ss (s_remove (s_choose w) w), ss, w) \<in> {(ss', ss). ss \<in> list n A \<and> ss' \<in> list n A \<and> ss [\<sqsubset>\<^bsub>r\<^esub>] ss'} <*lex*> s_finite_psubset
[PROOF STEP]
prefer 3
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<And>ss w a b. \<lbrakk>acc A r; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); s_\<alpha> w \<noteq> {}; \<And>A n. acc A r \<Longrightarrow> acc (list n A) (Listn.le r); s_choose w \<in> s_\<alpha> w; (a, b) \<in> set (step (s_choose w) (ss ! s_choose w)); ss \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p; ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss; \<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts; \<forall>p\<in>s_\<alpha> w. p < n\<rbrakk> \<Longrightarrow> (?q3533 ss w a b, b) \<in> set (step (?p3533 ss w a b) (?s3533 ss w a b))
 2. \<And>ss w a b. \<lbrakk>acc A r; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); s_\<alpha> w \<noteq> {}; \<And>A n. acc A r \<Longrightarrow> acc (list n A) (Listn.le r); s_choose w \<in> s_\<alpha> w; (a, b) \<in> set (step (s_choose w) (ss ! s_choose w)); ss \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p; ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss; \<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts; \<forall>p\<in>s_\<alpha> w. p < n\<rbrakk> \<Longrightarrow> ?s3533 ss w a b \<in> A
 3. \<And>ss w a b. \<lbrakk>acc A r; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); s_\<alpha> w \<noteq> {}; \<And>A n. acc A r \<Longrightarrow> acc (list n A) (Listn.le r); s_choose w \<in> s_\<alpha> w; (a, b) \<in> set (step (s_choose w) (ss ! s_choose w)); ss \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p; ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss; \<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts; \<forall>p\<in>s_\<alpha> w. p < n\<rbrakk> \<Longrightarrow> ?p3533 ss w a b < n
 4. \<And>ss w. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); s_\<alpha> w \<noteq> {}; \<And>A n. acc A r \<Longrightarrow> acc (list n A) (Listn.le r); s_choose w \<in> s_\<alpha> w; \<forall>(q, t)\<in>set (step (s_choose w) (ss ! s_choose w)). q < length ss \<and> t \<in> A\<rbrakk> \<Longrightarrow> (propa f (step (s_choose w) (ss ! s_choose w)) ss (s_remove (s_choose w) w), ss, w) \<in> {(ss', ss). ss \<in> list n A \<and> ss' \<in> list n A \<and> ss [\<sqsubset>\<^bsub>r\<^esub>] ss'} <*lex*> s_finite_psubset
[PROOF STEP]
apply assumption
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>ss w a b. \<lbrakk>acc A r; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); s_\<alpha> w \<noteq> {}; \<And>A n. acc A r \<Longrightarrow> acc (list n A) (Listn.le r); s_choose w \<in> s_\<alpha> w; (a, b) \<in> set (step (s_choose w) (ss ! s_choose w)); ss \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p; ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss; \<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts; \<forall>p\<in>s_\<alpha> w. p < n\<rbrakk> \<Longrightarrow> ss ! s_choose w \<in> A
 2. \<And>ss w a b. \<lbrakk>acc A r; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); s_\<alpha> w \<noteq> {}; \<And>A n. acc A r \<Longrightarrow> acc (list n A) (Listn.le r); s_choose w \<in> s_\<alpha> w; (a, b) \<in> set (step (s_choose w) (ss ! s_choose w)); ss \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p; ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss; \<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts; \<forall>p\<in>s_\<alpha> w. p < n\<rbrakk> \<Longrightarrow> s_choose w < n
 3. \<And>ss w. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); s_\<alpha> w \<noteq> {}; \<And>A n. acc A r \<Longrightarrow> acc (list n A) (Listn.le r); s_choose w \<in> s_\<alpha> w; \<forall>(q, t)\<in>set (step (s_choose w) (ss ! s_choose w)). q < length ss \<and> t \<in> A\<rbrakk> \<Longrightarrow> (propa f (step (s_choose w) (ss ! s_choose w)) ss (s_remove (s_choose w) w), ss, w) \<in> {(ss', ss). ss \<in> list n A \<and> ss' \<in> list n A \<and> ss [\<sqsubset>\<^bsub>r\<^esub>] ss'} <*lex*> s_finite_psubset
[PROOF STEP]
apply (erule listE_nth_in)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>ss w a b. \<lbrakk>acc A r; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); s_\<alpha> w \<noteq> {}; \<And>A n. acc A r \<Longrightarrow> acc (list n A) (Listn.le r); s_choose w \<in> s_\<alpha> w; (a, b) \<in> set (step (s_choose w) (ss ! s_choose w)); \<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p; ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss; \<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts; \<forall>p\<in>s_\<alpha> w. p < n\<rbrakk> \<Longrightarrow> s_choose w < n
 2. \<And>ss w a b. \<lbrakk>acc A r; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); s_\<alpha> w \<noteq> {}; \<And>A n. acc A r \<Longrightarrow> acc (list n A) (Listn.le r); s_choose w \<in> s_\<alpha> w; (a, b) \<in> set (step (s_choose w) (ss ! s_choose w)); ss \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p; ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss; \<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts; \<forall>p\<in>s_\<alpha> w. p < n\<rbrakk> \<Longrightarrow> s_choose w < n
 3. \<And>ss w. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); s_\<alpha> w \<noteq> {}; \<And>A n. acc A r \<Longrightarrow> acc (list n A) (Listn.le r); s_choose w \<in> s_\<alpha> w; \<forall>(q, t)\<in>set (step (s_choose w) (ss ! s_choose w)). q < length ss \<and> t \<in> A\<rbrakk> \<Longrightarrow> (propa f (step (s_choose w) (ss ! s_choose w)) ss (s_remove (s_choose w) w), ss, w) \<in> {(ss', ss). ss \<in> list n A \<and> ss' \<in> list n A \<and> ss [\<sqsubset>\<^bsub>r\<^esub>] ss'} <*lex*> s_finite_psubset
[PROOF STEP]
apply blast
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>ss w a b. \<lbrakk>acc A r; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); s_\<alpha> w \<noteq> {}; \<And>A n. acc A r \<Longrightarrow> acc (list n A) (Listn.le r); s_choose w \<in> s_\<alpha> w; (a, b) \<in> set (step (s_choose w) (ss ! s_choose w)); ss \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p; ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss; \<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts; \<forall>p\<in>s_\<alpha> w. p < n\<rbrakk> \<Longrightarrow> s_choose w < n
 2. \<And>ss w. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); s_\<alpha> w \<noteq> {}; \<And>A n. acc A r \<Longrightarrow> acc (list n A) (Listn.le r); s_choose w \<in> s_\<alpha> w; \<forall>(q, t)\<in>set (step (s_choose w) (ss ! s_choose w)). q < length ss \<and> t \<in> A\<rbrakk> \<Longrightarrow> (propa f (step (s_choose w) (ss ! s_choose w)) ss (s_remove (s_choose w) w), ss, w) \<in> {(ss', ss). ss \<in> list n A \<and> ss' \<in> list n A \<and> ss [\<sqsubset>\<^bsub>r\<^esub>] ss'} <*lex*> s_finite_psubset
[PROOF STEP]
apply blast
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>ss w. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); s_\<alpha> w \<noteq> {}; \<And>A n. acc A r \<Longrightarrow> acc (list n A) (Listn.le r); s_choose w \<in> s_\<alpha> w; \<forall>(q, t)\<in>set (step (s_choose w) (ss ! s_choose w)). q < length ss \<and> t \<in> A\<rbrakk> \<Longrightarrow> (propa f (step (s_choose w) (ss ! s_choose w)) ss (s_remove (s_choose w) w), ss, w) \<in> {(ss', ss). ss \<in> list n A \<and> ss' \<in> list n A \<and> ss [\<sqsubset>\<^bsub>r\<^esub>] ss'} <*lex*> s_finite_psubset
[PROOF STEP]
apply(subgoal_tac "(t_\<alpha> (propa f (step (s_choose w) (ss ! s_choose w)) ss
            (s_remove (s_choose w) w)),
           ss, s_\<alpha> w)
          \<in> {(ss', ss). ss \<in> list n A \<and> ss' \<in> list n A \<and> ss [\<sqsubset>\<^bsub>r\<^esub>] ss'} <*lex*> finite_psubset")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>ss w. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); s_\<alpha> w \<noteq> {}; \<And>A n. acc A r \<Longrightarrow> acc (list n A) (Listn.le r); s_choose w \<in> s_\<alpha> w; \<forall>(q, t)\<in>set (step (s_choose w) (ss ! s_choose w)). q < length ss \<and> t \<in> A; (t_\<alpha> (propa f (step (s_choose w) (ss ! s_choose w)) ss (s_remove (s_choose w) w)), ss, s_\<alpha> w) \<in> {(ss', ss). ss \<in> list n A \<and> ss' \<in> list n A \<and> ss [\<sqsubset>\<^bsub>r\<^esub>] ss'} <*lex*> finite_psubset\<rbrakk> \<Longrightarrow> (propa f (step (s_choose w) (ss ! s_choose w)) ss (s_remove (s_choose w) w), ss, w) \<in> {(ss', ss). ss \<in> list n A \<and> ss' \<in> list n A \<and> ss [\<sqsubset>\<^bsub>r\<^esub>] ss'} <*lex*> s_finite_psubset
 2. \<And>ss w. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); s_\<alpha> w \<noteq> {}; \<And>A n. acc A r \<Longrightarrow> acc (list n A) (Listn.le r); s_choose w \<in> s_\<alpha> w; \<forall>(q, t)\<in>set (step (s_choose w) (ss ! s_choose w)). q < length ss \<and> t \<in> A\<rbrakk> \<Longrightarrow> (t_\<alpha> (propa f (step (s_choose w) (ss ! s_choose w)) ss (s_remove (s_choose w) w)), ss, s_\<alpha> w) \<in> {(ss', ss). ss \<in> list n A \<and> ss' \<in> list n A \<and> ss [\<sqsubset>\<^bsub>r\<^esub>] ss'} <*lex*> finite_psubset
[PROOF STEP]
prefer 2
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>ss w. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); s_\<alpha> w \<noteq> {}; \<And>A n. acc A r \<Longrightarrow> acc (list n A) (Listn.le r); s_choose w \<in> s_\<alpha> w; \<forall>(q, t)\<in>set (step (s_choose w) (ss ! s_choose w)). q < length ss \<and> t \<in> A\<rbrakk> \<Longrightarrow> (t_\<alpha> (propa f (step (s_choose w) (ss ! s_choose w)) ss (s_remove (s_choose w) w)), ss, s_\<alpha> w) \<in> {(ss', ss). ss \<in> list n A \<and> ss' \<in> list n A \<and> ss [\<sqsubset>\<^bsub>r\<^esub>] ss'} <*lex*> finite_psubset
 2. \<And>ss w. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); s_\<alpha> w \<noteq> {}; \<And>A n. acc A r \<Longrightarrow> acc (list n A) (Listn.le r); s_choose w \<in> s_\<alpha> w; \<forall>(q, t)\<in>set (step (s_choose w) (ss ! s_choose w)). q < length ss \<and> t \<in> A; (t_\<alpha> (propa f (step (s_choose w) (ss ! s_choose w)) ss (s_remove (s_choose w) w)), ss, s_\<alpha> w) \<in> {(ss', ss). ss \<in> list n A \<and> ss' \<in> list n A \<and> ss [\<sqsubset>\<^bsub>r\<^esub>] ss'} <*lex*> finite_psubset\<rbrakk> \<Longrightarrow> (propa f (step (s_choose w) (ss ! s_choose w)) ss (s_remove (s_choose w) w), ss, w) \<in> {(ss', ss). ss \<in> list n A \<and> ss' \<in> list n A \<and> ss [\<sqsubset>\<^bsub>r\<^esub>] ss'} <*lex*> s_finite_psubset
[PROOF STEP]
apply (subst decomp_propa)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>ss w. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); s_\<alpha> w \<noteq> {}; \<And>A n. acc A r \<Longrightarrow> acc (list n A) (Listn.le r); s_choose w \<in> s_\<alpha> w; \<forall>(q, t)\<in>set (step (s_choose w) (ss ! s_choose w)). q < length ss \<and> t \<in> A\<rbrakk> \<Longrightarrow> \<forall>(q, t)\<in>set (step (s_choose w) (ss ! s_choose w)). q < length ss
 2. \<And>ss w. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); s_\<alpha> w \<noteq> {}; \<And>A n. acc A r \<Longrightarrow> acc (list n A) (Listn.le r); s_choose w \<in> s_\<alpha> w; \<forall>(q, t)\<in>set (step (s_choose w) (ss ! s_choose w)). q < length ss \<and> t \<in> A\<rbrakk> \<Longrightarrow> ((merges f (step (s_choose w) (ss ! s_choose w)) ss, {q. \<exists>t. (q, t) \<in> set (step (s_choose w) (ss ! s_choose w)) \<and> t \<squnion>\<^bsub>f\<^esub> ss ! q \<noteq> ss ! q} \<union> s_\<alpha> (s_remove (s_choose w) w)), ss, s_\<alpha> w) \<in> {(ss', ss). ss \<in> list n A \<and> ss' \<in> list n A \<and> ss [\<sqsubset>\<^bsub>r\<^esub>] ss'} <*lex*> finite_psubset
 3. \<And>ss w. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); s_\<alpha> w \<noteq> {}; \<And>A n. acc A r \<Longrightarrow> acc (list n A) (Listn.le r); s_choose w \<in> s_\<alpha> w; \<forall>(q, t)\<in>set (step (s_choose w) (ss ! s_choose w)). q < length ss \<and> t \<in> A; (t_\<alpha> (propa f (step (s_choose w) (ss ! s_choose w)) ss (s_remove (s_choose w) w)), ss, s_\<alpha> w) \<in> {(ss', ss). ss \<in> list n A \<and> ss' \<in> list n A \<and> ss [\<sqsubset>\<^bsub>r\<^esub>] ss'} <*lex*> finite_psubset\<rbrakk> \<Longrightarrow> (propa f (step (s_choose w) (ss ! s_choose w)) ss (s_remove (s_choose w) w), ss, w) \<in> {(ss', ss). ss \<in> list n A \<and> ss' \<in> list n A \<and> ss [\<sqsubset>\<^bsub>r\<^esub>] ss'} <*lex*> s_finite_psubset
[PROOF STEP]
apply blast
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>ss w. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); s_\<alpha> w \<noteq> {}; \<And>A n. acc A r \<Longrightarrow> acc (list n A) (Listn.le r); s_choose w \<in> s_\<alpha> w; \<forall>(q, t)\<in>set (step (s_choose w) (ss ! s_choose w)). q < length ss \<and> t \<in> A\<rbrakk> \<Longrightarrow> ((merges f (step (s_choose w) (ss ! s_choose w)) ss, {q. \<exists>t. (q, t) \<in> set (step (s_choose w) (ss ! s_choose w)) \<and> t \<squnion>\<^bsub>f\<^esub> ss ! q \<noteq> ss ! q} \<union> s_\<alpha> (s_remove (s_choose w) w)), ss, s_\<alpha> w) \<in> {(ss', ss). ss \<in> list n A \<and> ss' \<in> list n A \<and> ss [\<sqsubset>\<^bsub>r\<^esub>] ss'} <*lex*> finite_psubset
 2. \<And>ss w. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); s_\<alpha> w \<noteq> {}; \<And>A n. acc A r \<Longrightarrow> acc (list n A) (Listn.le r); s_choose w \<in> s_\<alpha> w; \<forall>(q, t)\<in>set (step (s_choose w) (ss ! s_choose w)). q < length ss \<and> t \<in> A; (t_\<alpha> (propa f (step (s_choose w) (ss ! s_choose w)) ss (s_remove (s_choose w) w)), ss, s_\<alpha> w) \<in> {(ss', ss). ss \<in> list n A \<and> ss' \<in> list n A \<and> ss [\<sqsubset>\<^bsub>r\<^esub>] ss'} <*lex*> finite_psubset\<rbrakk> \<Longrightarrow> (propa f (step (s_choose w) (ss ! s_choose w)) ss (s_remove (s_choose w) w), ss, w) \<in> {(ss', ss). ss \<in> list n A \<and> ss' \<in> list n A \<and> ss [\<sqsubset>\<^bsub>r\<^esub>] ss'} <*lex*> s_finite_psubset
[PROOF STEP]
apply clarify
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>ss w. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); s_\<alpha> w \<noteq> {}; \<And>A n. acc A r \<Longrightarrow> acc (list n A) (Listn.le r); s_choose w \<in> s_\<alpha> w; \<forall>(q, t)\<in>set (step (s_choose w) (ss ! s_choose w)). q < length ss \<and> t \<in> A; ss \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p; ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss; \<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts; \<forall>p\<in>s_\<alpha> w. p < n\<rbrakk> \<Longrightarrow> ((merges f (step (s_choose w) (ss ! s_choose w)) ss, {q. \<exists>t. (q, t) \<in> set (step (s_choose w) (ss ! s_choose w)) \<and> t \<squnion>\<^bsub>f\<^esub> ss ! q \<noteq> ss ! q} \<union> s_\<alpha> (s_remove (s_choose w) w)), ss, s_\<alpha> w) \<in> {(ss', ss). ss \<in> list n A \<and> ss' \<in> list n A \<and> ss [\<sqsubset>\<^bsub>r\<^esub>] ss'} <*lex*> finite_psubset
 2. \<And>ss w. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); s_\<alpha> w \<noteq> {}; \<And>A n. acc A r \<Longrightarrow> acc (list n A) (Listn.le r); s_choose w \<in> s_\<alpha> w; \<forall>(q, t)\<in>set (step (s_choose w) (ss ! s_choose w)). q < length ss \<and> t \<in> A; (t_\<alpha> (propa f (step (s_choose w) (ss ! s_choose w)) ss (s_remove (s_choose w) w)), ss, s_\<alpha> w) \<in> {(ss', ss). ss \<in> list n A \<and> ss' \<in> list n A \<and> ss [\<sqsubset>\<^bsub>r\<^esub>] ss'} <*lex*> finite_psubset\<rbrakk> \<Longrightarrow> (propa f (step (s_choose w) (ss ! s_choose w)) ss (s_remove (s_choose w) w), ss, w) \<in> {(ss', ss). ss \<in> list n A \<and> ss' \<in> list n A \<and> ss [\<sqsubset>\<^bsub>r\<^esub>] ss'} <*lex*> s_finite_psubset
[PROOF STEP]
apply (simp del: listE_length
               add: lex_prod_def finite_psubset_def bounded_nat_set_is_finite)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>ss w. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); s_\<alpha> w \<noteq> {}; \<And>A n. acc A r \<Longrightarrow> acc (list n A) (Listn.le r); s_choose w \<in> s_\<alpha> w; \<forall>x\<in>set (step (s_choose w) (ss ! s_choose w)). case x of (q, t) \<Rightarrow> q < length ss0 \<and> t \<in> A; ss \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p; ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss; \<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts; \<forall>p\<in>s_\<alpha> w. p < n\<rbrakk> \<Longrightarrow> merges f (step (s_choose w) (ss ! s_choose w)) ss \<in> list n A \<and> ss [\<sqsubset>\<^bsub>r\<^esub>] merges f (step (s_choose w) (ss ! s_choose w)) ss \<or> merges f (step (s_choose w) (ss ! s_choose w)) ss = ss \<and> {q. \<exists>t. (q, t) \<in> set (step (s_choose w) (ss ! s_choose w)) \<and> t \<squnion>\<^bsub>f\<^esub> ss ! q \<noteq> ss ! q} \<union> (s_\<alpha> w - {s_choose w}) \<subset> s_\<alpha> w
 2. \<And>ss w. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); s_\<alpha> w \<noteq> {}; \<And>A n. acc A r \<Longrightarrow> acc (list n A) (Listn.le r); s_choose w \<in> s_\<alpha> w; \<forall>(q, t)\<in>set (step (s_choose w) (ss ! s_choose w)). q < length ss \<and> t \<in> A; (t_\<alpha> (propa f (step (s_choose w) (ss ! s_choose w)) ss (s_remove (s_choose w) w)), ss, s_\<alpha> w) \<in> {(ss', ss). ss \<in> list n A \<and> ss' \<in> list n A \<and> ss [\<sqsubset>\<^bsub>r\<^esub>] ss'} <*lex*> finite_psubset\<rbrakk> \<Longrightarrow> (propa f (step (s_choose w) (ss ! s_choose w)) ss (s_remove (s_choose w) w), ss, w) \<in> {(ss', ss). ss \<in> list n A \<and> ss' \<in> list n A \<and> ss [\<sqsubset>\<^bsub>r\<^esub>] ss'} <*lex*> s_finite_psubset
[PROOF STEP]
apply(subgoal_tac "merges f (step (s_choose w) (ss ! s_choose w)) ss \<in> list n A")
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>ss w. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); s_\<alpha> w \<noteq> {}; \<And>A n. acc A r \<Longrightarrow> acc (list n A) (Listn.le r); s_choose w \<in> s_\<alpha> w; \<forall>x\<in>set (step (s_choose w) (ss ! s_choose w)). case x of (q, t) \<Rightarrow> q < length ss0 \<and> t \<in> A; ss \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p; ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss; \<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts; \<forall>p\<in>s_\<alpha> w. p < n; merges f (step (s_choose w) (ss ! s_choose w)) ss \<in> list n A\<rbrakk> \<Longrightarrow> merges f (step (s_choose w) (ss ! s_choose w)) ss \<in> list n A \<and> ss [\<sqsubset>\<^bsub>r\<^esub>] merges f (step (s_choose w) (ss ! s_choose w)) ss \<or> merges f (step (s_choose w) (ss ! s_choose w)) ss = ss \<and> {q. \<exists>t. (q, t) \<in> set (step (s_choose w) (ss ! s_choose w)) \<and> t \<squnion>\<^bsub>f\<^esub> ss ! q \<noteq> ss ! q} \<union> (s_\<alpha> w - {s_choose w}) \<subset> s_\<alpha> w
 2. \<And>ss w. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); s_\<alpha> w \<noteq> {}; \<And>A n. acc A r \<Longrightarrow> acc (list n A) (Listn.le r); s_choose w \<in> s_\<alpha> w; \<forall>x\<in>set (step (s_choose w) (ss ! s_choose w)). case x of (q, t) \<Rightarrow> q < length ss0 \<and> t \<in> A; ss \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p; ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss; \<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts; \<forall>p\<in>s_\<alpha> w. p < n\<rbrakk> \<Longrightarrow> merges f (step (s_choose w) (ss ! s_choose w)) ss \<in> list n A
 3. \<And>ss w. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); s_\<alpha> w \<noteq> {}; \<And>A n. acc A r \<Longrightarrow> acc (list n A) (Listn.le r); s_choose w \<in> s_\<alpha> w; \<forall>(q, t)\<in>set (step (s_choose w) (ss ! s_choose w)). q < length ss \<and> t \<in> A; (t_\<alpha> (propa f (step (s_choose w) (ss ! s_choose w)) ss (s_remove (s_choose w) w)), ss, s_\<alpha> w) \<in> {(ss', ss). ss \<in> list n A \<and> ss' \<in> list n A \<and> ss [\<sqsubset>\<^bsub>r\<^esub>] ss'} <*lex*> finite_psubset\<rbrakk> \<Longrightarrow> (propa f (step (s_choose w) (ss ! s_choose w)) ss (s_remove (s_choose w) w), ss, w) \<in> {(ss', ss). ss \<in> list n A \<and> ss' \<in> list n A \<and> ss [\<sqsubset>\<^bsub>r\<^esub>] ss'} <*lex*> s_finite_psubset
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>ss w. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); s_\<alpha> w \<noteq> {}; \<And>A n. acc A r \<Longrightarrow> acc (list n A) (Listn.le r); s_choose w \<in> s_\<alpha> w; \<forall>x\<in>set (step (s_choose w) (ss ! s_choose w)). case x of (q, t) \<Rightarrow> q < n \<and> t \<in> A; ss \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p; ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss; \<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts; \<forall>p\<in>s_\<alpha> w. p < n\<rbrakk> \<Longrightarrow> ss [\<sqsubset>\<^bsub>r\<^esub>] merges f (step (s_choose w) (ss ! s_choose w)) ss \<or> merges f (step (s_choose w) (ss ! s_choose w)) ss = ss \<and> {q. \<exists>t. (q, t) \<in> set (step (s_choose w) (ss ! s_choose w)) \<and> t \<squnion>\<^bsub>f\<^esub> ss ! q \<noteq> ss ! q} \<union> (s_\<alpha> w - {s_choose w}) \<subset> s_\<alpha> w
 2. \<And>ss w. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); s_\<alpha> w \<noteq> {}; \<And>A n. acc A r \<Longrightarrow> acc (list n A) (Listn.le r); s_choose w \<in> s_\<alpha> w; \<forall>x\<in>set (step (s_choose w) (ss ! s_choose w)). case x of (q, t) \<Rightarrow> q < length ss0 \<and> t \<in> A; ss \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p; ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss; \<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts; \<forall>p\<in>s_\<alpha> w. p < n\<rbrakk> \<Longrightarrow> merges f (step (s_choose w) (ss ! s_choose w)) ss \<in> list n A
 3. \<And>ss w. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); s_\<alpha> w \<noteq> {}; \<And>A n. acc A r \<Longrightarrow> acc (list n A) (Listn.le r); s_choose w \<in> s_\<alpha> w; \<forall>(q, t)\<in>set (step (s_choose w) (ss ! s_choose w)). q < length ss \<and> t \<in> A; (t_\<alpha> (propa f (step (s_choose w) (ss ! s_choose w)) ss (s_remove (s_choose w) w)), ss, s_\<alpha> w) \<in> {(ss', ss). ss \<in> list n A \<and> ss' \<in> list n A \<and> ss [\<sqsubset>\<^bsub>r\<^esub>] ss'} <*lex*> finite_psubset\<rbrakk> \<Longrightarrow> (propa f (step (s_choose w) (ss ! s_choose w)) ss (s_remove (s_choose w) w), ss, w) \<in> {(ss', ss). ss \<in> list n A \<and> ss' \<in> list n A \<and> ss [\<sqsubset>\<^bsub>r\<^esub>] ss'} <*lex*> s_finite_psubset
[PROOF STEP]
apply (rule termination_lemma)
[PROOF STATE]
proof (prove)
goal (6 subgoals):
 1. \<And>ss w. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); s_\<alpha> w \<noteq> {}; \<And>A n. acc A r \<Longrightarrow> acc (list n A) (Listn.le r); s_choose w \<in> s_\<alpha> w; \<forall>x\<in>set (step (s_choose w) (ss ! s_choose w)). case x of (q, t) \<Rightarrow> q < n \<and> t \<in> A; ss \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p; ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss; \<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts; \<forall>p\<in>s_\<alpha> w. p < n\<rbrakk> \<Longrightarrow> Semilat (?A4856 ss w) r f
 2. \<And>ss w. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); s_\<alpha> w \<noteq> {}; \<And>A n. acc A r \<Longrightarrow> acc (list n A) (Listn.le r); s_choose w \<in> s_\<alpha> w; \<forall>x\<in>set (step (s_choose w) (ss ! s_choose w)). case x of (q, t) \<Rightarrow> q < n \<and> t \<in> A; ss \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p; ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss; \<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts; \<forall>p\<in>s_\<alpha> w. p < n\<rbrakk> \<Longrightarrow> ss \<in> list (?n4856 ss w) (?A4856 ss w)
 3. \<And>ss w. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); s_\<alpha> w \<noteq> {}; \<And>A n. acc A r \<Longrightarrow> acc (list n A) (Listn.le r); s_choose w \<in> s_\<alpha> w; \<forall>x\<in>set (step (s_choose w) (ss ! s_choose w)). case x of (q, t) \<Rightarrow> q < n \<and> t \<in> A; ss \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p; ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss; \<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts; \<forall>p\<in>s_\<alpha> w. p < n\<rbrakk> \<Longrightarrow> \<forall>(q, t)\<in>set (step (s_choose w) (ss ! s_choose w)). q < ?n4856 ss w \<and> t \<in> ?A4856 ss w
 4. \<And>ss w. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); s_\<alpha> w \<noteq> {}; \<And>A n. acc A r \<Longrightarrow> acc (list n A) (Listn.le r); s_choose w \<in> s_\<alpha> w; \<forall>x\<in>set (step (s_choose w) (ss ! s_choose w)). case x of (q, t) \<Rightarrow> q < n \<and> t \<in> A; ss \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p; ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss; \<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts; \<forall>p\<in>s_\<alpha> w. p < n\<rbrakk> \<Longrightarrow> s_choose w \<in> s_\<alpha> w
 5. \<And>ss w. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); s_\<alpha> w \<noteq> {}; \<And>A n. acc A r \<Longrightarrow> acc (list n A) (Listn.le r); s_choose w \<in> s_\<alpha> w; \<forall>x\<in>set (step (s_choose w) (ss ! s_choose w)). case x of (q, t) \<Rightarrow> q < length ss0 \<and> t \<in> A; ss \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p; ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss; \<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts; \<forall>p\<in>s_\<alpha> w. p < n\<rbrakk> \<Longrightarrow> merges f (step (s_choose w) (ss ! s_choose w)) ss \<in> list n A
 6. \<And>ss w. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); s_\<alpha> w \<noteq> {}; \<And>A n. acc A r \<Longrightarrow> acc (list n A) (Listn.le r); s_choose w \<in> s_\<alpha> w; \<forall>(q, t)\<in>set (step (s_choose w) (ss ! s_choose w)). q < length ss \<and> t \<in> A; (t_\<alpha> (propa f (step (s_choose w) (ss ! s_choose w)) ss (s_remove (s_choose w) w)), ss, s_\<alpha> w) \<in> {(ss', ss). ss \<in> list n A \<and> ss' \<in> list n A \<and> ss [\<sqsubset>\<^bsub>r\<^esub>] ss'} <*lex*> finite_psubset\<rbrakk> \<Longrightarrow> (propa f (step (s_choose w) (ss ! s_choose w)) ss (s_remove (s_choose w) w), ss, w) \<in> {(ss', ss). ss \<in> list n A \<and> ss' \<in> list n A \<and> ss [\<sqsubset>\<^bsub>r\<^esub>] ss'} <*lex*> s_finite_psubset
[PROOF STEP]
apply (rule assms)
[PROOF STATE]
proof (prove)
goal (5 subgoals):
 1. \<And>ss w. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); s_\<alpha> w \<noteq> {}; \<And>A n. acc A r \<Longrightarrow> acc (list n A) (Listn.le r); s_choose w \<in> s_\<alpha> w; \<forall>x\<in>set (step (s_choose w) (ss ! s_choose w)). case x of (q, t) \<Rightarrow> q < n \<and> t \<in> A; ss \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p; ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss; \<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts; \<forall>p\<in>s_\<alpha> w. p < n\<rbrakk> \<Longrightarrow> ss \<in> list (?n4856 ss w) A
 2. \<And>ss w. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); s_\<alpha> w \<noteq> {}; \<And>A n. acc A r \<Longrightarrow> acc (list n A) (Listn.le r); s_choose w \<in> s_\<alpha> w; \<forall>x\<in>set (step (s_choose w) (ss ! s_choose w)). case x of (q, t) \<Rightarrow> q < n \<and> t \<in> A; ss \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p; ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss; \<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts; \<forall>p\<in>s_\<alpha> w. p < n\<rbrakk> \<Longrightarrow> \<forall>(q, t)\<in>set (step (s_choose w) (ss ! s_choose w)). q < ?n4856 ss w \<and> t \<in> A
 3. \<And>ss w. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); s_\<alpha> w \<noteq> {}; \<And>A n. acc A r \<Longrightarrow> acc (list n A) (Listn.le r); s_choose w \<in> s_\<alpha> w; \<forall>x\<in>set (step (s_choose w) (ss ! s_choose w)). case x of (q, t) \<Rightarrow> q < n \<and> t \<in> A; ss \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p; ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss; \<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts; \<forall>p\<in>s_\<alpha> w. p < n\<rbrakk> \<Longrightarrow> s_choose w \<in> s_\<alpha> w
 4. \<And>ss w. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); s_\<alpha> w \<noteq> {}; \<And>A n. acc A r \<Longrightarrow> acc (list n A) (Listn.le r); s_choose w \<in> s_\<alpha> w; \<forall>x\<in>set (step (s_choose w) (ss ! s_choose w)). case x of (q, t) \<Rightarrow> q < length ss0 \<and> t \<in> A; ss \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p; ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss; \<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts; \<forall>p\<in>s_\<alpha> w. p < n\<rbrakk> \<Longrightarrow> merges f (step (s_choose w) (ss ! s_choose w)) ss \<in> list n A
 5. \<And>ss w. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); s_\<alpha> w \<noteq> {}; \<And>A n. acc A r \<Longrightarrow> acc (list n A) (Listn.le r); s_choose w \<in> s_\<alpha> w; \<forall>(q, t)\<in>set (step (s_choose w) (ss ! s_choose w)). q < length ss \<and> t \<in> A; (t_\<alpha> (propa f (step (s_choose w) (ss ! s_choose w)) ss (s_remove (s_choose w) w)), ss, s_\<alpha> w) \<in> {(ss', ss). ss \<in> list n A \<and> ss' \<in> list n A \<and> ss [\<sqsubset>\<^bsub>r\<^esub>] ss'} <*lex*> finite_psubset\<rbrakk> \<Longrightarrow> (propa f (step (s_choose w) (ss ! s_choose w)) ss (s_remove (s_choose w) w), ss, w) \<in> {(ss', ss). ss \<in> list n A \<and> ss' \<in> list n A \<and> ss [\<sqsubset>\<^bsub>r\<^esub>] ss'} <*lex*> s_finite_psubset
[PROOF STEP]
apply assumption+
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>ss w. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); s_\<alpha> w \<noteq> {}; \<And>A n. acc A r \<Longrightarrow> acc (list n A) (Listn.le r); s_choose w \<in> s_\<alpha> w; \<forall>x\<in>set (step (s_choose w) (ss ! s_choose w)). case x of (q, t) \<Rightarrow> q < length ss0 \<and> t \<in> A; ss \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p; ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss; \<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts; \<forall>p\<in>s_\<alpha> w. p < n\<rbrakk> \<Longrightarrow> merges f (step (s_choose w) (ss ! s_choose w)) ss \<in> list n A
 2. \<And>ss w. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); s_\<alpha> w \<noteq> {}; \<And>A n. acc A r \<Longrightarrow> acc (list n A) (Listn.le r); s_choose w \<in> s_\<alpha> w; \<forall>(q, t)\<in>set (step (s_choose w) (ss ! s_choose w)). q < length ss \<and> t \<in> A; (t_\<alpha> (propa f (step (s_choose w) (ss ! s_choose w)) ss (s_remove (s_choose w) w)), ss, s_\<alpha> w) \<in> {(ss', ss). ss \<in> list n A \<and> ss' \<in> list n A \<and> ss [\<sqsubset>\<^bsub>r\<^esub>] ss'} <*lex*> finite_psubset\<rbrakk> \<Longrightarrow> (propa f (step (s_choose w) (ss ! s_choose w)) ss (s_remove (s_choose w) w), ss, w) \<in> {(ss', ss). ss \<in> list n A \<and> ss' \<in> list n A \<and> ss [\<sqsubset>\<^bsub>r\<^esub>] ss'} <*lex*> s_finite_psubset
[PROOF STEP]
apply clarsimp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>ss w. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); s_\<alpha> w \<noteq> {}; \<And>A n. acc A r \<Longrightarrow> acc (list n A) (Listn.le r); s_choose w \<in> s_\<alpha> w; \<forall>(q, t)\<in>set (step (s_choose w) (ss ! s_choose w)). q < length ss \<and> t \<in> A; (t_\<alpha> (propa f (step (s_choose w) (ss ! s_choose w)) ss (s_remove (s_choose w) w)), ss, s_\<alpha> w) \<in> {(ss', ss). ss \<in> list n A \<and> ss' \<in> list n A \<and> ss [\<sqsubset>\<^bsub>r\<^esub>] ss'} <*lex*> finite_psubset\<rbrakk> \<Longrightarrow> (propa f (step (s_choose w) (ss ! s_choose w)) ss (s_remove (s_choose w) w), ss, w) \<in> {(ss', ss). ss \<in> list n A \<and> ss' \<in> list n A \<and> ss [\<sqsubset>\<^bsub>r\<^esub>] ss'} <*lex*> s_finite_psubset
[PROOF STEP]
apply(case_tac "propa f (step (s_choose w) (ss ! s_choose w)) ss
               (s_remove (s_choose w) w)")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>ss w a b. \<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p; semilat (A, r, f); ss \<in> list n A \<and> (\<forall>p<n. p \<notin> s_\<alpha> w \<longrightarrow> Typing_Framework.stable r step ss p) \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> (\<forall>p<n. Typing_Framework.stable r step ts p) \<longrightarrow> ss [\<sqsubseteq>\<^bsub>r\<^esub>] ts) \<and> (\<forall>p\<in>s_\<alpha> w. p < n); s_\<alpha> w \<noteq> {}; \<And>A n. acc A r \<Longrightarrow> acc (list n A) (Listn.le r); s_choose w \<in> s_\<alpha> w; \<forall>(q, t)\<in>set (step (s_choose w) (ss ! s_choose w)). q < length ss \<and> t \<in> A; (t_\<alpha> (propa f (step (s_choose w) (ss ! s_choose w)) ss (s_remove (s_choose w) w)), ss, s_\<alpha> w) \<in> {(ss', ss). ss \<in> list n A \<and> ss' \<in> list n A \<and> ss [\<sqsubset>\<^bsub>r\<^esub>] ss'} <*lex*> finite_psubset; propa f (step (s_choose w) (ss ! s_choose w)) ss (s_remove (s_choose w) w) = (a, b)\<rbrakk> \<Longrightarrow> (propa f (step (s_choose w) (ss ! s_choose w)) ss (s_remove (s_choose w) w), ss, w) \<in> {(ss', ss). ss \<in> list n A \<and> ss' \<in> list n A \<and> ss [\<sqsubset>\<^bsub>r\<^esub>] ss'} <*lex*> s_finite_psubset
[PROOF STEP]
apply(simp add: s_finite_psubset_inv_image)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
\<lbrakk>acc A r; pres_type step n A; SemilatAlg.mono r step n A; bounded step n; \<forall>p\<in>s_\<alpha> w0. p < n; ss0 \<in> list n A; \<forall>p<n. p \<notin> s_\<alpha> w0 \<longrightarrow> Typing_Framework.stable r step ss0 p\<rbrakk> \<Longrightarrow> t_\<alpha> (iter f step ss0 w0) = (ss', w') \<longrightarrow> ss' \<in> list n A \<and> stables r step ss' \<and> ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ss' \<and> (\<forall>ts\<in>list n A. ss0 [\<sqsubseteq>\<^bsub>r\<^esub>] ts \<and> stables r step ts \<longrightarrow> ss' [\<sqsubseteq>\<^bsub>r\<^esub>] ts)

goal:
No subgoals!
[PROOF STEP]
qed