]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/basic_2A/etc/tshf/tshf.etc
update in delayed_updating
[helm.git] / matita / matita / contribs / lambdadelta / basic_2A / etc / tshf / tshf.etc
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 notation "hvbox( L ⊢ break term 46 T1 ≈ break term 46 T2 )"
16    non associative with precedence 45
17    for @{ 'Hom $L $T1 $T2 }.
18
19 notation "hvbox( L ⊢ break 𝐇𝐑 ⦃ term 46 T ⦄ )"
20    non associative with precedence 45
21    for @{ 'HdReducible $L $T }.
22
23 notation "hvbox( L ⊢ break 𝐇𝐈 ⦃ term 46 T ⦄ )"
24    non associative with precedence 45
25    for @{ 'NotHdReducible $L $T }.
26
27 include "basic_2/grammar/term_simple.ma".
28
29 (* SAME HEAD TERM FORMS *****************************************************)
30
31 inductive tshf: relation term ≝
32    | tshf_atom: ∀I. tshf (⓪{I}) (⓪{I})
33    | tshf_abbr: ∀V1,V2,T1,T2. tshf (-ⓓV1. T1) (-ⓓV2. T2)
34    | tshf_abst: ∀a,V1,V2,T1,T2. tshf (ⓛ{a}V1. T1) (ⓛ{a}V2. T2)
35    | tshf_appl: ∀V1,V2,T1,T2. tshf T1 T2 → 𝐒⦃T1⦄ → 𝐒⦃T2⦄ →
36                 tshf (ⓐV1. T1) (ⓐV2. T2)
37 .
38
39 interpretation "same head form (term)" 'napart T1 T2 = (tshf T1 T2).
40
41 (* Basic properties *********************************************************)
42
43 lemma tshf_sym: ∀T1,T2. T1 ≈ T2 → T2 ≈ T1.
44 #T1 #T2 #H elim H -T1 -T2 /2 width=1/
45 qed.
46
47 lemma tshf_refl2: ∀T1,T2. T1 ≈ T2 → T2 ≈ T2.
48 #T1 #T2 #H elim H -T1 -T2 // /2 width=1/
49 qed.
50
51 lemma tshf_refl1: ∀T1,T2. T1 ≈ T2 → T1 ≈ T1.
52 /3 width=2/ qed.
53
54 lemma simple_tshf_repl_dx: ∀T1,T2. T1 ≈ T2 → 𝐒⦃T1⦄ → 𝐒⦃T2⦄.
55 #T1 #T2 #H elim H -T1 -T2 //
56 [ #V1 #V2 #T1 #T2 #H
57   elim (simple_inv_bind … H)
58 | #a #V1 #V2 #T1 #T2 #H
59   elim (simple_inv_bind … H)
60 ]
61 qed. (**) (* remove from index *)
62
63 lemma simple_tshf_repl_sn: ∀T1,T2. T1 ≈ T2 → 𝐒⦃T2⦄ → 𝐒⦃T1⦄.
64 /3 width=3/ qed-.
65
66 (* Basic inversion lemmas ***************************************************)
67
68 fact tshf_inv_bind1_aux: ∀T1,T2. T1 ≈ T2 → ∀a,I,W1,U1. T1 = ⓑ{a,I}W1.U1 →
69                          ∃∃W2,U2. T2 = ⓑ{a,I}W2. U2 &
70                                   (Bind2 a I = Bind2 false Abbr ∨ I = Abst).
71 #T1 #T2 * -T1 -T2
72 [ #J #a #I #W1 #U1 #H destruct
73 | #V1 #V2 #T1 #T2 #a #I #W1 #U1 #H destruct /3 width=3/
74 | #b #V1 #V2 #T1 #T2 #a #I #W1 #U1 #H destruct /3 width=3/
75 | #V1 #V2 #T1 #T2 #_ #_ #_ #a #I #W1 #U1 #H destruct
76 ]
77 qed.
78
79 lemma tshf_inv_bind1: ∀a,I,W1,U1,T2. ⓑ{a,I}W1.U1 ≈ T2 →
80                       ∃∃W2,U2. T2 = ⓑ{a,I}W2. U2 &
81                                (Bind2 a I = Bind2 false Abbr ∨ I = Abst).
82 /2 width=5/ qed-.
83
84 fact tshf_inv_flat1_aux: ∀T1,T2. T1 ≈ T2 → ∀I,W1,U1. T1 = ⓕ{I}W1.U1 →
85                          ∃∃W2,U2. U1 ≈ U2 & 𝐒⦃U1⦄ & 𝐒⦃U2⦄ &
86                                   I = Appl & T2 = ⓐW2. U2.
87 #T1 #T2 * -T1 -T2
88 [ #J #I #W1 #U1 #H destruct
89 | #V1 #V2 #T1 #T2 #I #W1 #U1 #H destruct
90 | #a #V1 #V2 #T1 #T2 #I #W1 #U1 #H destruct
91 | #V1 #V2 #T1 #T2 #HT12 #HT1 #HT2 #I #W1 #U1 #H destruct /2 width=5/
92 ]
93 qed.
94
95 lemma tshf_inv_flat1: ∀I,W1,U1,T2. ⓕ{I}W1.U1 ≈ T2 →
96                       ∃∃W2,U2. U1 ≈ U2 & 𝐒⦃U1⦄ & 𝐒⦃U2⦄ &
97                                I = Appl & T2 = ⓐW2. U2.
98 /2 width=4/ qed-.