]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/ground_2/etc/relocation/trace_sle.etc
milestone update in ground_2 and basic_2A
[helm.git] / matita / matita / contribs / lambdadelta / ground_2 / etc / relocation / trace_sle.etc
1 (**************************************************************************)
2 (*       ___                                                              *)
3 (*      ||M||                                                             *)
4 (*      ||A||       A project by Andrea Asperti                           *)
5 (*      ||T||                                                             *)
6 (*      ||I||       Developers:                                           *)
7 (*      ||T||         The HELM team.                                      *)
8 (*      ||A||         http://helm.cs.unibo.it                             *)
9 (*      \   /                                                             *)
10 (*       \ /        This file is distributed under the terms of the       *)
11 (*        v         GNU General Public License Version 2                  *)
12 (*                                                                        *)
13 (**************************************************************************)
14
15 include "ground_2/relocation/trace_at.ma".
16
17 (* RELOCATION TRACE *********************************************************)
18
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)
23 .
24
25 interpretation
26    "inclusion (trace)"
27    'subseteq t1 t2 = (sle t1 t2).
28
29 (* Basic properties *********************************************************)
30
31 (* Basic forward lemmas *****************************************************)
32
33 lemma sle_fwd_length: ∀t1,t2. t1 ⊆ t2 → |t1| = |t2|.
34 #t1 #t2 #H elim H -t1 -t2 //
35 qed-.
36
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/
40 qed-.
41
42 (* Inversion lemmas on application ******************************************)
43
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
50   /3 width=3 by le_S_S/
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
57     /3 width=3 by le_S_S/
58   ]
59 ]  
60 qed-.