(* Function trajectories. *)

Notation fpath f := (path (coerced_frel f)).Notation fcycle f := (cycle (coerced_frel f)).Notation ufcycle f := (ucycle (coerced_frel f)).

(* Specifications: *)
Lemma last_traject x n : last x (traject (f x) n) = iter n f x.
Lemma size_traject x n : size (traject x n) = n.
Lemma nth_traject i n : i < n -> forall x, nth x (traject x n) i = iter i f x.
Lemma eq_fpath f' : f =1 f' -> fpath f =2 fpath f'.
Lemma eq_fcycle f' : f =1 f' -> fcycle f =1 fcycle f'.
Lemma fpathP x p : reflect (exists n, p = traject f (f x) n) (fpath f x p).
Lemma fpath_traject x n : fpath f x (traject f (f x) n).
Lemma prev_next : cancel (next p) (prev p).
Lemma next_prev : cancel (prev p) (next p).
Lemma cycle_next : fcycle (next p) p.
Lemma next_rot : next (rot n0 p) =1 next p.
Lemma prev_rot : prev (rot n0 p) =1 prev p.
Lemma next_rotr : next (rotr n0 p) =1 next p.
Lemma prev_rotr : prev (rotr n0 p) =1 prev p.
Lemma prev_rev p : uniq p -> prev (rev p) =1 next p.
Lemma next_rev p : uniq p -> next (rev p) =1 prev p.