Section php_upto.
(* If R is a partial equivalence relation, l is a list contained in the list m (upto R), and m is shorter than l, then l contains a duplicate upto R *)

Theorem php_upto X (R : X -> X -> Prop) (l m : list X) :
symmetric _ R -> transitive _ R                  (* PER *)
-> (forall x, In x l -> exists y, In y m /\ R x y)  (* l contained in m *)
-> length m < length l                              (* shorter *)
-> exists a x b y c, l = a++x::b++y::c /\ R x y.    (* duplicate *)
End php_upto.