Definition added (c: clause) {s s'': clauseset} (step: trans s s'') :=
(c \notin s) && (c \in s'').

(* Specifications: *)
Lemma added_add (c: clause) (s s'': clauseset) (step: trans s s'') :
added c step -> c \in add s.
(* removable clauses are not added *)
Lemma rem_not_added (c: clause) (s s'': clauseset) (step: trans s s'') :
c \in rem s -> ~~added c step.
Lemma removed_not_added (c: clause) (s s'': clauseset) (step: trans s s'') :
removed c step -> ~~added c step.
Lemma removed_notin
(c: clause) (s s': clauseset) (trace: deriv s s') :
c \notin s -> c \in rem s -> c \notin s'.
Lemma redundD2 (c: clause) (s: clauseset) : redund s c -> redund (s :\ c) c.
Lemma added_not_rem (c: clause) (s s'': clauseset) (step: trans s s'') :
added c step -> c \notin rem s''.
(* main lemma 2 as we proved it on paper: if a clause is added to set s, then later removed to produce set s', s != s'.  unfortunately, this lemma is not strong enough to prove our main theorem. redund_sub below proves the required (stronger) property. *)
Lemma added_removed_neq
(c: clause) (s1 s2 s3 s4: clauseset)
(step1: trans s1 s2) (trace: deriv s2 s3) (step2: trans s3 s4) :
added c step1 -> removed c step2 -> s1 != s4.
Lemma redundD3 (c c2: clause) (s: clauseset) :
redund (s :\ c2) c -> redund s c.
(*main lemma 2' (redund_sub): if c \in s, c is not redundant in s and s -->* s', then either: (1) c \in s', or (2) c \notin s' and there exists a clauseset t such that t is a subset of s' but not a subset of the first set s  as a corollary, we have that when c is added in some step s --> s'' and s'' -->* s', then s != s'.  proof sketch: since c is added in s --> s'', c is not redundant in s''. also, we know that c \notin s and c \in s'' (since c was just added).  by lemma 2', either c \in s' (in which case s != s' since c \notin s), or there exists a clauseset t such that t is a subset of s' but not of s''. since s'' = s \cup {c}, t is not a subset of s either, so s != s'. *)
Lemma redund_sub (c: clause) (s s': clauseset) :
c \in s -> ~redund s c -> deriv s s' ->
(c \in s') \/
(c \notin s' /\ exists t: clauseset, t \subset s' /\ ~t \subset s).
Lemma added_trans (c: clause) (s s'': clauseset) (step: trans s s'') :
added c step -> s'' = (c |: s).
Lemma trans_neq (s: clauseset) : ~trans s s.
Definition adds (c: clause) (s s': clauseset) (trace: deriv s s') :=
[&& c \notin s & c \in s'].
Lemma deriv_plus_eq_removed
(c: clause) (s1 s2: clauseset) (step1: trans s1 s2) (trace: deriv s2 s1) :
removed c step1 -> adds c trace.