simple induction 1; intros.
(* regles de reecriture *)
apply commut_systemSL; assumption.
(* contexte app droit *)
red in |- *; intros z H2; generalize H0 H1.
pattern z in |- *; apply case_bapp with a b0.
3: assumption.
(* regle B||: app *)
intros a'' b0'' H3 H4 H5 H6.
elim (H6 a'' H3); intros a_ H7; elim H7; intros H8 H9.
exists (app a_ b0''); auto.
(* regle B||: beta *)
intros a1 a1'' b0'' H3 H4 H5; rewrite H3.
intro H6; pattern a' in |- *; apply case_SLlambda with a1.
2: assumption.
intros a1' H7 H8.
elim (diag1_lambda a1 a1' H8 a1'' H4); intros a_ H9; elim H9; intros H10 H11.
exists (env a_ (cons b0'' id)); auto.
(* contexte app gauche *)
red in |- *; intros z H2; pattern z in |- *; apply case_bapp with a b0.
3: assumption.
(* regle B||: app *)
intros a'' b0'' H3 H4.
elim (H1 b0'' H4); intros b0_ H5; elim H5; intros H6 H7.
exists (app a'' b0_); auto.
(* regle B||: beta *)
intros a1 a1'' b0'' H3 H4 H5; rewrite H3.
elim (H1 b0'' H5); intros b0_ H6; elim H6; intros H7 H8.
exists (env a1'' (cons b0_ id)); auto.
(* contexte lambda *)
red in |- *; intros z H2.
pattern z in |- *; apply case_blambda with a.
2: assumption.
intros a'' H3.
elim (H1 a'' H3); intros a_ H4; elim H4; intros H5 H6.
exists (lambda a_); auto.
(* contexte env droit *)
red in |- *; intros z H2.
pattern z in |- *; apply case_benv with a s.
2: assumption.
intros a'' s'' H3 H4.
elim (H1 a'' H3); intros a_ H5; elim H5; intros H6 H7.
exists (env a_ s''); auto.
(* contexte env gauche *)
red in |- *; intros z H2.
pattern z in |- *; apply case_benv with a s.
2: assumption.
intros a'' s'' H3 H4.
elim (H1 s'' H4); intros s_ H5; elim H5; intros H6 H7.
exists (env a'' s_); auto.
(* contexte cons droit *)
red in |- *; intros z H2.
pattern z in |- *; apply case_bcons with a s.
2: assumption.
intros a'' s'' H3 H4.
elim (H1 a'' H3); intros a_ H5; elim H5; intros H6 H7.
exists (cons a_ s''); auto.
(* contexte cons gauche *)
red in |- *; intros z H2.
pattern z in |- *; apply case_bcons with a s.
2: assumption.
intros a'' s'' H3 H4.
elim (H1 s'' H4); intros s_ H5; elim H5; intros H6 H7.
exists (cons a'' s_); auto.
(* contexte comp droit *)
red in |- *; intros z H2.
pattern z in |- *; apply case_bcomp with s t.
2: assumption.
intros s'' t'' H3 H4.
elim (H1 s'' H3); intros s_ H5; elim H5; intros H6 H7.
exists (comp s_ t''); auto.
(* contexte comp gauche *)
red in |- *; intros z H2.
pattern z in |- *; apply case_bcomp with s t.
2: assumption.
intros s'' t'' H3 H4.
elim (H1 t'' H4); intros t_ H5; elim H5; intros H6 H7.
exists (comp s'' t_); auto.
(* contexte lift *)
red in |- *; intros z H2.
pattern z in |- *; apply case_blift with s.
2: assumption.
intros s'' H3.
elim (H1 s'' H3); intros s_ H4; elim H4; intros H5 H6.
exists (lift s_); auto.
Qed.
(***************************************************)
(*    SL verifie le diagramme ci-dessus            *)
(***************************************************)

Theorem commutation :
forall (b : wsort) (x y z : TS b),
e_relSL _ x y ->
e_beta_par _ x z ->
exists u : TS b, e_relSLstar _ z u /\ e_slstar_bp_slstar _ y u.