]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/ground/relocation/pr_after_after_ist.ma
update in delayed_updating
[helm.git] / matita / matita / contribs / lambdadelta / ground / relocation / pr_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/pr_pat_tls.ma".
17 include "ground/relocation/pr_ist_tls.ma".
18 include "ground/relocation/pr_after_pat_tls.ma".
19
20 (* RELATIONAL COMPOSITION FOR PARTIAL RELOCATION MAPS ***********************)
21
22 (*** H_after_inj *)
23 definition H_pr_after_inj: predicate pr_map ≝
24            λf1. 𝐓❨f1❩ →
25            ∀f,f21,f22. f1 ⊚ f21 ≘ f → f1 ⊚ f22 ≘ f → f21 ≡ f22.
26
27 (* Main destructions with pr_ist ********************************************)
28
29 (*** after_inj_O_aux *)
30 corec fact pr_after_inj_unit_aux:
31            ∀f1. @❨𝟏, f1❩ ≘ 𝟏 → H_pr_after_inj f1.
32 #f1 #H1f1 #H2f1 #f #f21 #f22 #H1f #H2f
33 cases (pr_pat_inv_unit_bi … H1f1) -H1f1 [|*: // ] #g1 #H1
34 lapply (pr_ist_inv_push … H2f1 … H1) -H2f1 #H2g1
35 cases (H2g1 (𝟏)) #p #Hp
36 cases (pr_after_inv_push_sn … H1f … H1) -H1f * #g21 #g #H1g #H21 #H
37 [ cases (pr_after_inv_push_sn_push … H2f … H1 H) -f1 -f #g22 #H2g #H22
38   @(pr_eq_push … H21 H22) -f21 -f22
39 | cases (pr_after_inv_push_sn_next … H2f … H1 H) -f1 -f #g22 #H2g #H22
40   @(pr_eq_next … H21 H22) -f21 -f22
41 ]
42 @(pr_after_inj_unit_aux (⫰*[↓p]g1) … (⫰*[↓p]g)) -pr_after_inj_unit_aux
43 /2 width=1 by pr_after_tls_sn_tls, pr_ist_tls, pr_pat_unit_succ_tls/
44 qed-.
45
46 (*** after_inj_aux *)
47 fact pr_after_inj_aux:
48      (∀f1. @❨𝟏, f1❩ ≘ 𝟏 → H_pr_after_inj f1) →
49      ∀i2,f1. @❨𝟏, f1❩ ≘ i2 → H_pr_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 (pr_pat_inv_unit_succ … H1f1) -H1f1 [|*: // ] #g1 #H1g1 #H1
53 elim (pr_after_inv_next_sn … H1f … H1) -H1f #g #H1g #H
54 lapply (pr_after_inv_next_sn_next … H2f … H1 H) -f #H2g
55 /3 width=6 by pr_ist_inv_next/
56 qed-.
57
58 (*** after_inj *)
59 theorem pr_after_inj:
60         ∀f1. H_pr_after_inj f1.
61 #f1 #H cases (H (𝟏))
62 /3 width=7 by pr_after_inj_aux, pr_after_inj_unit_aux/
63 qed-.