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 TOP TERM CONSTRUCTOR ************************************************)
19 inductive tstc: relation term ≝
20 | tstc_atom: ∀I. tstc (⓪{I}) (⓪{I})
21 | tstc_pair: ∀I,V1,V2,T1,T2. tstc (②{I} V1. T1) (②{I} V2. T2)
24 interpretation "same top constructor (term)" 'Iso T1 T2 = (tstc T1 T2).
26 (* Basic inversion lemmas ***************************************************)
28 fact tstc_inv_atom1_aux: ∀T1,T2. T1 ≃ T2 → ∀I. T1 = ⓪{I} → T2 = ⓪{I}.
30 #J #V1 #V2 #T1 #T2 #I #H destruct
33 (* Basic_1: was: iso_gen_sort iso_gen_lref *)
34 lemma tstc_inv_atom1: ∀I,T2. ⓪{I} ≃ T2 → T2 = ⓪{I}.
37 fact tstc_inv_pair1_aux: ∀T1,T2. T1 ≃ T2 → ∀I,W1,U1. T1 = ②{I}W1.U1 →
38 ∃∃W2,U2. T2 = ②{I}W2. U2.
40 [ #J #I #W1 #U1 #H destruct
41 | #J #V1 #V2 #T1 #T2 #I #W1 #U1 #H destruct /2 width=3/
45 (* Basic_1: was: iso_gen_head *)
46 lemma tstc_inv_pair1: ∀I,W1,U1,T2. ②{I}W1.U1 ≃ T2 →
47 ∃∃W2,U2. T2 = ②{I}W2. U2.
50 fact tstc_inv_atom2_aux: ∀T1,T2. T1 ≃ T2 → ∀I. T2 = ⓪{I} → T1 = ⓪{I}.
52 #J #V1 #V2 #T1 #T2 #I #H destruct
55 lemma tstc_inv_atom2: ∀I,T1. T1 ≃ ⓪{I} → T1 = ⓪{I}.
58 fact tstc_inv_pair2_aux: ∀T1,T2. T1 ≃ T2 → ∀I,W2,U2. T2 = ②{I}W2.U2 →
59 ∃∃W1,U1. T1 = ②{I}W1. U1.
61 [ #J #I #W2 #U2 #H destruct
62 | #J #V1 #V2 #T1 #T2 #I #W2 #U2 #H destruct /2 width=3/
66 lemma tstc_inv_pair2: ∀I,T1,W2,U2. T1 ≃ ②{I}W2.U2 →
67 ∃∃W1,U1. T1 = ②{I}W1. U1.
70 (* Basic properties *********************************************************)
72 (* Basic_1: was: iso_refl *)
73 lemma tstc_refl: ∀T. T ≃ T.
77 lemma tstc_sym: ∀T1,T2. T1 ≃ T2 → T2 ≃ T1.
78 #T1 #T2 #H elim H -T1 -T2 //
81 lemma tstc_dec: ∀T1,T2. Decidable (T1 ≃ T2).
82 * #I1 [2: #V1 #T1 ] * #I2 [2,4: #V2 #T2 ]
83 [ elim (item2_eq_dec I1 I2) #HI12
84 [ destruct /2 width=1/
86 elim (tstc_inv_pair1 … H) -H #V #T #H destruct /2 width=1/
89 lapply (tstc_inv_atom1 … H) -H #H destruct
91 lapply (tstc_inv_atom2 … H) -H #H destruct
92 | elim (item0_eq_dec I1 I2) #HI12
93 [ destruct /2 width=1/
95 lapply (tstc_inv_atom2 … H) -H #H destruct /2 width=1/
100 lemma simple_tstc_repl_dx: ∀T1,T2. T1 ≃ T2 → 𝐒⦃T1⦄ → 𝐒⦃T2⦄.
102 #I #V1 #V2 #T1 #T2 #H
103 elim (simple_inv_pair … H) -H #J #H destruct //
104 qed. (**) (* remove from index *)
106 lemma simple_tstc_repl_sn: ∀T1,T2. T1 ≃ T2 → 𝐒⦃T2⦄ → 𝐒⦃T1⦄.