Section Reachability.
Variable  A : dfa.
(** transition function for whole words *)
Fixpoint delta_star (q: A) (w: word) :=
match w with
| nil => q
| x::w' => delta_star (delta_S q x) w'
end.
(** Definition if acceptance *)
Definition accept (w:word) := F (@delta_star s w).
Instance accept_dec w : dec (accept w).
(** * Reachability - normal reachability - reachability with a specific word *)
Inductive reachable (q: A) :  A -> Prop :=
| refl: reachable q q
| step q' x: reachable (delta_S q x) q' -> reachable q q'.
Definition reachable_with q w q':= delta_star q w = q'.
Hint Constructors reachable.
Hint Resolve reachable_with_reachable.
(* Lemma reachable_delta_star q w: reachable q (delta_star q w). *)
(** * Reach (set of all reachable states) - defined using fixed-point iteration *)
(* The predicate for the fixed-point iteration *)
Definition step_reach (set: list A) (q: A) := exists q' x, q' el set /\ reachable_with q' [x] q.
Definition reach (q: A) := FCIter step_reach [q].
Global Instance reachable_dec q q': dec (reachable q q').
Global Instance reachable_with_something_dec q q': dec (exists w, reachable_with q w q').
Notation in_lang w := (accept w) (only parsing).

Lemma Sig_reach : (forall w, in_lang w) <-> forall (q: A), q el (reach s) -> F q.