[STATEMENT]
lemma subtree_rank_ge_if_mdeg_le1':
  "\<lbrakk>is_subtree (Node r {|(t1,e1)|}) t; max_deg (Node r {|(t1,e1)|}) \<le> 1; v \<noteq> r;
    v \<in> dverts t; y \<in> set v; \<exists>x\<in>set r. x \<rightarrow>\<^sup>+\<^bsub>T\<^esub> y; \<not>(\<exists>x'\<in>set (Dtree.root t1). x' \<rightarrow>\<^sup>+\<^bsub>T\<^esub> y)\<rbrakk>
    \<Longrightarrow> rank (rev (Dtree.root t1)) \<le> rank (rev v)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>is_subtree (Node r {|(t1, e1)|}) t; max_deg (Node r {|(t1, e1)|}) \<le> 1; v \<noteq> r; v \<in> dverts t; y \<in> set v; \<exists>x\<in>set r. x \<rightarrow>\<^sup>+\<^bsub>T\<^esub> y; \<not> (\<exists>x'\<in>set (dtree.root t1). x' \<rightarrow>\<^sup>+\<^bsub>T\<^esub> y)\<rbrakk> \<Longrightarrow> rank (rev (dtree.root t1)) \<le> rank (rev v)
[PROOF STEP]
using subtree_y_reach_if_mdeg_le1_notroot_subcontr subtree_rank_ge_if_mdeg_le1_nocontr
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>is_subtree (Node ?r {|(?t1.0, ?e1.0)|}) t; max_deg (Node ?r {|(?t1.0, ?e1.0)|}) \<le> 1; is_subtree (Node ?v2.0 {|(?t2.0, ?e2.0)|}) ?t1.0; rank (rev (dtree.root ?t2.0)) < rank (rev ?v2.0); ?v \<noteq> ?r; ?v \<in> dverts t; ?v \<noteq> dtree.root ?t1.0; ?y \<in> set ?v; \<exists>x\<in>set ?r. x \<rightarrow>\<^sup>+\<^bsub>T\<^esub> ?y\<rbrakk> \<Longrightarrow> \<exists>x'\<in>set (dtree.root ?t1.0). x' \<rightarrow>\<^sup>+\<^bsub>T\<^esub> ?y
\<lbrakk>is_subtree (Node ?r {|(?t1.0, ?e1.0)|}) t; max_deg (Node ?r {|(?t1.0, ?e1.0)|}) \<le> 1; \<nexists>v2 t2 e2. is_subtree (Node v2 {|(t2, e2)|}) ?t1.0 \<and> rank (rev (dtree.root t2)) < rank (rev v2); ?v \<noteq> ?r; ?v \<in> dverts t; ?y \<in> set ?v; \<exists>x\<in>set ?r. x \<rightarrow>\<^sup>+\<^bsub>T\<^esub> ?y\<rbrakk> \<Longrightarrow> rank (rev (dtree.root ?t1.0)) \<le> rank (rev ?v)

goal (1 subgoal):
 1. \<lbrakk>is_subtree (Node r {|(t1, e1)|}) t; max_deg (Node r {|(t1, e1)|}) \<le> 1; v \<noteq> r; v \<in> dverts t; y \<in> set v; \<exists>x\<in>set r. x \<rightarrow>\<^sup>+\<^bsub>T\<^esub> y; \<not> (\<exists>x'\<in>set (dtree.root t1). x' \<rightarrow>\<^sup>+\<^bsub>T\<^esub> y)\<rbrakk> \<Longrightarrow> rank (rev (dtree.root t1)) \<le> rank (rev v)
[PROOF STEP]
apply(cases "\<exists>v2 t2 e2. is_subtree (Node v2 {|(t2,e2)|}) t1 \<and> rank (rev (Dtree.root t2))<rank (rev v2)")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>is_subtree (Node r {|(t1, e1)|}) t; max_deg (Node r {|(t1, e1)|}) \<le> 1; v \<noteq> r; v \<in> dverts t; y \<in> set v; \<exists>x\<in>set r. x \<rightarrow>\<^sup>+\<^bsub>T\<^esub> y; \<not> (\<exists>x'\<in>set (dtree.root t1). x' \<rightarrow>\<^sup>+\<^bsub>T\<^esub> y); \<And>r t1 e1 v2 t2 e2 v y. \<lbrakk>is_subtree (Node r {|(t1, e1)|}) t; max_deg (Node r {|(t1, e1)|}) \<le> 1; is_subtree (Node v2 {|(t2, e2)|}) t1; rank (rev (dtree.root t2)) < rank (rev v2); v \<noteq> r; v \<in> dverts t; v \<noteq> dtree.root t1; y \<in> set v; \<exists>x\<in>set r. x \<rightarrow>\<^sup>+\<^bsub>T\<^esub> y\<rbrakk> \<Longrightarrow> \<exists>x'\<in>set (dtree.root t1). x' \<rightarrow>\<^sup>+\<^bsub>T\<^esub> y; \<And>r t1 e1 v y. \<lbrakk>is_subtree (Node r {|(t1, e1)|}) t; max_deg (Node r {|(t1, e1)|}) \<le> 1; \<nexists>v2 t2 e2. is_subtree (Node v2 {|(t2, e2)|}) t1 \<and> rank (rev (dtree.root t2)) < rank (rev v2); v \<noteq> r; v \<in> dverts t; y \<in> set v; \<exists>x\<in>set r. x \<rightarrow>\<^sup>+\<^bsub>T\<^esub> y\<rbrakk> \<Longrightarrow> rank (rev (dtree.root t1)) \<le> rank (rev v); \<exists>v2 t2 e2. is_subtree (Node v2 {|(t2, e2)|}) t1 \<and> rank (rev (dtree.root t2)) < rank (rev v2)\<rbrakk> \<Longrightarrow> rank (rev (dtree.root t1)) \<le> rank (rev v)
 2. \<lbrakk>is_subtree (Node r {|(t1, e1)|}) t; max_deg (Node r {|(t1, e1)|}) \<le> 1; v \<noteq> r; v \<in> dverts t; y \<in> set v; \<exists>x\<in>set r. x \<rightarrow>\<^sup>+\<^bsub>T\<^esub> y; \<not> (\<exists>x'\<in>set (dtree.root t1). x' \<rightarrow>\<^sup>+\<^bsub>T\<^esub> y); \<And>r t1 e1 v2 t2 e2 v y. \<lbrakk>is_subtree (Node r {|(t1, e1)|}) t; max_deg (Node r {|(t1, e1)|}) \<le> 1; is_subtree (Node v2 {|(t2, e2)|}) t1; rank (rev (dtree.root t2)) < rank (rev v2); v \<noteq> r; v \<in> dverts t; v \<noteq> dtree.root t1; y \<in> set v; \<exists>x\<in>set r. x \<rightarrow>\<^sup>+\<^bsub>T\<^esub> y\<rbrakk> \<Longrightarrow> \<exists>x'\<in>set (dtree.root t1). x' \<rightarrow>\<^sup>+\<^bsub>T\<^esub> y; \<And>r t1 e1 v y. \<lbrakk>is_subtree (Node r {|(t1, e1)|}) t; max_deg (Node r {|(t1, e1)|}) \<le> 1; \<nexists>v2 t2 e2. is_subtree (Node v2 {|(t2, e2)|}) t1 \<and> rank (rev (dtree.root t2)) < rank (rev v2); v \<noteq> r; v \<in> dverts t; y \<in> set v; \<exists>x\<in>set r. x \<rightarrow>\<^sup>+\<^bsub>T\<^esub> y\<rbrakk> \<Longrightarrow> rank (rev (dtree.root t1)) \<le> rank (rev v); \<nexists>v2 t2 e2. is_subtree (Node v2 {|(t2, e2)|}) t1 \<and> rank (rev (dtree.root t2)) < rank (rev v2)\<rbrakk> \<Longrightarrow> rank (rev (dtree.root t1)) \<le> rank (rev v)
[PROOF STEP]
by blast+


[STATEMENT]
lemma rcliff_greek_less2:
  assumes "trans r" (* unused assumption kept for symmetry with lcliff_greek_less2 *)
  and as: "snd ` set as \<subseteq> under r a" and b': "b' \<in> {[(Grave,b)],[]}"
  and cs: "snd ` set cs \<subseteq> under r a \<union> under r b"
  shows "(as @ b' @ cs, [(Macron,a),(Grave,b)]) \<in> greek_less r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (as @ b' @ cs, [(Macron, a), (Grave, b)]) \<in> greek_less r
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (as @ b' @ cs, [(Macron, a), (Grave, b)]) \<in> greek_less r
[PROOF STEP]
let ?A = "(Macron,a)" and ?B = "(Grave,b)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (as @ b' @ cs, [(Macron, a), (Grave, b)]) \<in> greek_less r
[PROOF STEP]
have "(ms_of_greek (as @ b' @ cs), ms_of_greek [?A,?B]) \<in> mult (letter_less r <*lex*> greek_less r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (ms_of_greek (as @ b' @ cs), ms_of_greek [(Macron, a), (Grave, b)]) \<in> mult (letter_less r <*lex*> greek_less r)
[PROOF STEP]
proof (intro pairwise_imp_mult)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. ms_of_greek [(Macron, a), (Grave, b)] \<noteq> {#}
 2. \<forall>x\<in>#ms_of_greek (as @ b' @ cs). \<exists>y\<in>#ms_of_greek [(Macron, a), (Grave, b)]. (x, y) \<in> letter_less r <*lex*> greek_less r
[PROOF STEP]
(* we distinguish 3 cases depending on where in xs an element e originates *)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. ms_of_greek [(Macron, a), (Grave, b)] \<noteq> {#}
 2. \<forall>x\<in>#ms_of_greek (as @ b' @ cs). \<exists>y\<in>#ms_of_greek [(Macron, a), (Grave, b)]. (x, y) \<in> letter_less r <*lex*> greek_less r
[PROOF STEP]
{
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. ms_of_greek [(Macron, a), (Grave, b)] \<noteq> {#}
 2. \<forall>x\<in>#ms_of_greek (as @ b' @ cs). \<exists>y\<in>#ms_of_greek [(Macron, a), (Grave, b)]. (x, y) \<in> letter_less r <*lex*> greek_less r
[PROOF STEP]
fix e
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. ms_of_greek [(Macron, a), (Grave, b)] \<noteq> {#}
 2. \<forall>x\<in>#ms_of_greek (as @ b' @ cs). \<exists>y\<in>#ms_of_greek [(Macron, a), (Grave, b)]. (x, y) \<in> letter_less r <*lex*> greek_less r
[PROOF STEP]
assume "e \<in> set_mset (ms_of_greek as)"
[PROOF STATE]
proof (state)
this:
e \<in># ms_of_greek as

goal (2 subgoals):
 1. ms_of_greek [(Macron, a), (Grave, b)] \<noteq> {#}
 2. \<forall>x\<in>#ms_of_greek (as @ b' @ cs). \<exists>y\<in>#ms_of_greek [(Macron, a), (Grave, b)]. (x, y) \<in> letter_less r <*lex*> greek_less r
[PROOF STEP]
with as ms_of_greek_elem[of _ _ as]
[PROOF STATE]
proof (chain)
picking this:
snd ` set as \<subseteq> under r a
(?x, ?xs) \<in># ms_of_greek as \<Longrightarrow> ?x \<in> set as
e \<in># ms_of_greek as
[PROOF STEP]
have "(adj_msog [] (b' @ cs) e, (?A,[])) \<in> letter_less r <*lex*> greek_less r"
[PROOF STATE]
proof (prove)
using this:
snd ` set as \<subseteq> under r a
(?x, ?xs) \<in># ms_of_greek as \<Longrightarrow> ?x \<in> set as
e \<in># ms_of_greek as

goal (1 subgoal):
 1. (adj_msog [] (b' @ cs) e, (Macron, a), []) \<in> letter_less r <*lex*> greek_less r
[PROOF STEP]
by (cases e) (fastforce simp: adj_msog_def under_def)
[PROOF STATE]
proof (state)
this:
(adj_msog [] (b' @ cs) e, (Macron, a), []) \<in> letter_less r <*lex*> greek_less r

goal (2 subgoals):
 1. ms_of_greek [(Macron, a), (Grave, b)] \<noteq> {#}
 2. \<forall>x\<in>#ms_of_greek (as @ b' @ cs). \<exists>y\<in>#ms_of_greek [(Macron, a), (Grave, b)]. (x, y) \<in> letter_less r <*lex*> greek_less r
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
?e2 \<in># ms_of_greek as \<Longrightarrow> (adj_msog [] (b' @ cs) ?e2, (Macron, a), []) \<in> letter_less r <*lex*> greek_less r

goal (2 subgoals):
 1. ms_of_greek [(Macron, a), (Grave, b)] \<noteq> {#}
 2. \<forall>x\<in>#ms_of_greek (as @ b' @ cs). \<exists>y\<in>#ms_of_greek [(Macron, a), (Grave, b)]. (x, y) \<in> letter_less r <*lex*> greek_less r
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
?e2 \<in># ms_of_greek as \<Longrightarrow> (adj_msog [] (b' @ cs) ?e2, (Macron, a), []) \<in> letter_less r <*lex*> greek_less r

goal (2 subgoals):
 1. ms_of_greek [(Macron, a), (Grave, b)] \<noteq> {#}
 2. \<forall>x\<in>#ms_of_greek (as @ b' @ cs). \<exists>y\<in>#ms_of_greek [(Macron, a), (Grave, b)]. (x, y) \<in> letter_less r <*lex*> greek_less r
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
?e2 \<in># ms_of_greek as \<Longrightarrow> (adj_msog [] (b' @ cs) ?e2, (Macron, a), []) \<in> letter_less r <*lex*> greek_less r

goal (2 subgoals):
 1. ms_of_greek [(Macron, a), (Grave, b)] \<noteq> {#}
 2. \<forall>x\<in>#ms_of_greek (as @ b' @ cs). \<exists>y\<in>#ms_of_greek [(Macron, a), (Grave, b)]. (x, y) \<in> letter_less r <*lex*> greek_less r
[PROOF STEP]
fix e
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. ms_of_greek [(Macron, a), (Grave, b)] \<noteq> {#}
 2. \<forall>x\<in>#ms_of_greek (as @ b' @ cs). \<exists>y\<in>#ms_of_greek [(Macron, a), (Grave, b)]. (x, y) \<in> letter_less r <*lex*> greek_less r
[PROOF STEP]
assume "e \<in> set_mset (ms_of_greek b')"
[PROOF STATE]
proof (state)
this:
e \<in># ms_of_greek b'

goal (2 subgoals):
 1. ms_of_greek [(Macron, a), (Grave, b)] \<noteq> {#}
 2. \<forall>x\<in>#ms_of_greek (as @ b' @ cs). \<exists>y\<in>#ms_of_greek [(Macron, a), (Grave, b)]. (x, y) \<in> letter_less r <*lex*> greek_less r
[PROOF STEP]
with b' singleton_greek_less[OF as] ms_of_greek_elem[of _ _ b']
[PROOF STATE]
proof (chain)
picking this:
b' \<in> {[(Grave, b)], []}
(as, [(?a, a)]) \<in> greek_less r
(?x, ?xs) \<in># ms_of_greek b' \<Longrightarrow> ?x \<in> set b'
e \<in># ms_of_greek b'
[PROOF STEP]
have "(adj_msog as (cs) e, (?B,[?A])) \<in> letter_less r <*lex*> greek_less r"
[PROOF STATE]
proof (prove)
using this:
b' \<in> {[(Grave, b)], []}
(as, [(?a, a)]) \<in> greek_less r
(?x, ?xs) \<in># ms_of_greek b' \<Longrightarrow> ?x \<in> set b'
e \<in># ms_of_greek b'

goal (1 subgoal):
 1. (adj_msog as cs e, (Grave, b), [(Macron, a)]) \<in> letter_less r <*lex*> greek_less r
[PROOF STEP]
by (cases e) (fastforce simp: adj_msog_def ms_of_greek_def)
[PROOF STATE]
proof (state)
this:
(adj_msog as cs e, (Grave, b), [(Macron, a)]) \<in> letter_less r <*lex*> greek_less r

goal (2 subgoals):
 1. ms_of_greek [(Macron, a), (Grave, b)] \<noteq> {#}
 2. \<forall>x\<in>#ms_of_greek (as @ b' @ cs). \<exists>y\<in>#ms_of_greek [(Macron, a), (Grave, b)]. (x, y) \<in> letter_less r <*lex*> greek_less r
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
?e2 \<in># ms_of_greek b' \<Longrightarrow> (adj_msog as cs ?e2, (Grave, b), [(Macron, a)]) \<in> letter_less r <*lex*> greek_less r

goal (2 subgoals):
 1. ms_of_greek [(Macron, a), (Grave, b)] \<noteq> {#}
 2. \<forall>x\<in>#ms_of_greek (as @ b' @ cs). \<exists>y\<in>#ms_of_greek [(Macron, a), (Grave, b)]. (x, y) \<in> letter_less r <*lex*> greek_less r
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
?e2 \<in># ms_of_greek b' \<Longrightarrow> (adj_msog as cs ?e2, (Grave, b), [(Macron, a)]) \<in> letter_less r <*lex*> greek_less r

goal (2 subgoals):
 1. ms_of_greek [(Macron, a), (Grave, b)] \<noteq> {#}
 2. \<forall>x\<in>#ms_of_greek (as @ b' @ cs). \<exists>y\<in>#ms_of_greek [(Macron, a), (Grave, b)]. (x, y) \<in> letter_less r <*lex*> greek_less r
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
?e2 \<in># ms_of_greek b' \<Longrightarrow> (adj_msog as cs ?e2, (Grave, b), [(Macron, a)]) \<in> letter_less r <*lex*> greek_less r

goal (2 subgoals):
 1. ms_of_greek [(Macron, a), (Grave, b)] \<noteq> {#}
 2. \<forall>x\<in>#ms_of_greek (as @ b' @ cs). \<exists>y\<in>#ms_of_greek [(Macron, a), (Grave, b)]. (x, y) \<in> letter_less r <*lex*> greek_less r
[PROOF STEP]
fix e
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. ms_of_greek [(Macron, a), (Grave, b)] \<noteq> {#}
 2. \<forall>x\<in>#ms_of_greek (as @ b' @ cs). \<exists>y\<in>#ms_of_greek [(Macron, a), (Grave, b)]. (x, y) \<in> letter_less r <*lex*> greek_less r
[PROOF STEP]
assume "e \<in> set_mset (ms_of_greek cs)"
[PROOF STATE]
proof (state)
this:
e \<in># ms_of_greek cs

goal (2 subgoals):
 1. ms_of_greek [(Macron, a), (Grave, b)] \<noteq> {#}
 2. \<forall>x\<in>#ms_of_greek (as @ b' @ cs). \<exists>y\<in>#ms_of_greek [(Macron, a), (Grave, b)]. (x, y) \<in> letter_less r <*lex*> greek_less r
[PROOF STEP]
with cs ms_of_greek_elem[of _ _ cs]
[PROOF STATE]
proof (chain)
picking this:
snd ` set cs \<subseteq> under r a \<union> under r b
(?x, ?xs) \<in># ms_of_greek cs \<Longrightarrow> ?x \<in> set cs
e \<in># ms_of_greek cs
[PROOF STEP]
have "(adj_msog (as @ b') [] e, (?A,[])) \<in> letter_less r <*lex*> greek_less r \<or>
            (adj_msog (as @ b') [] e, (?B,[?A])) \<in> letter_less r <*lex*> greek_less r"
[PROOF STATE]
proof (prove)
using this:
snd ` set cs \<subseteq> under r a \<union> under r b
(?x, ?xs) \<in># ms_of_greek cs \<Longrightarrow> ?x \<in> set cs
e \<in># ms_of_greek cs

goal (1 subgoal):
 1. (adj_msog (as @ b') [] e, (Macron, a), []) \<in> letter_less r <*lex*> greek_less r \<or> (adj_msog (as @ b') [] e, (Grave, b), [(Macron, a)]) \<in> letter_less r <*lex*> greek_less r
[PROOF STEP]
by (cases e) (fastforce simp: adj_msog_def under_def)
[PROOF STATE]
proof (state)
this:
(adj_msog (as @ b') [] e, (Macron, a), []) \<in> letter_less r <*lex*> greek_less r \<or> (adj_msog (as @ b') [] e, (Grave, b), [(Macron, a)]) \<in> letter_less r <*lex*> greek_less r

goal (2 subgoals):
 1. ms_of_greek [(Macron, a), (Grave, b)] \<noteq> {#}
 2. \<forall>x\<in>#ms_of_greek (as @ b' @ cs). \<exists>y\<in>#ms_of_greek [(Macron, a), (Grave, b)]. (x, y) \<in> letter_less r <*lex*> greek_less r
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
?e2 \<in># ms_of_greek cs \<Longrightarrow> (adj_msog (as @ b') [] ?e2, (Macron, a), []) \<in> letter_less r <*lex*> greek_less r \<or> (adj_msog (as @ b') [] ?e2, (Grave, b), [(Macron, a)]) \<in> letter_less r <*lex*> greek_less r

goal (2 subgoals):
 1. ms_of_greek [(Macron, a), (Grave, b)] \<noteq> {#}
 2. \<forall>x\<in>#ms_of_greek (as @ b' @ cs). \<exists>y\<in>#ms_of_greek [(Macron, a), (Grave, b)]. (x, y) \<in> letter_less r <*lex*> greek_less r
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
?e2 \<in># ms_of_greek cs \<Longrightarrow> (adj_msog (as @ b') [] ?e2, (Macron, a), []) \<in> letter_less r <*lex*> greek_less r \<or> (adj_msog (as @ b') [] ?e2, (Grave, b), [(Macron, a)]) \<in> letter_less r <*lex*> greek_less r

goal (2 subgoals):
 1. ms_of_greek [(Macron, a), (Grave, b)] \<noteq> {#}
 2. \<forall>x\<in>#ms_of_greek (as @ b' @ cs). \<exists>y\<in>#ms_of_greek [(Macron, a), (Grave, b)]. (x, y) \<in> letter_less r <*lex*> greek_less r
[PROOF STEP]
have *: "ms_of_greek [?A,?B] = {# (?B,[?A]), (?A,[]) #}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ms_of_greek [(Macron, a), (Grave, b)] = {#((Grave, b), [(Macron, a)]), ((Macron, a), [])#}
[PROOF STEP]
by (simp add: adj_msog_def ms_of_greek_def)
[PROOF STATE]
proof (state)
this:
ms_of_greek [(Macron, a), (Grave, b)] = {#((Grave, b), [(Macron, a)]), ((Macron, a), [])#}

goal (2 subgoals):
 1. ms_of_greek [(Macron, a), (Grave, b)] \<noteq> {#}
 2. \<forall>x\<in>#ms_of_greek (as @ b' @ cs). \<exists>y\<in>#ms_of_greek [(Macron, a), (Grave, b)]. (x, y) \<in> letter_less r <*lex*> greek_less r
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
?e2 \<in># ms_of_greek as \<Longrightarrow> (adj_msog [] (b' @ cs) ?e2, (Macron, a), []) \<in> letter_less r <*lex*> greek_less r
?e2 \<in># ms_of_greek b' \<Longrightarrow> (adj_msog as cs ?e2, (Grave, b), [(Macron, a)]) \<in> letter_less r <*lex*> greek_less r
?e2 \<in># ms_of_greek cs \<Longrightarrow> (adj_msog (as @ b') [] ?e2, (Macron, a), []) \<in> letter_less r <*lex*> greek_less r \<or> (adj_msog (as @ b') [] ?e2, (Grave, b), [(Macron, a)]) \<in> letter_less r <*lex*> greek_less r
ms_of_greek [(Macron, a), (Grave, b)] = {#((Grave, b), [(Macron, a)]), ((Macron, a), [])#}
[PROOF STEP]
show "\<forall>x\<in>set_mset (ms_of_greek (as @ b' @ cs)).
      \<exists>y\<in>set_mset (ms_of_greek [?A,?B]). (x, y) \<in> letter_less r <*lex*> greek_less r"
[PROOF STATE]
proof (prove)
using this:
?e2 \<in># ms_of_greek as \<Longrightarrow> (adj_msog [] (b' @ cs) ?e2, (Macron, a), []) \<in> letter_less r <*lex*> greek_less r
?e2 \<in># ms_of_greek b' \<Longrightarrow> (adj_msog as cs ?e2, (Grave, b), [(Macron, a)]) \<in> letter_less r <*lex*> greek_less r
?e2 \<in># ms_of_greek cs \<Longrightarrow> (adj_msog (as @ b') [] ?e2, (Macron, a), []) \<in> letter_less r <*lex*> greek_less r \<or> (adj_msog (as @ b') [] ?e2, (Grave, b), [(Macron, a)]) \<in> letter_less r <*lex*> greek_less r
ms_of_greek [(Macron, a), (Grave, b)] = {#((Grave, b), [(Macron, a)]), ((Macron, a), [])#}

goal (1 subgoal):
 1. \<forall>x\<in>#ms_of_greek (as @ b' @ cs). \<exists>y\<in>#ms_of_greek [(Macron, a), (Grave, b)]. (x, y) \<in> letter_less r <*lex*> greek_less r
[PROOF STEP]
by (auto simp: msog_append adj_msog_single ac_simps *) blast
[PROOF STATE]
proof (state)
this:
\<forall>x\<in>#ms_of_greek (as @ b' @ cs). \<exists>y\<in>#ms_of_greek [(Macron, a), (Grave, b)]. (x, y) \<in> letter_less r <*lex*> greek_less r

goal (1 subgoal):
 1. ms_of_greek [(Macron, a), (Grave, b)] \<noteq> {#}
[PROOF STEP]
qed (auto simp: ms_of_greek_def)
[PROOF STATE]
proof (state)
this:
(ms_of_greek (as @ b' @ cs), ms_of_greek [(Macron, a), (Grave, b)]) \<in> mult (letter_less r <*lex*> greek_less r)

goal (1 subgoal):
 1. (as @ b' @ cs, [(Macron, a), (Grave, b)]) \<in> greek_less r
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(ms_of_greek (as @ b' @ cs), ms_of_greek [(Macron, a), (Grave, b)]) \<in> mult (letter_less r <*lex*> greek_less r)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(ms_of_greek (as @ b' @ cs), ms_of_greek [(Macron, a), (Grave, b)]) \<in> mult (letter_less r <*lex*> greek_less r)

goal (1 subgoal):
 1. (as @ b' @ cs, [(Macron, a), (Grave, b)]) \<in> greek_less r
[PROOF STEP]
by (subst greek_less_unfold) auto
[PROOF STATE]
proof (state)
this:
(as @ b' @ cs, [(Macron, a), (Grave, b)]) \<in> greek_less r

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma get_mode_ok: "type_wf h \<Longrightarrow> shadow_root_ptr |\<in>| shadow_root_ptr_kinds h \<Longrightarrow>
h \<turnstile> ok (get_mode shadow_root_ptr)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>type_wf h; shadow_root_ptr |\<in>| shadow_root_ptr_kinds h\<rbrakk> \<Longrightarrow> h \<turnstile> ok get_mode shadow_root_ptr
[PROOF STEP]
unfolding get_mode_def type_wf_impl
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>ShadowRootClass.type_wf h; shadow_root_ptr |\<in>| shadow_root_ptr_kinds h\<rbrakk> \<Longrightarrow> h \<turnstile> ok get_M\<^sub>S\<^sub>h\<^sub>a\<^sub>d\<^sub>o\<^sub>w\<^sub>R\<^sub>o\<^sub>o\<^sub>t shadow_root_ptr mode
[PROOF STEP]
using ShadowRootMonad.get_M\<^sub>S\<^sub>h\<^sub>a\<^sub>d\<^sub>o\<^sub>w\<^sub>R\<^sub>o\<^sub>o\<^sub>t_ok
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>ShadowRootClass.type_wf ?h; ?ptr |\<in>| shadow_root_ptr_kinds ?h\<rbrakk> \<Longrightarrow> ?h \<turnstile> ok get_M\<^sub>S\<^sub>h\<^sub>a\<^sub>d\<^sub>o\<^sub>w\<^sub>R\<^sub>o\<^sub>o\<^sub>t ?ptr ?getter

goal (1 subgoal):
 1. \<lbrakk>ShadowRootClass.type_wf h; shadow_root_ptr |\<in>| shadow_root_ptr_kinds h\<rbrakk> \<Longrightarrow> h \<turnstile> ok get_M\<^sub>S\<^sub>h\<^sub>a\<^sub>d\<^sub>o\<^sub>w\<^sub>R\<^sub>o\<^sub>o\<^sub>t shadow_root_ptr mode
[PROOF STEP]
by blast


[STATEMENT]
lemma virtual_memop_step_simulates_direct_memop_step:
  assumes step:
  "(is, \<theta>, x, m, \<D>, \<O>, \<R>, \<S>) \<rightarrow> (is', \<theta>', x', m', \<D>', \<O>', \<R>', \<S>')"
  shows "(is, \<theta>, x, m, \<D>, \<O>, (), \<S>) \<rightarrow>\<^sub>v (is', \<theta>', x', m', \<D>', \<O>', (), \<S>')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (is, \<theta>, x, m, \<D>, \<O>, (), \<S>) \<rightarrow>\<^sub>v (is', \<theta>', x', m', \<D>', \<O>', (), \<S>')
[PROOF STEP]
using step
[PROOF STATE]
proof (prove)
using this:
(is, \<theta>, x, m, \<D>, \<O>, \<R>, \<S>) \<rightarrow> (is', \<theta>', x', m', \<D>', \<O>', \<R>', \<S>')

goal (1 subgoal):
 1. (is, \<theta>, x, m, \<D>, \<O>, (), \<S>) \<rightarrow>\<^sub>v (is', \<theta>', x', m', \<D>', \<O>', (), \<S>')
[PROOF STEP]
apply (cases)
[PROOF STATE]
proof (prove)
goal (7 subgoals):
 1. \<And>volatile a t. \<lbrakk>is = Read volatile a t # is'; \<theta>' = \<theta>(t \<mapsto> m a); x' = x; m' = m; \<D>' = \<D>; \<O>' = \<O>; \<R>' = \<R>; \<S>' = \<S>\<rbrakk> \<Longrightarrow> (is, \<theta>, x, m, \<D>, \<O>, (), \<S>) \<rightarrow>\<^sub>v (is', \<theta>', x', m', \<D>', \<O>', (), \<S>')
 2. \<And>a D f A L R W. \<lbrakk>is = Write False a (D, f) A L R W # is'; \<theta>' = \<theta>; x' = x; m' = m(a := f \<theta>); \<D>' = \<D>; \<O>' = \<O>; \<R>' = \<R>; \<S>' = \<S>\<rbrakk> \<Longrightarrow> (is, \<theta>, x, m, \<D>, \<O>, (), \<S>) \<rightarrow>\<^sub>v (is', \<theta>', x', m', \<D>', \<O>', (), \<S>')
 3. \<And>a D f A L R W. \<lbrakk>is = Write True a (D, f) A L R W # is'; \<theta>' = \<theta>; x' = x; m' = m(a := f \<theta>); \<D>' = True; \<O>' = \<O> \<union> A - R; \<R>' = Map.empty; \<S>' = \<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L\<rbrakk> \<Longrightarrow> (is, \<theta>, x, m, \<D>, \<O>, (), \<S>) \<rightarrow>\<^sub>v (is', \<theta>', x', m', \<D>', \<O>', (), \<S>')
 4. \<lbrakk>is = Fence # is'; \<theta>' = \<theta>; x' = x; m' = m; \<D>' = False; \<O>' = \<O>; \<R>' = Map.empty; \<S>' = \<S>\<rbrakk> \<Longrightarrow> (is, \<theta>, x, m, \<D>, \<O>, (), \<S>) \<rightarrow>\<^sub>v (is', \<theta>', x', m', \<D>', \<O>', (), \<S>')
 5. \<And>cond t a D f ret A L R W. \<lbrakk>is = RMW a t (D, f) cond ret A L R W # is'; \<theta>' = \<theta>(t \<mapsto> m a); x' = x; m' = m; \<D>' = False; \<O>' = \<O>; \<R>' = Map.empty; \<S>' = \<S>; \<not> cond (\<theta>(t \<mapsto> m a))\<rbrakk> \<Longrightarrow> (is, \<theta>, x, m, \<D>, \<O>, (), \<S>) \<rightarrow>\<^sub>v (is', \<theta>', x', m', \<D>', \<O>', (), \<S>')
 6. \<And>cond t a D f ret A L R W. \<lbrakk>is = RMW a t (D, f) cond ret A L R W # is'; \<theta>' = \<theta>(t \<mapsto> ret (m a) (f (\<theta>(t \<mapsto> m a)))); x' = x; m' = m(a := f (\<theta>(t \<mapsto> m a))); \<D>' = False; \<O>' = \<O> \<union> A - R; \<R>' = Map.empty; \<S>' = \<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L; cond (\<theta>(t \<mapsto> m a))\<rbrakk> \<Longrightarrow> (is, \<theta>, x, m, \<D>, \<O>, (), \<S>) \<rightarrow>\<^sub>v (is', \<theta>', x', m', \<D>', \<O>', (), \<S>')
 7. \<And>A L R W. \<lbrakk>is = Ghost A L R W # is'; \<theta>' = \<theta>; x' = x; m' = m; \<D>' = \<D>; \<O>' = \<O> \<union> A - R; \<R>' = augment_rels (dom \<S>) R \<R>; \<S>' = \<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L\<rbrakk> \<Longrightarrow> (is, \<theta>, x, m, \<D>, \<O>, (), \<S>) \<rightarrow>\<^sub>v (is', \<theta>', x', m', \<D>', \<O>', (), \<S>')
[PROOF STEP]
apply (auto intro: virtual_memop_step.gen_direct_memop_step.intros)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma put_M\<^sub>E\<^sub>l\<^sub>e\<^sub>m\<^sub>e\<^sub>n\<^sub>t_tag_name_type_wf_preserved [simp]:
  "h \<turnstile> put_M element_ptr tag_name_update v \<rightarrow>\<^sub>h h' \<Longrightarrow> type_wf h = type_wf h'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. h \<turnstile> put_M element_ptr tag_name_update v \<rightarrow>\<^sub>h h' \<Longrightarrow> DocumentClass.type_wf h = DocumentClass.type_wf h'
[PROOF STEP]
apply(auto simp add: ElementMonad.put_M_defs put\<^sub>E\<^sub>l\<^sub>e\<^sub>m\<^sub>e\<^sub>n\<^sub>t_def put\<^sub>N\<^sub>o\<^sub>d\<^sub>e_def
      DocumentClass.type_wf\<^sub>C\<^sub>h\<^sub>a\<^sub>r\<^sub>a\<^sub>c\<^sub>t\<^sub>e\<^sub>r\<^sub>D\<^sub>a\<^sub>t\<^sub>a DocumentClass.type_wf\<^sub>E\<^sub>l\<^sub>e\<^sub>m\<^sub>e\<^sub>n\<^sub>t
      DocumentClass.type_wf\<^sub>N\<^sub>o\<^sub>d\<^sub>e DocumentClass.type_wf\<^sub>O\<^sub>b\<^sub>j\<^sub>e\<^sub>c\<^sub>t
      is_node_kind_def
      dest!: get_heap_E
      elim!: bind_returns_heap_E2
      intro!: type_wf_put_I CharacterDataMonad.type_wf_put_I ElementMonad.type_wf_put_I
      NodeMonad.type_wf_put_I ObjectMonad.type_wf_put_I)[1]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>h \<turnstile> get_M element_ptr id \<rightarrow>\<^sub>r x; h' = put (cast (cast element_ptr)) (cast (cast (x\<lparr>tag_name := v\<rparr>))) h; DocumentClass.type_wf (put (cast (cast element_ptr)) (cast (cast (x\<lparr>tag_name := v\<rparr>))) h)\<rbrakk> \<Longrightarrow> DocumentClass.type_wf h
[PROOF STEP]
apply(auto simp add: is_node_kind_def type_wf_defs ElementClass.type_wf_defs NodeClass.type_wf_defs
      ElementMonad.get_M_defs ObjectClass.type_wf_defs
      CharacterDataClass.type_wf_defs split: option.splits)[1]
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x node_ptr. \<lbrakk>\<forall>character_data_ptr\<in>fset (character_data_ptr_kinds h). \<exists>y. get character_data_ptr h = Some y; \<forall>document_ptr\<in>fset (document_ptr_kinds h). \<exists>y. get document_ptr h = Some y; get element_ptr h = Some x; h' = put (cast (cast element_ptr)) (cast (cast (x\<lparr>tag_name := v\<rparr>))) h; \<forall>node_ptr\<in>fset (node_ptr_kinds h). \<exists>y. (if cast element_ptr = node_ptr then cast (cast (cast (x\<lparr>tag_name := v\<rparr>))) else get node_ptr h) = Some y; \<forall>element_ptra\<in>fset (element_ptr_kinds h). \<exists>y. (if element_ptr = element_ptra then cast (cast (x\<lparr>tag_name := v\<rparr>)) else get element_ptra h) = Some y; node_ptr |\<in>| node_ptr_kinds h\<rbrakk> \<Longrightarrow> \<exists>y. get node_ptr h = Some y
 2. \<And>x element_ptra. \<lbrakk>\<forall>character_data_ptr\<in>fset (character_data_ptr_kinds h). \<exists>y. get character_data_ptr h = Some y; \<forall>document_ptr\<in>fset (document_ptr_kinds h). \<exists>y. get document_ptr h = Some y; get element_ptr h = Some x; h' = put (cast (cast element_ptr)) (cast (cast (x\<lparr>tag_name := v\<rparr>))) h; \<forall>node_ptr\<in>fset (node_ptr_kinds h). \<exists>y. (if cast element_ptr = node_ptr then cast (cast (cast (x\<lparr>tag_name := v\<rparr>))) else get node_ptr h) = Some y; \<forall>element_ptra\<in>fset (element_ptr_kinds h). \<exists>y. (if element_ptr = element_ptra then cast (cast (x\<lparr>tag_name := v\<rparr>)) else get element_ptra h) = Some y; element_ptra |\<in>| element_ptr_kinds h\<rbrakk> \<Longrightarrow> \<exists>y. get element_ptra h = Some y
[PROOF STEP]
apply (metis NodeClass.a_type_wf_def NodeClass.get\<^sub>N\<^sub>o\<^sub>d\<^sub>e_type_wf ObjectClass.a_type_wf_def
      bind.bind_lzero finite_set_in get\<^sub>E\<^sub>l\<^sub>e\<^sub>m\<^sub>e\<^sub>n\<^sub>t_def l_type_wf_def\<^sub>N\<^sub>o\<^sub>d\<^sub>e.a_type_wf_def option.collapse
      option.distinct(1) option.simps(3))
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x element_ptra. \<lbrakk>\<forall>character_data_ptr\<in>fset (character_data_ptr_kinds h). \<exists>y. get character_data_ptr h = Some y; \<forall>document_ptr\<in>fset (document_ptr_kinds h). \<exists>y. get document_ptr h = Some y; get element_ptr h = Some x; h' = put (cast (cast element_ptr)) (cast (cast (x\<lparr>tag_name := v\<rparr>))) h; \<forall>node_ptr\<in>fset (node_ptr_kinds h). \<exists>y. (if cast element_ptr = node_ptr then cast (cast (cast (x\<lparr>tag_name := v\<rparr>))) else get node_ptr h) = Some y; \<forall>element_ptra\<in>fset (element_ptr_kinds h). \<exists>y. (if element_ptr = element_ptra then cast (cast (x\<lparr>tag_name := v\<rparr>)) else get element_ptra h) = Some y; element_ptra |\<in>| element_ptr_kinds h\<rbrakk> \<Longrightarrow> \<exists>y. get element_ptra h = Some y
[PROOF STEP]
by (metis fmember.rep_eq)


[STATEMENT]
lemma "The P \<noteq> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. The P \<noteq> x
[PROOF STEP]
nitpick [expect = genuine]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. The P \<noteq> x
[PROOF STEP]
oops


[STATEMENT]
lemma wf_cdecl_compPI:
  "\<lbrakk> \<And>C M b Ts T m.
     \<lbrakk> wf_mdecl wf\<^sub>1 P C (M,b,Ts,T,m); P \<turnstile> C sees M,b:Ts\<rightarrow>T = m in C \<rbrakk>
     \<Longrightarrow> wf_mdecl wf\<^sub>2 (compP f P) C (M,b,Ts,T, f b m);
    \<forall>x\<in>set P. wf_cdecl wf\<^sub>1 P x; x \<in> set (compP f P); wf_prog p P \<rbrakk>
  \<Longrightarrow> wf_cdecl wf\<^sub>2 (compP f P) x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<And>C M b Ts T m. \<lbrakk>wf_mdecl wf\<^sub>1 P C (M, b, Ts, T, m); P \<turnstile> C sees M, b :  Ts\<rightarrow>T = m in C\<rbrakk> \<Longrightarrow> wf_mdecl wf\<^sub>2 (compP f P) C (M, b, Ts, T, f b m); \<forall>x\<in>set P. wf_cdecl wf\<^sub>1 P x; x \<in> set (compP f P); wf_prog p P\<rbrakk> \<Longrightarrow> wf_cdecl wf\<^sub>2 (compP f P) x
[PROOF STEP]
(*<*)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<And>C M b Ts T m. \<lbrakk>wf_mdecl wf\<^sub>1 P C (M, b, Ts, T, m); P \<turnstile> C sees M, b :  Ts\<rightarrow>T = m in C\<rbrakk> \<Longrightarrow> wf_mdecl wf\<^sub>2 (compP f P) C (M, b, Ts, T, f b m); \<forall>x\<in>set P. wf_cdecl wf\<^sub>1 P x; x \<in> set (compP f P); wf_prog p P\<rbrakk> \<Longrightarrow> wf_cdecl wf\<^sub>2 (compP f P) x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>\<And>C M b Ts T m. \<lbrakk>wf_mdecl wf\<^sub>1 P C (M, b, Ts, T, m); P \<turnstile> C sees M, b :  Ts\<rightarrow>T = m in C\<rbrakk> \<Longrightarrow> wf_mdecl wf\<^sub>2 (compP f P) C (M, b, Ts, T, f b m); \<forall>x\<in>set P. wf_cdecl wf\<^sub>1 P x; x \<in> set (compP f P); wf_prog p P\<rbrakk> \<Longrightarrow> wf_cdecl wf\<^sub>2 (compP f P) x
[PROOF STEP]
assume
   wfm: "\<And>C M b Ts T m. \<lbrakk> wf_mdecl wf\<^sub>1 P C (M,b,Ts,T,m); P \<turnstile> C sees M,b:Ts\<rightarrow>T = m in C \<rbrakk>
     \<Longrightarrow> wf_mdecl wf\<^sub>2 (compP f P) C (M,b,Ts,T, f b m)"
    and wfc: "\<forall>x\<in>set P. wf_cdecl wf\<^sub>1 P x"
    and compP: "x \<in> set (compP f P)" and wf: "wf_prog p P"
[PROOF STATE]
proof (state)
this:
\<lbrakk>wf_mdecl wf\<^sub>1 P ?C (?M, ?b, ?Ts, ?T, ?m); P \<turnstile> ?C sees ?M, ?b :  ?Ts\<rightarrow>?T = ?m in ?C\<rbrakk> \<Longrightarrow> wf_mdecl wf\<^sub>2 (compP f P) ?C (?M, ?b, ?Ts, ?T, f ?b ?m)
\<forall>x\<in>set P. wf_cdecl wf\<^sub>1 P x
x \<in> set (compP f P)
wf_prog p P

goal (1 subgoal):
 1. \<lbrakk>\<And>C M b Ts T m. \<lbrakk>wf_mdecl wf\<^sub>1 P C (M, b, Ts, T, m); P \<turnstile> C sees M, b :  Ts\<rightarrow>T = m in C\<rbrakk> \<Longrightarrow> wf_mdecl wf\<^sub>2 (compP f P) C (M, b, Ts, T, f b m); \<forall>x\<in>set P. wf_cdecl wf\<^sub>1 P x; x \<in> set (compP f P); wf_prog p P\<rbrakk> \<Longrightarrow> wf_cdecl wf\<^sub>2 (compP f P) x
[PROOF STEP]
obtain C D fs ms where x: "x = (C, D, fs, map (compM f) ms)"
    and x_set: "(C, D, fs, ms) \<in> set P"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>C D fs ms. \<lbrakk>x = (C, D, fs, map (compM f) ms); (C, D, fs, ms) \<in> set P\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using compP
[PROOF STATE]
proof (prove)
using this:
x \<in> set (compP f P)

goal (1 subgoal):
 1. (\<And>C D fs ms. \<lbrakk>x = (C, D, fs, map (compM f) ms); (C, D, fs, ms) \<in> set P\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by(case_tac x) (clarsimp simp: set_compP)
[PROOF STATE]
proof (state)
this:
x = (C, D, fs, map (compM f) ms)
(C, D, fs, ms) \<in> set P

goal (1 subgoal):
 1. \<lbrakk>\<And>C M b Ts T m. \<lbrakk>wf_mdecl wf\<^sub>1 P C (M, b, Ts, T, m); P \<turnstile> C sees M, b :  Ts\<rightarrow>T = m in C\<rbrakk> \<Longrightarrow> wf_mdecl wf\<^sub>2 (compP f P) C (M, b, Ts, T, f b m); \<forall>x\<in>set P. wf_cdecl wf\<^sub>1 P x; x \<in> set (compP f P); wf_prog p P\<rbrakk> \<Longrightarrow> wf_cdecl wf\<^sub>2 (compP f P) x
[PROOF STEP]
have wfc': "wf_cdecl wf\<^sub>1 P (C, D, fs, ms)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wf_cdecl wf\<^sub>1 P (C, D, fs, ms)
[PROOF STEP]
using wfc x_set
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>set P. wf_cdecl wf\<^sub>1 P x
(C, D, fs, ms) \<in> set P

goal (1 subgoal):
 1. wf_cdecl wf\<^sub>1 P (C, D, fs, ms)
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
wf_cdecl wf\<^sub>1 P (C, D, fs, ms)

goal (1 subgoal):
 1. \<lbrakk>\<And>C M b Ts T m. \<lbrakk>wf_mdecl wf\<^sub>1 P C (M, b, Ts, T, m); P \<turnstile> C sees M, b :  Ts\<rightarrow>T = m in C\<rbrakk> \<Longrightarrow> wf_mdecl wf\<^sub>2 (compP f P) C (M, b, Ts, T, f b m); \<forall>x\<in>set P. wf_cdecl wf\<^sub>1 P x; x \<in> set (compP f P); wf_prog p P\<rbrakk> \<Longrightarrow> wf_cdecl wf\<^sub>2 (compP f P) x
[PROOF STEP]
let ?P = "compP f P" and ?ms = "compM f ` set ms"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>\<And>C M b Ts T m. \<lbrakk>wf_mdecl wf\<^sub>1 P C (M, b, Ts, T, m); P \<turnstile> C sees M, b :  Ts\<rightarrow>T = m in C\<rbrakk> \<Longrightarrow> wf_mdecl wf\<^sub>2 (compP f P) C (M, b, Ts, T, f b m); \<forall>x\<in>set P. wf_cdecl wf\<^sub>1 P x; x \<in> set (compP f P); wf_prog p P\<rbrakk> \<Longrightarrow> wf_cdecl wf\<^sub>2 (compP f P) x
[PROOF STEP]
{
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>\<And>C M b Ts T m. \<lbrakk>wf_mdecl wf\<^sub>1 P C (M, b, Ts, T, m); P \<turnstile> C sees M, b :  Ts\<rightarrow>T = m in C\<rbrakk> \<Longrightarrow> wf_mdecl wf\<^sub>2 (compP f P) C (M, b, Ts, T, f b m); \<forall>x\<in>set P. wf_cdecl wf\<^sub>1 P x; x \<in> set (compP f P); wf_prog p P\<rbrakk> \<Longrightarrow> wf_cdecl wf\<^sub>2 (compP f P) x
[PROOF STEP]
fix M b Ts T m
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>\<And>C M b Ts T m. \<lbrakk>wf_mdecl wf\<^sub>1 P C (M, b, Ts, T, m); P \<turnstile> C sees M, b :  Ts\<rightarrow>T = m in C\<rbrakk> \<Longrightarrow> wf_mdecl wf\<^sub>2 (compP f P) C (M, b, Ts, T, f b m); \<forall>x\<in>set P. wf_cdecl wf\<^sub>1 P x; x \<in> set (compP f P); wf_prog p P\<rbrakk> \<Longrightarrow> wf_cdecl wf\<^sub>2 (compP f P) x
[PROOF STEP]
assume M: "(M,b,Ts,T,m) \<in> set ms"
[PROOF STATE]
proof (state)
this:
(M, b, Ts, T, m) \<in> set ms

goal (1 subgoal):
 1. \<lbrakk>\<And>C M b Ts T m. \<lbrakk>wf_mdecl wf\<^sub>1 P C (M, b, Ts, T, m); P \<turnstile> C sees M, b :  Ts\<rightarrow>T = m in C\<rbrakk> \<Longrightarrow> wf_mdecl wf\<^sub>2 (compP f P) C (M, b, Ts, T, f b m); \<forall>x\<in>set P. wf_cdecl wf\<^sub>1 P x; x \<in> set (compP f P); wf_prog p P\<rbrakk> \<Longrightarrow> wf_cdecl wf\<^sub>2 (compP f P) x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(M, b, Ts, T, m) \<in> set ms
[PROOF STEP]
have "wf_mdecl wf\<^sub>1 P C (M, b, Ts, T, m)"
[PROOF STATE]
proof (prove)
using this:
(M, b, Ts, T, m) \<in> set ms

goal (1 subgoal):
 1. wf_mdecl wf\<^sub>1 P C (M, b, Ts, T, m)
[PROOF STEP]
using wfc'
[PROOF STATE]
proof (prove)
using this:
(M, b, Ts, T, m) \<in> set ms
wf_cdecl wf\<^sub>1 P (C, D, fs, ms)

goal (1 subgoal):
 1. wf_mdecl wf\<^sub>1 P C (M, b, Ts, T, m)
[PROOF STEP]
by(simp add:wf_cdecl_def)
[PROOF STATE]
proof (state)
this:
wf_mdecl wf\<^sub>1 P C (M, b, Ts, T, m)

goal (1 subgoal):
 1. \<lbrakk>\<And>C M b Ts T m. \<lbrakk>wf_mdecl wf\<^sub>1 P C (M, b, Ts, T, m); P \<turnstile> C sees M, b :  Ts\<rightarrow>T = m in C\<rbrakk> \<Longrightarrow> wf_mdecl wf\<^sub>2 (compP f P) C (M, b, Ts, T, f b m); \<forall>x\<in>set P. wf_cdecl wf\<^sub>1 P x; x \<in> set (compP f P); wf_prog p P\<rbrakk> \<Longrightarrow> wf_cdecl wf\<^sub>2 (compP f P) x
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
wf_mdecl wf\<^sub>1 P C (M, b, Ts, T, m)

goal (1 subgoal):
 1. \<lbrakk>\<And>C M b Ts T m. \<lbrakk>wf_mdecl wf\<^sub>1 P C (M, b, Ts, T, m); P \<turnstile> C sees M, b :  Ts\<rightarrow>T = m in C\<rbrakk> \<Longrightarrow> wf_mdecl wf\<^sub>2 (compP f P) C (M, b, Ts, T, f b m); \<forall>x\<in>set P. wf_cdecl wf\<^sub>1 P x; x \<in> set (compP f P); wf_prog p P\<rbrakk> \<Longrightarrow> wf_cdecl wf\<^sub>2 (compP f P) x
[PROOF STEP]
have cM: "P \<turnstile> C sees M, b :  Ts\<rightarrow>T = m in C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P \<turnstile> C sees M, b :  Ts\<rightarrow>T = m in C
[PROOF STEP]
using M
[PROOF STATE]
proof (prove)
using this:
(M, b, Ts, T, m) \<in> set ms

goal (1 subgoal):
 1. P \<turnstile> C sees M, b :  Ts\<rightarrow>T = m in C
[PROOF STEP]
by(rule mdecl_visible[OF wf x_set])
[PROOF STATE]
proof (state)
this:
P \<turnstile> C sees M, b :  Ts\<rightarrow>T = m in C

goal (1 subgoal):
 1. \<lbrakk>\<And>C M b Ts T m. \<lbrakk>wf_mdecl wf\<^sub>1 P C (M, b, Ts, T, m); P \<turnstile> C sees M, b :  Ts\<rightarrow>T = m in C\<rbrakk> \<Longrightarrow> wf_mdecl wf\<^sub>2 (compP f P) C (M, b, Ts, T, f b m); \<forall>x\<in>set P. wf_cdecl wf\<^sub>1 P x; x \<in> set (compP f P); wf_prog p P\<rbrakk> \<Longrightarrow> wf_cdecl wf\<^sub>2 (compP f P) x
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
wf_mdecl wf\<^sub>1 P C (M, b, Ts, T, m)
P \<turnstile> C sees M, b :  Ts\<rightarrow>T = m in C
[PROOF STEP]
have "wf_mdecl wf\<^sub>2 (compP f P) C (M, b, Ts, T, f b m)"
[PROOF STATE]
proof (prove)
using this:
wf_mdecl wf\<^sub>1 P C (M, b, Ts, T, m)
P \<turnstile> C sees M, b :  Ts\<rightarrow>T = m in C

goal (1 subgoal):
 1. wf_mdecl wf\<^sub>2 (compP f P) C (M, b, Ts, T, f b m)
[PROOF STEP]
by(rule wfm)
[PROOF STATE]
proof (state)
this:
wf_mdecl wf\<^sub>2 (compP f P) C (M, b, Ts, T, f b m)

goal (1 subgoal):
 1. \<lbrakk>\<And>C M b Ts T m. \<lbrakk>wf_mdecl wf\<^sub>1 P C (M, b, Ts, T, m); P \<turnstile> C sees M, b :  Ts\<rightarrow>T = m in C\<rbrakk> \<Longrightarrow> wf_mdecl wf\<^sub>2 (compP f P) C (M, b, Ts, T, f b m); \<forall>x\<in>set P. wf_cdecl wf\<^sub>1 P x; x \<in> set (compP f P); wf_prog p P\<rbrakk> \<Longrightarrow> wf_cdecl wf\<^sub>2 (compP f P) x
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
(?M2, ?b2, ?Ts2, ?T2, ?m2) \<in> set ms \<Longrightarrow> wf_mdecl wf\<^sub>2 (compP f P) C (?M2, ?b2, ?Ts2, ?T2, f ?b2 ?m2)

goal (1 subgoal):
 1. \<lbrakk>\<And>C M b Ts T m. \<lbrakk>wf_mdecl wf\<^sub>1 P C (M, b, Ts, T, m); P \<turnstile> C sees M, b :  Ts\<rightarrow>T = m in C\<rbrakk> \<Longrightarrow> wf_mdecl wf\<^sub>2 (compP f P) C (M, b, Ts, T, f b m); \<forall>x\<in>set P. wf_cdecl wf\<^sub>1 P x; x \<in> set (compP f P); wf_prog p P\<rbrakk> \<Longrightarrow> wf_cdecl wf\<^sub>2 (compP f P) x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(?M2, ?b2, ?Ts2, ?T2, ?m2) \<in> set ms \<Longrightarrow> wf_mdecl wf\<^sub>2 (compP f P) C (?M2, ?b2, ?Ts2, ?T2, f ?b2 ?m2)
[PROOF STEP]
have "\<forall>m \<in> ?ms. wf_mdecl wf\<^sub>2 ?P C m"
[PROOF STATE]
proof (prove)
using this:
(?M2, ?b2, ?Ts2, ?T2, ?m2) \<in> set ms \<Longrightarrow> wf_mdecl wf\<^sub>2 (compP f P) C (?M2, ?b2, ?Ts2, ?T2, f ?b2 ?m2)

goal (1 subgoal):
 1. \<forall>m\<in>compM f ` set ms. wf_mdecl wf\<^sub>2 (compP f P) C m
[PROOF STEP]
by (clarsimp simp:compM_def)
[PROOF STATE]
proof (state)
this:
\<forall>m\<in>compM f ` set ms. wf_mdecl wf\<^sub>2 (compP f P) C m

goal (1 subgoal):
 1. \<lbrakk>\<And>C M b Ts T m. \<lbrakk>wf_mdecl wf\<^sub>1 P C (M, b, Ts, T, m); P \<turnstile> C sees M, b :  Ts\<rightarrow>T = m in C\<rbrakk> \<Longrightarrow> wf_mdecl wf\<^sub>2 (compP f P) C (M, b, Ts, T, f b m); \<forall>x\<in>set P. wf_cdecl wf\<^sub>1 P x; x \<in> set (compP f P); wf_prog p P\<rbrakk> \<Longrightarrow> wf_cdecl wf\<^sub>2 (compP f P) x
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<forall>m\<in>compM f ` set ms. wf_mdecl wf\<^sub>2 (compP f P) C m

goal (1 subgoal):
 1. \<lbrakk>\<And>C M b Ts T m. \<lbrakk>wf_mdecl wf\<^sub>1 P C (M, b, Ts, T, m); P \<turnstile> C sees M, b :  Ts\<rightarrow>T = m in C\<rbrakk> \<Longrightarrow> wf_mdecl wf\<^sub>2 (compP f P) C (M, b, Ts, T, f b m); \<forall>x\<in>set P. wf_cdecl wf\<^sub>1 P x; x \<in> set (compP f P); wf_prog p P\<rbrakk> \<Longrightarrow> wf_cdecl wf\<^sub>2 (compP f P) x
[PROOF STEP]
have "C \<noteq> Object \<longrightarrow>
   (\<forall>(M,b,Ts,T,m)\<in>?ms.
      \<forall>D' b' Ts' T' m'. ?P \<turnstile> D sees M,b':Ts' \<rightarrow> T' = m' in D' \<longrightarrow>
                       b = b' \<and> P \<turnstile> Ts' [\<le>] Ts \<and> P \<turnstile> T \<le> T')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. C \<noteq> Object \<longrightarrow> (\<forall>(M, b, Ts, T, m)\<in>compM f ` set ms. \<forall>D' b' Ts' T' m'. compP f P \<turnstile> D sees M, b' :  Ts'\<rightarrow>T' = m' in D' \<longrightarrow> b = b' \<and> P \<turnstile> Ts' [\<le>] Ts \<and> P \<turnstile> T \<le> T')
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. C \<noteq> Object \<longrightarrow> (\<forall>(M, b, Ts, T, m)\<in>compM f ` set ms. \<forall>D' b' Ts' T' m'. compP f P \<turnstile> D sees M, b' :  Ts'\<rightarrow>T' = m' in D' \<longrightarrow> b = b' \<and> P \<turnstile> Ts' [\<le>] Ts \<and> P \<turnstile> T \<le> T')
[PROOF STEP]
{
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. C \<noteq> Object \<longrightarrow> (\<forall>(M, b, Ts, T, m)\<in>compM f ` set ms. \<forall>D' b' Ts' T' m'. compP f P \<turnstile> D sees M, b' :  Ts'\<rightarrow>T' = m' in D' \<longrightarrow> b = b' \<and> P \<turnstile> Ts' [\<le>] Ts \<and> P \<turnstile> T \<le> T')
[PROOF STEP]
fix M b Ts T m D' b' Ts' T' m'
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. C \<noteq> Object \<longrightarrow> (\<forall>(M, b, Ts, T, m)\<in>compM f ` set ms. \<forall>D' b' Ts' T' m'. compP f P \<turnstile> D sees M, b' :  Ts'\<rightarrow>T' = m' in D' \<longrightarrow> b = b' \<and> P \<turnstile> Ts' [\<le>] Ts \<and> P \<turnstile> T \<le> T')
[PROOF STEP]
assume "C \<noteq> Object" and "(M,b,Ts,T,m)\<in>?ms"
        and dM: "?P \<turnstile> D sees M,b':Ts' \<rightarrow> T' = m' in D'"
[PROOF STATE]
proof (state)
this:
C \<noteq> Object
(M, b, Ts, T, m) \<in> compM f ` set ms
compP f P \<turnstile> D sees M, b' :  Ts'\<rightarrow>T' = m' in D'

goal (1 subgoal):
 1. C \<noteq> Object \<longrightarrow> (\<forall>(M, b, Ts, T, m)\<in>compM f ` set ms. \<forall>D' b' Ts' T' m'. compP f P \<turnstile> D sees M, b' :  Ts'\<rightarrow>T' = m' in D' \<longrightarrow> b = b' \<and> P \<turnstile> Ts' [\<le>] Ts \<and> P \<turnstile> T \<le> T')
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
C \<noteq> Object
(M, b, Ts, T, m) \<in> compM f ` set ms
compP f P \<turnstile> D sees M, b' :  Ts'\<rightarrow>T' = m' in D'
[PROOF STEP]
have "b = b' \<and> P \<turnstile> Ts' [\<le>] Ts \<and> P \<turnstile> T \<le> T'"
[PROOF STATE]
proof (prove)
using this:
C \<noteq> Object
(M, b, Ts, T, m) \<in> compM f ` set ms
compP f P \<turnstile> D sees M, b' :  Ts'\<rightarrow>T' = m' in D'

goal (1 subgoal):
 1. b = b' \<and> P \<turnstile> Ts' [\<le>] Ts \<and> P \<turnstile> T \<le> T'
[PROOF STEP]
using wfc' sees_method_compPD[OF dM]
[PROOF STATE]
proof (prove)
using this:
C \<noteq> Object
(M, b, Ts, T, m) \<in> compM f ` set ms
compP f P \<turnstile> D sees M, b' :  Ts'\<rightarrow>T' = m' in D'
wf_cdecl wf\<^sub>1 P (C, D, fs, ms)
\<exists>m. P \<turnstile> D sees M, b' :  Ts'\<rightarrow>T' = m in D' \<and> f b' m = m'

goal (1 subgoal):
 1. b = b' \<and> P \<turnstile> Ts' [\<le>] Ts \<and> P \<turnstile> T \<le> T'
[PROOF STEP]
by(fastforce simp:wf_cdecl_def image_iff compM_def)
[PROOF STATE]
proof (state)
this:
b = b' \<and> P \<turnstile> Ts' [\<le>] Ts \<and> P \<turnstile> T \<le> T'

goal (1 subgoal):
 1. C \<noteq> Object \<longrightarrow> (\<forall>(M, b, Ts, T, m)\<in>compM f ` set ms. \<forall>D' b' Ts' T' m'. compP f P \<turnstile> D sees M, b' :  Ts'\<rightarrow>T' = m' in D' \<longrightarrow> b = b' \<and> P \<turnstile> Ts' [\<le>] Ts \<and> P \<turnstile> T \<le> T')
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
\<lbrakk>C \<noteq> Object; (?M2, ?b2, ?Ts2, ?T2, ?m2) \<in> compM f ` set ms; compP f P \<turnstile> D sees ?M2, ?b'2 :  ?Ts'2\<rightarrow>?T'2 = ?m'2 in ?D'2\<rbrakk> \<Longrightarrow> ?b2 = ?b'2 \<and> P \<turnstile> ?Ts'2 [\<le>] ?Ts2 \<and> P \<turnstile> ?T2 \<le> ?T'2

goal (1 subgoal):
 1. C \<noteq> Object \<longrightarrow> (\<forall>(M, b, Ts, T, m)\<in>compM f ` set ms. \<forall>D' b' Ts' T' m'. compP f P \<turnstile> D sees M, b' :  Ts'\<rightarrow>T' = m' in D' \<longrightarrow> b = b' \<and> P \<turnstile> Ts' [\<le>] Ts \<and> P \<turnstile> T \<le> T')
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>C \<noteq> Object; (?M2, ?b2, ?Ts2, ?T2, ?m2) \<in> compM f ` set ms; compP f P \<turnstile> D sees ?M2, ?b'2 :  ?Ts'2\<rightarrow>?T'2 = ?m'2 in ?D'2\<rbrakk> \<Longrightarrow> ?b2 = ?b'2 \<and> P \<turnstile> ?Ts'2 [\<le>] ?Ts2 \<and> P \<turnstile> ?T2 \<le> ?T'2
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>C \<noteq> Object; (?M2, ?b2, ?Ts2, ?T2, ?m2) \<in> compM f ` set ms; compP f P \<turnstile> D sees ?M2, ?b'2 :  ?Ts'2\<rightarrow>?T'2 = ?m'2 in ?D'2\<rbrakk> \<Longrightarrow> ?b2 = ?b'2 \<and> P \<turnstile> ?Ts'2 [\<le>] ?Ts2 \<and> P \<turnstile> ?T2 \<le> ?T'2

goal (1 subgoal):
 1. C \<noteq> Object \<longrightarrow> (\<forall>(M, b, Ts, T, m)\<in>compM f ` set ms. \<forall>D' b' Ts' T' m'. compP f P \<turnstile> D sees M, b' :  Ts'\<rightarrow>T' = m' in D' \<longrightarrow> b = b' \<and> P \<turnstile> Ts' [\<le>] Ts \<and> P \<turnstile> T \<le> T')
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
C \<noteq> Object \<longrightarrow> (\<forall>(M, b, Ts, T, m)\<in>compM f ` set ms. \<forall>D' b' Ts' T' m'. compP f P \<turnstile> D sees M, b' :  Ts'\<rightarrow>T' = m' in D' \<longrightarrow> b = b' \<and> P \<turnstile> Ts' [\<le>] Ts \<and> P \<turnstile> T \<le> T')

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
C \<noteq> Object \<longrightarrow> (\<forall>(M, b, Ts, T, m)\<in>compM f ` set ms. \<forall>D' b' Ts' T' m'. compP f P \<turnstile> D sees M, b' :  Ts'\<rightarrow>T' = m' in D' \<longrightarrow> b = b' \<and> P \<turnstile> Ts' [\<le>] Ts \<and> P \<turnstile> T \<le> T')

goal (1 subgoal):
 1. \<lbrakk>\<And>C M b Ts T m. \<lbrakk>wf_mdecl wf\<^sub>1 P C (M, b, Ts, T, m); P \<turnstile> C sees M, b :  Ts\<rightarrow>T = m in C\<rbrakk> \<Longrightarrow> wf_mdecl wf\<^sub>2 (compP f P) C (M, b, Ts, T, f b m); \<forall>x\<in>set P. wf_cdecl wf\<^sub>1 P x; x \<in> set (compP f P); wf_prog p P\<rbrakk> \<Longrightarrow> wf_cdecl wf\<^sub>2 (compP f P) x
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
C \<noteq> Object \<longrightarrow> (\<forall>(M, b, Ts, T, m)\<in>compM f ` set ms. \<forall>D' b' Ts' T' m'. compP f P \<turnstile> D sees M, b' :  Ts'\<rightarrow>T' = m' in D' \<longrightarrow> b = b' \<and> P \<turnstile> Ts' [\<le>] Ts \<and> P \<turnstile> T \<le> T')

goal (1 subgoal):
 1. \<lbrakk>\<And>C M b Ts T m. \<lbrakk>wf_mdecl wf\<^sub>1 P C (M, b, Ts, T, m); P \<turnstile> C sees M, b :  Ts\<rightarrow>T = m in C\<rbrakk> \<Longrightarrow> wf_mdecl wf\<^sub>2 (compP f P) C (M, b, Ts, T, f b m); \<forall>x\<in>set P. wf_cdecl wf\<^sub>1 P x; x \<in> set (compP f P); wf_prog p P\<rbrakk> \<Longrightarrow> wf_cdecl wf\<^sub>2 (compP f P) x
[PROOF STEP]
have "(\<forall>f\<in>set fs. wf_fdecl P f) \<and> distinct_fst fs
     \<and> distinct_fst ms \<and> wf_clinit ms
     \<and> (C \<noteq> Object \<longrightarrow> is_class P D \<and> \<not> P \<turnstile> D \<preceq>\<^sup>* C)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>f\<in>set fs. wf_fdecl P f) \<and> distinct_fst fs \<and> distinct_fst ms \<and> wf_clinit ms \<and> (C \<noteq> Object \<longrightarrow> is_class P D \<and> (D, C) \<notin> (subcls1 P)\<^sup>*)
[PROOF STEP]
using wfc'
[PROOF STATE]
proof (prove)
using this:
wf_cdecl wf\<^sub>1 P (C, D, fs, ms)

goal (1 subgoal):
 1. (\<forall>f\<in>set fs. wf_fdecl P f) \<and> distinct_fst fs \<and> distinct_fst ms \<and> wf_clinit ms \<and> (C \<noteq> Object \<longrightarrow> is_class P D \<and> (D, C) \<notin> (subcls1 P)\<^sup>*)
[PROOF STEP]
by(simp add: wf_cdecl_def)
[PROOF STATE]
proof (state)
this:
(\<forall>f\<in>set fs. wf_fdecl P f) \<and> distinct_fst fs \<and> distinct_fst ms \<and> wf_clinit ms \<and> (C \<noteq> Object \<longrightarrow> is_class P D \<and> (D, C) \<notin> (subcls1 P)\<^sup>*)

goal (1 subgoal):
 1. \<lbrakk>\<And>C M b Ts T m. \<lbrakk>wf_mdecl wf\<^sub>1 P C (M, b, Ts, T, m); P \<turnstile> C sees M, b :  Ts\<rightarrow>T = m in C\<rbrakk> \<Longrightarrow> wf_mdecl wf\<^sub>2 (compP f P) C (M, b, Ts, T, f b m); \<forall>x\<in>set P. wf_cdecl wf\<^sub>1 P x; x \<in> set (compP f P); wf_prog p P\<rbrakk> \<Longrightarrow> wf_cdecl wf\<^sub>2 (compP f P) x
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<forall>m\<in>compM f ` set ms. wf_mdecl wf\<^sub>2 (compP f P) C m
C \<noteq> Object \<longrightarrow> (\<forall>(M, b, Ts, T, m)\<in>compM f ` set ms. \<forall>D' b' Ts' T' m'. compP f P \<turnstile> D sees M, b' :  Ts'\<rightarrow>T' = m' in D' \<longrightarrow> b = b' \<and> P \<turnstile> Ts' [\<le>] Ts \<and> P \<turnstile> T \<le> T')
(\<forall>f\<in>set fs. wf_fdecl P f) \<and> distinct_fst fs \<and> distinct_fst ms \<and> wf_clinit ms \<and> (C \<noteq> Object \<longrightarrow> is_class P D \<and> (D, C) \<notin> (subcls1 P)\<^sup>*)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<forall>m\<in>compM f ` set ms. wf_mdecl wf\<^sub>2 (compP f P) C m
C \<noteq> Object \<longrightarrow> (\<forall>(M, b, Ts, T, m)\<in>compM f ` set ms. \<forall>D' b' Ts' T' m'. compP f P \<turnstile> D sees M, b' :  Ts'\<rightarrow>T' = m' in D' \<longrightarrow> b = b' \<and> P \<turnstile> Ts' [\<le>] Ts \<and> P \<turnstile> T \<le> T')
(\<forall>f\<in>set fs. wf_fdecl P f) \<and> distinct_fst fs \<and> distinct_fst ms \<and> wf_clinit ms \<and> (C \<noteq> Object \<longrightarrow> is_class P D \<and> (D, C) \<notin> (subcls1 P)\<^sup>*)

goal (1 subgoal):
 1. wf_cdecl wf\<^sub>2 (compP f P) x
[PROOF STEP]
using x
[PROOF STATE]
proof (prove)
using this:
\<forall>m\<in>compM f ` set ms. wf_mdecl wf\<^sub>2 (compP f P) C m
C \<noteq> Object \<longrightarrow> (\<forall>(M, b, Ts, T, m)\<in>compM f ` set ms. \<forall>D' b' Ts' T' m'. compP f P \<turnstile> D sees M, b' :  Ts'\<rightarrow>T' = m' in D' \<longrightarrow> b = b' \<and> P \<turnstile> Ts' [\<le>] Ts \<and> P \<turnstile> T \<le> T')
(\<forall>f\<in>set fs. wf_fdecl P f) \<and> distinct_fst fs \<and> distinct_fst ms \<and> wf_clinit ms \<and> (C \<noteq> Object \<longrightarrow> is_class P D \<and> (D, C) \<notin> (subcls1 P)\<^sup>*)
x = (C, D, fs, map (compM f) ms)

goal (1 subgoal):
 1. wf_cdecl wf\<^sub>2 (compP f P) x
[PROOF STEP]
by(simp add:wf_cdecl_def)
[PROOF STATE]
proof (state)
this:
wf_cdecl wf\<^sub>2 (compP f P) x

goal:
No subgoals!
[PROOF STEP]
qed