]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/ground_2/relocation/nstream_sle.ma
021ac660e21eb1a4e5252138062a13c7768d9b27
[helm.git] / matita / matita / contribs / lambdadelta / ground_2 / relocation / nstream_sle.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.tcs.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/nstream_lift.ma".
16
17 (* RELOCATION N-STREAM ******************************************************)
18
19 coinductive sle: relation rtmap ≝
20 | sle_next: ∀f1,f2,g1,g2. sle f1 f2 → g1 = ↑f1 → g2 = ↑f2 → sle g1 g2
21 | sle_push: ∀f1,f2,g1,g2. sle f1 f2 → g1 = ⫯f1 → g2 = ⫯f2 → sle g1 g2
22 | sle_weak: ∀f1,f2,g1,g2. sle f1 f2 → g1 = ↑f1 → g2 = ⫯f2 → sle g1 g2
23 .
24
25 interpretation "inclusion (nstream)"
26    'subseteq t1 t2 = (sle t1 t2).
27
28 (* Basic inversion lemmas ***************************************************)
29
30 fact sle_inv_xO_aux: ∀g1,g2. g1 ⊆ g2 → ∀f2. g2 = ↑f2 →
31                      ∃∃f1. f1 ⊆ f2 & g1 = ↑f1.
32 #g1 #g2 * -g1 -g2
33 #f1 #f2 #g1 #g2 #H #H1 #H2 #x2 #Hx2 destruct
34 [ lapply (injective_push … Hx2) -Hx2 /2 width=3 by ex2_intro/ ]
35 elim (discr_next_push … Hx2)
36 qed-.
37
38 lemma sle_inv_xO: ∀g1,f2. g1 ⊆ ↑f2 → ∃∃f1. f1 ⊆ f2 & g1 = ↑f1.
39 /2 width=3 by sle_inv_xO_aux/ qed-.
40
41 fact sle_inv_Sx_aux: ∀g1,g2. g1 ⊆ g2 → ∀f1. g1 = ⫯f1 →
42                      ∃∃f2. f1 ⊆ f2 & g2 = ⫯f2.
43 #g1 #g2 * -g1 -g2
44 #f1 #f2 #g1 #g2 #H #H1 #H2 #x1 #Hx1 destruct
45 [2: lapply (injective_next … Hx1) -Hx1 /2 width=3 by ex2_intro/ ]
46 elim (discr_push_next … Hx1)
47 qed-.
48
49 lemma sle_inv_Sx: ∀f1,g2. ⫯f1 ⊆ g2 → ∃∃f2. f1 ⊆ f2 & g2 = ⫯f2.
50 /2 width=3 by sle_inv_Sx_aux/ qed-.
51
52 fact sle_inv_OS_aux: ∀g1,g2. g1 ⊆ g2 → ∀f1,f2. g1 = ↑f1 → g2 = ⫯f2 → f1 ⊆ f2.
53 #g1 #g2 * -g1 -g2
54 #f1 #f2 #g1 #g2 #H #H1 #H2 #x1 #x2 #Hx1 #Hx2 destruct
55 [ elim (discr_push_next … Hx2)
56 | elim (discr_next_push … Hx1)
57 | lapply (injective_push … Hx1) -Hx1
58   lapply (injective_next … Hx2) -Hx2 //
59 ]
60 qed-.
61
62 lemma sle_inv_OS: ∀f1,f2. ↑f1 ⊆ ⫯f2 → f1 ⊆ f2.
63 /2 width=5 by sle_inv_OS_aux/ qed-.
64
65 (* Advanced inversion lemmas ************************************************)
66
67 fact sle_inv_OO_aux: ∀g1,g2. g1 ⊆ g2 → ∀f1,f2. g1 = ↑f1 → g2 = ↑f2 → f1 ⊆ f2.
68 #g1 #g2 #H #f1 #f2 #H1 #H2 elim (sle_inv_xO_aux … H … H2) -g2
69 #x1 #H #Hx1 destruct lapply (injective_push … Hx1) -Hx1 //
70 qed-.
71
72 fact sle_inv_SS_aux: ∀g1,g2. g1 ⊆ g2 → ∀f1,f2. g1 = ⫯f1 → g2 = ⫯f2 → f1 ⊆ f2.
73 #g1 #g2 #H #f1 #f2 #H1 #H2 elim (sle_inv_Sx_aux … H … H1) -g1
74 #x2 #H #Hx2 destruct lapply (injective_next … Hx2) -Hx2 //
75 qed-.