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/isidentity_1.ma".
16 include "ground_2/relocation/rtmap_tls.ma".
18 (* RELOCATION MAP ***********************************************************)
20 coinductive isid: predicate rtmap ≝
21 | isid_push: ∀f,g. isid f → ⫯f = g → isid g
24 interpretation "test for identity (rtmap)"
25 'IsIdentity f = (isid f).
27 (* Basic inversion lemmas ***************************************************)
29 lemma isid_inv_gen: ∀g. 𝐈⦃g⦄ → ∃∃f. 𝐈⦃f⦄ & ⫯f = g.
31 #f #g #Hf * /2 width=3 by ex2_intro/
34 (* Advanced inversion lemmas ************************************************)
36 lemma isid_inv_push: ∀g. 𝐈⦃g⦄ → ∀f. ⫯f = g → 𝐈⦃f⦄.
37 #g #H elim (isid_inv_gen … H) -H
38 #f #Hf * -g #g #H >(injective_push … H) -H //
41 lemma isid_inv_next: ∀g. 𝐈⦃g⦄ → ∀f. ↑f = g → ⊥.
42 #g #H elim (isid_inv_gen … H) -H
43 #f #Hf * -g #g #H elim (discr_next_push … H)
46 (* Main inversion lemmas ****************************************************)
48 corec theorem isid_inv_eq_repl: ∀f1,f2. 𝐈⦃f1⦄ → 𝐈⦃f2⦄ → f1 ≡ f2.
50 cases (isid_inv_gen … H1) -H1
51 cases (isid_inv_gen … H2) -H2
52 /3 width=5 by eq_push/
55 (* Basic properties *********************************************************)
57 corec lemma isid_eq_repl_back: eq_repl_back … isid.
58 #f1 #H cases (isid_inv_gen … H) -H
59 #g1 #Hg1 #H1 #f2 #Hf cases (eq_inv_px … Hf … H1) -f1
60 /3 width=3 by isid_push/
63 lemma isid_eq_repl_fwd: eq_repl_fwd … isid.
64 /3 width=3 by isid_eq_repl_back, eq_repl_sym/ qed-.
66 (* Alternative definition ***************************************************)
68 corec lemma eq_push_isid: ∀f. ⫯f ≡ f → 𝐈⦃f⦄.
69 #f #H cases (eq_inv_px … H) -H /4 width=3 by isid_push, eq_trans/
72 corec lemma eq_push_inv_isid: ∀f. 𝐈⦃f⦄ → ⫯f ≡ f.
74 #f #g #Hf #Hg @(eq_push … Hg) [2: @eq_push_inv_isid // | skip ]
78 (* Properties with iterated push ********************************************)
80 lemma isid_pushs: ∀n,f. 𝐈⦃f⦄ → 𝐈⦃⫯*[n]f⦄.
81 #n elim n -n /3 width=3 by isid_push/
84 (* Inversion lemmas with iterated push **************************************)
86 lemma isid_inv_pushs: ∀n,g. 𝐈⦃⫯*[n]g⦄ → 𝐈⦃g⦄.
87 #n elim n -n /3 width=3 by isid_inv_push/
90 (* Properties with tail *****************************************************)
92 lemma isid_tl: ∀f. 𝐈⦃f⦄ → 𝐈⦃⫱f⦄.
93 #f cases (pn_split f) * #g * -f #H
94 [ /2 width=3 by isid_inv_push/
95 | elim (isid_inv_next … H) -H //
99 (* Properties with iterated tail ********************************************)
101 lemma isid_tls: ∀n,g. 𝐈⦃g⦄ → 𝐈⦃⫱*[n]g⦄.
102 #n elim n -n /3 width=1 by isid_tl/