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 include "basic_2/grammar/term_simple.ma".
17 (* SAME HEAD TERM FORMS *****************************************************)
19 inductive tshf: relation term ≝
20 | tshf_atom: ∀I. tshf (⓪{I}) (⓪{I})
21 | tshf_abst: ∀V1,V2,T1,T2. tshf (ⓛV1. T1) (ⓛV2. T2)
22 | tshf_appl: ∀V1,V2,T1,T2. tshf T1 T2 → 𝐒[T1] → 𝐒[T2] →
23 tshf (ⓐV1. T1) (ⓐV2. T2)
26 interpretation "same head form (term)" 'napart T1 T2 = (tshf T1 T2).
28 (* Basic properties *********************************************************)
30 lemma tshf_sym: ∀T1,T2. T1 ≈ T2 → T2 ≈ T1.
31 #T1 #T2 #H elim H -T1 -T2 /2 width=1/
34 lemma tshf_refl2: ∀T1,T2. T1 ≈ T2 → T2 ≈ T2.
35 #T1 #T2 #H elim H -T1 -T2 // /2 width=1/
38 lemma tshf_refl1: ∀T1,T2. T1 ≈ T2 → T1 ≈ T1.
41 lemma simple_tshf_repl_dx: ∀T1,T2. T1 ≈ T2 → 𝐒[T1] → 𝐒[T2].
42 #T1 #T2 #H elim H -T1 -T2 //
44 elim (simple_inv_bind … H)
45 qed. (**) (* remove from index *)
47 lemma simple_tshf_repl_sn: ∀T1,T2. T1 ≈ T2 → 𝐒[T2] → 𝐒[T1].
50 (* Basic inversion lemmas ***************************************************)
52 fact tshf_inv_bind1_aux: ∀T1,T2. T1 ≈ T2 → ∀I,W1,U1. T1 = ⓑ{I}W1.U1 →
53 ∃∃W2,U2. I = Abst & T2 = ⓛW2. U2.
55 [ #J #I #W1 #U1 #H destruct
56 | #V1 #V2 #T1 #T2 #I #W1 #U1 #H destruct /2 width=3/
57 | #V1 #V2 #T1 #T2 #H_ #_ #_ #I #W1 #U1 #H destruct
61 lemma tshf_inv_bind1: ∀I,W1,U1,T2. ⓑ{I}W1.U1 ≈ T2 →
62 ∃∃W2,U2. I = Abst & T2 = ⓛW2. U2.
65 fact tshf_inv_flat1_aux: ∀T1,T2. T1 ≈ T2 → ∀I,W1,U1. T1 = ⓕ{I}W1.U1 →
66 ∃∃W2,U2. U1 ≈ U2 & 𝐒[U1] & 𝐒[U2] &
67 I = Appl & T2 = ⓐW2. U2.
69 [ #J #I #W1 #U1 #H destruct
70 | #V1 #V2 #T1 #T2 #I #W1 #U1 #H destruct
71 | #V1 #V2 #T1 #T2 #HT12 #HT1 #HT2 #I #W1 #U1 #H destruct /2 width=5/
75 lemma tshf_inv_flat1: ∀I,W1,U1,T2. ⓕ{I}W1.U1 ≈ T2 →
76 ∃∃W2,U2. U1 ≈ U2 & 𝐒[U1] & 𝐒[U2] &
77 I = Appl & T2 = ⓐW2. U2.