[STATEMENT]
lemma finiteUniqAndConsistentTrailsWithGivenVariableSet:
  fixes V :: "Variable set"
  assumes "finite V"
  shows "finite {(M::LiteralTrail). vars (elements M) = V \<and> uniq (elements M) \<and> consistent (elements M)}"
        (is "finite (?trails V)")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {M. vars (elements M) = V \<and> uniq (elements M) \<and> consistent (elements M)}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
finite V

goal (1 subgoal):
 1. finite {M. vars (elements M) = V \<and> uniq (elements M) \<and> consistent (elements M)}
[PROOF STEP]
proof induct
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. finite {M. vars (elements M) = {} \<and> uniq (elements M) \<and> consistent (elements M)}
 2. \<And>x F. \<lbrakk>finite F; x \<notin> F; finite {M. vars (elements M) = F \<and> uniq (elements M) \<and> consistent (elements M)}\<rbrakk> \<Longrightarrow> finite {M. vars (elements M) = insert x F \<and> uniq (elements M) \<and> consistent (elements M)}
[PROOF STEP]
case empty
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. finite {M. vars (elements M) = {} \<and> uniq (elements M) \<and> consistent (elements M)}
 2. \<And>x F. \<lbrakk>finite F; x \<notin> F; finite {M. vars (elements M) = F \<and> uniq (elements M) \<and> consistent (elements M)}\<rbrakk> \<Longrightarrow> finite {M. vars (elements M) = insert x F \<and> uniq (elements M) \<and> consistent (elements M)}
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {M. vars (elements M) = {} \<and> uniq (elements M) \<and> consistent (elements M)}
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. finite {M. vars (elements M) = {} \<and> uniq (elements M) \<and> consistent (elements M)}
[PROOF STEP]
have "?trails {} = {M. M = []}" (is "?lhs = ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {M. vars (elements M) = {} \<and> uniq (elements M) \<and> consistent (elements M)} = {M. M = []}
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. {M. vars (elements M) = {} \<and> uniq (elements M) \<and> consistent (elements M)} \<subseteq> {M. M = []}
 2. {M. M = []} \<subseteq> {M. vars (elements M) = {} \<and> uniq (elements M) \<and> consistent (elements M)}
[PROOF STEP]
show "?lhs \<subseteq> ?rhs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {M. vars (elements M) = {} \<and> uniq (elements M) \<and> consistent (elements M)} \<subseteq> {M. M = []}
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> {M. vars (elements M) = {} \<and> uniq (elements M) \<and> consistent (elements M)} \<Longrightarrow> x \<in> {M. M = []}
[PROOF STEP]
fix M::LiteralTrail
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> {M. vars (elements M) = {} \<and> uniq (elements M) \<and> consistent (elements M)} \<Longrightarrow> x \<in> {M. M = []}
[PROOF STEP]
assume "M \<in> ?lhs"
[PROOF STATE]
proof (state)
this:
M \<in> {M. vars (elements M) = {} \<and> uniq (elements M) \<and> consistent (elements M)}

goal (1 subgoal):
 1. \<And>x. x \<in> {M. vars (elements M) = {} \<and> uniq (elements M) \<and> consistent (elements M)} \<Longrightarrow> x \<in> {M. M = []}
[PROOF STEP]
hence "M = []"
[PROOF STATE]
proof (prove)
using this:
M \<in> {M. vars (elements M) = {} \<and> uniq (elements M) \<and> consistent (elements M)}

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

goal (1 subgoal):
 1. \<And>x. x \<in> {M. vars (elements M) = {} \<and> uniq (elements M) \<and> consistent (elements M)} \<Longrightarrow> x \<in> {M. M = []}
[PROOF STEP]
thus "M \<in> ?rhs"
[PROOF STATE]
proof (prove)
using this:
M = []

goal (1 subgoal):
 1. M \<in> {M. M = []}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
M \<in> {M. M = []}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
{M. vars (elements M) = {} \<and> uniq (elements M) \<and> consistent (elements M)} \<subseteq> {M. M = []}

goal (1 subgoal):
 1. {M. M = []} \<subseteq> {M. vars (elements M) = {} \<and> uniq (elements M) \<and> consistent (elements M)}
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. {M. M = []} \<subseteq> {M. vars (elements M) = {} \<and> uniq (elements M) \<and> consistent (elements M)}
[PROOF STEP]
show "?rhs \<subseteq> ?lhs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {M. M = []} \<subseteq> {M. vars (elements M) = {} \<and> uniq (elements M) \<and> consistent (elements M)}
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> {M. M = []} \<Longrightarrow> x \<in> {M. vars (elements M) = {} \<and> uniq (elements M) \<and> consistent (elements M)}
[PROOF STEP]
fix M::LiteralTrail
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> {M. M = []} \<Longrightarrow> x \<in> {M. vars (elements M) = {} \<and> uniq (elements M) \<and> consistent (elements M)}
[PROOF STEP]
assume "M \<in> ?rhs"
[PROOF STATE]
proof (state)
this:
M \<in> {M. M = []}

goal (1 subgoal):
 1. \<And>x. x \<in> {M. M = []} \<Longrightarrow> x \<in> {M. vars (elements M) = {} \<and> uniq (elements M) \<and> consistent (elements M)}
[PROOF STEP]
hence "M = []"
[PROOF STATE]
proof (prove)
using this:
M \<in> {M. M = []}

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

goal (1 subgoal):
 1. \<And>x. x \<in> {M. M = []} \<Longrightarrow> x \<in> {M. vars (elements M) = {} \<and> uniq (elements M) \<and> consistent (elements M)}
[PROOF STEP]
thus "M \<in> ?lhs"
[PROOF STATE]
proof (prove)
using this:
M = []

goal (1 subgoal):
 1. M \<in> {M. vars (elements M) = {} \<and> uniq (elements M) \<and> consistent (elements M)}
[PROOF STEP]
by (induct M) auto
[PROOF STATE]
proof (state)
this:
M \<in> {M. vars (elements M) = {} \<and> uniq (elements M) \<and> consistent (elements M)}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
{M. M = []} \<subseteq> {M. vars (elements M) = {} \<and> uniq (elements M) \<and> consistent (elements M)}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
{M. vars (elements M) = {} \<and> uniq (elements M) \<and> consistent (elements M)} = {M. M = []}

goal (1 subgoal):
 1. finite {M. vars (elements M) = {} \<and> uniq (elements M) \<and> consistent (elements M)}
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
{M. vars (elements M) = {} \<and> uniq (elements M) \<and> consistent (elements M)} = {M. M = []}

goal (1 subgoal):
 1. finite {M. vars (elements M) = {} \<and> uniq (elements M) \<and> consistent (elements M)}
[PROOF STEP]
have "finite {M. M = []}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {M. M = []}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
finite {M. M = []}

goal (1 subgoal):
 1. finite {M. vars (elements M) = {} \<and> uniq (elements M) \<and> consistent (elements M)}
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
{M. vars (elements M) = {} \<and> uniq (elements M) \<and> consistent (elements M)} = {M. M = []}
finite {M. M = []}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
{M. vars (elements M) = {} \<and> uniq (elements M) \<and> consistent (elements M)} = {M. M = []}
finite {M. M = []}

goal (1 subgoal):
 1. finite {M. vars (elements M) = {} \<and> uniq (elements M) \<and> consistent (elements M)}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
finite {M. vars (elements M) = {} \<and> uniq (elements M) \<and> consistent (elements M)}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
finite {M. vars (elements M) = {} \<and> uniq (elements M) \<and> consistent (elements M)}

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; finite {M. vars (elements M) = F \<and> uniq (elements M) \<and> consistent (elements M)}\<rbrakk> \<Longrightarrow> finite {M. vars (elements M) = insert x F \<and> uniq (elements M) \<and> consistent (elements M)}
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; finite {M. vars (elements M) = F \<and> uniq (elements M) \<and> consistent (elements M)}\<rbrakk> \<Longrightarrow> finite {M. vars (elements M) = insert x F \<and> uniq (elements M) \<and> consistent (elements M)}
[PROOF STEP]
case (insert v V')
[PROOF STATE]
proof (state)
this:
finite V'
v \<notin> V'
finite {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)}

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; finite {M. vars (elements M) = F \<and> uniq (elements M) \<and> consistent (elements M)}\<rbrakk> \<Longrightarrow> finite {M. vars (elements M) = insert x F \<and> uniq (elements M) \<and> consistent (elements M)}
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
finite V'
v \<notin> V'
finite {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)}

goal (1 subgoal):
 1. finite {M. vars (elements M) = insert v V' \<and> uniq (elements M) \<and> consistent (elements M)}
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>finite V'; v \<notin> V'; finite {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)}\<rbrakk> \<Longrightarrow> finite {M. vars (elements M) = insert v V' \<and> uniq (elements M) \<and> consistent (elements M)}
[PROOF STEP]
let "?trails' V'" = "{(M::LiteralTrail). \<exists> M' l d M''.
                                M = M' @ [(l, d)] @ M'' \<and>
                                M' @ M'' \<in> (?trails V') \<and>
                                l \<in> {Pos v, Neg v} \<and>
                                d \<in> {True, False}}"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>finite V'; v \<notin> V'; finite {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)}\<rbrakk> \<Longrightarrow> finite {M. vars (elements M) = insert v V' \<and> uniq (elements M) \<and> consistent (elements M)}
[PROOF STEP]
have "?trails (insert v V') = ?trails' V'"
      (is "?lhs = ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {M. vars (elements M) = insert v V' \<and> uniq (elements M) \<and> consistent (elements M)} = {M' @ [(l, d)] @ M'' |M' l d M''. M' @ M'' \<in> {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)} \<and> l \<in> {Pos v, Neg v} \<and> d \<in> {True, False}}
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. {M. vars (elements M) = insert v V' \<and> uniq (elements M) \<and> consistent (elements M)} \<subseteq> {M' @ [(l, d)] @ M'' |M' l d M''. M' @ M'' \<in> {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)} \<and> l \<in> {Pos v, Neg v} \<and> d \<in> {True, False}}
 2. {M' @ [(l, d)] @ M'' |M' l d M''. M' @ M'' \<in> {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)} \<and> l \<in> {Pos v, Neg v} \<and> d \<in> {True, False}} \<subseteq> {M. vars (elements M) = insert v V' \<and> uniq (elements M) \<and> consistent (elements M)}
[PROOF STEP]
show "?lhs \<subseteq> ?rhs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {M. vars (elements M) = insert v V' \<and> uniq (elements M) \<and> consistent (elements M)} \<subseteq> {M' @ [(l, d)] @ M'' |M' l d M''. M' @ M'' \<in> {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)} \<and> l \<in> {Pos v, Neg v} \<and> d \<in> {True, False}}
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> {M. vars (elements M) = insert v V' \<and> uniq (elements M) \<and> consistent (elements M)} \<Longrightarrow> x \<in> {M' @ [(l, d)] @ M'' |M' l d M''. M' @ M'' \<in> {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)} \<and> l \<in> {Pos v, Neg v} \<and> d \<in> {True, False}}
[PROOF STEP]
fix M::LiteralTrail
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> {M. vars (elements M) = insert v V' \<and> uniq (elements M) \<and> consistent (elements M)} \<Longrightarrow> x \<in> {M' @ [(l, d)] @ M'' |M' l d M''. M' @ M'' \<in> {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)} \<and> l \<in> {Pos v, Neg v} \<and> d \<in> {True, False}}
[PROOF STEP]
assume "M \<in> ?lhs"
[PROOF STATE]
proof (state)
this:
M \<in> {M. vars (elements M) = insert v V' \<and> uniq (elements M) \<and> consistent (elements M)}

goal (1 subgoal):
 1. \<And>x. x \<in> {M. vars (elements M) = insert v V' \<and> uniq (elements M) \<and> consistent (elements M)} \<Longrightarrow> x \<in> {M' @ [(l, d)] @ M'' |M' l d M''. M' @ M'' \<in> {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)} \<and> l \<in> {Pos v, Neg v} \<and> d \<in> {True, False}}
[PROOF STEP]
hence "vars (elements M) = insert v V'" "uniq (elements M)" "consistent (elements M)"
[PROOF STATE]
proof (prove)
using this:
M \<in> {M. vars (elements M) = insert v V' \<and> uniq (elements M) \<and> consistent (elements M)}

goal (1 subgoal):
 1. vars (elements M) = insert v V' &&& uniq (elements M) &&& consistent (elements M)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
vars (elements M) = insert v V'
uniq (elements M)
consistent (elements M)

goal (1 subgoal):
 1. \<And>x. x \<in> {M. vars (elements M) = insert v V' \<and> uniq (elements M) \<and> consistent (elements M)} \<Longrightarrow> x \<in> {M' @ [(l, d)] @ M'' |M' l d M''. M' @ M'' \<in> {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)} \<and> l \<in> {Pos v, Neg v} \<and> d \<in> {True, False}}
[PROOF STEP]
hence "v \<in> vars (elements M)"
[PROOF STATE]
proof (prove)
using this:
vars (elements M) = insert v V'
uniq (elements M)
consistent (elements M)

goal (1 subgoal):
 1. v \<in> vars (elements M)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
v \<in> vars (elements M)

goal (1 subgoal):
 1. \<And>x. x \<in> {M. vars (elements M) = insert v V' \<and> uniq (elements M) \<and> consistent (elements M)} \<Longrightarrow> x \<in> {M' @ [(l, d)] @ M'' |M' l d M''. M' @ M'' \<in> {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)} \<and> l \<in> {Pos v, Neg v} \<and> d \<in> {True, False}}
[PROOF STEP]
hence "\<exists> l. l el elements M \<and> var l = v"
[PROOF STATE]
proof (prove)
using this:
v \<in> vars (elements M)

goal (1 subgoal):
 1. \<exists>l. l el elements M \<and> var l = v
[PROOF STEP]
by (induct M) auto
[PROOF STATE]
proof (state)
this:
\<exists>l. l el elements M \<and> var l = v

goal (1 subgoal):
 1. \<And>x. x \<in> {M. vars (elements M) = insert v V' \<and> uniq (elements M) \<and> consistent (elements M)} \<Longrightarrow> x \<in> {M' @ [(l, d)] @ M'' |M' l d M''. M' @ M'' \<in> {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)} \<and> l \<in> {Pos v, Neg v} \<and> d \<in> {True, False}}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>l. l el elements M \<and> var l = v
[PROOF STEP]
obtain l where "l el elements M" "var l = v"
[PROOF STATE]
proof (prove)
using this:
\<exists>l. l el elements M \<and> var l = v

goal (1 subgoal):
 1. (\<And>l. \<lbrakk>l el elements M; var l = v\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
l el elements M
var l = v

goal (1 subgoal):
 1. \<And>x. x \<in> {M. vars (elements M) = insert v V' \<and> uniq (elements M) \<and> consistent (elements M)} \<Longrightarrow> x \<in> {M' @ [(l, d)] @ M'' |M' l d M''. M' @ M'' \<in> {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)} \<and> l \<in> {Pos v, Neg v} \<and> d \<in> {True, False}}
[PROOF STEP]
hence "\<exists> M' M'' d. M = M' @ [(l, d)] @ M''"
[PROOF STATE]
proof (prove)
using this:
l el elements M
var l = v

goal (1 subgoal):
 1. \<exists>M' M'' d. M = M' @ [(l, d)] @ M''
[PROOF STEP]
proof (induct M)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>l el elements []; var l = v\<rbrakk> \<Longrightarrow> \<exists>M' M'' d. [] = M' @ [(l, d)] @ M''
 2. \<And>a M. \<lbrakk>\<lbrakk>l el elements M; var l = v\<rbrakk> \<Longrightarrow> \<exists>M' M'' d. M = M' @ [(l, d)] @ M''; l el elements (a # M); var l = v\<rbrakk> \<Longrightarrow> \<exists>M' M'' d. a # M = M' @ [(l, d)] @ M''
[PROOF STEP]
case (Cons m M1)
[PROOF STATE]
proof (state)
this:
\<lbrakk>l el elements M1; var l = v\<rbrakk> \<Longrightarrow> \<exists>M' M'' d. M1 = M' @ [(l, d)] @ M''
l el elements (m # M1)
var l = v

goal (2 subgoals):
 1. \<lbrakk>l el elements []; var l = v\<rbrakk> \<Longrightarrow> \<exists>M' M'' d. [] = M' @ [(l, d)] @ M''
 2. \<And>a M. \<lbrakk>\<lbrakk>l el elements M; var l = v\<rbrakk> \<Longrightarrow> \<exists>M' M'' d. M = M' @ [(l, d)] @ M''; l el elements (a # M); var l = v\<rbrakk> \<Longrightarrow> \<exists>M' M'' d. a # M = M' @ [(l, d)] @ M''
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>l el elements M1; var l = v\<rbrakk> \<Longrightarrow> \<exists>M' M'' d. M1 = M' @ [(l, d)] @ M''
l el elements (m # M1)
var l = v

goal (1 subgoal):
 1. \<exists>M' M'' d. m # M1 = M' @ [(l, d)] @ M''
[PROOF STEP]
proof (cases "l = (element m)")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>\<lbrakk>l el elements M1; var l = v\<rbrakk> \<Longrightarrow> \<exists>M' M'' d. M1 = M' @ [(l, d)] @ M''; l el elements (m # M1); var l = v; l = element m\<rbrakk> \<Longrightarrow> \<exists>M' M'' d. m # M1 = M' @ [(l, d)] @ M''
 2. \<lbrakk>\<lbrakk>l el elements M1; var l = v\<rbrakk> \<Longrightarrow> \<exists>M' M'' d. M1 = M' @ [(l, d)] @ M''; l el elements (m # M1); var l = v; l \<noteq> element m\<rbrakk> \<Longrightarrow> \<exists>M' M'' d. m # M1 = M' @ [(l, d)] @ M''
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
l = element m

goal (2 subgoals):
 1. \<lbrakk>\<lbrakk>l el elements M1; var l = v\<rbrakk> \<Longrightarrow> \<exists>M' M'' d. M1 = M' @ [(l, d)] @ M''; l el elements (m # M1); var l = v; l = element m\<rbrakk> \<Longrightarrow> \<exists>M' M'' d. m # M1 = M' @ [(l, d)] @ M''
 2. \<lbrakk>\<lbrakk>l el elements M1; var l = v\<rbrakk> \<Longrightarrow> \<exists>M' M'' d. M1 = M' @ [(l, d)] @ M''; l el elements (m # M1); var l = v; l \<noteq> element m\<rbrakk> \<Longrightarrow> \<exists>M' M'' d. m # M1 = M' @ [(l, d)] @ M''
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
l = element m
[PROOF STEP]
obtain d where "m = (l, d)"
[PROOF STATE]
proof (prove)
using this:
l = element m

goal (1 subgoal):
 1. (\<And>d. m = (l, d) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using eitherMarkedOrNotMarkedElement[of "m"]
[PROOF STATE]
proof (prove)
using this:
l = element m
m = (element m, True) \<or> m = (element m, False)

goal (1 subgoal):
 1. (\<And>d. m = (l, d) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
m = (l, d)

goal (2 subgoals):
 1. \<lbrakk>\<lbrakk>l el elements M1; var l = v\<rbrakk> \<Longrightarrow> \<exists>M' M'' d. M1 = M' @ [(l, d)] @ M''; l el elements (m # M1); var l = v; l = element m\<rbrakk> \<Longrightarrow> \<exists>M' M'' d. m # M1 = M' @ [(l, d)] @ M''
 2. \<lbrakk>\<lbrakk>l el elements M1; var l = v\<rbrakk> \<Longrightarrow> \<exists>M' M'' d. M1 = M' @ [(l, d)] @ M''; l el elements (m # M1); var l = v; l \<noteq> element m\<rbrakk> \<Longrightarrow> \<exists>M' M'' d. m # M1 = M' @ [(l, d)] @ M''
[PROOF STEP]
hence "m # M1 = [] @ [(l, d)] @ M1"
[PROOF STATE]
proof (prove)
using this:
m = (l, d)

goal (1 subgoal):
 1. m # M1 = [] @ [(l, d)] @ M1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
m # M1 = [] @ [(l, d)] @ M1

goal (2 subgoals):
 1. \<lbrakk>\<lbrakk>l el elements M1; var l = v\<rbrakk> \<Longrightarrow> \<exists>M' M'' d. M1 = M' @ [(l, d)] @ M''; l el elements (m # M1); var l = v; l = element m\<rbrakk> \<Longrightarrow> \<exists>M' M'' d. m # M1 = M' @ [(l, d)] @ M''
 2. \<lbrakk>\<lbrakk>l el elements M1; var l = v\<rbrakk> \<Longrightarrow> \<exists>M' M'' d. M1 = M' @ [(l, d)] @ M''; l el elements (m # M1); var l = v; l \<noteq> element m\<rbrakk> \<Longrightarrow> \<exists>M' M'' d. m # M1 = M' @ [(l, d)] @ M''
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
m # M1 = [] @ [(l, d)] @ M1
[PROOF STEP]
obtain M' M'' d where "m # M1 = M' @ [(l, d)] @ M''"
[PROOF STATE]
proof (prove)
using this:
m # M1 = [] @ [(l, d)] @ M1

goal (1 subgoal):
 1. (\<And>M' d M''. m # M1 = M' @ [(l, d)] @ M'' \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
m # M1 = M' @ [(l, d)] @ M''

goal (2 subgoals):
 1. \<lbrakk>\<lbrakk>l el elements M1; var l = v\<rbrakk> \<Longrightarrow> \<exists>M' M'' d. M1 = M' @ [(l, d)] @ M''; l el elements (m # M1); var l = v; l = element m\<rbrakk> \<Longrightarrow> \<exists>M' M'' d. m # M1 = M' @ [(l, d)] @ M''
 2. \<lbrakk>\<lbrakk>l el elements M1; var l = v\<rbrakk> \<Longrightarrow> \<exists>M' M'' d. M1 = M' @ [(l, d)] @ M''; l el elements (m # M1); var l = v; l \<noteq> element m\<rbrakk> \<Longrightarrow> \<exists>M' M'' d. m # M1 = M' @ [(l, d)] @ M''
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
m # M1 = M' @ [(l, d)] @ M''

goal (1 subgoal):
 1. \<exists>M' M'' d. m # M1 = M' @ [(l, d)] @ M''
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>M' M'' d. m # M1 = M' @ [(l, d)] @ M''

goal (1 subgoal):
 1. \<lbrakk>\<lbrakk>l el elements M1; var l = v\<rbrakk> \<Longrightarrow> \<exists>M' M'' d. M1 = M' @ [(l, d)] @ M''; l el elements (m # M1); var l = v; l \<noteq> element m\<rbrakk> \<Longrightarrow> \<exists>M' M'' d. m # M1 = M' @ [(l, d)] @ M''
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>\<lbrakk>l el elements M1; var l = v\<rbrakk> \<Longrightarrow> \<exists>M' M'' d. M1 = M' @ [(l, d)] @ M''; l el elements (m # M1); var l = v; l \<noteq> element m\<rbrakk> \<Longrightarrow> \<exists>M' M'' d. m # M1 = M' @ [(l, d)] @ M''
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
l \<noteq> element m

goal (1 subgoal):
 1. \<lbrakk>\<lbrakk>l el elements M1; var l = v\<rbrakk> \<Longrightarrow> \<exists>M' M'' d. M1 = M' @ [(l, d)] @ M''; l el elements (m # M1); var l = v; l \<noteq> element m\<rbrakk> \<Longrightarrow> \<exists>M' M'' d. m # M1 = M' @ [(l, d)] @ M''
[PROOF STEP]
with \<open>l el elements (m # M1)\<close>
[PROOF STATE]
proof (chain)
picking this:
l el elements (m # M1)
l \<noteq> element m
[PROOF STEP]
have "l el elements M1"
[PROOF STATE]
proof (prove)
using this:
l el elements (m # M1)
l \<noteq> element m

goal (1 subgoal):
 1. l el elements M1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
l el elements M1

goal (1 subgoal):
 1. \<lbrakk>\<lbrakk>l el elements M1; var l = v\<rbrakk> \<Longrightarrow> \<exists>M' M'' d. M1 = M' @ [(l, d)] @ M''; l el elements (m # M1); var l = v; l \<noteq> element m\<rbrakk> \<Longrightarrow> \<exists>M' M'' d. m # M1 = M' @ [(l, d)] @ M''
[PROOF STEP]
with Cons(1) \<open>var l = v\<close>
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>l el elements M1; var l = v\<rbrakk> \<Longrightarrow> \<exists>M' M'' d. M1 = M' @ [(l, d)] @ M''
var l = v
l el elements M1
[PROOF STEP]
obtain M1' M'' d where "M1 = M1' @ [(l, d)] @ M''"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>l el elements M1; var l = v\<rbrakk> \<Longrightarrow> \<exists>M' M'' d. M1 = M' @ [(l, d)] @ M''
var l = v
l el elements M1

goal (1 subgoal):
 1. (\<And>M1' d M''. M1 = M1' @ [(l, d)] @ M'' \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
M1 = M1' @ [(l, d)] @ M''

goal (1 subgoal):
 1. \<lbrakk>\<lbrakk>l el elements M1; var l = v\<rbrakk> \<Longrightarrow> \<exists>M' M'' d. M1 = M' @ [(l, d)] @ M''; l el elements (m # M1); var l = v; l \<noteq> element m\<rbrakk> \<Longrightarrow> \<exists>M' M'' d. m # M1 = M' @ [(l, d)] @ M''
[PROOF STEP]
hence "m # M1 = (m # M1') @ [(l, d)] @ M''"
[PROOF STATE]
proof (prove)
using this:
M1 = M1' @ [(l, d)] @ M''

goal (1 subgoal):
 1. m # M1 = (m # M1') @ [(l, d)] @ M''
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
m # M1 = (m # M1') @ [(l, d)] @ M''

goal (1 subgoal):
 1. \<lbrakk>\<lbrakk>l el elements M1; var l = v\<rbrakk> \<Longrightarrow> \<exists>M' M'' d. M1 = M' @ [(l, d)] @ M''; l el elements (m # M1); var l = v; l \<noteq> element m\<rbrakk> \<Longrightarrow> \<exists>M' M'' d. m # M1 = M' @ [(l, d)] @ M''
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
m # M1 = (m # M1') @ [(l, d)] @ M''
[PROOF STEP]
obtain M' M'' d where "m # M1 = M' @ [(l, d)] @ M''"
[PROOF STATE]
proof (prove)
using this:
m # M1 = (m # M1') @ [(l, d)] @ M''

goal (1 subgoal):
 1. (\<And>M' d M''. m # M1 = M' @ [(l, d)] @ M'' \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
m # M1 = M' @ [(l, d)] @ M''

goal (1 subgoal):
 1. \<lbrakk>\<lbrakk>l el elements M1; var l = v\<rbrakk> \<Longrightarrow> \<exists>M' M'' d. M1 = M' @ [(l, d)] @ M''; l el elements (m # M1); var l = v; l \<noteq> element m\<rbrakk> \<Longrightarrow> \<exists>M' M'' d. m # M1 = M' @ [(l, d)] @ M''
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
m # M1 = M' @ [(l, d)] @ M''

goal (1 subgoal):
 1. \<exists>M' M'' d. m # M1 = M' @ [(l, d)] @ M''
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>M' M'' d. m # M1 = M' @ [(l, d)] @ M''

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<exists>M' M'' d. m # M1 = M' @ [(l, d)] @ M''

goal (1 subgoal):
 1. \<lbrakk>l el elements []; var l = v\<rbrakk> \<Longrightarrow> \<exists>M' M'' d. [] = M' @ [(l, d)] @ M''
[PROOF STEP]
qed simp
[PROOF STATE]
proof (state)
this:
\<exists>M' M'' d. M = M' @ [(l, d)] @ M''

goal (1 subgoal):
 1. \<And>x. x \<in> {M. vars (elements M) = insert v V' \<and> uniq (elements M) \<and> consistent (elements M)} \<Longrightarrow> x \<in> {M' @ [(l, d)] @ M'' |M' l d M''. M' @ M'' \<in> {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)} \<and> l \<in> {Pos v, Neg v} \<and> d \<in> {True, False}}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>M' M'' d. M = M' @ [(l, d)] @ M''
[PROOF STEP]
obtain M' M'' d where "M = M' @ [(l, d)] @ M''"
[PROOF STATE]
proof (prove)
using this:
\<exists>M' M'' d. M = M' @ [(l, d)] @ M''

goal (1 subgoal):
 1. (\<And>M' d M''. M = M' @ [(l, d)] @ M'' \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
M = M' @ [(l, d)] @ M''

goal (1 subgoal):
 1. \<And>x. x \<in> {M. vars (elements M) = insert v V' \<and> uniq (elements M) \<and> consistent (elements M)} \<Longrightarrow> x \<in> {M' @ [(l, d)] @ M'' |M' l d M''. M' @ M'' \<in> {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)} \<and> l \<in> {Pos v, Neg v} \<and> d \<in> {True, False}}
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
M = M' @ [(l, d)] @ M''

goal (1 subgoal):
 1. \<And>x. x \<in> {M. vars (elements M) = insert v V' \<and> uniq (elements M) \<and> consistent (elements M)} \<Longrightarrow> x \<in> {M' @ [(l, d)] @ M'' |M' l d M''. M' @ M'' \<in> {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)} \<and> l \<in> {Pos v, Neg v} \<and> d \<in> {True, False}}
[PROOF STEP]
from \<open>var l = v\<close>
[PROOF STATE]
proof (chain)
picking this:
var l = v
[PROOF STEP]
have "l : {Pos v, Neg v}"
[PROOF STATE]
proof (prove)
using this:
var l = v

goal (1 subgoal):
 1. l \<in> {Pos v, Neg v}
[PROOF STEP]
by (cases l) auto
[PROOF STATE]
proof (state)
this:
l \<in> {Pos v, Neg v}

goal (1 subgoal):
 1. \<And>x. x \<in> {M. vars (elements M) = insert v V' \<and> uniq (elements M) \<and> consistent (elements M)} \<Longrightarrow> x \<in> {M' @ [(l, d)] @ M'' |M' l d M''. M' @ M'' \<in> {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)} \<and> l \<in> {Pos v, Neg v} \<and> d \<in> {True, False}}
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
l \<in> {Pos v, Neg v}

goal (1 subgoal):
 1. \<And>x. x \<in> {M. vars (elements M) = insert v V' \<and> uniq (elements M) \<and> consistent (elements M)} \<Longrightarrow> x \<in> {M' @ [(l, d)] @ M'' |M' l d M''. M' @ M'' \<in> {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)} \<and> l \<in> {Pos v, Neg v} \<and> d \<in> {True, False}}
[PROOF STEP]
have *: "vars (elements (M' @ M'')) = vars (elements M') \<union> vars (elements M'')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vars (elements (M' @ M'')) = vars (elements M') \<union> vars (elements M'')
[PROOF STEP]
using varsAppendClauses[of "elements M'" "elements M''"]
[PROOF STATE]
proof (prove)
using this:
vars (elements M' @ elements M'') = vars (elements M') \<union> vars (elements M'')

goal (1 subgoal):
 1. vars (elements (M' @ M'')) = vars (elements M') \<union> vars (elements M'')
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
vars (elements (M' @ M'')) = vars (elements M') \<union> vars (elements M'')

goal (1 subgoal):
 1. \<And>x. x \<in> {M. vars (elements M) = insert v V' \<and> uniq (elements M) \<and> consistent (elements M)} \<Longrightarrow> x \<in> {M' @ [(l, d)] @ M'' |M' l d M''. M' @ M'' \<in> {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)} \<and> l \<in> {Pos v, Neg v} \<and> d \<in> {True, False}}
[PROOF STEP]
from \<open>M = M' @ [(l, d)] @ M''\<close> \<open>var l = v\<close>
[PROOF STATE]
proof (chain)
picking this:
M = M' @ [(l, d)] @ M''
var l = v
[PROOF STEP]
have **: "vars (elements M) = (vars (elements M')) \<union> {v} \<union> (vars (elements M''))"
[PROOF STATE]
proof (prove)
using this:
M = M' @ [(l, d)] @ M''
var l = v

goal (1 subgoal):
 1. vars (elements M) = vars (elements M') \<union> {v} \<union> vars (elements M'')
[PROOF STEP]
using varsAppendClauses[of "elements M'" "elements ([(l, d)] @ M'')"]
[PROOF STATE]
proof (prove)
using this:
M = M' @ [(l, d)] @ M''
var l = v
vars (elements M' @ elements ([(l, d)] @ M'')) = vars (elements M') \<union> vars (elements ([(l, d)] @ M''))

goal (1 subgoal):
 1. vars (elements M) = vars (elements M') \<union> {v} \<union> vars (elements M'')
[PROOF STEP]
using varsAppendClauses[of "elements [(l, d)]" "elements M''"]
[PROOF STATE]
proof (prove)
using this:
M = M' @ [(l, d)] @ M''
var l = v
vars (elements M' @ elements ([(l, d)] @ M'')) = vars (elements M') \<union> vars (elements ([(l, d)] @ M''))
vars (elements [(l, d)] @ elements M'') = vars (elements [(l, d)]) \<union> vars (elements M'')

goal (1 subgoal):
 1. vars (elements M) = vars (elements M') \<union> {v} \<union> vars (elements M'')
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
vars (elements M) = vars (elements M') \<union> {v} \<union> vars (elements M'')

goal (1 subgoal):
 1. \<And>x. x \<in> {M. vars (elements M) = insert v V' \<and> uniq (elements M) \<and> consistent (elements M)} \<Longrightarrow> x \<in> {M' @ [(l, d)] @ M'' |M' l d M''. M' @ M'' \<in> {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)} \<and> l \<in> {Pos v, Neg v} \<and> d \<in> {True, False}}
[PROOF STEP]
have ***: "vars (elements M) = vars (elements (M' @ M'')) \<union> {v}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vars (elements M) = vars (elements (M' @ M'')) \<union> {v}
[PROOF STEP]
using * **
[PROOF STATE]
proof (prove)
using this:
vars (elements (M' @ M'')) = vars (elements M') \<union> vars (elements M'')
vars (elements M) = vars (elements M') \<union> {v} \<union> vars (elements M'')

goal (1 subgoal):
 1. vars (elements M) = vars (elements (M' @ M'')) \<union> {v}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
vars (elements M) = vars (elements (M' @ M'')) \<union> {v}

goal (1 subgoal):
 1. \<And>x. x \<in> {M. vars (elements M) = insert v V' \<and> uniq (elements M) \<and> consistent (elements M)} \<Longrightarrow> x \<in> {M' @ [(l, d)] @ M'' |M' l d M''. M' @ M'' \<in> {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)} \<and> l \<in> {Pos v, Neg v} \<and> d \<in> {True, False}}
[PROOF STEP]
have "M' @ M'' \<in> (?trails V')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. M' @ M'' \<in> {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)}
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. M' @ M'' \<in> {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)}
[PROOF STEP]
from \<open>uniq (elements M)\<close> \<open>M = M' @ [(l, d)] @ M''\<close>
[PROOF STATE]
proof (chain)
picking this:
uniq (elements M)
M = M' @ [(l, d)] @ M''
[PROOF STEP]
have "uniq (elements (M' @ M''))"
[PROOF STATE]
proof (prove)
using this:
uniq (elements M)
M = M' @ [(l, d)] @ M''

goal (1 subgoal):
 1. uniq (elements (M' @ M''))
[PROOF STEP]
by (auto iff: uniqAppendIff)
[PROOF STATE]
proof (state)
this:
uniq (elements (M' @ M''))

goal (1 subgoal):
 1. M' @ M'' \<in> {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)}
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
uniq (elements (M' @ M''))

goal (1 subgoal):
 1. M' @ M'' \<in> {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)}
[PROOF STEP]
have "consistent (elements (M' @ M''))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. consistent (elements (M' @ M''))
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. consistent (elements (M' @ M''))
[PROOF STEP]
{
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. consistent (elements (M' @ M''))
[PROOF STEP]
assume "\<not> consistent (elements (M' @ M''))"
[PROOF STATE]
proof (state)
this:
\<not> consistent (elements (M' @ M''))

goal (1 subgoal):
 1. consistent (elements (M' @ M''))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> consistent (elements (M' @ M''))
[PROOF STEP]
obtain l' where "literalTrue l' (elements (M' @ M''))" "literalFalse l' (elements (M' @ M''))"
[PROOF STATE]
proof (prove)
using this:
\<not> consistent (elements (M' @ M''))

goal (1 subgoal):
 1. (\<And>l'. \<lbrakk>literalTrue l' (elements (M' @ M'')); literalFalse l' (elements (M' @ M''))\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp add:inconsistentCharacterization)
[PROOF STATE]
proof (state)
this:
literalTrue l' (elements (M' @ M''))
literalFalse l' (elements (M' @ M''))

goal (1 subgoal):
 1. consistent (elements (M' @ M''))
[PROOF STEP]
with \<open>M = M' @ [(l, d)] @ M''\<close>
[PROOF STATE]
proof (chain)
picking this:
M = M' @ [(l, d)] @ M''
literalTrue l' (elements (M' @ M''))
literalFalse l' (elements (M' @ M''))
[PROOF STEP]
have "literalTrue l' (elements M)" "literalFalse l' (elements M)"
[PROOF STATE]
proof (prove)
using this:
M = M' @ [(l, d)] @ M''
literalTrue l' (elements (M' @ M''))
literalFalse l' (elements (M' @ M''))

goal (1 subgoal):
 1. literalTrue l' (elements M) &&& literalFalse l' (elements M)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
literalTrue l' (elements M)
literalFalse l' (elements M)

goal (1 subgoal):
 1. consistent (elements (M' @ M''))
[PROOF STEP]
hence "\<not> consistent (elements M)"
[PROOF STATE]
proof (prove)
using this:
literalTrue l' (elements M)
literalFalse l' (elements M)

goal (1 subgoal):
 1. \<not> consistent (elements M)
[PROOF STEP]
by (auto simp add: inconsistentCharacterization)
[PROOF STATE]
proof (state)
this:
\<not> consistent (elements M)

goal (1 subgoal):
 1. consistent (elements (M' @ M''))
[PROOF STEP]
with \<open>consistent (elements M)\<close>
[PROOF STATE]
proof (chain)
picking this:
consistent (elements M)
\<not> consistent (elements M)
[PROOF STEP]
have False
[PROOF STATE]
proof (prove)
using this:
consistent (elements M)
\<not> consistent (elements M)

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

goal (1 subgoal):
 1. consistent (elements (M' @ M''))
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
\<not> consistent (elements (M' @ M'')) \<Longrightarrow> False

goal (1 subgoal):
 1. consistent (elements (M' @ M''))
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<not> consistent (elements (M' @ M'')) \<Longrightarrow> False

goal (1 subgoal):
 1. consistent (elements (M' @ M''))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
consistent (elements (M' @ M''))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
consistent (elements (M' @ M''))

goal (1 subgoal):
 1. M' @ M'' \<in> {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)}
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
consistent (elements (M' @ M''))

goal (1 subgoal):
 1. M' @ M'' \<in> {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)}
[PROOF STEP]
have "v \<notin> vars (elements (M' @ M''))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. v \<notin> vars (elements (M' @ M''))
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. v \<notin> vars (elements (M' @ M''))
[PROOF STEP]
{
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. v \<notin> vars (elements (M' @ M''))
[PROOF STEP]
assume "v \<in> vars (elements (M' @ M''))"
[PROOF STATE]
proof (state)
this:
v \<in> vars (elements (M' @ M''))

goal (1 subgoal):
 1. v \<notin> vars (elements (M' @ M''))
[PROOF STEP]
with *
[PROOF STATE]
proof (chain)
picking this:
vars (elements (M' @ M'')) = vars (elements M') \<union> vars (elements M'')
v \<in> vars (elements (M' @ M''))
[PROOF STEP]
have "v \<in> vars (elements M') \<or> v \<in> vars (elements M'')"
[PROOF STATE]
proof (prove)
using this:
vars (elements (M' @ M'')) = vars (elements M') \<union> vars (elements M'')
v \<in> vars (elements (M' @ M''))

goal (1 subgoal):
 1. v \<in> vars (elements M') \<or> v \<in> vars (elements M'')
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
v \<in> vars (elements M') \<or> v \<in> vars (elements M'')

goal (1 subgoal):
 1. v \<notin> vars (elements (M' @ M''))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
v \<in> vars (elements M') \<or> v \<in> vars (elements M'')

goal (1 subgoal):
 1. v \<notin> vars (elements (M' @ M''))
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
v \<in> vars (elements M') \<or> v \<in> vars (elements M'')

goal (1 subgoal):
 1. v \<notin> vars (elements (M' @ M''))
[PROOF STEP]
assume "v \<in> (vars (elements M'))"
[PROOF STATE]
proof (state)
this:
v \<in> vars (elements M')

goal (1 subgoal):
 1. v \<notin> vars (elements (M' @ M''))
[PROOF STEP]
hence "\<exists> l. var l = v \<and> l el elements M'"
[PROOF STATE]
proof (prove)
using this:
v \<in> vars (elements M')

goal (1 subgoal):
 1. \<exists>l. var l = v \<and> l el elements M'
[PROOF STEP]
by (induct M') auto
[PROOF STATE]
proof (state)
this:
\<exists>l. var l = v \<and> l el elements M'

goal (1 subgoal):
 1. v \<notin> vars (elements (M' @ M''))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>l. var l = v \<and> l el elements M'
[PROOF STEP]
obtain l' where "var l' = v" "l' el elements M'"
[PROOF STATE]
proof (prove)
using this:
\<exists>l. var l = v \<and> l el elements M'

goal (1 subgoal):
 1. (\<And>l'. \<lbrakk>var l' = v; l' el elements M'\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
var l' = v
l' el elements M'

goal (1 subgoal):
 1. v \<notin> vars (elements (M' @ M''))
[PROOF STEP]
from \<open>var l = v\<close> \<open>var l' = v\<close>
[PROOF STATE]
proof (chain)
picking this:
var l = v
var l' = v
[PROOF STEP]
have "l = l' \<or> opposite l = l'"
[PROOF STATE]
proof (prove)
using this:
var l = v
var l' = v

goal (1 subgoal):
 1. l = l' \<or> opposite l = l'
[PROOF STEP]
using literalsWithSameVariableAreEqualOrOpposite[of "l" "l'"]
[PROOF STATE]
proof (prove)
using this:
var l = v
var l' = v
(var l = var l') = (l = l' \<or> opposite l = l')

goal (1 subgoal):
 1. l = l' \<or> opposite l = l'
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
l = l' \<or> opposite l = l'

goal (1 subgoal):
 1. v \<notin> vars (elements (M' @ M''))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
l = l' \<or> opposite l = l'

goal (1 subgoal):
 1. v \<notin> vars (elements (M' @ M''))
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
l = l' \<or> opposite l = l'

goal (1 subgoal):
 1. v \<notin> vars (elements (M' @ M''))
[PROOF STEP]
assume "l = l'"
[PROOF STATE]
proof (state)
this:
l = l'

goal (1 subgoal):
 1. v \<notin> vars (elements (M' @ M''))
[PROOF STEP]
with \<open>l' el elements M'\<close> \<open>M = M' @ [(l, d)] @ M''\<close>
[PROOF STATE]
proof (chain)
picking this:
l' el elements M'
M = M' @ [(l, d)] @ M''
l = l'
[PROOF STEP]
have "\<not> uniq (elements M)"
[PROOF STATE]
proof (prove)
using this:
l' el elements M'
M = M' @ [(l, d)] @ M''
l = l'

goal (1 subgoal):
 1. \<not> uniq (elements M)
[PROOF STEP]
by (auto iff: uniqAppendIff)
[PROOF STATE]
proof (state)
this:
\<not> uniq (elements M)

goal (1 subgoal):
 1. v \<notin> vars (elements (M' @ M''))
[PROOF STEP]
with \<open>uniq (elements M)\<close>
[PROOF STATE]
proof (chain)
picking this:
uniq (elements M)
\<not> uniq (elements M)
[PROOF STEP]
have False
[PROOF STATE]
proof (prove)
using this:
uniq (elements M)
\<not> uniq (elements M)

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

goal (1 subgoal):
 1. v \<notin> vars (elements (M' @ M''))
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
l = l' \<Longrightarrow> False

goal (1 subgoal):
 1. v \<notin> vars (elements (M' @ M''))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
l = l' \<Longrightarrow> False

goal (1 subgoal):
 1. v \<notin> vars (elements (M' @ M''))
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
l = l' \<Longrightarrow> False

goal (1 subgoal):
 1. v \<notin> vars (elements (M' @ M''))
[PROOF STEP]
assume "opposite l = l'"
[PROOF STATE]
proof (state)
this:
opposite l = l'

goal (1 subgoal):
 1. v \<notin> vars (elements (M' @ M''))
[PROOF STEP]
have "\<not> consistent (elements M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> consistent (elements M)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> consistent (elements M)
[PROOF STEP]
from \<open>l' el elements M'\<close> \<open>M = M' @ [(l, d)] @ M''\<close>
[PROOF STATE]
proof (chain)
picking this:
l' el elements M'
M = M' @ [(l, d)] @ M''
[PROOF STEP]
have "literalTrue l' (elements M)"
[PROOF STATE]
proof (prove)
using this:
l' el elements M'
M = M' @ [(l, d)] @ M''

goal (1 subgoal):
 1. literalTrue l' (elements M)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
literalTrue l' (elements M)

goal (1 subgoal):
 1. \<not> consistent (elements M)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
literalTrue l' (elements M)

goal (1 subgoal):
 1. \<not> consistent (elements M)
[PROOF STEP]
from \<open>l' el elements M'\<close> \<open>opposite l = l'\<close> \<open>M = M' @ [(l, d)] @ M''\<close>
[PROOF STATE]
proof (chain)
picking this:
l' el elements M'
opposite l = l'
M = M' @ [(l, d)] @ M''
[PROOF STEP]
have "literalFalse l' (elements M)"
[PROOF STATE]
proof (prove)
using this:
l' el elements M'
opposite l = l'
M = M' @ [(l, d)] @ M''

goal (1 subgoal):
 1. literalFalse l' (elements M)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
literalFalse l' (elements M)

goal (1 subgoal):
 1. \<not> consistent (elements M)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
literalTrue l' (elements M)
literalFalse l' (elements M)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
literalTrue l' (elements M)
literalFalse l' (elements M)

goal (1 subgoal):
 1. \<not> consistent (elements M)
[PROOF STEP]
by (auto simp add: inconsistentCharacterization)
[PROOF STATE]
proof (state)
this:
\<not> consistent (elements M)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<not> consistent (elements M)

goal (1 subgoal):
 1. v \<notin> vars (elements (M' @ M''))
[PROOF STEP]
with \<open>consistent (elements M)\<close>
[PROOF STATE]
proof (chain)
picking this:
consistent (elements M)
\<not> consistent (elements M)
[PROOF STEP]
have False
[PROOF STATE]
proof (prove)
using this:
consistent (elements M)
\<not> consistent (elements M)

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

goal (1 subgoal):
 1. v \<notin> vars (elements (M' @ M''))
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
opposite l = l' \<Longrightarrow> False

goal (1 subgoal):
 1. v \<notin> vars (elements (M' @ M''))
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
l = l' \<or> opposite l = l'
l = l' \<Longrightarrow> False
opposite l = l' \<Longrightarrow> False
[PROOF STEP]
have False
[PROOF STATE]
proof (prove)
using this:
l = l' \<or> opposite l = l'
l = l' \<Longrightarrow> False
opposite l = l' \<Longrightarrow> False

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

goal (1 subgoal):
 1. v \<notin> vars (elements (M' @ M''))
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
v \<in> vars (elements M') \<Longrightarrow> False

goal (1 subgoal):
 1. v \<notin> vars (elements (M' @ M''))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
v \<in> vars (elements M') \<Longrightarrow> False

goal (1 subgoal):
 1. v \<notin> vars (elements (M' @ M''))
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
v \<in> vars (elements M') \<Longrightarrow> False

goal (1 subgoal):
 1. v \<notin> vars (elements (M' @ M''))
[PROOF STEP]
assume "v \<in> (vars (elements M''))"
[PROOF STATE]
proof (state)
this:
v \<in> vars (elements M'')

goal (1 subgoal):
 1. v \<notin> vars (elements (M' @ M''))
[PROOF STEP]
hence "\<exists> l. var l = v \<and> l el elements M''"
[PROOF STATE]
proof (prove)
using this:
v \<in> vars (elements M'')

goal (1 subgoal):
 1. \<exists>l. var l = v \<and> l el elements M''
[PROOF STEP]
by (induct M'') auto
[PROOF STATE]
proof (state)
this:
\<exists>l. var l = v \<and> l el elements M''

goal (1 subgoal):
 1. v \<notin> vars (elements (M' @ M''))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>l. var l = v \<and> l el elements M''
[PROOF STEP]
obtain l' where "var l' = v" "l' el (elements M'')"
[PROOF STATE]
proof (prove)
using this:
\<exists>l. var l = v \<and> l el elements M''

goal (1 subgoal):
 1. (\<And>l'. \<lbrakk>var l' = v; l' el elements M''\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
var l' = v
l' el elements M''

goal (1 subgoal):
 1. v \<notin> vars (elements (M' @ M''))
[PROOF STEP]
from \<open>var l = v\<close> \<open>var l' = v\<close>
[PROOF STATE]
proof (chain)
picking this:
var l = v
var l' = v
[PROOF STEP]
have "l = l' \<or> opposite l = l'"
[PROOF STATE]
proof (prove)
using this:
var l = v
var l' = v

goal (1 subgoal):
 1. l = l' \<or> opposite l = l'
[PROOF STEP]
using literalsWithSameVariableAreEqualOrOpposite[of "l" "l'"]
[PROOF STATE]
proof (prove)
using this:
var l = v
var l' = v
(var l = var l') = (l = l' \<or> opposite l = l')

goal (1 subgoal):
 1. l = l' \<or> opposite l = l'
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
l = l' \<or> opposite l = l'

goal (1 subgoal):
 1. v \<notin> vars (elements (M' @ M''))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
l = l' \<or> opposite l = l'

goal (1 subgoal):
 1. v \<notin> vars (elements (M' @ M''))
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
l = l' \<or> opposite l = l'

goal (1 subgoal):
 1. v \<notin> vars (elements (M' @ M''))
[PROOF STEP]
assume "l = l'"
[PROOF STATE]
proof (state)
this:
l = l'

goal (1 subgoal):
 1. v \<notin> vars (elements (M' @ M''))
[PROOF STEP]
with \<open>l' el elements M''\<close> \<open>M = M' @ [(l, d)] @ M''\<close>
[PROOF STATE]
proof (chain)
picking this:
l' el elements M''
M = M' @ [(l, d)] @ M''
l = l'
[PROOF STEP]
have "\<not> uniq (elements M)"
[PROOF STATE]
proof (prove)
using this:
l' el elements M''
M = M' @ [(l, d)] @ M''
l = l'

goal (1 subgoal):
 1. \<not> uniq (elements M)
[PROOF STEP]
by (auto iff: uniqAppendIff)
[PROOF STATE]
proof (state)
this:
\<not> uniq (elements M)

goal (1 subgoal):
 1. v \<notin> vars (elements (M' @ M''))
[PROOF STEP]
with \<open>uniq (elements M)\<close>
[PROOF STATE]
proof (chain)
picking this:
uniq (elements M)
\<not> uniq (elements M)
[PROOF STEP]
have False
[PROOF STATE]
proof (prove)
using this:
uniq (elements M)
\<not> uniq (elements M)

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

goal (1 subgoal):
 1. v \<notin> vars (elements (M' @ M''))
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
l = l' \<Longrightarrow> False

goal (1 subgoal):
 1. v \<notin> vars (elements (M' @ M''))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
l = l' \<Longrightarrow> False

goal (1 subgoal):
 1. v \<notin> vars (elements (M' @ M''))
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
l = l' \<Longrightarrow> False

goal (1 subgoal):
 1. v \<notin> vars (elements (M' @ M''))
[PROOF STEP]
assume "opposite l = l'"
[PROOF STATE]
proof (state)
this:
opposite l = l'

goal (1 subgoal):
 1. v \<notin> vars (elements (M' @ M''))
[PROOF STEP]
have "\<not> consistent (elements M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> consistent (elements M)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> consistent (elements M)
[PROOF STEP]
from \<open>l' el elements M''\<close> \<open>M = M' @ [(l, d)] @ M''\<close>
[PROOF STATE]
proof (chain)
picking this:
l' el elements M''
M = M' @ [(l, d)] @ M''
[PROOF STEP]
have "literalTrue l' (elements M)"
[PROOF STATE]
proof (prove)
using this:
l' el elements M''
M = M' @ [(l, d)] @ M''

goal (1 subgoal):
 1. literalTrue l' (elements M)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
literalTrue l' (elements M)

goal (1 subgoal):
 1. \<not> consistent (elements M)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
literalTrue l' (elements M)

goal (1 subgoal):
 1. \<not> consistent (elements M)
[PROOF STEP]
from \<open>l' el elements M''\<close> \<open>opposite l = l'\<close> \<open>M = M' @ [(l, d)] @ M''\<close>
[PROOF STATE]
proof (chain)
picking this:
l' el elements M''
opposite l = l'
M = M' @ [(l, d)] @ M''
[PROOF STEP]
have "literalFalse l' (elements M)"
[PROOF STATE]
proof (prove)
using this:
l' el elements M''
opposite l = l'
M = M' @ [(l, d)] @ M''

goal (1 subgoal):
 1. literalFalse l' (elements M)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
literalFalse l' (elements M)

goal (1 subgoal):
 1. \<not> consistent (elements M)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
literalTrue l' (elements M)
literalFalse l' (elements M)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
literalTrue l' (elements M)
literalFalse l' (elements M)

goal (1 subgoal):
 1. \<not> consistent (elements M)
[PROOF STEP]
by (auto simp add: inconsistentCharacterization)
[PROOF STATE]
proof (state)
this:
\<not> consistent (elements M)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<not> consistent (elements M)

goal (1 subgoal):
 1. v \<notin> vars (elements (M' @ M''))
[PROOF STEP]
with \<open>consistent (elements M)\<close>
[PROOF STATE]
proof (chain)
picking this:
consistent (elements M)
\<not> consistent (elements M)
[PROOF STEP]
have False
[PROOF STATE]
proof (prove)
using this:
consistent (elements M)
\<not> consistent (elements M)

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

goal (1 subgoal):
 1. v \<notin> vars (elements (M' @ M''))
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
opposite l = l' \<Longrightarrow> False

goal (1 subgoal):
 1. v \<notin> vars (elements (M' @ M''))
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
l = l' \<or> opposite l = l'
l = l' \<Longrightarrow> False
opposite l = l' \<Longrightarrow> False
[PROOF STEP]
have False
[PROOF STATE]
proof (prove)
using this:
l = l' \<or> opposite l = l'
l = l' \<Longrightarrow> False
opposite l = l' \<Longrightarrow> False

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

goal (1 subgoal):
 1. v \<notin> vars (elements (M' @ M''))
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
v \<in> vars (elements M'') \<Longrightarrow> False

goal (1 subgoal):
 1. v \<notin> vars (elements (M' @ M''))
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
v \<in> vars (elements M') \<or> v \<in> vars (elements M'')
v \<in> vars (elements M') \<Longrightarrow> False
v \<in> vars (elements M'') \<Longrightarrow> False
[PROOF STEP]
have False
[PROOF STATE]
proof (prove)
using this:
v \<in> vars (elements M') \<or> v \<in> vars (elements M'')
v \<in> vars (elements M') \<Longrightarrow> False
v \<in> vars (elements M'') \<Longrightarrow> False

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

goal (1 subgoal):
 1. v \<notin> vars (elements (M' @ M''))
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
v \<in> vars (elements (M' @ M'')) \<Longrightarrow> False

goal (1 subgoal):
 1. v \<notin> vars (elements (M' @ M''))
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
v \<in> vars (elements (M' @ M'')) \<Longrightarrow> False

goal (1 subgoal):
 1. v \<notin> vars (elements (M' @ M''))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
v \<notin> vars (elements (M' @ M''))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
v \<notin> vars (elements (M' @ M''))

goal (1 subgoal):
 1. M' @ M'' \<in> {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)}
[PROOF STEP]
from
            * ** ***
            \<open>v \<notin> vars (elements (M' @ M''))\<close>
            \<open>vars (elements M) = insert v V'\<close>
            \<open>\<not> v \<in> V'\<close>
[PROOF STATE]
proof (chain)
picking this:
vars (elements (M' @ M'')) = vars (elements M') \<union> vars (elements M'')
vars (elements M) = vars (elements M') \<union> {v} \<union> vars (elements M'')
vars (elements M) = vars (elements (M' @ M'')) \<union> {v}
v \<notin> vars (elements (M' @ M''))
vars (elements M) = insert v V'
v \<notin> V'
[PROOF STEP]
have "vars (elements (M' @ M'')) = V'"
[PROOF STATE]
proof (prove)
using this:
vars (elements (M' @ M'')) = vars (elements M') \<union> vars (elements M'')
vars (elements M) = vars (elements M') \<union> {v} \<union> vars (elements M'')
vars (elements M) = vars (elements (M' @ M'')) \<union> {v}
v \<notin> vars (elements (M' @ M''))
vars (elements M) = insert v V'
v \<notin> V'

goal (1 subgoal):
 1. vars (elements (M' @ M'')) = V'
[PROOF STEP]
by (auto simp del: vars_clause_def)
[PROOF STATE]
proof (state)
this:
vars (elements (M' @ M'')) = V'

goal (1 subgoal):
 1. M' @ M'' \<in> {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)}
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
uniq (elements (M' @ M''))
consistent (elements (M' @ M''))
vars (elements (M' @ M'')) = V'
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
uniq (elements (M' @ M''))
consistent (elements (M' @ M''))
vars (elements (M' @ M'')) = V'

goal (1 subgoal):
 1. M' @ M'' \<in> {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
M' @ M'' \<in> {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
M' @ M'' \<in> {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)}

goal (1 subgoal):
 1. \<And>x. x \<in> {M. vars (elements M) = insert v V' \<and> uniq (elements M) \<and> consistent (elements M)} \<Longrightarrow> x \<in> {M' @ [(l, d)] @ M'' |M' l d M''. M' @ M'' \<in> {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)} \<and> l \<in> {Pos v, Neg v} \<and> d \<in> {True, False}}
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
M = M' @ [(l, d)] @ M''
l \<in> {Pos v, Neg v}
M' @ M'' \<in> {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)}
[PROOF STEP]
show "M \<in> ?rhs"
[PROOF STATE]
proof (prove)
using this:
M = M' @ [(l, d)] @ M''
l \<in> {Pos v, Neg v}
M' @ M'' \<in> {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)}

goal (1 subgoal):
 1. M \<in> {M' @ [(l, d)] @ M'' |M' l d M''. M' @ M'' \<in> {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)} \<and> l \<in> {Pos v, Neg v} \<and> d \<in> {True, False}}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
M \<in> {M' @ [(l, d)] @ M'' |M' l d M''. M' @ M'' \<in> {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)} \<and> l \<in> {Pos v, Neg v} \<and> d \<in> {True, False}}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
{M. vars (elements M) = insert v V' \<and> uniq (elements M) \<and> consistent (elements M)} \<subseteq> {M' @ [(l, d)] @ M'' |M' l d M''. M' @ M'' \<in> {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)} \<and> l \<in> {Pos v, Neg v} \<and> d \<in> {True, False}}

goal (1 subgoal):
 1. {M' @ [(l, d)] @ M'' |M' l d M''. M' @ M'' \<in> {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)} \<and> l \<in> {Pos v, Neg v} \<and> d \<in> {True, False}} \<subseteq> {M. vars (elements M) = insert v V' \<and> uniq (elements M) \<and> consistent (elements M)}
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. {M' @ [(l, d)] @ M'' |M' l d M''. M' @ M'' \<in> {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)} \<and> l \<in> {Pos v, Neg v} \<and> d \<in> {True, False}} \<subseteq> {M. vars (elements M) = insert v V' \<and> uniq (elements M) \<and> consistent (elements M)}
[PROOF STEP]
show "?rhs \<subseteq> ?lhs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {M' @ [(l, d)] @ M'' |M' l d M''. M' @ M'' \<in> {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)} \<and> l \<in> {Pos v, Neg v} \<and> d \<in> {True, False}} \<subseteq> {M. vars (elements M) = insert v V' \<and> uniq (elements M) \<and> consistent (elements M)}
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> {M' @ [(l, d)] @ M'' |M' l d M''. M' @ M'' \<in> {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)} \<and> l \<in> {Pos v, Neg v} \<and> d \<in> {True, False}} \<Longrightarrow> x \<in> {M. vars (elements M) = insert v V' \<and> uniq (elements M) \<and> consistent (elements M)}
[PROOF STEP]
fix M :: LiteralTrail
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> {M' @ [(l, d)] @ M'' |M' l d M''. M' @ M'' \<in> {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)} \<and> l \<in> {Pos v, Neg v} \<and> d \<in> {True, False}} \<Longrightarrow> x \<in> {M. vars (elements M) = insert v V' \<and> uniq (elements M) \<and> consistent (elements M)}
[PROOF STEP]
assume "M \<in> ?rhs"
[PROOF STATE]
proof (state)
this:
M \<in> {M' @ [(l, d)] @ M'' |M' l d M''. M' @ M'' \<in> {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)} \<and> l \<in> {Pos v, Neg v} \<and> d \<in> {True, False}}

goal (1 subgoal):
 1. \<And>x. x \<in> {M' @ [(l, d)] @ M'' |M' l d M''. M' @ M'' \<in> {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)} \<and> l \<in> {Pos v, Neg v} \<and> d \<in> {True, False}} \<Longrightarrow> x \<in> {M. vars (elements M) = insert v V' \<and> uniq (elements M) \<and> consistent (elements M)}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
M \<in> {M' @ [(l, d)] @ M'' |M' l d M''. M' @ M'' \<in> {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)} \<and> l \<in> {Pos v, Neg v} \<and> d \<in> {True, False}}
[PROOF STEP]
obtain M' M'' l d where
          "M = M' @ [(l, d)] @ M''"
          "vars (elements (M' @ M'')) = V'"
          "uniq (elements (M' @ M''))" "consistent (elements (M' @ M''))" "l \<in> {Pos v, Neg v}"
[PROOF STATE]
proof (prove)
using this:
M \<in> {M' @ [(l, d)] @ M'' |M' l d M''. M' @ M'' \<in> {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)} \<and> l \<in> {Pos v, Neg v} \<and> d \<in> {True, False}}

goal (1 subgoal):
 1. (\<And>M' l d M''. \<lbrakk>M = M' @ [(l, d)] @ M''; vars (elements (M' @ M'')) = V'; uniq (elements (M' @ M'')); consistent (elements (M' @ M'')); l \<in> {Pos v, Neg v}\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
M = M' @ [(l, d)] @ M''
vars (elements (M' @ M'')) = V'
uniq (elements (M' @ M''))
consistent (elements (M' @ M''))
l \<in> {Pos v, Neg v}

goal (1 subgoal):
 1. \<And>x. x \<in> {M' @ [(l, d)] @ M'' |M' l d M''. M' @ M'' \<in> {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)} \<and> l \<in> {Pos v, Neg v} \<and> d \<in> {True, False}} \<Longrightarrow> x \<in> {M. vars (elements M) = insert v V' \<and> uniq (elements M) \<and> consistent (elements M)}
[PROOF STEP]
from \<open>l \<in> {Pos v, Neg v}\<close>
[PROOF STATE]
proof (chain)
picking this:
l \<in> {Pos v, Neg v}
[PROOF STEP]
have "var l = v"
[PROOF STATE]
proof (prove)
using this:
l \<in> {Pos v, Neg v}

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

goal (1 subgoal):
 1. \<And>x. x \<in> {M' @ [(l, d)] @ M'' |M' l d M''. M' @ M'' \<in> {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)} \<and> l \<in> {Pos v, Neg v} \<and> d \<in> {True, False}} \<Longrightarrow> x \<in> {M. vars (elements M) = insert v V' \<and> uniq (elements M) \<and> consistent (elements M)}
[PROOF STEP]
have *: "vars (elements (M' @ M'')) = vars (elements M') \<union> vars (elements M'')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vars (elements (M' @ M'')) = vars (elements M') \<union> vars (elements M'')
[PROOF STEP]
using varsAppendClauses[of "elements M'" "elements M''"]
[PROOF STATE]
proof (prove)
using this:
vars (elements M' @ elements M'') = vars (elements M') \<union> vars (elements M'')

goal (1 subgoal):
 1. vars (elements (M' @ M'')) = vars (elements M') \<union> vars (elements M'')
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
vars (elements (M' @ M'')) = vars (elements M') \<union> vars (elements M'')

goal (1 subgoal):
 1. \<And>x. x \<in> {M' @ [(l, d)] @ M'' |M' l d M''. M' @ M'' \<in> {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)} \<and> l \<in> {Pos v, Neg v} \<and> d \<in> {True, False}} \<Longrightarrow> x \<in> {M. vars (elements M) = insert v V' \<and> uniq (elements M) \<and> consistent (elements M)}
[PROOF STEP]
from \<open>var l = v\<close> \<open>M = M' @ [(l, d)] @ M''\<close>
[PROOF STATE]
proof (chain)
picking this:
var l = v
M = M' @ [(l, d)] @ M''
[PROOF STEP]
have **: "vars (elements M) = vars (elements M') \<union> {v} \<union> vars (elements M'')"
[PROOF STATE]
proof (prove)
using this:
var l = v
M = M' @ [(l, d)] @ M''

goal (1 subgoal):
 1. vars (elements M) = vars (elements M') \<union> {v} \<union> vars (elements M'')
[PROOF STEP]
using varsAppendClauses[of "elements M'" "elements ([(l, d)] @ M'')"]
[PROOF STATE]
proof (prove)
using this:
var l = v
M = M' @ [(l, d)] @ M''
vars (elements M' @ elements ([(l, d)] @ M'')) = vars (elements M') \<union> vars (elements ([(l, d)] @ M''))

goal (1 subgoal):
 1. vars (elements M) = vars (elements M') \<union> {v} \<union> vars (elements M'')
[PROOF STEP]
using varsAppendClauses[of "elements [(l, d)]" "elements M''"]
[PROOF STATE]
proof (prove)
using this:
var l = v
M = M' @ [(l, d)] @ M''
vars (elements M' @ elements ([(l, d)] @ M'')) = vars (elements M') \<union> vars (elements ([(l, d)] @ M''))
vars (elements [(l, d)] @ elements M'') = vars (elements [(l, d)]) \<union> vars (elements M'')

goal (1 subgoal):
 1. vars (elements M) = vars (elements M') \<union> {v} \<union> vars (elements M'')
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
vars (elements M) = vars (elements M') \<union> {v} \<union> vars (elements M'')

goal (1 subgoal):
 1. \<And>x. x \<in> {M' @ [(l, d)] @ M'' |M' l d M''. M' @ M'' \<in> {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)} \<and> l \<in> {Pos v, Neg v} \<and> d \<in> {True, False}} \<Longrightarrow> x \<in> {M. vars (elements M) = insert v V' \<and> uniq (elements M) \<and> consistent (elements M)}
[PROOF STEP]
from * ** \<open>vars (elements (M' @ M'')) = V'\<close>
[PROOF STATE]
proof (chain)
picking this:
vars (elements (M' @ M'')) = vars (elements M') \<union> vars (elements M'')
vars (elements M) = vars (elements M') \<union> {v} \<union> vars (elements M'')
vars (elements (M' @ M'')) = V'
[PROOF STEP]
have "vars (elements M) = insert v V'"
[PROOF STATE]
proof (prove)
using this:
vars (elements (M' @ M'')) = vars (elements M') \<union> vars (elements M'')
vars (elements M) = vars (elements M') \<union> {v} \<union> vars (elements M'')
vars (elements (M' @ M'')) = V'

goal (1 subgoal):
 1. vars (elements M) = insert v V'
[PROOF STEP]
by (auto simp del: vars_clause_def)
[PROOF STATE]
proof (state)
this:
vars (elements M) = insert v V'

goal (1 subgoal):
 1. \<And>x. x \<in> {M' @ [(l, d)] @ M'' |M' l d M''. M' @ M'' \<in> {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)} \<and> l \<in> {Pos v, Neg v} \<and> d \<in> {True, False}} \<Longrightarrow> x \<in> {M. vars (elements M) = insert v V' \<and> uniq (elements M) \<and> consistent (elements M)}
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
vars (elements M) = insert v V'

goal (1 subgoal):
 1. \<And>x. x \<in> {M' @ [(l, d)] @ M'' |M' l d M''. M' @ M'' \<in> {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)} \<and> l \<in> {Pos v, Neg v} \<and> d \<in> {True, False}} \<Longrightarrow> x \<in> {M. vars (elements M) = insert v V' \<and> uniq (elements M) \<and> consistent (elements M)}
[PROOF STEP]
from *
          \<open>var l = v\<close>
          \<open>v \<notin> V'\<close>
          \<open>vars (elements (M' @ M'')) = V'\<close>
[PROOF STATE]
proof (chain)
picking this:
vars (elements (M' @ M'')) = vars (elements M') \<union> vars (elements M'')
var l = v
v \<notin> V'
vars (elements (M' @ M'')) = V'
[PROOF STEP]
have "var l \<notin> vars (elements M')" "var l \<notin> vars (elements M'')"
[PROOF STATE]
proof (prove)
using this:
vars (elements (M' @ M'')) = vars (elements M') \<union> vars (elements M'')
var l = v
v \<notin> V'
vars (elements (M' @ M'')) = V'

goal (1 subgoal):
 1. var l \<notin> vars (elements M') &&& var l \<notin> vars (elements M'')
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
var l \<notin> vars (elements M')
var l \<notin> vars (elements M'')

goal (1 subgoal):
 1. \<And>x. x \<in> {M' @ [(l, d)] @ M'' |M' l d M''. M' @ M'' \<in> {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)} \<and> l \<in> {Pos v, Neg v} \<and> d \<in> {True, False}} \<Longrightarrow> x \<in> {M. vars (elements M) = insert v V' \<and> uniq (elements M) \<and> consistent (elements M)}
[PROOF STEP]
from \<open>var l \<notin> vars (elements M')\<close>
[PROOF STATE]
proof (chain)
picking this:
var l \<notin> vars (elements M')
[PROOF STEP]
have "\<not> literalTrue l (elements M')" "\<not> literalFalse l (elements M')"
[PROOF STATE]
proof (prove)
using this:
var l \<notin> vars (elements M')

goal (1 subgoal):
 1. \<not> literalTrue l (elements M') &&& \<not> literalFalse l (elements M')
[PROOF STEP]
using valuationContainsItsLiteralsVariable[of "l" "elements M'"]
[PROOF STATE]
proof (prove)
using this:
var l \<notin> vars (elements M')
l el elements M' \<Longrightarrow> var l \<in> vars (elements M')

goal (1 subgoal):
 1. \<not> literalTrue l (elements M') &&& \<not> literalFalse l (elements M')
[PROOF STEP]
using valuationContainsItsLiteralsVariable[of "opposite l" "elements M'"]
[PROOF STATE]
proof (prove)
using this:
var l \<notin> vars (elements M')
l el elements M' \<Longrightarrow> var l \<in> vars (elements M')
opposite l el elements M' \<Longrightarrow> var (opposite l) \<in> vars (elements M')

goal (1 subgoal):
 1. \<not> literalTrue l (elements M') &&& \<not> literalFalse l (elements M')
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<not> literalTrue l (elements M')
\<not> literalFalse l (elements M')

goal (1 subgoal):
 1. \<And>x. x \<in> {M' @ [(l, d)] @ M'' |M' l d M''. M' @ M'' \<in> {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)} \<and> l \<in> {Pos v, Neg v} \<and> d \<in> {True, False}} \<Longrightarrow> x \<in> {M. vars (elements M) = insert v V' \<and> uniq (elements M) \<and> consistent (elements M)}
[PROOF STEP]
from \<open>var l \<notin> vars (elements M'')\<close>
[PROOF STATE]
proof (chain)
picking this:
var l \<notin> vars (elements M'')
[PROOF STEP]
have "\<not> literalTrue l (elements M'')" "\<not> literalFalse l (elements M'')"
[PROOF STATE]
proof (prove)
using this:
var l \<notin> vars (elements M'')

goal (1 subgoal):
 1. \<not> literalTrue l (elements M'') &&& \<not> literalFalse l (elements M'')
[PROOF STEP]
using valuationContainsItsLiteralsVariable[of "l" "elements M''"]
[PROOF STATE]
proof (prove)
using this:
var l \<notin> vars (elements M'')
l el elements M'' \<Longrightarrow> var l \<in> vars (elements M'')

goal (1 subgoal):
 1. \<not> literalTrue l (elements M'') &&& \<not> literalFalse l (elements M'')
[PROOF STEP]
using valuationContainsItsLiteralsVariable[of "opposite l" "elements M''"]
[PROOF STATE]
proof (prove)
using this:
var l \<notin> vars (elements M'')
l el elements M'' \<Longrightarrow> var l \<in> vars (elements M'')
opposite l el elements M'' \<Longrightarrow> var (opposite l) \<in> vars (elements M'')

goal (1 subgoal):
 1. \<not> literalTrue l (elements M'') &&& \<not> literalFalse l (elements M'')
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<not> literalTrue l (elements M'')
\<not> literalFalse l (elements M'')

goal (1 subgoal):
 1. \<And>x. x \<in> {M' @ [(l, d)] @ M'' |M' l d M''. M' @ M'' \<in> {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)} \<and> l \<in> {Pos v, Neg v} \<and> d \<in> {True, False}} \<Longrightarrow> x \<in> {M. vars (elements M) = insert v V' \<and> uniq (elements M) \<and> consistent (elements M)}
[PROOF STEP]
have "uniq (elements M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. uniq (elements M)
[PROOF STEP]
using \<open>M = M' @ [(l, d)] @ M''\<close> \<open>uniq (elements (M' @ M''))\<close>
            \<open>\<not> literalTrue l (elements M'')\<close> \<open>\<not> literalFalse l (elements M'')\<close>
            \<open>\<not> literalTrue l (elements M')\<close> \<open>\<not> literalFalse l (elements M')\<close>
[PROOF STATE]
proof (prove)
using this:
M = M' @ [(l, d)] @ M''
uniq (elements (M' @ M''))
\<not> literalTrue l (elements M'')
\<not> literalFalse l (elements M'')
\<not> literalTrue l (elements M')
\<not> literalFalse l (elements M')

goal (1 subgoal):
 1. uniq (elements M)
[PROOF STEP]
by (auto iff: uniqAppendIff)
[PROOF STATE]
proof (state)
this:
uniq (elements M)

goal (1 subgoal):
 1. \<And>x. x \<in> {M' @ [(l, d)] @ M'' |M' l d M''. M' @ M'' \<in> {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)} \<and> l \<in> {Pos v, Neg v} \<and> d \<in> {True, False}} \<Longrightarrow> x \<in> {M. vars (elements M) = insert v V' \<and> uniq (elements M) \<and> consistent (elements M)}
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
uniq (elements M)

goal (1 subgoal):
 1. \<And>x. x \<in> {M' @ [(l, d)] @ M'' |M' l d M''. M' @ M'' \<in> {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)} \<and> l \<in> {Pos v, Neg v} \<and> d \<in> {True, False}} \<Longrightarrow> x \<in> {M. vars (elements M) = insert v V' \<and> uniq (elements M) \<and> consistent (elements M)}
[PROOF STEP]
have "consistent (elements M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. consistent (elements M)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. consistent (elements M)
[PROOF STEP]
{
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. consistent (elements M)
[PROOF STEP]
assume "\<not> consistent (elements M)"
[PROOF STATE]
proof (state)
this:
\<not> consistent (elements M)

goal (1 subgoal):
 1. consistent (elements M)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> consistent (elements M)
[PROOF STEP]
obtain l' where "literalTrue l' (elements M)" "literalFalse l' (elements M)"
[PROOF STATE]
proof (prove)
using this:
\<not> consistent (elements M)

goal (1 subgoal):
 1. (\<And>l'. \<lbrakk>literalTrue l' (elements M); literalFalse l' (elements M)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp add: inconsistentCharacterization)
[PROOF STATE]
proof (state)
this:
literalTrue l' (elements M)
literalFalse l' (elements M)

goal (1 subgoal):
 1. consistent (elements M)
[PROOF STEP]
have False
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. False
[PROOF STEP]
proof (cases "l' = l")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. l' = l \<Longrightarrow> False
 2. l' \<noteq> l \<Longrightarrow> False
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
l' = l

goal (2 subgoals):
 1. l' = l \<Longrightarrow> False
 2. l' \<noteq> l \<Longrightarrow> False
[PROOF STEP]
with \<open>literalFalse l' (elements M)\<close> \<open>M = M' @ [(l, d)] @ M''\<close>
[PROOF STATE]
proof (chain)
picking this:
literalFalse l' (elements M)
M = M' @ [(l, d)] @ M''
l' = l
[PROOF STEP]
have "literalFalse l' (elements (M' @ M''))"
[PROOF STATE]
proof (prove)
using this:
literalFalse l' (elements M)
M = M' @ [(l, d)] @ M''
l' = l

goal (1 subgoal):
 1. literalFalse l' (elements (M' @ M''))
[PROOF STEP]
using oppositeIsDifferentFromLiteral[of "l"]
[PROOF STATE]
proof (prove)
using this:
literalFalse l' (elements M)
M = M' @ [(l, d)] @ M''
l' = l
opposite l \<noteq> l

goal (1 subgoal):
 1. literalFalse l' (elements (M' @ M''))
[PROOF STEP]
by (auto split: if_split_asm)
[PROOF STATE]
proof (state)
this:
literalFalse l' (elements (M' @ M''))

goal (2 subgoals):
 1. l' = l \<Longrightarrow> False
 2. l' \<noteq> l \<Longrightarrow> False
[PROOF STEP]
with \<open>\<not> literalFalse l (elements M')\<close> \<open>\<not> literalFalse l (elements M'')\<close> \<open>l' = l\<close>
[PROOF STATE]
proof (chain)
picking this:
\<not> literalFalse l (elements M')
\<not> literalFalse l (elements M'')
l' = l
literalFalse l' (elements (M' @ M''))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<not> literalFalse l (elements M')
\<not> literalFalse l (elements M'')
l' = l
literalFalse l' (elements (M' @ M''))

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

goal (1 subgoal):
 1. l' \<noteq> l \<Longrightarrow> False
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. l' \<noteq> l \<Longrightarrow> False
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
l' \<noteq> l

goal (1 subgoal):
 1. l' \<noteq> l \<Longrightarrow> False
[PROOF STEP]
with \<open>literalTrue l' (elements M)\<close> \<open>M = M' @ [(l, d)] @ M''\<close>
[PROOF STATE]
proof (chain)
picking this:
literalTrue l' (elements M)
M = M' @ [(l, d)] @ M''
l' \<noteq> l
[PROOF STEP]
have "literalTrue l' (elements (M' @ M''))"
[PROOF STATE]
proof (prove)
using this:
literalTrue l' (elements M)
M = M' @ [(l, d)] @ M''
l' \<noteq> l

goal (1 subgoal):
 1. literalTrue l' (elements (M' @ M''))
[PROOF STEP]
by (auto split: if_split_asm)
[PROOF STATE]
proof (state)
this:
literalTrue l' (elements (M' @ M''))

goal (1 subgoal):
 1. l' \<noteq> l \<Longrightarrow> False
[PROOF STEP]
with \<open>consistent (elements (M' @ M''))\<close>
[PROOF STATE]
proof (chain)
picking this:
consistent (elements (M' @ M''))
literalTrue l' (elements (M' @ M''))
[PROOF STEP]
have "\<not> literalFalse l' (elements (M' @ M''))"
[PROOF STATE]
proof (prove)
using this:
consistent (elements (M' @ M''))
literalTrue l' (elements (M' @ M''))

goal (1 subgoal):
 1. \<not> literalFalse l' (elements (M' @ M''))
[PROOF STEP]
by (auto simp add: inconsistentCharacterization)
[PROOF STATE]
proof (state)
this:
\<not> literalFalse l' (elements (M' @ M''))

goal (1 subgoal):
 1. l' \<noteq> l \<Longrightarrow> False
[PROOF STEP]
with \<open>literalFalse l' (elements M)\<close> \<open>M = M' @ [(l, d)] @ M''\<close>
[PROOF STATE]
proof (chain)
picking this:
literalFalse l' (elements M)
M = M' @ [(l, d)] @ M''
\<not> literalFalse l' (elements (M' @ M''))
[PROOF STEP]
have "opposite l' = l"
[PROOF STATE]
proof (prove)
using this:
literalFalse l' (elements M)
M = M' @ [(l, d)] @ M''
\<not> literalFalse l' (elements (M' @ M''))

goal (1 subgoal):
 1. opposite l' = l
[PROOF STEP]
by (auto split: if_split_asm)
[PROOF STATE]
proof (state)
this:
opposite l' = l

goal (1 subgoal):
 1. l' \<noteq> l \<Longrightarrow> False
[PROOF STEP]
with \<open>var l = v\<close>
[PROOF STATE]
proof (chain)
picking this:
var l = v
opposite l' = l
[PROOF STEP]
have "var l' = v"
[PROOF STATE]
proof (prove)
using this:
var l = v
opposite l' = l

goal (1 subgoal):
 1. var l' = v
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
var l' = v

goal (1 subgoal):
 1. l' \<noteq> l \<Longrightarrow> False
[PROOF STEP]
with \<open>literalTrue l' (elements (M' @ M''))\<close> \<open>vars (elements (M' @ M'')) = V'\<close>
[PROOF STATE]
proof (chain)
picking this:
literalTrue l' (elements (M' @ M''))
vars (elements (M' @ M'')) = V'
var l' = v
[PROOF STEP]
have "v \<in> V'"
[PROOF STATE]
proof (prove)
using this:
literalTrue l' (elements (M' @ M''))
vars (elements (M' @ M'')) = V'
var l' = v

goal (1 subgoal):
 1. v \<in> V'
[PROOF STEP]
using valuationContainsItsLiteralsVariable[of "l'" "elements (M' @ M'')"]
[PROOF STATE]
proof (prove)
using this:
literalTrue l' (elements (M' @ M''))
vars (elements (M' @ M'')) = V'
var l' = v
l' el elements (M' @ M'') \<Longrightarrow> var l' \<in> vars (elements (M' @ M''))

goal (1 subgoal):
 1. v \<in> V'
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
v \<in> V'

goal (1 subgoal):
 1. l' \<noteq> l \<Longrightarrow> False
[PROOF STEP]
with \<open>v \<notin> V'\<close>
[PROOF STATE]
proof (chain)
picking this:
v \<notin> V'
v \<in> V'
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
v \<notin> V'
v \<in> V'

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

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

goal (1 subgoal):
 1. consistent (elements M)
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
\<not> consistent (elements M) \<Longrightarrow> False

goal (1 subgoal):
 1. consistent (elements M)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<not> consistent (elements M) \<Longrightarrow> False

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

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

goal (1 subgoal):
 1. \<And>x. x \<in> {M' @ [(l, d)] @ M'' |M' l d M''. M' @ M'' \<in> {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)} \<and> l \<in> {Pos v, Neg v} \<and> d \<in> {True, False}} \<Longrightarrow> x \<in> {M. vars (elements M) = insert v V' \<and> uniq (elements M) \<and> consistent (elements M)}
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
vars (elements M) = insert v V'
uniq (elements M)
consistent (elements M)
[PROOF STEP]
show "M \<in> ?lhs"
[PROOF STATE]
proof (prove)
using this:
vars (elements M) = insert v V'
uniq (elements M)
consistent (elements M)

goal (1 subgoal):
 1. M \<in> {M. vars (elements M) = insert v V' \<and> uniq (elements M) \<and> consistent (elements M)}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
M \<in> {M. vars (elements M) = insert v V' \<and> uniq (elements M) \<and> consistent (elements M)}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
{M' @ [(l, d)] @ M'' |M' l d M''. M' @ M'' \<in> {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)} \<and> l \<in> {Pos v, Neg v} \<and> d \<in> {True, False}} \<subseteq> {M. vars (elements M) = insert v V' \<and> uniq (elements M) \<and> consistent (elements M)}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
{M. vars (elements M) = insert v V' \<and> uniq (elements M) \<and> consistent (elements M)} = {M' @ [(l, d)] @ M'' |M' l d M''. M' @ M'' \<in> {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)} \<and> l \<in> {Pos v, Neg v} \<and> d \<in> {True, False}}

goal (1 subgoal):
 1. \<lbrakk>finite V'; v \<notin> V'; finite {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)}\<rbrakk> \<Longrightarrow> finite {M. vars (elements M) = insert v V' \<and> uniq (elements M) \<and> consistent (elements M)}
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
{M. vars (elements M) = insert v V' \<and> uniq (elements M) \<and> consistent (elements M)} = {M' @ [(l, d)] @ M'' |M' l d M''. M' @ M'' \<in> {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)} \<and> l \<in> {Pos v, Neg v} \<and> d \<in> {True, False}}

goal (1 subgoal):
 1. \<lbrakk>finite V'; v \<notin> V'; finite {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)}\<rbrakk> \<Longrightarrow> finite {M. vars (elements M) = insert v V' \<and> uniq (elements M) \<and> consistent (elements M)}
[PROOF STEP]
let ?f = "\<lambda> ((M', M''), l, d). M' @ [(l, d)] @ M''"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>finite V'; v \<notin> V'; finite {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)}\<rbrakk> \<Longrightarrow> finite {M. vars (elements M) = insert v V' \<and> uniq (elements M) \<and> consistent (elements M)}
[PROOF STEP]
let ?Mset = "{(M', M''). M' @ M'' \<in> ?trails V'}"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>finite V'; v \<notin> V'; finite {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)}\<rbrakk> \<Longrightarrow> finite {M. vars (elements M) = insert v V' \<and> uniq (elements M) \<and> consistent (elements M)}
[PROOF STEP]
let ?lSet = "{Pos v, Neg v}"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>finite V'; v \<notin> V'; finite {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)}\<rbrakk> \<Longrightarrow> finite {M. vars (elements M) = insert v V' \<and> uniq (elements M) \<and> consistent (elements M)}
[PROOF STEP]
let ?dSet = "{True, False}"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>finite V'; v \<notin> V'; finite {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)}\<rbrakk> \<Longrightarrow> finite {M. vars (elements M) = insert v V' \<and> uniq (elements M) \<and> consistent (elements M)}
[PROOF STEP]
have "?trails' V' = ?f ` (?Mset \<times> ?lSet \<times> ?dSet)" (is "?lhs = ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {M' @ [(l, d)] @ M'' |M' l d M''. M' @ M'' \<in> {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)} \<and> l \<in> {Pos v, Neg v} \<and> d \<in> {True, False}} = (\<lambda>((M', M''), l, d). M' @ [(l, d)] @ M'') ` ({(M', M''). M' @ M'' \<in> {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)}} \<times> {Pos v, Neg v} \<times> {True, False})
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. {M' @ [(l, d)] @ M'' |M' l d M''. M' @ M'' \<in> {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)} \<and> l \<in> {Pos v, Neg v} \<and> d \<in> {True, False}} \<subseteq> (\<lambda>((M', M''), l, d). M' @ [(l, d)] @ M'') ` ({(M', M''). M' @ M'' \<in> {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)}} \<times> {Pos v, Neg v} \<times> {True, False})
 2. (\<lambda>((M', M''), l, d). M' @ [(l, d)] @ M'') ` ({(M', M''). M' @ M'' \<in> {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)}} \<times> {Pos v, Neg v} \<times> {True, False}) \<subseteq> {M' @ [(l, d)] @ M'' |M' l d M''. M' @ M'' \<in> {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)} \<and> l \<in> {Pos v, Neg v} \<and> d \<in> {True, False}}
[PROOF STEP]
show "?lhs \<subseteq> ?rhs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {M' @ [(l, d)] @ M'' |M' l d M''. M' @ M'' \<in> {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)} \<and> l \<in> {Pos v, Neg v} \<and> d \<in> {True, False}} \<subseteq> (\<lambda>((M', M''), l, d). M' @ [(l, d)] @ M'') ` ({(M', M''). M' @ M'' \<in> {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)}} \<times> {Pos v, Neg v} \<times> {True, False})
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> {M' @ [(l, d)] @ M'' |M' l d M''. M' @ M'' \<in> {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)} \<and> l \<in> {Pos v, Neg v} \<and> d \<in> {True, False}} \<Longrightarrow> x \<in> (\<lambda>((M', M''), l, d). M' @ [(l, d)] @ M'') ` ({(M', M''). M' @ M'' \<in> {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)}} \<times> {Pos v, Neg v} \<times> {True, False})
[PROOF STEP]
fix M :: LiteralTrail
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> {M' @ [(l, d)] @ M'' |M' l d M''. M' @ M'' \<in> {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)} \<and> l \<in> {Pos v, Neg v} \<and> d \<in> {True, False}} \<Longrightarrow> x \<in> (\<lambda>((M', M''), l, d). M' @ [(l, d)] @ M'') ` ({(M', M''). M' @ M'' \<in> {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)}} \<times> {Pos v, Neg v} \<times> {True, False})
[PROOF STEP]
assume "M \<in> ?lhs"
[PROOF STATE]
proof (state)
this:
M \<in> {M' @ [(l, d)] @ M'' |M' l d M''. M' @ M'' \<in> {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)} \<and> l \<in> {Pos v, Neg v} \<and> d \<in> {True, False}}

goal (1 subgoal):
 1. \<And>x. x \<in> {M' @ [(l, d)] @ M'' |M' l d M''. M' @ M'' \<in> {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)} \<and> l \<in> {Pos v, Neg v} \<and> d \<in> {True, False}} \<Longrightarrow> x \<in> (\<lambda>((M', M''), l, d). M' @ [(l, d)] @ M'') ` ({(M', M''). M' @ M'' \<in> {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)}} \<times> {Pos v, Neg v} \<times> {True, False})
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
M \<in> {M' @ [(l, d)] @ M'' |M' l d M''. M' @ M'' \<in> {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)} \<and> l \<in> {Pos v, Neg v} \<and> d \<in> {True, False}}
[PROOF STEP]
obtain M' M'' l d
          where P: "M = M' @ [(l, d)] @ M''" "M' @ M'' \<in> (?trails V')" "l \<in> {Pos v, Neg v}" "d \<in> {True, False}"
[PROOF STATE]
proof (prove)
using this:
M \<in> {M' @ [(l, d)] @ M'' |M' l d M''. M' @ M'' \<in> {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)} \<and> l \<in> {Pos v, Neg v} \<and> d \<in> {True, False}}

goal (1 subgoal):
 1. (\<And>M' l d M''. \<lbrakk>M = M' @ [(l, d)] @ M''; M' @ M'' \<in> {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)}; l \<in> {Pos v, Neg v}; d \<in> {True, False}\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
M = M' @ [(l, d)] @ M''
M' @ M'' \<in> {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)}
l \<in> {Pos v, Neg v}
d \<in> {True, False}

goal (1 subgoal):
 1. \<And>x. x \<in> {M' @ [(l, d)] @ M'' |M' l d M''. M' @ M'' \<in> {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)} \<and> l \<in> {Pos v, Neg v} \<and> d \<in> {True, False}} \<Longrightarrow> x \<in> (\<lambda>((M', M''), l, d). M' @ [(l, d)] @ M'') ` ({(M', M''). M' @ M'' \<in> {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)}} \<times> {Pos v, Neg v} \<times> {True, False})
[PROOF STEP]
show "M \<in> ?rhs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. M \<in> (\<lambda>((M', M''), l, d). M' @ [(l, d)] @ M'') ` ({(M', M''). M' @ M'' \<in> {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)}} \<times> {Pos v, Neg v} \<times> {True, False})
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. M = (case ?x of (x, xa) \<Rightarrow> (case x of (M', M'') \<Rightarrow> \<lambda>(l, d). M' @ [(l, d)] @ M'') xa)
 2. ?x \<in> {(M', M''). M' @ M'' \<in> {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)}} \<times> {Pos v, Neg v} \<times> {True, False}
[PROOF STEP]
from P
[PROOF STATE]
proof (chain)
picking this:
M = M' @ [(l, d)] @ M''
M' @ M'' \<in> {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)}
l \<in> {Pos v, Neg v}
d \<in> {True, False}
[PROOF STEP]
show "M = ?f ((M', M''), l, d)"
[PROOF STATE]
proof (prove)
using this:
M = M' @ [(l, d)] @ M''
M' @ M'' \<in> {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)}
l \<in> {Pos v, Neg v}
d \<in> {True, False}

goal (1 subgoal):
 1. M = (case ((M', M''), l, d) of (x, xa) \<Rightarrow> (case x of (M', M'') \<Rightarrow> \<lambda>(l, d). M' @ [(l, d)] @ M'') xa)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
M = (case ((M', M''), l, d) of (x, xa) \<Rightarrow> (case x of (M', M'') \<Rightarrow> \<lambda>(l, d). M' @ [(l, d)] @ M'') xa)

goal (1 subgoal):
 1. ((M', M''), l, d) \<in> {(M', M''). M' @ M'' \<in> {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)}} \<times> {Pos v, Neg v} \<times> {True, False}
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ((M', M''), l, d) \<in> {(M', M''). M' @ M'' \<in> {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)}} \<times> {Pos v, Neg v} \<times> {True, False}
[PROOF STEP]
from P
[PROOF STATE]
proof (chain)
picking this:
M = M' @ [(l, d)] @ M''
M' @ M'' \<in> {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)}
l \<in> {Pos v, Neg v}
d \<in> {True, False}
[PROOF STEP]
show "((M', M''), l, d) \<in> ?Mset \<times> ?lSet \<times> ?dSet"
[PROOF STATE]
proof (prove)
using this:
M = M' @ [(l, d)] @ M''
M' @ M'' \<in> {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)}
l \<in> {Pos v, Neg v}
d \<in> {True, False}

goal (1 subgoal):
 1. ((M', M''), l, d) \<in> {(M', M''). M' @ M'' \<in> {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)}} \<times> {Pos v, Neg v} \<times> {True, False}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
((M', M''), l, d) \<in> {(M', M''). M' @ M'' \<in> {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)}} \<times> {Pos v, Neg v} \<times> {True, False}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
M \<in> (\<lambda>((M', M''), l, d). M' @ [(l, d)] @ M'') ` ({(M', M''). M' @ M'' \<in> {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)}} \<times> {Pos v, Neg v} \<times> {True, False})

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
{M' @ [(l, d)] @ M'' |M' l d M''. M' @ M'' \<in> {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)} \<and> l \<in> {Pos v, Neg v} \<and> d \<in> {True, False}} \<subseteq> (\<lambda>((M', M''), l, d). M' @ [(l, d)] @ M'') ` ({(M', M''). M' @ M'' \<in> {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)}} \<times> {Pos v, Neg v} \<times> {True, False})

goal (1 subgoal):
 1. (\<lambda>((M', M''), l, d). M' @ [(l, d)] @ M'') ` ({(M', M''). M' @ M'' \<in> {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)}} \<times> {Pos v, Neg v} \<times> {True, False}) \<subseteq> {M' @ [(l, d)] @ M'' |M' l d M''. M' @ M'' \<in> {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)} \<and> l \<in> {Pos v, Neg v} \<and> d \<in> {True, False}}
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<lambda>((M', M''), l, d). M' @ [(l, d)] @ M'') ` ({(M', M''). M' @ M'' \<in> {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)}} \<times> {Pos v, Neg v} \<times> {True, False}) \<subseteq> {M' @ [(l, d)] @ M'' |M' l d M''. M' @ M'' \<in> {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)} \<and> l \<in> {Pos v, Neg v} \<and> d \<in> {True, False}}
[PROOF STEP]
show "?rhs \<subseteq> ?lhs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>((M', M''), l, d). M' @ [(l, d)] @ M'') ` ({(M', M''). M' @ M'' \<in> {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)}} \<times> {Pos v, Neg v} \<times> {True, False}) \<subseteq> {M' @ [(l, d)] @ M'' |M' l d M''. M' @ M'' \<in> {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)} \<and> l \<in> {Pos v, Neg v} \<and> d \<in> {True, False}}
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> (\<lambda>((M', M''), l, d). M' @ [(l, d)] @ M'') ` ({(M', M''). M' @ M'' \<in> {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)}} \<times> {Pos v, Neg v} \<times> {True, False}) \<Longrightarrow> x \<in> {M' @ [(l, d)] @ M'' |M' l d M''. M' @ M'' \<in> {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)} \<and> l \<in> {Pos v, Neg v} \<and> d \<in> {True, False}}
[PROOF STEP]
fix M::LiteralTrail
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> (\<lambda>((M', M''), l, d). M' @ [(l, d)] @ M'') ` ({(M', M''). M' @ M'' \<in> {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)}} \<times> {Pos v, Neg v} \<times> {True, False}) \<Longrightarrow> x \<in> {M' @ [(l, d)] @ M'' |M' l d M''. M' @ M'' \<in> {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)} \<and> l \<in> {Pos v, Neg v} \<and> d \<in> {True, False}}
[PROOF STEP]
assume "M \<in> ?rhs"
[PROOF STATE]
proof (state)
this:
M \<in> (\<lambda>((M', M''), l, d). M' @ [(l, d)] @ M'') ` ({(M', M''). M' @ M'' \<in> {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)}} \<times> {Pos v, Neg v} \<times> {True, False})

goal (1 subgoal):
 1. \<And>x. x \<in> (\<lambda>((M', M''), l, d). M' @ [(l, d)] @ M'') ` ({(M', M''). M' @ M'' \<in> {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)}} \<times> {Pos v, Neg v} \<times> {True, False}) \<Longrightarrow> x \<in> {M' @ [(l, d)] @ M'' |M' l d M''. M' @ M'' \<in> {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)} \<and> l \<in> {Pos v, Neg v} \<and> d \<in> {True, False}}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
M \<in> (\<lambda>((M', M''), l, d). M' @ [(l, d)] @ M'') ` ({(M', M''). M' @ M'' \<in> {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)}} \<times> {Pos v, Neg v} \<times> {True, False})
[PROOF STEP]
obtain p l d where P: "M = ?f (p, l, d)" "p \<in> ?Mset" "l \<in> ?lSet" "d \<in> ?dSet"
[PROOF STATE]
proof (prove)
using this:
M \<in> (\<lambda>((M', M''), l, d). M' @ [(l, d)] @ M'') ` ({(M', M''). M' @ M'' \<in> {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)}} \<times> {Pos v, Neg v} \<times> {True, False})

goal (1 subgoal):
 1. (\<And>p l d. \<lbrakk>M = (case (p, l, d) of (x, xa) \<Rightarrow> (case x of (M', M'') \<Rightarrow> \<lambda>(l, d). M' @ [(l, d)] @ M'') xa); p \<in> {(M', M''). M' @ M'' \<in> {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)}}; l \<in> {Pos v, Neg v}; d \<in> {True, False}\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
M = (case (p, l, d) of (x, xa) \<Rightarrow> (case x of (M', M'') \<Rightarrow> \<lambda>(l, d). M' @ [(l, d)] @ M'') xa)
p \<in> {(M', M''). M' @ M'' \<in> {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)}}
l \<in> {Pos v, Neg v}
d \<in> {True, False}

goal (1 subgoal):
 1. \<And>x. x \<in> (\<lambda>((M', M''), l, d). M' @ [(l, d)] @ M'') ` ({(M', M''). M' @ M'' \<in> {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)}} \<times> {Pos v, Neg v} \<times> {True, False}) \<Longrightarrow> x \<in> {M' @ [(l, d)] @ M'' |M' l d M''. M' @ M'' \<in> {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)} \<and> l \<in> {Pos v, Neg v} \<and> d \<in> {True, False}}
[PROOF STEP]
from \<open>p \<in> ?Mset\<close>
[PROOF STATE]
proof (chain)
picking this:
p \<in> {(M', M''). M' @ M'' \<in> {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)}}
[PROOF STEP]
obtain M' M'' where "M' @ M'' \<in> ?trails V'"
[PROOF STATE]
proof (prove)
using this:
p \<in> {(M', M''). M' @ M'' \<in> {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)}}

goal (1 subgoal):
 1. (\<And>M' M''. M' @ M'' \<in> {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)} \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
M' @ M'' \<in> {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)}

goal (1 subgoal):
 1. \<And>x. x \<in> (\<lambda>((M', M''), l, d). M' @ [(l, d)] @ M'') ` ({(M', M''). M' @ M'' \<in> {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)}} \<times> {Pos v, Neg v} \<times> {True, False}) \<Longrightarrow> x \<in> {M' @ [(l, d)] @ M'' |M' l d M''. M' @ M'' \<in> {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)} \<and> l \<in> {Pos v, Neg v} \<and> d \<in> {True, False}}
[PROOF STEP]
thus "M \<in> ?lhs"
[PROOF STATE]
proof (prove)
using this:
M' @ M'' \<in> {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)}

goal (1 subgoal):
 1. M \<in> {M' @ [(l, d)] @ M'' |M' l d M''. M' @ M'' \<in> {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)} \<and> l \<in> {Pos v, Neg v} \<and> d \<in> {True, False}}
[PROOF STEP]
using P
[PROOF STATE]
proof (prove)
using this:
M' @ M'' \<in> {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)}
M = (case (p, l, d) of (x, xa) \<Rightarrow> (case x of (M', M'') \<Rightarrow> \<lambda>(l, d). M' @ [(l, d)] @ M'') xa)
p \<in> {(M', M''). M' @ M'' \<in> {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)}}
l \<in> {Pos v, Neg v}
d \<in> {True, False}

goal (1 subgoal):
 1. M \<in> {M' @ [(l, d)] @ M'' |M' l d M''. M' @ M'' \<in> {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)} \<and> l \<in> {Pos v, Neg v} \<and> d \<in> {True, False}}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
M \<in> {M' @ [(l, d)] @ M'' |M' l d M''. M' @ M'' \<in> {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)} \<and> l \<in> {Pos v, Neg v} \<and> d \<in> {True, False}}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<lambda>((M', M''), l, d). M' @ [(l, d)] @ M'') ` ({(M', M''). M' @ M'' \<in> {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)}} \<times> {Pos v, Neg v} \<times> {True, False}) \<subseteq> {M' @ [(l, d)] @ M'' |M' l d M''. M' @ M'' \<in> {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)} \<and> l \<in> {Pos v, Neg v} \<and> d \<in> {True, False}}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
{M' @ [(l, d)] @ M'' |M' l d M''. M' @ M'' \<in> {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)} \<and> l \<in> {Pos v, Neg v} \<and> d \<in> {True, False}} = (\<lambda>((M', M''), l, d). M' @ [(l, d)] @ M'') ` ({(M', M''). M' @ M'' \<in> {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)}} \<times> {Pos v, Neg v} \<times> {True, False})

goal (1 subgoal):
 1. \<lbrakk>finite V'; v \<notin> V'; finite {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)}\<rbrakk> \<Longrightarrow> finite {M. vars (elements M) = insert v V' \<and> uniq (elements M) \<and> consistent (elements M)}
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
{M' @ [(l, d)] @ M'' |M' l d M''. M' @ M'' \<in> {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)} \<and> l \<in> {Pos v, Neg v} \<and> d \<in> {True, False}} = (\<lambda>((M', M''), l, d). M' @ [(l, d)] @ M'') ` ({(M', M''). M' @ M'' \<in> {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)}} \<times> {Pos v, Neg v} \<times> {True, False})

goal (1 subgoal):
 1. \<lbrakk>finite V'; v \<notin> V'; finite {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)}\<rbrakk> \<Longrightarrow> finite {M. vars (elements M) = insert v V' \<and> uniq (elements M) \<and> consistent (elements M)}
[PROOF STEP]
have "?Mset = {(M', M''). \<exists> l. l \<in> ?trails V' \<and> l = M' @ M''}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {(M', M''). M' @ M'' \<in> {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)}} = {(M', M''). \<exists>l. l \<in> {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)} \<and> l = M' @ M''}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{(M', M''). M' @ M'' \<in> {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)}} = {(M', M''). \<exists>l. l \<in> {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)} \<and> l = M' @ M''}

goal (1 subgoal):
 1. \<lbrakk>finite V'; v \<notin> V'; finite {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)}\<rbrakk> \<Longrightarrow> finite {M. vars (elements M) = insert v V' \<and> uniq (elements M) \<and> consistent (elements M)}
[PROOF STEP]
hence "finite ?Mset"
[PROOF STATE]
proof (prove)
using this:
{(M', M''). M' @ M'' \<in> {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)}} = {(M', M''). \<exists>l. l \<in> {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)} \<and> l = M' @ M''}

goal (1 subgoal):
 1. finite {(M', M''). M' @ M'' \<in> {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)}}
[PROOF STEP]
using insert(3)
[PROOF STATE]
proof (prove)
using this:
{(M', M''). M' @ M'' \<in> {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)}} = {(M', M''). \<exists>l. l \<in> {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)} \<and> l = M' @ M''}
finite {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)}

goal (1 subgoal):
 1. finite {(M', M''). M' @ M'' \<in> {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)}}
[PROOF STEP]
using finiteListDecomposeSet[of "?trails V'"]
[PROOF STATE]
proof (prove)
using this:
{(M', M''). M' @ M'' \<in> {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)}} = {(M', M''). \<exists>l. l \<in> {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)} \<and> l = M' @ M''}
finite {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)}
finite {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)} \<Longrightarrow> finite {(a, b). \<exists>l. l \<in> {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)} \<and> l = a @ b}

goal (1 subgoal):
 1. finite {(M', M''). M' @ M'' \<in> {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)}}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
finite {(M', M''). M' @ M'' \<in> {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)}}

goal (1 subgoal):
 1. \<lbrakk>finite V'; v \<notin> V'; finite {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)}\<rbrakk> \<Longrightarrow> finite {M. vars (elements M) = insert v V' \<and> uniq (elements M) \<and> consistent (elements M)}
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
{M. vars (elements M) = insert v V' \<and> uniq (elements M) \<and> consistent (elements M)} = {M' @ [(l, d)] @ M'' |M' l d M''. M' @ M'' \<in> {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)} \<and> l \<in> {Pos v, Neg v} \<and> d \<in> {True, False}}
{M' @ [(l, d)] @ M'' |M' l d M''. M' @ M'' \<in> {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)} \<and> l \<in> {Pos v, Neg v} \<and> d \<in> {True, False}} = (\<lambda>((M', M''), l, d). M' @ [(l, d)] @ M'') ` ({(M', M''). M' @ M'' \<in> {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)}} \<times> {Pos v, Neg v} \<times> {True, False})
finite {(M', M''). M' @ M'' \<in> {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)}}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
{M. vars (elements M) = insert v V' \<and> uniq (elements M) \<and> consistent (elements M)} = {M' @ [(l, d)] @ M'' |M' l d M''. M' @ M'' \<in> {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)} \<and> l \<in> {Pos v, Neg v} \<and> d \<in> {True, False}}
{M' @ [(l, d)] @ M'' |M' l d M''. M' @ M'' \<in> {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)} \<and> l \<in> {Pos v, Neg v} \<and> d \<in> {True, False}} = (\<lambda>((M', M''), l, d). M' @ [(l, d)] @ M'') ` ({(M', M''). M' @ M'' \<in> {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)}} \<times> {Pos v, Neg v} \<times> {True, False})
finite {(M', M''). M' @ M'' \<in> {M. vars (elements M) = V' \<and> uniq (elements M) \<and> consistent (elements M)}}

goal (1 subgoal):
 1. finite {M. vars (elements M) = insert v V' \<and> uniq (elements M) \<and> consistent (elements M)}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
finite {M. vars (elements M) = insert v V' \<and> uniq (elements M) \<and> consistent (elements M)}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
finite {M. vars (elements M) = insert v V' \<and> uniq (elements M) \<and> consistent (elements M)}

goal:
No subgoals!
[PROOF STEP]
qed