]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/ground/relocation/gr_pat_eq.ma
8cd42b57510996889ca5fbdb9c0f507bfb8f3061
[helm.git] / matita / matita / contribs / lambdadelta / ground / relocation / gr_pat_eq.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/relocation/gr_tl_eq.ma".
16 include "ground/relocation/gr_pat_lt.ma".
17
18 (* POSITIVE APPLICATION FOR GENERIC RELOCATION MAPS *************************)
19
20 (* Constructions with gr_eq *************************************************)
21
22 (*** at_eq_repl_back *)
23 corec lemma gr_pat_eq_repl_back (i1) (i2):
24             gr_eq_repl_back (λf. @❪i1,f❫ ≘ i2).
25 #f1 * -f1 -i1 -i2
26 [ #f1 #g1 #j1 #j2 #H #H1 #H2 #f2 #H12
27   cases (gr_eq_inv_push_sn … H12 … H) -g1 /2 width=2 by gr_pat_refl/
28 | #f1 #i1 #i2 #Hf1 #g1 #j1 #j2 #H #H1 #H2 #f2 #H12
29   cases (gr_eq_inv_push_sn … H12 … H) -g1 /3 width=7 by gr_pat_push/
30 | #f1 #i1 #i2 #Hf1 #g1 #j2 #H #H2 #f2 #H12
31   cases (gr_eq_inv_next_sn … H12 … H) -g1 /3 width=5 by gr_pat_next/
32 ]
33 qed-.
34
35 (*** at_eq_repl_fwd *)
36 lemma gr_pat_eq_repl_fwd (i1) (i2):
37       gr_eq_repl_fwd (λf. @❪i1,f❫ ≘ i2).
38 #i1 #i2 @gr_eq_repl_sym /2 width=3 by gr_pat_eq_repl_back/
39 qed-.
40
41 lemma gr_pat_eq (f): ⫯f ≡ f → ∀i. @❪i,f❫ ≘ i.
42 #f #Hf #i elim i -i
43 [ /3 width=3 by gr_pat_eq_repl_back, gr_pat_refl/
44 | /3 width=7 by gr_pat_eq_repl_back, gr_pat_push/
45 ]
46 qed.
47
48 (* Inversions with gr_eq ****************************************************)
49
50 corec lemma gr_pat_inv_eq (f):
51             (∀i. @❪i,f❫ ≘ i) → ⫯f ≡ f.
52 #Hf
53 lapply (Hf (𝟏)) #H
54 lapply (gr_pat_des_id … H) -H #H
55 cases H in Hf; -H #Hf
56 @gr_eq_push [3:|*: // ]
57 /3 width=7 by gr_pat_inv_succ_push_succ/
58 qed-.