Definition ss_ok (ss : SS.t) (interp: positive -> COLTpoint) :=
  forall s, SS.mem s ss = true ->
  forall p1 p2 p3, S.mem p1 s && S.mem p2 s && S.mem p3 s = true ->
    CTCol (interp p1) (interp p2) (interp p3).Definition sp_ok (sp : SP.t) (interp: positive -> COLTpoint) :=
  forall p, SP.mem p sp = true -> interp (fstpp p) <> interp (sndpp p).

(* Specifications: *)
Lemma identify_lines_ok : forall ss sp interp, ss_ok ss interp -> sp_ok sp interp -> ss_ok (identify_lines ss sp) interp.
Lemma test_col_ok : forall ss sp interp p1 p2 p3, ss_ok ss interp -> sp_ok sp interp -> test_col ss sp p1 p2 p3 = true -> CTCol (interp p1) (interp p2) (interp p3).
Lemma ss_ok_empty : forall interp, ss_ok SS.empty interp.
Lemma sp_ok_empty : forall interp, sp_ok SP.empty interp.
Lemma collect_cols : forall (A B C : COLTpoint) (HCol : CTCol A B C) pa pb pc ss (interp : positive -> COLTpoint), interp pa = A -> interp pb = B -> interp pc = C -> ss_ok ss interp -> ss_ok (SS.add (S.add pa (S.add pb (S.add pc S.empty))) ss) interp.
Lemma collect_diffs : forall (A B : COLTpoint) (H : A <> B) pa pb sp (interp : positive -> COLTpoint), interp pa = A -> interp pb = B -> sp_ok sp interp -> sp_ok (SP.add (pa, pb) sp) interp.