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/notation/relations/iso_2.ma".
16 include "basic_2/grammar/term_simple.ma".
18 (* SAME TOP TERM CONSTRUCTOR ************************************************)
20 inductive tstc: relation term ≝
21 | tstc_atom: ∀I. tstc (⓪{I}) (⓪{I})
22 | tstc_pair: ∀I,V1,V2,T1,T2. tstc (②{I} V1. T1) (②{I} V2. T2)
25 interpretation "same top constructor (term)" 'Iso T1 T2 = (tstc T1 T2).
27 (* Basic inversion lemmas ***************************************************)
29 fact tstc_inv_atom1_aux: ∀T1,T2. T1 ≃ T2 → ∀I. T1 = ⓪{I} → T2 = ⓪{I}.
31 #J #V1 #V2 #T1 #T2 #I #H destruct
34 (* Basic_1: was: iso_gen_sort iso_gen_lref *)
35 lemma tstc_inv_atom1: ∀I,T2. ⓪{I} ≃ T2 → T2 = ⓪{I}.
38 fact tstc_inv_pair1_aux: ∀T1,T2. T1 ≃ T2 → ∀I,W1,U1. T1 = ②{I}W1.U1 →
39 ∃∃W2,U2. T2 = ②{I}W2. U2.
41 [ #J #I #W1 #U1 #H destruct
42 | #J #V1 #V2 #T1 #T2 #I #W1 #U1 #H destruct /2 width=3/
46 (* Basic_1: was: iso_gen_head *)
47 lemma tstc_inv_pair1: ∀I,W1,U1,T2. ②{I}W1.U1 ≃ T2 →
48 ∃∃W2,U2. T2 = ②{I}W2. U2.
51 fact tstc_inv_atom2_aux: ∀T1,T2. T1 ≃ T2 → ∀I. T2 = ⓪{I} → T1 = ⓪{I}.
53 #J #V1 #V2 #T1 #T2 #I #H destruct
56 lemma tstc_inv_atom2: ∀I,T1. T1 ≃ ⓪{I} → T1 = ⓪{I}.
59 fact tstc_inv_pair2_aux: ∀T1,T2. T1 ≃ T2 → ∀I,W2,U2. T2 = ②{I}W2.U2 →
60 ∃∃W1,U1. T1 = ②{I}W1. U1.
62 [ #J #I #W2 #U2 #H destruct
63 | #J #V1 #V2 #T1 #T2 #I #W2 #U2 #H destruct /2 width=3/
67 lemma tstc_inv_pair2: ∀I,T1,W2,U2. T1 ≃ ②{I}W2.U2 →
68 ∃∃W1,U1. T1 = ②{I}W1. U1.
71 (* Basic properties *********************************************************)
73 (* Basic_1: was: iso_refl *)
74 lemma tstc_refl: ∀T. T ≃ T.
78 lemma tstc_sym: ∀T1,T2. T1 ≃ T2 → T2 ≃ T1.
79 #T1 #T2 #H elim H -T1 -T2 //
82 lemma tstc_dec: ∀T1,T2. Decidable (T1 ≃ T2).
83 * #I1 [2: #V1 #T1 ] * #I2 [2,4: #V2 #T2 ]
84 [ elim (eq_item2_dec I1 I2) #HI12
85 [ destruct /2 width=1/
87 elim (tstc_inv_pair1 … H) -H #V #T #H destruct /2 width=1/
90 lapply (tstc_inv_atom1 … H) -H #H destruct
92 lapply (tstc_inv_atom2 … H) -H #H destruct
93 | elim (eq_item0_dec I1 I2) #HI12
94 [ destruct /2 width=1/
96 lapply (tstc_inv_atom2 … H) -H #H destruct /2 width=1/
101 lemma simple_tstc_repl_dx: ∀T1,T2. T1 ≃ T2 → 𝐒⦃T1⦄ → 𝐒⦃T2⦄.
103 #I #V1 #V2 #T1 #T2 #H
104 elim (simple_inv_pair … H) -H #J #H destruct //
105 qed. (**) (* remove from index *)
107 lemma simple_tstc_repl_sn: ∀T1,T2. T1 ≃ T2 → 𝐒⦃T2⦄ → 𝐒⦃T1⦄.