-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathITyping.v
453 lines (390 loc) · 14 KB
/
ITyping.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
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
From Coq Require Import Bool String List BinPos Compare_dec Lia Arith.
From Equations Require Import Equations.
From Translation
Require Import util Sorts SAst SLiftSubst SCommon Equality.
Import ListNotations.
Open Scope s_scope.
(*! Typing *)
Declare Scope i_scope.
Section ITyping.
Context `{Sort_notion : Sorts.notion}.
Reserved Notation " Σ ;;; Γ '|-i' t : T " (at level 50, Γ, t, T at next level).
Inductive typing (Σ : sglobal_context) : scontext -> sterm -> sterm -> Prop :=
| type_Rel Γ n :
wf Σ Γ ->
forall A,
nth_error Γ n = Some A ->
Σ ;;; Γ |-i (sRel n) : lift0 (S n) A
| type_Sort Γ s :
wf Σ Γ ->
Σ ;;; Γ |-i (sSort s) : sSort (Sorts.succ s)
| type_Prod Γ n t b s1 s2 :
Σ ;;; Γ |-i t : sSort s1 ->
Σ ;;; Γ ,, t |-i b : sSort s2 ->
Σ ;;; Γ |-i (sProd n t b) : sSort (Sorts.prod_sort s1 s2)
| type_Lambda Γ n n' t b s1 s2 bty :
Σ ;;; Γ |-i t : sSort s1 ->
Σ ;;; Γ ,, t |-i bty : sSort s2 ->
Σ ;;; Γ ,, t |-i b : bty ->
Σ ;;; Γ |-i (sLambda n t bty b) : sProd n' t bty
| type_App Γ n s1 s2 t A B u :
Σ ;;; Γ |-i A : sSort s1 ->
Σ ;;; Γ ,, A |-i B : sSort s2 ->
Σ ;;; Γ |-i t : sProd n A B ->
Σ ;;; Γ |-i u : A ->
Σ ;;; Γ |-i (sApp t A B u) : B{ 0 := u }
| type_Sum Γ n t b s1 s2 :
Σ ;;; Γ |-i t : sSort s1 ->
Σ ;;; Γ ,, t |-i b : sSort s2 ->
Σ ;;; Γ |-i (sSum n t b) : sSort (Sorts.sum_sort s1 s2)
| type_Pair Γ n A B u v s1 s2 :
Σ ;;; Γ |-i A : sSort s1 ->
Σ ;;; Γ ,, A |-i B : sSort s2 ->
Σ ;;; Γ |-i u : A ->
Σ ;;; Γ |-i v : B{ 0 := u } ->
Σ ;;; Γ |-i sPair A B u v : sSum n A B
| type_Pi1 Γ n A B s1 s2 p :
Σ ;;; Γ |-i p : sSum n A B ->
Σ ;;; Γ |-i A : sSort s1 ->
Σ ;;; Γ ,, A |-i B : sSort s2 ->
Σ ;;; Γ |-i sPi1 A B p : A
| type_Pi2 Γ n A B s1 s2 p :
Σ ;;; Γ |-i p : sSum n A B ->
Σ ;;; Γ |-i A : sSort s1 ->
Σ ;;; Γ ,, A |-i B : sSort s2 ->
Σ ;;; Γ |-i sPi2 A B p : B{ 0 := sPi1 A B p }
| type_Eq Γ s A u v :
Σ ;;; Γ |-i A : sSort s ->
Σ ;;; Γ |-i u : A ->
Σ ;;; Γ |-i v : A ->
Σ ;;; Γ |-i sEq A u v : sSort (Sorts.eq_sort s)
| type_Refl Γ s A u :
Σ ;;; Γ |-i A : sSort s ->
Σ ;;; Γ |-i u : A ->
Σ ;;; Γ |-i sRefl A u : sEq A u u
| type_J Γ s1 s2 A u v P p w :
Σ ;;; Γ |-i A : sSort s1 ->
Σ ;;; Γ |-i u : A ->
Σ ;;; Γ |-i v : A ->
Σ ;;; Γ ,, A ,, (sEq (lift0 1 A) (lift0 1 u) (sRel 0)) |-i P : sSort s2 ->
Σ ;;; Γ |-i p : sEq A u v ->
Σ ;;; Γ |-i w : P{ 1 := u }{ 0 := sRefl A u } ->
Σ ;;; Γ |-i sJ A u P w v p : P{ 1 := v }{ 0 := p }
| type_Transport Γ s T1 T2 p t :
Σ ;;; Γ |-i T1 : sSort s ->
Σ ;;; Γ |-i T2 : sSort s ->
Σ ;;; Γ |-i p : sEq (sSort s) T1 T2 ->
Σ ;;; Γ |-i t : T1 ->
Σ ;;; Γ |-i sTransport T1 T2 p t : T2
| type_Beta Γ A B t u n s :
Σ ;;; Γ ,, A |-i t : B ->
Σ ;;; Γ |-i u : A ->
Σ ;;; Γ |-i A : sSort s ->
Σ ;;; Γ |-i sBeta t u : sEq (B{ 0 := u })
(sApp (sLambda n A B t) A B u)
(t{ 0 := u })
| type_Heq Γ A a B b s :
Σ ;;; Γ |-i A : sSort s ->
Σ ;;; Γ |-i B : sSort s ->
Σ ;;; Γ |-i a : A ->
Σ ;;; Γ |-i b : B ->
Σ ;;; Γ |-i sHeq A a B b : sSort (heq_sort s)
| type_HeqToEq Γ A u v p s :
Σ ;;; Γ |-i p : sHeq A u A v ->
Σ ;;; Γ |-i A : sSort s ->
Σ ;;; Γ |-i u : A ->
Σ ;;; Γ |-i v : A ->
Σ ;;; Γ |-i sHeqToEq p : sEq A u v
| type_HeqRefl Γ A a s :
Σ ;;; Γ |-i A : sSort s ->
Σ ;;; Γ |-i a : A ->
Σ ;;; Γ |-i sHeqRefl A a : sHeq A a A a
| type_HeqSym Γ A a B b p s :
Σ ;;; Γ |-i p : sHeq A a B b ->
Σ ;;; Γ |-i a : A ->
Σ ;;; Γ |-i b : B ->
Σ ;;; Γ |-i A : sSort s ->
Σ ;;; Γ |-i B : sSort s ->
Σ ;;; Γ |-i sHeqSym p : sHeq B b A a
| type_HeqTrans Γ A a B b C c p q s :
Σ ;;; Γ |-i p : sHeq A a B b ->
Σ ;;; Γ |-i q : sHeq B b C c ->
Σ ;;; Γ |-i a : A ->
Σ ;;; Γ |-i b : B ->
Σ ;;; Γ |-i c : C ->
Σ ;;; Γ |-i A : sSort s ->
Σ ;;; Γ |-i B : sSort s ->
Σ ;;; Γ |-i C : sSort s ->
Σ ;;; Γ |-i sHeqTrans p q : sHeq A a C c
| type_HeqTransport Γ A B p t s :
Σ ;;; Γ |-i p : sEq (sSort s) A B ->
Σ ;;; Γ |-i t : A ->
Σ ;;; Γ |-i A : sSort s ->
Σ ;;; Γ |-i B : sSort s ->
Σ ;;; Γ |-i sHeqTransport p t : sHeq A t B (sTransport A B p t)
| type_CongProd Γ s z nx ny A1 A2 B1 B2 pA pB :
Σ ;;; Γ |-i pA : sHeq (sSort s) A1 (sSort s) A2 ->
Σ ;;; Γ ,, (sPack A1 A2)
|-i pB : sHeq (sSort z) ((lift 1 1 B1){ 0 := sProjT1 (sRel 0) })
(sSort z) ((lift 1 1 B2){ 0 := sProjT2 (sRel 0) }) ->
Σ ;;; Γ |-i A1 : sSort s ->
Σ ;;; Γ |-i A2 : sSort s ->
Σ ;;; Γ ,, A1 |-i B1 : sSort z ->
Σ ;;; Γ ,, A2 |-i B2 : sSort z ->
Σ ;;; Γ |-i sCongProd B1 B2 pA pB :
sHeq (sSort (Sorts.prod_sort s z)) (sProd nx A1 B1)
(sSort (Sorts.prod_sort s z)) (sProd ny A2 B2)
| type_CongLambda Γ s z nx ny A1 A2 B1 B2 t1 t2 pA pB pt :
Σ ;;; Γ |-i pA : sHeq (sSort s) A1 (sSort s) A2 ->
Σ ;;; Γ ,, (sPack A1 A2)
|-i pB : sHeq (sSort z) ((lift 1 1 B1){ 0 := sProjT1 (sRel 0) })
(sSort z) ((lift 1 1 B2){ 0 := sProjT2 (sRel 0) }) ->
Σ ;;; Γ ,, (sPack A1 A2)
|-i pt : sHeq ((lift 1 1 B1){ 0 := sProjT1 (sRel 0) })
((lift 1 1 t1){ 0 := sProjT1 (sRel 0) })
((lift 1 1 B2){ 0 := sProjT2 (sRel 0) })
((lift 1 1 t2){ 0 := sProjT2 (sRel 0) }) ->
Σ ;;; Γ |-i A1 : sSort s ->
Σ ;;; Γ |-i A2 : sSort s ->
Σ ;;; Γ ,, A1 |-i B1 : sSort z ->
Σ ;;; Γ ,, A2 |-i B2 : sSort z ->
Σ ;;; Γ ,, A1 |-i t1 : B1 ->
Σ ;;; Γ ,, A2 |-i t2 : B2 ->
Σ ;;; Γ |-i sCongLambda B1 B2 t1 t2 pA pB pt :
sHeq (sProd nx A1 B1) (sLambda nx A1 B1 t1)
(sProd ny A2 B2) (sLambda ny A2 B2 t2)
| type_CongApp Γ s z nx ny A1 A2 B1 B2 u1 u2 v1 v2 pA pB pu pv :
Σ ;;; Γ |-i pA : sHeq (sSort s) A1 (sSort s) A2 ->
Σ ;;; Γ ,, (sPack A1 A2)
|-i pB : sHeq (sSort z) ((lift 1 1 B1){ 0 := sProjT1 (sRel 0) })
(sSort z) ((lift 1 1 B2){ 0 := sProjT2 (sRel 0) }) ->
Σ ;;; Γ |-i pu : sHeq (sProd nx A1 B1) u1 (sProd ny A2 B2) u2 ->
Σ ;;; Γ |-i pv : sHeq A1 v1 A2 v2 ->
Σ ;;; Γ |-i A1 : sSort s ->
Σ ;;; Γ |-i A2 : sSort s ->
Σ ;;; Γ ,, A1 |-i B1 : sSort z ->
Σ ;;; Γ ,, A2 |-i B2 : sSort z ->
Σ ;;; Γ |-i u1 : sProd nx A1 B1 ->
Σ ;;; Γ |-i u2 : sProd ny A2 B2 ->
Σ ;;; Γ |-i v1 : A1 ->
Σ ;;; Γ |-i v2 : A2 ->
Σ ;;; Γ |-i sCongApp B1 B2 pu pA pB pv :
sHeq (B1{0 := v1}) (sApp u1 A1 B1 v1)
(B2{0 := v2}) (sApp u2 A2 B2 v2)
| type_CongSum Γ s z nx ny A1 A2 B1 B2 pA pB :
Σ ;;; Γ |-i pA : sHeq (sSort s) A1 (sSort s) A2 ->
Σ ;;; Γ ,, (sPack A1 A2)
|-i pB : sHeq (sSort z) ((lift 1 1 B1){ 0 := sProjT1 (sRel 0) })
(sSort z) ((lift 1 1 B2){ 0 := sProjT2 (sRel 0) }) ->
Σ ;;; Γ |-i A1 : sSort s ->
Σ ;;; Γ |-i A2 : sSort s ->
Σ ;;; Γ ,, A1 |-i B1 : sSort z ->
Σ ;;; Γ ,, A2 |-i B2 : sSort z ->
Σ ;;; Γ |-i sCongSum B1 B2 pA pB :
sHeq (sSort (Sorts.sum_sort s z)) (sSum nx A1 B1)
(sSort (Sorts.sum_sort s z)) (sSum ny A2 B2)
| type_CongPair Γ s z nx ny A1 A2 B1 B2 u1 u2 v1 v2 pA pB pu pv :
Σ ;;; Γ |-i pA : sHeq (sSort s) A1 (sSort s) A2 ->
Σ ;;; Γ ,, (sPack A1 A2)
|-i pB : sHeq (sSort z) ((lift 1 1 B1){ 0 := sProjT1 (sRel 0) })
(sSort z) ((lift 1 1 B2){ 0 := sProjT2 (sRel 0) }) ->
Σ ;;; Γ |-i pu : sHeq A1 u1 A2 u2 ->
Σ ;;; Γ |-i pv : sHeq (B1{ 0 := u1 }) v1 (B2{ 0 := u2 }) v2 ->
Σ ;;; Γ |-i A1 : sSort s ->
Σ ;;; Γ |-i A2 : sSort s ->
Σ ;;; Γ ,, A1 |-i B1 : sSort z ->
Σ ;;; Γ ,, A2 |-i B2 : sSort z ->
Σ ;;; Γ |-i u1 : A1 ->
Σ ;;; Γ |-i u2 : A2 ->
Σ ;;; Γ |-i v1 : B1{ 0 := u1 } ->
Σ ;;; Γ |-i v2 : B2{ 0 := u2 } ->
Σ ;;; Γ |-i sCongPair B1 B2 pA pB pu pv :
sHeq (sSum nx A1 B1) (sPair A1 B1 u1 v1)
(sSum ny A2 B2) (sPair A2 B2 u2 v2)
| type_CongPi1 Γ s z nx ny A1 A2 B1 B2 p1 p2 pA pB pp :
Σ ;;; Γ |-i pA : sHeq (sSort s) A1 (sSort s) A2 ->
Σ ;;; Γ ,, (sPack A1 A2)
|-i pB : sHeq (sSort z) ((lift 1 1 B1){ 0 := sProjT1 (sRel 0) })
(sSort z) ((lift 1 1 B2){ 0 := sProjT2 (sRel 0) }) ->
Σ ;;; Γ |-i pp : sHeq (sSum nx A1 B1) p1 (sSum ny A2 B2) p2 ->
Σ ;;; Γ |-i A1 : sSort s ->
Σ ;;; Γ |-i A2 : sSort s ->
Σ ;;; Γ ,, A1 |-i B1 : sSort z ->
Σ ;;; Γ ,, A2 |-i B2 : sSort z ->
Σ ;;; Γ |-i p1 : sSum nx A1 B1 ->
Σ ;;; Γ |-i p2 : sSum ny A2 B2 ->
Σ ;;; Γ |-i sCongPi1 B1 B2 pA pB pp : sHeq A1 (sPi1 A1 B1 p1)
A2 (sPi1 A2 B2 p2)
| type_CongPi2 Γ s z nx ny A1 A2 B1 B2 p1 p2 pA pB pp :
Σ ;;; Γ |-i pA : sHeq (sSort s) A1 (sSort s) A2 ->
Σ ;;; Γ ,, (sPack A1 A2)
|-i pB : sHeq (sSort z) ((lift 1 1 B1){ 0 := sProjT1 (sRel 0) })
(sSort z) ((lift 1 1 B2){ 0 := sProjT2 (sRel 0) }) ->
Σ ;;; Γ |-i pp : sHeq (sSum nx A1 B1) p1 (sSum ny A2 B2) p2 ->
Σ ;;; Γ |-i A1 : sSort s ->
Σ ;;; Γ |-i A2 : sSort s ->
Σ ;;; Γ ,, A1 |-i B1 : sSort z ->
Σ ;;; Γ ,, A2 |-i B2 : sSort z ->
Σ ;;; Γ |-i p1 : sSum nx A1 B1 ->
Σ ;;; Γ |-i p2 : sSum ny A2 B2 ->
Σ ;;; Γ |-i sCongPi2 B1 B2 pA pB pp :
sHeq (B1{ 0 := sPi1 A1 B1 p1}) (sPi2 A1 B1 p1)
(B2{ 0 := sPi1 A2 B2 p2}) (sPi2 A2 B2 p2)
| type_CongEq Γ s A1 A2 u1 u2 v1 v2 pA pu pv :
Σ ;;; Γ |-i pA : sHeq (sSort s) A1 (sSort s) A2 ->
Σ ;;; Γ |-i pu : sHeq A1 u1 A2 u2 ->
Σ ;;; Γ |-i pv : sHeq A1 v1 A2 v2 ->
Σ ;;; Γ |-i A1 : sSort s ->
Σ ;;; Γ |-i A2 : sSort s ->
Σ ;;; Γ |-i u1 : A1 ->
Σ ;;; Γ |-i u2 : A2 ->
Σ ;;; Γ |-i v1 : A1 ->
Σ ;;; Γ |-i v2 : A2 ->
Σ ;;; Γ |-i sCongEq pA pu pv :
sHeq (sSort (Sorts.eq_sort s)) (sEq A1 u1 v1)
(sSort (Sorts.eq_sort s)) (sEq A2 u2 v2)
| type_CongRefl Γ s A1 A2 u1 u2 pA pu :
Σ ;;; Γ |-i pA : sHeq (sSort s) A1 (sSort s) A2 ->
Σ ;;; Γ |-i pu : sHeq A1 u1 A2 u2 ->
Σ ;;; Γ |-i A1 : sSort s ->
Σ ;;; Γ |-i A2 : sSort s ->
Σ ;;; Γ |-i u1 : A1 ->
Σ ;;; Γ |-i u2 : A2 ->
Σ ;;; Γ |-i sCongRefl pA pu :
sHeq (sEq A1 u1 u1) (sRefl A1 u1) (sEq A2 u2 u2) (sRefl A2 u2)
| type_EqToHeq Γ A u v p s :
Σ ;;; Γ |-i p : sEq A u v ->
Σ ;;; Γ |-i A : sSort s ->
Σ ;;; Γ |-i u : A ->
Σ ;;; Γ |-i v : A ->
Σ ;;; Γ |-i sEqToHeq p : sHeq A u A v
| type_HeqTypeEq Γ A u B v p s :
Σ ;;; Γ |-i p : sHeq A u B v ->
Σ ;;; Γ |-i A : sSort s ->
Σ ;;; Γ |-i B : sSort s ->
Σ ;;; Γ |-i u : A ->
Σ ;;; Γ |-i v : B ->
Σ ;;; Γ |-i sHeqTypeEq A B p : sEq (sSort s) A B
| type_Pack Γ A1 A2 s :
Σ ;;; Γ |-i A1 : sSort s ->
Σ ;;; Γ |-i A2 : sSort s ->
Σ ;;; Γ |-i sPack A1 A2 : sSort (pack_sort s)
| type_ProjT1 Γ A1 A2 p s :
Σ ;;; Γ |-i p : sPack A1 A2 ->
Σ ;;; Γ |-i A1 : sSort s ->
Σ ;;; Γ |-i A2 : sSort s ->
Σ ;;; Γ |-i sProjT1 p : A1
| type_ProjT2 Γ A1 A2 p s :
Σ ;;; Γ |-i p : sPack A1 A2 ->
Σ ;;; Γ |-i A1 : sSort s ->
Σ ;;; Γ |-i A2 : sSort s ->
Σ ;;; Γ |-i sProjT2 p : A2
| type_ProjTe Γ A1 A2 p s :
Σ ;;; Γ |-i p : sPack A1 A2 ->
Σ ;;; Γ |-i A1 : sSort s ->
Σ ;;; Γ |-i A2 : sSort s ->
Σ ;;; Γ |-i sProjTe p : sHeq A1 (sProjT1 p) A2 (sProjT2 p)
| type_Ax Γ id ty :
wf Σ Γ ->
lookup_glob Σ id = Some ty ->
Σ ;;; Γ |-i sAx id : ty
| type_rename Γ t A B :
Σ ;;; Γ |-i t : A ->
nl A = nl B ->
Σ ;;; Γ |-i t : B
where " Σ ;;; Γ '|-i' t : T " := (@typing Σ Γ t T) : i_scope
with wf (Σ : sglobal_context) : scontext -> Prop :=
| wf_nil :
wf Σ nil
| wf_snoc s Γ A :
wf Σ Γ ->
Σ ;;; Γ |-i A : sSort s ->
wf Σ (Γ ,, A)
.
End ITyping.
Notation " Σ ;;; Γ '|-i' t : T " :=
(@typing _ Σ Γ t T) (at level 50, Γ, t, T at next level) : i_scope.
Derive Signature for typing.
Derive Signature for wf.
Delimit Scope i_scope with i.
(* Syntactic restriction.
We define the notion of ETT compatibility to restrict the syntax
to the one that is allowed in ETT.
[TODO Move?]
*)
Section Xcomp.
Context `{Sort_notion : Sorts.notion}.
Inductive Xcomp : sterm -> Type :=
| xcomp_Rel n : Xcomp (sRel n)
| xcomp_Sort s : Xcomp (sSort s)
| xcomp_Prod na A B :
Xcomp A ->
Xcomp B ->
Xcomp (sProd na A B)
| xcomp_Lambda na A B t :
Xcomp A ->
Xcomp B ->
Xcomp t ->
Xcomp (sLambda na A B t)
| xcomp_App u A B v :
Xcomp u ->
Xcomp A ->
Xcomp B ->
Xcomp v ->
Xcomp (sApp u A B v)
| xcomp_Sum na A B :
Xcomp A ->
Xcomp B ->
Xcomp (sSum na A B)
| xcomp_Pair A B u v :
Xcomp A ->
Xcomp B ->
Xcomp u ->
Xcomp v ->
Xcomp (sPair A B u v)
| xcomp_Pi1 A B p :
Xcomp A ->
Xcomp B ->
Xcomp p ->
Xcomp (sPi1 A B p)
| xcomp_Pi2 A B p :
Xcomp A ->
Xcomp B ->
Xcomp p ->
Xcomp (sPi2 A B p)
| xcomp_Eq A u v :
Xcomp A ->
Xcomp u ->
Xcomp v ->
Xcomp (sEq A u v)
| xcomp_Refl A u :
Xcomp A ->
Xcomp u ->
Xcomp (sRefl A u)
| xcomp_Ax id :
Xcomp (sAx id)
.
End Xcomp.
Derive Signature for Xcomp.
Section Global.
Context `{Sort_notion : Sorts.notion}.
Open Scope i_scope.
Definition isType (Σ : sglobal_context) (Γ : scontext) (t : sterm) :=
exists s, Σ ;;; Γ |-i t : sSort s.
Inductive fresh_glob (id : ident) : sglobal_context -> Prop :=
| fresh_glob_nil : fresh_glob id []
| fresh_glob_cons Σ d :
fresh_glob id Σ ->
(dname d) <> id ->
fresh_glob id (d :: Σ).
Inductive type_glob : sglobal_context -> Type :=
| type_glob_nil : type_glob []
| type_glob_cons Σ d :
type_glob Σ ->
fresh_glob (dname d) Σ ->
isType Σ [] (dtype d) ->
Xcomp (dtype d) ->
type_glob (d :: Σ).
End Global.
Derive Signature for fresh_glob.
Derive Signature for type_glob.