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/isdivergent_1.ma".
16 include "ground_2/relocation/rtmap_nexts.ma".
17 include "ground_2/relocation/rtmap_tls.ma".
19 (* RELOCATION MAP ***********************************************************)
21 coinductive isdiv: predicate rtmap ≝
22 | isdiv_next: ∀f,g. isdiv f → ↑f = g → isdiv g
25 interpretation "test for divergence (rtmap)"
26 'IsDivergent f = (isdiv f).
28 (* Basic inversion lemmas ***************************************************)
30 lemma isdiv_inv_gen: ∀g. 𝛀⦃g⦄ → ∃∃f. 𝛀⦃f⦄ & ↑f = g.
32 #f #g #Hf * /2 width=3 by ex2_intro/
35 (* Advanced inversion lemmas ************************************************)
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 //
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)
47 (* Main inversion lemmas ****************************************************)
49 corec theorem isdiv_inv_eq_repl: ∀f1,f2. 𝛀⦃f1⦄ → 𝛀⦃f2⦄ → f1 ≡ f2.
51 cases (isdiv_inv_gen … H1) -H1
52 cases (isdiv_inv_gen … H2) -H2
53 /3 width=5 by eq_next/
56 (* Basic properties *********************************************************)
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/
64 lemma isdiv_eq_repl_fwd: eq_repl_fwd … isdiv.
65 /3 width=3 by isdiv_eq_repl_back, eq_repl_sym/ qed-.
67 (* Alternative definition ***************************************************)
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/
73 corec lemma eq_next_inv_isdiv: ∀f. 𝛀⦃f⦄ → ↑f ≡ f.
75 #f #g #Hf #Hg @(eq_next … Hg) [2: @eq_next_inv_isdiv // | skip ]
79 (* Properties with iterated next ********************************************)
81 lemma isdiv_nexts: ∀n,f. 𝛀⦃f⦄ → 𝛀⦃↑*[n]f⦄.
82 #n elim n -n /3 width=3 by isdiv_next/
85 (* Inversion lemmas with iterated next **************************************)
87 lemma isdiv_inv_nexts: ∀n,g. 𝛀⦃↑*[n]g⦄ → 𝛀⦃g⦄.
88 #n elim n -n /3 width=3 by isdiv_inv_next/
91 (* Properties with tail *****************************************************)
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/
100 (* Properties with iterated tail ********************************************)
102 lemma isdiv_tls: ∀n,g. 𝛀⦃g⦄ → 𝛀⦃⫱*[n]g⦄.
103 #n elim n -n /3 width=1 by isdiv_tl/