]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/ground_2/relocation/rtmap_isid.ma
update in ground_2, static_2, basic_2, apps_2, alpha_1
[helm.git] / matita / matita / contribs / lambdadelta / ground_2 / relocation / rtmap_isid.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.cs.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/notation/relations/isidentity_1.ma".
16 include "ground_2/relocation/rtmap_tls.ma".
17
18 (* RELOCATION MAP ***********************************************************)
19
20 coinductive isid: predicate rtmap ≝
21 | isid_push: ∀f,g. isid f → ⫯f = g → isid g
22 .
23
24 interpretation "test for identity (rtmap)"
25    'IsIdentity f = (isid f).
26
27 (* Basic inversion lemmas ***************************************************)
28
29 lemma isid_inv_gen: ∀g. 𝐈❪g❫ → ∃∃f. 𝐈❪f❫ & ⫯f = g.
30 #g * -g
31 #f #g #Hf * /2 width=3 by ex2_intro/
32 qed-.
33
34 (* Advanced inversion lemmas ************************************************)
35
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 //
39 qed-.
40
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)
44 qed-.
45
46 (* Main inversion lemmas ****************************************************)
47
48 corec theorem isid_inv_eq_repl: ∀f1,f2. 𝐈❪f1❫ → 𝐈❪f2❫ → f1 ≡ f2.
49 #f1 #f2 #H1 #H2
50 cases (isid_inv_gen … H1) -H1
51 cases (isid_inv_gen … H2) -H2
52 /3 width=5 by eq_push/
53 qed-.
54
55 (* Basic properties *********************************************************)
56
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/
61 qed-.
62
63 lemma isid_eq_repl_fwd: eq_repl_fwd … isid.
64 /3 width=3 by isid_eq_repl_back, eq_repl_sym/ qed-.
65
66 (* Alternative definition ***************************************************)
67
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/
70 qed.
71
72 corec lemma eq_push_inv_isid: ∀f. 𝐈❪f❫ → ⫯f ≡ f.
73 #f * -f
74 #f #g #Hf #Hg @(eq_push … Hg) [2: @eq_push_inv_isid // | skip ]
75 @eq_f //
76 qed-.
77
78 (* Properties with iterated push ********************************************)
79
80 lemma isid_pushs: ∀n,f. 𝐈❪f❫ → 𝐈❪⫯*[n]f❫.
81 #n elim n -n /3 width=3 by isid_push/
82 qed.
83
84 (* Inversion lemmas with iterated push **************************************)
85
86 lemma isid_inv_pushs: ∀n,g. 𝐈❪⫯*[n]g❫ → 𝐈❪g❫.
87 #n elim n -n /3 width=3 by isid_inv_push/
88 qed.
89
90 (* Properties with tail *****************************************************)
91
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 //
96 ]
97 qed.
98
99 (* Properties with iterated tail ********************************************)
100
101 lemma isid_tls: ∀n,g. 𝐈❪g❫ → 𝐈❪⫱*[n]g❫.
102 #n elim n -n /3 width=1 by isid_tl/
103 qed.