]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/ground_2/relocation/rtmap_isid.ma
some results on co-composition ...
[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 tail *****************************************************)
79
80 lemma isid_tl: ∀f. 𝐈⦃f⦄ → 𝐈⦃⫱f⦄.
81 #f cases (pn_split f) * #g * -f #H
82 [ /2 width=3 by isid_inv_push/
83 | elim (isid_inv_next … H) -H //
84 ]
85 qed.
86
87 (* Properties with iterated tail ********************************************)
88
89 lemma isid_tls: ∀n,g. 𝐈⦃g⦄ → 𝐈⦃⫱*[n]g⦄.
90 #n elim n -n /3 width=1 by isid_tl/
91 qed.