(* --------------------------------------------------- *)
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.

Lemma join_consistent : forall S D a b, joins S D a b -> consistent a b.