]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/ground/relocation/gr_after_after_ist.ma
update in ground
[helm.git] / matita / matita / contribs / lambdadelta / ground / relocation / gr_after_after_ist.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/arith/nat_pred_succ.ma".
16 include "ground/relocation/gr_pat_tls.ma".
17 include "ground/relocation/gr_ist_tls.ma".
18 include "ground/relocation/gr_after_pat_tls.ma".
19
20 (* RELATIONAL COMPOSITION FOR GENERIC RELOCATION MAPS ***********************)
21
22 (*** H_after_inj *)
23 definition H_gr_after_inj: predicate gr_map ≝
24            λf1. 𝐓❪f1❫ →
25            ∀f,f21,f22. f1 ⊚ f21 ≘ f → f1 ⊚ f22 ≘ f → f21 ≡ f22.
26
27 (* Main destructions with gr_ist ********************************************)
28
29 (*** after_inj_O_aux *)
30 corec fact gr_after_inj_unit_aux:
31            ∀f1. @❪𝟏, f1❫ ≘ 𝟏 → H_gr_after_inj f1.
32 #f1 #H1f1 #H2f1 #f #f21 #f22 #H1f #H2f
33 cases (gr_pat_inv_unit_bi … H1f1) -H1f1 [|*: // ] #g1 #H1
34 lapply (gr_ist_inv_push … H2f1 … H1) -H2f1 #H2g1
35 cases (H2g1 (𝟏)) #p #Hp
36 cases (gr_after_inv_push_sn … H1f … H1) -H1f * #g21 #g #H1g #H21 #H
37 [ cases (gr_after_inv_push_sn_push … H2f … H1 H) -f1 -f #g22 #H2g #H22
38   @(gr_eq_push … H21 H22) -f21 -f22
39 | cases (gr_after_inv_push_sn_next … H2f … H1 H) -f1 -f #g22 #H2g #H22
40   @(gr_eq_next … H21 H22) -f21 -f22
41 ]
42 @(gr_after_inj_unit_aux (⫱*[↓p]g1) … (⫱*[↓p]g)) -gr_after_inj_unit_aux
43 /2 width=1 by gr_after_tls_sn_tls, gr_ist_tls, gr_pat_unit_succ_tls/
44 qed-.
45
46 (*** after_inj_aux *)
47 fact gr_after_inj_aux:
48      (∀f1. @❪𝟏, f1❫ ≘ 𝟏 → H_gr_after_inj f1) →
49      ∀i2,f1. @❪𝟏, f1❫ ≘ i2 → H_gr_after_inj f1.
50 #H0 #i2 elim i2 -i2 /2 width=1 by/ -H0
51 #i2 #IH #f1 #H1f1 #H2f1 #f #f21 #f22 #H1f #H2f
52 elim (gr_pat_inv_unit_succ … H1f1) -H1f1 [|*: // ] #g1 #H1g1 #H1
53 elim (gr_after_inv_next_sn … H1f … H1) -H1f #g #H1g #H
54 lapply (gr_after_inv_next_sn_next … H2f … H1 H) -f #H2g
55 /3 width=6 by gr_ist_inv_next/
56 qed-.
57
58 (*** after_inj *)
59 theorem gr_after_inj:
60         ∀f1. H_gr_after_inj f1.
61 #f1 #H cases (H (𝟏))
62 /3 width=7 by gr_after_inj_aux, gr_after_inj_unit_aux/
63 qed-.