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_2/notation/relations/isid_1.ma".
16 include "ground_2/relocation/trace_after.ma".
18 (* RELOCATION TRACE *********************************************************)
20 definition isid: predicate trace ≝ λcs. ∥cs∥ = |cs|.
22 interpretation "test for identity (trace)"
25 (* Basic properties *********************************************************)
27 lemma isid_empty: 𝐈⦃◊⦄.
30 lemma isid_true: ∀cs. 𝐈⦃cs⦄ → 𝐈⦃Ⓣ @ cs⦄.
33 (* Basic inversion lemmas ***************************************************)
35 lemma isid_inv_true: ∀cs. 𝐈⦃Ⓣ @ cs⦄ → 𝐈⦃cs⦄.
36 /2 width=1 by injective_S/ qed-.
38 lemma isid_inv_false: ∀cs. 𝐈⦃Ⓕ @ cs⦄ → ⊥.
39 /3 width=4 by colength_le, lt_le_false/ qed-.
41 lemma isid_inv_cons: ∀cs,b. 𝐈⦃b @ cs⦄ → 𝐈⦃cs⦄ ∧ b = Ⓣ.
42 #cs * #H /3 width=1 by isid_inv_true, conj/
43 elim (isid_inv_false … H)
46 (* Properties on application ************************************************)
48 lemma isid_at: ∀cs. (∀i1,i2. @⦃i1, cs⦄ ≡ i2 → i1 = i2) → 𝐈⦃cs⦄.
49 #cs elim cs -cs // * /2 width=1 by/
52 (* Inversion lemmas on application ******************************************)
54 lemma isid_inv_at: ∀cs,i1,i2. @⦃i1, cs⦄ ≡ i2 → 𝐈⦃cs⦄ → i1 = i2.
55 #cs #i1 #i2 #H elim H -cs -i1 -i2 /4 width=1 by isid_inv_true, eq_f/
56 #cs #i1 #i2 #_ #IH #H elim (isid_inv_false … H)
59 (* Properties on composition ************************************************)
61 lemma isid_after_sn: ∀cs1,cs2. cs1 ⊚ cs2 ≡ cs2 → 𝐈⦃cs1⦄ .
62 #cs1 #cs2 #H elim (after_inv_length … H) -H //
65 lemma isid_after_dx: ∀cs1,cs2. cs1 ⊚ cs2 ≡ cs1 → 𝐈⦃cs2⦄ .
66 #cs1 #cs2 #H elim (after_inv_length … H) -H //
69 (* Inversion lemmas on composition ******************************************)
71 lemma isid_inv_after_sn: ∀cs1,cs2,cs. cs1 ⊚ cs2 ≡ cs → 𝐈⦃cs1⦄ → cs = cs2.
72 #cs1 #cs2 #cs #H elim H -cs1 -cs2 -cs //
73 #cs1 #cs2 #cs #_ [ #b ] #IH #H
74 [ >IH -IH // | elim (isid_inv_false … H) ]
77 lemma isid_inv_after_dx: ∀cs1,cs2,cs. cs1 ⊚ cs2 ≡ cs → 𝐈⦃cs2⦄ → cs = cs1.
78 #cs1 #cs2 #cs #H elim H -cs1 -cs2 -cs //
79 #cs1 #cs2 #cs #_ [ #b ] #IH #H
80 [ elim (isid_inv_cons … H) -H #H >IH -IH // | >IH -IH // ]