[STATEMENT]
lemma (in rga) insert_in_apply_set:
  assumes "es @ [Deliver (i, Insert e (Some a))] prefix of j"
      and "Deliver (i', Insert e' n) \<in> set es"
      and "apply_operations es = Some s"
    shows "fst e' \<in> element_ids s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fst e' \<in> element_ids s
[PROOF STEP]
using assms apply_opers_idx_elems idx_in_elem_inserted prefix_of_appendD
[PROOF STATE]
proof (prove)
using this:
es @ [Deliver (i, Insert e (Some a))] prefix of j
Deliver (i', Insert e' n) \<in> set es
apply_operations es = Some s
\<lbrakk>?es prefix of ?i; apply_operations ?es = Some ?xs\<rbrakk> \<Longrightarrow> element_ids ?xs = set (indices ?es)
Deliver (?i, Insert ?e ?n) \<in> set ?xs \<Longrightarrow> fst ?e \<in> set (indices ?xs)
?xs @ ?ys prefix of ?i \<Longrightarrow> ?xs prefix of ?i

goal (1 subgoal):
 1. fst e' \<in> element_ids s
[PROOF STEP]
by blast


[STATEMENT]
lemma get_shadow_root_ok: "type_wf h \<Longrightarrow> element_ptr |\<in>| element_ptr_kinds h \<Longrightarrow> h \<turnstile> ok (get_shadow_root element_ptr)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>type_wf h; element_ptr |\<in>| element_ptr_kinds h\<rbrakk> \<Longrightarrow> h \<turnstile> ok get_shadow_root element_ptr
[PROOF STEP]
unfolding get_shadow_root_def type_wf_impl
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>ShadowRootClass.type_wf h; element_ptr |\<in>| element_ptr_kinds h\<rbrakk> \<Longrightarrow> h \<turnstile> ok get_M\<^sub>E\<^sub>l\<^sub>e\<^sub>m\<^sub>e\<^sub>n\<^sub>t element_ptr shadow_root_opt
[PROOF STEP]
using ShadowRootMonad.get_M\<^sub>E\<^sub>l\<^sub>e\<^sub>m\<^sub>e\<^sub>n\<^sub>t_ok
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>ShadowRootClass.type_wf ?h; ?ptr |\<in>| element_ptr_kinds ?h\<rbrakk> \<Longrightarrow> ?h \<turnstile> ok get_M\<^sub>E\<^sub>l\<^sub>e\<^sub>m\<^sub>e\<^sub>n\<^sub>t ?ptr ?getter

goal (1 subgoal):
 1. \<lbrakk>ShadowRootClass.type_wf h; element_ptr |\<in>| element_ptr_kinds h\<rbrakk> \<Longrightarrow> h \<turnstile> ok get_M\<^sub>E\<^sub>l\<^sub>e\<^sub>m\<^sub>e\<^sub>n\<^sub>t element_ptr shadow_root_opt
[PROOF STEP]
by blast


[STATEMENT]
lemma lemma_9:
  assumes "dickson_grading d" and "is_rewrite_ord rword" and "is_RB_upt d rword G u"
    and "inj_on lt G" and "\<not> is_syz_sig d u" and "is_canon_rewriter rword G u g1" and "h \<in> G"
    and "is_sig_red (\<prec>\<^sub>t) (=) {h} (monom_mult 1 (pp_of_term u - lp g1) g1)"
    and "d (pp_of_term u) \<le> dgrad_max d"
  shows "lcs (punit.lt (rep_list g1)) (punit.lt (rep_list h)) - punit.lt (rep_list g1) =
            pp_of_term u - lp g1" (is ?thesis1)
    and "lcs (punit.lt (rep_list g1)) (punit.lt (rep_list h)) - punit.lt (rep_list h) =
            ((pp_of_term u - lp g1) + punit.lt (rep_list g1)) - punit.lt (rep_list h)" (is ?thesis2)
    and "is_regular_spair g1 h" (is ?thesis3)
    and "lt (spair g1 h) = u" (is ?thesis4)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (lcs (punit.lt (rep_list g1)) (punit.lt (rep_list h)) - punit.lt (rep_list g1) = pp_of_term u - lp g1 &&& lcs (punit.lt (rep_list g1)) (punit.lt (rep_list h)) - punit.lt (rep_list h) = pp_of_term u - lp g1 + punit.lt (rep_list g1) - punit.lt (rep_list h)) &&& is_regular_spair g1 h &&& lt (spair g1 h) = u
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. lcs (punit.lt (rep_list g1)) (punit.lt (rep_list h)) - punit.lt (rep_list g1) = pp_of_term u - lp g1
 2. lcs (punit.lt (rep_list g1)) (punit.lt (rep_list h)) - punit.lt (rep_list h) = pp_of_term u - lp g1 + punit.lt (rep_list g1) - punit.lt (rep_list h)
 3. is_regular_spair g1 h
 4. lt (spair g1 h) = u
[PROOF STEP]
from assms(8)
[PROOF STATE]
proof (chain)
picking this:
is_sig_red (\<prec>\<^sub>t) (=) {h} (monom_mult (1::'b) (pp_of_term u - lp g1) g1)
[PROOF STEP]
have "rep_list (monom_mult 1 (pp_of_term u - lp g1) g1) \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
is_sig_red (\<prec>\<^sub>t) (=) {h} (monom_mult (1::'b) (pp_of_term u - lp g1) g1)

goal (1 subgoal):
 1. rep_list (monom_mult (1::'b) (pp_of_term u - lp g1) g1) \<noteq> 0
[PROOF STEP]
using is_sig_red_top_addsE
[PROOF STATE]
proof (prove)
using this:
is_sig_red (\<prec>\<^sub>t) (=) {h} (monom_mult (1::'b) (pp_of_term u - lp g1) g1)
\<lbrakk>is_sig_red ?sing_reg (=) ?F ?p; \<And>f. \<lbrakk>f \<in> ?F; rep_list f \<noteq> 0; rep_list ?p \<noteq> 0; punit.lt (rep_list f) adds punit.lt (rep_list ?p); ?sing_reg (punit.lt (rep_list ?p) \<oplus> lt f) (punit.lt (rep_list f) \<oplus> lt ?p)\<rbrakk> \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. rep_list (monom_mult (1::'b) (pp_of_term u - lp g1) g1) \<noteq> 0
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
rep_list (monom_mult (1::'b) (pp_of_term u - lp g1) g1) \<noteq> 0

goal (4 subgoals):
 1. lcs (punit.lt (rep_list g1)) (punit.lt (rep_list h)) - punit.lt (rep_list g1) = pp_of_term u - lp g1
 2. lcs (punit.lt (rep_list g1)) (punit.lt (rep_list h)) - punit.lt (rep_list h) = pp_of_term u - lp g1 + punit.lt (rep_list g1) - punit.lt (rep_list h)
 3. is_regular_spair g1 h
 4. lt (spair g1 h) = u
[PROOF STEP]
hence "rep_list g1 \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
rep_list (monom_mult (1::'b) (pp_of_term u - lp g1) g1) \<noteq> 0

goal (1 subgoal):
 1. rep_list g1 \<noteq> 0
[PROOF STEP]
by (simp add: rep_list_monom_mult punit.monom_mult_eq_zero_iff)
[PROOF STATE]
proof (state)
this:
rep_list g1 \<noteq> 0

goal (4 subgoals):
 1. lcs (punit.lt (rep_list g1)) (punit.lt (rep_list h)) - punit.lt (rep_list g1) = pp_of_term u - lp g1
 2. lcs (punit.lt (rep_list g1)) (punit.lt (rep_list h)) - punit.lt (rep_list h) = pp_of_term u - lp g1 + punit.lt (rep_list g1) - punit.lt (rep_list h)
 3. is_regular_spair g1 h
 4. lt (spair g1 h) = u
[PROOF STEP]
hence "g1 \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
rep_list g1 \<noteq> 0

goal (1 subgoal):
 1. g1 \<noteq> 0
[PROOF STEP]
by (auto simp: rep_list_zero)
[PROOF STATE]
proof (state)
this:
g1 \<noteq> 0

goal (4 subgoals):
 1. lcs (punit.lt (rep_list g1)) (punit.lt (rep_list h)) - punit.lt (rep_list g1) = pp_of_term u - lp g1
 2. lcs (punit.lt (rep_list g1)) (punit.lt (rep_list h)) - punit.lt (rep_list h) = pp_of_term u - lp g1 + punit.lt (rep_list g1) - punit.lt (rep_list h)
 3. is_regular_spair g1 h
 4. lt (spair g1 h) = u
[PROOF STEP]
from assms(6)
[PROOF STATE]
proof (chain)
picking this:
is_canon_rewriter rword G u g1
[PROOF STEP]
have "g1 \<in> G" and "lt g1 adds\<^sub>t u"
[PROOF STATE]
proof (prove)
using this:
is_canon_rewriter rword G u g1

goal (1 subgoal):
 1. g1 \<in> G &&& lt g1 adds\<^sub>t u
[PROOF STEP]
by (rule is_canon_rewriterD)+
[PROOF STATE]
proof (state)
this:
g1 \<in> G
lt g1 adds\<^sub>t u

goal (4 subgoals):
 1. lcs (punit.lt (rep_list g1)) (punit.lt (rep_list h)) - punit.lt (rep_list g1) = pp_of_term u - lp g1
 2. lcs (punit.lt (rep_list g1)) (punit.lt (rep_list h)) - punit.lt (rep_list h) = pp_of_term u - lp g1 + punit.lt (rep_list g1) - punit.lt (rep_list h)
 3. is_regular_spair g1 h
 4. lt (spair g1 h) = u
[PROOF STEP]
from assms(3)
[PROOF STATE]
proof (chain)
picking this:
is_RB_upt d rword G u
[PROOF STEP]
have "G \<subseteq> dgrad_sig_set d"
[PROOF STATE]
proof (prove)
using this:
is_RB_upt d rword G u

goal (1 subgoal):
 1. G \<subseteq> dgrad_sig_set' (length fs) d
[PROOF STEP]
by (rule is_RB_uptD1)
[PROOF STATE]
proof (state)
this:
G \<subseteq> dgrad_sig_set' (length fs) d

goal (4 subgoals):
 1. lcs (punit.lt (rep_list g1)) (punit.lt (rep_list h)) - punit.lt (rep_list g1) = pp_of_term u - lp g1
 2. lcs (punit.lt (rep_list g1)) (punit.lt (rep_list h)) - punit.lt (rep_list h) = pp_of_term u - lp g1 + punit.lt (rep_list g1) - punit.lt (rep_list h)
 3. is_regular_spair g1 h
 4. lt (spair g1 h) = u
[PROOF STEP]
with \<open>g1 \<in> G\<close>
[PROOF STATE]
proof (chain)
picking this:
g1 \<in> G
G \<subseteq> dgrad_sig_set' (length fs) d
[PROOF STEP]
have "g1 \<in> dgrad_sig_set d"
[PROOF STATE]
proof (prove)
using this:
g1 \<in> G
G \<subseteq> dgrad_sig_set' (length fs) d

goal (1 subgoal):
 1. g1 \<in> dgrad_sig_set' (length fs) d
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
g1 \<in> dgrad_sig_set' (length fs) d

goal (4 subgoals):
 1. lcs (punit.lt (rep_list g1)) (punit.lt (rep_list h)) - punit.lt (rep_list g1) = pp_of_term u - lp g1
 2. lcs (punit.lt (rep_list g1)) (punit.lt (rep_list h)) - punit.lt (rep_list h) = pp_of_term u - lp g1 + punit.lt (rep_list g1) - punit.lt (rep_list h)
 3. is_regular_spair g1 h
 4. lt (spair g1 h) = u
[PROOF STEP]
hence "component_of_term (lt g1) < length fs"
[PROOF STATE]
proof (prove)
using this:
g1 \<in> dgrad_sig_set' (length fs) d

goal (1 subgoal):
 1. component_of_term (lt g1) < length fs
[PROOF STEP]
using \<open>g1 \<noteq> 0\<close>
[PROOF STATE]
proof (prove)
using this:
g1 \<in> dgrad_sig_set' (length fs) d
g1 \<noteq> 0

goal (1 subgoal):
 1. component_of_term (lt g1) < length fs
[PROOF STEP]
by (rule dgrad_sig_setD_lt)
[PROOF STATE]
proof (state)
this:
component_of_term (lt g1) < length fs

goal (4 subgoals):
 1. lcs (punit.lt (rep_list g1)) (punit.lt (rep_list h)) - punit.lt (rep_list g1) = pp_of_term u - lp g1
 2. lcs (punit.lt (rep_list g1)) (punit.lt (rep_list h)) - punit.lt (rep_list h) = pp_of_term u - lp g1 + punit.lt (rep_list g1) - punit.lt (rep_list h)
 3. is_regular_spair g1 h
 4. lt (spair g1 h) = u
[PROOF STEP]
with \<open>lt g1 adds\<^sub>t u\<close>
[PROOF STATE]
proof (chain)
picking this:
lt g1 adds\<^sub>t u
component_of_term (lt g1) < length fs
[PROOF STEP]
have "component_of_term u < length fs"
[PROOF STATE]
proof (prove)
using this:
lt g1 adds\<^sub>t u
component_of_term (lt g1) < length fs

goal (1 subgoal):
 1. component_of_term u < length fs
[PROOF STEP]
by (simp add: adds_term_def)
[PROOF STATE]
proof (state)
this:
component_of_term u < length fs

goal (4 subgoals):
 1. lcs (punit.lt (rep_list g1)) (punit.lt (rep_list h)) - punit.lt (rep_list g1) = pp_of_term u - lp g1
 2. lcs (punit.lt (rep_list g1)) (punit.lt (rep_list h)) - punit.lt (rep_list h) = pp_of_term u - lp g1 + punit.lt (rep_list g1) - punit.lt (rep_list h)
 3. is_regular_spair g1 h
 4. lt (spair g1 h) = u
[PROOF STEP]
from \<open>lt g1 adds\<^sub>t u\<close>
[PROOF STATE]
proof (chain)
picking this:
lt g1 adds\<^sub>t u
[PROOF STEP]
obtain a where u: "u = a \<oplus> lt g1"
[PROOF STATE]
proof (prove)
using this:
lt g1 adds\<^sub>t u

goal (1 subgoal):
 1. (\<And>a. u = a \<oplus> lt g1 \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (rule adds_termE)
[PROOF STATE]
proof (state)
this:
u = a \<oplus> lt g1

goal (4 subgoals):
 1. lcs (punit.lt (rep_list g1)) (punit.lt (rep_list h)) - punit.lt (rep_list g1) = pp_of_term u - lp g1
 2. lcs (punit.lt (rep_list g1)) (punit.lt (rep_list h)) - punit.lt (rep_list h) = pp_of_term u - lp g1 + punit.lt (rep_list g1) - punit.lt (rep_list h)
 3. is_regular_spair g1 h
 4. lt (spair g1 h) = u
[PROOF STEP]
hence a: "a = pp_of_term u - lp g1"
[PROOF STATE]
proof (prove)
using this:
u = a \<oplus> lt g1

goal (1 subgoal):
 1. a = pp_of_term u - lp g1
[PROOF STEP]
by (simp add: term_simps)
[PROOF STATE]
proof (state)
this:
a = pp_of_term u - lp g1

goal (4 subgoals):
 1. lcs (punit.lt (rep_list g1)) (punit.lt (rep_list h)) - punit.lt (rep_list g1) = pp_of_term u - lp g1
 2. lcs (punit.lt (rep_list g1)) (punit.lt (rep_list h)) - punit.lt (rep_list h) = pp_of_term u - lp g1 + punit.lt (rep_list g1) - punit.lt (rep_list h)
 3. is_regular_spair g1 h
 4. lt (spair g1 h) = u
[PROOF STEP]
from assms(8)
[PROOF STATE]
proof (chain)
picking this:
is_sig_red (\<prec>\<^sub>t) (=) {h} (monom_mult (1::'b) (pp_of_term u - lp g1) g1)
[PROOF STEP]
have "is_sig_red (\<prec>\<^sub>t) (=) {h} (monom_mult 1 a g1)"
[PROOF STATE]
proof (prove)
using this:
is_sig_red (\<prec>\<^sub>t) (=) {h} (monom_mult (1::'b) (pp_of_term u - lp g1) g1)

goal (1 subgoal):
 1. is_sig_red (\<prec>\<^sub>t) (=) {h} (monom_mult (1::'b) a g1)
[PROOF STEP]
by (simp only: a)
[PROOF STATE]
proof (state)
this:
is_sig_red (\<prec>\<^sub>t) (=) {h} (monom_mult (1::'b) a g1)

goal (4 subgoals):
 1. lcs (punit.lt (rep_list g1)) (punit.lt (rep_list h)) - punit.lt (rep_list g1) = pp_of_term u - lp g1
 2. lcs (punit.lt (rep_list g1)) (punit.lt (rep_list h)) - punit.lt (rep_list h) = pp_of_term u - lp g1 + punit.lt (rep_list g1) - punit.lt (rep_list h)
 3. is_regular_spair g1 h
 4. lt (spair g1 h) = u
[PROOF STEP]
hence "rep_list h \<noteq> 0" and "rep_list (monom_mult 1 a g1) \<noteq> 0" and
      2: "punit.lt (rep_list h) adds punit.lt (rep_list (monom_mult 1 a g1))" and
      3: "punit.lt (rep_list (monom_mult 1 a g1)) \<oplus> lt h \<prec>\<^sub>t punit.lt (rep_list h) \<oplus> lt (monom_mult 1 a g1)"
[PROOF STATE]
proof (prove)
using this:
is_sig_red (\<prec>\<^sub>t) (=) {h} (monom_mult (1::'b) a g1)

goal (1 subgoal):
 1. (rep_list h \<noteq> 0 &&& rep_list (monom_mult (1::'b) a g1) \<noteq> 0) &&& punit.lt (rep_list h) adds punit.lt (rep_list (monom_mult (1::'b) a g1)) &&& punit.lt (rep_list (monom_mult (1::'b) a g1)) \<oplus> lt h \<prec>\<^sub>t punit.lt (rep_list h) \<oplus> lt (monom_mult (1::'b) a g1)
[PROOF STEP]
by (auto elim: is_sig_red_top_addsE)
[PROOF STATE]
proof (state)
this:
rep_list h \<noteq> 0
rep_list (monom_mult (1::'b) a g1) \<noteq> 0
punit.lt (rep_list h) adds punit.lt (rep_list (monom_mult (1::'b) a g1))
punit.lt (rep_list (monom_mult (1::'b) a g1)) \<oplus> lt h \<prec>\<^sub>t punit.lt (rep_list h) \<oplus> lt (monom_mult (1::'b) a g1)

goal (4 subgoals):
 1. lcs (punit.lt (rep_list g1)) (punit.lt (rep_list h)) - punit.lt (rep_list g1) = pp_of_term u - lp g1
 2. lcs (punit.lt (rep_list g1)) (punit.lt (rep_list h)) - punit.lt (rep_list h) = pp_of_term u - lp g1 + punit.lt (rep_list g1) - punit.lt (rep_list h)
 3. is_regular_spair g1 h
 4. lt (spair g1 h) = u
[PROOF STEP]
from this(2)
[PROOF STATE]
proof (chain)
picking this:
rep_list (monom_mult (1::'b) a g1) \<noteq> 0
[PROOF STEP]
have "rep_list g1 \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
rep_list (monom_mult (1::'b) a g1) \<noteq> 0

goal (1 subgoal):
 1. rep_list g1 \<noteq> 0
[PROOF STEP]
by (simp add: rep_list_monom_mult punit.monom_mult_eq_zero_iff)
[PROOF STATE]
proof (state)
this:
rep_list g1 \<noteq> 0

goal (4 subgoals):
 1. lcs (punit.lt (rep_list g1)) (punit.lt (rep_list h)) - punit.lt (rep_list g1) = pp_of_term u - lp g1
 2. lcs (punit.lt (rep_list g1)) (punit.lt (rep_list h)) - punit.lt (rep_list h) = pp_of_term u - lp g1 + punit.lt (rep_list g1) - punit.lt (rep_list h)
 3. is_regular_spair g1 h
 4. lt (spair g1 h) = u
[PROOF STEP]
hence "g1 \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
rep_list g1 \<noteq> 0

goal (1 subgoal):
 1. g1 \<noteq> 0
[PROOF STEP]
by (auto simp: rep_list_zero)
[PROOF STATE]
proof (state)
this:
g1 \<noteq> 0

goal (4 subgoals):
 1. lcs (punit.lt (rep_list g1)) (punit.lt (rep_list h)) - punit.lt (rep_list g1) = pp_of_term u - lp g1
 2. lcs (punit.lt (rep_list g1)) (punit.lt (rep_list h)) - punit.lt (rep_list h) = pp_of_term u - lp g1 + punit.lt (rep_list g1) - punit.lt (rep_list h)
 3. is_regular_spair g1 h
 4. lt (spair g1 h) = u
[PROOF STEP]
from \<open>rep_list h \<noteq> 0\<close>
[PROOF STATE]
proof (chain)
picking this:
rep_list h \<noteq> 0
[PROOF STEP]
have "h \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
rep_list h \<noteq> 0

goal (1 subgoal):
 1. h \<noteq> 0
[PROOF STEP]
by (auto simp: rep_list_zero)
[PROOF STATE]
proof (state)
this:
h \<noteq> 0

goal (4 subgoals):
 1. lcs (punit.lt (rep_list g1)) (punit.lt (rep_list h)) - punit.lt (rep_list g1) = pp_of_term u - lp g1
 2. lcs (punit.lt (rep_list g1)) (punit.lt (rep_list h)) - punit.lt (rep_list h) = pp_of_term u - lp g1 + punit.lt (rep_list g1) - punit.lt (rep_list h)
 3. is_regular_spair g1 h
 4. lt (spair g1 h) = u
[PROOF STEP]
from 2 \<open>rep_list g1 \<noteq> 0\<close>
[PROOF STATE]
proof (chain)
picking this:
punit.lt (rep_list h) adds punit.lt (rep_list (monom_mult (1::'b) a g1))
rep_list g1 \<noteq> 0
[PROOF STEP]
have "punit.lt (rep_list h) adds a + punit.lt (rep_list g1)"
[PROOF STATE]
proof (prove)
using this:
punit.lt (rep_list h) adds punit.lt (rep_list (monom_mult (1::'b) a g1))
rep_list g1 \<noteq> 0

goal (1 subgoal):
 1. punit.lt (rep_list h) adds a + punit.lt (rep_list g1)
[PROOF STEP]
by (simp add: rep_list_monom_mult punit.lt_monom_mult)
[PROOF STATE]
proof (state)
this:
punit.lt (rep_list h) adds a + punit.lt (rep_list g1)

goal (4 subgoals):
 1. lcs (punit.lt (rep_list g1)) (punit.lt (rep_list h)) - punit.lt (rep_list g1) = pp_of_term u - lp g1
 2. lcs (punit.lt (rep_list g1)) (punit.lt (rep_list h)) - punit.lt (rep_list h) = pp_of_term u - lp g1 + punit.lt (rep_list g1) - punit.lt (rep_list h)
 3. is_regular_spair g1 h
 4. lt (spair g1 h) = u
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
punit.lt (rep_list h) adds a + punit.lt (rep_list g1)
[PROOF STEP]
obtain b where eq1: "a + punit.lt (rep_list g1) = b + punit.lt (rep_list h)"
[PROOF STATE]
proof (prove)
using this:
punit.lt (rep_list h) adds a + punit.lt (rep_list g1)

goal (1 subgoal):
 1. (\<And>b. a + punit.lt (rep_list g1) = b + punit.lt (rep_list h) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto elim: addsE simp: add.commute)
[PROOF STATE]
proof (state)
this:
a + punit.lt (rep_list g1) = b + punit.lt (rep_list h)

goal (4 subgoals):
 1. lcs (punit.lt (rep_list g1)) (punit.lt (rep_list h)) - punit.lt (rep_list g1) = pp_of_term u - lp g1
 2. lcs (punit.lt (rep_list g1)) (punit.lt (rep_list h)) - punit.lt (rep_list h) = pp_of_term u - lp g1 + punit.lt (rep_list g1) - punit.lt (rep_list h)
 3. is_regular_spair g1 h
 4. lt (spair g1 h) = u
[PROOF STEP]
hence b: "b = ((pp_of_term u - lp g1) + punit.lt (rep_list g1)) - punit.lt (rep_list h)"
[PROOF STATE]
proof (prove)
using this:
a + punit.lt (rep_list g1) = b + punit.lt (rep_list h)

goal (1 subgoal):
 1. b = pp_of_term u - lp g1 + punit.lt (rep_list g1) - punit.lt (rep_list h)
[PROOF STEP]
by (simp add: a)
[PROOF STATE]
proof (state)
this:
b = pp_of_term u - lp g1 + punit.lt (rep_list g1) - punit.lt (rep_list h)

goal (4 subgoals):
 1. lcs (punit.lt (rep_list g1)) (punit.lt (rep_list h)) - punit.lt (rep_list g1) = pp_of_term u - lp g1
 2. lcs (punit.lt (rep_list g1)) (punit.lt (rep_list h)) - punit.lt (rep_list h) = pp_of_term u - lp g1 + punit.lt (rep_list g1) - punit.lt (rep_list h)
 3. is_regular_spair g1 h
 4. lt (spair g1 h) = u
[PROOF STEP]
define g where "g = gcs a b"
[PROOF STATE]
proof (state)
this:
g = gcs a b

goal (4 subgoals):
 1. lcs (punit.lt (rep_list g1)) (punit.lt (rep_list h)) - punit.lt (rep_list g1) = pp_of_term u - lp g1
 2. lcs (punit.lt (rep_list g1)) (punit.lt (rep_list h)) - punit.lt (rep_list h) = pp_of_term u - lp g1 + punit.lt (rep_list g1) - punit.lt (rep_list h)
 3. is_regular_spair g1 h
 4. lt (spair g1 h) = u
[PROOF STEP]
have "g = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. g = (0::'a)
[PROOF STEP]
proof (rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. g \<noteq> (0::'a) \<Longrightarrow> False
[PROOF STEP]
assume "g \<noteq> 0"
[PROOF STATE]
proof (state)
this:
g \<noteq> (0::'a)

goal (1 subgoal):
 1. g \<noteq> (0::'a) \<Longrightarrow> False
[PROOF STEP]
have "g adds a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. g adds a
[PROOF STEP]
unfolding g_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. gcs a b adds a
[PROOF STEP]
by (fact gcs_adds)
[PROOF STATE]
proof (state)
this:
g adds a

goal (1 subgoal):
 1. g \<noteq> (0::'a) \<Longrightarrow> False
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
g adds a

goal (1 subgoal):
 1. g \<noteq> (0::'a) \<Longrightarrow> False
[PROOF STEP]
have "... adds\<^sub>p u"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a adds\<^sub>p u
[PROOF STEP]
unfolding u
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a adds\<^sub>p a \<oplus> lt g1
[PROOF STEP]
by (fact adds_pp_triv)
[PROOF STATE]
proof (state)
this:
a adds\<^sub>p u

goal (1 subgoal):
 1. g \<noteq> (0::'a) \<Longrightarrow> False
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
g adds\<^sub>p u
[PROOF STEP]
obtain v where u2: "u = g \<oplus> v"
[PROOF STATE]
proof (prove)
using this:
g adds\<^sub>p u

goal (1 subgoal):
 1. (\<And>v. u = g \<oplus> v \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (rule adds_ppE)
[PROOF STATE]
proof (state)
this:
u = g \<oplus> v

goal (1 subgoal):
 1. g \<noteq> (0::'a) \<Longrightarrow> False
[PROOF STEP]
hence v: "v = u \<ominus> g"
[PROOF STATE]
proof (prove)
using this:
u = g \<oplus> v

goal (1 subgoal):
 1. v = u \<ominus> g
[PROOF STEP]
by (simp add: term_simps)
[PROOF STATE]
proof (state)
this:
v = u \<ominus> g

goal (1 subgoal):
 1. g \<noteq> (0::'a) \<Longrightarrow> False
[PROOF STEP]
from u2
[PROOF STATE]
proof (chain)
picking this:
u = g \<oplus> v
[PROOF STEP]
have "v adds\<^sub>t u"
[PROOF STATE]
proof (prove)
using this:
u = g \<oplus> v

goal (1 subgoal):
 1. v adds\<^sub>t u
[PROOF STEP]
by (rule adds_termI)
[PROOF STATE]
proof (state)
this:
v adds\<^sub>t u

goal (1 subgoal):
 1. g \<noteq> (0::'a) \<Longrightarrow> False
[PROOF STEP]
hence "v \<preceq>\<^sub>t u"
[PROOF STATE]
proof (prove)
using this:
v adds\<^sub>t u

goal (1 subgoal):
 1. v \<preceq>\<^sub>t u
[PROOF STEP]
by (rule ord_adds_term)
[PROOF STATE]
proof (state)
this:
v \<preceq>\<^sub>t u

goal (1 subgoal):
 1. g \<noteq> (0::'a) \<Longrightarrow> False
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
v \<preceq>\<^sub>t u

goal (1 subgoal):
 1. g \<noteq> (0::'a) \<Longrightarrow> False
[PROOF STEP]
have "v \<noteq> u"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. v \<noteq> u
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. v = u \<Longrightarrow> False
[PROOF STEP]
assume "v = u"
[PROOF STATE]
proof (state)
this:
v = u

goal (1 subgoal):
 1. v = u \<Longrightarrow> False
[PROOF STEP]
hence "g \<oplus> v = 0 \<oplus> v"
[PROOF STATE]
proof (prove)
using this:
v = u

goal (1 subgoal):
 1. g \<oplus> v = (0::'a) \<oplus> v
[PROOF STEP]
by (simp add: u2 term_simps)
[PROOF STATE]
proof (state)
this:
g \<oplus> v = (0::'a) \<oplus> v

goal (1 subgoal):
 1. v = u \<Longrightarrow> False
[PROOF STEP]
hence "g = 0"
[PROOF STATE]
proof (prove)
using this:
g \<oplus> v = (0::'a) \<oplus> v

goal (1 subgoal):
 1. g = (0::'a)
[PROOF STEP]
by (simp only: splus_right_canc)
[PROOF STATE]
proof (state)
this:
g = (0::'a)

goal (1 subgoal):
 1. v = u \<Longrightarrow> False
[PROOF STEP]
with \<open>g \<noteq> 0\<close>
[PROOF STATE]
proof (chain)
picking this:
g \<noteq> (0::'a)
g = (0::'a)
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
g \<noteq> (0::'a)
g = (0::'a)

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
v \<noteq> u

goal (1 subgoal):
 1. g \<noteq> (0::'a) \<Longrightarrow> False
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
v \<preceq>\<^sub>t u
v \<noteq> u
[PROOF STEP]
have "v \<prec>\<^sub>t u"
[PROOF STATE]
proof (prove)
using this:
v \<preceq>\<^sub>t u
v \<noteq> u

goal (1 subgoal):
 1. v \<prec>\<^sub>t u
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
v \<prec>\<^sub>t u

goal (1 subgoal):
 1. g \<noteq> (0::'a) \<Longrightarrow> False
[PROOF STEP]
note assms(3) \<open>v \<prec>\<^sub>t u\<close>
[PROOF STATE]
proof (state)
this:
is_RB_upt d rword G u
v \<prec>\<^sub>t u

goal (1 subgoal):
 1. g \<noteq> (0::'a) \<Longrightarrow> False
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
is_RB_upt d rword G u
v \<prec>\<^sub>t u

goal (1 subgoal):
 1. g \<noteq> (0::'a) \<Longrightarrow> False
[PROOF STEP]
have "d (pp_of_term v) \<le> dgrad_max d"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d (pp_of_term v) \<le> dgrad_max d
[PROOF STEP]
proof (rule le_trans)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. d (pp_of_term v) \<le> ?j
 2. ?j \<le> dgrad_max d
[PROOF STEP]
from assms(1)
[PROOF STATE]
proof (chain)
picking this:
dickson_grading d
[PROOF STEP]
show "d (pp_of_term v) \<le> d (pp_of_term u)"
[PROOF STATE]
proof (prove)
using this:
dickson_grading d

goal (1 subgoal):
 1. d (pp_of_term v) \<le> d (pp_of_term u)
[PROOF STEP]
by (simp add: u2 term_simps dickson_gradingD1)
[PROOF STATE]
proof (state)
this:
d (pp_of_term v) \<le> d (pp_of_term u)

goal (1 subgoal):
 1. d (pp_of_term u) \<le> dgrad_max d
[PROOF STEP]
qed fact
[PROOF STATE]
proof (state)
this:
d (pp_of_term v) \<le> dgrad_max d

goal (1 subgoal):
 1. g \<noteq> (0::'a) \<Longrightarrow> False
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
d (pp_of_term v) \<le> dgrad_max d

goal (1 subgoal):
 1. g \<noteq> (0::'a) \<Longrightarrow> False
[PROOF STEP]
from \<open>component_of_term u < length fs\<close>
[PROOF STATE]
proof (chain)
picking this:
component_of_term u < length fs
[PROOF STEP]
have "component_of_term v < length fs"
[PROOF STATE]
proof (prove)
using this:
component_of_term u < length fs

goal (1 subgoal):
 1. component_of_term v < length fs
[PROOF STEP]
by (simp only: v term_simps)
[PROOF STATE]
proof (state)
this:
component_of_term v < length fs

goal (1 subgoal):
 1. g \<noteq> (0::'a) \<Longrightarrow> False
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
is_RB_upt d rword G u
v \<prec>\<^sub>t u
d (pp_of_term v) \<le> dgrad_max d
component_of_term v < length fs
[PROOF STEP]
have "is_RB_in d rword G v"
[PROOF STATE]
proof (prove)
using this:
is_RB_upt d rword G u
v \<prec>\<^sub>t u
d (pp_of_term v) \<le> dgrad_max d
component_of_term v < length fs

goal (1 subgoal):
 1. is_RB_in d rword G v
[PROOF STEP]
by (rule is_RB_uptD2)
[PROOF STATE]
proof (state)
this:
is_RB_in d rword G v

goal (1 subgoal):
 1. g \<noteq> (0::'a) \<Longrightarrow> False
[PROOF STEP]
thus False
[PROOF STATE]
proof (prove)
using this:
is_RB_in d rword G v

goal (1 subgoal):
 1. False
[PROOF STEP]
proof (rule is_RB_inE)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. is_syz_sig d v \<Longrightarrow> False
 2. \<And>g. \<lbrakk>\<not> is_syz_sig d v; is_canon_rewriter rword G v g; \<not> is_sig_red (\<prec>\<^sub>t) (=) G (monom_mult (1::'b) (pp_of_term v - lp g) g)\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
assume "is_syz_sig d v"
[PROOF STATE]
proof (state)
this:
is_syz_sig d v

goal (2 subgoals):
 1. is_syz_sig d v \<Longrightarrow> False
 2. \<And>g. \<lbrakk>\<not> is_syz_sig d v; is_canon_rewriter rword G v g; \<not> is_sig_red (\<prec>\<^sub>t) (=) G (monom_mult (1::'b) (pp_of_term v - lp g) g)\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
with assms(1)
[PROOF STATE]
proof (chain)
picking this:
dickson_grading d
is_syz_sig d v
[PROOF STEP]
have "is_syz_sig d u"
[PROOF STATE]
proof (prove)
using this:
dickson_grading d
is_syz_sig d v

goal (1 subgoal):
 1. is_syz_sig d u
[PROOF STEP]
using \<open>v adds\<^sub>t u\<close> assms(9)
[PROOF STATE]
proof (prove)
using this:
dickson_grading d
is_syz_sig d v
v adds\<^sub>t u
d (pp_of_term u) \<le> dgrad_max d

goal (1 subgoal):
 1. is_syz_sig d u
[PROOF STEP]
by (rule is_syz_sig_adds)
[PROOF STATE]
proof (state)
this:
is_syz_sig d u

goal (2 subgoals):
 1. is_syz_sig d v \<Longrightarrow> False
 2. \<And>g. \<lbrakk>\<not> is_syz_sig d v; is_canon_rewriter rword G v g; \<not> is_sig_red (\<prec>\<^sub>t) (=) G (monom_mult (1::'b) (pp_of_term v - lp g) g)\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
with assms(5)
[PROOF STATE]
proof (chain)
picking this:
\<not> is_syz_sig d u
is_syz_sig d u
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
\<not> is_syz_sig d u
is_syz_sig d u

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

goal (1 subgoal):
 1. \<And>g. \<lbrakk>\<not> is_syz_sig d v; is_canon_rewriter rword G v g; \<not> is_sig_red (\<prec>\<^sub>t) (=) G (monom_mult (1::'b) (pp_of_term v - lp g) g)\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>g. \<lbrakk>\<not> is_syz_sig d v; is_canon_rewriter rword G v g; \<not> is_sig_red (\<prec>\<^sub>t) (=) G (monom_mult (1::'b) (pp_of_term v - lp g) g)\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
fix g2
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>g. \<lbrakk>\<not> is_syz_sig d v; is_canon_rewriter rword G v g; \<not> is_sig_red (\<prec>\<^sub>t) (=) G (monom_mult (1::'b) (pp_of_term v - lp g) g)\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
assume *: "\<not> is_sig_red (\<prec>\<^sub>t) (=) G (monom_mult 1 (pp_of_term v - lp g2) g2)"
[PROOF STATE]
proof (state)
this:
\<not> is_sig_red (\<prec>\<^sub>t) (=) G (monom_mult (1::'b) (pp_of_term v - lp g2) g2)

goal (1 subgoal):
 1. \<And>g. \<lbrakk>\<not> is_syz_sig d v; is_canon_rewriter rword G v g; \<not> is_sig_red (\<prec>\<^sub>t) (=) G (monom_mult (1::'b) (pp_of_term v - lp g) g)\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
assume "is_canon_rewriter rword G v g2"
[PROOF STATE]
proof (state)
this:
is_canon_rewriter rword G v g2

goal (1 subgoal):
 1. \<And>g. \<lbrakk>\<not> is_syz_sig d v; is_canon_rewriter rword G v g; \<not> is_sig_red (\<prec>\<^sub>t) (=) G (monom_mult (1::'b) (pp_of_term v - lp g) g)\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
hence "g2 \<in> G" and "g2 \<noteq> 0" and "lt g2 adds\<^sub>t v"
[PROOF STATE]
proof (prove)
using this:
is_canon_rewriter rword G v g2

goal (1 subgoal):
 1. g2 \<in> G &&& g2 \<noteq> 0 &&& lt g2 adds\<^sub>t v
[PROOF STEP]
by (rule is_canon_rewriterD)+
[PROOF STATE]
proof (state)
this:
g2 \<in> G
g2 \<noteq> 0
lt g2 adds\<^sub>t v

goal (1 subgoal):
 1. \<And>g. \<lbrakk>\<not> is_syz_sig d v; is_canon_rewriter rword G v g; \<not> is_sig_red (\<prec>\<^sub>t) (=) G (monom_mult (1::'b) (pp_of_term v - lp g) g)\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
assume "\<not> is_syz_sig d v"
[PROOF STATE]
proof (state)
this:
\<not> is_syz_sig d v

goal (1 subgoal):
 1. \<And>g. \<lbrakk>\<not> is_syz_sig d v; is_canon_rewriter rword G v g; \<not> is_sig_red (\<prec>\<^sub>t) (=) G (monom_mult (1::'b) (pp_of_term v - lp g) g)\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
note assms(2) \<open>is_canon_rewriter rword G v g2\<close> assms(6)
[PROOF STATE]
proof (state)
this:
is_rewrite_ord rword
is_canon_rewriter rword G v g2
is_canon_rewriter rword G u g1

goal (1 subgoal):
 1. \<And>g. \<lbrakk>\<not> is_syz_sig d v; is_canon_rewriter rword G v g; \<not> is_sig_red (\<prec>\<^sub>t) (=) G (monom_mult (1::'b) (pp_of_term v - lp g) g)\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
is_rewrite_ord rword
is_canon_rewriter rword G v g2
is_canon_rewriter rword G u g1

goal (1 subgoal):
 1. \<And>g. \<lbrakk>\<not> is_syz_sig d v; is_canon_rewriter rword G v g; \<not> is_sig_red (\<prec>\<^sub>t) (=) G (monom_mult (1::'b) (pp_of_term v - lp g) g)\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
from \<open>lt g2 adds\<^sub>t v\<close> \<open>v adds\<^sub>t u\<close>
[PROOF STATE]
proof (chain)
picking this:
lt g2 adds\<^sub>t v
v adds\<^sub>t u
[PROOF STEP]
have "lt g2 adds\<^sub>t u"
[PROOF STATE]
proof (prove)
using this:
lt g2 adds\<^sub>t v
v adds\<^sub>t u

goal (1 subgoal):
 1. lt g2 adds\<^sub>t u
[PROOF STEP]
by (rule adds_term_trans)
[PROOF STATE]
proof (state)
this:
lt g2 adds\<^sub>t u

goal (1 subgoal):
 1. \<And>g. \<lbrakk>\<not> is_syz_sig d v; is_canon_rewriter rword G v g; \<not> is_sig_red (\<prec>\<^sub>t) (=) G (monom_mult (1::'b) (pp_of_term v - lp g) g)\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
lt g2 adds\<^sub>t u

goal (1 subgoal):
 1. \<And>g. \<lbrakk>\<not> is_syz_sig d v; is_canon_rewriter rword G v g; \<not> is_sig_red (\<prec>\<^sub>t) (=) G (monom_mult (1::'b) (pp_of_term v - lp g) g)\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
from \<open>g adds a\<close>
[PROOF STATE]
proof (chain)
picking this:
g adds a
[PROOF STEP]
have "lt g1 adds\<^sub>t v"
[PROOF STATE]
proof (prove)
using this:
g adds a

goal (1 subgoal):
 1. lt g1 adds\<^sub>t v
[PROOF STEP]
by (simp add: v u minus_splus[symmetric] adds_termI)
[PROOF STATE]
proof (state)
this:
lt g1 adds\<^sub>t v

goal (1 subgoal):
 1. \<And>g. \<lbrakk>\<not> is_syz_sig d v; is_canon_rewriter rword G v g; \<not> is_sig_red (\<prec>\<^sub>t) (=) G (monom_mult (1::'b) (pp_of_term v - lp g) g)\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
is_rewrite_ord rword
is_canon_rewriter rword G v g2
is_canon_rewriter rword G u g1
lt g2 adds\<^sub>t u
lt g1 adds\<^sub>t v
[PROOF STEP]
have "lt g2 = lt g1"
[PROOF STATE]
proof (prove)
using this:
is_rewrite_ord rword
is_canon_rewriter rword G v g2
is_canon_rewriter rword G u g1
lt g2 adds\<^sub>t u
lt g1 adds\<^sub>t v

goal (1 subgoal):
 1. lt g2 = lt g1
[PROOF STEP]
by (rule is_rewrite_ord_canon_rewriterD1)
[PROOF STATE]
proof (state)
this:
lt g2 = lt g1

goal (1 subgoal):
 1. \<And>g. \<lbrakk>\<not> is_syz_sig d v; is_canon_rewriter rword G v g; \<not> is_sig_red (\<prec>\<^sub>t) (=) G (monom_mult (1::'b) (pp_of_term v - lp g) g)\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
with assms(4)
[PROOF STATE]
proof (chain)
picking this:
inj_on lt G
lt g2 = lt g1
[PROOF STEP]
have "g2 = g1"
[PROOF STATE]
proof (prove)
using this:
inj_on lt G
lt g2 = lt g1

goal (1 subgoal):
 1. g2 = g1
[PROOF STEP]
using \<open>g2 \<in> G\<close> \<open>g1 \<in> G\<close>
[PROOF STATE]
proof (prove)
using this:
inj_on lt G
lt g2 = lt g1
g2 \<in> G
g1 \<in> G

goal (1 subgoal):
 1. g2 = g1
[PROOF STEP]
by (rule inj_onD)
[PROOF STATE]
proof (state)
this:
g2 = g1

goal (1 subgoal):
 1. \<And>g. \<lbrakk>\<not> is_syz_sig d v; is_canon_rewriter rword G v g; \<not> is_sig_red (\<prec>\<^sub>t) (=) G (monom_mult (1::'b) (pp_of_term v - lp g) g)\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
have "pp_of_term v - lp g1 = a - g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pp_of_term v - lp g1 = a - g
[PROOF STEP]
by (simp add: u v term_simps diff_diff_add)
[PROOF STATE]
proof (state)
this:
pp_of_term v - lp g1 = a - g

goal (1 subgoal):
 1. \<And>g. \<lbrakk>\<not> is_syz_sig d v; is_canon_rewriter rword G v g; \<not> is_sig_red (\<prec>\<^sub>t) (=) G (monom_mult (1::'b) (pp_of_term v - lp g) g)\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
have "is_sig_red (\<prec>\<^sub>t) (=) G (monom_mult 1 (pp_of_term v - lp g2) g2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_sig_red (\<prec>\<^sub>t) (=) G (monom_mult (1::'b) (pp_of_term v - lp g2) g2)
[PROOF STEP]
unfolding \<open>g2 = g1\<close> \<open>pp_of_term v - lp g1 = a - g\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_sig_red (\<prec>\<^sub>t) (=) G (monom_mult (1::'b) (a - g) g1)
[PROOF STEP]
using assms(7) \<open>rep_list h \<noteq> 0\<close>
[PROOF STATE]
proof (prove)
using this:
h \<in> G
rep_list h \<noteq> 0

goal (1 subgoal):
 1. is_sig_red (\<prec>\<^sub>t) (=) G (monom_mult (1::'b) (a - g) g1)
[PROOF STEP]
proof (rule is_sig_red_top_addsI)
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. rep_list (monom_mult (1::'b) (a - g) g1) \<noteq> 0
 2. punit.lt (rep_list h) adds punit.lt (rep_list (monom_mult (1::'b) (a - g) g1))
 3. ord_term_lin.is_le_rel (\<prec>\<^sub>t)
 4. punit.lt (rep_list (monom_mult (1::'b) (a - g) g1)) \<oplus> lt h \<prec>\<^sub>t punit.lt (rep_list h) \<oplus> lt (monom_mult (1::'b) (a - g) g1)
[PROOF STEP]
from \<open>rep_list g1 \<noteq> 0\<close>
[PROOF STATE]
proof (chain)
picking this:
rep_list g1 \<noteq> 0
[PROOF STEP]
show "rep_list (monom_mult 1 (a - g) g1) \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
rep_list g1 \<noteq> 0

goal (1 subgoal):
 1. rep_list (monom_mult (1::'b) (a - g) g1) \<noteq> 0
[PROOF STEP]
by (simp add: rep_list_monom_mult punit.monom_mult_eq_zero_iff)
[PROOF STATE]
proof (state)
this:
rep_list (monom_mult (1::'b) (a - g) g1) \<noteq> 0

goal (3 subgoals):
 1. punit.lt (rep_list h) adds punit.lt (rep_list (monom_mult (1::'b) (a - g) g1))
 2. ord_term_lin.is_le_rel (\<prec>\<^sub>t)
 3. punit.lt (rep_list (monom_mult (1::'b) (a - g) g1)) \<oplus> lt h \<prec>\<^sub>t punit.lt (rep_list h) \<oplus> lt (monom_mult (1::'b) (a - g) g1)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. punit.lt (rep_list h) adds punit.lt (rep_list (monom_mult (1::'b) (a - g) g1))
 2. ord_term_lin.is_le_rel (\<prec>\<^sub>t)
 3. punit.lt (rep_list (monom_mult (1::'b) (a - g) g1)) \<oplus> lt h \<prec>\<^sub>t punit.lt (rep_list h) \<oplus> lt (monom_mult (1::'b) (a - g) g1)
[PROOF STEP]
have eq3: "(a - g) + punit.lt (rep_list g1) = lcs (punit.lt (rep_list g1)) (punit.lt (rep_list h))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a - g + punit.lt (rep_list g1) = lcs (punit.lt (rep_list g1)) (punit.lt (rep_list h))
[PROOF STEP]
by (simp add: g_def lcs_minus_1[OF eq1, symmetric] adds_minus adds_lcs)
[PROOF STATE]
proof (state)
this:
a - g + punit.lt (rep_list g1) = lcs (punit.lt (rep_list g1)) (punit.lt (rep_list h))

goal (3 subgoals):
 1. punit.lt (rep_list h) adds punit.lt (rep_list (monom_mult (1::'b) (a - g) g1))
 2. ord_term_lin.is_le_rel (\<prec>\<^sub>t)
 3. punit.lt (rep_list (monom_mult (1::'b) (a - g) g1)) \<oplus> lt h \<prec>\<^sub>t punit.lt (rep_list h) \<oplus> lt (monom_mult (1::'b) (a - g) g1)
[PROOF STEP]
from \<open>rep_list g1 \<noteq> 0\<close>
[PROOF STATE]
proof (chain)
picking this:
rep_list g1 \<noteq> 0
[PROOF STEP]
show "punit.lt (rep_list h) adds punit.lt (rep_list (monom_mult 1 (a - g) g1))"
[PROOF STATE]
proof (prove)
using this:
rep_list g1 \<noteq> 0

goal (1 subgoal):
 1. punit.lt (rep_list h) adds punit.lt (rep_list (monom_mult (1::'b) (a - g) g1))
[PROOF STEP]
by (simp add: rep_list_monom_mult punit.lt_monom_mult eq3 adds_lcs_2)
[PROOF STATE]
proof (state)
this:
punit.lt (rep_list h) adds punit.lt (rep_list (monom_mult (1::'b) (a - g) g1))

goal (2 subgoals):
 1. ord_term_lin.is_le_rel (\<prec>\<^sub>t)
 2. punit.lt (rep_list (monom_mult (1::'b) (a - g) g1)) \<oplus> lt h \<prec>\<^sub>t punit.lt (rep_list h) \<oplus> lt (monom_mult (1::'b) (a - g) g1)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. ord_term_lin.is_le_rel (\<prec>\<^sub>t)
 2. punit.lt (rep_list (monom_mult (1::'b) (a - g) g1)) \<oplus> lt h \<prec>\<^sub>t punit.lt (rep_list h) \<oplus> lt (monom_mult (1::'b) (a - g) g1)
[PROOF STEP]
from 3 \<open>rep_list g1 \<noteq> 0\<close> \<open>g1 \<noteq> 0\<close>
[PROOF STATE]
proof (chain)
picking this:
punit.lt (rep_list (monom_mult (1::'b) a g1)) \<oplus> lt h \<prec>\<^sub>t punit.lt (rep_list h) \<oplus> lt (monom_mult (1::'b) a g1)
rep_list g1 \<noteq> 0
g1 \<noteq> 0
[PROOF STEP]
show "punit.lt (rep_list (monom_mult 1 (a - g) g1)) \<oplus> lt h \<prec>\<^sub>t
              punit.lt (rep_list h) \<oplus> lt (monom_mult 1 (a - g) g1)"
[PROOF STATE]
proof (prove)
using this:
punit.lt (rep_list (monom_mult (1::'b) a g1)) \<oplus> lt h \<prec>\<^sub>t punit.lt (rep_list h) \<oplus> lt (monom_mult (1::'b) a g1)
rep_list g1 \<noteq> 0
g1 \<noteq> 0

goal (1 subgoal):
 1. punit.lt (rep_list (monom_mult (1::'b) (a - g) g1)) \<oplus> lt h \<prec>\<^sub>t punit.lt (rep_list h) \<oplus> lt (monom_mult (1::'b) (a - g) g1)
[PROOF STEP]
by (auto simp: rep_list_monom_mult punit.lt_monom_mult lt_monom_mult splus_assoc splus_left_commute
                dest!: ord_term_strict_canc intro: splus_mono_strict)
[PROOF STATE]
proof (state)
this:
punit.lt (rep_list (monom_mult (1::'b) (a - g) g1)) \<oplus> lt h \<prec>\<^sub>t punit.lt (rep_list h) \<oplus> lt (monom_mult (1::'b) (a - g) g1)

goal (1 subgoal):
 1. ord_term_lin.is_le_rel (\<prec>\<^sub>t)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ord_term_lin.is_le_rel (\<prec>\<^sub>t)
[PROOF STEP]
show "ord_term_lin.is_le_rel (\<prec>\<^sub>t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ord_term_lin.is_le_rel (\<prec>\<^sub>t)
[PROOF STEP]
by (fact ord_term_lin.is_le_relI)
[PROOF STATE]
proof (state)
this:
ord_term_lin.is_le_rel (\<prec>\<^sub>t)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
is_sig_red (\<prec>\<^sub>t) (=) G (monom_mult (1::'b) (pp_of_term v - lp g2) g2)

goal (1 subgoal):
 1. \<And>g. \<lbrakk>\<not> is_syz_sig d v; is_canon_rewriter rword G v g; \<not> is_sig_red (\<prec>\<^sub>t) (=) G (monom_mult (1::'b) (pp_of_term v - lp g) g)\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
with *
[PROOF STATE]
proof (chain)
picking this:
\<not> is_sig_red (\<prec>\<^sub>t) (=) G (monom_mult (1::'b) (pp_of_term v - lp g2) g2)
is_sig_red (\<prec>\<^sub>t) (=) G (monom_mult (1::'b) (pp_of_term v - lp g2) g2)
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
\<not> is_sig_red (\<prec>\<^sub>t) (=) G (monom_mult (1::'b) (pp_of_term v - lp g2) g2)
is_sig_red (\<prec>\<^sub>t) (=) G (monom_mult (1::'b) (pp_of_term v - lp g2) g2)

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
False

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
g = (0::'a)

goal (4 subgoals):
 1. lcs (punit.lt (rep_list g1)) (punit.lt (rep_list h)) - punit.lt (rep_list g1) = pp_of_term u - lp g1
 2. lcs (punit.lt (rep_list g1)) (punit.lt (rep_list h)) - punit.lt (rep_list h) = pp_of_term u - lp g1 + punit.lt (rep_list g1) - punit.lt (rep_list h)
 3. is_regular_spair g1 h
 4. lt (spair g1 h) = u
[PROOF STEP]
thus ?thesis1 and ?thesis2
[PROOF STATE]
proof (prove)
using this:
g = (0::'a)

goal (1 subgoal):
 1. lcs (punit.lt (rep_list g1)) (punit.lt (rep_list h)) - punit.lt (rep_list g1) = pp_of_term u - lp g1 &&& lcs (punit.lt (rep_list g1)) (punit.lt (rep_list h)) - punit.lt (rep_list h) = pp_of_term u - lp g1 + punit.lt (rep_list g1) - punit.lt (rep_list h)
[PROOF STEP]
by (simp_all add: a b lcs_minus_1[OF eq1] lcs_minus_2[OF eq1] g_def)
[PROOF STATE]
proof (state)
this:
lcs (punit.lt (rep_list g1)) (punit.lt (rep_list h)) - punit.lt (rep_list g1) = pp_of_term u - lp g1
lcs (punit.lt (rep_list g1)) (punit.lt (rep_list h)) - punit.lt (rep_list h) = pp_of_term u - lp g1 + punit.lt (rep_list g1) - punit.lt (rep_list h)

goal (2 subgoals):
 1. is_regular_spair g1 h
 2. lt (spair g1 h) = u
[PROOF STEP]
hence eq3: "spair g1 h = monom_mult (1 / punit.lc (rep_list g1)) a g1 -
                            monom_mult (1 / punit.lc (rep_list h)) b h"
[PROOF STATE]
proof (prove)
using this:
lcs (punit.lt (rep_list g1)) (punit.lt (rep_list h)) - punit.lt (rep_list g1) = pp_of_term u - lp g1
lcs (punit.lt (rep_list g1)) (punit.lt (rep_list h)) - punit.lt (rep_list h) = pp_of_term u - lp g1 + punit.lt (rep_list g1) - punit.lt (rep_list h)

goal (1 subgoal):
 1. spair g1 h = monom_mult ((1::'b) / punit.lc (rep_list g1)) a g1 - monom_mult ((1::'b) / punit.lc (rep_list h)) b h
[PROOF STEP]
by (simp add: spair_def Let_def a b)
[PROOF STATE]
proof (state)
this:
spair g1 h = monom_mult ((1::'b) / punit.lc (rep_list g1)) a g1 - monom_mult ((1::'b) / punit.lc (rep_list h)) b h

goal (2 subgoals):
 1. is_regular_spair g1 h
 2. lt (spair g1 h) = u
[PROOF STEP]
from 3 \<open>rep_list g1 \<noteq> 0\<close> \<open>g1 \<noteq> 0\<close>
[PROOF STATE]
proof (chain)
picking this:
punit.lt (rep_list (monom_mult (1::'b) a g1)) \<oplus> lt h \<prec>\<^sub>t punit.lt (rep_list h) \<oplus> lt (monom_mult (1::'b) a g1)
rep_list g1 \<noteq> 0
g1 \<noteq> 0
[PROOF STEP]
have "b \<oplus> lt h \<prec>\<^sub>t a \<oplus> lt g1"
[PROOF STATE]
proof (prove)
using this:
punit.lt (rep_list (monom_mult (1::'b) a g1)) \<oplus> lt h \<prec>\<^sub>t punit.lt (rep_list h) \<oplus> lt (monom_mult (1::'b) a g1)
rep_list g1 \<noteq> 0
g1 \<noteq> 0

goal (1 subgoal):
 1. b \<oplus> lt h \<prec>\<^sub>t a \<oplus> lt g1
[PROOF STEP]
by (auto simp: rep_list_monom_mult punit.lt_monom_mult lt_monom_mult eq1 splus_assoc
        splus_left_commute[of b] dest!: ord_term_strict_canc)
[PROOF STATE]
proof (state)
this:
b \<oplus> lt h \<prec>\<^sub>t a \<oplus> lt g1

goal (2 subgoals):
 1. is_regular_spair g1 h
 2. lt (spair g1 h) = u
[PROOF STEP]
hence "a \<oplus> lt g1 \<noteq> b \<oplus> lt h"
[PROOF STATE]
proof (prove)
using this:
b \<oplus> lt h \<prec>\<^sub>t a \<oplus> lt g1

goal (1 subgoal):
 1. a \<oplus> lt g1 \<noteq> b \<oplus> lt h
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
a \<oplus> lt g1 \<noteq> b \<oplus> lt h

goal (2 subgoals):
 1. is_regular_spair g1 h
 2. lt (spair g1 h) = u
[PROOF STEP]
with \<open>rep_list g1 \<noteq> 0\<close> \<open>rep_list h \<noteq> 0\<close> eq1
[PROOF STATE]
proof (chain)
picking this:
rep_list g1 \<noteq> 0
rep_list h \<noteq> 0
a + punit.lt (rep_list g1) = b + punit.lt (rep_list h)
a \<oplus> lt g1 \<noteq> b \<oplus> lt h
[PROOF STEP]
show ?thesis3
[PROOF STATE]
proof (prove)
using this:
rep_list g1 \<noteq> 0
rep_list h \<noteq> 0
a + punit.lt (rep_list g1) = b + punit.lt (rep_list h)
a \<oplus> lt g1 \<noteq> b \<oplus> lt h

goal (1 subgoal):
 1. is_regular_spair g1 h
[PROOF STEP]
by (rule is_regular_spairI')
[PROOF STATE]
proof (state)
this:
is_regular_spair g1 h

goal (1 subgoal):
 1. lt (spair g1 h) = u
[PROOF STEP]
have "lt (monom_mult (1 / punit.lc (rep_list h)) b h) = b \<oplus> lt h"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lt (monom_mult ((1::'b) / punit.lc (rep_list h)) b h) = b \<oplus> lt h
[PROOF STEP]
proof (rule lt_monom_mult)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (1::'b) / punit.lc (rep_list h) \<noteq> (0::'b)
 2. h \<noteq> 0
[PROOF STEP]
from \<open>rep_list h \<noteq> 0\<close>
[PROOF STATE]
proof (chain)
picking this:
rep_list h \<noteq> 0
[PROOF STEP]
show "1 / punit.lc (rep_list h) \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
rep_list h \<noteq> 0

goal (1 subgoal):
 1. (1::'b) / punit.lc (rep_list h) \<noteq> (0::'b)
[PROOF STEP]
by (simp add: punit.lc_eq_zero_iff)
[PROOF STATE]
proof (state)
this:
(1::'b) / punit.lc (rep_list h) \<noteq> (0::'b)

goal (1 subgoal):
 1. h \<noteq> 0
[PROOF STEP]
qed fact
[PROOF STATE]
proof (state)
this:
lt (monom_mult ((1::'b) / punit.lc (rep_list h)) b h) = b \<oplus> lt h

goal (1 subgoal):
 1. lt (spair g1 h) = u
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
lt (monom_mult ((1::'b) / punit.lc (rep_list h)) b h) = b \<oplus> lt h

goal (1 subgoal):
 1. lt (spair g1 h) = u
[PROOF STEP]
have "... \<prec>\<^sub>t a \<oplus> lt g1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. b \<oplus> lt h \<prec>\<^sub>t a \<oplus> lt g1
[PROOF STEP]
by fact
[PROOF STATE]
proof (state)
this:
b \<oplus> lt h \<prec>\<^sub>t a \<oplus> lt g1

goal (1 subgoal):
 1. lt (spair g1 h) = u
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
b \<oplus> lt h \<prec>\<^sub>t a \<oplus> lt g1

goal (1 subgoal):
 1. lt (spair g1 h) = u
[PROOF STEP]
have "... = lt (monom_mult (1 / punit.lc (rep_list g1)) a g1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<oplus> lt g1 = lt (monom_mult ((1::'b) / punit.lc (rep_list g1)) a g1)
[PROOF STEP]
proof (rule HOL.sym, rule lt_monom_mult)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (1::'b) / punit.lc (rep_list g1) \<noteq> (0::'b)
 2. g1 \<noteq> 0
[PROOF STEP]
from \<open>rep_list g1 \<noteq> 0\<close>
[PROOF STATE]
proof (chain)
picking this:
rep_list g1 \<noteq> 0
[PROOF STEP]
show "1 / punit.lc (rep_list g1) \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
rep_list g1 \<noteq> 0

goal (1 subgoal):
 1. (1::'b) / punit.lc (rep_list g1) \<noteq> (0::'b)
[PROOF STEP]
by (simp add: punit.lc_eq_zero_iff)
[PROOF STATE]
proof (state)
this:
(1::'b) / punit.lc (rep_list g1) \<noteq> (0::'b)

goal (1 subgoal):
 1. g1 \<noteq> 0
[PROOF STEP]
qed fact
[PROOF STATE]
proof (state)
this:
a \<oplus> lt g1 = lt (monom_mult ((1::'b) / punit.lc (rep_list g1)) a g1)

goal (1 subgoal):
 1. lt (spair g1 h) = u
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
lt (monom_mult ((1::'b) / punit.lc (rep_list h)) b h) \<prec>\<^sub>t lt (monom_mult ((1::'b) / punit.lc (rep_list g1)) a g1)
[PROOF STEP]
have "lt (spair g1 h) = lt (monom_mult (1 / punit.lc (rep_list g1)) a g1)"
[PROOF STATE]
proof (prove)
using this:
lt (monom_mult ((1::'b) / punit.lc (rep_list h)) b h) \<prec>\<^sub>t lt (monom_mult ((1::'b) / punit.lc (rep_list g1)) a g1)

goal (1 subgoal):
 1. lt (spair g1 h) = lt (monom_mult ((1::'b) / punit.lc (rep_list g1)) a g1)
[PROOF STEP]
unfolding eq3
[PROOF STATE]
proof (prove)
using this:
lt (monom_mult ((1::'b) / punit.lc (rep_list h)) b h) \<prec>\<^sub>t lt (monom_mult ((1::'b) / punit.lc (rep_list g1)) a g1)

goal (1 subgoal):
 1. lt (monom_mult ((1::'b) / punit.lc (rep_list g1)) a g1 - monom_mult ((1::'b) / punit.lc (rep_list h)) b h) = lt (monom_mult ((1::'b) / punit.lc (rep_list g1)) a g1)
[PROOF STEP]
by (rule lt_minus_eqI_2)
[PROOF STATE]
proof (state)
this:
lt (spair g1 h) = lt (monom_mult ((1::'b) / punit.lc (rep_list g1)) a g1)

goal (1 subgoal):
 1. lt (spair g1 h) = u
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
lt (spair g1 h) = lt (monom_mult ((1::'b) / punit.lc (rep_list g1)) a g1)

goal (1 subgoal):
 1. lt (spair g1 h) = u
[PROOF STEP]
have "... = a \<oplus> lt g1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lt (monom_mult ((1::'b) / punit.lc (rep_list g1)) a g1) = a \<oplus> lt g1
[PROOF STEP]
by (rule HOL.sym, fact)
[PROOF STATE]
proof (state)
this:
lt (monom_mult ((1::'b) / punit.lc (rep_list g1)) a g1) = a \<oplus> lt g1

goal (1 subgoal):
 1. lt (spair g1 h) = u
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
lt (spair g1 h) = a \<oplus> lt g1
[PROOF STEP]
show ?thesis4
[PROOF STATE]
proof (prove)
using this:
lt (spair g1 h) = a \<oplus> lt g1

goal (1 subgoal):
 1. lt (spair g1 h) = u
[PROOF STEP]
by (simp only: u)
[PROOF STATE]
proof (state)
this:
lt (spair g1 h) = u

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma "True" and "True"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. True &&& True
[PROOF STEP]
find_proof Auto2
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. True &&& True
[PROOF STEP]
oops


[STATEMENT]
lemma "DM4 \<eta> \<Longrightarrow> iDM4 \<eta>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. DM4 \<eta> \<Longrightarrow> iDM4 \<eta>
[PROOF STEP]
nitpick
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. DM4 \<eta> \<Longrightarrow> iDM4 \<eta>
[PROOF STEP]
oops


[STATEMENT]
lemma exec_gpv_oracle_bisim_bad:
  assumes *: "if bad2 s2 then X_bad s1 s2 else X s1 s2"
  and bad: "bad1 s1 = bad2 s2"
  and bisim: "\<And>s1 s2 x. X s1 s2 \<Longrightarrow> rel_spmf (\<lambda>(a, s1') (b, s2'). bad1 s1' = bad2 s2' \<and> (if bad2 s2' then X_bad s1' s2' else a = b \<and> X s1' s2')) (oracle1 s1 x) (oracle2 s2 x)"
  and bad_sticky1: "\<And>s2. bad2 s2 \<Longrightarrow> callee_invariant_on oracle1 (\<lambda>s1. bad1 s1 \<and> X_bad s1 s2) \<I>"
  and bad_sticky2: "\<And>s1. bad1 s1 \<Longrightarrow> callee_invariant_on oracle2 (\<lambda>s2. bad2 s2 \<and> X_bad s1 s2) \<I>"
  and lossless1: "\<And>s1 x. bad1 s1 \<Longrightarrow> lossless_spmf (oracle1 s1 x)"
  and lossless2: "\<And>s2 x. bad2 s2 \<Longrightarrow> lossless_spmf (oracle2 s2 x)"
  and lossless: "lossless_gpv \<I> gpv"
  and WT_oracle1: "\<And>s1. \<I> \<turnstile>c oracle1 s1 \<surd>"
  and WT_oracle2: "\<And>s2. \<I> \<turnstile>c oracle2 s2 \<surd>"
  and WT_gpv: "\<I> \<turnstile>g gpv \<surd>"
  and R: "\<And>a s1 b s2. \<lbrakk> bad1 s1 = bad2 s2; \<not> bad2 s2 \<Longrightarrow> a = b \<and> X s1 s2; bad2 s2 \<Longrightarrow> X_bad s1 s2 \<rbrakk> \<Longrightarrow> R (a, s1) (b, s2)"
  shows "rel_spmf R (exec_gpv oracle1 gpv s1) (exec_gpv oracle2 gpv s2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rel_spmf R (exec_gpv oracle1 gpv s1) (exec_gpv oracle2 gpv s2)
[PROOF STEP]
using exec_gpv_oracle_bisim_bad'[OF * bad bisim bad_sticky1 bad_sticky2 lossless1 lossless2 lossless WT_oracle1 WT_oracle2 WT_gpv]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<And>s1 s2 x. \<lbrakk>X s1 s2; x \<in> outs_\<I> \<I>\<rbrakk> \<Longrightarrow> X s1 s2; \<And>s2. bad2 s2 \<Longrightarrow> bad2 s2; \<And>s1. bad1 s1 \<Longrightarrow> bad1 s1; \<And>s1 x. \<lbrakk>bad1 s1; x \<in> outs_\<I> \<I>\<rbrakk> \<Longrightarrow> bad1 s1; \<And>s2 x. \<lbrakk>bad2 s2; x \<in> outs_\<I> \<I>\<rbrakk> \<Longrightarrow> bad2 s2\<rbrakk> \<Longrightarrow> rel_spmf (\<lambda>(a, s1') (b, s2'). bad1 s1' = bad2 s2' \<and> (if bad2 s2' then X_bad s1' s2' else a = b \<and> X s1' s2')) (exec_gpv oracle1 gpv s1) (exec_gpv oracle2 gpv s2)

goal (1 subgoal):
 1. rel_spmf R (exec_gpv oracle1 gpv s1) (exec_gpv oracle2 gpv s2)
[PROOF STEP]
by(rule rel_spmf_mono)(auto intro: R)