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/relocation/pr_eq.ma".
16 include "ground/relocation/pr_tl.ma".
18 (* TAIL FOR PARTIAL RELOCATION MAPS *****************************************)
20 (* Constructions with pr_eq *************************************************)
23 corec lemma pr_eq_refl: reflexive … pr_eq.
24 #f cases (pr_map_split_tl f) #Hf
25 [ @(pr_eq_push … Hf Hf) | @(pr_eq_next … Hf Hf) ] -Hf //
30 pr_eq_repl … (λf1,f2. ⫰f1 ≡ ⫰f2).
34 (* Inversions with pr_eq ****************************************************)
37 lemma pr_eq_inv_gen (g1) (g2):
39 ∨∨ ∧∧ ⫰g1 ≡ ⫰g2 & ⫯⫰g1 = g1 & ⫯⫰g2 = g2
40 | ∧∧ ⫰g1 ≡ ⫰g2 & ↑⫰g1 = g1 & ↑⫰g2 = g2.
41 #g1 #g2 * -g1 -g2 #f1 #f2 #g1 #g2 #f * *
42 /3 width=1 by and3_intro, or_introl, or_intror/
45 (* Advanced inversions with pr_eq *******************************************)
48 lemma pr_eq_inv_push_sn (g1) (g2):
49 g1 ≡ g2 → ∀f1. ⫯f1 = g1 →
50 ∧∧ f1 ≡ ⫰g2 & ⫯⫰g2 = g2.
52 elim (pr_eq_inv_gen … H) -H * #Hg #Hg1 #Hg2 destruct
54 | elim (eq_inv_pr_next_push … Hg1)
59 lemma pr_eq_inv_next_sn (g1) (g2):
60 g1 ≡ g2 → ∀f1. ↑f1 = g1 →
61 ∧∧ f1 ≡ ⫰g2 & ↑⫰g2 = g2.
63 elim (pr_eq_inv_gen … H) -H * #Hg #Hg1 #Hg2 destruct
64 [ elim (eq_inv_pr_push_next … Hg1)
70 lemma pr_eq_inv_push_dx (g1) (g2):
71 g1 ≡ g2 → ∀f2. ⫯f2 = g2 →
72 ∧∧ ⫰g1 ≡ f2 & ⫯⫰g1 = g1.
74 elim (pr_eq_inv_gen … H) -H * #Hg #Hg1 #Hg2 destruct
76 | elim (eq_inv_pr_next_push … Hg2)
81 lemma pr_eq_inv_next_dx (g1) (g2):
82 g1 ≡ g2 → ∀f2. ↑f2 = g2 →
83 ∧∧ ⫰g1 ≡ f2 & ↑⫰g1 = g1.
85 elim (pr_eq_inv_gen … H) -H * #Hg #Hg1 #Hg2 destruct
86 [ elim (eq_inv_pr_push_next … Hg2)
92 lemma pr_eq_inv_push_bi (g1) (g2):
93 g1 ≡ g2 → ∀f1,f2. ⫯f1 = g1 → ⫯f2 = g2 → f1 ≡ f2.
94 #g1 #g2 #H #f1 #f2 #H1
95 elim (pr_eq_inv_push_sn … H … H1) -g1 #Hx2 * #H
96 lapply (eq_inv_pr_push_bi … H) -H //
100 lemma pr_eq_inv_next_bi (g1) (g2):
101 g1 ≡ g2 → ∀f1,f2. ↑f1 = g1 → ↑f2 = g2 → f1 ≡ f2.
102 #g1 #g2 #H #f1 #f2 #H1
103 elim (pr_eq_inv_next_sn … H … H1) -g1 #Hx2 * #H
104 lapply (eq_inv_pr_next_bi … H) -H //
108 lemma pr_eq_inv_push_next (g1) (g2):
109 g1 ≡ g2 → ∀f1,f2. ⫯f1 = g1 → ↑f2 = g2 → ⊥.
110 #g1 #g2 #H #f1 #f2 #H1
111 elim (pr_eq_inv_push_sn … H … H1) -g1 #Hx2 * #H
112 elim (eq_inv_pr_next_push … H)
116 lemma pr_eq_inv_next_push (g1) (g2):
117 g1 ≡ g2 → ∀f1,f2. ↑f1 = g1 → ⫯f2 = g2 → ⊥.
118 #g1 #g2 #H #f1 #f2 #H1
119 elim (pr_eq_inv_next_sn … H … H1) -g1 #Hx2 * #H
120 elim (eq_inv_pr_push_next … H)