]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/ground_2/relocation/rtmap_isdiv.ma
update in ground_2, static_2, basic_2, apps_2, alpha_1
[helm.git] / matita / matita / contribs / lambdadelta / ground_2 / relocation / rtmap_isdiv.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/isdivergent_1.ma".
16 include "ground_2/relocation/rtmap_nexts.ma".
17 include "ground_2/relocation/rtmap_tls.ma".
18
19 (* RELOCATION MAP ***********************************************************)
20
21 coinductive isdiv: predicate rtmap ≝
22 | isdiv_next: ∀f,g. isdiv f → ↑f = g → isdiv g
23 .
24
25 interpretation "test for divergence (rtmap)"
26    'IsDivergent f = (isdiv f).
27
28 (* Basic inversion lemmas ***************************************************)
29
30 lemma isdiv_inv_gen: ∀g. 𝛀❪g❫ → ∃∃f. 𝛀❪f❫ & ↑f = g.
31 #g * -g
32 #f #g #Hf * /2 width=3 by ex2_intro/
33 qed-.
34
35 (* Advanced inversion lemmas ************************************************)
36
37 lemma isdiv_inv_next: ∀g. 𝛀❪g❫ → ∀f. ↑f = g → 𝛀❪f❫.
38 #g #H elim (isdiv_inv_gen … H) -H
39 #f #Hf * -g #g #H >(injective_next … H) -H //
40 qed-.
41
42 lemma isdiv_inv_push: ∀g. 𝛀❪g❫ → ∀f. ⫯f = g → ⊥.
43 #g #H elim (isdiv_inv_gen … H) -H
44 #f #Hf * -g #g #H elim (discr_push_next … H)
45 qed-.
46
47 (* Main inversion lemmas ****************************************************)
48
49 corec theorem isdiv_inv_eq_repl: ∀f1,f2. 𝛀❪f1❫ → 𝛀❪f2❫ → f1 ≡ f2.
50 #f1 #f2 #H1 #H2
51 cases (isdiv_inv_gen … H1) -H1
52 cases (isdiv_inv_gen … H2) -H2
53 /3 width=5 by eq_next/
54 qed-.
55
56 (* Basic properties *********************************************************)
57
58 corec lemma isdiv_eq_repl_back: eq_repl_back … isdiv.
59 #f1 #H cases (isdiv_inv_gen … H) -H
60 #g1 #Hg1 #H1 #f2 #Hf cases (eq_inv_nx … Hf … H1) -f1
61 /3 width=3 by isdiv_next/
62 qed-.
63
64 lemma isdiv_eq_repl_fwd: eq_repl_fwd … isdiv.
65 /3 width=3 by isdiv_eq_repl_back, eq_repl_sym/ qed-.
66
67 (* Alternative definition ***************************************************)
68
69 corec lemma eq_next_isdiv: ∀f. ↑f ≡ f → 𝛀❪f❫.
70 #f #H cases (eq_inv_nx … H) -H /4 width=3 by isdiv_next, eq_trans/
71 qed.
72
73 corec lemma eq_next_inv_isdiv: ∀f. 𝛀❪f❫ → ↑f ≡ f.
74 #f * -f
75 #f #g #Hf #Hg @(eq_next … Hg) [2: @eq_next_inv_isdiv // | skip ]
76 @eq_f //
77 qed-.
78
79 (* Properties with iterated next ********************************************)
80
81 lemma isdiv_nexts: ∀n,f. 𝛀❪f❫ → 𝛀❪↑*[n]f❫.
82 #n elim n -n /3 width=3 by isdiv_next/
83 qed.
84
85 (* Inversion lemmas with iterated next **************************************)
86
87 lemma isdiv_inv_nexts: ∀n,g. 𝛀❪↑*[n]g❫ → 𝛀❪g❫.
88 #n elim n -n /3 width=3 by isdiv_inv_next/
89 qed.
90
91 (* Properties with tail *****************************************************)
92
93 lemma isdiv_tl: ∀f. 𝛀❪f❫ → 𝛀❪⫱f❫.
94 #f cases (pn_split f) * #g * -f #H
95 [ elim (isdiv_inv_push … H) -H //
96 | /2 width=3 by isdiv_inv_next/
97 ]
98 qed.
99
100 (* Properties with iterated tail ********************************************)
101
102 lemma isdiv_tls: ∀n,g. 𝛀❪g❫ → 𝛀❪⫱*[n]g❫.
103 #n elim n -n /3 width=1 by isdiv_tl/
104 qed.