1 (**************************************************************************)
4 (* ||A|| A project by Andrea Asperti *)
6 (* ||I|| Developers: *)
7 (* ||T|| The HELM team. *)
8 (* ||A|| http://helm.cs.unibo.it *)
10 (* \ / This file is distributed under the terms of the *)
11 (* v GNU General Public License Version 2 *)
13 (**************************************************************************)
15 include "ground_2/relocation/trace_at.ma".
17 (* RELOCATION TRACE *********************************************************)
19 inductive sle: relation trace ≝
20 | sle_empty: sle (◊) (◊)
21 | sle_true : ∀t1,t2. sle t1 t2 → sle (Ⓣ @ t1) (Ⓣ @ t2)
22 | sle_false: ∀t1,t2,b. sle t1 t2 → sle (Ⓕ @ t1) (b @ t2)
27 'subseteq t1 t2 = (sle t1 t2).
29 (* Basic properties *********************************************************)
31 (* Basic forward lemmas *****************************************************)
33 lemma sle_fwd_length: ∀t1,t2. t1 ⊆ t2 → |t1| = |t2|.
34 #t1 #t2 #H elim H -t1 -t2 //
37 lemma sle_fwd_colength: ∀t1,t2. t1 ⊆ t2 → ∥t1∥ ≤ ∥t2∥.
38 #t1 #t2 #H elim H -t1 -t2 /2 width=1 by le_S_S/
39 #t1 #t2 * /2 width=1 by le_S/
42 (* Inversion lemmas on application ******************************************)
44 lemma sle_inv_at: ∀t1,t2. t1 ⊆ t2 →
45 ∀i,i1,i2. @⦃i, t1⦄ ≡ i1 → @⦃i, t2⦄ ≡ i2 → i2 ≤ i1.
46 #t1 #t2 #H elim H -t1 -t2
47 [ #i #i1 #i2 #_ #H2 elim (at_inv_empty … H2) -H2 //
48 | #t1 #t2 #_ #IH #i #i1 #i2 #H0 #H2 elim (at_inv_true … H2) -H2 * //
49 #j1 #j2 #H1 #H2 #Hj destruct elim (at_inv_true_succ_sn … H0) -H0
51 | #t1 #t2 * #_ #IH #i #i1 #i2 #H0 #H2
52 [ elim (at_inv_true … H2) -H2 * //
53 #j #j2 #H1 #H2 #Hj2 destruct elim (at_inv_false … H0) -H0
54 #j1 #H #Hj1 destruct elim (at_monotonic … Hj1 j) -Hj1 //
55 #x #H1x #H2x @le_S_S /4 width=3 by lt_to_le, le_to_lt_to_lt/ (**) (* full auto too slow *)
56 | elim (at_inv_false … H2) elim (at_inv_false … H0) -H0 -H2