1 (**************************************************************************)
4 (* ||A|| A project by Andrea Asperti *)
6 (* ||I|| Developers: *)
7 (* ||T|| The HELM team. *)
8 (* ||A|| http://helm.tcs.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/rtmap_isid.ma".
17 (* RELOCATION MAP ***********************************************************)
19 coinductive sle: relation rtmap ≝
20 | sle_push: ∀f1,f2,g1,g2. sle f1 f2 → ↑f1 = g1 → ↑f2 = g2 → sle g1 g2
21 | sle_next: ∀f1,f2,g1,g2. sle f1 f2 → ⫯f1 = g1 → ⫯f2 = g2 → sle g1 g2
22 | sle_weak: ∀f1,f2,g1,g2. sle f1 f2 → ↑f1 = g1 → ⫯f2 = g2 → sle g1 g2
25 interpretation "inclusion (rtmap)"
26 'subseteq t1 t2 = (sle t1 t2).
28 (* Basic inversion lemmas ***************************************************)
30 lemma sle_inv_xp: ∀g1,g2. g1 ⊆ g2 → ∀f2. ↑f2 = g2 →
31 ∃∃f1. f1 ⊆ f2 & ↑f1 = g1.
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_push_next … Hx2)
38 lemma sle_inv_nx: ∀g1,g2. g1 ⊆ g2 → ∀f1. ⫯f1 = g1 →
39 ∃∃f2. f1 ⊆ f2 & ⫯f2 = g2.
41 #f1 #f2 #g1 #g2 #H #H1 #H2 #x1 #Hx1 destruct
42 [2: lapply (injective_next … Hx1) -Hx1 /2 width=3 by ex2_intro/ ]
43 elim (discr_next_push … Hx1)
46 lemma sle_inv_pn: ∀g1,g2. g1 ⊆ g2 → ∀f1,f2. ↑f1 = g1 → ⫯f2 = g2 → f1 ⊆ f2.
48 #f1 #f2 #g1 #g2 #H #H1 #H2 #x1 #x2 #Hx1 #Hx2 destruct
49 [ elim (discr_next_push … Hx2)
50 | elim (discr_push_next … Hx1)
51 | lapply (injective_push … Hx1) -Hx1
52 lapply (injective_next … Hx2) -Hx2 //
56 (* Advanced inversion lemmas ************************************************)
58 lemma sle_inv_pp: ∀g1,g2. g1 ⊆ g2 → ∀f1,f2. ↑f1 = g1 → ↑f2 = g2 → f1 ⊆ f2.
59 #g1 #g2 #H #f1 #f2 #H1 #H2 elim (sle_inv_xp … H … H2) -g2
60 #x1 #H #Hx1 destruct lapply (injective_push … Hx1) -Hx1 //
63 lemma sle_inv_nn: ∀g1,g2. g1 ⊆ g2 → ∀f1,f2. ⫯f1 = g1 → ⫯f2 = g2 → f1 ⊆ f2.
64 #g1 #g2 #H #f1 #f2 #H1 #H2 elim (sle_inv_nx … H … H1) -g1
65 #x2 #H #Hx2 destruct lapply (injective_next … Hx2) -Hx2 //
68 (* properties on isid *******************************************************)
70 let corec sle_isid_sn: ∀f1. 𝐈⦃f1⦄ → ∀f2. f1 ⊆ f2 ≝ ?.
72 #f1 #g1 #Hf1 #H1 #f2 cases (pn_split f2) *
73 /3 width=5 by sle_weak, sle_push/
76 (* inversion lemmas on isid *************************************************)
78 let corec sle_inv_isid_dx: ∀f1,f2. f1 ⊆ f2 → 𝐈⦃f2⦄ → 𝐈⦃f1⦄ ≝ ?.
80 #f1 #f2 #g1 #g2 #Hf * * #H
81 [2,3: elim (isid_inv_next … H) // ]
82 lapply (isid_inv_push … H ??) -H
83 /3 width=3 by isid_push/