proposition: Lemma swap_in_appR : forall E PtL PtR A B (Ml: E |- PtL := A --> B) (Mr: E |- PtR := A) (pos: Pos (buildT Mr)) (Mpos: PlaceHolder pos) (MLpos: PlaceHolder (PAppR Ml pos)) (MLapp: isApp (swap MLpos)), proj1_sig2 Mpos = proj1_sig2 MLpos -> swap Mpos = appBodyR (M := swap MLpos) MLapp.
proof: Proof. intros E PtL PtR A B Ml Mr pos Mpos MLpos MLapp M_MN. apply term_eq. rewrite appBodyR_env. do 2 rewrite swap_env_eq; try_solve. rewrite swap_term_is. rewrite appBodyR_term with (PtL := PtL) (PtR := swap_term pos (proj1_sig2 Mpos)); trivial. rewrite swap_term_is; try_solve. Qed.
imports: CoLoR(RelExtras ListExtras TermsBuilding)