-
Notifications
You must be signed in to change notification settings - Fork 0
/
sigma_lift.v
363 lines (309 loc) · 13.3 KB
/
sigma_lift.v
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
(* Contribution to the Coq Library V6.3 (July 1999) *)
(****************************************************************************)
(* The Calculus of Inductive Constructions *)
(* *)
(* Projet Coq *)
(* *)
(* INRIA ENS-CNRS *)
(* Rocquencourt Lyon *)
(* *)
(* Coq V5.10 *)
(* Nov 25th 1994 *)
(* *)
(****************************************************************************)
(* sigma_lift.v *)
(****************************************************************************)
(*****************************************************************************)
(* Projet Coq - Calculus of Inductive Constructions V5.8 *)
(*****************************************************************************)
(* *)
(* Meta-theory of the explicit substitution calculus lambda-env *)
(* Amokrane Saibi *)
(* *)
(* September 1993 *)
(* *)
(*****************************************************************************)
(* Systeme sigma-lift *)
Require Import TS.
Require Import sur_les_relations.
(* regles de reecriture *)
Inductive reg_app : terms -> terms -> Prop :=
reg1_app :
forall (a b : terms) (s : sub_explicits),
reg_app (env (app a b) s) (app (env a s) (env b s)).
Hint Resolve reg1_app.
Inductive reg_lambda : terms -> terms -> Prop :=
reg1_lambda :
forall (a : terms) (s : sub_explicits),
reg_lambda (env (lambda a) s) (lambda (env a (lift s))).
Hint Resolve reg1_lambda.
Inductive reg_clos : terms -> terms -> Prop :=
reg1_clos :
forall (a : terms) (s t : sub_explicits),
reg_clos (env (env a s) t) (env a (comp s t)).
Hint Resolve reg1_clos.
Inductive reg_varshift1 : terms -> terms -> Prop :=
reg1_varshift1 :
forall n : nat, reg_varshift1 (env (var n) shift) (var (S n)).
Hint Resolve reg1_varshift1.
Inductive reg_varshift2 : terms -> terms -> Prop :=
reg1_varshift2 :
forall (n : nat) (s : sub_explicits),
reg_varshift2 (env (var n) (comp shift s)) (env (var (S n)) s).
Hint Resolve reg1_varshift2.
Inductive reg_fvarcons : terms -> terms -> Prop :=
reg1_fvarcons :
forall (a : terms) (s : sub_explicits),
reg_fvarcons (env (var 0) (cons a s)) a.
Hint Resolve reg1_fvarcons.
Inductive reg_fvarlift1 : terms -> terms -> Prop :=
reg1_fvarlift1 :
forall s : sub_explicits, reg_fvarlift1 (env (var 0) (lift s)) (var 0).
Hint Resolve reg1_fvarlift1.
Inductive reg_fvarlift2 : terms -> terms -> Prop :=
reg1_fvarlift2 :
forall s t : sub_explicits,
reg_fvarlift2 (env (var 0) (comp (lift s) t)) (env (var 0) t).
Hint Resolve reg1_fvarlift2.
Inductive reg_rvarcons : terms -> terms -> Prop :=
reg1_rvarcons :
forall (n : nat) (a : terms) (s : sub_explicits),
reg_rvarcons (env (var (S n)) (cons a s)) (env (var n) s).
Hint Resolve reg1_rvarcons.
Inductive reg_rvarlift1 : terms -> terms -> Prop :=
reg1_rvarlift1 :
forall (n : nat) (s : sub_explicits),
reg_rvarlift1 (env (var (S n)) (lift s)) (env (var n) (comp s shift)).
Hint Resolve reg1_rvarlift1.
Inductive reg_rvarlift2 : terms -> terms -> Prop :=
reg1_rvarlift2 :
forall (n : nat) (s t : sub_explicits),
reg_rvarlift2 (env (var (S n)) (comp (lift s) t))
(env (var n) (comp s (comp shift t))).
Hint Resolve reg1_rvarlift2.
Inductive reg_assenv : sub_explicits -> sub_explicits -> Prop :=
reg1_assenv :
forall s t u : sub_explicits,
reg_assenv (comp (comp s t) u) (comp s (comp t u)).
Hint Resolve reg1_assenv.
Inductive reg_mapenv : sub_explicits -> sub_explicits -> Prop :=
reg1_mapenv :
forall (a : terms) (s t : sub_explicits),
reg_mapenv (comp (cons a s) t) (cons (env a t) (comp s t)).
Hint Resolve reg1_mapenv.
Inductive reg_shiftcons : sub_explicits -> sub_explicits -> Prop :=
reg1_shiftcons :
forall (a : terms) (s : sub_explicits),
reg_shiftcons (comp shift (cons a s)) s.
Hint Resolve reg1_shiftcons.
Inductive reg_shiftlift1 : sub_explicits -> sub_explicits -> Prop :=
reg1_shiftlift1 :
forall s : sub_explicits,
reg_shiftlift1 (comp shift (lift s)) (comp s shift).
Hint Resolve reg1_shiftlift1.
Inductive reg_shiftlift2 : sub_explicits -> sub_explicits -> Prop :=
reg1_shiftlift2 :
forall s t : sub_explicits,
reg_shiftlift2 (comp shift (comp (lift s) t)) (comp s (comp shift t)).
Hint Resolve reg1_shiftlift2.
Inductive reg_lift1 : sub_explicits -> sub_explicits -> Prop :=
reg1_lift1 :
forall s t : sub_explicits,
reg_lift1 (comp (lift s) (lift t)) (lift (comp s t)).
Hint Resolve reg1_lift1.
Inductive reg_lift2 : sub_explicits -> sub_explicits -> Prop :=
reg1_lift2 :
forall s t u : sub_explicits,
reg_lift2 (comp (lift s) (comp (lift t) u)) (comp (lift (comp s t)) u).
Hint Resolve reg1_lift2.
Inductive reg_liftenv : sub_explicits -> sub_explicits -> Prop :=
reg1_liftenv :
forall (a : terms) (s t : sub_explicits),
reg_liftenv (comp (lift s) (cons a t)) (cons a (comp s t)).
Hint Resolve reg1_liftenv.
Inductive reg_idl : sub_explicits -> sub_explicits -> Prop :=
reg1_idl : forall s : sub_explicits, reg_idl (comp id s) s.
Hint Resolve reg1_idl.
Inductive reg_idr : sub_explicits -> sub_explicits -> Prop :=
reg1_idr : forall s : sub_explicits, reg_idr (comp s id) s.
Hint Resolve reg1_idr.
Inductive reg_liftid : sub_explicits -> sub_explicits -> Prop :=
reg1_liftid : reg_liftid (lift id) id.
Hint Resolve reg1_liftid.
Inductive reg_id : terms -> terms -> Prop :=
reg1_id : forall a : terms, reg_id (env a id) a.
Hint Resolve reg1_id.
(* systeme sigma-lift *)
Inductive e_systemSL : forall b : wsort, TS b -> TS b -> Prop :=
| regle_app : forall a b : terms, reg_app a b -> e_systemSL wt a b
| regle_lambda : forall a b : terms, reg_lambda a b -> e_systemSL wt a b
| regle_clos : forall a b : terms, reg_clos a b -> e_systemSL wt a b
| regle_varshift1 :
forall a b : terms, reg_varshift1 a b -> e_systemSL wt a b
| regle_varshift2 :
forall a b : terms, reg_varshift2 a b -> e_systemSL wt a b
| regle_fvarcons :
forall a b : terms, reg_fvarcons a b -> e_systemSL wt a b
| regle_fvarlift1 :
forall a b : terms, reg_fvarlift1 a b -> e_systemSL wt a b
| regle_fvarlift2 :
forall a b : terms, reg_fvarlift2 a b -> e_systemSL wt a b
| regle_rvarcons :
forall a b : terms, reg_rvarcons a b -> e_systemSL wt a b
| regle_rvarlift1 :
forall a b : terms, reg_rvarlift1 a b -> e_systemSL wt a b
| regle_rvarlift2 :
forall a b : terms, reg_rvarlift2 a b -> e_systemSL wt a b
| regle_assenv :
forall s t : sub_explicits, reg_assenv s t -> e_systemSL ws s t
| regle_mapenv :
forall s t : sub_explicits, reg_mapenv s t -> e_systemSL ws s t
| regle_shiftcons :
forall s t : sub_explicits, reg_shiftcons s t -> e_systemSL ws s t
| regle_shiftlift1 :
forall s t : sub_explicits, reg_shiftlift1 s t -> e_systemSL ws s t
| regle_shiftlift2 :
forall s t : sub_explicits, reg_shiftlift2 s t -> e_systemSL ws s t
| regle_lift1 :
forall s t : sub_explicits, reg_lift1 s t -> e_systemSL ws s t
| regle_lift2 :
forall s t : sub_explicits, reg_lift2 s t -> e_systemSL ws s t
| regle_liftenv :
forall s t : sub_explicits, reg_liftenv s t -> e_systemSL ws s t
| regle_idl : forall s t : sub_explicits, reg_idl s t -> e_systemSL ws s t
| regle_idr : forall s t : sub_explicits, reg_idr s t -> e_systemSL ws s t
| regle_liftid :
forall s t : sub_explicits, reg_liftid s t -> e_systemSL ws s t
| regle_id : forall a b : terms, reg_id a b -> e_systemSL wt a b.
Notation systemSL := (e_systemSL _) (only parsing).
(* <Warning> : Syntax is discontinued *)
Hint Resolve regle_app regle_lambda regle_clos regle_varshift1
regle_varshift2 regle_fvarcons regle_fvarlift1 regle_fvarlift2
regle_rvarcons regle_rvarlift1 regle_rvarlift2 regle_assenv regle_mapenv
regle_shiftcons regle_shiftlift1 regle_shiftlift2 regle_lift1 regle_lift2
regle_liftenv regle_idl regle_idr regle_liftid regle_id.
(* relation engendree par le systeme sigma-lift *)
Inductive e_relSL : forall b : wsort, TS b -> TS b -> Prop :=
| SL_one_regle :
forall (b : wsort) (M N : TS b), e_systemSL _ M N -> e_relSL b M N
| SL_context_app_l :
forall a a' b : terms,
e_relSL wt a a' -> e_relSL wt (app a b) (app a' b)
| SL_context_app_r :
forall a b b' : terms,
e_relSL wt b b' -> e_relSL wt (app a b) (app a b')
| SL_context_lambda :
forall a a' : terms,
e_relSL wt a a' -> e_relSL wt (lambda a) (lambda a')
| SL_context_env_t :
forall (a a' : terms) (s : sub_explicits),
e_relSL wt a a' -> e_relSL wt (env a s) (env a' s)
| SL_context_env_s :
forall (a : terms) (s s' : sub_explicits),
e_relSL ws s s' -> e_relSL wt (env a s) (env a s')
| SL_context_cons_t :
forall (a a' : terms) (s : sub_explicits),
e_relSL wt a a' -> e_relSL ws (cons a s) (cons a' s)
| SL_context_cons_s :
forall (a : terms) (s s' : sub_explicits),
e_relSL ws s s' -> e_relSL ws (cons a s) (cons a s')
| SL_context_comp_l :
forall s s' t : sub_explicits,
e_relSL ws s s' -> e_relSL ws (comp s t) (comp s' t)
| SL_context_comp_r :
forall s t t' : sub_explicits,
e_relSL ws t t' -> e_relSL ws (comp s t) (comp s t')
| SL_context_lift :
forall s s' : sub_explicits,
e_relSL ws s s' -> e_relSL ws (lift s) (lift s').
Notation relSL := (e_relSL _) (only parsing).
(* <Warning> : Syntax is discontinued *)
Hint Resolve SL_one_regle SL_context_app_l SL_context_app_r SL_context_lambda
SL_context_env_t SL_context_env_s SL_context_cons_t SL_context_cons_s
SL_context_comp_l SL_context_comp_r SL_context_lift.
(* fermeture reflexive-transitive de la relation sigma-lift *)
Definition e_relSLstar (b : wsort) := explicit_star _ (e_relSL b).
Notation relSLstar := (e_relSLstar _) (only parsing).
(* <Warning> : Syntax is discontinued *)
Hint Unfold e_relSLstar.
(* *)
Goal
forall a a' b : terms,
e_relSLstar _ a a' -> e_relSLstar _ (app a b) (app a' b).
red in |- *; simple induction 1; intros.
auto.
apply star_trans1 with (app y b); auto.
Save SLstar_context_app_l.
Hint Resolve SLstar_context_app_l.
Goal
forall a b b' : terms,
e_relSLstar _ b b' -> e_relSLstar _ (app a b) (app a b').
red in |- *; simple induction 1; intros.
auto.
apply star_trans1 with (app a y); auto.
Save SLstar_context_app_r.
Hint Resolve SLstar_context_app_r.
Goal
forall a a' : terms,
e_relSLstar _ a a' -> e_relSLstar _ (lambda a) (lambda a').
red in |- *; simple induction 1; intros.
auto.
apply star_trans1 with (lambda y); auto.
Save SLstar_context_lambda.
Hint Resolve SLstar_context_lambda.
Goal
forall (a a' : terms) (s : sub_explicits),
e_relSLstar _ a a' -> e_relSLstar _ (env a s) (env a' s).
red in |- *; simple induction 1; intros.
auto.
apply star_trans1 with (env y s); auto.
Save SLstar_context_env_t.
Hint Resolve SLstar_context_env_t.
Goal
forall (a : terms) (s s' : sub_explicits),
e_relSLstar _ s s' -> e_relSLstar _ (env a s) (env a s').
red in |- *; simple induction 1; intros.
auto.
apply star_trans1 with (env a y); auto.
Save SLstar_context_env_s.
Hint Resolve SLstar_context_env_s.
Goal
forall (a a' : terms) (s : sub_explicits),
e_relSLstar _ a a' -> e_relSLstar _ (cons a s) (cons a' s).
red in |- *; simple induction 1; intros.
auto.
apply star_trans1 with (cons y s); auto.
Save SLstar_context_cons_t.
Hint Resolve SLstar_context_cons_t.
Goal
forall (a : terms) (s s' : sub_explicits),
e_relSLstar _ s s' -> e_relSLstar _ (cons a s) (cons a s').
red in |- *; simple induction 1; intros.
auto.
apply star_trans1 with (cons a y); auto.
Save SLstar_context_cons_s.
Hint Resolve SLstar_context_cons_s.
Goal
forall s s' t : sub_explicits,
e_relSLstar _ s s' -> e_relSLstar _ (comp s t) (comp s' t).
red in |- *; simple induction 1; intros.
auto.
apply star_trans1 with (comp y t); auto.
Save SLstar_context_comp_l.
Hint Resolve SLstar_context_comp_l.
Goal
forall s t t' : sub_explicits,
e_relSLstar _ t t' -> e_relSLstar _ (comp s t) (comp s t').
red in |- *; simple induction 1; intros.
auto.
apply star_trans1 with (comp s y); auto.
Save SLstar_context_comp_r.
Hint Resolve SLstar_context_comp_r.
Goal
forall s s' : sub_explicits,
e_relSLstar _ s s' -> e_relSLstar _ (lift s) (lift s').
red in |- *; simple induction 1; intros.
auto.
apply star_trans1 with (lift y); auto.
Save SLstar_context_lift.
Hint Resolve SLstar_context_lift.