[STATEMENT]
lemma reduction_exists:
  assumes "polarity = neg \<or> \<not> equivalent_eq_exists t s (cl_ecl C) (int_clset S) \<sigma> L1
    \<or> proper_subterm_red t S \<sigma>"
  assumes "\<forall>x y. (( x \<in> vars_of_cl (cl_ecl C)) \<longrightarrow> (occurs_in y (subst (Var x) \<sigma>))
            \<longrightarrow> trm_rep y S = y)"
  assumes "eligible_literal L1 C \<sigma>"
  assumes "(trm_rep (subst t \<sigma>) S) \<noteq>  (subst t \<sigma>)"
  assumes "L1 \<in> (cl_ecl C)"
  assumes "(orient_lit_inst L1 t s polarity \<sigma>)"
  assumes "\<forall>x \<in> S. finite (cl_ecl x)"
  assumes "ground_clause (subst_cl (cl_ecl C) \<sigma>)"
  assumes "(fo_interpretation (same_values (\<lambda>t. (trm_rep t S))))"
  assumes "C \<in> S"
  assumes "Ball S well_constrained"
  assumes "all_trms_irreducible (subst_set (trms_ecl C) \<sigma>) (\<lambda>t. trm_rep t S)"
  assumes "\<not> validate_ground_clause (int_clset S) (subst_cl (cl_ecl C) \<sigma>)"
  assumes "closed_under_renaming S"

  shows "\<exists>\<sigma>' u u' p v D L2.
    ((reduction L1 C \<sigma>' t s polarity L2 u u' p v D (same_values (\<lambda>t. (trm_rep t S))) S \<sigma>)
    \<and> (variable_disjoint C D))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>\<sigma>' u u' p v D L2. reduction L1 C \<sigma>' t s polarity L2 u u' p v D (same_values (\<lambda>t. trm_rep t S)) S \<sigma> \<and> variable_disjoint C D
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>\<sigma>' u u' p v D L2. reduction L1 C \<sigma>' t s polarity L2 u u' p v D (same_values (\<lambda>t. trm_rep t S)) S \<sigma> \<and> variable_disjoint C D
[PROOF STEP]
text \<open>The first step is to get the minimal reducible position in @{term "(subst t \<sigma>)"} and
the corresponding subterm @{term "v"}.\<close>
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>\<sigma>' u u' p v D L2. reduction L1 C \<sigma>' t s polarity L2 u u' p v D (same_values (\<lambda>t. trm_rep t S)) S \<sigma> \<and> variable_disjoint C D
[PROOF STEP]
let ?Redexes = "{ p. \<exists>v. subterm (subst t \<sigma>) p v \<and> root_term S v \<and> trm_rep v S \<noteq> v }"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>\<sigma>' u u' p v D L2. reduction L1 C \<sigma>' t s polarity L2 u u' p v D (same_values (\<lambda>t. trm_rep t S)) S \<sigma> \<and> variable_disjoint C D
[PROOF STEP]
have "?Redexes \<subseteq> pos_of (subst t \<sigma>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {p. \<exists>v. subterm (t \<lhd> \<sigma>) p v \<and> root_term S v \<and> trm_rep v S \<noteq> v} \<subseteq> pos_of (t \<lhd> \<sigma>)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> {p. \<exists>v. subterm (t \<lhd> \<sigma>) p v \<and> root_term S v \<and> trm_rep v S \<noteq> v} \<Longrightarrow> x \<in> pos_of (t \<lhd> \<sigma>)
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> {p. \<exists>v. subterm (t \<lhd> \<sigma>) p v \<and> root_term S v \<and> trm_rep v S \<noteq> v} \<Longrightarrow> x \<in> pos_of (t \<lhd> \<sigma>)
[PROOF STEP]
assume "x \<in> ?Redexes"
[PROOF STATE]
proof (state)
this:
x \<in> {p. \<exists>v. subterm (t \<lhd> \<sigma>) p v \<and> root_term S v \<and> trm_rep v S \<noteq> v}

goal (1 subgoal):
 1. \<And>x. x \<in> {p. \<exists>v. subterm (t \<lhd> \<sigma>) p v \<and> root_term S v \<and> trm_rep v S \<noteq> v} \<Longrightarrow> x \<in> pos_of (t \<lhd> \<sigma>)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<in> {p. \<exists>v. subterm (t \<lhd> \<sigma>) p v \<and> root_term S v \<and> trm_rep v S \<noteq> v}
[PROOF STEP]
have "\<exists>v. subterm (subst t \<sigma>) x v"
[PROOF STATE]
proof (prove)
using this:
x \<in> {p. \<exists>v. subterm (t \<lhd> \<sigma>) p v \<and> root_term S v \<and> trm_rep v S \<noteq> v}

goal (1 subgoal):
 1. \<exists>v. subterm (t \<lhd> \<sigma>) x v
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>v. subterm (t \<lhd> \<sigma>) x v

goal (1 subgoal):
 1. \<And>x. x \<in> {p. \<exists>v. subterm (t \<lhd> \<sigma>) p v \<and> root_term S v \<and> trm_rep v S \<noteq> v} \<Longrightarrow> x \<in> pos_of (t \<lhd> \<sigma>)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>v. subterm (t \<lhd> \<sigma>) x v
[PROOF STEP]
have "position_in x (subst t \<sigma>)"
[PROOF STATE]
proof (prove)
using this:
\<exists>v. subterm (t \<lhd> \<sigma>) x v

goal (1 subgoal):
 1. position_in x (t \<lhd> \<sigma>)
[PROOF STEP]
unfolding position_in_def
[PROOF STATE]
proof (prove)
using this:
\<exists>v. subterm (t \<lhd> \<sigma>) x v

goal (1 subgoal):
 1. Ex (subterm (t \<lhd> \<sigma>) x)
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
position_in x (t \<lhd> \<sigma>)

goal (1 subgoal):
 1. \<And>x. x \<in> {p. \<exists>v. subterm (t \<lhd> \<sigma>) p v \<and> root_term S v \<and> trm_rep v S \<noteq> v} \<Longrightarrow> x \<in> pos_of (t \<lhd> \<sigma>)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
position_in x (t \<lhd> \<sigma>)
[PROOF STEP]
show "x \<in> pos_of (subst t \<sigma>)"
[PROOF STATE]
proof (prove)
using this:
position_in x (t \<lhd> \<sigma>)

goal (1 subgoal):
 1. x \<in> pos_of (t \<lhd> \<sigma>)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x \<in> pos_of (t \<lhd> \<sigma>)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
{p. \<exists>v. subterm (t \<lhd> \<sigma>) p v \<and> root_term S v \<and> trm_rep v S \<noteq> v} \<subseteq> pos_of (t \<lhd> \<sigma>)

goal (1 subgoal):
 1. \<exists>\<sigma>' u u' p v D L2. reduction L1 C \<sigma>' t s polarity L2 u u' p v D (same_values (\<lambda>t. trm_rep t S)) S \<sigma> \<and> variable_disjoint C D
[PROOF STEP]
from this
[PROOF STATE]
proof (chain)
picking this:
{p. \<exists>v. subterm (t \<lhd> \<sigma>) p v \<and> root_term S v \<and> trm_rep v S \<noteq> v} \<subseteq> pos_of (t \<lhd> \<sigma>)
[PROOF STEP]
have "finite ?Redexes"
[PROOF STATE]
proof (prove)
using this:
{p. \<exists>v. subterm (t \<lhd> \<sigma>) p v \<and> root_term S v \<and> trm_rep v S \<noteq> v} \<subseteq> pos_of (t \<lhd> \<sigma>)

goal (1 subgoal):
 1. finite {p. \<exists>v. subterm (t \<lhd> \<sigma>) p v \<and> root_term S v \<and> trm_rep v S \<noteq> v}
[PROOF STEP]
using set_of_positions_is_finite [of "(subst t \<sigma>)" ]
[PROOF STATE]
proof (prove)
using this:
{p. \<exists>v. subterm (t \<lhd> \<sigma>) p v \<and> root_term S v \<and> trm_rep v S \<noteq> v} \<subseteq> pos_of (t \<lhd> \<sigma>)
finite (pos_of (t \<lhd> \<sigma>))

goal (1 subgoal):
 1. finite {p. \<exists>v. subterm (t \<lhd> \<sigma>) p v \<and> root_term S v \<and> trm_rep v S \<noteq> v}
[PROOF STEP]
using finite_subset
[PROOF STATE]
proof (prove)
using this:
{p. \<exists>v. subterm (t \<lhd> \<sigma>) p v \<and> root_term S v \<and> trm_rep v S \<noteq> v} \<subseteq> pos_of (t \<lhd> \<sigma>)
finite (pos_of (t \<lhd> \<sigma>))
\<lbrakk>?A \<subseteq> ?B; finite ?B\<rbrakk> \<Longrightarrow> finite ?A

goal (1 subgoal):
 1. finite {p. \<exists>v. subterm (t \<lhd> \<sigma>) p v \<and> root_term S v \<and> trm_rep v S \<noteq> v}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
finite {p. \<exists>v. subterm (t \<lhd> \<sigma>) p v \<and> root_term S v \<and> trm_rep v S \<noteq> v}

goal (1 subgoal):
 1. \<exists>\<sigma>' u u' p v D L2. reduction L1 C \<sigma>' t s polarity L2 u u' p v D (same_values (\<lambda>t. trm_rep t S)) S \<sigma> \<and> variable_disjoint C D
[PROOF STEP]
from assms(4)
[PROOF STATE]
proof (chain)
picking this:
trm_rep (t \<lhd> \<sigma>) S \<noteq> t \<lhd> \<sigma>
[PROOF STEP]
have "st_red S (subst t \<sigma>)"
[PROOF STATE]
proof (prove)
using this:
trm_rep (t \<lhd> \<sigma>) S \<noteq> t \<lhd> \<sigma>

goal (1 subgoal):
 1. st_red S (t \<lhd> \<sigma>)
[PROOF STEP]
using subterms_of_irred_trms_are_irred
[PROOF STATE]
proof (prove)
using this:
trm_rep (t \<lhd> \<sigma>) S \<noteq> t \<lhd> \<sigma>
trm_rep ?t ?S \<noteq> ?t \<longrightarrow> st_red ?S ?t

goal (1 subgoal):
 1. st_red S (t \<lhd> \<sigma>)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
st_red S (t \<lhd> \<sigma>)

goal (1 subgoal):
 1. \<exists>\<sigma>' u u' p v D L2. reduction L1 C \<sigma>' t s polarity L2 u u' p v D (same_values (\<lambda>t. trm_rep t S)) S \<sigma> \<and> variable_disjoint C D
[PROOF STEP]
from this
[PROOF STATE]
proof (chain)
picking this:
st_red S (t \<lhd> \<sigma>)
[PROOF STEP]
obtain p' where "p' \<in> ?Redexes"
[PROOF STATE]
proof (prove)
using this:
st_red S (t \<lhd> \<sigma>)

goal (1 subgoal):
 1. (\<And>p'. p' \<in> {p. \<exists>v. subterm (t \<lhd> \<sigma>) p v \<and> root_term S v \<and> trm_rep v S \<noteq> v} \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding st_red_def
[PROOF STATE]
proof (prove)
using this:
\<exists>t' p. subterm (t \<lhd> \<sigma>) p t' \<and> root_term S t' \<and> trm_rep t' S \<noteq> t'

goal (1 subgoal):
 1. (\<And>p'. p' \<in> {p. \<exists>v. subterm (t \<lhd> \<sigma>) p v \<and> root_term S v \<and> trm_rep v S \<noteq> v} \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
p' \<in> {p. \<exists>v. subterm (t \<lhd> \<sigma>) p v \<and> root_term S v \<and> trm_rep v S \<noteq> v}

goal (1 subgoal):
 1. \<exists>\<sigma>' u u' p v D L2. reduction L1 C \<sigma>' t s polarity L2 u u' p v D (same_values (\<lambda>t. trm_rep t S)) S \<sigma> \<and> variable_disjoint C D
[PROOF STEP]
from \<open>finite ?Redexes\<close> this
[PROOF STATE]
proof (chain)
picking this:
finite {p. \<exists>v. subterm (t \<lhd> \<sigma>) p v \<and> root_term S v \<and> trm_rep v S \<noteq> v}
p' \<in> {p. \<exists>v. subterm (t \<lhd> \<sigma>) p v \<and> root_term S v \<and> trm_rep v S \<noteq> v}
[PROOF STEP]
obtain mp where "mp \<in> ?Redexes"
    and "\<And>p'. (p', mp) \<in> (pos_ord C t) \<Longrightarrow> p' \<notin> ?Redexes"
[PROOF STATE]
proof (prove)
using this:
finite {p. \<exists>v. subterm (t \<lhd> \<sigma>) p v \<and> root_term S v \<and> trm_rep v S \<noteq> v}
p' \<in> {p. \<exists>v. subterm (t \<lhd> \<sigma>) p v \<and> root_term S v \<and> trm_rep v S \<noteq> v}

goal (1 subgoal):
 1. (\<And>mp. \<lbrakk>mp \<in> {p. \<exists>v. subterm (t \<lhd> \<sigma>) p v \<and> root_term S v \<and> trm_rep v S \<noteq> v}; \<And>p'. (p', mp) \<in> pos_ord C t \<Longrightarrow> p' \<notin> {p. \<exists>v. subterm (t \<lhd> \<sigma>) p v \<and> root_term S v \<and> trm_rep v S \<noteq> v}\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using pos_ord_acyclic [of C t] finite_proj_wf [of ?Redexes p' "pos_ord C t"]
[PROOF STATE]
proof (prove)
using this:
finite {p. \<exists>v. subterm (t \<lhd> \<sigma>) p v \<and> root_term S v \<and> trm_rep v S \<noteq> v}
p' \<in> {p. \<exists>v. subterm (t \<lhd> \<sigma>) p v \<and> root_term S v \<and> trm_rep v S \<noteq> v}
acyclic (pos_ord C t)
\<lbrakk>finite {p. \<exists>v. subterm (t \<lhd> \<sigma>) p v \<and> root_term S v \<and> trm_rep v S \<noteq> v}; p' \<in> {p. \<exists>v. subterm (t \<lhd> \<sigma>) p v \<and> root_term S v \<and> trm_rep v S \<noteq> v}; acyclic (pos_ord C t)\<rbrakk> \<Longrightarrow> \<exists>y. y \<in> {p. \<exists>v. subterm (t \<lhd> \<sigma>) p v \<and> root_term S v \<and> trm_rep v S \<noteq> v} \<and> (\<forall>z. (z, y) \<in> pos_ord C t \<longrightarrow> z \<notin> {p. \<exists>v. subterm (t \<lhd> \<sigma>) p v \<and> root_term S v \<and> trm_rep v S \<noteq> v})

goal (1 subgoal):
 1. (\<And>mp. \<lbrakk>mp \<in> {p. \<exists>v. subterm (t \<lhd> \<sigma>) p v \<and> root_term S v \<and> trm_rep v S \<noteq> v}; \<And>p'. (p', mp) \<in> pos_ord C t \<Longrightarrow> p' \<notin> {p. \<exists>v. subterm (t \<lhd> \<sigma>) p v \<and> root_term S v \<and> trm_rep v S \<noteq> v}\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
mp \<in> {p. \<exists>v. subterm (t \<lhd> \<sigma>) p v \<and> root_term S v \<and> trm_rep v S \<noteq> v}
(?p', mp) \<in> pos_ord C t \<Longrightarrow> ?p' \<notin> {p. \<exists>v. subterm (t \<lhd> \<sigma>) p v \<and> root_term S v \<and> trm_rep v S \<noteq> v}

goal (1 subgoal):
 1. \<exists>\<sigma>' u u' p v D L2. reduction L1 C \<sigma>' t s polarity L2 u u' p v D (same_values (\<lambda>t. trm_rep t S)) S \<sigma> \<and> variable_disjoint C D
[PROOF STEP]
have mr: "minimal_redex mp (subst t \<sigma>) C S t"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. minimal_redex mp (t \<lhd> \<sigma>) C S t
[PROOF STEP]
proof (rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> minimal_redex mp (t \<lhd> \<sigma>) C S t \<Longrightarrow> False
[PROOF STEP]
assume "\<not>minimal_redex mp (subst t \<sigma>) C S t"
[PROOF STATE]
proof (state)
this:
\<not> minimal_redex mp (t \<lhd> \<sigma>) C S t

goal (1 subgoal):
 1. \<not> minimal_redex mp (t \<lhd> \<sigma>) C S t \<Longrightarrow> False
[PROOF STEP]
from this
[PROOF STATE]
proof (chain)
picking this:
\<not> minimal_redex mp (t \<lhd> \<sigma>) C S t
[PROOF STEP]
obtain p'' v' where "(p'',mp) \<in> (pos_ord C t)" "subterm (subst t \<sigma>) p'' v'"
      and "trm_rep v' S \<noteq> v'"
[PROOF STATE]
proof (prove)
using this:
\<not> minimal_redex mp (t \<lhd> \<sigma>) C S t

goal (1 subgoal):
 1. (\<And>p'' v'. \<lbrakk>(p'', mp) \<in> pos_ord C t; subterm (t \<lhd> \<sigma>) p'' v'; trm_rep v' S \<noteq> v'\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding minimal_redex_def
[PROOF STATE]
proof (prove)
using this:
\<not> (\<forall>q s. (q, mp) \<in> pos_ord C t \<longrightarrow> subterm (t \<lhd> \<sigma>) q s \<longrightarrow> trm_rep s S = s)

goal (1 subgoal):
 1. (\<And>p'' v'. \<lbrakk>(p'', mp) \<in> pos_ord C t; subterm (t \<lhd> \<sigma>) p'' v'; trm_rep v' S \<noteq> v'\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(p'', mp) \<in> pos_ord C t
subterm (t \<lhd> \<sigma>) p'' v'
trm_rep v' S \<noteq> v'

goal (1 subgoal):
 1. \<not> minimal_redex mp (t \<lhd> \<sigma>) C S t \<Longrightarrow> False
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. False
[PROOF STEP]
proof (cases)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. ?P \<Longrightarrow> False
 2. \<not> ?P \<Longrightarrow> False
[PROOF STEP]
assume "(root_term S v')"
[PROOF STATE]
proof (state)
this:
root_term S v'

goal (2 subgoals):
 1. ?P \<Longrightarrow> False
 2. \<not> ?P \<Longrightarrow> False
[PROOF STEP]
from this and \<open>subterm (subst t \<sigma>) p'' v'\<close> \<open>trm_rep v' S \<noteq> v'\<close>
[PROOF STATE]
proof (chain)
picking this:
root_term S v'
subterm (t \<lhd> \<sigma>) p'' v'
trm_rep v' S \<noteq> v'
[PROOF STEP]
have "p'' \<in>?Redexes"
[PROOF STATE]
proof (prove)
using this:
root_term S v'
subterm (t \<lhd> \<sigma>) p'' v'
trm_rep v' S \<noteq> v'

goal (1 subgoal):
 1. p'' \<in> {p. \<exists>v. subterm (t \<lhd> \<sigma>) p v \<and> root_term S v \<and> trm_rep v S \<noteq> v}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
p'' \<in> {p. \<exists>v. subterm (t \<lhd> \<sigma>) p v \<and> root_term S v \<and> trm_rep v S \<noteq> v}

goal (2 subgoals):
 1. ?P \<Longrightarrow> False
 2. \<not> ?P \<Longrightarrow> False
[PROOF STEP]
from this and \<open>\<And>p'. (p', mp) \<in> (pos_ord C t) \<Longrightarrow> p' \<notin> ?Redexes\<close> and \<open>(p'',mp) \<in> (pos_ord C t)\<close>
[PROOF STATE]
proof (chain)
picking this:
p'' \<in> {p. \<exists>v. subterm (t \<lhd> \<sigma>) p v \<and> root_term S v \<and> trm_rep v S \<noteq> v}
(?p', mp) \<in> pos_ord C t \<Longrightarrow> ?p' \<notin> {p. \<exists>v. subterm (t \<lhd> \<sigma>) p v \<and> root_term S v \<and> trm_rep v S \<noteq> v}
(p'', mp) \<in> pos_ord C t
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
p'' \<in> {p. \<exists>v. subterm (t \<lhd> \<sigma>) p v \<and> root_term S v \<and> trm_rep v S \<noteq> v}
(?p', mp) \<in> pos_ord C t \<Longrightarrow> ?p' \<notin> {p. \<exists>v. subterm (t \<lhd> \<sigma>) p v \<and> root_term S v \<and> trm_rep v S \<noteq> v}
(p'', mp) \<in> pos_ord C t

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

goal (1 subgoal):
 1. \<not> root_term S v' \<Longrightarrow> False
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> root_term S v' \<Longrightarrow> False
[PROOF STEP]
assume "\<not>(root_term S v')"
[PROOF STATE]
proof (state)
this:
\<not> root_term S v'

goal (1 subgoal):
 1. \<not> root_term S v' \<Longrightarrow> False
[PROOF STEP]
from \<open>trm_rep v' S \<noteq> v'\<close>
[PROOF STATE]
proof (chain)
picking this:
trm_rep v' S \<noteq> v'
[PROOF STEP]
have "st_red S v'"
[PROOF STATE]
proof (prove)
using this:
trm_rep v' S \<noteq> v'

goal (1 subgoal):
 1. st_red S v'
[PROOF STEP]
using subterms_of_irred_trms_are_irred
[PROOF STATE]
proof (prove)
using this:
trm_rep v' S \<noteq> v'
trm_rep ?t ?S \<noteq> ?t \<longrightarrow> st_red ?S ?t

goal (1 subgoal):
 1. st_red S v'
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
st_red S v'

goal (1 subgoal):
 1. \<not> root_term S v' \<Longrightarrow> False
[PROOF STEP]
from this
[PROOF STATE]
proof (chain)
picking this:
st_red S v'
[PROOF STEP]
obtain p''' v'' where "subterm v' p''' v''" "root_term S v''" "trm_rep v'' S \<noteq> v''"
[PROOF STATE]
proof (prove)
using this:
st_red S v'

goal (1 subgoal):
 1. (\<And>p''' v''. \<lbrakk>subterm v' p''' v''; root_term S v''; trm_rep v'' S \<noteq> v''\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding st_red_def
[PROOF STATE]
proof (prove)
using this:
\<exists>t' p. subterm v' p t' \<and> root_term S t' \<and> trm_rep t' S \<noteq> t'

goal (1 subgoal):
 1. (\<And>p''' v''. \<lbrakk>subterm v' p''' v''; root_term S v''; trm_rep v'' S \<noteq> v''\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
subterm v' p''' v''
root_term S v''
trm_rep v'' S \<noteq> v''

goal (1 subgoal):
 1. \<not> root_term S v' \<Longrightarrow> False
[PROOF STEP]
from \<open>subterm v' p''' v''\<close> and \<open>subterm (subst t \<sigma>) p'' v'\<close>
[PROOF STATE]
proof (chain)
picking this:
subterm v' p''' v''
subterm (t \<lhd> \<sigma>) p'' v'
[PROOF STEP]
have "subterm (subst t \<sigma>) (append p'' p''') v''"
[PROOF STATE]
proof (prove)
using this:
subterm v' p''' v''
subterm (t \<lhd> \<sigma>) p'' v'

goal (1 subgoal):
 1. subterm (t \<lhd> \<sigma>) (p'' @ p''') v''
[PROOF STEP]
using subterm_of_a_subterm_is_a_subterm
[PROOF STATE]
proof (prove)
using this:
subterm v' p''' v''
subterm (t \<lhd> \<sigma>) p'' v'
\<lbrakk>subterm ?u ?q ?v; subterm ?t ?p ?u\<rbrakk> \<Longrightarrow> subterm ?t (?p @ ?q) ?v

goal (1 subgoal):
 1. subterm (t \<lhd> \<sigma>) (p'' @ p''') v''
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
subterm (t \<lhd> \<sigma>) (p'' @ p''') v''

goal (1 subgoal):
 1. \<not> root_term S v' \<Longrightarrow> False
[PROOF STEP]
from this and \<open>trm_rep v'' S \<noteq> v''\<close> \<open>root_term S v''\<close>
[PROOF STATE]
proof (chain)
picking this:
subterm (t \<lhd> \<sigma>) (p'' @ p''') v''
trm_rep v'' S \<noteq> v''
root_term S v''
[PROOF STEP]
have "(append p'' p''') \<in> ?Redexes"
[PROOF STATE]
proof (prove)
using this:
subterm (t \<lhd> \<sigma>) (p'' @ p''') v''
trm_rep v'' S \<noteq> v''
root_term S v''

goal (1 subgoal):
 1. p'' @ p''' \<in> {p. \<exists>v. subterm (t \<lhd> \<sigma>) p v \<and> root_term S v \<and> trm_rep v S \<noteq> v}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
p'' @ p''' \<in> {p. \<exists>v. subterm (t \<lhd> \<sigma>) p v \<and> root_term S v \<and> trm_rep v S \<noteq> v}

goal (1 subgoal):
 1. \<not> root_term S v' \<Longrightarrow> False
[PROOF STEP]
from this and \<open>\<And>p'. (p', mp) \<in> (pos_ord C t) \<Longrightarrow> p' \<notin> ?Redexes\<close>
[PROOF STATE]
proof (chain)
picking this:
p'' @ p''' \<in> {p. \<exists>v. subterm (t \<lhd> \<sigma>) p v \<and> root_term S v \<and> trm_rep v S \<noteq> v}
(?p', mp) \<in> pos_ord C t \<Longrightarrow> ?p' \<notin> {p. \<exists>v. subterm (t \<lhd> \<sigma>) p v \<and> root_term S v \<and> trm_rep v S \<noteq> v}
[PROOF STEP]
have "(append p'' p''',mp) \<notin> (pos_ord C t)"
[PROOF STATE]
proof (prove)
using this:
p'' @ p''' \<in> {p. \<exists>v. subterm (t \<lhd> \<sigma>) p v \<and> root_term S v \<and> trm_rep v S \<noteq> v}
(?p', mp) \<in> pos_ord C t \<Longrightarrow> ?p' \<notin> {p. \<exists>v. subterm (t \<lhd> \<sigma>) p v \<and> root_term S v \<and> trm_rep v S \<noteq> v}

goal (1 subgoal):
 1. (p'' @ p''', mp) \<notin> pos_ord C t
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(p'' @ p''', mp) \<notin> pos_ord C t

goal (1 subgoal):
 1. \<not> root_term S v' \<Longrightarrow> False
[PROOF STEP]
from this and \<open>(p'',mp) \<in> (pos_ord C t)\<close>
[PROOF STATE]
proof (chain)
picking this:
(p'' @ p''', mp) \<notin> pos_ord C t
(p'', mp) \<in> pos_ord C t
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
(p'' @ p''', mp) \<notin> pos_ord C t
(p'', mp) \<in> pos_ord C t

goal (1 subgoal):
 1. False
[PROOF STEP]
using pos_ord_prefix
[PROOF STATE]
proof (prove)
using this:
(p'' @ p''', mp) \<notin> pos_ord C t
(p'', mp) \<in> pos_ord C t
\<forall>x y p q r. (q, p) \<in> pos_ord x y \<longrightarrow> (q @ r, p) \<in> pos_ord x y

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

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
minimal_redex mp (t \<lhd> \<sigma>) C S t

goal (1 subgoal):
 1. \<exists>\<sigma>' u u' p v D L2. reduction L1 C \<sigma>' t s polarity L2 u u' p v D (same_values (\<lambda>t. trm_rep t S)) S \<sigma> \<and> variable_disjoint C D
[PROOF STEP]
from \<open>mp \<in> ?Redexes\<close>
[PROOF STATE]
proof (chain)
picking this:
mp \<in> {p. \<exists>v. subterm (t \<lhd> \<sigma>) p v \<and> root_term S v \<and> trm_rep v S \<noteq> v}
[PROOF STEP]
obtain p v where "mp=p" "subterm (subst t \<sigma>) p v" and "root_term S v"
    and "trm_rep v S \<noteq> v"
[PROOF STATE]
proof (prove)
using this:
mp \<in> {p. \<exists>v. subterm (t \<lhd> \<sigma>) p v \<and> root_term S v \<and> trm_rep v S \<noteq> v}

goal (1 subgoal):
 1. (\<And>p v. \<lbrakk>mp = p; subterm (t \<lhd> \<sigma>) p v; root_term S v; trm_rep v S \<noteq> v\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding st_red_def
[PROOF STATE]
proof (prove)
using this:
mp \<in> {p. \<exists>v. subterm (t \<lhd> \<sigma>) p v \<and> root_term S v \<and> trm_rep v S \<noteq> v}

goal (1 subgoal):
 1. (\<And>p v. \<lbrakk>mp = p; subterm (t \<lhd> \<sigma>) p v; root_term S v; trm_rep v S \<noteq> v\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
mp = p
subterm (t \<lhd> \<sigma>) p v
root_term S v
trm_rep v S \<noteq> v

goal (1 subgoal):
 1. \<exists>\<sigma>' u u' p v D L2. reduction L1 C \<sigma>' t s polarity L2 u u' p v D (same_values (\<lambda>t. trm_rep t S)) S \<sigma> \<and> variable_disjoint C D
[PROOF STEP]
text \<open>Second, we find the clause @{term "C2"} and substitution @{term "\<eta>"} that are used to
determine the value of @{term "v"} according to the definition of @{term "trm_rep"},
 and we prove that they satisfy all the desired properties.
In particular, clause @{term "C2"}  is renamed to ensure that it shares no variable
with @{term "C"}.\<close>
[PROOF STATE]
proof (state)
this:
mp = p
subterm (t \<lhd> \<sigma>) p v
root_term S v
trm_rep v S \<noteq> v

goal (1 subgoal):
 1. \<exists>\<sigma>' u u' p v D L2. reduction L1 C \<sigma>' t s polarity L2 u u' p v D (same_values (\<lambda>t. trm_rep t S)) S \<sigma> \<and> variable_disjoint C D
[PROOF STEP]
from \<open>subterm (subst t \<sigma>) p v\<close>
[PROOF STATE]
proof (chain)
picking this:
subterm (t \<lhd> \<sigma>) p v
[PROOF STEP]
have
    si: "(\<exists>x q1 q2. (is_a_variable x) \<and> (subterm (subst x \<sigma>) q1 v) \<and>
                      (subterm t q2 x) \<and> (p = (append q2 q1))) \<or>
        ((\<exists> u. (\<not>(is_a_variable u) \<and> (subterm t p u) \<and> (v = (subst u \<sigma>)))))"
[PROOF STATE]
proof (prove)
using this:
subterm (t \<lhd> \<sigma>) p v

goal (1 subgoal):
 1. (\<exists>x q1 q2. is_a_variable x \<and> subterm (x \<lhd> \<sigma>) q1 v \<and> subterm t q2 x \<and> p = q2 @ q1) \<or> (\<exists>u. \<not> is_a_variable u \<and> subterm t p u \<and> v = u \<lhd> \<sigma>)
[PROOF STEP]
using subterms_of_instances
[PROOF STATE]
proof (prove)
using this:
subterm (t \<lhd> \<sigma>) p v
\<forall>u v u' s. u = v \<lhd> s \<longrightarrow> subterm u ?p u' \<longrightarrow> (\<exists>x q1 q2. is_a_variable x \<and> subterm (x \<lhd> s) q1 u' \<and> subterm v q2 x \<and> ?p = q2 @ q1) \<or> (\<exists>v'. \<not> is_a_variable v' \<and> subterm v ?p v' \<and> u' = v' \<lhd> s)

goal (1 subgoal):
 1. (\<exists>x q1 q2. is_a_variable x \<and> subterm (x \<lhd> \<sigma>) q1 v \<and> subterm t q2 x \<and> p = q2 @ q1) \<or> (\<exists>u. \<not> is_a_variable u \<and> subterm t p u \<and> v = u \<lhd> \<sigma>)
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
(\<exists>x q1 q2. is_a_variable x \<and> subterm (x \<lhd> \<sigma>) q1 v \<and> subterm t q2 x \<and> p = q2 @ q1) \<or> (\<exists>u. \<not> is_a_variable u \<and> subterm t p u \<and> v = u \<lhd> \<sigma>)

goal (1 subgoal):
 1. \<exists>\<sigma>' u u' p v D L2. reduction L1 C \<sigma>' t s polarity L2 u u' p v D (same_values (\<lambda>t. trm_rep t S)) S \<sigma> \<and> variable_disjoint C D
[PROOF STEP]
let ?v = "trm_rep v S"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>\<sigma>' u u' p v D L2. reduction L1 C \<sigma>' t s polarity L2 u u' p v D (same_values (\<lambda>t. trm_rep t S)) S \<sigma> \<and> variable_disjoint C D
[PROOF STEP]
from \<open>trm_rep v S \<noteq> v\<close> and \<open>root_term S v\<close>
[PROOF STATE]
proof (chain)
picking this:
trm_rep v S \<noteq> v
root_term S v
[PROOF STEP]
have "?v \<in> min_trms (set_of_candidate_values S v)"
[PROOF STATE]
proof (prove)
using this:
trm_rep v S \<noteq> v
root_term S v

goal (1 subgoal):
 1. trm_rep v S \<in> min_trms (set_of_candidate_values S v)
[PROOF STEP]
unfolding root_term_def get_min_def
[PROOF STATE]
proof (prove)
using this:
trm_rep v S \<noteq> v
trm_rep v S = (if min_trms (set_of_candidate_values S v) = {} then v else SOME x. x \<in> min_trms (set_of_candidate_values S v))

goal (1 subgoal):
 1. trm_rep v S \<in> min_trms (set_of_candidate_values S v)
[PROOF STEP]
by (metis some_in_eq)
[PROOF STATE]
proof (state)
this:
trm_rep v S \<in> min_trms (set_of_candidate_values S v)

goal (1 subgoal):
 1. \<exists>\<sigma>' u u' p v D L2. reduction L1 C \<sigma>' t s polarity L2 u u' p v D (same_values (\<lambda>t. trm_rep t S)) S \<sigma> \<and> variable_disjoint C D
[PROOF STEP]
from \<open>?v \<in> min_trms (set_of_candidate_values S v)\<close>
[PROOF STATE]
proof (chain)
picking this:
trm_rep v S \<in> min_trms (set_of_candidate_values S v)
[PROOF STEP]
obtain pair where "?v = fst pair"
    and "pair \<in> (set_of_candidate_values S v)" and
    min_pair: "(\<forall>pair'\<in>set_of_candidate_values S v. (snd pair', snd pair) \<notin> trm_ord)"
[PROOF STATE]
proof (prove)
using this:
trm_rep v S \<in> min_trms (set_of_candidate_values S v)

goal (1 subgoal):
 1. (\<And>pair. \<lbrakk>trm_rep v S = fst pair; pair \<in> set_of_candidate_values S v; \<forall>pair'\<in>set_of_candidate_values S v. (snd pair', snd pair) \<notin> trm_ord\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding min_trms_def
[PROOF STATE]
proof (prove)
using this:
trm_rep v S \<in> {x. \<exists>pair. (pair \<in> set_of_candidate_values S v \<and> (\<forall>pair'\<in>set_of_candidate_values S v. (snd pair', snd pair) \<notin> trm_ord)) \<and> x = fst pair}

goal (1 subgoal):
 1. (\<And>pair. \<lbrakk>trm_rep v S = fst pair; pair \<in> set_of_candidate_values S v; \<forall>pair'\<in>set_of_candidate_values S v. (snd pair', snd pair) \<notin> trm_ord\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
trm_rep v S = fst pair
pair \<in> set_of_candidate_values S v
\<forall>pair'\<in>set_of_candidate_values S v. (snd pair', snd pair) \<notin> trm_ord

goal (1 subgoal):
 1. \<exists>\<sigma>' u u' p v D L2. reduction L1 C \<sigma>' t s polarity L2 u u' p v D (same_values (\<lambda>t. trm_rep t S)) S \<sigma> \<and> variable_disjoint C D
[PROOF STEP]
from \<open>pair \<in> (set_of_candidate_values S v)\<close>
[PROOF STATE]
proof (chain)
picking this:
pair \<in> set_of_candidate_values S v
[PROOF STEP]
have
  "\<exists>z CC C' C s L L' \<sigma> t' s'. pair = (z, s) \<and> (candidate_values z CC C' C s L L' \<sigma> t' s' v S)"
[PROOF STATE]
proof (prove)
using this:
pair \<in> set_of_candidate_values S v

goal (1 subgoal):
 1. \<exists>z CC C' C s L L' \<sigma> t' s'. pair = (z, s) \<and> candidate_values z CC C' C s L L' \<sigma> t' s' v S
[PROOF STEP]
unfolding set_of_candidate_values_def [of S v]
[PROOF STATE]
proof (prove)
using this:
pair \<in> {pair. \<exists>z CC C' C s L L' \<sigma> t' s'. pair = (z, s) \<and> candidate_values z CC C' C s L L' \<sigma> t' s' v S}

goal (1 subgoal):
 1. \<exists>z CC C' C s L L' \<sigma> t' s'. pair = (z, s) \<and> candidate_values z CC C' C s L L' \<sigma> t' s' v S
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>z CC C' C s L L' \<sigma> t' s'. pair = (z, s) \<and> candidate_values z CC C' C s L L' \<sigma> t' s' v S

goal (1 subgoal):
 1. \<exists>\<sigma>' u u' p v D L2. reduction L1 C \<sigma>' t s polarity L2 u u' p v D (same_values (\<lambda>t. trm_rep t S)) S \<sigma> \<and> variable_disjoint C D
[PROOF STEP]
from this
[PROOF STATE]
proof (chain)
picking this:
\<exists>z CC C' C s L L' \<sigma> t' s'. pair = (z, s) \<and> candidate_values z CC C' C s L L' \<sigma> t' s' v S
[PROOF STEP]
obtain zz C2_init Cl_C2_init gr_Cl_C2 gr_rhs gr_L2 L2_init \<eta>_init lhs_init rhs_init
    where "pair = (zz,  gr_rhs)"
    and "(candidate_values zz C2_init Cl_C2_init gr_Cl_C2 gr_rhs gr_L2 L2_init
          \<eta>_init lhs_init rhs_init v S)"
[PROOF STATE]
proof (prove)
using this:
\<exists>z CC C' C s L L' \<sigma> t' s'. pair = (z, s) \<and> candidate_values z CC C' C s L L' \<sigma> t' s' v S

goal (1 subgoal):
 1. (\<And>zz gr_rhs C2_init Cl_C2_init gr_Cl_C2 gr_L2 L2_init \<eta>_init lhs_init rhs_init. \<lbrakk>pair = (zz, gr_rhs); candidate_values zz C2_init Cl_C2_init gr_Cl_C2 gr_rhs gr_L2 L2_init \<eta>_init lhs_init rhs_init v S\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
pair = (zz, gr_rhs)
candidate_values zz C2_init Cl_C2_init gr_Cl_C2 gr_rhs gr_L2 L2_init \<eta>_init lhs_init rhs_init v S

goal (1 subgoal):
 1. \<exists>\<sigma>' u u' p v D L2. reduction L1 C \<sigma>' t s polarity L2 u u' p v D (same_values (\<lambda>t. trm_rep t S)) S \<sigma> \<and> variable_disjoint C D
[PROOF STEP]
from assms(7) and \<open>C \<in> S\<close>
[PROOF STATE]
proof (chain)
picking this:
\<forall>x\<in>S. finite (cl_ecl x)
C \<in> S
[PROOF STEP]
have "finite (cl_ecl C)"
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>S. finite (cl_ecl x)
C \<in> S

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

goal (1 subgoal):
 1. \<exists>\<sigma>' u u' p v D L2. reduction L1 C \<sigma>' t s polarity L2 u u' p v D (same_values (\<lambda>t. trm_rep t S)) S \<sigma> \<and> variable_disjoint C D
[PROOF STEP]
from \<open>(candidate_values zz C2_init Cl_C2_init gr_Cl_C2 gr_rhs gr_L2 L2_init
            \<eta>_init lhs_init rhs_init v S)\<close>
[PROOF STATE]
proof (chain)
picking this:
candidate_values zz C2_init Cl_C2_init gr_Cl_C2 gr_rhs gr_L2 L2_init \<eta>_init lhs_init rhs_init v S
[PROOF STEP]
have "finite Cl_C2_init"
[PROOF STATE]
proof (prove)
using this:
candidate_values zz C2_init Cl_C2_init gr_Cl_C2 gr_rhs gr_L2 L2_init \<eta>_init lhs_init rhs_init v S

goal (1 subgoal):
 1. finite Cl_C2_init
[PROOF STEP]
unfolding candidate_values_def
[PROOF STATE]
proof (prove)
using this:
C2_init \<in> S \<and> v \<notin> subst_set (trms_ecl C2_init) \<eta>_init \<and> trms_irreducible C2_init \<eta>_init S v \<and> Cl_C2_init = cl_ecl C2_init \<and> (gr_rhs, v) \<in> trm_ord \<and> ((gr_rhs, v) \<in> trm_ord \<longrightarrow> zz = trm_rep gr_rhs S) \<and> orient_lit_inst L2_init lhs_init rhs_init pos \<eta>_init \<and> sel Cl_C2_init = {} \<and> L2_init \<in> Cl_C2_init \<and> maximal_literal gr_L2 gr_Cl_C2 \<and> gr_L2 = subst_lit L2_init \<eta>_init \<and> gr_Cl_C2 = subst_cl Cl_C2_init \<eta>_init \<and> ground_clause gr_Cl_C2 \<and> v = lhs_init \<lhd> \<eta>_init \<and> gr_rhs = rhs_init \<lhd> \<eta>_init \<and> finite Cl_C2_init \<and> smaller_lits_are_false v gr_Cl_C2 S \<and> maximal_literal_is_unique v gr_rhs Cl_C2_init L2_init S \<eta>_init

goal (1 subgoal):
 1. finite Cl_C2_init
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
finite Cl_C2_init

goal (1 subgoal):
 1. \<exists>\<sigma>' u u' p v D L2. reduction L1 C \<sigma>' t s polarity L2 u u' p v D (same_values (\<lambda>t. trm_rep t S)) S \<sigma> \<and> variable_disjoint C D
[PROOF STEP]
from assms(11) \<open>closed_under_renaming S\<close> \<open>finite Cl_C2_init\<close> \<open>finite (cl_ecl C)\<close>
    \<open>(candidate_values zz C2_init Cl_C2_init gr_Cl_C2 gr_rhs gr_L2 L2_init
        \<eta>_init lhs_init rhs_init v S)\<close>
[PROOF STATE]
proof (chain)
picking this:
Ball S well_constrained
closed_under_renaming S
finite Cl_C2_init
finite (cl_ecl C)
candidate_values zz C2_init Cl_C2_init gr_Cl_C2 gr_rhs gr_L2 L2_init \<eta>_init lhs_init rhs_init v S
[PROOF STEP]
obtain C2 Cl_C2 \<eta> L2 lhs rhs where
    "(candidate_values zz C2 Cl_C2 gr_Cl_C2 gr_rhs gr_L2 L2 \<eta> lhs rhs v S)"
    and "(vars_of_cl (cl_ecl C) \<inter> vars_of_cl (cl_ecl C2)) = {}"
[PROOF STATE]
proof (prove)
using this:
Ball S well_constrained
closed_under_renaming S
finite Cl_C2_init
finite (cl_ecl C)
candidate_values zz C2_init Cl_C2_init gr_Cl_C2 gr_rhs gr_L2 L2_init \<eta>_init lhs_init rhs_init v S

goal (1 subgoal):
 1. (\<And>C2 Cl_C2 L2 \<eta> lhs rhs. \<lbrakk>candidate_values zz C2 Cl_C2 gr_Cl_C2 gr_rhs gr_L2 L2 \<eta> lhs rhs v S; vars_of_cl (cl_ecl C) \<inter> vars_of_cl (cl_ecl C2) = {}\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using candidate_values_renaming [of zz C2_init Cl_C2_init gr_Cl_C2 gr_rhs gr_L2 L2_init
        \<eta>_init lhs_init rhs_init v S C]
[PROOF STATE]
proof (prove)
using this:
Ball S well_constrained
closed_under_renaming S
finite Cl_C2_init
finite (cl_ecl C)
candidate_values zz C2_init Cl_C2_init gr_Cl_C2 gr_rhs gr_L2 L2_init \<eta>_init lhs_init rhs_init v S
\<lbrakk>candidate_values zz C2_init Cl_C2_init gr_Cl_C2 gr_rhs gr_L2 L2_init \<eta>_init lhs_init rhs_init v S; finite Cl_C2_init; finite (cl_ecl C); closed_under_renaming S; Ball S well_constrained\<rbrakk> \<Longrightarrow> \<exists>CC_bis C'_bis L'_bis \<sigma>_bis t'_bis s'_bis t_bis. candidate_values zz CC_bis C'_bis gr_Cl_C2 gr_rhs gr_L2 L'_bis \<sigma>_bis t'_bis s'_bis v S \<and> vars_of_cl (cl_ecl C) \<inter> vars_of_cl (cl_ecl CC_bis) = {}

goal (1 subgoal):
 1. (\<And>C2 Cl_C2 L2 \<eta> lhs rhs. \<lbrakk>candidate_values zz C2 Cl_C2 gr_Cl_C2 gr_rhs gr_L2 L2 \<eta> lhs rhs v S; vars_of_cl (cl_ecl C) \<inter> vars_of_cl (cl_ecl C2) = {}\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
candidate_values zz C2 Cl_C2 gr_Cl_C2 gr_rhs gr_L2 L2 \<eta> lhs rhs v S
vars_of_cl (cl_ecl C) \<inter> vars_of_cl (cl_ecl C2) = {}

goal (1 subgoal):
 1. \<exists>\<sigma>' u u' p v D L2. reduction L1 C \<sigma>' t s polarity L2 u u' p v D (same_values (\<lambda>t. trm_rep t S)) S \<sigma> \<and> variable_disjoint C D
[PROOF STEP]
from \<open>(candidate_values zz C2 Cl_C2 gr_Cl_C2 gr_rhs gr_L2 L2 \<eta> lhs rhs v S)\<close>
    and \<open>pair = (zz,  gr_rhs)\<close> and \<open>?v = fst pair\<close>
[PROOF STATE]
proof (chain)
picking this:
candidate_values zz C2 Cl_C2 gr_Cl_C2 gr_rhs gr_L2 L2 \<eta> lhs rhs v S
pair = (zz, gr_rhs)
trm_rep v S = fst pair
[PROOF STEP]
have cv: "(candidate_values ?v C2 Cl_C2 gr_Cl_C2 gr_rhs gr_L2 L2 \<eta> lhs rhs v S)"
[PROOF STATE]
proof (prove)
using this:
candidate_values zz C2 Cl_C2 gr_Cl_C2 gr_rhs gr_L2 L2 \<eta> lhs rhs v S
pair = (zz, gr_rhs)
trm_rep v S = fst pair

goal (1 subgoal):
 1. candidate_values (trm_rep v S) C2 Cl_C2 gr_Cl_C2 gr_rhs gr_L2 L2 \<eta> lhs rhs v S
[PROOF STEP]
by (metis fst_conv)
[PROOF STATE]
proof (state)
this:
candidate_values (trm_rep v S) C2 Cl_C2 gr_Cl_C2 gr_rhs gr_L2 L2 \<eta> lhs rhs v S

goal (1 subgoal):
 1. \<exists>\<sigma>' u u' p v D L2. reduction L1 C \<sigma>' t s polarity L2 u u' p v D (same_values (\<lambda>t. trm_rep t S)) S \<sigma> \<and> variable_disjoint C D
[PROOF STEP]
from cv
[PROOF STATE]
proof (chain)
picking this:
candidate_values (trm_rep v S) C2 Cl_C2 gr_Cl_C2 gr_rhs gr_L2 L2 \<eta> lhs rhs v S
[PROOF STEP]
have "C2 \<in> S"
[PROOF STATE]
proof (prove)
using this:
candidate_values (trm_rep v S) C2 Cl_C2 gr_Cl_C2 gr_rhs gr_L2 L2 \<eta> lhs rhs v S

goal (1 subgoal):
 1. C2 \<in> S
[PROOF STEP]
unfolding candidate_values_def
[PROOF STATE]
proof (prove)
using this:
C2 \<in> S \<and> v \<notin> subst_set (trms_ecl C2) \<eta> \<and> trms_irreducible C2 \<eta> S v \<and> Cl_C2 = cl_ecl C2 \<and> (gr_rhs, v) \<in> trm_ord \<and> ((gr_rhs, v) \<in> trm_ord \<longrightarrow> trm_rep v S = trm_rep gr_rhs S) \<and> orient_lit_inst L2 lhs rhs pos \<eta> \<and> sel Cl_C2 = {} \<and> L2 \<in> Cl_C2 \<and> maximal_literal gr_L2 gr_Cl_C2 \<and> gr_L2 = subst_lit L2 \<eta> \<and> gr_Cl_C2 = subst_cl Cl_C2 \<eta> \<and> ground_clause gr_Cl_C2 \<and> v = lhs \<lhd> \<eta> \<and> gr_rhs = rhs \<lhd> \<eta> \<and> finite Cl_C2 \<and> smaller_lits_are_false v gr_Cl_C2 S \<and> maximal_literal_is_unique v gr_rhs Cl_C2 L2 S \<eta>

goal (1 subgoal):
 1. C2 \<in> S
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
C2 \<in> S

goal (1 subgoal):
 1. \<exists>\<sigma>' u u' p v D L2. reduction L1 C \<sigma>' t s polarity L2 u u' p v D (same_values (\<lambda>t. trm_rep t S)) S \<sigma> \<and> variable_disjoint C D
[PROOF STEP]
from cv
[PROOF STATE]
proof (chain)
picking this:
candidate_values (trm_rep v S) C2 Cl_C2 gr_Cl_C2 gr_rhs gr_L2 L2 \<eta> lhs rhs v S
[PROOF STEP]
have "ground_clause gr_Cl_C2"
[PROOF STATE]
proof (prove)
using this:
candidate_values (trm_rep v S) C2 Cl_C2 gr_Cl_C2 gr_rhs gr_L2 L2 \<eta> lhs rhs v S

goal (1 subgoal):
 1. ground_clause gr_Cl_C2
[PROOF STEP]
unfolding candidate_values_def
[PROOF STATE]
proof (prove)
using this:
C2 \<in> S \<and> v \<notin> subst_set (trms_ecl C2) \<eta> \<and> trms_irreducible C2 \<eta> S v \<and> Cl_C2 = cl_ecl C2 \<and> (gr_rhs, v) \<in> trm_ord \<and> ((gr_rhs, v) \<in> trm_ord \<longrightarrow> trm_rep v S = trm_rep gr_rhs S) \<and> orient_lit_inst L2 lhs rhs pos \<eta> \<and> sel Cl_C2 = {} \<and> L2 \<in> Cl_C2 \<and> maximal_literal gr_L2 gr_Cl_C2 \<and> gr_L2 = subst_lit L2 \<eta> \<and> gr_Cl_C2 = subst_cl Cl_C2 \<eta> \<and> ground_clause gr_Cl_C2 \<and> v = lhs \<lhd> \<eta> \<and> gr_rhs = rhs \<lhd> \<eta> \<and> finite Cl_C2 \<and> smaller_lits_are_false v gr_Cl_C2 S \<and> maximal_literal_is_unique v gr_rhs Cl_C2 L2 S \<eta>

goal (1 subgoal):
 1. ground_clause gr_Cl_C2
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
ground_clause gr_Cl_C2

goal (1 subgoal):
 1. \<exists>\<sigma>' u u' p v D L2. reduction L1 C \<sigma>' t s polarity L2 u u' p v D (same_values (\<lambda>t. trm_rep t S)) S \<sigma> \<and> variable_disjoint C D
[PROOF STEP]
from assms(7) and assms(10)
[PROOF STATE]
proof (chain)
picking this:
\<forall>x\<in>S. finite (cl_ecl x)
C \<in> S
[PROOF STEP]
have "finite (vars_of_cl (cl_ecl C))"
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>S. finite (cl_ecl x)
C \<in> S

goal (1 subgoal):
 1. finite (vars_of_cl (cl_ecl C))
[PROOF STEP]
using set_of_variables_is_finite_cl
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>S. finite (cl_ecl x)
C \<in> S
finite ?C \<Longrightarrow> finite (vars_of_cl ?C)

goal (1 subgoal):
 1. finite (vars_of_cl (cl_ecl C))
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
finite (vars_of_cl (cl_ecl C))

goal (1 subgoal):
 1. \<exists>\<sigma>' u u' p v D L2. reduction L1 C \<sigma>' t s polarity L2 u u' p v D (same_values (\<lambda>t. trm_rep t S)) S \<sigma> \<and> variable_disjoint C D
[PROOF STEP]
from cv
[PROOF STATE]
proof (chain)
picking this:
candidate_values (trm_rep v S) C2 Cl_C2 gr_Cl_C2 gr_rhs gr_L2 L2 \<eta> lhs rhs v S
[PROOF STEP]
have "smaller_lits_are_false v gr_Cl_C2 S"
[PROOF STATE]
proof (prove)
using this:
candidate_values (trm_rep v S) C2 Cl_C2 gr_Cl_C2 gr_rhs gr_L2 L2 \<eta> lhs rhs v S

goal (1 subgoal):
 1. smaller_lits_are_false v gr_Cl_C2 S
[PROOF STEP]
unfolding candidate_values_def
[PROOF STATE]
proof (prove)
using this:
C2 \<in> S \<and> v \<notin> subst_set (trms_ecl C2) \<eta> \<and> trms_irreducible C2 \<eta> S v \<and> Cl_C2 = cl_ecl C2 \<and> (gr_rhs, v) \<in> trm_ord \<and> ((gr_rhs, v) \<in> trm_ord \<longrightarrow> trm_rep v S = trm_rep gr_rhs S) \<and> orient_lit_inst L2 lhs rhs pos \<eta> \<and> sel Cl_C2 = {} \<and> L2 \<in> Cl_C2 \<and> maximal_literal gr_L2 gr_Cl_C2 \<and> gr_L2 = subst_lit L2 \<eta> \<and> gr_Cl_C2 = subst_cl Cl_C2 \<eta> \<and> ground_clause gr_Cl_C2 \<and> v = lhs \<lhd> \<eta> \<and> gr_rhs = rhs \<lhd> \<eta> \<and> finite Cl_C2 \<and> smaller_lits_are_false v gr_Cl_C2 S \<and> maximal_literal_is_unique v gr_rhs Cl_C2 L2 S \<eta>

goal (1 subgoal):
 1. smaller_lits_are_false v gr_Cl_C2 S
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
smaller_lits_are_false v gr_Cl_C2 S

goal (1 subgoal):
 1. \<exists>\<sigma>' u u' p v D L2. reduction L1 C \<sigma>' t s polarity L2 u u' p v D (same_values (\<lambda>t. trm_rep t S)) S \<sigma> \<and> variable_disjoint C D
[PROOF STEP]
from cv
[PROOF STATE]
proof (chain)
picking this:
candidate_values (trm_rep v S) C2 Cl_C2 gr_Cl_C2 gr_rhs gr_L2 L2 \<eta> lhs rhs v S
[PROOF STEP]
have "gr_Cl_C2 = subst_cl Cl_C2 \<eta>"
[PROOF STATE]
proof (prove)
using this:
candidate_values (trm_rep v S) C2 Cl_C2 gr_Cl_C2 gr_rhs gr_L2 L2 \<eta> lhs rhs v S

goal (1 subgoal):
 1. gr_Cl_C2 = subst_cl Cl_C2 \<eta>
[PROOF STEP]
unfolding candidate_values_def
[PROOF STATE]
proof (prove)
using this:
C2 \<in> S \<and> v \<notin> subst_set (trms_ecl C2) \<eta> \<and> trms_irreducible C2 \<eta> S v \<and> Cl_C2 = cl_ecl C2 \<and> (gr_rhs, v) \<in> trm_ord \<and> ((gr_rhs, v) \<in> trm_ord \<longrightarrow> trm_rep v S = trm_rep gr_rhs S) \<and> orient_lit_inst L2 lhs rhs pos \<eta> \<and> sel Cl_C2 = {} \<and> L2 \<in> Cl_C2 \<and> maximal_literal gr_L2 gr_Cl_C2 \<and> gr_L2 = subst_lit L2 \<eta> \<and> gr_Cl_C2 = subst_cl Cl_C2 \<eta> \<and> ground_clause gr_Cl_C2 \<and> v = lhs \<lhd> \<eta> \<and> gr_rhs = rhs \<lhd> \<eta> \<and> finite Cl_C2 \<and> smaller_lits_are_false v gr_Cl_C2 S \<and> maximal_literal_is_unique v gr_rhs Cl_C2 L2 S \<eta>

goal (1 subgoal):
 1. gr_Cl_C2 = subst_cl Cl_C2 \<eta>
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
gr_Cl_C2 = subst_cl Cl_C2 \<eta>

goal (1 subgoal):
 1. \<exists>\<sigma>' u u' p v D L2. reduction L1 C \<sigma>' t s polarity L2 u u' p v D (same_values (\<lambda>t. trm_rep t S)) S \<sigma> \<and> variable_disjoint C D
[PROOF STEP]
from cv
[PROOF STATE]
proof (chain)
picking this:
candidate_values (trm_rep v S) C2 Cl_C2 gr_Cl_C2 gr_rhs gr_L2 L2 \<eta> lhs rhs v S
[PROOF STEP]
have "orient_lit_inst L2 lhs rhs pos \<eta>"
[PROOF STATE]
proof (prove)
using this:
candidate_values (trm_rep v S) C2 Cl_C2 gr_Cl_C2 gr_rhs gr_L2 L2 \<eta> lhs rhs v S

goal (1 subgoal):
 1. orient_lit_inst L2 lhs rhs pos \<eta>
[PROOF STEP]
unfolding candidate_values_def
[PROOF STATE]
proof (prove)
using this:
C2 \<in> S \<and> v \<notin> subst_set (trms_ecl C2) \<eta> \<and> trms_irreducible C2 \<eta> S v \<and> Cl_C2 = cl_ecl C2 \<and> (gr_rhs, v) \<in> trm_ord \<and> ((gr_rhs, v) \<in> trm_ord \<longrightarrow> trm_rep v S = trm_rep gr_rhs S) \<and> orient_lit_inst L2 lhs rhs pos \<eta> \<and> sel Cl_C2 = {} \<and> L2 \<in> Cl_C2 \<and> maximal_literal gr_L2 gr_Cl_C2 \<and> gr_L2 = subst_lit L2 \<eta> \<and> gr_Cl_C2 = subst_cl Cl_C2 \<eta> \<and> ground_clause gr_Cl_C2 \<and> v = lhs \<lhd> \<eta> \<and> gr_rhs = rhs \<lhd> \<eta> \<and> finite Cl_C2 \<and> smaller_lits_are_false v gr_Cl_C2 S \<and> maximal_literal_is_unique v gr_rhs Cl_C2 L2 S \<eta>

goal (1 subgoal):
 1. orient_lit_inst L2 lhs rhs pos \<eta>
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
orient_lit_inst L2 lhs rhs pos \<eta>

goal (1 subgoal):
 1. \<exists>\<sigma>' u u' p v D L2. reduction L1 C \<sigma>' t s polarity L2 u u' p v D (same_values (\<lambda>t. trm_rep t S)) S \<sigma> \<and> variable_disjoint C D
[PROOF STEP]
from cv
[PROOF STATE]
proof (chain)
picking this:
candidate_values (trm_rep v S) C2 Cl_C2 gr_Cl_C2 gr_rhs gr_L2 L2 \<eta> lhs rhs v S
[PROOF STEP]
have "maximal_literal gr_L2 gr_Cl_C2"
[PROOF STATE]
proof (prove)
using this:
candidate_values (trm_rep v S) C2 Cl_C2 gr_Cl_C2 gr_rhs gr_L2 L2 \<eta> lhs rhs v S

goal (1 subgoal):
 1. maximal_literal gr_L2 gr_Cl_C2
[PROOF STEP]
unfolding candidate_values_def
[PROOF STATE]
proof (prove)
using this:
C2 \<in> S \<and> v \<notin> subst_set (trms_ecl C2) \<eta> \<and> trms_irreducible C2 \<eta> S v \<and> Cl_C2 = cl_ecl C2 \<and> (gr_rhs, v) \<in> trm_ord \<and> ((gr_rhs, v) \<in> trm_ord \<longrightarrow> trm_rep v S = trm_rep gr_rhs S) \<and> orient_lit_inst L2 lhs rhs pos \<eta> \<and> sel Cl_C2 = {} \<and> L2 \<in> Cl_C2 \<and> maximal_literal gr_L2 gr_Cl_C2 \<and> gr_L2 = subst_lit L2 \<eta> \<and> gr_Cl_C2 = subst_cl Cl_C2 \<eta> \<and> ground_clause gr_Cl_C2 \<and> v = lhs \<lhd> \<eta> \<and> gr_rhs = rhs \<lhd> \<eta> \<and> finite Cl_C2 \<and> smaller_lits_are_false v gr_Cl_C2 S \<and> maximal_literal_is_unique v gr_rhs Cl_C2 L2 S \<eta>

goal (1 subgoal):
 1. maximal_literal gr_L2 gr_Cl_C2
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
maximal_literal gr_L2 gr_Cl_C2

goal (1 subgoal):
 1. \<exists>\<sigma>' u u' p v D L2. reduction L1 C \<sigma>' t s polarity L2 u u' p v D (same_values (\<lambda>t. trm_rep t S)) S \<sigma> \<and> variable_disjoint C D
[PROOF STEP]
from cv
[PROOF STATE]
proof (chain)
picking this:
candidate_values (trm_rep v S) C2 Cl_C2 gr_Cl_C2 gr_rhs gr_L2 L2 \<eta> lhs rhs v S
[PROOF STEP]
have "gr_L2 = subst_lit L2 \<eta>"
[PROOF STATE]
proof (prove)
using this:
candidate_values (trm_rep v S) C2 Cl_C2 gr_Cl_C2 gr_rhs gr_L2 L2 \<eta> lhs rhs v S

goal (1 subgoal):
 1. gr_L2 = subst_lit L2 \<eta>
[PROOF STEP]
unfolding candidate_values_def
[PROOF STATE]
proof (prove)
using this:
C2 \<in> S \<and> v \<notin> subst_set (trms_ecl C2) \<eta> \<and> trms_irreducible C2 \<eta> S v \<and> Cl_C2 = cl_ecl C2 \<and> (gr_rhs, v) \<in> trm_ord \<and> ((gr_rhs, v) \<in> trm_ord \<longrightarrow> trm_rep v S = trm_rep gr_rhs S) \<and> orient_lit_inst L2 lhs rhs pos \<eta> \<and> sel Cl_C2 = {} \<and> L2 \<in> Cl_C2 \<and> maximal_literal gr_L2 gr_Cl_C2 \<and> gr_L2 = subst_lit L2 \<eta> \<and> gr_Cl_C2 = subst_cl Cl_C2 \<eta> \<and> ground_clause gr_Cl_C2 \<and> v = lhs \<lhd> \<eta> \<and> gr_rhs = rhs \<lhd> \<eta> \<and> finite Cl_C2 \<and> smaller_lits_are_false v gr_Cl_C2 S \<and> maximal_literal_is_unique v gr_rhs Cl_C2 L2 S \<eta>

goal (1 subgoal):
 1. gr_L2 = subst_lit L2 \<eta>
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
gr_L2 = subst_lit L2 \<eta>

goal (1 subgoal):
 1. \<exists>\<sigma>' u u' p v D L2. reduction L1 C \<sigma>' t s polarity L2 u u' p v D (same_values (\<lambda>t. trm_rep t S)) S \<sigma> \<and> variable_disjoint C D
[PROOF STEP]
from cv
[PROOF STATE]
proof (chain)
picking this:
candidate_values (trm_rep v S) C2 Cl_C2 gr_Cl_C2 gr_rhs gr_L2 L2 \<eta> lhs rhs v S
[PROOF STEP]
have "ground_clause gr_Cl_C2"
[PROOF STATE]
proof (prove)
using this:
candidate_values (trm_rep v S) C2 Cl_C2 gr_Cl_C2 gr_rhs gr_L2 L2 \<eta> lhs rhs v S

goal (1 subgoal):
 1. ground_clause gr_Cl_C2
[PROOF STEP]
unfolding candidate_values_def
[PROOF STATE]
proof (prove)
using this:
C2 \<in> S \<and> v \<notin> subst_set (trms_ecl C2) \<eta> \<and> trms_irreducible C2 \<eta> S v \<and> Cl_C2 = cl_ecl C2 \<and> (gr_rhs, v) \<in> trm_ord \<and> ((gr_rhs, v) \<in> trm_ord \<longrightarrow> trm_rep v S = trm_rep gr_rhs S) \<and> orient_lit_inst L2 lhs rhs pos \<eta> \<and> sel Cl_C2 = {} \<and> L2 \<in> Cl_C2 \<and> maximal_literal gr_L2 gr_Cl_C2 \<and> gr_L2 = subst_lit L2 \<eta> \<and> gr_Cl_C2 = subst_cl Cl_C2 \<eta> \<and> ground_clause gr_Cl_C2 \<and> v = lhs \<lhd> \<eta> \<and> gr_rhs = rhs \<lhd> \<eta> \<and> finite Cl_C2 \<and> smaller_lits_are_false v gr_Cl_C2 S \<and> maximal_literal_is_unique v gr_rhs Cl_C2 L2 S \<eta>

goal (1 subgoal):
 1. ground_clause gr_Cl_C2
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
ground_clause gr_Cl_C2

goal (1 subgoal):
 1. \<exists>\<sigma>' u u' p v D L2. reduction L1 C \<sigma>' t s polarity L2 u u' p v D (same_values (\<lambda>t. trm_rep t S)) S \<sigma> \<and> variable_disjoint C D
[PROOF STEP]
from cv
[PROOF STATE]
proof (chain)
picking this:
candidate_values (trm_rep v S) C2 Cl_C2 gr_Cl_C2 gr_rhs gr_L2 L2 \<eta> lhs rhs v S
[PROOF STEP]
have "L2 \<in> Cl_C2"
[PROOF STATE]
proof (prove)
using this:
candidate_values (trm_rep v S) C2 Cl_C2 gr_Cl_C2 gr_rhs gr_L2 L2 \<eta> lhs rhs v S

goal (1 subgoal):
 1. L2 \<in> Cl_C2
[PROOF STEP]
unfolding candidate_values_def
[PROOF STATE]
proof (prove)
using this:
C2 \<in> S \<and> v \<notin> subst_set (trms_ecl C2) \<eta> \<and> trms_irreducible C2 \<eta> S v \<and> Cl_C2 = cl_ecl C2 \<and> (gr_rhs, v) \<in> trm_ord \<and> ((gr_rhs, v) \<in> trm_ord \<longrightarrow> trm_rep v S = trm_rep gr_rhs S) \<and> orient_lit_inst L2 lhs rhs pos \<eta> \<and> sel Cl_C2 = {} \<and> L2 \<in> Cl_C2 \<and> maximal_literal gr_L2 gr_Cl_C2 \<and> gr_L2 = subst_lit L2 \<eta> \<and> gr_Cl_C2 = subst_cl Cl_C2 \<eta> \<and> ground_clause gr_Cl_C2 \<and> v = lhs \<lhd> \<eta> \<and> gr_rhs = rhs \<lhd> \<eta> \<and> finite Cl_C2 \<and> smaller_lits_are_false v gr_Cl_C2 S \<and> maximal_literal_is_unique v gr_rhs Cl_C2 L2 S \<eta>

goal (1 subgoal):
 1. L2 \<in> Cl_C2
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
L2 \<in> Cl_C2

goal (1 subgoal):
 1. \<exists>\<sigma>' u u' p v D L2. reduction L1 C \<sigma>' t s polarity L2 u u' p v D (same_values (\<lambda>t. trm_rep t S)) S \<sigma> \<and> variable_disjoint C D
[PROOF STEP]
from this and \<open>gr_Cl_C2 = subst_cl Cl_C2 \<eta>\<close> and \<open>gr_L2 = subst_lit L2 \<eta>\<close>
[PROOF STATE]
proof (chain)
picking this:
L2 \<in> Cl_C2
gr_Cl_C2 = subst_cl Cl_C2 \<eta>
gr_L2 = subst_lit L2 \<eta>
[PROOF STEP]
have "gr_L2 \<in> gr_Cl_C2"
[PROOF STATE]
proof (prove)
using this:
L2 \<in> Cl_C2
gr_Cl_C2 = subst_cl Cl_C2 \<eta>
gr_L2 = subst_lit L2 \<eta>

goal (1 subgoal):
 1. gr_L2 \<in> gr_Cl_C2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
gr_L2 \<in> gr_Cl_C2

goal (1 subgoal):
 1. \<exists>\<sigma>' u u' p v D L2. reduction L1 C \<sigma>' t s polarity L2 u u' p v D (same_values (\<lambda>t. trm_rep t S)) S \<sigma> \<and> variable_disjoint C D
[PROOF STEP]
from cv
[PROOF STATE]
proof (chain)
picking this:
candidate_values (trm_rep v S) C2 Cl_C2 gr_Cl_C2 gr_rhs gr_L2 L2 \<eta> lhs rhs v S
[PROOF STEP]
have "trm_rep v S = trm_rep gr_rhs S"
[PROOF STATE]
proof (prove)
using this:
candidate_values (trm_rep v S) C2 Cl_C2 gr_Cl_C2 gr_rhs gr_L2 L2 \<eta> lhs rhs v S

goal (1 subgoal):
 1. trm_rep v S = trm_rep gr_rhs S
[PROOF STEP]
unfolding candidate_values_def
[PROOF STATE]
proof (prove)
using this:
C2 \<in> S \<and> v \<notin> subst_set (trms_ecl C2) \<eta> \<and> trms_irreducible C2 \<eta> S v \<and> Cl_C2 = cl_ecl C2 \<and> (gr_rhs, v) \<in> trm_ord \<and> ((gr_rhs, v) \<in> trm_ord \<longrightarrow> trm_rep v S = trm_rep gr_rhs S) \<and> orient_lit_inst L2 lhs rhs pos \<eta> \<and> sel Cl_C2 = {} \<and> L2 \<in> Cl_C2 \<and> maximal_literal gr_L2 gr_Cl_C2 \<and> gr_L2 = subst_lit L2 \<eta> \<and> gr_Cl_C2 = subst_cl Cl_C2 \<eta> \<and> ground_clause gr_Cl_C2 \<and> v = lhs \<lhd> \<eta> \<and> gr_rhs = rhs \<lhd> \<eta> \<and> finite Cl_C2 \<and> smaller_lits_are_false v gr_Cl_C2 S \<and> maximal_literal_is_unique v gr_rhs Cl_C2 L2 S \<eta>

goal (1 subgoal):
 1. trm_rep v S = trm_rep gr_rhs S
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
trm_rep v S = trm_rep gr_rhs S

goal (1 subgoal):
 1. \<exists>\<sigma>' u u' p v D L2. reduction L1 C \<sigma>' t s polarity L2 u u' p v D (same_values (\<lambda>t. trm_rep t S)) S \<sigma> \<and> variable_disjoint C D
[PROOF STEP]
from cv
[PROOF STATE]
proof (chain)
picking this:
candidate_values (trm_rep v S) C2 Cl_C2 gr_Cl_C2 gr_rhs gr_L2 L2 \<eta> lhs rhs v S
[PROOF STEP]
have "(gr_rhs, v) \<in> trm_ord"
[PROOF STATE]
proof (prove)
using this:
candidate_values (trm_rep v S) C2 Cl_C2 gr_Cl_C2 gr_rhs gr_L2 L2 \<eta> lhs rhs v S

goal (1 subgoal):
 1. (gr_rhs, v) \<in> trm_ord
[PROOF STEP]
unfolding candidate_values_def
[PROOF STATE]
proof (prove)
using this:
C2 \<in> S \<and> v \<notin> subst_set (trms_ecl C2) \<eta> \<and> trms_irreducible C2 \<eta> S v \<and> Cl_C2 = cl_ecl C2 \<and> (gr_rhs, v) \<in> trm_ord \<and> ((gr_rhs, v) \<in> trm_ord \<longrightarrow> trm_rep v S = trm_rep gr_rhs S) \<and> orient_lit_inst L2 lhs rhs pos \<eta> \<and> sel Cl_C2 = {} \<and> L2 \<in> Cl_C2 \<and> maximal_literal gr_L2 gr_Cl_C2 \<and> gr_L2 = subst_lit L2 \<eta> \<and> gr_Cl_C2 = subst_cl Cl_C2 \<eta> \<and> ground_clause gr_Cl_C2 \<and> v = lhs \<lhd> \<eta> \<and> gr_rhs = rhs \<lhd> \<eta> \<and> finite Cl_C2 \<and> smaller_lits_are_false v gr_Cl_C2 S \<and> maximal_literal_is_unique v gr_rhs Cl_C2 L2 S \<eta>

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

goal (1 subgoal):
 1. \<exists>\<sigma>' u u' p v D L2. reduction L1 C \<sigma>' t s polarity L2 u u' p v D (same_values (\<lambda>t. trm_rep t S)) S \<sigma> \<and> variable_disjoint C D
[PROOF STEP]
from cv
[PROOF STATE]
proof (chain)
picking this:
candidate_values (trm_rep v S) C2 Cl_C2 gr_Cl_C2 gr_rhs gr_L2 L2 \<eta> lhs rhs v S
[PROOF STEP]
have "Cl_C2 = cl_ecl C2"
[PROOF STATE]
proof (prove)
using this:
candidate_values (trm_rep v S) C2 Cl_C2 gr_Cl_C2 gr_rhs gr_L2 L2 \<eta> lhs rhs v S

goal (1 subgoal):
 1. Cl_C2 = cl_ecl C2
[PROOF STEP]
unfolding candidate_values_def
[PROOF STATE]
proof (prove)
using this:
C2 \<in> S \<and> v \<notin> subst_set (trms_ecl C2) \<eta> \<and> trms_irreducible C2 \<eta> S v \<and> Cl_C2 = cl_ecl C2 \<and> (gr_rhs, v) \<in> trm_ord \<and> ((gr_rhs, v) \<in> trm_ord \<longrightarrow> trm_rep v S = trm_rep gr_rhs S) \<and> orient_lit_inst L2 lhs rhs pos \<eta> \<and> sel Cl_C2 = {} \<and> L2 \<in> Cl_C2 \<and> maximal_literal gr_L2 gr_Cl_C2 \<and> gr_L2 = subst_lit L2 \<eta> \<and> gr_Cl_C2 = subst_cl Cl_C2 \<eta> \<and> ground_clause gr_Cl_C2 \<and> v = lhs \<lhd> \<eta> \<and> gr_rhs = rhs \<lhd> \<eta> \<and> finite Cl_C2 \<and> smaller_lits_are_false v gr_Cl_C2 S \<and> maximal_literal_is_unique v gr_rhs Cl_C2 L2 S \<eta>

goal (1 subgoal):
 1. Cl_C2 = cl_ecl C2
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
Cl_C2 = cl_ecl C2

goal (1 subgoal):
 1. \<exists>\<sigma>' u u' p v D L2. reduction L1 C \<sigma>' t s polarity L2 u u' p v D (same_values (\<lambda>t. trm_rep t S)) S \<sigma> \<and> variable_disjoint C D
[PROOF STEP]
from cv
[PROOF STATE]
proof (chain)
picking this:
candidate_values (trm_rep v S) C2 Cl_C2 gr_Cl_C2 gr_rhs gr_L2 L2 \<eta> lhs rhs v S
[PROOF STEP]
have "v \<notin> subst_set (trms_ecl C2) \<eta>"
[PROOF STATE]
proof (prove)
using this:
candidate_values (trm_rep v S) C2 Cl_C2 gr_Cl_C2 gr_rhs gr_L2 L2 \<eta> lhs rhs v S

goal (1 subgoal):
 1. v \<notin> subst_set (trms_ecl C2) \<eta>
[PROOF STEP]
unfolding candidate_values_def
[PROOF STATE]
proof (prove)
using this:
C2 \<in> S \<and> v \<notin> subst_set (trms_ecl C2) \<eta> \<and> trms_irreducible C2 \<eta> S v \<and> Cl_C2 = cl_ecl C2 \<and> (gr_rhs, v) \<in> trm_ord \<and> ((gr_rhs, v) \<in> trm_ord \<longrightarrow> trm_rep v S = trm_rep gr_rhs S) \<and> orient_lit_inst L2 lhs rhs pos \<eta> \<and> sel Cl_C2 = {} \<and> L2 \<in> Cl_C2 \<and> maximal_literal gr_L2 gr_Cl_C2 \<and> gr_L2 = subst_lit L2 \<eta> \<and> gr_Cl_C2 = subst_cl Cl_C2 \<eta> \<and> ground_clause gr_Cl_C2 \<and> v = lhs \<lhd> \<eta> \<and> gr_rhs = rhs \<lhd> \<eta> \<and> finite Cl_C2 \<and> smaller_lits_are_false v gr_Cl_C2 S \<and> maximal_literal_is_unique v gr_rhs Cl_C2 L2 S \<eta>

goal (1 subgoal):
 1. v \<notin> subst_set (trms_ecl C2) \<eta>
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
v \<notin> subst_set (trms_ecl C2) \<eta>

goal (1 subgoal):
 1. \<exists>\<sigma>' u u' p v D L2. reduction L1 C \<sigma>' t s polarity L2 u u' p v D (same_values (\<lambda>t. trm_rep t S)) S \<sigma> \<and> variable_disjoint C D
[PROOF STEP]
from cv
[PROOF STATE]
proof (chain)
picking this:
candidate_values (trm_rep v S) C2 Cl_C2 gr_Cl_C2 gr_rhs gr_L2 L2 \<eta> lhs rhs v S
[PROOF STEP]
have "sel (cl_ecl C2) = {}"
[PROOF STATE]
proof (prove)
using this:
candidate_values (trm_rep v S) C2 Cl_C2 gr_Cl_C2 gr_rhs gr_L2 L2 \<eta> lhs rhs v S

goal (1 subgoal):
 1. sel (cl_ecl C2) = {}
[PROOF STEP]
unfolding candidate_values_def
[PROOF STATE]
proof (prove)
using this:
C2 \<in> S \<and> v \<notin> subst_set (trms_ecl C2) \<eta> \<and> trms_irreducible C2 \<eta> S v \<and> Cl_C2 = cl_ecl C2 \<and> (gr_rhs, v) \<in> trm_ord \<and> ((gr_rhs, v) \<in> trm_ord \<longrightarrow> trm_rep v S = trm_rep gr_rhs S) \<and> orient_lit_inst L2 lhs rhs pos \<eta> \<and> sel Cl_C2 = {} \<and> L2 \<in> Cl_C2 \<and> maximal_literal gr_L2 gr_Cl_C2 \<and> gr_L2 = subst_lit L2 \<eta> \<and> gr_Cl_C2 = subst_cl Cl_C2 \<eta> \<and> ground_clause gr_Cl_C2 \<and> v = lhs \<lhd> \<eta> \<and> gr_rhs = rhs \<lhd> \<eta> \<and> finite Cl_C2 \<and> smaller_lits_are_false v gr_Cl_C2 S \<and> maximal_literal_is_unique v gr_rhs Cl_C2 L2 S \<eta>

goal (1 subgoal):
 1. sel (cl_ecl C2) = {}
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
sel (cl_ecl C2) = {}

goal (1 subgoal):
 1. \<exists>\<sigma>' u u' p v D L2. reduction L1 C \<sigma>' t s polarity L2 u u' p v D (same_values (\<lambda>t. trm_rep t S)) S \<sigma> \<and> variable_disjoint C D
[PROOF STEP]
from this and \<open>maximal_literal gr_L2 gr_Cl_C2\<close> and \<open>gr_Cl_C2 = subst_cl Cl_C2 \<eta>\<close>
    and \<open>Cl_C2 = (cl_ecl C2)\<close> and \<open>gr_L2 = subst_lit L2 \<eta>\<close>
[PROOF STATE]
proof (chain)
picking this:
sel (cl_ecl C2) = {}
maximal_literal gr_L2 gr_Cl_C2
gr_Cl_C2 = subst_cl Cl_C2 \<eta>
Cl_C2 = cl_ecl C2
gr_L2 = subst_lit L2 \<eta>
[PROOF STEP]
have "eligible_literal L2 C2 \<eta>"
[PROOF STATE]
proof (prove)
using this:
sel (cl_ecl C2) = {}
maximal_literal gr_L2 gr_Cl_C2
gr_Cl_C2 = subst_cl Cl_C2 \<eta>
Cl_C2 = cl_ecl C2
gr_L2 = subst_lit L2 \<eta>

goal (1 subgoal):
 1. eligible_literal L2 C2 \<eta>
[PROOF STEP]
unfolding eligible_literal_def
[PROOF STATE]
proof (prove)
using this:
sel (cl_ecl C2) = {}
maximal_literal gr_L2 gr_Cl_C2
gr_Cl_C2 = subst_cl Cl_C2 \<eta>
Cl_C2 = cl_ecl C2
gr_L2 = subst_lit L2 \<eta>

goal (1 subgoal):
 1. L2 \<in> sel (cl_ecl C2) \<or> sel (cl_ecl C2) = {} \<and> maximal_literal (subst_lit L2 \<eta>) (subst_cl (cl_ecl C2) \<eta>)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
eligible_literal L2 C2 \<eta>

goal (1 subgoal):
 1. \<exists>\<sigma>' u u' p v D L2. reduction L1 C \<sigma>' t s polarity L2 u u' p v D (same_values (\<lambda>t. trm_rep t S)) S \<sigma> \<and> variable_disjoint C D
[PROOF STEP]
from cv
[PROOF STATE]
proof (chain)
picking this:
candidate_values (trm_rep v S) C2 Cl_C2 gr_Cl_C2 gr_rhs gr_L2 L2 \<eta> lhs rhs v S
[PROOF STEP]
have "(gr_rhs, v) \<in> trm_ord"
[PROOF STATE]
proof (prove)
using this:
candidate_values (trm_rep v S) C2 Cl_C2 gr_Cl_C2 gr_rhs gr_L2 L2 \<eta> lhs rhs v S

goal (1 subgoal):
 1. (gr_rhs, v) \<in> trm_ord
[PROOF STEP]
unfolding candidate_values_def
[PROOF STATE]
proof (prove)
using this:
C2 \<in> S \<and> v \<notin> subst_set (trms_ecl C2) \<eta> \<and> trms_irreducible C2 \<eta> S v \<and> Cl_C2 = cl_ecl C2 \<and> (gr_rhs, v) \<in> trm_ord \<and> ((gr_rhs, v) \<in> trm_ord \<longrightarrow> trm_rep v S = trm_rep gr_rhs S) \<and> orient_lit_inst L2 lhs rhs pos \<eta> \<and> sel Cl_C2 = {} \<and> L2 \<in> Cl_C2 \<and> maximal_literal gr_L2 gr_Cl_C2 \<and> gr_L2 = subst_lit L2 \<eta> \<and> gr_Cl_C2 = subst_cl Cl_C2 \<eta> \<and> ground_clause gr_Cl_C2 \<and> v = lhs \<lhd> \<eta> \<and> gr_rhs = rhs \<lhd> \<eta> \<and> finite Cl_C2 \<and> smaller_lits_are_false v gr_Cl_C2 S \<and> maximal_literal_is_unique v gr_rhs Cl_C2 L2 S \<eta>

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

goal (1 subgoal):
 1. \<exists>\<sigma>' u u' p v D L2. reduction L1 C \<sigma>' t s polarity L2 u u' p v D (same_values (\<lambda>t. trm_rep t S)) S \<sigma> \<and> variable_disjoint C D
[PROOF STEP]
from cv
[PROOF STATE]
proof (chain)
picking this:
candidate_values (trm_rep v S) C2 Cl_C2 gr_Cl_C2 gr_rhs gr_L2 L2 \<eta> lhs rhs v S
[PROOF STEP]
have norm: "(\<forall>x. (\<exists>x'\<in> trms_ecl C2. occurs_in x (subst x' \<eta>)) \<longrightarrow>
       (x, v) \<in> trm_ord \<longrightarrow> trm_rep x S = x)"
[PROOF STATE]
proof (prove)
using this:
candidate_values (trm_rep v S) C2 Cl_C2 gr_Cl_C2 gr_rhs gr_L2 L2 \<eta> lhs rhs v S

goal (1 subgoal):
 1. \<forall>x. (\<exists>x'\<in>trms_ecl C2. occurs_in x (x' \<lhd> \<eta>)) \<longrightarrow> (x, v) \<in> trm_ord \<longrightarrow> trm_rep x S = x
[PROOF STEP]
unfolding candidate_values_def trms_irreducible_def
[PROOF STATE]
proof (prove)
using this:
C2 \<in> S \<and> v \<notin> subst_set (trms_ecl C2) \<eta> \<and> (\<forall>x. (\<exists>x'\<in>trms_ecl C2. occurs_in x (x' \<lhd> \<eta>)) \<longrightarrow> (x, v) \<in> trm_ord \<longrightarrow> trm_rep x S = x) \<and> Cl_C2 = cl_ecl C2 \<and> (gr_rhs, v) \<in> trm_ord \<and> ((gr_rhs, v) \<in> trm_ord \<longrightarrow> trm_rep v S = trm_rep gr_rhs S) \<and> orient_lit_inst L2 lhs rhs pos \<eta> \<and> sel Cl_C2 = {} \<and> L2 \<in> Cl_C2 \<and> maximal_literal gr_L2 gr_Cl_C2 \<and> gr_L2 = subst_lit L2 \<eta> \<and> gr_Cl_C2 = subst_cl Cl_C2 \<eta> \<and> ground_clause gr_Cl_C2 \<and> v = lhs \<lhd> \<eta> \<and> gr_rhs = rhs \<lhd> \<eta> \<and> finite Cl_C2 \<and> smaller_lits_are_false v gr_Cl_C2 S \<and> maximal_literal_is_unique v gr_rhs Cl_C2 L2 S \<eta>

goal (1 subgoal):
 1. \<forall>x. (\<exists>x'\<in>trms_ecl C2. occurs_in x (x' \<lhd> \<eta>)) \<longrightarrow> (x, v) \<in> trm_ord \<longrightarrow> trm_rep x S = x
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
\<forall>x. (\<exists>x'\<in>trms_ecl C2. occurs_in x (x' \<lhd> \<eta>)) \<longrightarrow> (x, v) \<in> trm_ord \<longrightarrow> trm_rep x S = x

goal (1 subgoal):
 1. \<exists>\<sigma>' u u' p v D L2. reduction L1 C \<sigma>' t s polarity L2 u u' p v D (same_values (\<lambda>t. trm_rep t S)) S \<sigma> \<and> variable_disjoint C D
[PROOF STEP]
from \<open>ground_clause gr_Cl_C2\<close> and \<open>gr_L2 \<in> gr_Cl_C2\<close>
[PROOF STATE]
proof (chain)
picking this:
ground_clause gr_Cl_C2
gr_L2 \<in> gr_Cl_C2
[PROOF STEP]
have "vars_of_lit gr_L2 = {}"
[PROOF STATE]
proof (prove)
using this:
ground_clause gr_Cl_C2
gr_L2 \<in> gr_Cl_C2

goal (1 subgoal):
 1. vars_of_lit gr_L2 = {}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
vars_of_lit gr_L2 = {}

goal (1 subgoal):
 1. \<exists>\<sigma>' u u' p v D L2. reduction L1 C \<sigma>' t s polarity L2 u u' p v D (same_values (\<lambda>t. trm_rep t S)) S \<sigma> \<and> variable_disjoint C D
[PROOF STEP]
from cv
[PROOF STATE]
proof (chain)
picking this:
candidate_values (trm_rep v S) C2 Cl_C2 gr_Cl_C2 gr_rhs gr_L2 L2 \<eta> lhs rhs v S
[PROOF STEP]
have "v = subst lhs \<eta>"
[PROOF STATE]
proof (prove)
using this:
candidate_values (trm_rep v S) C2 Cl_C2 gr_Cl_C2 gr_rhs gr_L2 L2 \<eta> lhs rhs v S

goal (1 subgoal):
 1. v = lhs \<lhd> \<eta>
[PROOF STEP]
unfolding candidate_values_def
[PROOF STATE]
proof (prove)
using this:
C2 \<in> S \<and> v \<notin> subst_set (trms_ecl C2) \<eta> \<and> trms_irreducible C2 \<eta> S v \<and> Cl_C2 = cl_ecl C2 \<and> (gr_rhs, v) \<in> trm_ord \<and> ((gr_rhs, v) \<in> trm_ord \<longrightarrow> trm_rep v S = trm_rep gr_rhs S) \<and> orient_lit_inst L2 lhs rhs pos \<eta> \<and> sel Cl_C2 = {} \<and> L2 \<in> Cl_C2 \<and> maximal_literal gr_L2 gr_Cl_C2 \<and> gr_L2 = subst_lit L2 \<eta> \<and> gr_Cl_C2 = subst_cl Cl_C2 \<eta> \<and> ground_clause gr_Cl_C2 \<and> v = lhs \<lhd> \<eta> \<and> gr_rhs = rhs \<lhd> \<eta> \<and> finite Cl_C2 \<and> smaller_lits_are_false v gr_Cl_C2 S \<and> maximal_literal_is_unique v gr_rhs Cl_C2 L2 S \<eta>

goal (1 subgoal):
 1. v = lhs \<lhd> \<eta>
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
v = lhs \<lhd> \<eta>

goal (1 subgoal):
 1. \<exists>\<sigma>' u u' p v D L2. reduction L1 C \<sigma>' t s polarity L2 u u' p v D (same_values (\<lambda>t. trm_rep t S)) S \<sigma> \<and> variable_disjoint C D
[PROOF STEP]
from cv
[PROOF STATE]
proof (chain)
picking this:
candidate_values (trm_rep v S) C2 Cl_C2 gr_Cl_C2 gr_rhs gr_L2 L2 \<eta> lhs rhs v S
[PROOF STEP]
have "gr_rhs = subst rhs \<eta>"
[PROOF STATE]
proof (prove)
using this:
candidate_values (trm_rep v S) C2 Cl_C2 gr_Cl_C2 gr_rhs gr_L2 L2 \<eta> lhs rhs v S

goal (1 subgoal):
 1. gr_rhs = rhs \<lhd> \<eta>
[PROOF STEP]
unfolding candidate_values_def
[PROOF STATE]
proof (prove)
using this:
C2 \<in> S \<and> v \<notin> subst_set (trms_ecl C2) \<eta> \<and> trms_irreducible C2 \<eta> S v \<and> Cl_C2 = cl_ecl C2 \<and> (gr_rhs, v) \<in> trm_ord \<and> ((gr_rhs, v) \<in> trm_ord \<longrightarrow> trm_rep v S = trm_rep gr_rhs S) \<and> orient_lit_inst L2 lhs rhs pos \<eta> \<and> sel Cl_C2 = {} \<and> L2 \<in> Cl_C2 \<and> maximal_literal gr_L2 gr_Cl_C2 \<and> gr_L2 = subst_lit L2 \<eta> \<and> gr_Cl_C2 = subst_cl Cl_C2 \<eta> \<and> ground_clause gr_Cl_C2 \<and> v = lhs \<lhd> \<eta> \<and> gr_rhs = rhs \<lhd> \<eta> \<and> finite Cl_C2 \<and> smaller_lits_are_false v gr_Cl_C2 S \<and> maximal_literal_is_unique v gr_rhs Cl_C2 L2 S \<eta>

goal (1 subgoal):
 1. gr_rhs = rhs \<lhd> \<eta>
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
gr_rhs = rhs \<lhd> \<eta>

goal (1 subgoal):
 1. \<exists>\<sigma>' u u' p v D L2. reduction L1 C \<sigma>' t s polarity L2 u u' p v D (same_values (\<lambda>t. trm_rep t S)) S \<sigma> \<and> variable_disjoint C D
[PROOF STEP]
let ?I = "(same_values (\<lambda>t. (trm_rep t S)))"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>\<sigma>' u u' p v D L2. reduction L1 C \<sigma>' t s polarity L2 u u' p v D (same_values (\<lambda>t. trm_rep t S)) S \<sigma> \<and> variable_disjoint C D
[PROOF STEP]
have no_fact: "\<not> equivalent_eq_exists lhs rhs Cl_C2 (same_values (\<lambda>t. trm_rep t S)) \<eta> L2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> equivalent_eq_exists lhs rhs Cl_C2 (same_values (\<lambda>t. trm_rep t S)) \<eta> L2
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. equivalent_eq_exists lhs rhs Cl_C2 (same_values (\<lambda>t. trm_rep t S)) \<eta> L2 \<Longrightarrow> False
[PROOF STEP]
assume "equivalent_eq_exists lhs rhs Cl_C2 (same_values (\<lambda>t. trm_rep t S)) \<eta> L2"
[PROOF STATE]
proof (state)
this:
equivalent_eq_exists lhs rhs Cl_C2 (same_values (\<lambda>t. trm_rep t S)) \<eta> L2

goal (1 subgoal):
 1. equivalent_eq_exists lhs rhs Cl_C2 (same_values (\<lambda>t. trm_rep t S)) \<eta> L2 \<Longrightarrow> False
[PROOF STEP]
from this
[PROOF STATE]
proof (chain)
picking this:
equivalent_eq_exists lhs rhs Cl_C2 (same_values (\<lambda>t. trm_rep t S)) \<eta> L2
[PROOF STEP]
have "\<exists>L\<in>Cl_C2 - {L2}.\<exists>u v. orient_lit_inst L u v pos \<eta> \<and>
           subst lhs \<eta> = subst u \<eta> \<and> same_values (\<lambda>t. trm_rep t S) (subst rhs \<eta>) (subst v \<eta>)"
[PROOF STATE]
proof (prove)
using this:
equivalent_eq_exists lhs rhs Cl_C2 (same_values (\<lambda>t. trm_rep t S)) \<eta> L2

goal (1 subgoal):
 1. \<exists>L\<in>Cl_C2 - {L2}. \<exists>u v. orient_lit_inst L u v pos \<eta> \<and> lhs \<lhd> \<eta> = u \<lhd> \<eta> \<and> same_values (\<lambda>t. trm_rep t S) (rhs \<lhd> \<eta>) (v \<lhd> \<eta>)
[PROOF STEP]
unfolding equivalent_eq_exists_def
[PROOF STATE]
proof (prove)
using this:
\<exists>L\<in>Cl_C2 - {L2}. \<exists>u v. orient_lit_inst L u v pos \<eta> \<and> lhs \<lhd> \<eta> = u \<lhd> \<eta> \<and> same_values (\<lambda>t. trm_rep t S) (rhs \<lhd> \<eta>) (v \<lhd> \<eta>)

goal (1 subgoal):
 1. \<exists>L\<in>Cl_C2 - {L2}. \<exists>u v. orient_lit_inst L u v pos \<eta> \<and> lhs \<lhd> \<eta> = u \<lhd> \<eta> \<and> same_values (\<lambda>t. trm_rep t S) (rhs \<lhd> \<eta>) (v \<lhd> \<eta>)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>L\<in>Cl_C2 - {L2}. \<exists>u v. orient_lit_inst L u v pos \<eta> \<and> lhs \<lhd> \<eta> = u \<lhd> \<eta> \<and> same_values (\<lambda>t. trm_rep t S) (rhs \<lhd> \<eta>) (v \<lhd> \<eta>)

goal (1 subgoal):
 1. equivalent_eq_exists lhs rhs Cl_C2 (same_values (\<lambda>t. trm_rep t S)) \<eta> L2 \<Longrightarrow> False
[PROOF STEP]
from this
[PROOF STATE]
proof (chain)
picking this:
\<exists>L\<in>Cl_C2 - {L2}. \<exists>u v. orient_lit_inst L u v pos \<eta> \<and> lhs \<lhd> \<eta> = u \<lhd> \<eta> \<and> same_values (\<lambda>t. trm_rep t S) (rhs \<lhd> \<eta>) (v \<lhd> \<eta>)
[PROOF STEP]
obtain M where "M\<in>Cl_C2 - {L2}" and e: "\<exists>u v. orient_lit_inst M u v pos \<eta> \<and>
           subst lhs \<eta> = subst u \<eta> \<and> same_values (\<lambda>t. trm_rep t S) (subst rhs \<eta>) (subst v \<eta>)"
[PROOF STATE]
proof (prove)
using this:
\<exists>L\<in>Cl_C2 - {L2}. \<exists>u v. orient_lit_inst L u v pos \<eta> \<and> lhs \<lhd> \<eta> = u \<lhd> \<eta> \<and> same_values (\<lambda>t. trm_rep t S) (rhs \<lhd> \<eta>) (v \<lhd> \<eta>)

goal (1 subgoal):
 1. (\<And>M. \<lbrakk>M \<in> Cl_C2 - {L2}; \<exists>u v. orient_lit_inst M u v pos \<eta> \<and> lhs \<lhd> \<eta> = u \<lhd> \<eta> \<and> same_values (\<lambda>t. trm_rep t S) (rhs \<lhd> \<eta>) (v \<lhd> \<eta>)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
M \<in> Cl_C2 - {L2}
\<exists>u v. orient_lit_inst M u v pos \<eta> \<and> lhs \<lhd> \<eta> = u \<lhd> \<eta> \<and> same_values (\<lambda>t. trm_rep t S) (rhs \<lhd> \<eta>) (v \<lhd> \<eta>)

goal (1 subgoal):
 1. equivalent_eq_exists lhs rhs Cl_C2 (same_values (\<lambda>t. trm_rep t S)) \<eta> L2 \<Longrightarrow> False
[PROOF STEP]
from e
[PROOF STATE]
proof (chain)
picking this:
\<exists>u v. orient_lit_inst M u v pos \<eta> \<and> lhs \<lhd> \<eta> = u \<lhd> \<eta> \<and> same_values (\<lambda>t. trm_rep t S) (rhs \<lhd> \<eta>) (v \<lhd> \<eta>)
[PROOF STEP]
obtain u' v' where "orient_lit_inst M u' v' pos \<eta>"
        and i: "subst lhs \<eta> = subst u' \<eta> \<and> same_values (\<lambda>t. trm_rep t S) (subst rhs \<eta>) (subst v' \<eta>)"
[PROOF STATE]
proof (prove)
using this:
\<exists>u v. orient_lit_inst M u v pos \<eta> \<and> lhs \<lhd> \<eta> = u \<lhd> \<eta> \<and> same_values (\<lambda>t. trm_rep t S) (rhs \<lhd> \<eta>) (v \<lhd> \<eta>)

goal (1 subgoal):
 1. (\<And>u' v'. \<lbrakk>orient_lit_inst M u' v' pos \<eta>; lhs \<lhd> \<eta> = u' \<lhd> \<eta> \<and> same_values (\<lambda>t. trm_rep t S) (rhs \<lhd> \<eta>) (v' \<lhd> \<eta>)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
orient_lit_inst M u' v' pos \<eta>
lhs \<lhd> \<eta> = u' \<lhd> \<eta> \<and> same_values (\<lambda>t. trm_rep t S) (rhs \<lhd> \<eta>) (v' \<lhd> \<eta>)

goal (1 subgoal):
 1. equivalent_eq_exists lhs rhs Cl_C2 (same_values (\<lambda>t. trm_rep t S)) \<eta> L2 \<Longrightarrow> False
[PROOF STEP]
from i
[PROOF STATE]
proof (chain)
picking this:
lhs \<lhd> \<eta> = u' \<lhd> \<eta> \<and> same_values (\<lambda>t. trm_rep t S) (rhs \<lhd> \<eta>) (v' \<lhd> \<eta>)
[PROOF STEP]
have "subst lhs \<eta> = subst u' \<eta>"
[PROOF STATE]
proof (prove)
using this:
lhs \<lhd> \<eta> = u' \<lhd> \<eta> \<and> same_values (\<lambda>t. trm_rep t S) (rhs \<lhd> \<eta>) (v' \<lhd> \<eta>)

goal (1 subgoal):
 1. lhs \<lhd> \<eta> = u' \<lhd> \<eta>
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
lhs \<lhd> \<eta> = u' \<lhd> \<eta>

goal (1 subgoal):
 1. equivalent_eq_exists lhs rhs Cl_C2 (same_values (\<lambda>t. trm_rep t S)) \<eta> L2 \<Longrightarrow> False
[PROOF STEP]
from i
[PROOF STATE]
proof (chain)
picking this:
lhs \<lhd> \<eta> = u' \<lhd> \<eta> \<and> same_values (\<lambda>t. trm_rep t S) (rhs \<lhd> \<eta>) (v' \<lhd> \<eta>)
[PROOF STEP]
have "trm_rep (subst rhs \<eta>) S = trm_rep (subst v' \<eta>) S"
[PROOF STATE]
proof (prove)
using this:
lhs \<lhd> \<eta> = u' \<lhd> \<eta> \<and> same_values (\<lambda>t. trm_rep t S) (rhs \<lhd> \<eta>) (v' \<lhd> \<eta>)

goal (1 subgoal):
 1. trm_rep (rhs \<lhd> \<eta>) S = trm_rep (v' \<lhd> \<eta>) S
[PROOF STEP]
unfolding same_values_def
[PROOF STATE]
proof (prove)
using this:
lhs \<lhd> \<eta> = u' \<lhd> \<eta> \<and> trm_rep (rhs \<lhd> \<eta>) S = trm_rep (v' \<lhd> \<eta>) S

goal (1 subgoal):
 1. trm_rep (rhs \<lhd> \<eta>) S = trm_rep (v' \<lhd> \<eta>) S
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
trm_rep (rhs \<lhd> \<eta>) S = trm_rep (v' \<lhd> \<eta>) S

goal (1 subgoal):
 1. equivalent_eq_exists lhs rhs Cl_C2 (same_values (\<lambda>t. trm_rep t S)) \<eta> L2 \<Longrightarrow> False
[PROOF STEP]
let ?u' = "(subst u' \<eta>)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. equivalent_eq_exists lhs rhs Cl_C2 (same_values (\<lambda>t. trm_rep t S)) \<eta> L2 \<Longrightarrow> False
[PROOF STEP]
let ?v' = "(subst v' \<eta>)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. equivalent_eq_exists lhs rhs Cl_C2 (same_values (\<lambda>t. trm_rep t S)) \<eta> L2 \<Longrightarrow> False
[PROOF STEP]
from \<open>orient_lit_inst M u' v' pos \<eta>\<close>
[PROOF STATE]
proof (chain)
picking this:
orient_lit_inst M u' v' pos \<eta>
[PROOF STEP]
have "orient_lit (subst_lit M \<eta>) ?u' ?v' pos"
[PROOF STATE]
proof (prove)
using this:
orient_lit_inst M u' v' pos \<eta>

goal (1 subgoal):
 1. orient_lit (subst_lit M \<eta>) (u' \<lhd> \<eta>) (v' \<lhd> \<eta>) pos
[PROOF STEP]
using lift_orient_lit
[PROOF STATE]
proof (prove)
using this:
orient_lit_inst M u' v' pos \<eta>
orient_lit_inst ?L ?t ?s ?p ?\<sigma> \<Longrightarrow> orient_lit (subst_lit ?L ?\<sigma>) (?t \<lhd> ?\<sigma>) (?s \<lhd> ?\<sigma>) ?p

goal (1 subgoal):
 1. orient_lit (subst_lit M \<eta>) (u' \<lhd> \<eta>) (v' \<lhd> \<eta>) pos
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
orient_lit (subst_lit M \<eta>) (u' \<lhd> \<eta>) (v' \<lhd> \<eta>) pos

goal (1 subgoal):
 1. equivalent_eq_exists lhs rhs Cl_C2 (same_values (\<lambda>t. trm_rep t S)) \<eta> L2 \<Longrightarrow> False
[PROOF STEP]
from \<open>orient_lit_inst L2 lhs rhs pos \<eta>\<close>
[PROOF STATE]
proof (chain)
picking this:
orient_lit_inst L2 lhs rhs pos \<eta>
[PROOF STEP]
have "orient_lit (subst_lit L2 \<eta>) (subst lhs \<eta>)
      (subst rhs \<eta>) pos"
[PROOF STATE]
proof (prove)
using this:
orient_lit_inst L2 lhs rhs pos \<eta>

goal (1 subgoal):
 1. orient_lit (subst_lit L2 \<eta>) (lhs \<lhd> \<eta>) (rhs \<lhd> \<eta>) pos
[PROOF STEP]
using lift_orient_lit
[PROOF STATE]
proof (prove)
using this:
orient_lit_inst L2 lhs rhs pos \<eta>
orient_lit_inst ?L ?t ?s ?p ?\<sigma> \<Longrightarrow> orient_lit (subst_lit ?L ?\<sigma>) (?t \<lhd> ?\<sigma>) (?s \<lhd> ?\<sigma>) ?p

goal (1 subgoal):
 1. orient_lit (subst_lit L2 \<eta>) (lhs \<lhd> \<eta>) (rhs \<lhd> \<eta>) pos
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
orient_lit (subst_lit L2 \<eta>) (lhs \<lhd> \<eta>) (rhs \<lhd> \<eta>) pos

goal (1 subgoal):
 1. equivalent_eq_exists lhs rhs Cl_C2 (same_values (\<lambda>t. trm_rep t S)) \<eta> L2 \<Longrightarrow> False
[PROOF STEP]
from \<open>orient_lit_inst M u' v' pos \<eta>\<close> and \<open>M \<in> (Cl_C2 - {L2})\<close> and
    \<open>gr_Cl_C2 = subst_cl Cl_C2 \<eta>\<close>
[PROOF STATE]
proof (chain)
picking this:
orient_lit_inst M u' v' pos \<eta>
M \<in> Cl_C2 - {L2}
gr_Cl_C2 = subst_cl Cl_C2 \<eta>
[PROOF STEP]
have "eq_occurs_in_cl ?u' ?v' (Cl_C2 - {L2}) \<eta>"
[PROOF STATE]
proof (prove)
using this:
orient_lit_inst M u' v' pos \<eta>
M \<in> Cl_C2 - {L2}
gr_Cl_C2 = subst_cl Cl_C2 \<eta>

goal (1 subgoal):
 1. eq_occurs_in_cl (u' \<lhd> \<eta>) (v' \<lhd> \<eta>) (Cl_C2 - {L2}) \<eta>
[PROOF STEP]
unfolding eq_occurs_in_cl_def
[PROOF STATE]
proof (prove)
using this:
orient_lit_inst M u' v' pos \<eta>
M \<in> Cl_C2 - {L2}
gr_Cl_C2 = subst_cl Cl_C2 \<eta>

goal (1 subgoal):
 1. \<exists>L t' s'. L \<in> Cl_C2 - {L2} \<and> orient_lit_inst L t' s' pos \<eta> \<and> u' \<lhd> \<eta> = t' \<lhd> \<eta> \<and> v' \<lhd> \<eta> = s' \<lhd> \<eta>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
eq_occurs_in_cl (u' \<lhd> \<eta>) (v' \<lhd> \<eta>) (Cl_C2 - {L2}) \<eta>

goal (1 subgoal):
 1. equivalent_eq_exists lhs rhs Cl_C2 (same_values (\<lambda>t. trm_rep t S)) \<eta> L2 \<Longrightarrow> False
[PROOF STEP]
from \<open>M\<in>Cl_C2 - {L2}\<close> and \<open>gr_Cl_C2 = subst_cl Cl_C2 \<eta>\<close>
[PROOF STATE]
proof (chain)
picking this:
M \<in> Cl_C2 - {L2}
gr_Cl_C2 = subst_cl Cl_C2 \<eta>
[PROOF STEP]
have "(subst_lit M \<eta>) \<in> (subst_cl (Cl_C2 - { L2 }) \<eta>)"
[PROOF STATE]
proof (prove)
using this:
M \<in> Cl_C2 - {L2}
gr_Cl_C2 = subst_cl Cl_C2 \<eta>

goal (1 subgoal):
 1. subst_lit M \<eta> \<in> subst_cl (Cl_C2 - {L2}) \<eta>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
subst_lit M \<eta> \<in> subst_cl (Cl_C2 - {L2}) \<eta>

goal (1 subgoal):
 1. equivalent_eq_exists lhs rhs Cl_C2 (same_values (\<lambda>t. trm_rep t S)) \<eta> L2 \<Longrightarrow> False
[PROOF STEP]
from \<open>M\<in>Cl_C2 - {L2}\<close> and \<open>gr_Cl_C2 = subst_cl Cl_C2 \<eta>\<close>
[PROOF STATE]
proof (chain)
picking this:
M \<in> Cl_C2 - {L2}
gr_Cl_C2 = subst_cl Cl_C2 \<eta>
[PROOF STEP]
have "(subst_lit M \<eta>) \<in> gr_Cl_C2"
[PROOF STATE]
proof (prove)
using this:
M \<in> Cl_C2 - {L2}
gr_Cl_C2 = subst_cl Cl_C2 \<eta>

goal (1 subgoal):
 1. subst_lit M \<eta> \<in> gr_Cl_C2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
subst_lit M \<eta> \<in> gr_Cl_C2

goal (1 subgoal):
 1. equivalent_eq_exists lhs rhs Cl_C2 (same_values (\<lambda>t. trm_rep t S)) \<eta> L2 \<Longrightarrow> False
[PROOF STEP]
from \<open>vars_of_lit gr_L2 = {}\<close> and \<open>gr_L2 = subst_lit L2 \<eta>\<close>
      \<open>orient_lit (subst_lit L2 \<eta>) (subst lhs \<eta>) (subst rhs \<eta>) pos\<close>
[PROOF STATE]
proof (chain)
picking this:
vars_of_lit gr_L2 = {}
gr_L2 = subst_lit L2 \<eta>
orient_lit (subst_lit L2 \<eta>) (lhs \<lhd> \<eta>) (rhs \<lhd> \<eta>) pos
[PROOF STEP]
have "vars_of (subst rhs \<eta>) = {}"
[PROOF STATE]
proof (prove)
using this:
vars_of_lit gr_L2 = {}
gr_L2 = subst_lit L2 \<eta>
orient_lit (subst_lit L2 \<eta>) (lhs \<lhd> \<eta>) (rhs \<lhd> \<eta>) pos

goal (1 subgoal):
 1. vars_of (rhs \<lhd> \<eta>) = {}
[PROOF STEP]
using orient_lit_vars
[PROOF STATE]
proof (prove)
using this:
vars_of_lit gr_L2 = {}
gr_L2 = subst_lit L2 \<eta>
orient_lit (subst_lit L2 \<eta>) (lhs \<lhd> \<eta>) (rhs \<lhd> \<eta>) pos
orient_lit ?L ?t ?s ?p \<Longrightarrow> vars_of ?t \<subseteq> vars_of_lit ?L \<and> vars_of ?s \<subseteq> vars_of_lit ?L

goal (1 subgoal):
 1. vars_of (rhs \<lhd> \<eta>) = {}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
vars_of (rhs \<lhd> \<eta>) = {}

goal (1 subgoal):
 1. equivalent_eq_exists lhs rhs Cl_C2 (same_values (\<lambda>t. trm_rep t S)) \<eta> L2 \<Longrightarrow> False
[PROOF STEP]
from \<open>ground_clause gr_Cl_C2\<close> and \<open>(subst_lit M \<eta>) \<in> gr_Cl_C2\<close>
[PROOF STATE]
proof (chain)
picking this:
ground_clause gr_Cl_C2
subst_lit M \<eta> \<in> gr_Cl_C2
[PROOF STEP]
have "vars_of_lit (subst_lit M \<eta>) = {}"
[PROOF STATE]
proof (prove)
using this:
ground_clause gr_Cl_C2
subst_lit M \<eta> \<in> gr_Cl_C2

goal (1 subgoal):
 1. vars_of_lit (subst_lit M \<eta>) = {}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
vars_of_lit (subst_lit M \<eta>) = {}

goal (1 subgoal):
 1. equivalent_eq_exists lhs rhs Cl_C2 (same_values (\<lambda>t. trm_rep t S)) \<eta> L2 \<Longrightarrow> False
[PROOF STEP]
from this and \<open>orient_lit (subst_lit M \<eta>) ?u' ?v' pos\<close>
[PROOF STATE]
proof (chain)
picking this:
vars_of_lit (subst_lit M \<eta>) = {}
orient_lit (subst_lit M \<eta>) (u' \<lhd> \<eta>) (v' \<lhd> \<eta>) pos
[PROOF STEP]
have "vars_of ?v' = {}"
[PROOF STATE]
proof (prove)
using this:
vars_of_lit (subst_lit M \<eta>) = {}
orient_lit (subst_lit M \<eta>) (u' \<lhd> \<eta>) (v' \<lhd> \<eta>) pos

goal (1 subgoal):
 1. vars_of (v' \<lhd> \<eta>) = {}
[PROOF STEP]
using orient_lit_vars
[PROOF STATE]
proof (prove)
using this:
vars_of_lit (subst_lit M \<eta>) = {}
orient_lit (subst_lit M \<eta>) (u' \<lhd> \<eta>) (v' \<lhd> \<eta>) pos
orient_lit ?L ?t ?s ?p \<Longrightarrow> vars_of ?t \<subseteq> vars_of_lit ?L \<and> vars_of ?s \<subseteq> vars_of_lit ?L

goal (1 subgoal):
 1. vars_of (v' \<lhd> \<eta>) = {}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
vars_of (v' \<lhd> \<eta>) = {}

goal (1 subgoal):
 1. equivalent_eq_exists lhs rhs Cl_C2 (same_values (\<lambda>t. trm_rep t S)) \<eta> L2 \<Longrightarrow> False
[PROOF STEP]
from \<open>maximal_literal gr_L2 gr_Cl_C2\<close> and \<open>(subst_lit M \<eta>) \<in> gr_Cl_C2\<close>
[PROOF STATE]
proof (chain)
picking this:
maximal_literal gr_L2 gr_Cl_C2
subst_lit M \<eta> \<in> gr_Cl_C2
[PROOF STEP]
have "(gr_L2,(subst_lit M \<eta>)) \<notin> lit_ord"
[PROOF STATE]
proof (prove)
using this:
maximal_literal gr_L2 gr_Cl_C2
subst_lit M \<eta> \<in> gr_Cl_C2

goal (1 subgoal):
 1. (gr_L2, subst_lit M \<eta>) \<notin> lit_ord
[PROOF STEP]
unfolding maximal_literal_def
[PROOF STATE]
proof (prove)
using this:
\<forall>x. x \<in> gr_Cl_C2 \<longrightarrow> (gr_L2, x) \<notin> lit_ord
subst_lit M \<eta> \<in> gr_Cl_C2

goal (1 subgoal):
 1. (gr_L2, subst_lit M \<eta>) \<notin> lit_ord
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(gr_L2, subst_lit M \<eta>) \<notin> lit_ord

goal (1 subgoal):
 1. equivalent_eq_exists lhs rhs Cl_C2 (same_values (\<lambda>t. trm_rep t S)) \<eta> L2 \<Longrightarrow> False
[PROOF STEP]
from this and \<open>orient_lit (subst_lit M \<eta>) ?u' ?v' pos\<close>
      and \<open>orient_lit (subst_lit L2 \<eta>) (subst lhs \<eta>) (subst rhs \<eta>) pos\<close>
      and \<open>subst lhs \<eta> = subst u' \<eta>\<close>
      and \<open>vars_of_lit gr_L2 = {}\<close> and  \<open>vars_of_lit (subst_lit M \<eta>) = {}\<close>
      and \<open>gr_L2 = subst_lit L2 \<eta>\<close>
[PROOF STATE]
proof (chain)
picking this:
(gr_L2, subst_lit M \<eta>) \<notin> lit_ord
orient_lit (subst_lit M \<eta>) (u' \<lhd> \<eta>) (v' \<lhd> \<eta>) pos
orient_lit (subst_lit L2 \<eta>) (lhs \<lhd> \<eta>) (rhs \<lhd> \<eta>) pos
lhs \<lhd> \<eta> = u' \<lhd> \<eta>
vars_of_lit gr_L2 = {}
vars_of_lit (subst_lit M \<eta>) = {}
gr_L2 = subst_lit L2 \<eta>
[PROOF STEP]
have "((subst rhs \<eta>),?v') \<notin>  trm_ord"
[PROOF STATE]
proof (prove)
using this:
(gr_L2, subst_lit M \<eta>) \<notin> lit_ord
orient_lit (subst_lit M \<eta>) (u' \<lhd> \<eta>) (v' \<lhd> \<eta>) pos
orient_lit (subst_lit L2 \<eta>) (lhs \<lhd> \<eta>) (rhs \<lhd> \<eta>) pos
lhs \<lhd> \<eta> = u' \<lhd> \<eta>
vars_of_lit gr_L2 = {}
vars_of_lit (subst_lit M \<eta>) = {}
gr_L2 = subst_lit L2 \<eta>

goal (1 subgoal):
 1. (rhs \<lhd> \<eta>, v' \<lhd> \<eta>) \<notin> trm_ord
[PROOF STEP]
using lit_ord_rhs
[PROOF STATE]
proof (prove)
using this:
(gr_L2, subst_lit M \<eta>) \<notin> lit_ord
orient_lit (subst_lit M \<eta>) (u' \<lhd> \<eta>) (v' \<lhd> \<eta>) pos
orient_lit (subst_lit L2 \<eta>) (lhs \<lhd> \<eta>) (rhs \<lhd> \<eta>) pos
lhs \<lhd> \<eta> = u' \<lhd> \<eta>
vars_of_lit gr_L2 = {}
vars_of_lit (subst_lit M \<eta>) = {}
gr_L2 = subst_lit L2 \<eta>
\<lbrakk>(?t1.0, ?t2.0) \<in> trm_ord; orient_lit ?x1.0 ?s ?t1.0 ?p; orient_lit ?x2.0 ?s ?t2.0 ?p; vars_of_lit ?x1.0 = {}; vars_of_lit ?x2.0 = {}\<rbrakk> \<Longrightarrow> (?x1.0, ?x2.0) \<in> lit_ord

goal (1 subgoal):
 1. (rhs \<lhd> \<eta>, v' \<lhd> \<eta>) \<notin> trm_ord
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(rhs \<lhd> \<eta>, v' \<lhd> \<eta>) \<notin> trm_ord

goal (1 subgoal):
 1. equivalent_eq_exists lhs rhs Cl_C2 (same_values (\<lambda>t. trm_rep t S)) \<eta> L2 \<Longrightarrow> False
[PROOF STEP]
from this and \<open>vars_of ?v' = {}\<close> and \<open>vars_of (subst rhs \<eta>) = {}\<close>
[PROOF STATE]
proof (chain)
picking this:
(rhs \<lhd> \<eta>, v' \<lhd> \<eta>) \<notin> trm_ord
vars_of (v' \<lhd> \<eta>) = {}
vars_of (rhs \<lhd> \<eta>) = {}
[PROOF STEP]
have "?v' = (subst rhs \<eta>) \<or> (?v',(subst rhs \<eta>)) \<in>  trm_ord"
[PROOF STATE]
proof (prove)
using this:
(rhs \<lhd> \<eta>, v' \<lhd> \<eta>) \<notin> trm_ord
vars_of (v' \<lhd> \<eta>) = {}
vars_of (rhs \<lhd> \<eta>) = {}

goal (1 subgoal):
 1. v' \<lhd> \<eta> = rhs \<lhd> \<eta> \<or> (v' \<lhd> \<eta>, rhs \<lhd> \<eta>) \<in> trm_ord
[PROOF STEP]
using trm_ord_ground_total
[PROOF STATE]
proof (prove)
using this:
(rhs \<lhd> \<eta>, v' \<lhd> \<eta>) \<notin> trm_ord
vars_of (v' \<lhd> \<eta>) = {}
vars_of (rhs \<lhd> \<eta>) = {}
\<forall>x y. ground_term x \<longrightarrow> ground_term y \<longrightarrow> x \<noteq> y \<longrightarrow> (x, y) \<in> trm_ord \<or> (y, x) \<in> trm_ord

goal (1 subgoal):
 1. v' \<lhd> \<eta> = rhs \<lhd> \<eta> \<or> (v' \<lhd> \<eta>, rhs \<lhd> \<eta>) \<in> trm_ord
[PROOF STEP]
unfolding ground_term_def
[PROOF STATE]
proof (prove)
using this:
(rhs \<lhd> \<eta>, v' \<lhd> \<eta>) \<notin> trm_ord
vars_of (v' \<lhd> \<eta>) = {}
vars_of (rhs \<lhd> \<eta>) = {}
\<forall>x y. vars_of x = {} \<longrightarrow> vars_of y = {} \<longrightarrow> x \<noteq> y \<longrightarrow> (x, y) \<in> trm_ord \<or> (y, x) \<in> trm_ord

goal (1 subgoal):
 1. v' \<lhd> \<eta> = rhs \<lhd> \<eta> \<or> (v' \<lhd> \<eta>, rhs \<lhd> \<eta>) \<in> trm_ord
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
v' \<lhd> \<eta> = rhs \<lhd> \<eta> \<or> (v' \<lhd> \<eta>, rhs \<lhd> \<eta>) \<in> trm_ord

goal (1 subgoal):
 1. equivalent_eq_exists lhs rhs Cl_C2 (same_values (\<lambda>t. trm_rep t S)) \<eta> L2 \<Longrightarrow> False
[PROOF STEP]
from this and \<open>(gr_rhs,v) \<in> trm_ord\<close> and \<open>gr_rhs = subst rhs \<eta>\<close>
[PROOF STATE]
proof (chain)
picking this:
v' \<lhd> \<eta> = rhs \<lhd> \<eta> \<or> (v' \<lhd> \<eta>, rhs \<lhd> \<eta>) \<in> trm_ord
(gr_rhs, v) \<in> trm_ord
gr_rhs = rhs \<lhd> \<eta>
[PROOF STEP]
have
     "(?v',v) \<in> trm_ord"
[PROOF STATE]
proof (prove)
using this:
v' \<lhd> \<eta> = rhs \<lhd> \<eta> \<or> (v' \<lhd> \<eta>, rhs \<lhd> \<eta>) \<in> trm_ord
(gr_rhs, v) \<in> trm_ord
gr_rhs = rhs \<lhd> \<eta>

goal (1 subgoal):
 1. (v' \<lhd> \<eta>, v) \<in> trm_ord
[PROOF STEP]
using trm_ord_trans
[PROOF STATE]
proof (prove)
using this:
v' \<lhd> \<eta> = rhs \<lhd> \<eta> \<or> (v' \<lhd> \<eta>, rhs \<lhd> \<eta>) \<in> trm_ord
(gr_rhs, v) \<in> trm_ord
gr_rhs = rhs \<lhd> \<eta>
trans trm_ord

goal (1 subgoal):
 1. (v' \<lhd> \<eta>, v) \<in> trm_ord
[PROOF STEP]
unfolding trans_def
[PROOF STATE]
proof (prove)
using this:
v' \<lhd> \<eta> = rhs \<lhd> \<eta> \<or> (v' \<lhd> \<eta>, rhs \<lhd> \<eta>) \<in> trm_ord
(gr_rhs, v) \<in> trm_ord
gr_rhs = rhs \<lhd> \<eta>
\<forall>x y z. (x, y) \<in> trm_ord \<longrightarrow> (y, z) \<in> trm_ord \<longrightarrow> (x, z) \<in> trm_ord

goal (1 subgoal):
 1. (v' \<lhd> \<eta>, v) \<in> trm_ord
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(v' \<lhd> \<eta>, v) \<in> trm_ord

goal (1 subgoal):
 1. equivalent_eq_exists lhs rhs Cl_C2 (same_values (\<lambda>t. trm_rep t S)) \<eta> L2 \<Longrightarrow> False
[PROOF STEP]
from cv
[PROOF STATE]
proof (chain)
picking this:
candidate_values (trm_rep v S) C2 Cl_C2 gr_Cl_C2 gr_rhs gr_L2 L2 \<eta> lhs rhs v S
[PROOF STEP]
have "maximal_literal_is_unique v gr_rhs Cl_C2 L2 S \<eta>"
[PROOF STATE]
proof (prove)
using this:
candidate_values (trm_rep v S) C2 Cl_C2 gr_Cl_C2 gr_rhs gr_L2 L2 \<eta> lhs rhs v S

goal (1 subgoal):
 1. maximal_literal_is_unique v gr_rhs Cl_C2 L2 S \<eta>
[PROOF STEP]
unfolding candidate_values_def
[PROOF STATE]
proof (prove)
using this:
C2 \<in> S \<and> v \<notin> subst_set (trms_ecl C2) \<eta> \<and> trms_irreducible C2 \<eta> S v \<and> Cl_C2 = cl_ecl C2 \<and> (gr_rhs, v) \<in> trm_ord \<and> ((gr_rhs, v) \<in> trm_ord \<longrightarrow> trm_rep v S = trm_rep gr_rhs S) \<and> orient_lit_inst L2 lhs rhs pos \<eta> \<and> sel Cl_C2 = {} \<and> L2 \<in> Cl_C2 \<and> maximal_literal gr_L2 gr_Cl_C2 \<and> gr_L2 = subst_lit L2 \<eta> \<and> gr_Cl_C2 = subst_cl Cl_C2 \<eta> \<and> ground_clause gr_Cl_C2 \<and> v = lhs \<lhd> \<eta> \<and> gr_rhs = rhs \<lhd> \<eta> \<and> finite Cl_C2 \<and> smaller_lits_are_false v gr_Cl_C2 S \<and> maximal_literal_is_unique v gr_rhs Cl_C2 L2 S \<eta>

goal (1 subgoal):
 1. maximal_literal_is_unique v gr_rhs Cl_C2 L2 S \<eta>
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
maximal_literal_is_unique v gr_rhs Cl_C2 L2 S \<eta>

goal (1 subgoal):
 1. equivalent_eq_exists lhs rhs Cl_C2 (same_values (\<lambda>t. trm_rep t S)) \<eta> L2 \<Longrightarrow> False
[PROOF STEP]
from \<open>orient_lit_inst M u' v' pos \<eta>\<close>
[PROOF STATE]
proof (chain)
picking this:
orient_lit_inst M u' v' pos \<eta>
[PROOF STEP]
have "((subst u' \<eta>),(subst v' \<eta>)) \<notin> trm_ord"
[PROOF STATE]
proof (prove)
using this:
orient_lit_inst M u' v' pos \<eta>

goal (1 subgoal):
 1. (u' \<lhd> \<eta>, v' \<lhd> \<eta>) \<notin> trm_ord
[PROOF STEP]
unfolding orient_lit_inst_def
[PROOF STATE]
proof (prove)
using this:
(M = Pos (Eq u' v') \<or> M = Pos (Eq v' u')) \<and> (u' \<lhd> \<eta>, v' \<lhd> \<eta>) \<notin> trm_ord \<and> pos = pos \<or> (M = Neg (Eq u' v') \<or> M = Neg (Eq v' u')) \<and> (u' \<lhd> \<eta>, v' \<lhd> \<eta>) \<notin> trm_ord \<and> pos = neg

goal (1 subgoal):
 1. (u' \<lhd> \<eta>, v' \<lhd> \<eta>) \<notin> trm_ord
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(u' \<lhd> \<eta>, v' \<lhd> \<eta>) \<notin> trm_ord

goal (1 subgoal):
 1. equivalent_eq_exists lhs rhs Cl_C2 (same_values (\<lambda>t. trm_rep t S)) \<eta> L2 \<Longrightarrow> False
[PROOF STEP]
have "trm_rep gr_rhs S \<noteq> trm_rep (subst v' \<eta>) S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. trm_rep gr_rhs S \<noteq> trm_rep (v' \<lhd> \<eta>) S
[PROOF STEP]
by (metis \<open>(subst v' \<eta>, v) \<in> trm_ord\<close> \<open>(gr_rhs, v) \<in> trm_ord\<close>
          \<open>subst lhs \<eta> = subst u' \<eta>\<close>
          \<open>eq_occurs_in_cl (subst u' \<eta>) (subst v' \<eta>) (Cl_C2 - {L2}) \<eta>\<close>
          \<open>maximal_literal_is_unique v gr_rhs Cl_C2 L2 S \<eta>\<close> \<open>v = subst lhs \<eta>\<close>
            maximal_literal_is_unique_def)
[PROOF STATE]
proof (state)
this:
trm_rep gr_rhs S \<noteq> trm_rep (v' \<lhd> \<eta>) S

goal (1 subgoal):
 1. equivalent_eq_exists lhs rhs Cl_C2 (same_values (\<lambda>t. trm_rep t S)) \<eta> L2 \<Longrightarrow> False
[PROOF STEP]
from this and \<open>trm_rep (subst rhs \<eta>) S = trm_rep (subst v' \<eta>) S\<close>
      and \<open>gr_rhs = (subst rhs \<eta>)\<close>
[PROOF STATE]
proof (chain)
picking this:
trm_rep gr_rhs S \<noteq> trm_rep (v' \<lhd> \<eta>) S
trm_rep (rhs \<lhd> \<eta>) S = trm_rep (v' \<lhd> \<eta>) S
gr_rhs = rhs \<lhd> \<eta>
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
trm_rep gr_rhs S \<noteq> trm_rep (v' \<lhd> \<eta>) S
trm_rep (rhs \<lhd> \<eta>) S = trm_rep (v' \<lhd> \<eta>) S
gr_rhs = rhs \<lhd> \<eta>

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<not> equivalent_eq_exists lhs rhs Cl_C2 (same_values (\<lambda>t. trm_rep t S)) \<eta> L2

goal (1 subgoal):
 1. \<exists>\<sigma>' u u' p v D L2. reduction L1 C \<sigma>' t s polarity L2 u u' p v D (same_values (\<lambda>t. trm_rep t S)) S \<sigma> \<and> variable_disjoint C D
[PROOF STEP]
from  this \<open>gr_Cl_C2 = subst_cl Cl_C2 \<eta>\<close>
   and  \<open>gr_L2 = subst_lit L2 \<eta>\<close>
   and \<open>smaller_lits_are_false v gr_Cl_C2 S\<close> and assms(9) and \<open>orient_lit_inst L2 lhs rhs pos \<eta>\<close>
   and \<open>maximal_literal gr_L2 gr_Cl_C2\<close>
   and \<open>ground_clause gr_Cl_C2\<close>
   and \<open>gr_L2 \<in> gr_Cl_C2\<close> and \<open>v = subst lhs \<eta>\<close> \<open>gr_rhs = subst rhs \<eta>\<close>
   and \<open>trm_rep v S = trm_rep gr_rhs S\<close>
[PROOF STATE]
proof (chain)
picking this:
\<not> equivalent_eq_exists lhs rhs Cl_C2 (same_values (\<lambda>t. trm_rep t S)) \<eta> L2
gr_Cl_C2 = subst_cl Cl_C2 \<eta>
gr_L2 = subst_lit L2 \<eta>
smaller_lits_are_false v gr_Cl_C2 S
fo_interpretation (same_values (\<lambda>t. trm_rep t S))
orient_lit_inst L2 lhs rhs pos \<eta>
maximal_literal gr_L2 gr_Cl_C2
ground_clause gr_Cl_C2
gr_L2 \<in> gr_Cl_C2
v = lhs \<lhd> \<eta>
gr_rhs = rhs \<lhd> \<eta>
trm_rep v S = trm_rep gr_rhs S
[PROOF STEP]
have "(\<not> validate_ground_clause ?I (subst_cl ( Cl_C2 - { L2 } ) \<eta>))"
[PROOF STATE]
proof (prove)
using this:
\<not> equivalent_eq_exists lhs rhs Cl_C2 (same_values (\<lambda>t. trm_rep t S)) \<eta> L2
gr_Cl_C2 = subst_cl Cl_C2 \<eta>
gr_L2 = subst_lit L2 \<eta>
smaller_lits_are_false v gr_Cl_C2 S
fo_interpretation (same_values (\<lambda>t. trm_rep t S))
orient_lit_inst L2 lhs rhs pos \<eta>
maximal_literal gr_L2 gr_Cl_C2
ground_clause gr_Cl_C2
gr_L2 \<in> gr_Cl_C2
v = lhs \<lhd> \<eta>
gr_rhs = rhs \<lhd> \<eta>
trm_rep v S = trm_rep gr_rhs S

goal (1 subgoal):
 1. \<not> validate_ground_clause (same_values (\<lambda>t. trm_rep t S)) (subst_cl (Cl_C2 - {L2}) \<eta>)
[PROOF STEP]
using if_all_smaller_are_false_then_cl_not_valid [of lhs \<eta> "Cl_C2" S L2 rhs]
[PROOF STATE]
proof (prove)
using this:
\<not> equivalent_eq_exists lhs rhs Cl_C2 (same_values (\<lambda>t. trm_rep t S)) \<eta> L2
gr_Cl_C2 = subst_cl Cl_C2 \<eta>
gr_L2 = subst_lit L2 \<eta>
smaller_lits_are_false v gr_Cl_C2 S
fo_interpretation (same_values (\<lambda>t. trm_rep t S))
orient_lit_inst L2 lhs rhs pos \<eta>
maximal_literal gr_L2 gr_Cl_C2
ground_clause gr_Cl_C2
gr_L2 \<in> gr_Cl_C2
v = lhs \<lhd> \<eta>
gr_rhs = rhs \<lhd> \<eta>
trm_rep v S = trm_rep gr_rhs S
\<lbrakk>smaller_lits_are_false (lhs \<lhd> \<eta>) (subst_cl Cl_C2 \<eta>) S; fo_interpretation (same_values (\<lambda>t. trm_rep t S)); orient_lit_inst L2 lhs rhs pos \<eta>; maximal_literal (subst_lit L2 \<eta>) (subst_cl Cl_C2 \<eta>); ground_clause (subst_cl Cl_C2 \<eta>); subst_lit L2 \<eta> \<in> subst_cl Cl_C2 \<eta>; \<not> equivalent_eq_exists lhs rhs Cl_C2 (same_values (\<lambda>t. trm_rep t S)) \<eta> L2; trm_rep (lhs \<lhd> \<eta>) S = trm_rep (rhs \<lhd> \<eta>) S\<rbrakk> \<Longrightarrow> \<not> validate_ground_clause (same_values (\<lambda>t. trm_rep t S)) (subst_cl (Cl_C2 - {L2}) \<eta>)

goal (1 subgoal):
 1. \<not> validate_ground_clause (same_values (\<lambda>t. trm_rep t S)) (subst_cl (Cl_C2 - {L2}) \<eta>)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<not> validate_ground_clause (same_values (\<lambda>t. trm_rep t S)) (subst_cl (Cl_C2 - {L2}) \<eta>)

goal (1 subgoal):
 1. \<exists>\<sigma>' u u' p v D L2. reduction L1 C \<sigma>' t s polarity L2 u u' p v D (same_values (\<lambda>t. trm_rep t S)) S \<sigma> \<and> variable_disjoint C D
[PROOF STEP]
text \<open>We fuse the substitutions @{term "\<sigma>"} and @{term "\<eta>"} so that the superposition rule
can be applied:\<close>
[PROOF STATE]
proof (state)
this:
\<not> validate_ground_clause (same_values (\<lambda>t. trm_rep t S)) (subst_cl (Cl_C2 - {L2}) \<eta>)

goal (1 subgoal):
 1. \<exists>\<sigma>' u u' p v D L2. reduction L1 C \<sigma>' t s polarity L2 u u' p v D (same_values (\<lambda>t. trm_rep t S)) S \<sigma> \<and> variable_disjoint C D
[PROOF STEP]
from \<open>ground_clause (subst_cl (cl_ecl C) \<sigma>)\<close>
[PROOF STATE]
proof (chain)
picking this:
ground_clause (subst_cl (cl_ecl C) \<sigma>)
[PROOF STEP]
have "ground_on (vars_of_cl (cl_ecl C)) \<sigma>"
[PROOF STATE]
proof (prove)
using this:
ground_clause (subst_cl (cl_ecl C) \<sigma>)

goal (1 subgoal):
 1. ground_on (vars_of_cl (cl_ecl C)) \<sigma>
[PROOF STEP]
using ground_clauses_and_ground_substs
[PROOF STATE]
proof (prove)
using this:
ground_clause (subst_cl (cl_ecl C) \<sigma>)
ground_clause (subst_cl ?C ?\<sigma>) \<Longrightarrow> ground_on (vars_of_cl ?C) ?\<sigma>

goal (1 subgoal):
 1. ground_on (vars_of_cl (cl_ecl C)) \<sigma>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
ground_on (vars_of_cl (cl_ecl C)) \<sigma>

goal (1 subgoal):
 1. \<exists>\<sigma>' u u' p v D L2. reduction L1 C \<sigma>' t s polarity L2 u u' p v D (same_values (\<lambda>t. trm_rep t S)) S \<sigma> \<and> variable_disjoint C D
[PROOF STEP]
from \<open>finite (vars_of_cl (cl_ecl C))\<close> \<open>(vars_of_cl (cl_ecl C) \<inter> vars_of_cl (cl_ecl C2)) = {}\<close>
    \<open>ground_on (vars_of_cl (cl_ecl C)) \<sigma>\<close>
[PROOF STATE]
proof (chain)
picking this:
finite (vars_of_cl (cl_ecl C))
vars_of_cl (cl_ecl C) \<inter> vars_of_cl (cl_ecl C2) = {}
ground_on (vars_of_cl (cl_ecl C)) \<sigma>
[PROOF STEP]
obtain \<sigma>' where
      "coincide_on \<sigma>' \<sigma> (vars_of_cl (cl_ecl C))" and "coincide_on \<sigma>' \<eta> (vars_of_cl (cl_ecl C2))"
[PROOF STATE]
proof (prove)
using this:
finite (vars_of_cl (cl_ecl C))
vars_of_cl (cl_ecl C) \<inter> vars_of_cl (cl_ecl C2) = {}
ground_on (vars_of_cl (cl_ecl C)) \<sigma>

goal (1 subgoal):
 1. (\<And>\<sigma>'. \<lbrakk>coincide_on \<sigma>' \<sigma> (vars_of_cl (cl_ecl C)); coincide_on \<sigma>' \<eta> (vars_of_cl (cl_ecl C2))\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using combine_substs [of "(vars_of_cl (cl_ecl C))" "(vars_of_cl (cl_ecl C2))" \<sigma> \<eta>]
[PROOF STATE]
proof (prove)
using this:
finite (vars_of_cl (cl_ecl C))
vars_of_cl (cl_ecl C) \<inter> vars_of_cl (cl_ecl C2) = {}
ground_on (vars_of_cl (cl_ecl C)) \<sigma>
\<lbrakk>finite (vars_of_cl (cl_ecl C)); vars_of_cl (cl_ecl C) \<inter> vars_of_cl (cl_ecl C2) = {}; ground_on (vars_of_cl (cl_ecl C)) \<sigma>\<rbrakk> \<Longrightarrow> \<exists>\<sigma>'. coincide_on \<sigma>' \<sigma> (vars_of_cl (cl_ecl C)) \<and> coincide_on \<sigma>' \<eta> (vars_of_cl (cl_ecl C2))

goal (1 subgoal):
 1. (\<And>\<sigma>'. \<lbrakk>coincide_on \<sigma>' \<sigma> (vars_of_cl (cl_ecl C)); coincide_on \<sigma>' \<eta> (vars_of_cl (cl_ecl C2))\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
coincide_on \<sigma>' \<sigma> (vars_of_cl (cl_ecl C))
coincide_on \<sigma>' \<eta> (vars_of_cl (cl_ecl C2))

goal (1 subgoal):
 1. \<exists>\<sigma>' u u' p v D L2. reduction L1 C \<sigma>' t s polarity L2 u u' p v D (same_values (\<lambda>t. trm_rep t S)) S \<sigma> \<and> variable_disjoint C D
[PROOF STEP]
from \<open>coincide_on \<sigma>' \<sigma> (vars_of_cl (cl_ecl C))\<close>
[PROOF STATE]
proof (chain)
picking this:
coincide_on \<sigma>' \<sigma> (vars_of_cl (cl_ecl C))
[PROOF STEP]
have "coincide_on \<sigma> \<sigma>' (vars_of_cl (cl_ecl C))"
[PROOF STATE]
proof (prove)
using this:
coincide_on \<sigma>' \<sigma> (vars_of_cl (cl_ecl C))

goal (1 subgoal):
 1. coincide_on \<sigma> \<sigma>' (vars_of_cl (cl_ecl C))
[PROOF STEP]
using coincide_sym
[PROOF STATE]
proof (prove)
using this:
coincide_on \<sigma>' \<sigma> (vars_of_cl (cl_ecl C))
coincide_on ?\<sigma> ?\<eta> ?V \<Longrightarrow> coincide_on ?\<eta> ?\<sigma> ?V

goal (1 subgoal):
 1. coincide_on \<sigma> \<sigma>' (vars_of_cl (cl_ecl C))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
coincide_on \<sigma> \<sigma>' (vars_of_cl (cl_ecl C))

goal (1 subgoal):
 1. \<exists>\<sigma>' u u' p v D L2. reduction L1 C \<sigma>' t s polarity L2 u u' p v D (same_values (\<lambda>t. trm_rep t S)) S \<sigma> \<and> variable_disjoint C D
[PROOF STEP]
from \<open>coincide_on \<sigma>' \<eta> (vars_of_cl (cl_ecl C2))\<close>
[PROOF STATE]
proof (chain)
picking this:
coincide_on \<sigma>' \<eta> (vars_of_cl (cl_ecl C2))
[PROOF STEP]
have "coincide_on \<eta> \<sigma>' (vars_of_cl (cl_ecl C2))"
[PROOF STATE]
proof (prove)
using this:
coincide_on \<sigma>' \<eta> (vars_of_cl (cl_ecl C2))

goal (1 subgoal):
 1. coincide_on \<eta> \<sigma>' (vars_of_cl (cl_ecl C2))
[PROOF STEP]
using coincide_sym
[PROOF STATE]
proof (prove)
using this:
coincide_on \<sigma>' \<eta> (vars_of_cl (cl_ecl C2))
coincide_on ?\<sigma> ?\<eta> ?V \<Longrightarrow> coincide_on ?\<eta> ?\<sigma> ?V

goal (1 subgoal):
 1. coincide_on \<eta> \<sigma>' (vars_of_cl (cl_ecl C2))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
coincide_on \<eta> \<sigma>' (vars_of_cl (cl_ecl C2))

goal (1 subgoal):
 1. \<exists>\<sigma>' u u' p v D L2. reduction L1 C \<sigma>' t s polarity L2 u u' p v D (same_values (\<lambda>t. trm_rep t S)) S \<sigma> \<and> variable_disjoint C D
[PROOF STEP]
from \<open>eligible_literal L1 C \<sigma>\<close> \<open>L1 \<in> (cl_ecl C)\<close> \<open>coincide_on \<sigma> \<sigma>' (vars_of_cl (cl_ecl C))\<close>
[PROOF STATE]
proof (chain)
picking this:
eligible_literal L1 C \<sigma>
L1 \<in> cl_ecl C
coincide_on \<sigma> \<sigma>' (vars_of_cl (cl_ecl C))
[PROOF STEP]
have "eligible_literal L1 C \<sigma>'"
[PROOF STATE]
proof (prove)
using this:
eligible_literal L1 C \<sigma>
L1 \<in> cl_ecl C
coincide_on \<sigma> \<sigma>' (vars_of_cl (cl_ecl C))

goal (1 subgoal):
 1. eligible_literal L1 C \<sigma>'
[PROOF STEP]
using eligible_literal_coincide
[PROOF STATE]
proof (prove)
using this:
eligible_literal L1 C \<sigma>
L1 \<in> cl_ecl C
coincide_on \<sigma> \<sigma>' (vars_of_cl (cl_ecl C))
\<lbrakk>coincide_on ?\<sigma> ?\<sigma>' (vars_of_cl (cl_ecl ?C)); eligible_literal ?L ?C ?\<sigma>; ?L \<in> cl_ecl ?C\<rbrakk> \<Longrightarrow> eligible_literal ?L ?C ?\<sigma>'

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

goal (1 subgoal):
 1. \<exists>\<sigma>' u u' p v D L2. reduction L1 C \<sigma>' t s polarity L2 u u' p v D (same_values (\<lambda>t. trm_rep t S)) S \<sigma> \<and> variable_disjoint C D
[PROOF STEP]
from \<open>eligible_literal L2 C2 \<eta>\<close> \<open>L2 \<in> Cl_C2\<close> \<open>Cl_C2 = (cl_ecl C2)\<close> \<open>coincide_on \<eta> \<sigma>'
          (vars_of_cl (cl_ecl C2))\<close>
[PROOF STATE]
proof (chain)
picking this:
eligible_literal L2 C2 \<eta>
L2 \<in> Cl_C2
Cl_C2 = cl_ecl C2
coincide_on \<eta> \<sigma>' (vars_of_cl (cl_ecl C2))
[PROOF STEP]
have "eligible_literal L2 C2 \<sigma>'"
[PROOF STATE]
proof (prove)
using this:
eligible_literal L2 C2 \<eta>
L2 \<in> Cl_C2
Cl_C2 = cl_ecl C2
coincide_on \<eta> \<sigma>' (vars_of_cl (cl_ecl C2))

goal (1 subgoal):
 1. eligible_literal L2 C2 \<sigma>'
[PROOF STEP]
using eligible_literal_coincide
[PROOF STATE]
proof (prove)
using this:
eligible_literal L2 C2 \<eta>
L2 \<in> Cl_C2
Cl_C2 = cl_ecl C2
coincide_on \<eta> \<sigma>' (vars_of_cl (cl_ecl C2))
\<lbrakk>coincide_on ?\<sigma> ?\<sigma>' (vars_of_cl (cl_ecl ?C)); eligible_literal ?L ?C ?\<sigma>; ?L \<in> cl_ecl ?C\<rbrakk> \<Longrightarrow> eligible_literal ?L ?C ?\<sigma>'

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

goal (1 subgoal):
 1. \<exists>\<sigma>' u u' p v D L2. reduction L1 C \<sigma>' t s polarity L2 u u' p v D (same_values (\<lambda>t. trm_rep t S)) S \<sigma> \<and> variable_disjoint C D
[PROOF STEP]
from \<open>ground_clause gr_Cl_C2\<close> and \<open>gr_Cl_C2 = (subst_cl Cl_C2 \<eta>)\<close>
[PROOF STATE]
proof (chain)
picking this:
ground_clause gr_Cl_C2
gr_Cl_C2 = subst_cl Cl_C2 \<eta>
[PROOF STEP]
have "ground_clause (subst_cl Cl_C2 \<sigma>')"
[PROOF STATE]
proof (prove)
using this:
ground_clause gr_Cl_C2
gr_Cl_C2 = subst_cl Cl_C2 \<eta>

goal (1 subgoal):
 1. ground_clause (subst_cl Cl_C2 \<sigma>')
[PROOF STEP]
by (metis \<open>Cl_C2 = cl_ecl C2\<close> \<open>coincide_on \<sigma>' \<eta> (vars_of_cl (cl_ecl C2))\<close> coincide_on_cl)
[PROOF STATE]
proof (state)
this:
ground_clause (subst_cl Cl_C2 \<sigma>')

goal (1 subgoal):
 1. \<exists>\<sigma>' u u' p v D L2. reduction L1 C \<sigma>' t s polarity L2 u u' p v D (same_values (\<lambda>t. trm_rep t S)) S \<sigma> \<and> variable_disjoint C D
[PROOF STEP]
from \<open>coincide_on \<sigma> \<sigma>' (vars_of_cl (cl_ecl C))\<close> \<open>L1 \<in> (cl_ecl C)\<close>
[PROOF STATE]
proof (chain)
picking this:
coincide_on \<sigma> \<sigma>' (vars_of_cl (cl_ecl C))
L1 \<in> cl_ecl C
[PROOF STEP]
have
      "coincide_on \<sigma> \<sigma>' (vars_of_lit L1)"
[PROOF STATE]
proof (prove)
using this:
coincide_on \<sigma> \<sigma>' (vars_of_cl (cl_ecl C))
L1 \<in> cl_ecl C

goal (1 subgoal):
 1. coincide_on \<sigma> \<sigma>' (vars_of_lit L1)
[PROOF STEP]
unfolding coincide_on_def
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>vars_of_cl (cl_ecl C). Var x \<lhd> \<sigma> = Var x \<lhd> \<sigma>'
L1 \<in> cl_ecl C

goal (1 subgoal):
 1. \<forall>x\<in>vars_of_lit L1. Var x \<lhd> \<sigma> = Var x \<lhd> \<sigma>'
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
coincide_on \<sigma> \<sigma>' (vars_of_lit L1)

goal (1 subgoal):
 1. \<exists>\<sigma>' u u' p v D L2. reduction L1 C \<sigma>' t s polarity L2 u u' p v D (same_values (\<lambda>t. trm_rep t S)) S \<sigma> \<and> variable_disjoint C D
[PROOF STEP]
from \<open>coincide_on \<eta> \<sigma>' (vars_of_cl (cl_ecl C2))\<close> \<open>L2 \<in> Cl_C2\<close> and \<open>Cl_C2 = (cl_ecl C2)\<close>
[PROOF STATE]
proof (chain)
picking this:
coincide_on \<eta> \<sigma>' (vars_of_cl (cl_ecl C2))
L2 \<in> Cl_C2
Cl_C2 = cl_ecl C2
[PROOF STEP]
have "coincide_on \<eta> \<sigma>' (vars_of_lit L2)"
[PROOF STATE]
proof (prove)
using this:
coincide_on \<eta> \<sigma>' (vars_of_cl (cl_ecl C2))
L2 \<in> Cl_C2
Cl_C2 = cl_ecl C2

goal (1 subgoal):
 1. coincide_on \<eta> \<sigma>' (vars_of_lit L2)
[PROOF STEP]
unfolding coincide_on_def
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>vars_of_cl (cl_ecl C2). Var x \<lhd> \<eta> = Var x \<lhd> \<sigma>'
L2 \<in> Cl_C2
Cl_C2 = cl_ecl C2

goal (1 subgoal):
 1. \<forall>x\<in>vars_of_lit L2. Var x \<lhd> \<eta> = Var x \<lhd> \<sigma>'
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
coincide_on \<eta> \<sigma>' (vars_of_lit L2)

goal (1 subgoal):
 1. \<exists>\<sigma>' u u' p v D L2. reduction L1 C \<sigma>' t s polarity L2 u u' p v D (same_values (\<lambda>t. trm_rep t S)) S \<sigma> \<and> variable_disjoint C D
[PROOF STEP]
from \<open>(orient_lit_inst L1 t s polarity \<sigma>)\<close> and  \<open>coincide_on \<sigma> \<sigma>' (vars_of_lit L1)\<close>
[PROOF STATE]
proof (chain)
picking this:
orient_lit_inst L1 t s polarity \<sigma>
coincide_on \<sigma> \<sigma>' (vars_of_lit L1)
[PROOF STEP]
have "(orient_lit_inst L1 t s polarity \<sigma>')"
[PROOF STATE]
proof (prove)
using this:
orient_lit_inst L1 t s polarity \<sigma>
coincide_on \<sigma> \<sigma>' (vars_of_lit L1)

goal (1 subgoal):
 1. orient_lit_inst L1 t s polarity \<sigma>'
[PROOF STEP]
using orient_lit_inst_coincide [of L1 t s polarity \<sigma> \<sigma>']
[PROOF STATE]
proof (prove)
using this:
orient_lit_inst L1 t s polarity \<sigma>
coincide_on \<sigma> \<sigma>' (vars_of_lit L1)
\<lbrakk>orient_lit_inst L1 t s polarity \<sigma>; coincide_on \<sigma> \<sigma>' (vars_of_lit L1)\<rbrakk> \<Longrightarrow> orient_lit_inst L1 t s polarity \<sigma>'

goal (1 subgoal):
 1. orient_lit_inst L1 t s polarity \<sigma>'
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
orient_lit_inst L1 t s polarity \<sigma>'

goal (1 subgoal):
 1. \<exists>\<sigma>' u u' p v D L2. reduction L1 C \<sigma>' t s polarity L2 u u' p v D (same_values (\<lambda>t. trm_rep t S)) S \<sigma> \<and> variable_disjoint C D
[PROOF STEP]
from \<open>(orient_lit_inst L2 lhs rhs pos \<eta>)\<close> and  \<open>coincide_on \<eta> \<sigma>' (vars_of_lit L2)\<close>
[PROOF STATE]
proof (chain)
picking this:
orient_lit_inst L2 lhs rhs pos \<eta>
coincide_on \<eta> \<sigma>' (vars_of_lit L2)
[PROOF STEP]
have "(orient_lit_inst L2 lhs rhs pos \<sigma>')"
[PROOF STATE]
proof (prove)
using this:
orient_lit_inst L2 lhs rhs pos \<eta>
coincide_on \<eta> \<sigma>' (vars_of_lit L2)

goal (1 subgoal):
 1. orient_lit_inst L2 lhs rhs pos \<sigma>'
[PROOF STEP]
using orient_lit_inst_coincide
[PROOF STATE]
proof (prove)
using this:
orient_lit_inst L2 lhs rhs pos \<eta>
coincide_on \<eta> \<sigma>' (vars_of_lit L2)
\<lbrakk>orient_lit_inst ?L1.0 ?t ?s ?polarity ?\<sigma>; coincide_on ?\<sigma> ?\<eta> (vars_of_lit ?L1.0)\<rbrakk> \<Longrightarrow> orient_lit_inst ?L1.0 ?t ?s ?polarity ?\<eta>

goal (1 subgoal):
 1. orient_lit_inst L2 lhs rhs pos \<sigma>'
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
orient_lit_inst L2 lhs rhs pos \<sigma>'

goal (1 subgoal):
 1. \<exists>\<sigma>' u u' p v D L2. reduction L1 C \<sigma>' t s polarity L2 u u' p v D (same_values (\<lambda>t. trm_rep t S)) S \<sigma> \<and> variable_disjoint C D
[PROOF STEP]
text \<open>To prove that the superposition rule is applicable, we need to show that @{term "v"}
does not occur inside a variable:\<close>
[PROOF STATE]
proof (state)
this:
orient_lit_inst L2 lhs rhs pos \<sigma>'

goal (1 subgoal):
 1. \<exists>\<sigma>' u u' p v D L2. reduction L1 C \<sigma>' t s polarity L2 u u' p v D (same_values (\<lambda>t. trm_rep t S)) S \<sigma> \<and> variable_disjoint C D
[PROOF STEP]
have "\<not>(\<exists>x q1 q2. (is_a_variable x) \<and> (subterm (subst x \<sigma>) q1 v) \<and>
                      (subterm t q2 x) \<and> (p = (append q2 q1)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<nexists>x q1 q2. is_a_variable x \<and> subterm (x \<lhd> \<sigma>) q1 v \<and> subterm t q2 x \<and> p = q2 @ q1
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>x q1 q2. is_a_variable x \<and> subterm (x \<lhd> \<sigma>) q1 v \<and> subterm t q2 x \<and> p = q2 @ q1 \<Longrightarrow> False
[PROOF STEP]
assume "(\<exists>x q1 q2. (is_a_variable x) \<and> (subterm (subst x \<sigma>) q1 v) \<and>
                      (subterm t q2 x) \<and> (p = (append q2 q1)))"
[PROOF STATE]
proof (state)
this:
\<exists>x q1 q2. is_a_variable x \<and> subterm (x \<lhd> \<sigma>) q1 v \<and> subterm t q2 x \<and> p = q2 @ q1

goal (1 subgoal):
 1. \<exists>x q1 q2. is_a_variable x \<and> subterm (x \<lhd> \<sigma>) q1 v \<and> subterm t q2 x \<and> p = q2 @ q1 \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>x q1 q2. is_a_variable x \<and> subterm (x \<lhd> \<sigma>) q1 v \<and> subterm t q2 x \<and> p = q2 @ q1
[PROOF STEP]
obtain x q1 q2 where "is_a_variable x" "subterm (subst x \<sigma>) q1 v"
      "(subterm (subst x \<sigma>) q1 v)" "(subterm t q2 x)"
[PROOF STATE]
proof (prove)
using this:
\<exists>x q1 q2. is_a_variable x \<and> subterm (x \<lhd> \<sigma>) q1 v \<and> subterm t q2 x \<and> p = q2 @ q1

goal (1 subgoal):
 1. (\<And>x q1 q2. \<lbrakk>is_a_variable x; subterm (x \<lhd> \<sigma>) q1 v; subterm (x \<lhd> \<sigma>) q1 v; subterm t q2 x\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
is_a_variable x
subterm (x \<lhd> \<sigma>) q1 v
subterm (x \<lhd> \<sigma>) q1 v
subterm t q2 x

goal (1 subgoal):
 1. \<exists>x q1 q2. is_a_variable x \<and> subterm (x \<lhd> \<sigma>) q1 v \<and> subterm t q2 x \<and> p = q2 @ q1 \<Longrightarrow> False
[PROOF STEP]
from \<open>(subterm (subst x \<sigma>) q1 v)\<close>
[PROOF STATE]
proof (chain)
picking this:
subterm (x \<lhd> \<sigma>) q1 v
[PROOF STEP]
have "occurs_in v (subst x \<sigma>)"
[PROOF STATE]
proof (prove)
using this:
subterm (x \<lhd> \<sigma>) q1 v

goal (1 subgoal):
 1. occurs_in v (x \<lhd> \<sigma>)
[PROOF STEP]
unfolding occurs_in_def
[PROOF STATE]
proof (prove)
using this:
subterm (x \<lhd> \<sigma>) q1 v

goal (1 subgoal):
 1. \<exists>p. subterm (x \<lhd> \<sigma>) p v
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
occurs_in v (x \<lhd> \<sigma>)

goal (1 subgoal):
 1. \<exists>x q1 q2. is_a_variable x \<and> subterm (x \<lhd> \<sigma>) q1 v \<and> subterm t q2 x \<and> p = q2 @ q1 \<Longrightarrow> False
[PROOF STEP]
from \<open>is_a_variable x\<close>
[PROOF STATE]
proof (chain)
picking this:
is_a_variable x
[PROOF STEP]
obtain x' where "x = Var x'"
[PROOF STATE]
proof (prove)
using this:
is_a_variable x

goal (1 subgoal):
 1. (\<And>x'. x = Var x' \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using is_a_variable.elims(2)
[PROOF STATE]
proof (prove)
using this:
is_a_variable x
\<lbrakk>is_a_variable ?x; \<And>x. ?x = Var x \<Longrightarrow> ?P\<rbrakk> \<Longrightarrow> ?P

goal (1 subgoal):
 1. (\<And>x'. x = Var x' \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
x = Var x'

goal (1 subgoal):
 1. \<exists>x q1 q2. is_a_variable x \<and> subterm (x \<lhd> \<sigma>) q1 v \<and> subterm t q2 x \<and> p = q2 @ q1 \<Longrightarrow> False
[PROOF STEP]
from \<open>subterm t q2 x\<close>
[PROOF STATE]
proof (chain)
picking this:
subterm t q2 x
[PROOF STEP]
have "x \<in> subterms_of t"
[PROOF STATE]
proof (prove)
using this:
subterm t q2 x

goal (1 subgoal):
 1. x \<in> subterms_of t
[PROOF STEP]
using subterms_of.simps
[PROOF STATE]
proof (prove)
using this:
subterm t q2 x
subterms_of ?t = {s. occurs_in s ?t}

goal (1 subgoal):
 1. x \<in> subterms_of t
[PROOF STEP]
unfolding  occurs_in_def
[PROOF STATE]
proof (prove)
using this:
subterm t q2 x
subterms_of ?t = {s. \<exists>p. subterm ?t p s}

goal (1 subgoal):
 1. x \<in> subterms_of t
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
x \<in> subterms_of t

goal (1 subgoal):
 1. \<exists>x q1 q2. is_a_variable x \<and> subterm (x \<lhd> \<sigma>) q1 v \<and> subterm t q2 x \<and> p = q2 @ q1 \<Longrightarrow> False
[PROOF STEP]
from this
[PROOF STATE]
proof (chain)
picking this:
x \<in> subterms_of t
[PROOF STEP]
have "x \<in> subterms_of_lit L1"
[PROOF STATE]
proof (prove)
using this:
x \<in> subterms_of t

goal (1 subgoal):
 1. x \<in> subterms_of_lit L1
[PROOF STEP]
using assms(6)
[PROOF STATE]
proof (prove)
using this:
x \<in> subterms_of t
orient_lit_inst L1 t s polarity \<sigma>

goal (1 subgoal):
 1. x \<in> subterms_of_lit L1
[PROOF STEP]
by (simp add: orient_lit_inst_subterms)
[PROOF STATE]
proof (state)
this:
x \<in> subterms_of_lit L1

goal (1 subgoal):
 1. \<exists>x q1 q2. is_a_variable x \<and> subterm (x \<lhd> \<sigma>) q1 v \<and> subterm t q2 x \<and> p = q2 @ q1 \<Longrightarrow> False
[PROOF STEP]
from this \<open>L1 \<in> (cl_ecl C)\<close>
[PROOF STATE]
proof (chain)
picking this:
x \<in> subterms_of_lit L1
L1 \<in> cl_ecl C
[PROOF STEP]
have "x \<in> subterms_of_cl (cl_ecl C)"
[PROOF STATE]
proof (prove)
using this:
x \<in> subterms_of_lit L1
L1 \<in> cl_ecl C

goal (1 subgoal):
 1. x \<in> subterms_of_cl (cl_ecl C)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x \<in> subterms_of_cl (cl_ecl C)

goal (1 subgoal):
 1. \<exists>x q1 q2. is_a_variable x \<and> subterm (x \<lhd> \<sigma>) q1 v \<and> subterm t q2 x \<and> p = q2 @ q1 \<Longrightarrow> False
[PROOF STEP]
from this
[PROOF STATE]
proof (chain)
picking this:
x \<in> subterms_of_cl (cl_ecl C)
[PROOF STEP]
have "vars_of x \<subseteq> vars_of_cl (cl_ecl C)"
[PROOF STATE]
proof (prove)
using this:
x \<in> subterms_of_cl (cl_ecl C)

goal (1 subgoal):
 1. vars_of x \<subseteq> vars_of_cl (cl_ecl C)
[PROOF STEP]
using subterm_vars
[PROOF STATE]
proof (prove)
using this:
x \<in> subterms_of_cl (cl_ecl C)
?u \<in> subterms_of_cl ?C \<Longrightarrow> vars_of ?u \<subseteq> vars_of_cl ?C

goal (1 subgoal):
 1. vars_of x \<subseteq> vars_of_cl (cl_ecl C)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
vars_of x \<subseteq> vars_of_cl (cl_ecl C)

goal (1 subgoal):
 1. \<exists>x q1 q2. is_a_variable x \<and> subterm (x \<lhd> \<sigma>) q1 v \<and> subterm t q2 x \<and> p = q2 @ q1 \<Longrightarrow> False
[PROOF STEP]
from this and \<open>x = (Var x')\<close>
[PROOF STATE]
proof (chain)
picking this:
vars_of x \<subseteq> vars_of_cl (cl_ecl C)
x = Var x'
[PROOF STEP]
have "x' \<in> vars_of_cl (cl_ecl C)"
[PROOF STATE]
proof (prove)
using this:
vars_of x \<subseteq> vars_of_cl (cl_ecl C)
x = Var x'

goal (1 subgoal):
 1. x' \<in> vars_of_cl (cl_ecl C)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x' \<in> vars_of_cl (cl_ecl C)

goal (1 subgoal):
 1. \<exists>x q1 q2. is_a_variable x \<and> subterm (x \<lhd> \<sigma>) q1 v \<and> subterm t q2 x \<and> p = q2 @ q1 \<Longrightarrow> False
[PROOF STEP]
from \<open>x' \<in> vars_of_cl (cl_ecl C)\<close> \<open>occurs_in v (subst x \<sigma>)\<close>
      \<open>x = Var x'\<close> assms(2)
[PROOF STATE]
proof (chain)
picking this:
x' \<in> vars_of_cl (cl_ecl C)
occurs_in v (x \<lhd> \<sigma>)
x = Var x'
\<forall>x y. x \<in> vars_of_cl (cl_ecl C) \<longrightarrow> occurs_in y (Var x \<lhd> \<sigma>) \<longrightarrow> trm_rep y S = y
[PROOF STEP]
have "trm_rep v S = v"
[PROOF STATE]
proof (prove)
using this:
x' \<in> vars_of_cl (cl_ecl C)
occurs_in v (x \<lhd> \<sigma>)
x = Var x'
\<forall>x y. x \<in> vars_of_cl (cl_ecl C) \<longrightarrow> occurs_in y (Var x \<lhd> \<sigma>) \<longrightarrow> trm_rep y S = y

goal (1 subgoal):
 1. trm_rep v S = v
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
trm_rep v S = v

goal (1 subgoal):
 1. \<exists>x q1 q2. is_a_variable x \<and> subterm (x \<lhd> \<sigma>) q1 v \<and> subterm t q2 x \<and> p = q2 @ q1 \<Longrightarrow> False
[PROOF STEP]
from this and \<open>trm_rep v S \<noteq> v\<close>
[PROOF STATE]
proof (chain)
picking this:
trm_rep v S = v
trm_rep v S \<noteq> v
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
trm_rep v S = v
trm_rep v S \<noteq> v

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<nexists>x q1 q2. is_a_variable x \<and> subterm (x \<lhd> \<sigma>) q1 v \<and> subterm t q2 x \<and> p = q2 @ q1

goal (1 subgoal):
 1. \<exists>\<sigma>' u u' p v D L2. reduction L1 C \<sigma>' t s polarity L2 u u' p v D (same_values (\<lambda>t. trm_rep t S)) S \<sigma> \<and> variable_disjoint C D
[PROOF STEP]
from this and si
[PROOF STATE]
proof (chain)
picking this:
\<nexists>x q1 q2. is_a_variable x \<and> subterm (x \<lhd> \<sigma>) q1 v \<and> subterm t q2 x \<and> p = q2 @ q1
(\<exists>x q1 q2. is_a_variable x \<and> subterm (x \<lhd> \<sigma>) q1 v \<and> subterm t q2 x \<and> p = q2 @ q1) \<or> (\<exists>u. \<not> is_a_variable u \<and> subterm t p u \<and> v = u \<lhd> \<sigma>)
[PROOF STEP]
obtain u where "\<not> (is_a_variable u)" "(subterm t p u)" and "v = (subst u \<sigma>)"
[PROOF STATE]
proof (prove)
using this:
\<nexists>x q1 q2. is_a_variable x \<and> subterm (x \<lhd> \<sigma>) q1 v \<and> subterm t q2 x \<and> p = q2 @ q1
(\<exists>x q1 q2. is_a_variable x \<and> subterm (x \<lhd> \<sigma>) q1 v \<and> subterm t q2 x \<and> p = q2 @ q1) \<or> (\<exists>u. \<not> is_a_variable u \<and> subterm t p u \<and> v = u \<lhd> \<sigma>)

goal (1 subgoal):
 1. (\<And>u. \<lbrakk>\<not> is_a_variable u; subterm t p u; v = u \<lhd> \<sigma>\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<not> is_a_variable u
subterm t p u
v = u \<lhd> \<sigma>

goal (1 subgoal):
 1. \<exists>\<sigma>' u u' p v D L2. reduction L1 C \<sigma>' t s polarity L2 u u' p v D (same_values (\<lambda>t. trm_rep t S)) S \<sigma> \<and> variable_disjoint C D
[PROOF STEP]
from \<open>orient_lit_inst L1 t s polarity \<sigma>\<close>
[PROOF STATE]
proof (chain)
picking this:
orient_lit_inst L1 t s polarity \<sigma>
[PROOF STEP]
have "vars_of t \<subseteq> vars_of_lit L1"
[PROOF STATE]
proof (prove)
using this:
orient_lit_inst L1 t s polarity \<sigma>

goal (1 subgoal):
 1. vars_of t \<subseteq> vars_of_lit L1
[PROOF STEP]
using orient_lit_inst_vars
[PROOF STATE]
proof (prove)
using this:
orient_lit_inst L1 t s polarity \<sigma>
orient_lit_inst ?L ?t ?s ?p ?\<sigma> \<Longrightarrow> vars_of ?t \<subseteq> vars_of_lit ?L \<and> vars_of ?s \<subseteq> vars_of_lit ?L

goal (1 subgoal):
 1. vars_of t \<subseteq> vars_of_lit L1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
vars_of t \<subseteq> vars_of_lit L1

goal (1 subgoal):
 1. \<exists>\<sigma>' u u' p v D L2. reduction L1 C \<sigma>' t s polarity L2 u u' p v D (same_values (\<lambda>t. trm_rep t S)) S \<sigma> \<and> variable_disjoint C D
[PROOF STEP]
from \<open>subterm t p u\<close>
[PROOF STATE]
proof (chain)
picking this:
subterm t p u
[PROOF STEP]
have "vars_of u \<subseteq> vars_of t"
[PROOF STATE]
proof (prove)
using this:
subterm t p u

goal (1 subgoal):
 1. vars_of u \<subseteq> vars_of t
[PROOF STEP]
using vars_subterm
[PROOF STATE]
proof (prove)
using this:
subterm t p u
subterm ?t ?p ?s \<Longrightarrow> vars_of ?s \<subseteq> vars_of ?t

goal (1 subgoal):
 1. vars_of u \<subseteq> vars_of t
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
vars_of u \<subseteq> vars_of t

goal (1 subgoal):
 1. \<exists>\<sigma>' u u' p v D L2. reduction L1 C \<sigma>' t s polarity L2 u u' p v D (same_values (\<lambda>t. trm_rep t S)) S \<sigma> \<and> variable_disjoint C D
[PROOF STEP]
from \<open>vars_of t \<subseteq> vars_of_lit L1\<close> \<open>vars_of u \<subseteq> vars_of t\<close> \<open>coincide_on \<sigma> \<sigma>' (vars_of_lit L1)\<close>
[PROOF STATE]
proof (chain)
picking this:
vars_of t \<subseteq> vars_of_lit L1
vars_of u \<subseteq> vars_of t
coincide_on \<sigma> \<sigma>' (vars_of_lit L1)
[PROOF STEP]
have "coincide_on \<sigma> \<sigma>' (vars_of u)"
[PROOF STATE]
proof (prove)
using this:
vars_of t \<subseteq> vars_of_lit L1
vars_of u \<subseteq> vars_of t
coincide_on \<sigma> \<sigma>' (vars_of_lit L1)

goal (1 subgoal):
 1. coincide_on \<sigma> \<sigma>' (vars_of u)
[PROOF STEP]
unfolding coincide_on_def
[PROOF STATE]
proof (prove)
using this:
vars_of t \<subseteq> vars_of_lit L1
vars_of u \<subseteq> vars_of t
\<forall>x\<in>vars_of_lit L1. Var x \<lhd> \<sigma> = Var x \<lhd> \<sigma>'

goal (1 subgoal):
 1. \<forall>x\<in>vars_of u. Var x \<lhd> \<sigma> = Var x \<lhd> \<sigma>'
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
coincide_on \<sigma> \<sigma>' (vars_of u)

goal (1 subgoal):
 1. \<exists>\<sigma>' u u' p v D L2. reduction L1 C \<sigma>' t s polarity L2 u u' p v D (same_values (\<lambda>t. trm_rep t S)) S \<sigma> \<and> variable_disjoint C D
[PROOF STEP]
from this
[PROOF STATE]
proof (chain)
picking this:
coincide_on \<sigma> \<sigma>' (vars_of u)
[PROOF STEP]
have "subst u \<sigma> = subst u \<sigma>'"
[PROOF STATE]
proof (prove)
using this:
coincide_on \<sigma> \<sigma>' (vars_of u)

goal (1 subgoal):
 1. u \<lhd> \<sigma> = u \<lhd> \<sigma>'
[PROOF STEP]
using coincide_on_term
[PROOF STATE]
proof (prove)
using this:
coincide_on \<sigma> \<sigma>' (vars_of u)
coincide_on ?\<sigma> ?\<eta> (vars_of ?t) \<Longrightarrow> ?t \<lhd> ?\<sigma> = ?t \<lhd> ?\<eta>

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

goal (1 subgoal):
 1. \<exists>\<sigma>' u u' p v D L2. reduction L1 C \<sigma>' t s polarity L2 u u' p v D (same_values (\<lambda>t. trm_rep t S)) S \<sigma> \<and> variable_disjoint C D
[PROOF STEP]
from \<open>orient_lit_inst L2 lhs rhs pos \<eta>\<close>
[PROOF STATE]
proof (chain)
picking this:
orient_lit_inst L2 lhs rhs pos \<eta>
[PROOF STEP]
have "vars_of lhs \<subseteq> vars_of_lit L2"
      and "vars_of rhs \<subseteq> vars_of_lit L2"
[PROOF STATE]
proof (prove)
using this:
orient_lit_inst L2 lhs rhs pos \<eta>

goal (1 subgoal):
 1. vars_of lhs \<subseteq> vars_of_lit L2 &&& vars_of rhs \<subseteq> vars_of_lit L2
[PROOF STEP]
using orient_lit_inst_vars
[PROOF STATE]
proof (prove)
using this:
orient_lit_inst L2 lhs rhs pos \<eta>
orient_lit_inst ?L ?t ?s ?p ?\<sigma> \<Longrightarrow> vars_of ?t \<subseteq> vars_of_lit ?L \<and> vars_of ?s \<subseteq> vars_of_lit ?L

goal (1 subgoal):
 1. vars_of lhs \<subseteq> vars_of_lit L2 &&& vars_of rhs \<subseteq> vars_of_lit L2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
vars_of lhs \<subseteq> vars_of_lit L2
vars_of rhs \<subseteq> vars_of_lit L2

goal (1 subgoal):
 1. \<exists>\<sigma>' u u' p v D L2. reduction L1 C \<sigma>' t s polarity L2 u u' p v D (same_values (\<lambda>t. trm_rep t S)) S \<sigma> \<and> variable_disjoint C D
[PROOF STEP]
from \<open>vars_of lhs \<subseteq> vars_of_lit L2\<close> \<open>coincide_on \<eta> \<sigma>' (vars_of_lit L2)\<close>
[PROOF STATE]
proof (chain)
picking this:
vars_of lhs \<subseteq> vars_of_lit L2
coincide_on \<eta> \<sigma>' (vars_of_lit L2)
[PROOF STEP]
have "coincide_on \<eta> \<sigma>' (vars_of lhs)"
[PROOF STATE]
proof (prove)
using this:
vars_of lhs \<subseteq> vars_of_lit L2
coincide_on \<eta> \<sigma>' (vars_of_lit L2)

goal (1 subgoal):
 1. coincide_on \<eta> \<sigma>' (vars_of lhs)
[PROOF STEP]
unfolding coincide_on_def
[PROOF STATE]
proof (prove)
using this:
vars_of lhs \<subseteq> vars_of_lit L2
\<forall>x\<in>vars_of_lit L2. Var x \<lhd> \<eta> = Var x \<lhd> \<sigma>'

goal (1 subgoal):
 1. \<forall>x\<in>vars_of lhs. Var x \<lhd> \<eta> = Var x \<lhd> \<sigma>'
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
coincide_on \<eta> \<sigma>' (vars_of lhs)

goal (1 subgoal):
 1. \<exists>\<sigma>' u u' p v D L2. reduction L1 C \<sigma>' t s polarity L2 u u' p v D (same_values (\<lambda>t. trm_rep t S)) S \<sigma> \<and> variable_disjoint C D
[PROOF STEP]
from this
[PROOF STATE]
proof (chain)
picking this:
coincide_on \<eta> \<sigma>' (vars_of lhs)
[PROOF STEP]
have "subst lhs \<eta> = subst lhs \<sigma>'"
[PROOF STATE]
proof (prove)
using this:
coincide_on \<eta> \<sigma>' (vars_of lhs)

goal (1 subgoal):
 1. lhs \<lhd> \<eta> = lhs \<lhd> \<sigma>'
[PROOF STEP]
using coincide_on_term
[PROOF STATE]
proof (prove)
using this:
coincide_on \<eta> \<sigma>' (vars_of lhs)
coincide_on ?\<sigma> ?\<eta> (vars_of ?t) \<Longrightarrow> ?t \<lhd> ?\<sigma> = ?t \<lhd> ?\<eta>

goal (1 subgoal):
 1. lhs \<lhd> \<eta> = lhs \<lhd> \<sigma>'
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
lhs \<lhd> \<eta> = lhs \<lhd> \<sigma>'

goal (1 subgoal):
 1. \<exists>\<sigma>' u u' p v D L2. reduction L1 C \<sigma>' t s polarity L2 u u' p v D (same_values (\<lambda>t. trm_rep t S)) S \<sigma> \<and> variable_disjoint C D
[PROOF STEP]
from \<open>vars_of rhs \<subseteq> vars_of_lit L2\<close> \<open>coincide_on \<eta> \<sigma>' (vars_of_lit L2)\<close>
[PROOF STATE]
proof (chain)
picking this:
vars_of rhs \<subseteq> vars_of_lit L2
coincide_on \<eta> \<sigma>' (vars_of_lit L2)
[PROOF STEP]
have "coincide_on \<eta> \<sigma>' (vars_of rhs)"
[PROOF STATE]
proof (prove)
using this:
vars_of rhs \<subseteq> vars_of_lit L2
coincide_on \<eta> \<sigma>' (vars_of_lit L2)

goal (1 subgoal):
 1. coincide_on \<eta> \<sigma>' (vars_of rhs)
[PROOF STEP]
unfolding coincide_on_def
[PROOF STATE]
proof (prove)
using this:
vars_of rhs \<subseteq> vars_of_lit L2
\<forall>x\<in>vars_of_lit L2. Var x \<lhd> \<eta> = Var x \<lhd> \<sigma>'

goal (1 subgoal):
 1. \<forall>x\<in>vars_of rhs. Var x \<lhd> \<eta> = Var x \<lhd> \<sigma>'
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
coincide_on \<eta> \<sigma>' (vars_of rhs)

goal (1 subgoal):
 1. \<exists>\<sigma>' u u' p v D L2. reduction L1 C \<sigma>' t s polarity L2 u u' p v D (same_values (\<lambda>t. trm_rep t S)) S \<sigma> \<and> variable_disjoint C D
[PROOF STEP]
from this
[PROOF STATE]
proof (chain)
picking this:
coincide_on \<eta> \<sigma>' (vars_of rhs)
[PROOF STEP]
have "subst rhs \<eta> = subst rhs \<sigma>'"
[PROOF STATE]
proof (prove)
using this:
coincide_on \<eta> \<sigma>' (vars_of rhs)

goal (1 subgoal):
 1. rhs \<lhd> \<eta> = rhs \<lhd> \<sigma>'
[PROOF STEP]
using coincide_on_term
[PROOF STATE]
proof (prove)
using this:
coincide_on \<eta> \<sigma>' (vars_of rhs)
coincide_on ?\<sigma> ?\<eta> (vars_of ?t) \<Longrightarrow> ?t \<lhd> ?\<sigma> = ?t \<lhd> ?\<eta>

goal (1 subgoal):
 1. rhs \<lhd> \<eta> = rhs \<lhd> \<sigma>'
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
rhs \<lhd> \<eta> = rhs \<lhd> \<sigma>'

goal (1 subgoal):
 1. \<exists>\<sigma>' u u' p v D L2. reduction L1 C \<sigma>' t s polarity L2 u u' p v D (same_values (\<lambda>t. trm_rep t S)) S \<sigma> \<and> variable_disjoint C D
[PROOF STEP]
from \<open>trm_rep v S = trm_rep gr_rhs S\<close> and \<open>v= subst lhs \<eta>\<close> and \<open>gr_rhs = (subst rhs \<eta>)\<close>
[PROOF STATE]
proof (chain)
picking this:
trm_rep v S = trm_rep gr_rhs S
v = lhs \<lhd> \<eta>
gr_rhs = rhs \<lhd> \<eta>
[PROOF STEP]
have "trm_rep (subst rhs \<eta>) S = trm_rep (subst lhs \<eta>) S"
[PROOF STATE]
proof (prove)
using this:
trm_rep v S = trm_rep gr_rhs S
v = lhs \<lhd> \<eta>
gr_rhs = rhs \<lhd> \<eta>

goal (1 subgoal):
 1. trm_rep (rhs \<lhd> \<eta>) S = trm_rep (lhs \<lhd> \<eta>) S
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
trm_rep (rhs \<lhd> \<eta>) S = trm_rep (lhs \<lhd> \<eta>) S

goal (1 subgoal):
 1. \<exists>\<sigma>' u u' p v D L2. reduction L1 C \<sigma>' t s polarity L2 u u' p v D (same_values (\<lambda>t. trm_rep t S)) S \<sigma> \<and> variable_disjoint C D
[PROOF STEP]
from this and \<open>subst rhs \<eta> = subst rhs \<sigma>'\<close>  \<open>subst lhs \<eta> = subst lhs \<sigma>'\<close>
[PROOF STATE]
proof (chain)
picking this:
trm_rep (rhs \<lhd> \<eta>) S = trm_rep (lhs \<lhd> \<eta>) S
rhs \<lhd> \<eta> = rhs \<lhd> \<sigma>'
lhs \<lhd> \<eta> = lhs \<lhd> \<sigma>'
[PROOF STEP]
have  "trm_rep (subst rhs \<sigma>') S = trm_rep (subst lhs \<sigma>') S"
[PROOF STATE]
proof (prove)
using this:
trm_rep (rhs \<lhd> \<eta>) S = trm_rep (lhs \<lhd> \<eta>) S
rhs \<lhd> \<eta> = rhs \<lhd> \<sigma>'
lhs \<lhd> \<eta> = lhs \<lhd> \<sigma>'

goal (1 subgoal):
 1. trm_rep (rhs \<lhd> \<sigma>') S = trm_rep (lhs \<lhd> \<sigma>') S
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
trm_rep (rhs \<lhd> \<sigma>') S = trm_rep (lhs \<lhd> \<sigma>') S

goal (1 subgoal):
 1. \<exists>\<sigma>' u u' p v D L2. reduction L1 C \<sigma>' t s polarity L2 u u' p v D (same_values (\<lambda>t. trm_rep t S)) S \<sigma> \<and> variable_disjoint C D
[PROOF STEP]
from \<open>subst lhs \<eta> = subst lhs \<sigma>'\<close> \<open>subst u \<sigma> = subst u \<sigma>'\<close> \<open>v = subst u \<sigma>\<close> and \<open>v = subst lhs \<eta>\<close>
[PROOF STATE]
proof (chain)
picking this:
lhs \<lhd> \<eta> = lhs \<lhd> \<sigma>'
u \<lhd> \<sigma> = u \<lhd> \<sigma>'
v = u \<lhd> \<sigma>
v = lhs \<lhd> \<eta>
[PROOF STEP]
have "subst u \<sigma>' = subst lhs \<sigma>'"
[PROOF STATE]
proof (prove)
using this:
lhs \<lhd> \<eta> = lhs \<lhd> \<sigma>'
u \<lhd> \<sigma> = u \<lhd> \<sigma>'
v = u \<lhd> \<sigma>
v = lhs \<lhd> \<eta>

goal (1 subgoal):
 1. u \<lhd> \<sigma>' = lhs \<lhd> \<sigma>'
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
u \<lhd> \<sigma>' = lhs \<lhd> \<sigma>'

goal (1 subgoal):
 1. \<exists>\<sigma>' u u' p v D L2. reduction L1 C \<sigma>' t s polarity L2 u u' p v D (same_values (\<lambda>t. trm_rep t S)) S \<sigma> \<and> variable_disjoint C D
[PROOF STEP]
from \<open>coincide_on \<sigma>' \<eta> (vars_of_cl (cl_ecl C2))\<close> and \<open>Cl_C2 = (cl_ecl C2)\<close>
[PROOF STATE]
proof (chain)
picking this:
coincide_on \<sigma>' \<eta> (vars_of_cl (cl_ecl C2))
Cl_C2 = cl_ecl C2
[PROOF STEP]
have "coincide_on \<sigma>' \<eta>  (vars_of_cl (Cl_C2 - { L2 }))"
[PROOF STATE]
proof (prove)
using this:
coincide_on \<sigma>' \<eta> (vars_of_cl (cl_ecl C2))
Cl_C2 = cl_ecl C2

goal (1 subgoal):
 1. coincide_on \<sigma>' \<eta> (vars_of_cl (Cl_C2 - {L2}))
[PROOF STEP]
unfolding coincide_on_def
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>vars_of_cl (cl_ecl C2). Var x \<lhd> \<sigma>' = Var x \<lhd> \<eta>
Cl_C2 = cl_ecl C2

goal (1 subgoal):
 1. \<forall>x\<in>vars_of_cl (Cl_C2 - {L2}). Var x \<lhd> \<sigma>' = Var x \<lhd> \<eta>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
coincide_on \<sigma>' \<eta> (vars_of_cl (Cl_C2 - {L2}))

goal (1 subgoal):
 1. \<exists>\<sigma>' u u' p v D L2. reduction L1 C \<sigma>' t s polarity L2 u u' p v D (same_values (\<lambda>t. trm_rep t S)) S \<sigma> \<and> variable_disjoint C D
[PROOF STEP]
from this and \<open>(\<not> validate_ground_clause ?I (subst_cl ( Cl_C2 - { L2 } ) \<eta>))\<close>
[PROOF STATE]
proof (chain)
picking this:
coincide_on \<sigma>' \<eta> (vars_of_cl (Cl_C2 - {L2}))
\<not> validate_ground_clause (same_values (\<lambda>t. trm_rep t S)) (subst_cl (Cl_C2 - {L2}) \<eta>)
[PROOF STEP]
have "(\<not> validate_ground_clause ?I (subst_cl ( Cl_C2 - { L2 } ) \<sigma>'))"
[PROOF STATE]
proof (prove)
using this:
coincide_on \<sigma>' \<eta> (vars_of_cl (Cl_C2 - {L2}))
\<not> validate_ground_clause (same_values (\<lambda>t. trm_rep t S)) (subst_cl (Cl_C2 - {L2}) \<eta>)

goal (1 subgoal):
 1. \<not> validate_ground_clause (same_values (\<lambda>t. trm_rep t S)) (subst_cl (Cl_C2 - {L2}) \<sigma>')
[PROOF STEP]
using coincide_on_cl
[PROOF STATE]
proof (prove)
using this:
coincide_on \<sigma>' \<eta> (vars_of_cl (Cl_C2 - {L2}))
\<not> validate_ground_clause (same_values (\<lambda>t. trm_rep t S)) (subst_cl (Cl_C2 - {L2}) \<eta>)
coincide_on ?\<sigma> ?\<eta> (vars_of_cl ?C) \<Longrightarrow> subst_cl ?C ?\<sigma> = subst_cl ?C ?\<eta>

goal (1 subgoal):
 1. \<not> validate_ground_clause (same_values (\<lambda>t. trm_rep t S)) (subst_cl (Cl_C2 - {L2}) \<sigma>')
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
\<not> validate_ground_clause (same_values (\<lambda>t. trm_rep t S)) (subst_cl (Cl_C2 - {L2}) \<sigma>')

goal (1 subgoal):
 1. \<exists>\<sigma>' u u' p v D L2. reduction L1 C \<sigma>' t s polarity L2 u u' p v D (same_values (\<lambda>t. trm_rep t S)) S \<sigma> \<and> variable_disjoint C D
[PROOF STEP]
have "(\<forall>x\<in>cl_ecl C2 - {L2}. (subst_lit x \<sigma>', subst_lit L2 \<sigma>') \<in> lit_ord)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>cl_ecl C2 - {L2}. (subst_lit x \<sigma>', subst_lit L2 \<sigma>') \<in> lit_ord
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> cl_ecl C2 - {L2} \<Longrightarrow> (subst_lit x \<sigma>', subst_lit L2 \<sigma>') \<in> lit_ord
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> cl_ecl C2 - {L2} \<Longrightarrow> (subst_lit x \<sigma>', subst_lit L2 \<sigma>') \<in> lit_ord
[PROOF STEP]
assume "x \<in>cl_ecl C2 - {L2}"
[PROOF STATE]
proof (state)
this:
x \<in> cl_ecl C2 - {L2}

goal (1 subgoal):
 1. \<And>x. x \<in> cl_ecl C2 - {L2} \<Longrightarrow> (subst_lit x \<sigma>', subst_lit L2 \<sigma>') \<in> lit_ord
[PROOF STEP]
from \<open>L2 \<in> Cl_C2\<close> and  \<open>gr_L2 = (subst_lit L2 \<eta>)\<close>
      \<open>gr_Cl_C2 = (subst_cl Cl_C2 \<eta>)\<close>
[PROOF STATE]
proof (chain)
picking this:
L2 \<in> Cl_C2
gr_L2 = subst_lit L2 \<eta>
gr_Cl_C2 = subst_cl Cl_C2 \<eta>
[PROOF STEP]
have "gr_L2 \<in> gr_Cl_C2"
[PROOF STATE]
proof (prove)
using this:
L2 \<in> Cl_C2
gr_L2 = subst_lit L2 \<eta>
gr_Cl_C2 = subst_cl Cl_C2 \<eta>

goal (1 subgoal):
 1. gr_L2 \<in> gr_Cl_C2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
gr_L2 \<in> gr_Cl_C2

goal (1 subgoal):
 1. \<And>x. x \<in> cl_ecl C2 - {L2} \<Longrightarrow> (subst_lit x \<sigma>', subst_lit L2 \<sigma>') \<in> lit_ord
[PROOF STEP]
from this and \<open>ground_clause gr_Cl_C2\<close>
[PROOF STATE]
proof (chain)
picking this:
gr_L2 \<in> gr_Cl_C2
ground_clause gr_Cl_C2
[PROOF STEP]
have "vars_of_lit gr_L2 = {}"
[PROOF STATE]
proof (prove)
using this:
gr_L2 \<in> gr_Cl_C2
ground_clause gr_Cl_C2

goal (1 subgoal):
 1. vars_of_lit gr_L2 = {}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
vars_of_lit gr_L2 = {}

goal (1 subgoal):
 1. \<And>x. x \<in> cl_ecl C2 - {L2} \<Longrightarrow> (subst_lit x \<sigma>', subst_lit L2 \<sigma>') \<in> lit_ord
[PROOF STEP]
from \<open>x \<in> cl_ecl C2 - {L2}\<close> and \<open>Cl_C2 = (cl_ecl C2)\<close>  \<open>gr_Cl_C2 = (subst_cl Cl_C2 \<eta>)\<close>
[PROOF STATE]
proof (chain)
picking this:
x \<in> cl_ecl C2 - {L2}
Cl_C2 = cl_ecl C2
gr_Cl_C2 = subst_cl Cl_C2 \<eta>
[PROOF STEP]
have "(subst_lit x \<eta>) \<in> gr_Cl_C2"
[PROOF STATE]
proof (prove)
using this:
x \<in> cl_ecl C2 - {L2}
Cl_C2 = cl_ecl C2
gr_Cl_C2 = subst_cl Cl_C2 \<eta>

goal (1 subgoal):
 1. subst_lit x \<eta> \<in> gr_Cl_C2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
subst_lit x \<eta> \<in> gr_Cl_C2

goal (1 subgoal):
 1. \<And>x. x \<in> cl_ecl C2 - {L2} \<Longrightarrow> (subst_lit x \<sigma>', subst_lit L2 \<sigma>') \<in> lit_ord
[PROOF STEP]
from this and \<open>ground_clause gr_Cl_C2\<close>
[PROOF STATE]
proof (chain)
picking this:
subst_lit x \<eta> \<in> gr_Cl_C2
ground_clause gr_Cl_C2
[PROOF STEP]
have "vars_of_lit (subst_lit x \<eta>) = {}"
[PROOF STATE]
proof (prove)
using this:
subst_lit x \<eta> \<in> gr_Cl_C2
ground_clause gr_Cl_C2

goal (1 subgoal):
 1. vars_of_lit (subst_lit x \<eta>) = {}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
vars_of_lit (subst_lit x \<eta>) = {}

goal (1 subgoal):
 1. \<And>x. x \<in> cl_ecl C2 - {L2} \<Longrightarrow> (subst_lit x \<sigma>', subst_lit L2 \<sigma>') \<in> lit_ord
[PROOF STEP]
from this \<open>x \<in> cl_ecl C2 - {L2}\<close> \<open>maximal_literal gr_L2 gr_Cl_C2\<close> \<open>Cl_C2 = cl_ecl C2\<close>
    \<open>gr_L2 = (subst_lit L2 \<eta>)\<close>
    \<open>gr_Cl_C2 = (subst_cl Cl_C2 \<eta>)\<close> \<open>orient_lit_inst L2 lhs rhs pos \<eta>\<close> no_fact assms(9)
    \<open>vars_of_lit gr_L2 = {}\<close> \<open>vars_of_lit (subst_lit x \<eta>) = {}\<close>
[PROOF STATE]
proof (chain)
picking this:
vars_of_lit (subst_lit x \<eta>) = {}
x \<in> cl_ecl C2 - {L2}
maximal_literal gr_L2 gr_Cl_C2
Cl_C2 = cl_ecl C2
gr_L2 = subst_lit L2 \<eta>
gr_Cl_C2 = subst_cl Cl_C2 \<eta>
orient_lit_inst L2 lhs rhs pos \<eta>
\<not> equivalent_eq_exists lhs rhs Cl_C2 (same_values (\<lambda>t. trm_rep t S)) \<eta> L2
fo_interpretation (same_values (\<lambda>t. trm_rep t S))
vars_of_lit gr_L2 = {}
vars_of_lit (subst_lit x \<eta>) = {}
[PROOF STEP]
have "(subst_lit x \<eta>, subst_lit L2 \<eta>) \<in> lit_ord"
[PROOF STATE]
proof (prove)
using this:
vars_of_lit (subst_lit x \<eta>) = {}
x \<in> cl_ecl C2 - {L2}
maximal_literal gr_L2 gr_Cl_C2
Cl_C2 = cl_ecl C2
gr_L2 = subst_lit L2 \<eta>
gr_Cl_C2 = subst_cl Cl_C2 \<eta>
orient_lit_inst L2 lhs rhs pos \<eta>
\<not> equivalent_eq_exists lhs rhs Cl_C2 (same_values (\<lambda>t. trm_rep t S)) \<eta> L2
fo_interpretation (same_values (\<lambda>t. trm_rep t S))
vars_of_lit gr_L2 = {}
vars_of_lit (subst_lit x \<eta>) = {}

goal (1 subgoal):
 1. (subst_lit x \<eta>, subst_lit L2 \<eta>) \<in> lit_ord
[PROOF STEP]
using max_pos_lit_dominates_cl [of L2 \<eta> Cl_C2 lhs rhs x ?I]
[PROOF STATE]
proof (prove)
using this:
vars_of_lit (subst_lit x \<eta>) = {}
x \<in> cl_ecl C2 - {L2}
maximal_literal gr_L2 gr_Cl_C2
Cl_C2 = cl_ecl C2
gr_L2 = subst_lit L2 \<eta>
gr_Cl_C2 = subst_cl Cl_C2 \<eta>
orient_lit_inst L2 lhs rhs pos \<eta>
\<not> equivalent_eq_exists lhs rhs Cl_C2 (same_values (\<lambda>t. trm_rep t S)) \<eta> L2
fo_interpretation (same_values (\<lambda>t. trm_rep t S))
vars_of_lit gr_L2 = {}
vars_of_lit (subst_lit x \<eta>) = {}
\<lbrakk>maximal_literal (subst_lit L2 \<eta>) (subst_cl Cl_C2 \<eta>); orient_lit_inst L2 lhs rhs pos \<eta>; x \<in> Cl_C2 - {L2}; \<not> equivalent_eq_exists lhs rhs Cl_C2 (same_values (\<lambda>t. trm_rep t S)) \<eta> L2; vars_of_lit (subst_lit L2 \<eta>) = {}; vars_of_lit (subst_lit x \<eta>) = {}; fo_interpretation (same_values (\<lambda>t. trm_rep t S))\<rbrakk> \<Longrightarrow> (subst_lit x \<eta>, subst_lit L2 \<eta>) \<in> lit_ord

goal (1 subgoal):
 1. (subst_lit x \<eta>, subst_lit L2 \<eta>) \<in> lit_ord
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
(subst_lit x \<eta>, subst_lit L2 \<eta>) \<in> lit_ord

goal (1 subgoal):
 1. \<And>x. x \<in> cl_ecl C2 - {L2} \<Longrightarrow> (subst_lit x \<sigma>', subst_lit L2 \<sigma>') \<in> lit_ord
[PROOF STEP]
from \<open>L2 \<in> Cl_C2\<close>
[PROOF STATE]
proof (chain)
picking this:
L2 \<in> Cl_C2
[PROOF STEP]
have "vars_of_lit L2 \<subseteq> vars_of_cl Cl_C2"
[PROOF STATE]
proof (prove)
using this:
L2 \<in> Cl_C2

goal (1 subgoal):
 1. vars_of_lit L2 \<subseteq> vars_of_cl Cl_C2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
vars_of_lit L2 \<subseteq> vars_of_cl Cl_C2

goal (1 subgoal):
 1. \<And>x. x \<in> cl_ecl C2 - {L2} \<Longrightarrow> (subst_lit x \<sigma>', subst_lit L2 \<sigma>') \<in> lit_ord
[PROOF STEP]
from this and \<open>coincide_on \<sigma>' \<eta> (vars_of_cl (cl_ecl C2))\<close> and \<open>Cl_C2 = cl_ecl C2\<close>
[PROOF STATE]
proof (chain)
picking this:
vars_of_lit L2 \<subseteq> vars_of_cl Cl_C2
coincide_on \<sigma>' \<eta> (vars_of_cl (cl_ecl C2))
Cl_C2 = cl_ecl C2
[PROOF STEP]
have "coincide_on \<sigma>' \<eta> (vars_of_lit L2)"
[PROOF STATE]
proof (prove)
using this:
vars_of_lit L2 \<subseteq> vars_of_cl Cl_C2
coincide_on \<sigma>' \<eta> (vars_of_cl (cl_ecl C2))
Cl_C2 = cl_ecl C2

goal (1 subgoal):
 1. coincide_on \<sigma>' \<eta> (vars_of_lit L2)
[PROOF STEP]
unfolding coincide_on_def
[PROOF STATE]
proof (prove)
using this:
vars_of_lit L2 \<subseteq> vars_of_cl Cl_C2
\<forall>x\<in>vars_of_cl (cl_ecl C2). Var x \<lhd> \<sigma>' = Var x \<lhd> \<eta>
Cl_C2 = cl_ecl C2

goal (1 subgoal):
 1. \<forall>x\<in>vars_of_lit L2. Var x \<lhd> \<sigma>' = Var x \<lhd> \<eta>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
coincide_on \<sigma>' \<eta> (vars_of_lit L2)

goal (1 subgoal):
 1. \<And>x. x \<in> cl_ecl C2 - {L2} \<Longrightarrow> (subst_lit x \<sigma>', subst_lit L2 \<sigma>') \<in> lit_ord
[PROOF STEP]
from this
[PROOF STATE]
proof (chain)
picking this:
coincide_on \<sigma>' \<eta> (vars_of_lit L2)
[PROOF STEP]
have "subst_lit L2 \<sigma>' = subst_lit L2 \<eta>"
[PROOF STATE]
proof (prove)
using this:
coincide_on \<sigma>' \<eta> (vars_of_lit L2)

goal (1 subgoal):
 1. subst_lit L2 \<sigma>' = subst_lit L2 \<eta>
[PROOF STEP]
using coincide_on_lit
[PROOF STATE]
proof (prove)
using this:
coincide_on \<sigma>' \<eta> (vars_of_lit L2)
coincide_on ?\<sigma> ?\<eta> (vars_of_lit ?l) \<Longrightarrow> subst_lit ?l ?\<sigma> = subst_lit ?l ?\<eta>

goal (1 subgoal):
 1. subst_lit L2 \<sigma>' = subst_lit L2 \<eta>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
subst_lit L2 \<sigma>' = subst_lit L2 \<eta>

goal (1 subgoal):
 1. \<And>x. x \<in> cl_ecl C2 - {L2} \<Longrightarrow> (subst_lit x \<sigma>', subst_lit L2 \<sigma>') \<in> lit_ord
[PROOF STEP]
from \<open>x \<in> (cl_ecl C2) - {L2}\<close>
[PROOF STATE]
proof (chain)
picking this:
x \<in> cl_ecl C2 - {L2}
[PROOF STEP]
have "x \<in> cl_ecl C2"
[PROOF STATE]
proof (prove)
using this:
x \<in> cl_ecl C2 - {L2}

goal (1 subgoal):
 1. x \<in> cl_ecl C2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x \<in> cl_ecl C2

goal (1 subgoal):
 1. \<And>x. x \<in> cl_ecl C2 - {L2} \<Longrightarrow> (subst_lit x \<sigma>', subst_lit L2 \<sigma>') \<in> lit_ord
[PROOF STEP]
from this
[PROOF STATE]
proof (chain)
picking this:
x \<in> cl_ecl C2
[PROOF STEP]
have "vars_of_lit x \<subseteq> vars_of_cl (cl_ecl C2)"
[PROOF STATE]
proof (prove)
using this:
x \<in> cl_ecl C2

goal (1 subgoal):
 1. vars_of_lit x \<subseteq> vars_of_cl (cl_ecl C2)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
vars_of_lit x \<subseteq> vars_of_cl (cl_ecl C2)

goal (1 subgoal):
 1. \<And>x. x \<in> cl_ecl C2 - {L2} \<Longrightarrow> (subst_lit x \<sigma>', subst_lit L2 \<sigma>') \<in> lit_ord
[PROOF STEP]
from this and \<open>coincide_on \<sigma>' \<eta> (vars_of_cl (cl_ecl C2))\<close>
[PROOF STATE]
proof (chain)
picking this:
vars_of_lit x \<subseteq> vars_of_cl (cl_ecl C2)
coincide_on \<sigma>' \<eta> (vars_of_cl (cl_ecl C2))
[PROOF STEP]
have "coincide_on \<sigma>' \<eta> (vars_of_lit x)"
[PROOF STATE]
proof (prove)
using this:
vars_of_lit x \<subseteq> vars_of_cl (cl_ecl C2)
coincide_on \<sigma>' \<eta> (vars_of_cl (cl_ecl C2))

goal (1 subgoal):
 1. coincide_on \<sigma>' \<eta> (vars_of_lit x)
[PROOF STEP]
unfolding coincide_on_def
[PROOF STATE]
proof (prove)
using this:
vars_of_lit x \<subseteq> vars_of_cl (cl_ecl C2)
\<forall>x\<in>vars_of_cl (cl_ecl C2). Var x \<lhd> \<sigma>' = Var x \<lhd> \<eta>

goal (1 subgoal):
 1. \<forall>x\<in>vars_of_lit x. Var x \<lhd> \<sigma>' = Var x \<lhd> \<eta>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
coincide_on \<sigma>' \<eta> (vars_of_lit x)

goal (1 subgoal):
 1. \<And>x. x \<in> cl_ecl C2 - {L2} \<Longrightarrow> (subst_lit x \<sigma>', subst_lit L2 \<sigma>') \<in> lit_ord
[PROOF STEP]
from this
[PROOF STATE]
proof (chain)
picking this:
coincide_on \<sigma>' \<eta> (vars_of_lit x)
[PROOF STEP]
have "subst_lit x \<sigma>' = subst_lit x \<eta>"
[PROOF STATE]
proof (prove)
using this:
coincide_on \<sigma>' \<eta> (vars_of_lit x)

goal (1 subgoal):
 1. subst_lit x \<sigma>' = subst_lit x \<eta>
[PROOF STEP]
using coincide_on_lit
[PROOF STATE]
proof (prove)
using this:
coincide_on \<sigma>' \<eta> (vars_of_lit x)
coincide_on ?\<sigma> ?\<eta> (vars_of_lit ?l) \<Longrightarrow> subst_lit ?l ?\<sigma> = subst_lit ?l ?\<eta>

goal (1 subgoal):
 1. subst_lit x \<sigma>' = subst_lit x \<eta>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
subst_lit x \<sigma>' = subst_lit x \<eta>

goal (1 subgoal):
 1. \<And>x. x \<in> cl_ecl C2 - {L2} \<Longrightarrow> (subst_lit x \<sigma>', subst_lit L2 \<sigma>') \<in> lit_ord
[PROOF STEP]
from \<open>(subst_lit x \<eta>, subst_lit L2 \<eta>) \<in> lit_ord\<close>
      \<open>subst_lit L2 \<sigma>' = subst_lit L2 \<eta>\<close>
      \<open>subst_lit x \<sigma>' = subst_lit x \<eta>\<close>
[PROOF STATE]
proof (chain)
picking this:
(subst_lit x \<eta>, subst_lit L2 \<eta>) \<in> lit_ord
subst_lit L2 \<sigma>' = subst_lit L2 \<eta>
subst_lit x \<sigma>' = subst_lit x \<eta>
[PROOF STEP]
show "(subst_lit x \<sigma>',subst_lit L2 \<sigma>') \<in> lit_ord"
[PROOF STATE]
proof (prove)
using this:
(subst_lit x \<eta>, subst_lit L2 \<eta>) \<in> lit_ord
subst_lit L2 \<sigma>' = subst_lit L2 \<eta>
subst_lit x \<sigma>' = subst_lit x \<eta>

goal (1 subgoal):
 1. (subst_lit x \<sigma>', subst_lit L2 \<sigma>') \<in> lit_ord
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
(subst_lit x \<sigma>', subst_lit L2 \<sigma>') \<in> lit_ord

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>x\<in>cl_ecl C2 - {L2}. (subst_lit x \<sigma>', subst_lit L2 \<sigma>') \<in> lit_ord

goal (1 subgoal):
 1. \<exists>\<sigma>' u u' p v D L2. reduction L1 C \<sigma>' t s polarity L2 u u' p v D (same_values (\<lambda>t. trm_rep t S)) S \<sigma> \<and> variable_disjoint C D
[PROOF STEP]
have "all_trms_irreducible (subst_set (trms_ecl C2) \<sigma>') (\<lambda>t. trm_rep t S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. all_trms_irreducible (subst_set (trms_ecl C2) \<sigma>') (\<lambda>t. trm_rep t S)
[PROOF STEP]
proof (rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> all_trms_irreducible (subst_set (trms_ecl C2) \<sigma>') (\<lambda>t. trm_rep t S) \<Longrightarrow> False
[PROOF STEP]
assume "\<not>all_trms_irreducible (subst_set (trms_ecl C2) \<sigma>') (\<lambda>t. trm_rep t S)"
[PROOF STATE]
proof (state)
this:
\<not> all_trms_irreducible (subst_set (trms_ecl C2) \<sigma>') (\<lambda>t. trm_rep t S)

goal (1 subgoal):
 1. \<not> all_trms_irreducible (subst_set (trms_ecl C2) \<sigma>') (\<lambda>t. trm_rep t S) \<Longrightarrow> False
[PROOF STEP]
from this
[PROOF STATE]
proof (chain)
picking this:
\<not> all_trms_irreducible (subst_set (trms_ecl C2) \<sigma>') (\<lambda>t. trm_rep t S)
[PROOF STEP]
obtain x y where "x \<in> (subst_set (trms_ecl C2) \<sigma>')" and "occurs_in y x"
      and "trm_rep y S \<noteq> y"
[PROOF STATE]
proof (prove)
using this:
\<not> all_trms_irreducible (subst_set (trms_ecl C2) \<sigma>') (\<lambda>t. trm_rep t S)

goal (1 subgoal):
 1. (\<And>x y. \<lbrakk>x \<in> subst_set (trms_ecl C2) \<sigma>'; occurs_in y x; trm_rep y S \<noteq> y\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding all_trms_irreducible_def
[PROOF STATE]
proof (prove)
using this:
\<not> (\<forall>x y. x \<in> subst_set (trms_ecl C2) \<sigma>' \<longrightarrow> occurs_in y x \<longrightarrow> trm_rep y S = y)

goal (1 subgoal):
 1. (\<And>x y. \<lbrakk>x \<in> subst_set (trms_ecl C2) \<sigma>'; occurs_in y x; trm_rep y S \<noteq> y\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
x \<in> subst_set (trms_ecl C2) \<sigma>'
occurs_in y x
trm_rep y S \<noteq> y

goal (1 subgoal):
 1. \<not> all_trms_irreducible (subst_set (trms_ecl C2) \<sigma>') (\<lambda>t. trm_rep t S) \<Longrightarrow> False
[PROOF STEP]
from \<open>x \<in> (subst_set (trms_ecl C2) \<sigma>')\<close>
[PROOF STATE]
proof (chain)
picking this:
x \<in> subst_set (trms_ecl C2) \<sigma>'
[PROOF STEP]
obtain x' where "x' \<in> trms_ecl C2"
      and "x = (subst x' \<sigma>')"
[PROOF STATE]
proof (prove)
using this:
x \<in> subst_set (trms_ecl C2) \<sigma>'

goal (1 subgoal):
 1. (\<And>x'. \<lbrakk>x' \<in> trms_ecl C2; x = x' \<lhd> \<sigma>'\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x' \<in> trms_ecl C2
x = x' \<lhd> \<sigma>'

goal (1 subgoal):
 1. \<not> all_trms_irreducible (subst_set (trms_ecl C2) \<sigma>') (\<lambda>t. trm_rep t S) \<Longrightarrow> False
[PROOF STEP]
from assms(11) and \<open>x' \<in> (trms_ecl C2)\<close> and \<open>C2 \<in> S\<close>
[PROOF STATE]
proof (chain)
picking this:
Ball S well_constrained
x' \<in> trms_ecl C2
C2 \<in> S
[PROOF STEP]
have "dom_trm x' (cl_ecl C2)"
[PROOF STATE]
proof (prove)
using this:
Ball S well_constrained
x' \<in> trms_ecl C2
C2 \<in> S

goal (1 subgoal):
 1. dom_trm x' (cl_ecl C2)
[PROOF STEP]
unfolding Ball_def well_constrained_def
[PROOF STATE]
proof (prove)
using this:
\<forall>x. x \<in> S \<longrightarrow> (\<forall>y. y \<in> trms_ecl x \<longrightarrow> dom_trm y (cl_ecl x))
x' \<in> trms_ecl C2
C2 \<in> S

goal (1 subgoal):
 1. dom_trm x' (cl_ecl C2)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
dom_trm x' (cl_ecl C2)

goal (1 subgoal):
 1. \<not> all_trms_irreducible (subst_set (trms_ecl C2) \<sigma>') (\<lambda>t. trm_rep t S) \<Longrightarrow> False
[PROOF STEP]
from this
[PROOF STATE]
proof (chain)
picking this:
dom_trm x' (cl_ecl C2)
[PROOF STEP]
obtain x''
       where "x'' \<in> subterms_of_cl (cl_ecl C2)" and "x'' = x' \<or> (x',x'') \<in> trm_ord"
[PROOF STATE]
proof (prove)
using this:
dom_trm x' (cl_ecl C2)

goal (1 subgoal):
 1. (\<And>x''. \<lbrakk>x'' \<in> subterms_of_cl (cl_ecl C2); x'' = x' \<or> (x', x'') \<in> trm_ord\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using dom_trm_lemma
[PROOF STATE]
proof (prove)
using this:
dom_trm x' (cl_ecl C2)
dom_trm ?t ?C \<Longrightarrow> \<exists>u. u \<in> subterms_of_cl ?C \<and> (u = ?t \<or> (?t, u) \<in> trm_ord)

goal (1 subgoal):
 1. (\<And>x''. \<lbrakk>x'' \<in> subterms_of_cl (cl_ecl C2); x'' = x' \<or> (x', x'') \<in> trm_ord\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
x'' \<in> subterms_of_cl (cl_ecl C2)
x'' = x' \<or> (x', x'') \<in> trm_ord

goal (1 subgoal):
 1. \<not> all_trms_irreducible (subst_set (trms_ecl C2) \<sigma>') (\<lambda>t. trm_rep t S) \<Longrightarrow> False
[PROOF STEP]
from \<open>dom_trm x' (cl_ecl C2)\<close>
[PROOF STATE]
proof (chain)
picking this:
dom_trm x' (cl_ecl C2)
[PROOF STEP]
have "vars_of x'  \<subseteq> vars_of_cl (cl_ecl C2)"
[PROOF STATE]
proof (prove)
using this:
dom_trm x' (cl_ecl C2)

goal (1 subgoal):
 1. vars_of x' \<subseteq> vars_of_cl (cl_ecl C2)
[PROOF STEP]
using dom_trm_vars
[PROOF STATE]
proof (prove)
using this:
dom_trm x' (cl_ecl C2)
dom_trm ?t ?C \<Longrightarrow> vars_of ?t \<subseteq> vars_of_cl ?C

goal (1 subgoal):
 1. vars_of x' \<subseteq> vars_of_cl (cl_ecl C2)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
vars_of x' \<subseteq> vars_of_cl (cl_ecl C2)

goal (1 subgoal):
 1. \<not> all_trms_irreducible (subst_set (trms_ecl C2) \<sigma>') (\<lambda>t. trm_rep t S) \<Longrightarrow> False
[PROOF STEP]
from this and \<open>coincide_on \<sigma>' \<eta> (vars_of_cl (cl_ecl C2))\<close>
[PROOF STATE]
proof (chain)
picking this:
vars_of x' \<subseteq> vars_of_cl (cl_ecl C2)
coincide_on \<sigma>' \<eta> (vars_of_cl (cl_ecl C2))
[PROOF STEP]
have "coincide_on \<sigma>' \<eta> (vars_of x')"
[PROOF STATE]
proof (prove)
using this:
vars_of x' \<subseteq> vars_of_cl (cl_ecl C2)
coincide_on \<sigma>' \<eta> (vars_of_cl (cl_ecl C2))

goal (1 subgoal):
 1. coincide_on \<sigma>' \<eta> (vars_of x')
[PROOF STEP]
unfolding coincide_on_def
[PROOF STATE]
proof (prove)
using this:
vars_of x' \<subseteq> vars_of_cl (cl_ecl C2)
\<forall>x\<in>vars_of_cl (cl_ecl C2). Var x \<lhd> \<sigma>' = Var x \<lhd> \<eta>

goal (1 subgoal):
 1. \<forall>x\<in>vars_of x'. Var x \<lhd> \<sigma>' = Var x \<lhd> \<eta>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
coincide_on \<sigma>' \<eta> (vars_of x')

goal (1 subgoal):
 1. \<not> all_trms_irreducible (subst_set (trms_ecl C2) \<sigma>') (\<lambda>t. trm_rep t S) \<Longrightarrow> False
[PROOF STEP]
from this
[PROOF STATE]
proof (chain)
picking this:
coincide_on \<sigma>' \<eta> (vars_of x')
[PROOF STEP]
have "(subst x' \<eta>) = (subst x' \<sigma>')"
[PROOF STATE]
proof (prove)
using this:
coincide_on \<sigma>' \<eta> (vars_of x')

goal (1 subgoal):
 1. x' \<lhd> \<eta> = x' \<lhd> \<sigma>'
[PROOF STEP]
using coincide_on_term
[PROOF STATE]
proof (prove)
using this:
coincide_on \<sigma>' \<eta> (vars_of x')
coincide_on ?\<sigma> ?\<eta> (vars_of ?t) \<Longrightarrow> ?t \<lhd> ?\<sigma> = ?t \<lhd> ?\<eta>

goal (1 subgoal):
 1. x' \<lhd> \<eta> = x' \<lhd> \<sigma>'
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
x' \<lhd> \<eta> = x' \<lhd> \<sigma>'

goal (1 subgoal):
 1. \<not> all_trms_irreducible (subst_set (trms_ecl C2) \<sigma>') (\<lambda>t. trm_rep t S) \<Longrightarrow> False
[PROOF STEP]
from this and \<open>x = (subst x' \<sigma>')\<close>
[PROOF STATE]
proof (chain)
picking this:
x' \<lhd> \<eta> = x' \<lhd> \<sigma>'
x = x' \<lhd> \<sigma>'
[PROOF STEP]
have "x = (subst x' \<eta>)"
[PROOF STATE]
proof (prove)
using this:
x' \<lhd> \<eta> = x' \<lhd> \<sigma>'
x = x' \<lhd> \<sigma>'

goal (1 subgoal):
 1. x = x' \<lhd> \<eta>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x = x' \<lhd> \<eta>

goal (1 subgoal):
 1. \<not> all_trms_irreducible (subst_set (trms_ecl C2) \<sigma>') (\<lambda>t. trm_rep t S) \<Longrightarrow> False
[PROOF STEP]
from this and \<open>x' \<in> trms_ecl C2\<close>
[PROOF STATE]
proof (chain)
picking this:
x = x' \<lhd> \<eta>
x' \<in> trms_ecl C2
[PROOF STEP]
have "x \<in>(subst_set (trms_ecl C2) \<eta>)"
[PROOF STATE]
proof (prove)
using this:
x = x' \<lhd> \<eta>
x' \<in> trms_ecl C2

goal (1 subgoal):
 1. x \<in> subst_set (trms_ecl C2) \<eta>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x \<in> subst_set (trms_ecl C2) \<eta>

goal (1 subgoal):
 1. \<not> all_trms_irreducible (subst_set (trms_ecl C2) \<sigma>') (\<lambda>t. trm_rep t S) \<Longrightarrow> False
[PROOF STEP]
from \<open>x'' \<in> (subterms_of_cl (cl_ecl C2))\<close>
[PROOF STATE]
proof (chain)
picking this:
x'' \<in> subterms_of_cl (cl_ecl C2)
[PROOF STEP]
have
        "(subst x'' \<eta>) \<in> (subterms_of_cl (subst_cl (cl_ecl C2) \<eta>))"
[PROOF STATE]
proof (prove)
using this:
x'' \<in> subterms_of_cl (cl_ecl C2)

goal (1 subgoal):
 1. x'' \<lhd> \<eta> \<in> subterms_of_cl (subst_cl (cl_ecl C2) \<eta>)
[PROOF STEP]
using subterm_cl_subst [of x'' "cl_ecl C2"]
[PROOF STATE]
proof (prove)
using this:
x'' \<in> subterms_of_cl (cl_ecl C2)
x'' \<in> subterms_of_cl (cl_ecl C2) \<Longrightarrow> x'' \<lhd> ?\<sigma> \<in> subterms_of_cl (subst_cl (cl_ecl C2) ?\<sigma>)

goal (1 subgoal):
 1. x'' \<lhd> \<eta> \<in> subterms_of_cl (subst_cl (cl_ecl C2) \<eta>)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x'' \<lhd> \<eta> \<in> subterms_of_cl (subst_cl (cl_ecl C2) \<eta>)

goal (1 subgoal):
 1. \<not> all_trms_irreducible (subst_set (trms_ecl C2) \<sigma>') (\<lambda>t. trm_rep t S) \<Longrightarrow> False
[PROOF STEP]
from \<open>orient_lit_inst L2 lhs rhs pos \<eta>\<close> \<open>gr_rhs = (subst rhs \<eta>)\<close>
      \<open>gr_L2 = (subst_lit L2 \<eta>)\<close>
[PROOF STATE]
proof (chain)
picking this:
orient_lit_inst L2 lhs rhs pos \<eta>
gr_rhs = rhs \<lhd> \<eta>
gr_L2 = subst_lit L2 \<eta>
[PROOF STEP]
have "orient_lit gr_L2  (subst lhs \<eta>) gr_rhs pos"
[PROOF STATE]
proof (prove)
using this:
orient_lit_inst L2 lhs rhs pos \<eta>
gr_rhs = rhs \<lhd> \<eta>
gr_L2 = subst_lit L2 \<eta>

goal (1 subgoal):
 1. orient_lit gr_L2 (lhs \<lhd> \<eta>) gr_rhs pos
[PROOF STEP]
using lift_orient_lit
[PROOF STATE]
proof (prove)
using this:
orient_lit_inst L2 lhs rhs pos \<eta>
gr_rhs = rhs \<lhd> \<eta>
gr_L2 = subst_lit L2 \<eta>
orient_lit_inst ?L ?t ?s ?p ?\<sigma> \<Longrightarrow> orient_lit (subst_lit ?L ?\<sigma>) (?t \<lhd> ?\<sigma>) (?s \<lhd> ?\<sigma>) ?p

goal (1 subgoal):
 1. orient_lit gr_L2 (lhs \<lhd> \<eta>) gr_rhs pos
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
orient_lit gr_L2 (lhs \<lhd> \<eta>) gr_rhs pos

goal (1 subgoal):
 1. \<not> all_trms_irreducible (subst_set (trms_ecl C2) \<sigma>') (\<lambda>t. trm_rep t S) \<Longrightarrow> False
[PROOF STEP]
from \<open>ground_clause gr_Cl_C2\<close>
[PROOF STATE]
proof (chain)
picking this:
ground_clause gr_Cl_C2
[PROOF STEP]
have "vars_of_cl gr_Cl_C2 = {}"
[PROOF STATE]
proof (prove)
using this:
ground_clause gr_Cl_C2

goal (1 subgoal):
 1. vars_of_cl gr_Cl_C2 = {}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
vars_of_cl gr_Cl_C2 = {}

goal (1 subgoal):
 1. \<not> all_trms_irreducible (subst_set (trms_ecl C2) \<sigma>') (\<lambda>t. trm_rep t S) \<Longrightarrow> False
[PROOF STEP]
from  \<open>vars_of_lit gr_L2 = {}\<close> \<open>vars_of_cl gr_Cl_C2 = {}\<close>
    \<open>(subst x'' \<eta>) \<in> (subterms_of_cl (subst_cl (cl_ecl C2) \<eta>))\<close>
    \<open>orient_lit gr_L2 (subst lhs \<eta>) gr_rhs pos\<close> \<open>maximal_literal gr_L2 gr_Cl_C2\<close>
    \<open>Cl_C2 = cl_ecl C2\<close> \<open>gr_L2 = (subst_lit L2 \<eta>)\<close>
    \<open>gr_Cl_C2 = (subst_cl Cl_C2 \<eta>)\<close> \<open>v = (subst lhs \<eta>)\<close> \<open>v = (subst lhs \<eta>)\<close>
[PROOF STATE]
proof (chain)
picking this:
vars_of_lit gr_L2 = {}
vars_of_cl gr_Cl_C2 = {}
x'' \<lhd> \<eta> \<in> subterms_of_cl (subst_cl (cl_ecl C2) \<eta>)
orient_lit gr_L2 (lhs \<lhd> \<eta>) gr_rhs pos
maximal_literal gr_L2 gr_Cl_C2
Cl_C2 = cl_ecl C2
gr_L2 = subst_lit L2 \<eta>
gr_Cl_C2 = subst_cl Cl_C2 \<eta>
v = lhs \<lhd> \<eta>
v = lhs \<lhd> \<eta>
[PROOF STEP]
have "(subst x'' \<eta>) = v \<or> (((subst x'' \<eta>),v) \<in> trm_ord)"
[PROOF STATE]
proof (prove)
using this:
vars_of_lit gr_L2 = {}
vars_of_cl gr_Cl_C2 = {}
x'' \<lhd> \<eta> \<in> subterms_of_cl (subst_cl (cl_ecl C2) \<eta>)
orient_lit gr_L2 (lhs \<lhd> \<eta>) gr_rhs pos
maximal_literal gr_L2 gr_Cl_C2
Cl_C2 = cl_ecl C2
gr_L2 = subst_lit L2 \<eta>
gr_Cl_C2 = subst_cl Cl_C2 \<eta>
v = lhs \<lhd> \<eta>
v = lhs \<lhd> \<eta>

goal (1 subgoal):
 1. x'' \<lhd> \<eta> = v \<or> (x'' \<lhd> \<eta>, v) \<in> trm_ord
[PROOF STEP]
using subterms_dominated [of gr_L2 gr_Cl_C2  "(subst lhs \<eta>)" gr_rhs pos "subst x'' \<eta>"]
[PROOF STATE]
proof (prove)
using this:
vars_of_lit gr_L2 = {}
vars_of_cl gr_Cl_C2 = {}
x'' \<lhd> \<eta> \<in> subterms_of_cl (subst_cl (cl_ecl C2) \<eta>)
orient_lit gr_L2 (lhs \<lhd> \<eta>) gr_rhs pos
maximal_literal gr_L2 gr_Cl_C2
Cl_C2 = cl_ecl C2
gr_L2 = subst_lit L2 \<eta>
gr_Cl_C2 = subst_cl Cl_C2 \<eta>
v = lhs \<lhd> \<eta>
v = lhs \<lhd> \<eta>
\<lbrakk>maximal_literal gr_L2 gr_Cl_C2; orient_lit gr_L2 (lhs \<lhd> \<eta>) gr_rhs pos; x'' \<lhd> \<eta> \<in> subterms_of_cl gr_Cl_C2; vars_of_lit gr_L2 = {}; vars_of_cl gr_Cl_C2 = {}\<rbrakk> \<Longrightarrow> x'' \<lhd> \<eta> = lhs \<lhd> \<eta> \<or> (x'' \<lhd> \<eta>, lhs \<lhd> \<eta>) \<in> trm_ord

goal (1 subgoal):
 1. x'' \<lhd> \<eta> = v \<or> (x'' \<lhd> \<eta>, v) \<in> trm_ord
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
x'' \<lhd> \<eta> = v \<or> (x'' \<lhd> \<eta>, v) \<in> trm_ord

goal (1 subgoal):
 1. \<not> all_trms_irreducible (subst_set (trms_ecl C2) \<sigma>') (\<lambda>t. trm_rep t S) \<Longrightarrow> False
[PROOF STEP]
from \<open>x'' = x' \<or> (x',x'') \<in> trm_ord\<close>  \<open>x = (subst x' \<eta>)\<close>
[PROOF STATE]
proof (chain)
picking this:
x'' = x' \<or> (x', x'') \<in> trm_ord
x = x' \<lhd> \<eta>
[PROOF STEP]
have
      "(subst x'' \<eta>) = x \<or> (x,(subst x'' \<eta>)) \<in> trm_ord"
[PROOF STATE]
proof (prove)
using this:
x'' = x' \<or> (x', x'') \<in> trm_ord
x = x' \<lhd> \<eta>

goal (1 subgoal):
 1. x'' \<lhd> \<eta> = x \<or> (x, x'' \<lhd> \<eta>) \<in> trm_ord
[PROOF STEP]
using trm_ord_subst
[PROOF STATE]
proof (prove)
using this:
x'' = x' \<or> (x', x'') \<in> trm_ord
x = x' \<lhd> \<eta>
\<forall>s x y. (x, y) \<in> trm_ord \<longrightarrow> (x \<lhd> s, y \<lhd> s) \<in> trm_ord

goal (1 subgoal):
 1. x'' \<lhd> \<eta> = x \<or> (x, x'' \<lhd> \<eta>) \<in> trm_ord
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
x'' \<lhd> \<eta> = x \<or> (x, x'' \<lhd> \<eta>) \<in> trm_ord

goal (1 subgoal):
 1. \<not> all_trms_irreducible (subst_set (trms_ecl C2) \<sigma>') (\<lambda>t. trm_rep t S) \<Longrightarrow> False
[PROOF STEP]
from this and \<open>(subst x'' \<eta>) = v \<or> (((subst x'' \<eta>),v) \<in> trm_ord)\<close>
[PROOF STATE]
proof (chain)
picking this:
x'' \<lhd> \<eta> = x \<or> (x, x'' \<lhd> \<eta>) \<in> trm_ord
x'' \<lhd> \<eta> = v \<or> (x'' \<lhd> \<eta>, v) \<in> trm_ord
[PROOF STEP]
have "x = v \<or> ((x,v) \<in> trm_ord)"
[PROOF STATE]
proof (prove)
using this:
x'' \<lhd> \<eta> = x \<or> (x, x'' \<lhd> \<eta>) \<in> trm_ord
x'' \<lhd> \<eta> = v \<or> (x'' \<lhd> \<eta>, v) \<in> trm_ord

goal (1 subgoal):
 1. x = v \<or> (x, v) \<in> trm_ord
[PROOF STEP]
using trm_ord_trans trans_def
[PROOF STATE]
proof (prove)
using this:
x'' \<lhd> \<eta> = x \<or> (x, x'' \<lhd> \<eta>) \<in> trm_ord
x'' \<lhd> \<eta> = v \<or> (x'' \<lhd> \<eta>, v) \<in> trm_ord
trans trm_ord
trans ?r = (\<forall>x y z. (x, y) \<in> ?r \<longrightarrow> (y, z) \<in> ?r \<longrightarrow> (x, z) \<in> ?r)

goal (1 subgoal):
 1. x = v \<or> (x, v) \<in> trm_ord
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
x = v \<or> (x, v) \<in> trm_ord

goal (1 subgoal):
 1. \<not> all_trms_irreducible (subst_set (trms_ecl C2) \<sigma>') (\<lambda>t. trm_rep t S) \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x = v \<or> (x, v) \<in> trm_ord
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
x = v \<or> (x, v) \<in> trm_ord

goal (1 subgoal):
 1. False
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. x = v \<Longrightarrow> False
 2. (x, v) \<in> trm_ord \<Longrightarrow> False
[PROOF STEP]
assume "x = v"
[PROOF STATE]
proof (state)
this:
x = v

goal (2 subgoals):
 1. x = v \<Longrightarrow> False
 2. (x, v) \<in> trm_ord \<Longrightarrow> False
[PROOF STEP]
from this and \<open>v \<notin> subst_set (trms_ecl C2) \<eta>\<close>
      \<open>x \<in> (subst_set (trms_ecl C2) \<eta>)\<close>
[PROOF STATE]
proof (chain)
picking this:
x = v
v \<notin> subst_set (trms_ecl C2) \<eta>
x \<in> subst_set (trms_ecl C2) \<eta>
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
x = v
v \<notin> subst_set (trms_ecl C2) \<eta>
x \<in> subst_set (trms_ecl C2) \<eta>

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

goal (1 subgoal):
 1. (x, v) \<in> trm_ord \<Longrightarrow> False
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (x, v) \<in> trm_ord \<Longrightarrow> False
[PROOF STEP]
assume "(x,v) \<in> trm_ord"
[PROOF STATE]
proof (state)
this:
(x, v) \<in> trm_ord

goal (1 subgoal):
 1. (x, v) \<in> trm_ord \<Longrightarrow> False
[PROOF STEP]
from \<open>occurs_in y x\<close>
[PROOF STATE]
proof (chain)
picking this:
occurs_in y x
[PROOF STEP]
have "y = x \<or> (y,x) \<in> trm_ord"
[PROOF STATE]
proof (prove)
using this:
occurs_in y x

goal (1 subgoal):
 1. y = x \<or> (y, x) \<in> trm_ord
[PROOF STEP]
unfolding occurs_in_def
[PROOF STATE]
proof (prove)
using this:
\<exists>p. subterm x p y

goal (1 subgoal):
 1. y = x \<or> (y, x) \<in> trm_ord
[PROOF STEP]
using subterm_trm_ord_eq
[PROOF STATE]
proof (prove)
using this:
\<exists>p. subterm x p y
subterm ?t ?p ?s \<Longrightarrow> ?s = ?t \<or> (?s, ?t) \<in> trm_ord

goal (1 subgoal):
 1. y = x \<or> (y, x) \<in> trm_ord
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
y = x \<or> (y, x) \<in> trm_ord

goal (1 subgoal):
 1. (x, v) \<in> trm_ord \<Longrightarrow> False
[PROOF STEP]
from this and \<open>(x,v) \<in> trm_ord\<close>
[PROOF STATE]
proof (chain)
picking this:
y = x \<or> (y, x) \<in> trm_ord
(x, v) \<in> trm_ord
[PROOF STEP]
have "(y,v) \<in> trm_ord"
[PROOF STATE]
proof (prove)
using this:
y = x \<or> (y, x) \<in> trm_ord
(x, v) \<in> trm_ord

goal (1 subgoal):
 1. (y, v) \<in> trm_ord
[PROOF STEP]
using trm_ord_trans
[PROOF STATE]
proof (prove)
using this:
y = x \<or> (y, x) \<in> trm_ord
(x, v) \<in> trm_ord
trans trm_ord

goal (1 subgoal):
 1. (y, v) \<in> trm_ord
[PROOF STEP]
unfolding trans_def
[PROOF STATE]
proof (prove)
using this:
y = x \<or> (y, x) \<in> trm_ord
(x, v) \<in> trm_ord
\<forall>x y z. (x, y) \<in> trm_ord \<longrightarrow> (y, z) \<in> trm_ord \<longrightarrow> (x, z) \<in> trm_ord

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

goal (1 subgoal):
 1. (x, v) \<in> trm_ord \<Longrightarrow> False
[PROOF STEP]
from this and norm and \<open>trm_rep y S \<noteq> y\<close> and \<open>occurs_in y x\<close> and \<open>x' \<in> trms_ecl C2\<close>
        and \<open>x = (subst x' \<eta>)\<close>
[PROOF STATE]
proof (chain)
picking this:
(y, v) \<in> trm_ord
\<forall>x. (\<exists>x'\<in>trms_ecl C2. occurs_in x (x' \<lhd> \<eta>)) \<longrightarrow> (x, v) \<in> trm_ord \<longrightarrow> trm_rep x S = x
trm_rep y S \<noteq> y
occurs_in y x
x' \<in> trms_ecl C2
x = x' \<lhd> \<eta>
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
(y, v) \<in> trm_ord
\<forall>x. (\<exists>x'\<in>trms_ecl C2. occurs_in x (x' \<lhd> \<eta>)) \<longrightarrow> (x, v) \<in> trm_ord \<longrightarrow> trm_rep x S = x
trm_rep y S \<noteq> y
occurs_in y x
x' \<in> trms_ecl C2
x = x' \<lhd> \<eta>

goal (1 subgoal):
 1. False
[PROOF STEP]
by metis
[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:
all_trms_irreducible (subst_set (trms_ecl C2) \<sigma>') (\<lambda>t. trm_rep t S)

goal (1 subgoal):
 1. \<exists>\<sigma>' u u' p v D L2. reduction L1 C \<sigma>' t s polarity L2 u u' p v D (same_values (\<lambda>t. trm_rep t S)) S \<sigma> \<and> variable_disjoint C D
[PROOF STEP]
from \<open>subterm t p u\<close>
[PROOF STATE]
proof (chain)
picking this:
subterm t p u
[PROOF STEP]
have "u = t \<or> (u,t) \<in> trm_ord"
[PROOF STATE]
proof (prove)
using this:
subterm t p u

goal (1 subgoal):
 1. u = t \<or> (u, t) \<in> trm_ord
[PROOF STEP]
using subterm_trm_ord_eq
[PROOF STATE]
proof (prove)
using this:
subterm t p u
subterm ?t ?p ?s \<Longrightarrow> ?s = ?t \<or> (?s, ?t) \<in> trm_ord

goal (1 subgoal):
 1. u = t \<or> (u, t) \<in> trm_ord
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
u = t \<or> (u, t) \<in> trm_ord

goal (1 subgoal):
 1. \<exists>\<sigma>' u u' p v D L2. reduction L1 C \<sigma>' t s polarity L2 u u' p v D (same_values (\<lambda>t. trm_rep t S)) S \<sigma> \<and> variable_disjoint C D
[PROOF STEP]
from assms(8) and \<open>L1 \<in> (cl_ecl C)\<close>
[PROOF STATE]
proof (chain)
picking this:
ground_clause (subst_cl (cl_ecl C) \<sigma>)
L1 \<in> cl_ecl C
[PROOF STEP]
have "vars_of_lit (subst_lit L1 \<sigma>) = {}"
[PROOF STATE]
proof (prove)
using this:
ground_clause (subst_cl (cl_ecl C) \<sigma>)
L1 \<in> cl_ecl C

goal (1 subgoal):
 1. vars_of_lit (subst_lit L1 \<sigma>) = {}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
vars_of_lit (subst_lit L1 \<sigma>) = {}

goal (1 subgoal):
 1. \<exists>\<sigma>' u u' p v D L2. reduction L1 C \<sigma>' t s polarity L2 u u' p v D (same_values (\<lambda>t. trm_rep t S)) S \<sigma> \<and> variable_disjoint C D
[PROOF STEP]
from \<open>coincide_on \<sigma> \<sigma>' (vars_of_lit L1)\<close>
[PROOF STATE]
proof (chain)
picking this:
coincide_on \<sigma> \<sigma>' (vars_of_lit L1)
[PROOF STEP]
have "(subst_lit L1 \<sigma>) = (subst_lit L1 \<sigma>')"
[PROOF STATE]
proof (prove)
using this:
coincide_on \<sigma> \<sigma>' (vars_of_lit L1)

goal (1 subgoal):
 1. subst_lit L1 \<sigma> = subst_lit L1 \<sigma>'
[PROOF STEP]
using  coincide_on_lit
[PROOF STATE]
proof (prove)
using this:
coincide_on \<sigma> \<sigma>' (vars_of_lit L1)
coincide_on ?\<sigma> ?\<eta> (vars_of_lit ?l) \<Longrightarrow> subst_lit ?l ?\<sigma> = subst_lit ?l ?\<eta>

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

goal (1 subgoal):
 1. \<exists>\<sigma>' u u' p v D L2. reduction L1 C \<sigma>' t s polarity L2 u u' p v D (same_values (\<lambda>t. trm_rep t S)) S \<sigma> \<and> variable_disjoint C D
[PROOF STEP]
from this and  \<open>vars_of_lit (subst_lit L1 \<sigma>) = {}\<close>
[PROOF STATE]
proof (chain)
picking this:
subst_lit L1 \<sigma> = subst_lit L1 \<sigma>'
vars_of_lit (subst_lit L1 \<sigma>) = {}
[PROOF STEP]
have "vars_of_lit (subst_lit L1 \<sigma>') = {}"
[PROOF STATE]
proof (prove)
using this:
subst_lit L1 \<sigma> = subst_lit L1 \<sigma>'
vars_of_lit (subst_lit L1 \<sigma>) = {}

goal (1 subgoal):
 1. vars_of_lit (subst_lit L1 \<sigma>') = {}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
vars_of_lit (subst_lit L1 \<sigma>') = {}

goal (1 subgoal):
 1. \<exists>\<sigma>' u u' p v D L2. reduction L1 C \<sigma>' t s polarity L2 u u' p v D (same_values (\<lambda>t. trm_rep t S)) S \<sigma> \<and> variable_disjoint C D
[PROOF STEP]
from \<open>coincide_on \<eta> \<sigma>' (vars_of_lit L2)\<close>
[PROOF STATE]
proof (chain)
picking this:
coincide_on \<eta> \<sigma>' (vars_of_lit L2)
[PROOF STEP]
have "(subst_lit L2 \<eta>) = (subst_lit L2 \<sigma>')"
[PROOF STATE]
proof (prove)
using this:
coincide_on \<eta> \<sigma>' (vars_of_lit L2)

goal (1 subgoal):
 1. subst_lit L2 \<eta> = subst_lit L2 \<sigma>'
[PROOF STEP]
using  coincide_on_lit
[PROOF STATE]
proof (prove)
using this:
coincide_on \<eta> \<sigma>' (vars_of_lit L2)
coincide_on ?\<sigma> ?\<eta> (vars_of_lit ?l) \<Longrightarrow> subst_lit ?l ?\<sigma> = subst_lit ?l ?\<eta>

goal (1 subgoal):
 1. subst_lit L2 \<eta> = subst_lit L2 \<sigma>'
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
subst_lit L2 \<eta> = subst_lit L2 \<sigma>'

goal (1 subgoal):
 1. \<exists>\<sigma>' u u' p v D L2. reduction L1 C \<sigma>' t s polarity L2 u u' p v D (same_values (\<lambda>t. trm_rep t S)) S \<sigma> \<and> variable_disjoint C D
[PROOF STEP]
from \<open>vars_of_lit gr_L2 = {}\<close> \<open>ground_clause gr_Cl_C2\<close> \<open>gr_Cl_C2 = (subst_cl Cl_C2 \<eta>)\<close>
    \<open>L2 \<in> Cl_C2\<close>
[PROOF STATE]
proof (chain)
picking this:
vars_of_lit gr_L2 = {}
ground_clause gr_Cl_C2
gr_Cl_C2 = subst_cl Cl_C2 \<eta>
L2 \<in> Cl_C2
[PROOF STEP]
have "vars_of_lit (subst_lit L2 \<eta>) = {}"
[PROOF STATE]
proof (prove)
using this:
vars_of_lit gr_L2 = {}
ground_clause gr_Cl_C2
gr_Cl_C2 = subst_cl Cl_C2 \<eta>
L2 \<in> Cl_C2

goal (1 subgoal):
 1. vars_of_lit (subst_lit L2 \<eta>) = {}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
vars_of_lit (subst_lit L2 \<eta>) = {}

goal (1 subgoal):
 1. \<exists>\<sigma>' u u' p v D L2. reduction L1 C \<sigma>' t s polarity L2 u u' p v D (same_values (\<lambda>t. trm_rep t S)) S \<sigma> \<and> variable_disjoint C D
[PROOF STEP]
from this and \<open>(subst_lit L2 \<eta>) = (subst_lit L2 \<sigma>')\<close>
[PROOF STATE]
proof (chain)
picking this:
vars_of_lit (subst_lit L2 \<eta>) = {}
subst_lit L2 \<eta> = subst_lit L2 \<sigma>'
[PROOF STEP]
have "vars_of_lit (subst_lit L2 \<sigma>') = {}"
[PROOF STATE]
proof (prove)
using this:
vars_of_lit (subst_lit L2 \<eta>) = {}
subst_lit L2 \<eta> = subst_lit L2 \<sigma>'

goal (1 subgoal):
 1. vars_of_lit (subst_lit L2 \<sigma>') = {}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
vars_of_lit (subst_lit L2 \<sigma>') = {}

goal (1 subgoal):
 1. \<exists>\<sigma>' u u' p v D L2. reduction L1 C \<sigma>' t s polarity L2 u u' p v D (same_values (\<lambda>t. trm_rep t S)) S \<sigma> \<and> variable_disjoint C D
[PROOF STEP]
text \<open>We now prove that the ``into'' clause is strictly smaller than the ``from'' clause. This is
easy if the rewritten literal is negative or if the reduction does not occur at root level.
Otherwise, we must use the fact that the function @{term "trm_rep"} selects the smallest right-hand
side to compute the value of a term.\<close>
[PROOF STATE]
proof (state)
this:
vars_of_lit (subst_lit L2 \<sigma>') = {}

goal (1 subgoal):
 1. \<exists>\<sigma>' u u' p v D L2. reduction L1 C \<sigma>' t s polarity L2 u u' p v D (same_values (\<lambda>t. trm_rep t S)) S \<sigma> \<and> variable_disjoint C D
[PROOF STEP]
have "(subst_lit L2 \<sigma>', subst_lit L1 \<sigma>') \<in> lit_ord"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (subst_lit L2 \<sigma>', subst_lit L1 \<sigma>') \<in> lit_ord
[PROOF STEP]
proof (rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (subst_lit L2 \<sigma>', subst_lit L1 \<sigma>') \<notin> lit_ord \<Longrightarrow> False
[PROOF STEP]
assume "\<not>(subst_lit L2 \<sigma>', subst_lit L1 \<sigma>') \<in> lit_ord"
[PROOF STATE]
proof (state)
this:
(subst_lit L2 \<sigma>', subst_lit L1 \<sigma>') \<notin> lit_ord

goal (1 subgoal):
 1. (subst_lit L2 \<sigma>', subst_lit L1 \<sigma>') \<notin> lit_ord \<Longrightarrow> False
[PROOF STEP]
from \<open>orient_lit_inst L1 t s polarity \<sigma>'\<close>
[PROOF STATE]
proof (chain)
picking this:
orient_lit_inst L1 t s polarity \<sigma>'
[PROOF STEP]
have "orient_lit (subst_lit L1 \<sigma>')
          (subst t \<sigma>') (subst s \<sigma>') polarity"
[PROOF STATE]
proof (prove)
using this:
orient_lit_inst L1 t s polarity \<sigma>'

goal (1 subgoal):
 1. orient_lit (subst_lit L1 \<sigma>') (t \<lhd> \<sigma>') (s \<lhd> \<sigma>') polarity
[PROOF STEP]
using lift_orient_lit [of L1 t s polarity \<sigma>']
[PROOF STATE]
proof (prove)
using this:
orient_lit_inst L1 t s polarity \<sigma>'
orient_lit_inst L1 t s polarity \<sigma>' \<Longrightarrow> orient_lit (subst_lit L1 \<sigma>') (t \<lhd> \<sigma>') (s \<lhd> \<sigma>') polarity

goal (1 subgoal):
 1. orient_lit (subst_lit L1 \<sigma>') (t \<lhd> \<sigma>') (s \<lhd> \<sigma>') polarity
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
orient_lit (subst_lit L1 \<sigma>') (t \<lhd> \<sigma>') (s \<lhd> \<sigma>') polarity

goal (1 subgoal):
 1. (subst_lit L2 \<sigma>', subst_lit L1 \<sigma>') \<notin> lit_ord \<Longrightarrow> False
[PROOF STEP]
from \<open>orient_lit_inst L2 lhs rhs pos \<sigma>'\<close>
[PROOF STATE]
proof (chain)
picking this:
orient_lit_inst L2 lhs rhs pos \<sigma>'
[PROOF STEP]
have "orient_lit (subst_lit L2 \<sigma>')
          (subst lhs \<sigma>') (subst rhs \<sigma>') pos"
[PROOF STATE]
proof (prove)
using this:
orient_lit_inst L2 lhs rhs pos \<sigma>'

goal (1 subgoal):
 1. orient_lit (subst_lit L2 \<sigma>') (lhs \<lhd> \<sigma>') (rhs \<lhd> \<sigma>') pos
[PROOF STEP]
using lift_orient_lit
[PROOF STATE]
proof (prove)
using this:
orient_lit_inst L2 lhs rhs pos \<sigma>'
orient_lit_inst ?L ?t ?s ?p ?\<sigma> \<Longrightarrow> orient_lit (subst_lit ?L ?\<sigma>) (?t \<lhd> ?\<sigma>) (?s \<lhd> ?\<sigma>) ?p

goal (1 subgoal):
 1. orient_lit (subst_lit L2 \<sigma>') (lhs \<lhd> \<sigma>') (rhs \<lhd> \<sigma>') pos
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
orient_lit (subst_lit L2 \<sigma>') (lhs \<lhd> \<sigma>') (rhs \<lhd> \<sigma>') pos

goal (1 subgoal):
 1. (subst_lit L2 \<sigma>', subst_lit L1 \<sigma>') \<notin> lit_ord \<Longrightarrow> False
[PROOF STEP]
have "(u,t) \<notin> trm_ord"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (u, t) \<notin> trm_ord
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (u, t) \<in> trm_ord \<Longrightarrow> False
[PROOF STEP]
assume "(u,t) \<in> trm_ord"
[PROOF STATE]
proof (state)
this:
(u, t) \<in> trm_ord

goal (1 subgoal):
 1. (u, t) \<in> trm_ord \<Longrightarrow> False
[PROOF STEP]
from this
[PROOF STATE]
proof (chain)
picking this:
(u, t) \<in> trm_ord
[PROOF STEP]
have "(subst u \<sigma>', subst t \<sigma>') \<in> trm_ord"
[PROOF STATE]
proof (prove)
using this:
(u, t) \<in> trm_ord

goal (1 subgoal):
 1. (u \<lhd> \<sigma>', t \<lhd> \<sigma>') \<in> trm_ord
[PROOF STEP]
using trm_ord_subst
[PROOF STATE]
proof (prove)
using this:
(u, t) \<in> trm_ord
\<forall>s x y. (x, y) \<in> trm_ord \<longrightarrow> (x \<lhd> s, y \<lhd> s) \<in> trm_ord

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

goal (1 subgoal):
 1. (u, t) \<in> trm_ord \<Longrightarrow> False
[PROOF STEP]
have False "subst u \<sigma>' = subst lhs \<sigma>'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. False &&& u \<lhd> \<sigma>' = lhs \<lhd> \<sigma>'
[PROOF STEP]
using \<open>(subst u \<sigma>', subst t \<sigma>') \<in> trm_ord\<close>
        \<open>(subst_lit L2 \<sigma>', subst_lit L1 \<sigma>') \<notin> lit_ord\<close> \<open>subst lhs \<eta> = subst lhs \<sigma>'\<close>
        \<open>subst u \<sigma> = subst u \<sigma>'\<close> \<open>subst_lit L2 \<eta> = subst_lit L2 \<sigma>'\<close> \<open>gr_L2 = subst_lit L2 \<eta>\<close>
        \<open>orient_lit (subst_lit L1 \<sigma>') (subst t \<sigma>') (subst s \<sigma>') polarity\<close>
        \<open>orient_lit (subst_lit L2 \<sigma>') (subst lhs \<sigma>') (subst rhs \<sigma>') pos\<close> \<open>v = subst lhs \<eta>\<close>
        \<open>v = subst u \<sigma>\<close> \<open>vars_of_lit (subst_lit L1 \<sigma>') = {}\<close> \<open>vars_of_lit gr_L2 = {}\<close>
        lit_ord_dominating_term
[PROOF STATE]
proof (prove)
using this:
(u \<lhd> \<sigma>', t \<lhd> \<sigma>') \<in> trm_ord
(subst_lit L2 \<sigma>', subst_lit L1 \<sigma>') \<notin> lit_ord
lhs \<lhd> \<eta> = lhs \<lhd> \<sigma>'
u \<lhd> \<sigma> = u \<lhd> \<sigma>'
subst_lit L2 \<eta> = subst_lit L2 \<sigma>'
gr_L2 = subst_lit L2 \<eta>
orient_lit (subst_lit L1 \<sigma>') (t \<lhd> \<sigma>') (s \<lhd> \<sigma>') polarity
orient_lit (subst_lit L2 \<sigma>') (lhs \<lhd> \<sigma>') (rhs \<lhd> \<sigma>') pos
v = lhs \<lhd> \<eta>
v = u \<lhd> \<sigma>
vars_of_lit (subst_lit L1 \<sigma>') = {}
vars_of_lit gr_L2 = {}
\<lbrakk>(?s1.0, ?s2.0) \<in> trm_ord \<or> (?s1.0, ?t2.0) \<in> trm_ord; orient_lit ?x1.0 ?s1.0 ?t1.0 ?p1.0; orient_lit ?x2.0 ?s2.0 ?t2.0 ?p2.0; vars_of_lit ?x1.0 = {}; vars_of_lit ?x2.0 = {}\<rbrakk> \<Longrightarrow> (?x1.0, ?x2.0) \<in> lit_ord

goal (1 subgoal):
 1. False &&& u \<lhd> \<sigma>' = lhs \<lhd> \<sigma>'
[PROOF STEP]
apply fastforce
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. u \<lhd> \<sigma>' = lhs \<lhd> \<sigma>'
[PROOF STEP]
using \<open>(subst u \<sigma>', subst t \<sigma>') \<in> trm_ord\<close>
        \<open>(subst_lit L2 \<sigma>', subst_lit L1 \<sigma>') \<notin> lit_ord\<close>
        \<open>subst u \<sigma>' = subst lhs \<sigma>'\<close>
        \<open>orient_lit (subst_lit L1 \<sigma>') (subst t \<sigma>') (subst s \<sigma>') polarity\<close>
        \<open>orient_lit (subst_lit L2 \<sigma>') (subst lhs \<sigma>') (subst rhs \<sigma>') pos\<close>
        \<open>vars_of_lit (subst_lit L1 \<sigma>') = {}\<close> \<open>vars_of_lit (subst_lit L2 \<sigma>') = {}\<close>
        lit_ord_dominating_term
[PROOF STATE]
proof (prove)
using this:
(u \<lhd> \<sigma>', t \<lhd> \<sigma>') \<in> trm_ord
(subst_lit L2 \<sigma>', subst_lit L1 \<sigma>') \<notin> lit_ord
u \<lhd> \<sigma>' = lhs \<lhd> \<sigma>'
orient_lit (subst_lit L1 \<sigma>') (t \<lhd> \<sigma>') (s \<lhd> \<sigma>') polarity
orient_lit (subst_lit L2 \<sigma>') (lhs \<lhd> \<sigma>') (rhs \<lhd> \<sigma>') pos
vars_of_lit (subst_lit L1 \<sigma>') = {}
vars_of_lit (subst_lit L2 \<sigma>') = {}
\<lbrakk>(?s1.0, ?s2.0) \<in> trm_ord \<or> (?s1.0, ?t2.0) \<in> trm_ord; orient_lit ?x1.0 ?s1.0 ?t1.0 ?p1.0; orient_lit ?x2.0 ?s2.0 ?t2.0 ?p2.0; vars_of_lit ?x1.0 = {}; vars_of_lit ?x2.0 = {}\<rbrakk> \<Longrightarrow> (?x1.0, ?x2.0) \<in> lit_ord

goal (1 subgoal):
 1. u \<lhd> \<sigma>' = lhs \<lhd> \<sigma>'
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
False
u \<lhd> \<sigma>' = lhs \<lhd> \<sigma>'

goal (1 subgoal):
 1. (u, t) \<in> trm_ord \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
False
u \<lhd> \<sigma>' = lhs \<lhd> \<sigma>'
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
False
u \<lhd> \<sigma>' = lhs \<lhd> \<sigma>'

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(u, t) \<notin> trm_ord

goal (1 subgoal):
 1. (subst_lit L2 \<sigma>', subst_lit L1 \<sigma>') \<notin> lit_ord \<Longrightarrow> False
[PROOF STEP]
from this and \<open>subterm t p u\<close>
[PROOF STATE]
proof (chain)
picking this:
(u, t) \<notin> trm_ord
subterm t p u
[PROOF STEP]
have "p = Nil"
[PROOF STATE]
proof (prove)
using this:
(u, t) \<notin> trm_ord
subterm t p u

goal (1 subgoal):
 1. p = []
[PROOF STEP]
using subterm_trm_ord
[PROOF STATE]
proof (prove)
using this:
(u, t) \<notin> trm_ord
subterm t p u
\<lbrakk>subterm ?t ?p ?s; ?p \<noteq> []\<rbrakk> \<Longrightarrow> (?s, ?t) \<in> trm_ord

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

goal (1 subgoal):
 1. (subst_lit L2 \<sigma>', subst_lit L1 \<sigma>') \<notin> lit_ord \<Longrightarrow> False
[PROOF STEP]
have "\<not> proper_subterm_red t S \<sigma>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> proper_subterm_red t S \<sigma>
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. proper_subterm_red t S \<sigma> \<Longrightarrow> False
[PROOF STEP]
assume "proper_subterm_red t S \<sigma>"
[PROOF STATE]
proof (state)
this:
proper_subterm_red t S \<sigma>

goal (1 subgoal):
 1. proper_subterm_red t S \<sigma> \<Longrightarrow> False
[PROOF STEP]
from this
[PROOF STATE]
proof (chain)
picking this:
proper_subterm_red t S \<sigma>
[PROOF STEP]
obtain p' s where "p' \<noteq> Nil" and "subterm t p' s"
        "trm_rep (subst s \<sigma>) S \<noteq> (subst s \<sigma>)"
[PROOF STATE]
proof (prove)
using this:
proper_subterm_red t S \<sigma>

goal (1 subgoal):
 1. (\<And>p' s. \<lbrakk>p' \<noteq> []; subterm t p' s; trm_rep (s \<lhd> \<sigma>) S \<noteq> s \<lhd> \<sigma>\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding proper_subterm_red_def
[PROOF STATE]
proof (prove)
using this:
\<exists>p s. subterm t p s \<and> p \<noteq> [] \<and> trm_rep (s \<lhd> \<sigma>) S \<noteq> s \<lhd> \<sigma>

goal (1 subgoal):
 1. (\<And>p' s. \<lbrakk>p' \<noteq> []; subterm t p' s; trm_rep (s \<lhd> \<sigma>) S \<noteq> s \<lhd> \<sigma>\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
p' \<noteq> []
subterm t p' s
trm_rep (s \<lhd> \<sigma>) S \<noteq> s \<lhd> \<sigma>

goal (1 subgoal):
 1. proper_subterm_red t S \<sigma> \<Longrightarrow> False
[PROOF STEP]
from \<open>p = Nil\<close> and \<open>p' \<noteq> Nil\<close>
[PROOF STATE]
proof (chain)
picking this:
p = []
p' \<noteq> []
[PROOF STEP]
have "(p',p) \<in> (pos_ord C t)"
[PROOF STATE]
proof (prove)
using this:
p = []
p' \<noteq> []

goal (1 subgoal):
 1. (p', p) \<in> pos_ord C t
[PROOF STEP]
using pos_ord_nil
[PROOF STATE]
proof (prove)
using this:
p = []
p' \<noteq> []
\<forall>x y p. p \<noteq> [] \<longrightarrow> (p, []) \<in> pos_ord x y

goal (1 subgoal):
 1. (p', p) \<in> pos_ord C t
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(p', p) \<in> pos_ord C t

goal (1 subgoal):
 1. proper_subterm_red t S \<sigma> \<Longrightarrow> False
[PROOF STEP]
from \<open>subterm t p' s\<close>
[PROOF STATE]
proof (chain)
picking this:
subterm t p' s
[PROOF STEP]
have "subterm (subst t \<sigma>) p' (subst s \<sigma>)"
[PROOF STATE]
proof (prove)
using this:
subterm t p' s

goal (1 subgoal):
 1. subterm (t \<lhd> \<sigma>) p' (s \<lhd> \<sigma>)
[PROOF STEP]
by (simp add: substs_preserve_subterms)
[PROOF STATE]
proof (state)
this:
subterm (t \<lhd> \<sigma>) p' (s \<lhd> \<sigma>)

goal (1 subgoal):
 1. proper_subterm_red t S \<sigma> \<Longrightarrow> False
[PROOF STEP]
from this and \<open>(p',p) \<in> (pos_ord C t)\<close> mr and \<open>trm_rep (subst s \<sigma>) S \<noteq> (subst s \<sigma>)\<close> \<open>mp=p\<close>
[PROOF STATE]
proof (chain)
picking this:
subterm (t \<lhd> \<sigma>) p' (s \<lhd> \<sigma>)
(p', p) \<in> pos_ord C t
minimal_redex mp (t \<lhd> \<sigma>) C S t
trm_rep (s \<lhd> \<sigma>) S \<noteq> s \<lhd> \<sigma>
mp = p
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
subterm (t \<lhd> \<sigma>) p' (s \<lhd> \<sigma>)
(p', p) \<in> pos_ord C t
minimal_redex mp (t \<lhd> \<sigma>) C S t
trm_rep (s \<lhd> \<sigma>) S \<noteq> s \<lhd> \<sigma>
mp = p

goal (1 subgoal):
 1. False
[PROOF STEP]
using minimal_redex_def
[PROOF STATE]
proof (prove)
using this:
subterm (t \<lhd> \<sigma>) p' (s \<lhd> \<sigma>)
(p', p) \<in> pos_ord C t
minimal_redex mp (t \<lhd> \<sigma>) C S t
trm_rep (s \<lhd> \<sigma>) S \<noteq> s \<lhd> \<sigma>
mp = p
minimal_redex ?p ?t ?C ?S ?t' = (\<forall>q s. (q, ?p) \<in> pos_ord ?C ?t' \<longrightarrow> subterm ?t q s \<longrightarrow> trm_rep s ?S = s)

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<not> proper_subterm_red t S \<sigma>

goal (1 subgoal):
 1. (subst_lit L2 \<sigma>', subst_lit L1 \<sigma>') \<notin> lit_ord \<Longrightarrow> False
[PROOF STEP]
from \<open>(u,t) \<notin> trm_ord\<close> and \<open>u = t \<or> (u,t) \<in> trm_ord\<close>
[PROOF STATE]
proof (chain)
picking this:
(u, t) \<notin> trm_ord
u = t \<or> (u, t) \<in> trm_ord
[PROOF STEP]
have "u = t"
[PROOF STATE]
proof (prove)
using this:
(u, t) \<notin> trm_ord
u = t \<or> (u, t) \<in> trm_ord

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

goal (1 subgoal):
 1. (subst_lit L2 \<sigma>', subst_lit L1 \<sigma>') \<notin> lit_ord \<Longrightarrow> False
[PROOF STEP]
have "polarity = pos"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. polarity = pos
[PROOF STEP]
proof (rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. polarity \<noteq> pos \<Longrightarrow> False
[PROOF STEP]
assume "polarity \<noteq> pos"
[PROOF STATE]
proof (state)
this:
polarity \<noteq> pos

goal (1 subgoal):
 1. polarity \<noteq> pos \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
polarity \<noteq> pos
[PROOF STEP]
have "polarity = neg"
[PROOF STATE]
proof (prove)
using this:
polarity \<noteq> pos

goal (1 subgoal):
 1. polarity = neg
[PROOF STEP]
using sign.exhaust
[PROOF STATE]
proof (prove)
using this:
polarity \<noteq> pos
\<lbrakk>?y = pos \<Longrightarrow> ?P; ?y = neg \<Longrightarrow> ?P\<rbrakk> \<Longrightarrow> ?P

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

goal (1 subgoal):
 1. polarity \<noteq> pos \<Longrightarrow> False
[PROOF STEP]
from \<open>u = t\<close>
[PROOF STATE]
proof (chain)
picking this:
u = t
[PROOF STEP]
have "subst t \<sigma>' = subst u \<sigma>'"
[PROOF STATE]
proof (prove)
using this:
u = t

goal (1 subgoal):
 1. t \<lhd> \<sigma>' = u \<lhd> \<sigma>'
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
t \<lhd> \<sigma>' = u \<lhd> \<sigma>'

goal (1 subgoal):
 1. polarity \<noteq> pos \<Longrightarrow> False
[PROOF STEP]
from this and \<open>v = (subst u \<sigma>)\<close> and \<open>v = (subst lhs \<eta>)\<close>
          and \<open>subst lhs \<eta> = subst lhs \<sigma>'\<close>
          and \<open>(subst u \<sigma>) = (subst u \<sigma>')\<close>
[PROOF STATE]
proof (chain)
picking this:
t \<lhd> \<sigma>' = u \<lhd> \<sigma>'
v = u \<lhd> \<sigma>
v = lhs \<lhd> \<eta>
lhs \<lhd> \<eta> = lhs \<lhd> \<sigma>'
u \<lhd> \<sigma> = u \<lhd> \<sigma>'
[PROOF STEP]
have "(subst t \<sigma>') = (subst lhs \<sigma>')"
[PROOF STATE]
proof (prove)
using this:
t \<lhd> \<sigma>' = u \<lhd> \<sigma>'
v = u \<lhd> \<sigma>
v = lhs \<lhd> \<eta>
lhs \<lhd> \<eta> = lhs \<lhd> \<sigma>'
u \<lhd> \<sigma> = u \<lhd> \<sigma>'

goal (1 subgoal):
 1. t \<lhd> \<sigma>' = lhs \<lhd> \<sigma>'
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
t \<lhd> \<sigma>' = lhs \<lhd> \<sigma>'

goal (1 subgoal):
 1. polarity \<noteq> pos \<Longrightarrow> False
[PROOF STEP]
from this and \<open>polarity = neg\<close> \<open>orient_lit (subst_lit L1 \<sigma>')
          (subst t \<sigma>') (subst s \<sigma>') polarity\<close>
           and \<open>orient_lit (subst_lit L2 \<sigma>')
          (subst lhs \<sigma>') (subst rhs \<sigma>') pos\<close>
          \<open>(subst_lit L2 \<sigma>', subst_lit L1 \<sigma>') \<notin> lit_ord\<close>
          \<open>vars_of_lit (subst_lit L1 \<sigma>')  = {}\<close>
          \<open>vars_of_lit (subst_lit L2 \<sigma>') = {}\<close>
[PROOF STATE]
proof (chain)
picking this:
t \<lhd> \<sigma>' = lhs \<lhd> \<sigma>'
polarity = neg
orient_lit (subst_lit L1 \<sigma>') (t \<lhd> \<sigma>') (s \<lhd> \<sigma>') polarity
orient_lit (subst_lit L2 \<sigma>') (lhs \<lhd> \<sigma>') (rhs \<lhd> \<sigma>') pos
(subst_lit L2 \<sigma>', subst_lit L1 \<sigma>') \<notin> lit_ord
vars_of_lit (subst_lit L1 \<sigma>') = {}
vars_of_lit (subst_lit L2 \<sigma>') = {}
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
t \<lhd> \<sigma>' = lhs \<lhd> \<sigma>'
polarity = neg
orient_lit (subst_lit L1 \<sigma>') (t \<lhd> \<sigma>') (s \<lhd> \<sigma>') polarity
orient_lit (subst_lit L2 \<sigma>') (lhs \<lhd> \<sigma>') (rhs \<lhd> \<sigma>') pos
(subst_lit L2 \<sigma>', subst_lit L1 \<sigma>') \<notin> lit_ord
vars_of_lit (subst_lit L1 \<sigma>') = {}
vars_of_lit (subst_lit L2 \<sigma>') = {}

goal (1 subgoal):
 1. False
[PROOF STEP]
using lit_ord_neg_lit_lhs
[PROOF STATE]
proof (prove)
using this:
t \<lhd> \<sigma>' = lhs \<lhd> \<sigma>'
polarity = neg
orient_lit (subst_lit L1 \<sigma>') (t \<lhd> \<sigma>') (s \<lhd> \<sigma>') polarity
orient_lit (subst_lit L2 \<sigma>') (lhs \<lhd> \<sigma>') (rhs \<lhd> \<sigma>') pos
(subst_lit L2 \<sigma>', subst_lit L1 \<sigma>') \<notin> lit_ord
vars_of_lit (subst_lit L1 \<sigma>') = {}
vars_of_lit (subst_lit L2 \<sigma>') = {}
\<lbrakk>orient_lit ?x1.0 ?s ?t1.0 pos; orient_lit ?x2.0 ?s ?t2.0 neg; vars_of_lit ?x1.0 = {}; vars_of_lit ?x2.0 = {}\<rbrakk> \<Longrightarrow> (?x1.0, ?x2.0) \<in> lit_ord

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

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

goal (1 subgoal):
 1. (subst_lit L2 \<sigma>', subst_lit L1 \<sigma>') \<notin> lit_ord \<Longrightarrow> False
[PROOF STEP]
from  \<open>vars_of_lit (subst_lit L1 \<sigma>) = {}\<close> assms(6)
[PROOF STATE]
proof (chain)
picking this:
vars_of_lit (subst_lit L1 \<sigma>) = {}
orient_lit_inst L1 t s polarity \<sigma>
[PROOF STEP]
have "vars_of (subst t \<sigma>) = {}"
[PROOF STATE]
proof (prove)
using this:
vars_of_lit (subst_lit L1 \<sigma>) = {}
orient_lit_inst L1 t s polarity \<sigma>

goal (1 subgoal):
 1. vars_of (t \<lhd> \<sigma>) = {}
[PROOF STEP]
using lift_orient_lit orient_lit_vars
[PROOF STATE]
proof (prove)
using this:
vars_of_lit (subst_lit L1 \<sigma>) = {}
orient_lit_inst L1 t s polarity \<sigma>
orient_lit_inst ?L ?t ?s ?p ?\<sigma> \<Longrightarrow> orient_lit (subst_lit ?L ?\<sigma>) (?t \<lhd> ?\<sigma>) (?s \<lhd> ?\<sigma>) ?p
orient_lit ?L ?t ?s ?p \<Longrightarrow> vars_of ?t \<subseteq> vars_of_lit ?L \<and> vars_of ?s \<subseteq> vars_of_lit ?L

goal (1 subgoal):
 1. vars_of (t \<lhd> \<sigma>) = {}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
vars_of (t \<lhd> \<sigma>) = {}

goal (1 subgoal):
 1. (subst_lit L2 \<sigma>', subst_lit L1 \<sigma>') \<notin> lit_ord \<Longrightarrow> False
[PROOF STEP]
from  \<open>vars_of_lit (subst_lit L1 \<sigma>) = {}\<close> assms(6)
[PROOF STATE]
proof (chain)
picking this:
vars_of_lit (subst_lit L1 \<sigma>) = {}
orient_lit_inst L1 t s polarity \<sigma>
[PROOF STEP]
have "vars_of (subst s \<sigma>) = {}"
[PROOF STATE]
proof (prove)
using this:
vars_of_lit (subst_lit L1 \<sigma>) = {}
orient_lit_inst L1 t s polarity \<sigma>

goal (1 subgoal):
 1. vars_of (s \<lhd> \<sigma>) = {}
[PROOF STEP]
using lift_orient_lit orient_lit_vars
[PROOF STATE]
proof (prove)
using this:
vars_of_lit (subst_lit L1 \<sigma>) = {}
orient_lit_inst L1 t s polarity \<sigma>
orient_lit_inst ?L ?t ?s ?p ?\<sigma> \<Longrightarrow> orient_lit (subst_lit ?L ?\<sigma>) (?t \<lhd> ?\<sigma>) (?s \<lhd> ?\<sigma>) ?p
orient_lit ?L ?t ?s ?p \<Longrightarrow> vars_of ?t \<subseteq> vars_of_lit ?L \<and> vars_of ?s \<subseteq> vars_of_lit ?L

goal (1 subgoal):
 1. vars_of (s \<lhd> \<sigma>) = {}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
vars_of (s \<lhd> \<sigma>) = {}

goal (1 subgoal):
 1. (subst_lit L2 \<sigma>', subst_lit L1 \<sigma>') \<notin> lit_ord \<Longrightarrow> False
[PROOF STEP]
have "trm_rep (subst t \<sigma>) S \<noteq> trm_rep (subst s \<sigma>) S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. trm_rep (t \<lhd> \<sigma>) S \<noteq> trm_rep (s \<lhd> \<sigma>) S
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. trm_rep (t \<lhd> \<sigma>) S = trm_rep (s \<lhd> \<sigma>) S \<Longrightarrow> False
[PROOF STEP]
assume "trm_rep (subst t \<sigma>) S = trm_rep (subst s \<sigma>) S"
[PROOF STATE]
proof (state)
this:
trm_rep (t \<lhd> \<sigma>) S = trm_rep (s \<lhd> \<sigma>) S

goal (1 subgoal):
 1. trm_rep (t \<lhd> \<sigma>) S = trm_rep (s \<lhd> \<sigma>) S \<Longrightarrow> False
[PROOF STEP]
from this
[PROOF STATE]
proof (chain)
picking this:
trm_rep (t \<lhd> \<sigma>) S = trm_rep (s \<lhd> \<sigma>) S
[PROOF STEP]
have "validate_ground_eq ?I (Eq (subst t \<sigma>) (subst s \<sigma>))"
[PROOF STATE]
proof (prove)
using this:
trm_rep (t \<lhd> \<sigma>) S = trm_rep (s \<lhd> \<sigma>) S

goal (1 subgoal):
 1. validate_ground_eq (same_values (\<lambda>t. trm_rep t S)) (Eq (t \<lhd> \<sigma>) (s \<lhd> \<sigma>))
[PROOF STEP]
unfolding same_values_def
[PROOF STATE]
proof (prove)
using this:
trm_rep (t \<lhd> \<sigma>) S = trm_rep (s \<lhd> \<sigma>) S

goal (1 subgoal):
 1. validate_ground_eq (\<lambda>x y. trm_rep x S = trm_rep y S) (Eq (t \<lhd> \<sigma>) (s \<lhd> \<sigma>))
[PROOF STEP]
using validate_ground_eq.simps
[PROOF STATE]
proof (prove)
using this:
trm_rep (t \<lhd> \<sigma>) S = trm_rep (s \<lhd> \<sigma>) S
validate_ground_eq ?I (Eq ?t ?s) = ?I ?t ?s

goal (1 subgoal):
 1. validate_ground_eq (\<lambda>x y. trm_rep x S = trm_rep y S) (Eq (t \<lhd> \<sigma>) (s \<lhd> \<sigma>))
[PROOF STEP]
by (metis (mono_tags, lifting))
[PROOF STATE]
proof (state)
this:
validate_ground_eq (same_values (\<lambda>t. trm_rep t S)) (Eq (t \<lhd> \<sigma>) (s \<lhd> \<sigma>))

goal (1 subgoal):
 1. trm_rep (t \<lhd> \<sigma>) S = trm_rep (s \<lhd> \<sigma>) S \<Longrightarrow> False
[PROOF STEP]
from \<open>trm_rep (subst t \<sigma>) S = trm_rep (subst s \<sigma>) S\<close>
[PROOF STATE]
proof (chain)
picking this:
trm_rep (t \<lhd> \<sigma>) S = trm_rep (s \<lhd> \<sigma>) S
[PROOF STEP]
have "validate_ground_eq ?I (Eq (subst s \<sigma>) (subst t \<sigma>))"
[PROOF STATE]
proof (prove)
using this:
trm_rep (t \<lhd> \<sigma>) S = trm_rep (s \<lhd> \<sigma>) S

goal (1 subgoal):
 1. validate_ground_eq (same_values (\<lambda>t. trm_rep t S)) (Eq (s \<lhd> \<sigma>) (t \<lhd> \<sigma>))
[PROOF STEP]
unfolding same_values_def
[PROOF STATE]
proof (prove)
using this:
trm_rep (t \<lhd> \<sigma>) S = trm_rep (s \<lhd> \<sigma>) S

goal (1 subgoal):
 1. validate_ground_eq (\<lambda>x y. trm_rep x S = trm_rep y S) (Eq (s \<lhd> \<sigma>) (t \<lhd> \<sigma>))
[PROOF STEP]
using validate_ground_eq.simps
[PROOF STATE]
proof (prove)
using this:
trm_rep (t \<lhd> \<sigma>) S = trm_rep (s \<lhd> \<sigma>) S
validate_ground_eq ?I (Eq ?t ?s) = ?I ?t ?s

goal (1 subgoal):
 1. validate_ground_eq (\<lambda>x y. trm_rep x S = trm_rep y S) (Eq (s \<lhd> \<sigma>) (t \<lhd> \<sigma>))
[PROOF STEP]
by (metis (mono_tags, lifting))
[PROOF STATE]
proof (state)
this:
validate_ground_eq (same_values (\<lambda>t. trm_rep t S)) (Eq (s \<lhd> \<sigma>) (t \<lhd> \<sigma>))

goal (1 subgoal):
 1. trm_rep (t \<lhd> \<sigma>) S = trm_rep (s \<lhd> \<sigma>) S \<Longrightarrow> False
[PROOF STEP]
from \<open>orient_lit_inst L1 t s polarity \<sigma>\<close> and \<open>polarity=pos\<close>
[PROOF STATE]
proof (chain)
picking this:
orient_lit_inst L1 t s polarity \<sigma>
polarity = pos
[PROOF STEP]
have "L1 = (Pos (Eq t s)) \<or> L1 = (Pos (Eq s t))"
[PROOF STATE]
proof (prove)
using this:
orient_lit_inst L1 t s polarity \<sigma>
polarity = pos

goal (1 subgoal):
 1. L1 = Pos (Eq t s) \<or> L1 = Pos (Eq s t)
[PROOF STEP]
unfolding orient_lit_inst_def
[PROOF STATE]
proof (prove)
using this:
(L1 = Pos (Eq t s) \<or> L1 = Pos (Eq s t)) \<and> (t \<lhd> \<sigma>, s \<lhd> \<sigma>) \<notin> trm_ord \<and> polarity = pos \<or> (L1 = Neg (Eq t s) \<or> L1 = Neg (Eq s t)) \<and> (t \<lhd> \<sigma>, s \<lhd> \<sigma>) \<notin> trm_ord \<and> polarity = neg
polarity = pos

goal (1 subgoal):
 1. L1 = Pos (Eq t s) \<or> L1 = Pos (Eq s t)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
L1 = Pos (Eq t s) \<or> L1 = Pos (Eq s t)

goal (1 subgoal):
 1. trm_rep (t \<lhd> \<sigma>) S = trm_rep (s \<lhd> \<sigma>) S \<Longrightarrow> False
[PROOF STEP]
from this
[PROOF STATE]
proof (chain)
picking this:
L1 = Pos (Eq t s) \<or> L1 = Pos (Eq s t)
[PROOF STEP]
have "subst_lit L1 \<sigma> = (Pos (Eq (subst t \<sigma>)  (subst s \<sigma>))) \<or>
        subst_lit L1 \<sigma> = (Pos (Eq (subst s \<sigma>)  (subst t \<sigma>)))"
[PROOF STATE]
proof (prove)
using this:
L1 = Pos (Eq t s) \<or> L1 = Pos (Eq s t)

goal (1 subgoal):
 1. subst_lit L1 \<sigma> = Pos (Eq (t \<lhd> \<sigma>) (s \<lhd> \<sigma>)) \<or> subst_lit L1 \<sigma> = Pos (Eq (s \<lhd> \<sigma>) (t \<lhd> \<sigma>))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
subst_lit L1 \<sigma> = Pos (Eq (t \<lhd> \<sigma>) (s \<lhd> \<sigma>)) \<or> subst_lit L1 \<sigma> = Pos (Eq (s \<lhd> \<sigma>) (t \<lhd> \<sigma>))

goal (1 subgoal):
 1. trm_rep (t \<lhd> \<sigma>) S = trm_rep (s \<lhd> \<sigma>) S \<Longrightarrow> False
[PROOF STEP]
from this and \<open>validate_ground_eq ?I (Eq (subst s \<sigma>) (subst t \<sigma>))\<close>
        and \<open>validate_ground_eq ?I (Eq (subst t \<sigma>) (subst s \<sigma>))\<close>
[PROOF STATE]
proof (chain)
picking this:
subst_lit L1 \<sigma> = Pos (Eq (t \<lhd> \<sigma>) (s \<lhd> \<sigma>)) \<or> subst_lit L1 \<sigma> = Pos (Eq (s \<lhd> \<sigma>) (t \<lhd> \<sigma>))
validate_ground_eq (same_values (\<lambda>t. trm_rep t S)) (Eq (s \<lhd> \<sigma>) (t \<lhd> \<sigma>))
validate_ground_eq (same_values (\<lambda>t. trm_rep t S)) (Eq (t \<lhd> \<sigma>) (s \<lhd> \<sigma>))
[PROOF STEP]
have "validate_ground_lit ?I (subst_lit L1 \<sigma>)"
[PROOF STATE]
proof (prove)
using this:
subst_lit L1 \<sigma> = Pos (Eq (t \<lhd> \<sigma>) (s \<lhd> \<sigma>)) \<or> subst_lit L1 \<sigma> = Pos (Eq (s \<lhd> \<sigma>) (t \<lhd> \<sigma>))
validate_ground_eq (same_values (\<lambda>t. trm_rep t S)) (Eq (s \<lhd> \<sigma>) (t \<lhd> \<sigma>))
validate_ground_eq (same_values (\<lambda>t. trm_rep t S)) (Eq (t \<lhd> \<sigma>) (s \<lhd> \<sigma>))

goal (1 subgoal):
 1. validate_ground_lit (same_values (\<lambda>t. trm_rep t S)) (subst_lit L1 \<sigma>)
[PROOF STEP]
using validate_ground_lit.simps(1)
[PROOF STATE]
proof (prove)
using this:
subst_lit L1 \<sigma> = Pos (Eq (t \<lhd> \<sigma>) (s \<lhd> \<sigma>)) \<or> subst_lit L1 \<sigma> = Pos (Eq (s \<lhd> \<sigma>) (t \<lhd> \<sigma>))
validate_ground_eq (same_values (\<lambda>t. trm_rep t S)) (Eq (s \<lhd> \<sigma>) (t \<lhd> \<sigma>))
validate_ground_eq (same_values (\<lambda>t. trm_rep t S)) (Eq (t \<lhd> \<sigma>) (s \<lhd> \<sigma>))
validate_ground_lit ?I (Pos ?E) = validate_ground_eq ?I ?E

goal (1 subgoal):
 1. validate_ground_lit (same_values (\<lambda>t. trm_rep t S)) (subst_lit L1 \<sigma>)
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
validate_ground_lit (same_values (\<lambda>t. trm_rep t S)) (subst_lit L1 \<sigma>)

goal (1 subgoal):
 1. trm_rep (t \<lhd> \<sigma>) S = trm_rep (s \<lhd> \<sigma>) S \<Longrightarrow> False
[PROOF STEP]
from \<open>L1 \<in> (cl_ecl C)\<close>
[PROOF STATE]
proof (chain)
picking this:
L1 \<in> cl_ecl C
[PROOF STEP]
have "(subst_lit L1 \<sigma>) \<in> (subst_cl (cl_ecl C) \<sigma>)"
[PROOF STATE]
proof (prove)
using this:
L1 \<in> cl_ecl C

goal (1 subgoal):
 1. subst_lit L1 \<sigma> \<in> subst_cl (cl_ecl C) \<sigma>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
subst_lit L1 \<sigma> \<in> subst_cl (cl_ecl C) \<sigma>

goal (1 subgoal):
 1. trm_rep (t \<lhd> \<sigma>) S = trm_rep (s \<lhd> \<sigma>) S \<Longrightarrow> False
[PROOF STEP]
from this and \<open>validate_ground_lit ?I (subst_lit L1 \<sigma>)\<close>
[PROOF STATE]
proof (chain)
picking this:
subst_lit L1 \<sigma> \<in> subst_cl (cl_ecl C) \<sigma>
validate_ground_lit (same_values (\<lambda>t. trm_rep t S)) (subst_lit L1 \<sigma>)
[PROOF STEP]
have "validate_ground_clause ?I (subst_cl (cl_ecl C) \<sigma>)"
[PROOF STATE]
proof (prove)
using this:
subst_lit L1 \<sigma> \<in> subst_cl (cl_ecl C) \<sigma>
validate_ground_lit (same_values (\<lambda>t. trm_rep t S)) (subst_lit L1 \<sigma>)

goal (1 subgoal):
 1. validate_ground_clause (same_values (\<lambda>t. trm_rep t S)) (subst_cl (cl_ecl C) \<sigma>)
[PROOF STEP]
using validate_ground_clause.simps
[PROOF STATE]
proof (prove)
using this:
subst_lit L1 \<sigma> \<in> subst_cl (cl_ecl C) \<sigma>
validate_ground_lit (same_values (\<lambda>t. trm_rep t S)) (subst_lit L1 \<sigma>)
validate_ground_clause ?I ?C = (\<exists>L. L \<in> ?C \<and> validate_ground_lit ?I L)

goal (1 subgoal):
 1. validate_ground_clause (same_values (\<lambda>t. trm_rep t S)) (subst_cl (cl_ecl C) \<sigma>)
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
validate_ground_clause (same_values (\<lambda>t. trm_rep t S)) (subst_cl (cl_ecl C) \<sigma>)

goal (1 subgoal):
 1. trm_rep (t \<lhd> \<sigma>) S = trm_rep (s \<lhd> \<sigma>) S \<Longrightarrow> False
[PROOF STEP]
from this and \<open>\<not> validate_ground_clause (int_clset S) (subst_cl (cl_ecl C) \<sigma>)\<close>
[PROOF STATE]
proof (chain)
picking this:
validate_ground_clause (same_values (\<lambda>t. trm_rep t S)) (subst_cl (cl_ecl C) \<sigma>)
\<not> validate_ground_clause (int_clset S) (subst_cl (cl_ecl C) \<sigma>)
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
validate_ground_clause (same_values (\<lambda>t. trm_rep t S)) (subst_cl (cl_ecl C) \<sigma>)
\<not> validate_ground_clause (int_clset S) (subst_cl (cl_ecl C) \<sigma>)

goal (1 subgoal):
 1. False
[PROOF STEP]
unfolding int_clset_def
[PROOF STATE]
proof (prove)
using this:
validate_ground_clause (same_values (\<lambda>t. trm_rep t S)) (subst_cl (cl_ecl C) \<sigma>)
\<not> validate_ground_clause (same_values (\<lambda>x. trm_rep x S)) (subst_cl (cl_ecl C) \<sigma>)

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
trm_rep (t \<lhd> \<sigma>) S \<noteq> trm_rep (s \<lhd> \<sigma>) S

goal (1 subgoal):
 1. (subst_lit L2 \<sigma>', subst_lit L1 \<sigma>') \<notin> lit_ord \<Longrightarrow> False
[PROOF STEP]
have cv': "(candidate_values (trm_rep (subst s \<sigma>) S) C (cl_ecl C) (subst_cl (cl_ecl C) \<sigma>)
                  (subst s \<sigma>) (subst_lit L1 \<sigma>) L1 \<sigma> t s v S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. candidate_values (trm_rep (s \<lhd> \<sigma>) S) C (cl_ecl C) (subst_cl (cl_ecl C) \<sigma>) (s \<lhd> \<sigma>) (subst_lit L1 \<sigma>) L1 \<sigma> t s v S
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. candidate_values (trm_rep (s \<lhd> \<sigma>) S) C (cl_ecl C) (subst_cl (cl_ecl C) \<sigma>) (s \<lhd> \<sigma>) (subst_lit L1 \<sigma>) L1 \<sigma> t s v S
[PROOF STEP]
from \<open>polarity=pos\<close> and \<open>orient_lit_inst L1 t s polarity \<sigma>\<close>
[PROOF STATE]
proof (chain)
picking this:
polarity = pos
orient_lit_inst L1 t s polarity \<sigma>
[PROOF STEP]
have "\<not>negative_literal L1"
[PROOF STATE]
proof (prove)
using this:
polarity = pos
orient_lit_inst L1 t s polarity \<sigma>

goal (1 subgoal):
 1. \<not> negative_literal L1
[PROOF STEP]
unfolding  orient_lit_inst_def
[PROOF STATE]
proof (prove)
using this:
polarity = pos
(L1 = Pos (Eq t s) \<or> L1 = Pos (Eq s t)) \<and> (t \<lhd> \<sigma>, s \<lhd> \<sigma>) \<notin> trm_ord \<and> polarity = pos \<or> (L1 = Neg (Eq t s) \<or> L1 = Neg (Eq s t)) \<and> (t \<lhd> \<sigma>, s \<lhd> \<sigma>) \<notin> trm_ord \<and> polarity = neg

goal (1 subgoal):
 1. \<not> negative_literal L1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<not> negative_literal L1

goal (1 subgoal):
 1. candidate_values (trm_rep (s \<lhd> \<sigma>) S) C (cl_ecl C) (subst_cl (cl_ecl C) \<sigma>) (s \<lhd> \<sigma>) (subst_lit L1 \<sigma>) L1 \<sigma> t s v S
[PROOF STEP]
from this and \<open>eligible_literal L1 C \<sigma>\<close>
[PROOF STATE]
proof (chain)
picking this:
\<not> negative_literal L1
eligible_literal L1 C \<sigma>
[PROOF STEP]
have "sel(cl_ecl C) = {}" and "maximal_literal (subst_lit L1 \<sigma>) (subst_cl (cl_ecl C) \<sigma>)"
[PROOF STATE]
proof (prove)
using this:
\<not> negative_literal L1
eligible_literal L1 C \<sigma>

goal (1 subgoal):
 1. sel (cl_ecl C) = {} &&& maximal_literal (subst_lit L1 \<sigma>) (subst_cl (cl_ecl C) \<sigma>)
[PROOF STEP]
using sel_neg
[PROOF STATE]
proof (prove)
using this:
\<not> negative_literal L1
eligible_literal L1 C \<sigma>
\<forall>x. sel (cl_ecl x) \<subseteq> cl_ecl x \<and> (\<forall>y\<in>sel (cl_ecl x). negative_literal y)

goal (1 subgoal):
 1. sel (cl_ecl C) = {} &&& maximal_literal (subst_lit L1 \<sigma>) (subst_cl (cl_ecl C) \<sigma>)
[PROOF STEP]
unfolding eligible_literal_def
[PROOF STATE]
proof (prove)
using this:
\<not> negative_literal L1
L1 \<in> sel (cl_ecl C) \<or> sel (cl_ecl C) = {} \<and> maximal_literal (subst_lit L1 \<sigma>) (subst_cl (cl_ecl C) \<sigma>)
\<forall>x. sel (cl_ecl x) \<subseteq> cl_ecl x \<and> (\<forall>y\<in>sel (cl_ecl x). negative_literal y)

goal (1 subgoal):
 1. sel (cl_ecl C) = {} &&& maximal_literal (subst_lit L1 \<sigma>) (subst_cl (cl_ecl C) \<sigma>)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
sel (cl_ecl C) = {}
maximal_literal (subst_lit L1 \<sigma>) (subst_cl (cl_ecl C) \<sigma>)

goal (1 subgoal):
 1. candidate_values (trm_rep (s \<lhd> \<sigma>) S) C (cl_ecl C) (subst_cl (cl_ecl C) \<sigma>) (s \<lhd> \<sigma>) (subst_lit L1 \<sigma>) L1 \<sigma> t s v S
[PROOF STEP]
from  \<open>v = subst u \<sigma>\<close> and \<open>u = t\<close>
[PROOF STATE]
proof (chain)
picking this:
v = u \<lhd> \<sigma>
u = t
[PROOF STEP]
have "v = subst t \<sigma>"
[PROOF STATE]
proof (prove)
using this:
v = u \<lhd> \<sigma>
u = t

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

goal (1 subgoal):
 1. candidate_values (trm_rep (s \<lhd> \<sigma>) S) C (cl_ecl C) (subst_cl (cl_ecl C) \<sigma>) (s \<lhd> \<sigma>) (subst_lit L1 \<sigma>) L1 \<sigma> t s v S
[PROOF STEP]
from assms(7) \<open>C \<in> S\<close>
[PROOF STATE]
proof (chain)
picking this:
\<forall>x\<in>S. finite (cl_ecl x)
C \<in> S
[PROOF STEP]
have "finite (cl_ecl C)"
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>S. finite (cl_ecl x)
C \<in> S

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

goal (1 subgoal):
 1. candidate_values (trm_rep (s \<lhd> \<sigma>) S) C (cl_ecl C) (subst_cl (cl_ecl C) \<sigma>) (s \<lhd> \<sigma>) (subst_lit L1 \<sigma>) L1 \<sigma> t s v S
[PROOF STEP]
have "v \<notin> subst_set (trms_ecl C) \<sigma>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. v \<notin> subst_set (trms_ecl C) \<sigma>
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. v \<in> subst_set (trms_ecl C) \<sigma> \<Longrightarrow> False
[PROOF STEP]
assume "v \<in> subst_set (trms_ecl C) \<sigma>"
[PROOF STATE]
proof (state)
this:
v \<in> subst_set (trms_ecl C) \<sigma>

goal (1 subgoal):
 1. v \<in> subst_set (trms_ecl C) \<sigma> \<Longrightarrow> False
[PROOF STEP]
from this and assms(12) \<open>subterm (subst t \<sigma>) p v\<close> \<open>v = subst t \<sigma>\<close>
[PROOF STATE]
proof (chain)
picking this:
v \<in> subst_set (trms_ecl C) \<sigma>
all_trms_irreducible (subst_set (trms_ecl C) \<sigma>) (\<lambda>t. trm_rep t S)
subterm (t \<lhd> \<sigma>) p v
v = t \<lhd> \<sigma>
[PROOF STEP]
have "trm_rep v S = v"
[PROOF STATE]
proof (prove)
using this:
v \<in> subst_set (trms_ecl C) \<sigma>
all_trms_irreducible (subst_set (trms_ecl C) \<sigma>) (\<lambda>t. trm_rep t S)
subterm (t \<lhd> \<sigma>) p v
v = t \<lhd> \<sigma>

goal (1 subgoal):
 1. trm_rep v S = v
[PROOF STEP]
unfolding all_trms_irreducible_def occurs_in_def
[PROOF STATE]
proof (prove)
using this:
v \<in> subst_set (trms_ecl C) \<sigma>
\<forall>x y. x \<in> subst_set (trms_ecl C) \<sigma> \<longrightarrow> (\<exists>p. subterm x p y) \<longrightarrow> trm_rep y S = y
subterm (t \<lhd> \<sigma>) p v
v = t \<lhd> \<sigma>

goal (1 subgoal):
 1. trm_rep v S = v
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
trm_rep v S = v

goal (1 subgoal):
 1. v \<in> subst_set (trms_ecl C) \<sigma> \<Longrightarrow> False
[PROOF STEP]
from this \<open>v = subst t \<sigma>\<close> \<open>trm_rep (subst t \<sigma>) S \<noteq> (subst t \<sigma>)\<close>
[PROOF STATE]
proof (chain)
picking this:
trm_rep v S = v
v = t \<lhd> \<sigma>
trm_rep (t \<lhd> \<sigma>) S \<noteq> t \<lhd> \<sigma>
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
trm_rep v S = v
v = t \<lhd> \<sigma>
trm_rep (t \<lhd> \<sigma>) S \<noteq> t \<lhd> \<sigma>

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
v \<notin> subst_set (trms_ecl C) \<sigma>

goal (1 subgoal):
 1. candidate_values (trm_rep (s \<lhd> \<sigma>) S) C (cl_ecl C) (subst_cl (cl_ecl C) \<sigma>) (s \<lhd> \<sigma>) (subst_lit L1 \<sigma>) L1 \<sigma> t s v S
[PROOF STEP]
from assms(13)
[PROOF STATE]
proof (chain)
picking this:
\<not> validate_ground_clause (int_clset S) (subst_cl (cl_ecl C) \<sigma>)
[PROOF STEP]
have "smaller_lits_are_false v (subst_cl (cl_ecl C) \<sigma>) S"
[PROOF STATE]
proof (prove)
using this:
\<not> validate_ground_clause (int_clset S) (subst_cl (cl_ecl C) \<sigma>)

goal (1 subgoal):
 1. smaller_lits_are_false v (subst_cl (cl_ecl C) \<sigma>) S
[PROOF STEP]
using smaller_lits_are_false_if_cl_not_valid [of S "(subst_cl (cl_ecl C) \<sigma>)" ]
[PROOF STATE]
proof (prove)
using this:
\<not> validate_ground_clause (int_clset S) (subst_cl (cl_ecl C) \<sigma>)
\<not> validate_ground_clause (int_clset S) (subst_cl (cl_ecl C) \<sigma>) \<Longrightarrow> smaller_lits_are_false ?t (subst_cl (cl_ecl C) \<sigma>) S

goal (1 subgoal):
 1. smaller_lits_are_false v (subst_cl (cl_ecl C) \<sigma>) S
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
smaller_lits_are_false v (subst_cl (cl_ecl C) \<sigma>) S

goal (1 subgoal):
 1. candidate_values (trm_rep (s \<lhd> \<sigma>) S) C (cl_ecl C) (subst_cl (cl_ecl C) \<sigma>) (s \<lhd> \<sigma>) (subst_lit L1 \<sigma>) L1 \<sigma> t s v S
[PROOF STEP]
from assms(1) \<open>\<not> proper_subterm_red t S \<sigma>\<close> \<open>polarity=pos\<close> \<open>v = subst t \<sigma>\<close>
[PROOF STATE]
proof (chain)
picking this:
polarity = neg \<or> \<not> equivalent_eq_exists t s (cl_ecl C) (int_clset S) \<sigma> L1 \<or> proper_subterm_red t S \<sigma>
\<not> proper_subterm_red t S \<sigma>
polarity = pos
v = t \<lhd> \<sigma>
[PROOF STEP]
have
          "maximal_literal_is_unique v (subst s \<sigma>) (cl_ecl C) L1 S \<sigma>"
[PROOF STATE]
proof (prove)
using this:
polarity = neg \<or> \<not> equivalent_eq_exists t s (cl_ecl C) (int_clset S) \<sigma> L1 \<or> proper_subterm_red t S \<sigma>
\<not> proper_subterm_red t S \<sigma>
polarity = pos
v = t \<lhd> \<sigma>

goal (1 subgoal):
 1. maximal_literal_is_unique v (s \<lhd> \<sigma>) (cl_ecl C) L1 S \<sigma>
[PROOF STEP]
using maximal_literal_is_unique_lemma [of t s "(cl_ecl C)" S \<sigma> L1]
[PROOF STATE]
proof (prove)
using this:
polarity = neg \<or> \<not> equivalent_eq_exists t s (cl_ecl C) (int_clset S) \<sigma> L1 \<or> proper_subterm_red t S \<sigma>
\<not> proper_subterm_red t S \<sigma>
polarity = pos
v = t \<lhd> \<sigma>
\<not> equivalent_eq_exists t s (cl_ecl C) (int_clset S) \<sigma> L1 \<Longrightarrow> maximal_literal_is_unique (t \<lhd> \<sigma>) (s \<lhd> \<sigma>) (cl_ecl C) L1 S \<sigma>

goal (1 subgoal):
 1. maximal_literal_is_unique v (s \<lhd> \<sigma>) (cl_ecl C) L1 S \<sigma>
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
maximal_literal_is_unique v (s \<lhd> \<sigma>) (cl_ecl C) L1 S \<sigma>

goal (1 subgoal):
 1. candidate_values (trm_rep (s \<lhd> \<sigma>) S) C (cl_ecl C) (subst_cl (cl_ecl C) \<sigma>) (s \<lhd> \<sigma>) (subst_lit L1 \<sigma>) L1 \<sigma> t s v S
[PROOF STEP]
from \<open>all_trms_irreducible (subst_set (trms_ecl C) \<sigma>) (\<lambda>t. trm_rep t S)\<close>
[PROOF STATE]
proof (chain)
picking this:
all_trms_irreducible (subst_set (trms_ecl C) \<sigma>) (\<lambda>t. trm_rep t S)
[PROOF STEP]
have "trms_irreducible C \<sigma> S v"
[PROOF STATE]
proof (prove)
using this:
all_trms_irreducible (subst_set (trms_ecl C) \<sigma>) (\<lambda>t. trm_rep t S)

goal (1 subgoal):
 1. trms_irreducible C \<sigma> S v
[PROOF STEP]
using trms_irreducible_lemma [of C \<sigma> S v]
[PROOF STATE]
proof (prove)
using this:
all_trms_irreducible (subst_set (trms_ecl C) \<sigma>) (\<lambda>t. trm_rep t S)
all_trms_irreducible (subst_set (trms_ecl C) \<sigma>) (\<lambda>t. trm_rep t S) \<Longrightarrow> trms_irreducible C \<sigma> S v

goal (1 subgoal):
 1. trms_irreducible C \<sigma> S v
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
trms_irreducible C \<sigma> S v

goal (1 subgoal):
 1. candidate_values (trm_rep (s \<lhd> \<sigma>) S) C (cl_ecl C) (subst_cl (cl_ecl C) \<sigma>) (s \<lhd> \<sigma>) (subst_lit L1 \<sigma>) L1 \<sigma> t s v S
[PROOF STEP]
have "(subst s \<sigma>, subst t \<sigma>) \<in> trm_ord"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (s \<lhd> \<sigma>, t \<lhd> \<sigma>) \<in> trm_ord
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (s \<lhd> \<sigma>, t \<lhd> \<sigma>) \<in> trm_ord
[PROOF STEP]
from \<open>orient_lit_inst L1 t s polarity \<sigma>\<close>
[PROOF STATE]
proof (chain)
picking this:
orient_lit_inst L1 t s polarity \<sigma>
[PROOF STEP]
have "(subst t \<sigma>, subst s \<sigma>) \<notin> trm_ord"
[PROOF STATE]
proof (prove)
using this:
orient_lit_inst L1 t s polarity \<sigma>

goal (1 subgoal):
 1. (t \<lhd> \<sigma>, s \<lhd> \<sigma>) \<notin> trm_ord
[PROOF STEP]
unfolding orient_lit_inst_def
[PROOF STATE]
proof (prove)
using this:
(L1 = Pos (Eq t s) \<or> L1 = Pos (Eq s t)) \<and> (t \<lhd> \<sigma>, s \<lhd> \<sigma>) \<notin> trm_ord \<and> polarity = pos \<or> (L1 = Neg (Eq t s) \<or> L1 = Neg (Eq s t)) \<and> (t \<lhd> \<sigma>, s \<lhd> \<sigma>) \<notin> trm_ord \<and> polarity = neg

goal (1 subgoal):
 1. (t \<lhd> \<sigma>, s \<lhd> \<sigma>) \<notin> trm_ord
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(t \<lhd> \<sigma>, s \<lhd> \<sigma>) \<notin> trm_ord

goal (1 subgoal):
 1. (s \<lhd> \<sigma>, t \<lhd> \<sigma>) \<in> trm_ord
[PROOF STEP]
from \<open>trm_rep (subst t \<sigma>) S \<noteq> trm_rep (subst s \<sigma>) S\<close>
[PROOF STATE]
proof (chain)
picking this:
trm_rep (t \<lhd> \<sigma>) S \<noteq> trm_rep (s \<lhd> \<sigma>) S
[PROOF STEP]
have "(subst t \<sigma>) \<noteq> (subst s \<sigma>)"
[PROOF STATE]
proof (prove)
using this:
trm_rep (t \<lhd> \<sigma>) S \<noteq> trm_rep (s \<lhd> \<sigma>) S

goal (1 subgoal):
 1. t \<lhd> \<sigma> \<noteq> s \<lhd> \<sigma>
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
t \<lhd> \<sigma> \<noteq> s \<lhd> \<sigma>

goal (1 subgoal):
 1. (s \<lhd> \<sigma>, t \<lhd> \<sigma>) \<in> trm_ord
[PROOF STEP]
from this and \<open>(subst t \<sigma>, subst s \<sigma>) \<notin> trm_ord\<close>
            \<open>vars_of (subst t \<sigma>) = {}\<close>
            \<open>vars_of (subst s \<sigma>) = {}\<close>
[PROOF STATE]
proof (chain)
picking this:
t \<lhd> \<sigma> \<noteq> s \<lhd> \<sigma>
(t \<lhd> \<sigma>, s \<lhd> \<sigma>) \<notin> trm_ord
vars_of (t \<lhd> \<sigma>) = {}
vars_of (s \<lhd> \<sigma>) = {}
[PROOF STEP]
show "(subst s \<sigma>, subst t \<sigma>) \<in> trm_ord"
[PROOF STATE]
proof (prove)
using this:
t \<lhd> \<sigma> \<noteq> s \<lhd> \<sigma>
(t \<lhd> \<sigma>, s \<lhd> \<sigma>) \<notin> trm_ord
vars_of (t \<lhd> \<sigma>) = {}
vars_of (s \<lhd> \<sigma>) = {}

goal (1 subgoal):
 1. (s \<lhd> \<sigma>, t \<lhd> \<sigma>) \<in> trm_ord
[PROOF STEP]
using trm_ord_ground_total
[PROOF STATE]
proof (prove)
using this:
t \<lhd> \<sigma> \<noteq> s \<lhd> \<sigma>
(t \<lhd> \<sigma>, s \<lhd> \<sigma>) \<notin> trm_ord
vars_of (t \<lhd> \<sigma>) = {}
vars_of (s \<lhd> \<sigma>) = {}
\<forall>x y. ground_term x \<longrightarrow> ground_term y \<longrightarrow> x \<noteq> y \<longrightarrow> (x, y) \<in> trm_ord \<or> (y, x) \<in> trm_ord

goal (1 subgoal):
 1. (s \<lhd> \<sigma>, t \<lhd> \<sigma>) \<in> trm_ord
[PROOF STEP]
unfolding ground_term_def
[PROOF STATE]
proof (prove)
using this:
t \<lhd> \<sigma> \<noteq> s \<lhd> \<sigma>
(t \<lhd> \<sigma>, s \<lhd> \<sigma>) \<notin> trm_ord
vars_of (t \<lhd> \<sigma>) = {}
vars_of (s \<lhd> \<sigma>) = {}
\<forall>x y. vars_of x = {} \<longrightarrow> vars_of y = {} \<longrightarrow> x \<noteq> y \<longrightarrow> (x, y) \<in> trm_ord \<or> (y, x) \<in> trm_ord

goal (1 subgoal):
 1. (s \<lhd> \<sigma>, t \<lhd> \<sigma>) \<in> trm_ord
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
(s \<lhd> \<sigma>, t \<lhd> \<sigma>) \<in> trm_ord

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(s \<lhd> \<sigma>, t \<lhd> \<sigma>) \<in> trm_ord

goal (1 subgoal):
 1. candidate_values (trm_rep (s \<lhd> \<sigma>) S) C (cl_ecl C) (subst_cl (cl_ecl C) \<sigma>) (s \<lhd> \<sigma>) (subst_lit L1 \<sigma>) L1 \<sigma> t s v S
[PROOF STEP]
from \<open>C \<in> S\<close> \<open>(subst s \<sigma>, subst t \<sigma>) \<in> trm_ord\<close>
          and \<open>polarity=pos\<close> \<open>orient_lit_inst L1 t s polarity \<sigma>\<close> and \<open>sel (cl_ecl C) = {}\<close>
          and \<open>L1 \<in> cl_ecl C\<close>
          and \<open>maximal_literal (subst_lit L1 \<sigma>) (subst_cl (cl_ecl C) \<sigma>)\<close>
          and \<open>ground_clause (subst_cl (cl_ecl C) \<sigma>)\<close> and \<open>v = subst t \<sigma>\<close>
          and \<open>finite (cl_ecl C)\<close>
          and \<open>v \<notin> subst_set (trms_ecl C) \<sigma>\<close>
          and \<open>smaller_lits_are_false v (subst_cl (cl_ecl C) \<sigma>) S\<close>
          and \<open>maximal_literal_is_unique v (subst s \<sigma>) (cl_ecl C) L1 S \<sigma>\<close>
          and \<open>trms_irreducible C \<sigma> S v\<close>
[PROOF STATE]
proof (chain)
picking this:
C \<in> S
(s \<lhd> \<sigma>, t \<lhd> \<sigma>) \<in> trm_ord
polarity = pos
orient_lit_inst L1 t s polarity \<sigma>
sel (cl_ecl C) = {}
L1 \<in> cl_ecl C
maximal_literal (subst_lit L1 \<sigma>) (subst_cl (cl_ecl C) \<sigma>)
ground_clause (subst_cl (cl_ecl C) \<sigma>)
v = t \<lhd> \<sigma>
finite (cl_ecl C)
v \<notin> subst_set (trms_ecl C) \<sigma>
smaller_lits_are_false v (subst_cl (cl_ecl C) \<sigma>) S
maximal_literal_is_unique v (s \<lhd> \<sigma>) (cl_ecl C) L1 S \<sigma>
trms_irreducible C \<sigma> S v
[PROOF STEP]
show cv': "(candidate_values (trm_rep (subst s \<sigma>) S) C (cl_ecl C) (subst_cl (cl_ecl C) \<sigma>)
            (subst s \<sigma>) (subst_lit L1 \<sigma>) L1 \<sigma> t s v S)"
[PROOF STATE]
proof (prove)
using this:
C \<in> S
(s \<lhd> \<sigma>, t \<lhd> \<sigma>) \<in> trm_ord
polarity = pos
orient_lit_inst L1 t s polarity \<sigma>
sel (cl_ecl C) = {}
L1 \<in> cl_ecl C
maximal_literal (subst_lit L1 \<sigma>) (subst_cl (cl_ecl C) \<sigma>)
ground_clause (subst_cl (cl_ecl C) \<sigma>)
v = t \<lhd> \<sigma>
finite (cl_ecl C)
v \<notin> subst_set (trms_ecl C) \<sigma>
smaller_lits_are_false v (subst_cl (cl_ecl C) \<sigma>) S
maximal_literal_is_unique v (s \<lhd> \<sigma>) (cl_ecl C) L1 S \<sigma>
trms_irreducible C \<sigma> S v

goal (1 subgoal):
 1. candidate_values (trm_rep (s \<lhd> \<sigma>) S) C (cl_ecl C) (subst_cl (cl_ecl C) \<sigma>) (s \<lhd> \<sigma>) (subst_lit L1 \<sigma>) L1 \<sigma> t s v S
[PROOF STEP]
unfolding candidate_values_def
[PROOF STATE]
proof (prove)
using this:
C \<in> S
(s \<lhd> \<sigma>, t \<lhd> \<sigma>) \<in> trm_ord
polarity = pos
orient_lit_inst L1 t s polarity \<sigma>
sel (cl_ecl C) = {}
L1 \<in> cl_ecl C
maximal_literal (subst_lit L1 \<sigma>) (subst_cl (cl_ecl C) \<sigma>)
ground_clause (subst_cl (cl_ecl C) \<sigma>)
v = t \<lhd> \<sigma>
finite (cl_ecl C)
v \<notin> subst_set (trms_ecl C) \<sigma>
smaller_lits_are_false v (subst_cl (cl_ecl C) \<sigma>) S
maximal_literal_is_unique v (s \<lhd> \<sigma>) (cl_ecl C) L1 S \<sigma>
trms_irreducible C \<sigma> S v

goal (1 subgoal):
 1. C \<in> S \<and> v \<notin> subst_set (trms_ecl C) \<sigma> \<and> trms_irreducible C \<sigma> S v \<and> cl_ecl C = cl_ecl C \<and> (s \<lhd> \<sigma>, v) \<in> trm_ord \<and> ((s \<lhd> \<sigma>, v) \<in> trm_ord \<longrightarrow> trm_rep (s \<lhd> \<sigma>) S = trm_rep (s \<lhd> \<sigma>) S) \<and> orient_lit_inst L1 t s pos \<sigma> \<and> sel (cl_ecl C) = {} \<and> L1 \<in> cl_ecl C \<and> maximal_literal (subst_lit L1 \<sigma>) (subst_cl (cl_ecl C) \<sigma>) \<and> subst_lit L1 \<sigma> = subst_lit L1 \<sigma> \<and> subst_cl (cl_ecl C) \<sigma> = subst_cl (cl_ecl C) \<sigma> \<and> ground_clause (subst_cl (cl_ecl C) \<sigma>) \<and> v = t \<lhd> \<sigma> \<and> s \<lhd> \<sigma> = s \<lhd> \<sigma> \<and> finite (cl_ecl C) \<and> smaller_lits_are_false v (subst_cl (cl_ecl C) \<sigma>) S \<and> maximal_literal_is_unique v (s \<lhd> \<sigma>) (cl_ecl C) L1 S \<sigma>
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
candidate_values (trm_rep (s \<lhd> \<sigma>) S) C (cl_ecl C) (subst_cl (cl_ecl C) \<sigma>) (s \<lhd> \<sigma>) (subst_lit L1 \<sigma>) L1 \<sigma> t s v S

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
candidate_values (trm_rep (s \<lhd> \<sigma>) S) C (cl_ecl C) (subst_cl (cl_ecl C) \<sigma>) (s \<lhd> \<sigma>) (subst_lit L1 \<sigma>) L1 \<sigma> t s v S

goal (1 subgoal):
 1. (subst_lit L2 \<sigma>', subst_lit L1 \<sigma>') \<notin> lit_ord \<Longrightarrow> False
[PROOF STEP]
from cv'
[PROOF STATE]
proof (chain)
picking this:
candidate_values (trm_rep (s \<lhd> \<sigma>) S) C (cl_ecl C) (subst_cl (cl_ecl C) \<sigma>) (s \<lhd> \<sigma>) (subst_lit L1 \<sigma>) L1 \<sigma> t s v S
[PROOF STEP]
have "(trm_rep (subst s \<sigma>) S,(subst s \<sigma>)) \<in> set_of_candidate_values S v"
[PROOF STATE]
proof (prove)
using this:
candidate_values (trm_rep (s \<lhd> \<sigma>) S) C (cl_ecl C) (subst_cl (cl_ecl C) \<sigma>) (s \<lhd> \<sigma>) (subst_lit L1 \<sigma>) L1 \<sigma> t s v S

goal (1 subgoal):
 1. (trm_rep (s \<lhd> \<sigma>) S, s \<lhd> \<sigma>) \<in> set_of_candidate_values S v
[PROOF STEP]
unfolding set_of_candidate_values_def
[PROOF STATE]
proof (prove)
using this:
candidate_values (trm_rep (s \<lhd> \<sigma>) S) C (cl_ecl C) (subst_cl (cl_ecl C) \<sigma>) (s \<lhd> \<sigma>) (subst_lit L1 \<sigma>) L1 \<sigma> t s v S

goal (1 subgoal):
 1. (trm_rep (s \<lhd> \<sigma>) S, s \<lhd> \<sigma>) \<in> {pair. \<exists>z CC C' C s L L' \<sigma> t' s'. pair = (z, s) \<and> candidate_values z CC C' C s L L' \<sigma> t' s' v S}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(trm_rep (s \<lhd> \<sigma>) S, s \<lhd> \<sigma>) \<in> set_of_candidate_values S v

goal (1 subgoal):
 1. (subst_lit L2 \<sigma>', subst_lit L1 \<sigma>') \<notin> lit_ord \<Longrightarrow> False
[PROOF STEP]
from this and min_pair and \<open>pair = (zz,  gr_rhs)\<close>
[PROOF STATE]
proof (chain)
picking this:
(trm_rep (s \<lhd> \<sigma>) S, s \<lhd> \<sigma>) \<in> set_of_candidate_values S v
\<forall>pair'\<in>set_of_candidate_values S v. (snd pair', snd pair) \<notin> trm_ord
pair = (zz, gr_rhs)
[PROOF STEP]
have "((subst s \<sigma>),gr_rhs) \<notin> trm_ord"
[PROOF STATE]
proof (prove)
using this:
(trm_rep (s \<lhd> \<sigma>) S, s \<lhd> \<sigma>) \<in> set_of_candidate_values S v
\<forall>pair'\<in>set_of_candidate_values S v. (snd pair', snd pair) \<notin> trm_ord
pair = (zz, gr_rhs)

goal (1 subgoal):
 1. (s \<lhd> \<sigma>, gr_rhs) \<notin> trm_ord
[PROOF STEP]
by (metis snd_conv)
[PROOF STATE]
proof (state)
this:
(s \<lhd> \<sigma>, gr_rhs) \<notin> trm_ord

goal (1 subgoal):
 1. (subst_lit L2 \<sigma>', subst_lit L1 \<sigma>') \<notin> lit_ord \<Longrightarrow> False
[PROOF STEP]
have "(subst s \<sigma>)  \<noteq> gr_rhs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. s \<lhd> \<sigma> \<noteq> gr_rhs
[PROOF STEP]
using \<open>trm_rep v S = trm_rep gr_rhs S\<close> \<open>u = t\<close> \<open>v = subst u \<sigma>\<close>
            \<open>trm_rep (subst t \<sigma>) S \<noteq> trm_rep (subst s \<sigma>) S\<close>
[PROOF STATE]
proof (prove)
using this:
trm_rep v S = trm_rep gr_rhs S
u = t
v = u \<lhd> \<sigma>
trm_rep (t \<lhd> \<sigma>) S \<noteq> trm_rep (s \<lhd> \<sigma>) S

goal (1 subgoal):
 1. s \<lhd> \<sigma> \<noteq> gr_rhs
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
s \<lhd> \<sigma> \<noteq> gr_rhs

goal (1 subgoal):
 1. (subst_lit L2 \<sigma>', subst_lit L1 \<sigma>') \<notin> lit_ord \<Longrightarrow> False
[PROOF STEP]
have "vars_of gr_rhs = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vars_of gr_rhs = {}
[PROOF STEP]
using \<open>subst rhs \<eta> = subst rhs \<sigma>'\<close>
      \<open>subst_lit L2 \<eta> = subst_lit L2 \<sigma>'\<close>
      \<open>gr_L2 = subst_lit L2 \<eta>\<close> \<open>gr_rhs = subst rhs \<eta>\<close>
      \<open>orient_lit (subst_lit L2 \<sigma>') (subst lhs \<sigma>') (subst rhs \<sigma>') pos\<close>
      \<open>vars_of_lit gr_L2 = {}\<close> orient_lit_vars
[PROOF STATE]
proof (prove)
using this:
rhs \<lhd> \<eta> = rhs \<lhd> \<sigma>'
subst_lit L2 \<eta> = subst_lit L2 \<sigma>'
gr_L2 = subst_lit L2 \<eta>
gr_rhs = rhs \<lhd> \<eta>
orient_lit (subst_lit L2 \<sigma>') (lhs \<lhd> \<sigma>') (rhs \<lhd> \<sigma>') pos
vars_of_lit gr_L2 = {}
orient_lit ?L ?t ?s ?p \<Longrightarrow> vars_of ?t \<subseteq> vars_of_lit ?L \<and> vars_of ?s \<subseteq> vars_of_lit ?L

goal (1 subgoal):
 1. vars_of gr_rhs = {}
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
vars_of gr_rhs = {}

goal (1 subgoal):
 1. (subst_lit L2 \<sigma>', subst_lit L1 \<sigma>') \<notin> lit_ord \<Longrightarrow> False
[PROOF STEP]
from \<open>(subst s \<sigma>)  \<noteq> gr_rhs\<close> and \<open>vars_of (subst s \<sigma>) = {}\<close> \<open>vars_of gr_rhs = {}\<close>
        \<open>((subst s \<sigma>),gr_rhs) \<notin> trm_ord\<close>
[PROOF STATE]
proof (chain)
picking this:
s \<lhd> \<sigma> \<noteq> gr_rhs
vars_of (s \<lhd> \<sigma>) = {}
vars_of gr_rhs = {}
(s \<lhd> \<sigma>, gr_rhs) \<notin> trm_ord
[PROOF STEP]
have "(gr_rhs,(subst s \<sigma>)) \<in> trm_ord"
[PROOF STATE]
proof (prove)
using this:
s \<lhd> \<sigma> \<noteq> gr_rhs
vars_of (s \<lhd> \<sigma>) = {}
vars_of gr_rhs = {}
(s \<lhd> \<sigma>, gr_rhs) \<notin> trm_ord

goal (1 subgoal):
 1. (gr_rhs, s \<lhd> \<sigma>) \<in> trm_ord
[PROOF STEP]
using trm_ord_ground_total
[PROOF STATE]
proof (prove)
using this:
s \<lhd> \<sigma> \<noteq> gr_rhs
vars_of (s \<lhd> \<sigma>) = {}
vars_of gr_rhs = {}
(s \<lhd> \<sigma>, gr_rhs) \<notin> trm_ord
\<forall>x y. ground_term x \<longrightarrow> ground_term y \<longrightarrow> x \<noteq> y \<longrightarrow> (x, y) \<in> trm_ord \<or> (y, x) \<in> trm_ord

goal (1 subgoal):
 1. (gr_rhs, s \<lhd> \<sigma>) \<in> trm_ord
[PROOF STEP]
unfolding ground_term_def
[PROOF STATE]
proof (prove)
using this:
s \<lhd> \<sigma> \<noteq> gr_rhs
vars_of (s \<lhd> \<sigma>) = {}
vars_of gr_rhs = {}
(s \<lhd> \<sigma>, gr_rhs) \<notin> trm_ord
\<forall>x y. vars_of x = {} \<longrightarrow> vars_of y = {} \<longrightarrow> x \<noteq> y \<longrightarrow> (x, y) \<in> trm_ord \<or> (y, x) \<in> trm_ord

goal (1 subgoal):
 1. (gr_rhs, s \<lhd> \<sigma>) \<in> trm_ord
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(gr_rhs, s \<lhd> \<sigma>) \<in> trm_ord

goal (1 subgoal):
 1. (subst_lit L2 \<sigma>', subst_lit L1 \<sigma>') \<notin> lit_ord \<Longrightarrow> False
[PROOF STEP]
have "(subst_lit L2 \<sigma>', subst_lit L1 \<sigma>') \<in> lit_ord"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (subst_lit L2 \<sigma>', subst_lit L1 \<sigma>') \<in> lit_ord
[PROOF STEP]
using \<open>(gr_rhs, subst s \<sigma>) \<in> trm_ord\<close>
        \<open>subst lhs \<eta> = subst lhs \<sigma>'\<close> \<open>subst rhs \<eta> = subst rhs \<sigma>'\<close>
        \<open>subst_lit L1 \<sigma> = subst_lit L1 \<sigma>'\<close>
        \<open>gr_rhs = subst rhs \<eta>\<close>
        \<open>orient_lit (subst_lit L2 \<sigma>') (subst lhs \<sigma>') (subst rhs \<sigma>') pos\<close>
        \<open>polarity = pos\<close> \<open>u = t\<close> \<open>v = subst lhs \<eta>\<close> \<open>v = subst u \<sigma>\<close>
        \<open>vars_of_lit (subst_lit L1 \<sigma>') = {}\<close> \<open>vars_of_lit (subst_lit L2 \<sigma>') = {}\<close>
        assms(6) lit_ord_rhs lift_orient_lit
[PROOF STATE]
proof (prove)
using this:
(gr_rhs, s \<lhd> \<sigma>) \<in> trm_ord
lhs \<lhd> \<eta> = lhs \<lhd> \<sigma>'
rhs \<lhd> \<eta> = rhs \<lhd> \<sigma>'
subst_lit L1 \<sigma> = subst_lit L1 \<sigma>'
gr_rhs = rhs \<lhd> \<eta>
orient_lit (subst_lit L2 \<sigma>') (lhs \<lhd> \<sigma>') (rhs \<lhd> \<sigma>') pos
polarity = pos
u = t
v = lhs \<lhd> \<eta>
v = u \<lhd> \<sigma>
vars_of_lit (subst_lit L1 \<sigma>') = {}
vars_of_lit (subst_lit L2 \<sigma>') = {}
orient_lit_inst L1 t s polarity \<sigma>
\<lbrakk>(?t1.0, ?t2.0) \<in> trm_ord; orient_lit ?x1.0 ?s ?t1.0 ?p; orient_lit ?x2.0 ?s ?t2.0 ?p; vars_of_lit ?x1.0 = {}; vars_of_lit ?x2.0 = {}\<rbrakk> \<Longrightarrow> (?x1.0, ?x2.0) \<in> lit_ord
orient_lit_inst ?L ?t ?s ?p ?\<sigma> \<Longrightarrow> orient_lit (subst_lit ?L ?\<sigma>) (?t \<lhd> ?\<sigma>) (?s \<lhd> ?\<sigma>) ?p

goal (1 subgoal):
 1. (subst_lit L2 \<sigma>', subst_lit L1 \<sigma>') \<in> lit_ord
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
(subst_lit L2 \<sigma>', subst_lit L1 \<sigma>') \<in> lit_ord

goal (1 subgoal):
 1. (subst_lit L2 \<sigma>', subst_lit L1 \<sigma>') \<notin> lit_ord \<Longrightarrow> False
[PROOF STEP]
from this and \<open>(subst_lit L2 \<sigma>', subst_lit L1 \<sigma>') \<notin> lit_ord\<close>
[PROOF STATE]
proof (chain)
picking this:
(subst_lit L2 \<sigma>', subst_lit L1 \<sigma>') \<in> lit_ord
(subst_lit L2 \<sigma>', subst_lit L1 \<sigma>') \<notin> lit_ord
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
(subst_lit L2 \<sigma>', subst_lit L1 \<sigma>') \<in> lit_ord
(subst_lit L2 \<sigma>', subst_lit L1 \<sigma>') \<notin> lit_ord

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(subst_lit L2 \<sigma>', subst_lit L1 \<sigma>') \<in> lit_ord

goal (1 subgoal):
 1. \<exists>\<sigma>' u u' p v D L2. reduction L1 C \<sigma>' t s polarity L2 u u' p v D (same_values (\<lambda>t. trm_rep t S)) S \<sigma> \<and> variable_disjoint C D
[PROOF STEP]
have "trm_rep (subst u \<sigma>) S \<noteq> (subst u \<sigma>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. trm_rep (u \<lhd> \<sigma>) S \<noteq> u \<lhd> \<sigma>
[PROOF STEP]
using \<open>trm_rep v S \<noteq> v\<close> \<open>v = subst u \<sigma>\<close>
[PROOF STATE]
proof (prove)
using this:
trm_rep v S \<noteq> v
v = u \<lhd> \<sigma>

goal (1 subgoal):
 1. trm_rep (u \<lhd> \<sigma>) S \<noteq> u \<lhd> \<sigma>
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
trm_rep (u \<lhd> \<sigma>) S \<noteq> u \<lhd> \<sigma>

goal (1 subgoal):
 1. \<exists>\<sigma>' u u' p v D L2. reduction L1 C \<sigma>' t s polarity L2 u u' p v D (same_values (\<lambda>t. trm_rep t S)) S \<sigma> \<and> variable_disjoint C D
[PROOF STEP]
have "allowed_redex u C \<sigma>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. allowed_redex u C \<sigma>
[PROOF STEP]
proof (rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> allowed_redex u C \<sigma> \<Longrightarrow> False
[PROOF STEP]
assume "\<not>allowed_redex u C \<sigma>"
[PROOF STATE]
proof (state)
this:
\<not> allowed_redex u C \<sigma>

goal (1 subgoal):
 1. \<not> allowed_redex u C \<sigma> \<Longrightarrow> False
[PROOF STEP]
from this
[PROOF STATE]
proof (chain)
picking this:
\<not> allowed_redex u C \<sigma>
[PROOF STEP]
obtain ss where "ss \<in> trms_ecl C"
      and "occurs_in (subst u \<sigma>) (subst ss \<sigma>)"
[PROOF STATE]
proof (prove)
using this:
\<not> allowed_redex u C \<sigma>

goal (1 subgoal):
 1. (\<And>ss. \<lbrakk>ss \<in> trms_ecl C; occurs_in (u \<lhd> \<sigma>) (ss \<lhd> \<sigma>)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding allowed_redex_def
[PROOF STATE]
proof (prove)
using this:
\<not> \<not> (\<exists>s\<in>trms_ecl C. occurs_in (u \<lhd> \<sigma>) (s \<lhd> \<sigma>))

goal (1 subgoal):
 1. (\<And>ss. \<lbrakk>ss \<in> trms_ecl C; occurs_in (u \<lhd> \<sigma>) (ss \<lhd> \<sigma>)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
ss \<in> trms_ecl C
occurs_in (u \<lhd> \<sigma>) (ss \<lhd> \<sigma>)

goal (1 subgoal):
 1. \<not> allowed_redex u C \<sigma> \<Longrightarrow> False
[PROOF STEP]
from \<open>ss \<in> trms_ecl C\<close>
[PROOF STATE]
proof (chain)
picking this:
ss \<in> trms_ecl C
[PROOF STEP]
have "(subst ss \<sigma>) \<in> (subst_set (trms_ecl C) \<sigma>)"
[PROOF STATE]
proof (prove)
using this:
ss \<in> trms_ecl C

goal (1 subgoal):
 1. ss \<lhd> \<sigma> \<in> subst_set (trms_ecl C) \<sigma>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
ss \<lhd> \<sigma> \<in> subst_set (trms_ecl C) \<sigma>

goal (1 subgoal):
 1. \<not> allowed_redex u C \<sigma> \<Longrightarrow> False
[PROOF STEP]
from this and assms(12) and \<open>occurs_in (subst u \<sigma>) (subst ss \<sigma>)\<close>
      \<open>trm_rep (subst u \<sigma>) S \<noteq> (subst u \<sigma>)\<close>
[PROOF STATE]
proof (chain)
picking this:
ss \<lhd> \<sigma> \<in> subst_set (trms_ecl C) \<sigma>
all_trms_irreducible (subst_set (trms_ecl C) \<sigma>) (\<lambda>t. trm_rep t S)
occurs_in (u \<lhd> \<sigma>) (ss \<lhd> \<sigma>)
trm_rep (u \<lhd> \<sigma>) S \<noteq> u \<lhd> \<sigma>
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
ss \<lhd> \<sigma> \<in> subst_set (trms_ecl C) \<sigma>
all_trms_irreducible (subst_set (trms_ecl C) \<sigma>) (\<lambda>t. trm_rep t S)
occurs_in (u \<lhd> \<sigma>) (ss \<lhd> \<sigma>)
trm_rep (u \<lhd> \<sigma>) S \<noteq> u \<lhd> \<sigma>

goal (1 subgoal):
 1. False
[PROOF STEP]
unfolding all_trms_irreducible_def
[PROOF STATE]
proof (prove)
using this:
ss \<lhd> \<sigma> \<in> subst_set (trms_ecl C) \<sigma>
\<forall>x y. x \<in> subst_set (trms_ecl C) \<sigma> \<longrightarrow> occurs_in y x \<longrightarrow> trm_rep y S = y
occurs_in (u \<lhd> \<sigma>) (ss \<lhd> \<sigma>)
trm_rep (u \<lhd> \<sigma>) S \<noteq> u \<lhd> \<sigma>

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

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

goal (1 subgoal):
 1. \<exists>\<sigma>' u u' p v D L2. reduction L1 C \<sigma>' t s polarity L2 u u' p v D (same_values (\<lambda>t. trm_rep t S)) S \<sigma> \<and> variable_disjoint C D
[PROOF STEP]
have "subst lhs \<sigma>' \<noteq> subst rhs \<sigma>'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lhs \<lhd> \<sigma>' \<noteq> rhs \<lhd> \<sigma>'
[PROOF STEP]
using \<open>(gr_rhs, v) \<in> trm_ord\<close>
    \<open>subst lhs \<eta> = subst lhs \<sigma>'\<close>
    \<open>subst rhs \<eta> = subst rhs \<sigma>'\<close>
    \<open>gr_rhs = subst rhs \<eta>\<close> \<open>v = subst lhs \<eta>\<close> trm_ord_wf
[PROOF STATE]
proof (prove)
using this:
(gr_rhs, v) \<in> trm_ord
lhs \<lhd> \<eta> = lhs \<lhd> \<sigma>'
rhs \<lhd> \<eta> = rhs \<lhd> \<sigma>'
gr_rhs = rhs \<lhd> \<eta>
v = lhs \<lhd> \<eta>
wf trm_ord

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

goal (1 subgoal):
 1. \<exists>\<sigma>' u u' p v D L2. reduction L1 C \<sigma>' t s polarity L2 u u' p v D (same_values (\<lambda>t. trm_rep t S)) S \<sigma> \<and> variable_disjoint C D
[PROOF STEP]
from this \<open>mp=p\<close> \<open>\<not> (is_a_variable u)\<close>
   \<open>all_trms_irreducible (subst_set (trms_ecl C2) \<sigma>') (\<lambda>t. trm_rep t S)\<close>
   \<open>(subst_lit L2 \<sigma>', subst_lit L1 \<sigma>') \<in> lit_ord\<close>
   \<open>all_trms_irreducible (subst_set (trms_ecl C2) \<sigma>') (\<lambda>t. trm_rep t S)\<close>
   \<open>(\<forall>x\<in>cl_ecl C2 - {L2}. (subst_lit x \<sigma>', subst_lit L2 \<sigma>') \<in> lit_ord)\<close>
   \<open>C2 \<in> S\<close> \<open>eligible_literal L1 C \<sigma>'\<close> \<open>eligible_literal L2 C2 \<sigma>'\<close>
   \<open>ground_clause (subst_cl Cl_C2 \<sigma>')\<close> \<open>Cl_C2 = cl_ecl C2\<close>
    mr \<open>coincide_on \<sigma> \<sigma>' (vars_of_cl (cl_ecl C))\<close> \<open>L1 \<in> cl_ecl C\<close> \<open>L2 \<in> Cl_C2\<close>
    \<open>orient_lit_inst L1 t s polarity \<sigma>'\<close> \<open>(orient_lit_inst L2 lhs rhs pos \<sigma>')\<close>
    \<open>(subterm t p u)\<close> \<open>subst u \<sigma>' = subst lhs \<sigma>'\<close>
    \<open>trm_rep (subst rhs \<sigma>') S = trm_rep (subst lhs \<sigma>') S\<close>
    \<open>(\<not> validate_ground_clause ?I (subst_cl ( Cl_C2 - { L2 } ) \<sigma>'))\<close>
    \<open>allowed_redex u C \<sigma>\<close>
[PROOF STATE]
proof (chain)
picking this:
lhs \<lhd> \<sigma>' \<noteq> rhs \<lhd> \<sigma>'
mp = p
\<not> is_a_variable u
all_trms_irreducible (subst_set (trms_ecl C2) \<sigma>') (\<lambda>t. trm_rep t S)
(subst_lit L2 \<sigma>', subst_lit L1 \<sigma>') \<in> lit_ord
all_trms_irreducible (subst_set (trms_ecl C2) \<sigma>') (\<lambda>t. trm_rep t S)
\<forall>x\<in>cl_ecl C2 - {L2}. (subst_lit x \<sigma>', subst_lit L2 \<sigma>') \<in> lit_ord
C2 \<in> S
eligible_literal L1 C \<sigma>'
eligible_literal L2 C2 \<sigma>'
ground_clause (subst_cl Cl_C2 \<sigma>')
Cl_C2 = cl_ecl C2
minimal_redex mp (t \<lhd> \<sigma>) C S t
coincide_on \<sigma> \<sigma>' (vars_of_cl (cl_ecl C))
L1 \<in> cl_ecl C
L2 \<in> Cl_C2
orient_lit_inst L1 t s polarity \<sigma>'
orient_lit_inst L2 lhs rhs pos \<sigma>'
subterm t p u
u \<lhd> \<sigma>' = lhs \<lhd> \<sigma>'
trm_rep (rhs \<lhd> \<sigma>') S = trm_rep (lhs \<lhd> \<sigma>') S
\<not> validate_ground_clause (same_values (\<lambda>t. trm_rep t S)) (subst_cl (Cl_C2 - {L2}) \<sigma>')
allowed_redex u C \<sigma>
[PROOF STEP]
have "(reduction L1 C \<sigma>' t s polarity L2 lhs u mp rhs C2 (same_values (\<lambda>t. (trm_rep t S))) S \<sigma>)"
[PROOF STATE]
proof (prove)
using this:
lhs \<lhd> \<sigma>' \<noteq> rhs \<lhd> \<sigma>'
mp = p
\<not> is_a_variable u
all_trms_irreducible (subst_set (trms_ecl C2) \<sigma>') (\<lambda>t. trm_rep t S)
(subst_lit L2 \<sigma>', subst_lit L1 \<sigma>') \<in> lit_ord
all_trms_irreducible (subst_set (trms_ecl C2) \<sigma>') (\<lambda>t. trm_rep t S)
\<forall>x\<in>cl_ecl C2 - {L2}. (subst_lit x \<sigma>', subst_lit L2 \<sigma>') \<in> lit_ord
C2 \<in> S
eligible_literal L1 C \<sigma>'
eligible_literal L2 C2 \<sigma>'
ground_clause (subst_cl Cl_C2 \<sigma>')
Cl_C2 = cl_ecl C2
minimal_redex mp (t \<lhd> \<sigma>) C S t
coincide_on \<sigma> \<sigma>' (vars_of_cl (cl_ecl C))
L1 \<in> cl_ecl C
L2 \<in> Cl_C2
orient_lit_inst L1 t s polarity \<sigma>'
orient_lit_inst L2 lhs rhs pos \<sigma>'
subterm t p u
u \<lhd> \<sigma>' = lhs \<lhd> \<sigma>'
trm_rep (rhs \<lhd> \<sigma>') S = trm_rep (lhs \<lhd> \<sigma>') S
\<not> validate_ground_clause (same_values (\<lambda>t. trm_rep t S)) (subst_cl (Cl_C2 - {L2}) \<sigma>')
allowed_redex u C \<sigma>

goal (1 subgoal):
 1. reduction L1 C \<sigma>' t s polarity L2 lhs u mp rhs C2 (same_values (\<lambda>t. trm_rep t S)) S \<sigma>
[PROOF STEP]
unfolding reduction_def same_values_def
[PROOF STATE]
proof (prove)
using this:
lhs \<lhd> \<sigma>' \<noteq> rhs \<lhd> \<sigma>'
mp = p
\<not> is_a_variable u
all_trms_irreducible (subst_set (trms_ecl C2) \<sigma>') (\<lambda>t. trm_rep t S)
(subst_lit L2 \<sigma>', subst_lit L1 \<sigma>') \<in> lit_ord
all_trms_irreducible (subst_set (trms_ecl C2) \<sigma>') (\<lambda>t. trm_rep t S)
\<forall>x\<in>cl_ecl C2 - {L2}. (subst_lit x \<sigma>', subst_lit L2 \<sigma>') \<in> lit_ord
C2 \<in> S
eligible_literal L1 C \<sigma>'
eligible_literal L2 C2 \<sigma>'
ground_clause (subst_cl Cl_C2 \<sigma>')
Cl_C2 = cl_ecl C2
minimal_redex mp (t \<lhd> \<sigma>) C S t
coincide_on \<sigma> \<sigma>' (vars_of_cl (cl_ecl C))
L1 \<in> cl_ecl C
L2 \<in> Cl_C2
orient_lit_inst L1 t s polarity \<sigma>'
orient_lit_inst L2 lhs rhs pos \<sigma>'
subterm t p u
u \<lhd> \<sigma>' = lhs \<lhd> \<sigma>'
trm_rep (rhs \<lhd> \<sigma>') S = trm_rep (lhs \<lhd> \<sigma>') S
\<not> validate_ground_clause (\<lambda>x y. trm_rep x S = trm_rep y S) (subst_cl (Cl_C2 - {L2}) \<sigma>')
allowed_redex u C \<sigma>

goal (1 subgoal):
 1. C2 \<in> S \<and> eligible_literal L1 C \<sigma>' \<and> eligible_literal L2 C2 \<sigma>' \<and> ground_clause (subst_cl (cl_ecl C2) \<sigma>') \<and> minimal_redex mp (t \<lhd> \<sigma>) C S t \<and> coincide_on \<sigma> \<sigma>' (vars_of_cl (cl_ecl C)) \<and> allowed_redex u C \<sigma> \<and> \<not> is_a_variable u \<and> L1 \<in> cl_ecl C \<and> L2 \<in> cl_ecl C2 \<and> orient_lit_inst L1 t s polarity \<sigma>' \<and> orient_lit_inst L2 lhs rhs pos \<sigma>' \<and> lhs \<lhd> \<sigma>' \<noteq> rhs \<lhd> \<sigma>' \<and> u \<lhd> \<sigma>' = lhs \<lhd> \<sigma>' \<and> \<not> validate_ground_clause (\<lambda>x y. trm_rep x S = trm_rep y S) (subst_cl (cl_ecl C2 - {L2}) \<sigma>') \<and> (subst_lit L2 \<sigma>', subst_lit L1 \<sigma>') \<in> lit_ord \<and> (\<forall>x\<in>cl_ecl C2 - {L2}. (subst_lit x \<sigma>', subst_lit L2 \<sigma>') \<in> lit_ord) \<and> all_trms_irreducible (subst_set (trms_ecl C2) \<sigma>') (\<lambda>t. trm_rep t S) \<and> trm_rep (lhs \<lhd> \<sigma>') S = trm_rep (rhs \<lhd> \<sigma>') S \<and> subterm t mp u
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
reduction L1 C \<sigma>' t s polarity L2 lhs u mp rhs C2 (same_values (\<lambda>t. trm_rep t S)) S \<sigma>

goal (1 subgoal):
 1. \<exists>\<sigma>' u u' p v D L2. reduction L1 C \<sigma>' t s polarity L2 u u' p v D (same_values (\<lambda>t. trm_rep t S)) S \<sigma> \<and> variable_disjoint C D
[PROOF STEP]
from \<open>vars_of_cl (cl_ecl C) \<inter> vars_of_cl (cl_ecl C2) = {}\<close>
[PROOF STATE]
proof (chain)
picking this:
vars_of_cl (cl_ecl C) \<inter> vars_of_cl (cl_ecl C2) = {}
[PROOF STEP]
have "variable_disjoint C C2"
[PROOF STATE]
proof (prove)
using this:
vars_of_cl (cl_ecl C) \<inter> vars_of_cl (cl_ecl C2) = {}

goal (1 subgoal):
 1. variable_disjoint C C2
[PROOF STEP]
unfolding variable_disjoint_def
[PROOF STATE]
proof (prove)
using this:
vars_of_cl (cl_ecl C) \<inter> vars_of_cl (cl_ecl C2) = {}

goal (1 subgoal):
 1. vars_of_cl (cl_ecl C) \<inter> vars_of_cl (cl_ecl C2) = {}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
variable_disjoint C C2

goal (1 subgoal):
 1. \<exists>\<sigma>' u u' p v D L2. reduction L1 C \<sigma>' t s polarity L2 u u' p v D (same_values (\<lambda>t. trm_rep t S)) S \<sigma> \<and> variable_disjoint C D
[PROOF STEP]
from this and
    \<open>(reduction L1 C \<sigma>' t s polarity L2 lhs u mp rhs C2 (same_values (\<lambda>t. (trm_rep t S))) S \<sigma>)\<close>
[PROOF STATE]
proof (chain)
picking this:
variable_disjoint C C2
reduction L1 C \<sigma>' t s polarity L2 lhs u mp rhs C2 (same_values (\<lambda>t. trm_rep t S)) S \<sigma>
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
variable_disjoint C C2
reduction L1 C \<sigma>' t s polarity L2 lhs u mp rhs C2 (same_values (\<lambda>t. trm_rep t S)) S \<sigma>

goal (1 subgoal):
 1. \<exists>\<sigma>' u u' p v D L2. reduction L1 C \<sigma>' t s polarity L2 u u' p v D (same_values (\<lambda>t. trm_rep t S)) S \<sigma> \<and> variable_disjoint C D
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>\<sigma>' u u' p v D L2. reduction L1 C \<sigma>' t s polarity L2 u u' p v D (same_values (\<lambda>t. trm_rep t S)) S \<sigma> \<and> variable_disjoint C D

goal:
No subgoals!
[PROOF STEP]
qed