]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/lib/lambda/terms/labeled_sequential_computation.ma
2287c6b81053d22ee1fbb618be56964d098eab98
[helm.git] / matita / matita / lib / lambda / terms / labeled_sequential_computation.ma
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 "terms/sequential_computation.ma".
16
17 (* ABSTRACT LABELED SEQUENTIAL COMPUTATION (MULTISTEP) **********************)
18
19 definition l_sreds: ∀S. (S→relation term) → list S → relation term ≝
20                     λS,R. lstar … R.
21
22 lemma sreds_l_sreds: ∀S,R. (∀M,N. M ↦ N → ∃a. R a M N) →
23                      ∀M,N. M ↦* N → ∃l. l_sreds S R l M N.
24 #S #R #HR #M #N #H elim H -N
25 [ #N #N0 #_ #HN0 * #l #HMN
26   elim (HR … HN0) -HR -HN0 /3 width=5/
27 | /2 width=2/
28 ]
29 qed-.
30
31 lemma l_sreds_inv_sreds: ∀S,R. (∀a,M,N. R a M N → M ↦ N) →
32                          ∀l,M,N. l_sreds S R l M N → M ↦* N.
33 #S #R #HR #l #M #N #H elim H -N // /3 by star_compl/
34 qed-.
35
36 (* Note: "|s|" should be unparetesized *)
37 lemma l_sreds_fwd_mult: ∀S,R. (∀a,M,N. R a M N → M ↦ N) →
38                         ∀l,M1,M2. l_sreds S R l M1 M2 →
39                         ♯{M2} ≤ ♯{M1} ^ (2 ^ (|l|)).
40 #S #R #HR #l #M1 #M2 #H @(lstar_ind_l … l M1 H) -l -M1 normalize //
41 #a #l #M1 #M #HM1 #_ #IHM2
42 lapply (HR … HM1) -HR -a #HM1
43 lapply (sred_fwd_mult … HM1) #HM1
44 @(transitive_le … IHM2) -M2
45 /3 width=1 by le_exp1, lt_O_exp, lt_to_le/ (**) (* auto: slow without trace *)
46 qed-.