(* --------------------------------------------------- *)
Definition decide_Path : forall a, lc_tm a -> (exists T, Path T a) \/ (forall T, not (Path T a)).
(* --------------------------------------------------- *)
(* Proof that joinability implies consistency. *)
Ltac step_left := apply consistent_a_Step_R; [auto |intro N; inversion N; inversion H0]; fail.
Ltac step_right := apply consistent_a_Step_L; [auto | intro N; inversion N; inversion H0]; fail.
(* look for a multipar involvong a head form and apply the appropriate lemma for that head form. Note: for paths, the lemma has already been applied so we only need to look for a hypothesis about path consistency. *)
Ltac multipar_step SIDE EQ :=
match goal with
| [ SIDE : multipar _ _ a_Star _ |- _ ] =>
apply multipar_Star in SIDE; auto; rename SIDE into EQ
| [ SIDE : multipar _ _ (a_Pi _ _ _) _ |- _ ] =>
destruct (multipar_Pi SIDE eq_refl) as [b1' [b2' EQ]]
| [ SIDE : multipar _ _ (a_CPi ?phi _) _ |- _ ] =>
try (destruct phi); destruct (multipar_CPi SIDE eq_refl)
as (B1' & B2' & C1' & C2' &  EQ)
| [ SIDE : multipar _ _ (a_Const ?T) _ |- _ ] =>
apply multipar_Const in SIDE; auto; rename SIDE into EQ
| [ SIDE : Path_consistent _ _ _ |- _ ] =>
rename SIDE into EQ
end.

(*  a  -> b -->* c      d - by confluence |     |      |      e - by induction v     v      v a2 -> d -->* e *)
Lemma multipar_confluence_helper : forall S D a a1, Good S D -> erased_tm a -> multipar S D a a1
-> forall a2, Par S D a a2 -> exists e, Par S D a1 e /\ multipar S D a2 e.