6 Section subst1_gen_lift. (************************************************)
8 Theorem subst1_gen_lift_lt : (u,t1,x:?; i,h,d:?) (subst1 i (lift h d u) (lift h (S (plus i d)) t1) x) ->
9 (EX t2 | x = (lift h (S (plus i d)) t2) & (subst1 i u t1 t2)).
10 Intros; XElim H; Clear x; Intros;
11 Try Subst0Gen; XEAuto.
14 Theorem subst1_gen_lift_eq : (t,u,x:?; h,d,i:?)
15 (le d i) -> (lt i (plus d h)) ->
16 (subst1 i u (lift h d t) x) ->
18 Intros; XElim H1; Clear x; Intros;
22 Theorem subst1_gen_lift_ge : (u,t1,x:?; i,h,d:?) (subst1 i u (lift h d t1) x) ->
24 (EX t2 | x = (lift h d t2) & (subst1 (minus i h) u t1 t2)).
25 Intros; XElim H; Clear x; Intros;
26 Try Subst0Gen; XEAuto.
31 Tactic Definition Subst1Gen :=
33 | [ H: (subst1 ?0 (lift ?1 ?2 ?3) (lift ?1 (S (plus ?0 ?2)) ?4) ?5) |- ? ] ->
34 LApply (subst1_gen_lift_lt ?3 ?4 ?5 ?0 ?1 ?2); [ Clear H; Intros H | XAuto ];
36 | [ H: (subst1 ?0 ?1 (lift (1) ?0 ?2) ?3) |- ? ] ->
37 LApply (subst1_gen_lift_eq ?2 ?1 ?3 (1) ?0 ?0); [ Intros H_x | XAuto ];
38 LApply H_x; [ Clear H_x; Intros H_x | Rewrite plus_sym; XAuto ];
39 LApply H_x; [ Clear H H_x; Intros | XAuto ]
40 | [ H0: (subst1 ?0 ?1 (lift (1) ?4 ?2) ?3); H1: (lt ?4 ?0) |- ? ] ->
41 LApply (subst1_gen_lift_ge ?1 ?2 ?3 ?0 (1) ?4); [ Clear H0; Intros H0 | XAuto ];
42 LApply H0; [ Clear H0; Intros H0 | Rewrite plus_sym; XAuto ];