Implicit Type p : seq T.Variant split x : seq T -> seq T -> seq T -> Type :=
  Split p1 p2 : split x (rcons p1 x ++ p2) p1 p2.Variant split x : seq T -> seq T -> seq T -> Type :=
  Split p1 p2 : split x (rcons p1 x ++ p2) p1 p2.Variant splitr x : seq T -> Type :=
  Splitr p1 p2 : splitr x (p1 ++ x :: p2).Variant splitr x : seq T -> Type :=
  Splitr p1 p2 : splitr x (p1 ++ x :: p2).Definition next p x := if p is y :: p' then next_at x y y p' else x.Definition prev p x := if p is y :: p' then prev_at x y y p' else x.(* ucycleb is the boolean predicate, but ucycle is defined as a Prop *)
(* so that it can be used as a coercion target. *)
Definition ucycleb p := cycle e p && uniq p.Definition ucycle p : Prop := cycle e p && uniq p.

(* Specifications: *)
Lemma ucycle_cycle p : ucycle p -> cycle e p.
Lemma ucycle_uniq p : ucycle p -> uniq p.
Lemma rot_ucycle p : ucycle (rot n0 p) = ucycle p.
Lemma rotr_ucycle p : ucycle (rotr n0 p) = ucycle p.
Lemma mem2_splice p1 p3 x y p2 : mem2 (p1 ++ p3) x y -> mem2 (p1 ++ p2 ++ p3) x y.
Lemma mem2_splice1 p1 p3 x y z : mem2 (p1 ++ p3) x y -> mem2 (p1 ++ z :: p3) x y.
Lemma splitP2r p x y : mem2 p x y -> split2r x y p.
Lemma shortenP x p : path e x p -> shorten_spec x p (last x p) (shorten x p).