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 notation "hvbox( L ⊢ break term 46 T1 ≈ break term 46 T2 )"
16 non associative with precedence 45
17 for @{ 'Hom $L $T1 $T2 }.
19 notation "hvbox( L ⊢ break 𝐇𝐑 ⦃ term 46 T ⦄ )"
20 non associative with precedence 45
21 for @{ 'HdReducible $L $T }.
23 notation "hvbox( L ⊢ break 𝐇𝐈 ⦃ term 46 T ⦄ )"
24 non associative with precedence 45
25 for @{ 'NotHdReducible $L $T }.
27 include "basic_2/grammar/term_simple.ma".
29 (* SAME HEAD TERM FORMS *****************************************************)
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)
39 interpretation "same head form (term)" 'napart T1 T2 = (tshf T1 T2).
41 (* Basic properties *********************************************************)
43 lemma tshf_sym: ∀T1,T2. T1 ≈ T2 → T2 ≈ T1.
44 #T1 #T2 #H elim H -T1 -T2 /2 width=1/
47 lemma tshf_refl2: ∀T1,T2. T1 ≈ T2 → T2 ≈ T2.
48 #T1 #T2 #H elim H -T1 -T2 // /2 width=1/
51 lemma tshf_refl1: ∀T1,T2. T1 ≈ T2 → T1 ≈ T1.
54 lemma simple_tshf_repl_dx: ∀T1,T2. T1 ≈ T2 → 𝐒⦃T1⦄ → 𝐒⦃T2⦄.
55 #T1 #T2 #H elim H -T1 -T2 //
57 elim (simple_inv_bind … H)
58 | #a #V1 #V2 #T1 #T2 #H
59 elim (simple_inv_bind … H)
61 qed. (**) (* remove from index *)
63 lemma simple_tshf_repl_sn: ∀T1,T2. T1 ≈ T2 → 𝐒⦃T2⦄ → 𝐒⦃T1⦄.
66 (* Basic inversion lemmas ***************************************************)
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).
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
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).
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.
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/
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.