-
Notifications
You must be signed in to change notification settings - Fork 28
/
stlc_small5k.v
7488 lines (5568 loc) · 232 KB
/
stlc_small5k.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
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
Definition Ty : Set
:= forall (Ty : Set)
(base : Ty)
(arr : Ty -> Ty -> Ty)
, Ty.
Definition base : Ty := fun _ base _ => base.
Definition arr : Ty -> Ty -> Ty
:= fun A B Ty base arr =>
arr (A Ty base arr) (B Ty base arr).
Definition Con : Set
:= forall (Con : Set)
(nil : Con)
(snoc : Con -> Ty -> Con)
, Con.
Definition nil : Con
:= fun Con nil snoc => nil.
Definition snoc : Con -> Ty -> Con
:= fun Γ A Con nil snoc => snoc (Γ Con nil snoc) A.
Definition Var : Con -> Ty -> Set
:= fun Γ A =>
forall (Var : Con -> Ty -> Set)
(vz : forall Γ A, Var (snoc Γ A) A)
(vs : forall Γ B A, Var Γ A -> Var (snoc Γ B) A)
, Var Γ A.
Definition vz {Γ A} : Var (snoc Γ A) A
:= fun Var vz vs => vz _ _.
Definition vs {Γ B A} : Var Γ A -> Var (snoc Γ B) A
:= fun x Var vz vs => vs _ _ _ (x Var vz vs).
Definition Tm : Con -> Ty -> Set
:= fun Γ A =>
forall (Tm : Con -> Ty -> Set)
(var : forall Γ A , Var Γ A -> Tm Γ A)
(lam : forall Γ A B , Tm (snoc Γ A) B -> Tm Γ (arr A B))
(app : forall Γ A B , Tm Γ (arr A B) -> Tm Γ A -> Tm Γ B)
, Tm Γ A.
Definition var {Γ A} : Var Γ A -> Tm Γ A
:= fun x Tm var lam app =>
var _ _ x.
Definition lam {Γ A B} : Tm (snoc Γ A) B -> Tm Γ (arr A B)
:= fun t Tm var lam app =>
lam _ _ _ (t Tm var lam app).
Definition app {Γ A B} : Tm Γ (arr A B) -> Tm Γ A -> Tm Γ B
:= fun t u Tm var lam app =>
app _ _ _
(t Tm var lam app)
(u Tm var lam app).
Definition v0 {Γ A} : Tm (snoc Γ A) A
:= var vz.
Definition v1 {Γ A B} : Tm (snoc (snoc Γ A) B) A
:= var (vs vz).
Definition v2 {Γ A B C} : Tm (snoc (snoc (snoc Γ A) B) C) A
:= var (vs (vs vz)).
Definition v3 {Γ A B C D} : Tm (snoc (snoc (snoc (snoc Γ A) B) C) D) A
:= var (vs (vs (vs vz))).
Definition v4 {Γ A B C D E} : Tm (snoc (snoc (snoc (snoc (snoc Γ A) B) C) D) E) A
:= var (vs (vs (vs (vs vz)))).
Definition test {Γ A} : Tm Γ (arr (arr A A) (arr A A))
:= lam (lam (app v1 (app v1 (app v1 (app v1 (app v1 (app v1 v0))))))).
Definition Ty1 : Set
:= forall (Ty1 : Set)
(base : Ty1)
(arr : Ty1 -> Ty1 -> Ty1)
, Ty1.
Definition base1 : Ty1 := fun _ base1 _ => base1.
Definition arr1 : Ty1 -> Ty1 -> Ty1
:= fun A B Ty1 base1 arr1 =>
arr1 (A Ty1 base1 arr1) (B Ty1 base1 arr1).
Definition Con1 : Set
:= forall (Con1 : Set)
(nil : Con1)
(snoc : Con1 -> Ty1 -> Con1)
, Con1.
Definition nil1 : Con1
:= fun Con1 nil1 snoc => nil1.
Definition snoc1 : Con1 -> Ty1 -> Con1
:= fun Γ A Con1 nil1 snoc1 => snoc1 (Γ Con1 nil1 snoc1) A.
Definition Var1 : Con1 -> Ty1 -> Set
:= fun Γ A =>
forall (Var1 : Con1 -> Ty1 -> Set)
(vz : forall Γ A, Var1 (snoc1 Γ A) A)
(vs : forall Γ B A, Var1 Γ A -> Var1 (snoc1 Γ B) A)
, Var1 Γ A.
Definition vz1 {Γ A} : Var1 (snoc1 Γ A) A
:= fun Var1 vz1 vs => vz1 _ _.
Definition vs1 {Γ B A} : Var1 Γ A -> Var1 (snoc1 Γ B) A
:= fun x Var1 vz1 vs1 => vs1 _ _ _ (x Var1 vz1 vs1).
Definition Tm1 : Con1 -> Ty1 -> Set
:= fun Γ A =>
forall (Tm1 : Con1 -> Ty1 -> Set)
(var : forall Γ A , Var1 Γ A -> Tm1 Γ A)
(lam : forall Γ A B , Tm1 (snoc1 Γ A) B -> Tm1 Γ (arr1 A B))
(app : forall Γ A B , Tm1 Γ (arr1 A B) -> Tm1 Γ A -> Tm1 Γ B)
, Tm1 Γ A.
Definition var1 {Γ A} : Var1 Γ A -> Tm1 Γ A
:= fun x Tm1 var1 lam app =>
var1 _ _ x.
Definition lam1 {Γ A B} : Tm1 (snoc1 Γ A) B -> Tm1 Γ (arr1 A B)
:= fun t Tm1 var1 lam1 app =>
lam1 _ _ _ (t Tm1 var1 lam1 app).
Definition app1 {Γ A B} : Tm1 Γ (arr1 A B) -> Tm1 Γ A -> Tm1 Γ B
:= fun t u Tm1 var1 lam1 app1 =>
app1 _ _ _
(t Tm1 var1 lam1 app1)
(u Tm1 var1 lam1 app1).
Definition v01 {Γ A} : Tm1 (snoc1 Γ A) A
:= var1 vz1.
Definition v11 {Γ A B} : Tm1 (snoc1 (snoc1 Γ A) B) A
:= var1 (vs1 vz1).
Definition v21 {Γ A B C} : Tm1 (snoc1 (snoc1 (snoc1 Γ A) B) C) A
:= var1 (vs1 (vs1 vz1)).
Definition v31 {Γ A B C D} : Tm1 (snoc1 (snoc1 (snoc1 (snoc1 Γ A) B) C) D) A
:= var1 (vs1 (vs1 (vs1 vz1))).
Definition v41 {Γ A B C D E} : Tm1 (snoc1 (snoc1 (snoc1 (snoc1 (snoc1 Γ A) B) C) D) E) A
:= var1 (vs1 (vs1 (vs1 (vs1 vz1)))).
Definition test1 {Γ A} : Tm1 Γ (arr1 (arr1 A A) (arr1 A A))
:= lam1 (lam1 (app1 v11 (app1 v11 (app1 v11 (app1 v11 (app1 v11 (app1 v11 v01))))))).
Definition Ty2 : Set
:= forall (Ty2 : Set)
(base : Ty2)
(arr : Ty2 -> Ty2 -> Ty2)
, Ty2.
Definition base2 : Ty2 := fun _ base2 _ => base2.
Definition arr2 : Ty2 -> Ty2 -> Ty2
:= fun A B Ty2 base2 arr2 =>
arr2 (A Ty2 base2 arr2) (B Ty2 base2 arr2).
Definition Con2 : Set
:= forall (Con2 : Set)
(nil : Con2)
(snoc : Con2 -> Ty2 -> Con2)
, Con2.
Definition nil2 : Con2
:= fun Con2 nil2 snoc => nil2.
Definition snoc2 : Con2 -> Ty2 -> Con2
:= fun Γ A Con2 nil2 snoc2 => snoc2 (Γ Con2 nil2 snoc2) A.
Definition Var2 : Con2 -> Ty2 -> Set
:= fun Γ A =>
forall (Var2 : Con2 -> Ty2 -> Set)
(vz : forall Γ A, Var2 (snoc2 Γ A) A)
(vs : forall Γ B A, Var2 Γ A -> Var2 (snoc2 Γ B) A)
, Var2 Γ A.
Definition vz2 {Γ A} : Var2 (snoc2 Γ A) A
:= fun Var2 vz2 vs => vz2 _ _.
Definition vs2 {Γ B A} : Var2 Γ A -> Var2 (snoc2 Γ B) A
:= fun x Var2 vz2 vs2 => vs2 _ _ _ (x Var2 vz2 vs2).
Definition Tm2 : Con2 -> Ty2 -> Set
:= fun Γ A =>
forall (Tm2 : Con2 -> Ty2 -> Set)
(var : forall Γ A , Var2 Γ A -> Tm2 Γ A)
(lam : forall Γ A B , Tm2 (snoc2 Γ A) B -> Tm2 Γ (arr2 A B))
(app : forall Γ A B , Tm2 Γ (arr2 A B) -> Tm2 Γ A -> Tm2 Γ B)
, Tm2 Γ A.
Definition var2 {Γ A} : Var2 Γ A -> Tm2 Γ A
:= fun x Tm2 var2 lam app =>
var2 _ _ x.
Definition lam2 {Γ A B} : Tm2 (snoc2 Γ A) B -> Tm2 Γ (arr2 A B)
:= fun t Tm2 var2 lam2 app =>
lam2 _ _ _ (t Tm2 var2 lam2 app).
Definition app2 {Γ A B} : Tm2 Γ (arr2 A B) -> Tm2 Γ A -> Tm2 Γ B
:= fun t u Tm2 var2 lam2 app2 =>
app2 _ _ _
(t Tm2 var2 lam2 app2)
(u Tm2 var2 lam2 app2).
Definition v02 {Γ A} : Tm2 (snoc2 Γ A) A
:= var2 vz2.
Definition v12 {Γ A B} : Tm2 (snoc2 (snoc2 Γ A) B) A
:= var2 (vs2 vz2).
Definition v22 {Γ A B C} : Tm2 (snoc2 (snoc2 (snoc2 Γ A) B) C) A
:= var2 (vs2 (vs2 vz2)).
Definition v32 {Γ A B C D} : Tm2 (snoc2 (snoc2 (snoc2 (snoc2 Γ A) B) C) D) A
:= var2 (vs2 (vs2 (vs2 vz2))).
Definition v42 {Γ A B C D E} : Tm2 (snoc2 (snoc2 (snoc2 (snoc2 (snoc2 Γ A) B) C) D) E) A
:= var2 (vs2 (vs2 (vs2 (vs2 vz2)))).
Definition test2 {Γ A} : Tm2 Γ (arr2 (arr2 A A) (arr2 A A))
:= lam2 (lam2 (app2 v12 (app2 v12 (app2 v12 (app2 v12 (app2 v12 (app2 v12 v02))))))).
Definition Ty3 : Set
:= forall (Ty3 : Set)
(base : Ty3)
(arr : Ty3 -> Ty3 -> Ty3)
, Ty3.
Definition base3 : Ty3 := fun _ base3 _ => base3.
Definition arr3 : Ty3 -> Ty3 -> Ty3
:= fun A B Ty3 base3 arr3 =>
arr3 (A Ty3 base3 arr3) (B Ty3 base3 arr3).
Definition Con3 : Set
:= forall (Con3 : Set)
(nil : Con3)
(snoc : Con3 -> Ty3 -> Con3)
, Con3.
Definition nil3 : Con3
:= fun Con3 nil3 snoc => nil3.
Definition snoc3 : Con3 -> Ty3 -> Con3
:= fun Γ A Con3 nil3 snoc3 => snoc3 (Γ Con3 nil3 snoc3) A.
Definition Var3 : Con3 -> Ty3 -> Set
:= fun Γ A =>
forall (Var3 : Con3 -> Ty3 -> Set)
(vz : forall Γ A, Var3 (snoc3 Γ A) A)
(vs : forall Γ B A, Var3 Γ A -> Var3 (snoc3 Γ B) A)
, Var3 Γ A.
Definition vz3 {Γ A} : Var3 (snoc3 Γ A) A
:= fun Var3 vz3 vs => vz3 _ _.
Definition vs3 {Γ B A} : Var3 Γ A -> Var3 (snoc3 Γ B) A
:= fun x Var3 vz3 vs3 => vs3 _ _ _ (x Var3 vz3 vs3).
Definition Tm3 : Con3 -> Ty3 -> Set
:= fun Γ A =>
forall (Tm3 : Con3 -> Ty3 -> Set)
(var : forall Γ A , Var3 Γ A -> Tm3 Γ A)
(lam : forall Γ A B , Tm3 (snoc3 Γ A) B -> Tm3 Γ (arr3 A B))
(app : forall Γ A B , Tm3 Γ (arr3 A B) -> Tm3 Γ A -> Tm3 Γ B)
, Tm3 Γ A.
Definition var3 {Γ A} : Var3 Γ A -> Tm3 Γ A
:= fun x Tm3 var3 lam app =>
var3 _ _ x.
Definition lam3 {Γ A B} : Tm3 (snoc3 Γ A) B -> Tm3 Γ (arr3 A B)
:= fun t Tm3 var3 lam3 app =>
lam3 _ _ _ (t Tm3 var3 lam3 app).
Definition app3 {Γ A B} : Tm3 Γ (arr3 A B) -> Tm3 Γ A -> Tm3 Γ B
:= fun t u Tm3 var3 lam3 app3 =>
app3 _ _ _
(t Tm3 var3 lam3 app3)
(u Tm3 var3 lam3 app3).
Definition v03 {Γ A} : Tm3 (snoc3 Γ A) A
:= var3 vz3.
Definition v13 {Γ A B} : Tm3 (snoc3 (snoc3 Γ A) B) A
:= var3 (vs3 vz3).
Definition v23 {Γ A B C} : Tm3 (snoc3 (snoc3 (snoc3 Γ A) B) C) A
:= var3 (vs3 (vs3 vz3)).
Definition v33 {Γ A B C D} : Tm3 (snoc3 (snoc3 (snoc3 (snoc3 Γ A) B) C) D) A
:= var3 (vs3 (vs3 (vs3 vz3))).
Definition v43 {Γ A B C D E} : Tm3 (snoc3 (snoc3 (snoc3 (snoc3 (snoc3 Γ A) B) C) D) E) A
:= var3 (vs3 (vs3 (vs3 (vs3 vz3)))).
Definition test3 {Γ A} : Tm3 Γ (arr3 (arr3 A A) (arr3 A A))
:= lam3 (lam3 (app3 v13 (app3 v13 (app3 v13 (app3 v13 (app3 v13 (app3 v13 v03))))))).
Definition Ty4 : Set
:= forall (Ty4 : Set)
(base : Ty4)
(arr : Ty4 -> Ty4 -> Ty4)
, Ty4.
Definition base4 : Ty4 := fun _ base4 _ => base4.
Definition arr4 : Ty4 -> Ty4 -> Ty4
:= fun A B Ty4 base4 arr4 =>
arr4 (A Ty4 base4 arr4) (B Ty4 base4 arr4).
Definition Con4 : Set
:= forall (Con4 : Set)
(nil : Con4)
(snoc : Con4 -> Ty4 -> Con4)
, Con4.
Definition nil4 : Con4
:= fun Con4 nil4 snoc => nil4.
Definition snoc4 : Con4 -> Ty4 -> Con4
:= fun Γ A Con4 nil4 snoc4 => snoc4 (Γ Con4 nil4 snoc4) A.
Definition Var4 : Con4 -> Ty4 -> Set
:= fun Γ A =>
forall (Var4 : Con4 -> Ty4 -> Set)
(vz : forall Γ A, Var4 (snoc4 Γ A) A)
(vs : forall Γ B A, Var4 Γ A -> Var4 (snoc4 Γ B) A)
, Var4 Γ A.
Definition vz4 {Γ A} : Var4 (snoc4 Γ A) A
:= fun Var4 vz4 vs => vz4 _ _.
Definition vs4 {Γ B A} : Var4 Γ A -> Var4 (snoc4 Γ B) A
:= fun x Var4 vz4 vs4 => vs4 _ _ _ (x Var4 vz4 vs4).
Definition Tm4 : Con4 -> Ty4 -> Set
:= fun Γ A =>
forall (Tm4 : Con4 -> Ty4 -> Set)
(var : forall Γ A , Var4 Γ A -> Tm4 Γ A)
(lam : forall Γ A B , Tm4 (snoc4 Γ A) B -> Tm4 Γ (arr4 A B))
(app : forall Γ A B , Tm4 Γ (arr4 A B) -> Tm4 Γ A -> Tm4 Γ B)
, Tm4 Γ A.
Definition var4 {Γ A} : Var4 Γ A -> Tm4 Γ A
:= fun x Tm4 var4 lam app =>
var4 _ _ x.
Definition lam4 {Γ A B} : Tm4 (snoc4 Γ A) B -> Tm4 Γ (arr4 A B)
:= fun t Tm4 var4 lam4 app =>
lam4 _ _ _ (t Tm4 var4 lam4 app).
Definition app4 {Γ A B} : Tm4 Γ (arr4 A B) -> Tm4 Γ A -> Tm4 Γ B
:= fun t u Tm4 var4 lam4 app4 =>
app4 _ _ _
(t Tm4 var4 lam4 app4)
(u Tm4 var4 lam4 app4).
Definition v04 {Γ A} : Tm4 (snoc4 Γ A) A
:= var4 vz4.
Definition v14 {Γ A B} : Tm4 (snoc4 (snoc4 Γ A) B) A
:= var4 (vs4 vz4).
Definition v24 {Γ A B C} : Tm4 (snoc4 (snoc4 (snoc4 Γ A) B) C) A
:= var4 (vs4 (vs4 vz4)).
Definition v34 {Γ A B C D} : Tm4 (snoc4 (snoc4 (snoc4 (snoc4 Γ A) B) C) D) A
:= var4 (vs4 (vs4 (vs4 vz4))).
Definition v44 {Γ A B C D E} : Tm4 (snoc4 (snoc4 (snoc4 (snoc4 (snoc4 Γ A) B) C) D) E) A
:= var4 (vs4 (vs4 (vs4 (vs4 vz4)))).
Definition test4 {Γ A} : Tm4 Γ (arr4 (arr4 A A) (arr4 A A))
:= lam4 (lam4 (app4 v14 (app4 v14 (app4 v14 (app4 v14 (app4 v14 (app4 v14 v04))))))).
Definition Ty5 : Set
:= forall (Ty5 : Set)
(base : Ty5)
(arr : Ty5 -> Ty5 -> Ty5)
, Ty5.
Definition base5 : Ty5 := fun _ base5 _ => base5.
Definition arr5 : Ty5 -> Ty5 -> Ty5
:= fun A B Ty5 base5 arr5 =>
arr5 (A Ty5 base5 arr5) (B Ty5 base5 arr5).
Definition Con5 : Set
:= forall (Con5 : Set)
(nil : Con5)
(snoc : Con5 -> Ty5 -> Con5)
, Con5.
Definition nil5 : Con5
:= fun Con5 nil5 snoc => nil5.
Definition snoc5 : Con5 -> Ty5 -> Con5
:= fun Γ A Con5 nil5 snoc5 => snoc5 (Γ Con5 nil5 snoc5) A.
Definition Var5 : Con5 -> Ty5 -> Set
:= fun Γ A =>
forall (Var5 : Con5 -> Ty5 -> Set)
(vz : forall Γ A, Var5 (snoc5 Γ A) A)
(vs : forall Γ B A, Var5 Γ A -> Var5 (snoc5 Γ B) A)
, Var5 Γ A.
Definition vz5 {Γ A} : Var5 (snoc5 Γ A) A
:= fun Var5 vz5 vs => vz5 _ _.
Definition vs5 {Γ B A} : Var5 Γ A -> Var5 (snoc5 Γ B) A
:= fun x Var5 vz5 vs5 => vs5 _ _ _ (x Var5 vz5 vs5).
Definition Tm5 : Con5 -> Ty5 -> Set
:= fun Γ A =>
forall (Tm5 : Con5 -> Ty5 -> Set)
(var : forall Γ A , Var5 Γ A -> Tm5 Γ A)
(lam : forall Γ A B , Tm5 (snoc5 Γ A) B -> Tm5 Γ (arr5 A B))
(app : forall Γ A B , Tm5 Γ (arr5 A B) -> Tm5 Γ A -> Tm5 Γ B)
, Tm5 Γ A.
Definition var5 {Γ A} : Var5 Γ A -> Tm5 Γ A
:= fun x Tm5 var5 lam app =>
var5 _ _ x.
Definition lam5 {Γ A B} : Tm5 (snoc5 Γ A) B -> Tm5 Γ (arr5 A B)
:= fun t Tm5 var5 lam5 app =>
lam5 _ _ _ (t Tm5 var5 lam5 app).
Definition app5 {Γ A B} : Tm5 Γ (arr5 A B) -> Tm5 Γ A -> Tm5 Γ B
:= fun t u Tm5 var5 lam5 app5 =>
app5 _ _ _
(t Tm5 var5 lam5 app5)
(u Tm5 var5 lam5 app5).
Definition v05 {Γ A} : Tm5 (snoc5 Γ A) A
:= var5 vz5.
Definition v15 {Γ A B} : Tm5 (snoc5 (snoc5 Γ A) B) A
:= var5 (vs5 vz5).
Definition v25 {Γ A B C} : Tm5 (snoc5 (snoc5 (snoc5 Γ A) B) C) A
:= var5 (vs5 (vs5 vz5)).
Definition v35 {Γ A B C D} : Tm5 (snoc5 (snoc5 (snoc5 (snoc5 Γ A) B) C) D) A
:= var5 (vs5 (vs5 (vs5 vz5))).
Definition v45 {Γ A B C D E} : Tm5 (snoc5 (snoc5 (snoc5 (snoc5 (snoc5 Γ A) B) C) D) E) A
:= var5 (vs5 (vs5 (vs5 (vs5 vz5)))).
Definition test5 {Γ A} : Tm5 Γ (arr5 (arr5 A A) (arr5 A A))
:= lam5 (lam5 (app5 v15 (app5 v15 (app5 v15 (app5 v15 (app5 v15 (app5 v15 v05))))))).
Definition Ty6 : Set
:= forall (Ty6 : Set)
(base : Ty6)
(arr : Ty6 -> Ty6 -> Ty6)
, Ty6.
Definition base6 : Ty6 := fun _ base6 _ => base6.
Definition arr6 : Ty6 -> Ty6 -> Ty6
:= fun A B Ty6 base6 arr6 =>
arr6 (A Ty6 base6 arr6) (B Ty6 base6 arr6).
Definition Con6 : Set
:= forall (Con6 : Set)
(nil : Con6)
(snoc : Con6 -> Ty6 -> Con6)
, Con6.
Definition nil6 : Con6
:= fun Con6 nil6 snoc => nil6.
Definition snoc6 : Con6 -> Ty6 -> Con6
:= fun Γ A Con6 nil6 snoc6 => snoc6 (Γ Con6 nil6 snoc6) A.
Definition Var6 : Con6 -> Ty6 -> Set
:= fun Γ A =>
forall (Var6 : Con6 -> Ty6 -> Set)
(vz : forall Γ A, Var6 (snoc6 Γ A) A)
(vs : forall Γ B A, Var6 Γ A -> Var6 (snoc6 Γ B) A)
, Var6 Γ A.
Definition vz6 {Γ A} : Var6 (snoc6 Γ A) A
:= fun Var6 vz6 vs => vz6 _ _.
Definition vs6 {Γ B A} : Var6 Γ A -> Var6 (snoc6 Γ B) A
:= fun x Var6 vz6 vs6 => vs6 _ _ _ (x Var6 vz6 vs6).
Definition Tm6 : Con6 -> Ty6 -> Set
:= fun Γ A =>
forall (Tm6 : Con6 -> Ty6 -> Set)
(var : forall Γ A , Var6 Γ A -> Tm6 Γ A)
(lam : forall Γ A B , Tm6 (snoc6 Γ A) B -> Tm6 Γ (arr6 A B))
(app : forall Γ A B , Tm6 Γ (arr6 A B) -> Tm6 Γ A -> Tm6 Γ B)
, Tm6 Γ A.
Definition var6 {Γ A} : Var6 Γ A -> Tm6 Γ A
:= fun x Tm6 var6 lam app =>
var6 _ _ x.
Definition lam6 {Γ A B} : Tm6 (snoc6 Γ A) B -> Tm6 Γ (arr6 A B)
:= fun t Tm6 var6 lam6 app =>
lam6 _ _ _ (t Tm6 var6 lam6 app).
Definition app6 {Γ A B} : Tm6 Γ (arr6 A B) -> Tm6 Γ A -> Tm6 Γ B
:= fun t u Tm6 var6 lam6 app6 =>
app6 _ _ _
(t Tm6 var6 lam6 app6)
(u Tm6 var6 lam6 app6).
Definition v06 {Γ A} : Tm6 (snoc6 Γ A) A
:= var6 vz6.
Definition v16 {Γ A B} : Tm6 (snoc6 (snoc6 Γ A) B) A
:= var6 (vs6 vz6).
Definition v26 {Γ A B C} : Tm6 (snoc6 (snoc6 (snoc6 Γ A) B) C) A
:= var6 (vs6 (vs6 vz6)).
Definition v36 {Γ A B C D} : Tm6 (snoc6 (snoc6 (snoc6 (snoc6 Γ A) B) C) D) A
:= var6 (vs6 (vs6 (vs6 vz6))).
Definition v46 {Γ A B C D E} : Tm6 (snoc6 (snoc6 (snoc6 (snoc6 (snoc6 Γ A) B) C) D) E) A
:= var6 (vs6 (vs6 (vs6 (vs6 vz6)))).
Definition test6 {Γ A} : Tm6 Γ (arr6 (arr6 A A) (arr6 A A))
:= lam6 (lam6 (app6 v16 (app6 v16 (app6 v16 (app6 v16 (app6 v16 (app6 v16 v06))))))).
Definition Ty7 : Set
:= forall (Ty7 : Set)
(base : Ty7)
(arr : Ty7 -> Ty7 -> Ty7)
, Ty7.
Definition base7 : Ty7 := fun _ base7 _ => base7.
Definition arr7 : Ty7 -> Ty7 -> Ty7
:= fun A B Ty7 base7 arr7 =>
arr7 (A Ty7 base7 arr7) (B Ty7 base7 arr7).
Definition Con7 : Set
:= forall (Con7 : Set)
(nil : Con7)
(snoc : Con7 -> Ty7 -> Con7)
, Con7.
Definition nil7 : Con7
:= fun Con7 nil7 snoc => nil7.
Definition snoc7 : Con7 -> Ty7 -> Con7
:= fun Γ A Con7 nil7 snoc7 => snoc7 (Γ Con7 nil7 snoc7) A.
Definition Var7 : Con7 -> Ty7 -> Set
:= fun Γ A =>
forall (Var7 : Con7 -> Ty7 -> Set)
(vz : forall Γ A, Var7 (snoc7 Γ A) A)
(vs : forall Γ B A, Var7 Γ A -> Var7 (snoc7 Γ B) A)
, Var7 Γ A.
Definition vz7 {Γ A} : Var7 (snoc7 Γ A) A
:= fun Var7 vz7 vs => vz7 _ _.
Definition vs7 {Γ B A} : Var7 Γ A -> Var7 (snoc7 Γ B) A
:= fun x Var7 vz7 vs7 => vs7 _ _ _ (x Var7 vz7 vs7).
Definition Tm7 : Con7 -> Ty7 -> Set
:= fun Γ A =>
forall (Tm7 : Con7 -> Ty7 -> Set)
(var : forall Γ A , Var7 Γ A -> Tm7 Γ A)
(lam : forall Γ A B , Tm7 (snoc7 Γ A) B -> Tm7 Γ (arr7 A B))
(app : forall Γ A B , Tm7 Γ (arr7 A B) -> Tm7 Γ A -> Tm7 Γ B)
, Tm7 Γ A.
Definition var7 {Γ A} : Var7 Γ A -> Tm7 Γ A
:= fun x Tm7 var7 lam app =>
var7 _ _ x.
Definition lam7 {Γ A B} : Tm7 (snoc7 Γ A) B -> Tm7 Γ (arr7 A B)
:= fun t Tm7 var7 lam7 app =>
lam7 _ _ _ (t Tm7 var7 lam7 app).
Definition app7 {Γ A B} : Tm7 Γ (arr7 A B) -> Tm7 Γ A -> Tm7 Γ B
:= fun t u Tm7 var7 lam7 app7 =>
app7 _ _ _
(t Tm7 var7 lam7 app7)
(u Tm7 var7 lam7 app7).
Definition v07 {Γ A} : Tm7 (snoc7 Γ A) A
:= var7 vz7.
Definition v17 {Γ A B} : Tm7 (snoc7 (snoc7 Γ A) B) A
:= var7 (vs7 vz7).
Definition v27 {Γ A B C} : Tm7 (snoc7 (snoc7 (snoc7 Γ A) B) C) A
:= var7 (vs7 (vs7 vz7)).
Definition v37 {Γ A B C D} : Tm7 (snoc7 (snoc7 (snoc7 (snoc7 Γ A) B) C) D) A
:= var7 (vs7 (vs7 (vs7 vz7))).
Definition v47 {Γ A B C D E} : Tm7 (snoc7 (snoc7 (snoc7 (snoc7 (snoc7 Γ A) B) C) D) E) A
:= var7 (vs7 (vs7 (vs7 (vs7 vz7)))).
Definition test7 {Γ A} : Tm7 Γ (arr7 (arr7 A A) (arr7 A A))
:= lam7 (lam7 (app7 v17 (app7 v17 (app7 v17 (app7 v17 (app7 v17 (app7 v17 v07))))))).
Definition Ty8 : Set
:= forall (Ty8 : Set)
(base : Ty8)
(arr : Ty8 -> Ty8 -> Ty8)
, Ty8.
Definition base8 : Ty8 := fun _ base8 _ => base8.
Definition arr8 : Ty8 -> Ty8 -> Ty8
:= fun A B Ty8 base8 arr8 =>
arr8 (A Ty8 base8 arr8) (B Ty8 base8 arr8).
Definition Con8 : Set
:= forall (Con8 : Set)
(nil : Con8)
(snoc : Con8 -> Ty8 -> Con8)
, Con8.
Definition nil8 : Con8
:= fun Con8 nil8 snoc => nil8.
Definition snoc8 : Con8 -> Ty8 -> Con8
:= fun Γ A Con8 nil8 snoc8 => snoc8 (Γ Con8 nil8 snoc8) A.
Definition Var8 : Con8 -> Ty8 -> Set
:= fun Γ A =>
forall (Var8 : Con8 -> Ty8 -> Set)
(vz : forall Γ A, Var8 (snoc8 Γ A) A)
(vs : forall Γ B A, Var8 Γ A -> Var8 (snoc8 Γ B) A)
, Var8 Γ A.
Definition vz8 {Γ A} : Var8 (snoc8 Γ A) A
:= fun Var8 vz8 vs => vz8 _ _.
Definition vs8 {Γ B A} : Var8 Γ A -> Var8 (snoc8 Γ B) A
:= fun x Var8 vz8 vs8 => vs8 _ _ _ (x Var8 vz8 vs8).
Definition Tm8 : Con8 -> Ty8 -> Set
:= fun Γ A =>
forall (Tm8 : Con8 -> Ty8 -> Set)
(var : forall Γ A , Var8 Γ A -> Tm8 Γ A)
(lam : forall Γ A B , Tm8 (snoc8 Γ A) B -> Tm8 Γ (arr8 A B))
(app : forall Γ A B , Tm8 Γ (arr8 A B) -> Tm8 Γ A -> Tm8 Γ B)
, Tm8 Γ A.
Definition var8 {Γ A} : Var8 Γ A -> Tm8 Γ A
:= fun x Tm8 var8 lam app =>
var8 _ _ x.
Definition lam8 {Γ A B} : Tm8 (snoc8 Γ A) B -> Tm8 Γ (arr8 A B)
:= fun t Tm8 var8 lam8 app =>
lam8 _ _ _ (t Tm8 var8 lam8 app).
Definition app8 {Γ A B} : Tm8 Γ (arr8 A B) -> Tm8 Γ A -> Tm8 Γ B
:= fun t u Tm8 var8 lam8 app8 =>
app8 _ _ _
(t Tm8 var8 lam8 app8)
(u Tm8 var8 lam8 app8).
Definition v08 {Γ A} : Tm8 (snoc8 Γ A) A
:= var8 vz8.
Definition v18 {Γ A B} : Tm8 (snoc8 (snoc8 Γ A) B) A
:= var8 (vs8 vz8).
Definition v28 {Γ A B C} : Tm8 (snoc8 (snoc8 (snoc8 Γ A) B) C) A
:= var8 (vs8 (vs8 vz8)).
Definition v38 {Γ A B C D} : Tm8 (snoc8 (snoc8 (snoc8 (snoc8 Γ A) B) C) D) A
:= var8 (vs8 (vs8 (vs8 vz8))).
Definition v48 {Γ A B C D E} : Tm8 (snoc8 (snoc8 (snoc8 (snoc8 (snoc8 Γ A) B) C) D) E) A
:= var8 (vs8 (vs8 (vs8 (vs8 vz8)))).
Definition test8 {Γ A} : Tm8 Γ (arr8 (arr8 A A) (arr8 A A))
:= lam8 (lam8 (app8 v18 (app8 v18 (app8 v18 (app8 v18 (app8 v18 (app8 v18 v08))))))).
Definition Ty9 : Set
:= forall (Ty9 : Set)
(base : Ty9)
(arr : Ty9 -> Ty9 -> Ty9)
, Ty9.
Definition base9 : Ty9 := fun _ base9 _ => base9.
Definition arr9 : Ty9 -> Ty9 -> Ty9
:= fun A B Ty9 base9 arr9 =>
arr9 (A Ty9 base9 arr9) (B Ty9 base9 arr9).
Definition Con9 : Set
:= forall (Con9 : Set)
(nil : Con9)
(snoc : Con9 -> Ty9 -> Con9)
, Con9.
Definition nil9 : Con9
:= fun Con9 nil9 snoc => nil9.
Definition snoc9 : Con9 -> Ty9 -> Con9
:= fun Γ A Con9 nil9 snoc9 => snoc9 (Γ Con9 nil9 snoc9) A.
Definition Var9 : Con9 -> Ty9 -> Set
:= fun Γ A =>
forall (Var9 : Con9 -> Ty9 -> Set)
(vz : forall Γ A, Var9 (snoc9 Γ A) A)
(vs : forall Γ B A, Var9 Γ A -> Var9 (snoc9 Γ B) A)
, Var9 Γ A.
Definition vz9 {Γ A} : Var9 (snoc9 Γ A) A
:= fun Var9 vz9 vs => vz9 _ _.
Definition vs9 {Γ B A} : Var9 Γ A -> Var9 (snoc9 Γ B) A
:= fun x Var9 vz9 vs9 => vs9 _ _ _ (x Var9 vz9 vs9).
Definition Tm9 : Con9 -> Ty9 -> Set
:= fun Γ A =>
forall (Tm9 : Con9 -> Ty9 -> Set)
(var : forall Γ A , Var9 Γ A -> Tm9 Γ A)
(lam : forall Γ A B , Tm9 (snoc9 Γ A) B -> Tm9 Γ (arr9 A B))
(app : forall Γ A B , Tm9 Γ (arr9 A B) -> Tm9 Γ A -> Tm9 Γ B)
, Tm9 Γ A.
Definition var9 {Γ A} : Var9 Γ A -> Tm9 Γ A
:= fun x Tm9 var9 lam app =>
var9 _ _ x.
Definition lam9 {Γ A B} : Tm9 (snoc9 Γ A) B -> Tm9 Γ (arr9 A B)
:= fun t Tm9 var9 lam9 app =>
lam9 _ _ _ (t Tm9 var9 lam9 app).
Definition app9 {Γ A B} : Tm9 Γ (arr9 A B) -> Tm9 Γ A -> Tm9 Γ B
:= fun t u Tm9 var9 lam9 app9 =>
app9 _ _ _
(t Tm9 var9 lam9 app9)
(u Tm9 var9 lam9 app9).
Definition v09 {Γ A} : Tm9 (snoc9 Γ A) A
:= var9 vz9.
Definition v19 {Γ A B} : Tm9 (snoc9 (snoc9 Γ A) B) A
:= var9 (vs9 vz9).
Definition v29 {Γ A B C} : Tm9 (snoc9 (snoc9 (snoc9 Γ A) B) C) A
:= var9 (vs9 (vs9 vz9)).
Definition v39 {Γ A B C D} : Tm9 (snoc9 (snoc9 (snoc9 (snoc9 Γ A) B) C) D) A
:= var9 (vs9 (vs9 (vs9 vz9))).
Definition v49 {Γ A B C D E} : Tm9 (snoc9 (snoc9 (snoc9 (snoc9 (snoc9 Γ A) B) C) D) E) A
:= var9 (vs9 (vs9 (vs9 (vs9 vz9)))).
Definition test9 {Γ A} : Tm9 Γ (arr9 (arr9 A A) (arr9 A A))
:= lam9 (lam9 (app9 v19 (app9 v19 (app9 v19 (app9 v19 (app9 v19 (app9 v19 v09))))))).
Definition Ty10 : Set
:= forall (Ty10 : Set)
(base : Ty10)
(arr : Ty10 -> Ty10 -> Ty10)
, Ty10.
Definition base10 : Ty10 := fun _ base10 _ => base10.
Definition arr10 : Ty10 -> Ty10 -> Ty10
:= fun A B Ty10 base10 arr10 =>
arr10 (A Ty10 base10 arr10) (B Ty10 base10 arr10).
Definition Con10 : Set
:= forall (Con10 : Set)
(nil : Con10)
(snoc : Con10 -> Ty10 -> Con10)
, Con10.
Definition nil10 : Con10
:= fun Con10 nil10 snoc => nil10.
Definition snoc10 : Con10 -> Ty10 -> Con10
:= fun Γ A Con10 nil10 snoc10 => snoc10 (Γ Con10 nil10 snoc10) A.
Definition Var10 : Con10 -> Ty10 -> Set
:= fun Γ A =>
forall (Var10 : Con10 -> Ty10 -> Set)
(vz : forall Γ A, Var10 (snoc10 Γ A) A)
(vs : forall Γ B A, Var10 Γ A -> Var10 (snoc10 Γ B) A)
, Var10 Γ A.
Definition vz10 {Γ A} : Var10 (snoc10 Γ A) A
:= fun Var10 vz10 vs => vz10 _ _.
Definition vs10 {Γ B A} : Var10 Γ A -> Var10 (snoc10 Γ B) A
:= fun x Var10 vz10 vs10 => vs10 _ _ _ (x Var10 vz10 vs10).
Definition Tm10 : Con10 -> Ty10 -> Set
:= fun Γ A =>
forall (Tm10 : Con10 -> Ty10 -> Set)
(var : forall Γ A , Var10 Γ A -> Tm10 Γ A)
(lam : forall Γ A B , Tm10 (snoc10 Γ A) B -> Tm10 Γ (arr10 A B))
(app : forall Γ A B , Tm10 Γ (arr10 A B) -> Tm10 Γ A -> Tm10 Γ B)
, Tm10 Γ A.
Definition var10 {Γ A} : Var10 Γ A -> Tm10 Γ A
:= fun x Tm10 var10 lam app =>
var10 _ _ x.
Definition lam10 {Γ A B} : Tm10 (snoc10 Γ A) B -> Tm10 Γ (arr10 A B)
:= fun t Tm10 var10 lam10 app =>
lam10 _ _ _ (t Tm10 var10 lam10 app).
Definition app10 {Γ A B} : Tm10 Γ (arr10 A B) -> Tm10 Γ A -> Tm10 Γ B
:= fun t u Tm10 var10 lam10 app10 =>
app10 _ _ _
(t Tm10 var10 lam10 app10)
(u Tm10 var10 lam10 app10).
Definition v010 {Γ A} : Tm10 (snoc10 Γ A) A
:= var10 vz10.
Definition v110 {Γ A B} : Tm10 (snoc10 (snoc10 Γ A) B) A
:= var10 (vs10 vz10).
Definition v210 {Γ A B C} : Tm10 (snoc10 (snoc10 (snoc10 Γ A) B) C) A
:= var10 (vs10 (vs10 vz10)).
Definition v310 {Γ A B C D} : Tm10 (snoc10 (snoc10 (snoc10 (snoc10 Γ A) B) C) D) A
:= var10 (vs10 (vs10 (vs10 vz10))).
Definition v410 {Γ A B C D E} : Tm10 (snoc10 (snoc10 (snoc10 (snoc10 (snoc10 Γ A) B) C) D) E) A
:= var10 (vs10 (vs10 (vs10 (vs10 vz10)))).
Definition test10 {Γ A} : Tm10 Γ (arr10 (arr10 A A) (arr10 A A))
:= lam10 (lam10 (app10 v110 (app10 v110 (app10 v110 (app10 v110 (app10 v110 (app10 v110 v010))))))).
Definition Ty11 : Set
:= forall (Ty11 : Set)
(base : Ty11)
(arr : Ty11 -> Ty11 -> Ty11)
, Ty11.
Definition base11 : Ty11 := fun _ base11 _ => base11.
Definition arr11 : Ty11 -> Ty11 -> Ty11
:= fun A B Ty11 base11 arr11 =>
arr11 (A Ty11 base11 arr11) (B Ty11 base11 arr11).
Definition Con11 : Set
:= forall (Con11 : Set)
(nil : Con11)
(snoc : Con11 -> Ty11 -> Con11)
, Con11.
Definition nil11 : Con11
:= fun Con11 nil11 snoc => nil11.
Definition snoc11 : Con11 -> Ty11 -> Con11
:= fun Γ A Con11 nil11 snoc11 => snoc11 (Γ Con11 nil11 snoc11) A.
Definition Var11 : Con11 -> Ty11 -> Set
:= fun Γ A =>
forall (Var11 : Con11 -> Ty11 -> Set)
(vz : forall Γ A, Var11 (snoc11 Γ A) A)
(vs : forall Γ B A, Var11 Γ A -> Var11 (snoc11 Γ B) A)
, Var11 Γ A.
Definition vz11 {Γ A} : Var11 (snoc11 Γ A) A
:= fun Var11 vz11 vs => vz11 _ _.
Definition vs11 {Γ B A} : Var11 Γ A -> Var11 (snoc11 Γ B) A
:= fun x Var11 vz11 vs11 => vs11 _ _ _ (x Var11 vz11 vs11).
Definition Tm11 : Con11 -> Ty11 -> Set
:= fun Γ A =>
forall (Tm11 : Con11 -> Ty11 -> Set)
(var : forall Γ A , Var11 Γ A -> Tm11 Γ A)
(lam : forall Γ A B , Tm11 (snoc11 Γ A) B -> Tm11 Γ (arr11 A B))
(app : forall Γ A B , Tm11 Γ (arr11 A B) -> Tm11 Γ A -> Tm11 Γ B)
, Tm11 Γ A.
Definition var11 {Γ A} : Var11 Γ A -> Tm11 Γ A
:= fun x Tm11 var11 lam app =>
var11 _ _ x.
Definition lam11 {Γ A B} : Tm11 (snoc11 Γ A) B -> Tm11 Γ (arr11 A B)
:= fun t Tm11 var11 lam11 app =>
lam11 _ _ _ (t Tm11 var11 lam11 app).
Definition app11 {Γ A B} : Tm11 Γ (arr11 A B) -> Tm11 Γ A -> Tm11 Γ B
:= fun t u Tm11 var11 lam11 app11 =>
app11 _ _ _
(t Tm11 var11 lam11 app11)
(u Tm11 var11 lam11 app11).
Definition v011 {Γ A} : Tm11 (snoc11 Γ A) A
:= var11 vz11.
Definition v111 {Γ A B} : Tm11 (snoc11 (snoc11 Γ A) B) A
:= var11 (vs11 vz11).
Definition v211 {Γ A B C} : Tm11 (snoc11 (snoc11 (snoc11 Γ A) B) C) A
:= var11 (vs11 (vs11 vz11)).
Definition v311 {Γ A B C D} : Tm11 (snoc11 (snoc11 (snoc11 (snoc11 Γ A) B) C) D) A
:= var11 (vs11 (vs11 (vs11 vz11))).
Definition v411 {Γ A B C D E} : Tm11 (snoc11 (snoc11 (snoc11 (snoc11 (snoc11 Γ A) B) C) D) E) A
:= var11 (vs11 (vs11 (vs11 (vs11 vz11)))).
Definition test11 {Γ A} : Tm11 Γ (arr11 (arr11 A A) (arr11 A A))
:= lam11 (lam11 (app11 v111 (app11 v111 (app11 v111 (app11 v111 (app11 v111 (app11 v111 v011))))))).
Definition Ty12 : Set
:= forall (Ty12 : Set)
(base : Ty12)
(arr : Ty12 -> Ty12 -> Ty12)
, Ty12.
Definition base12 : Ty12 := fun _ base12 _ => base12.
Definition arr12 : Ty12 -> Ty12 -> Ty12
:= fun A B Ty12 base12 arr12 =>
arr12 (A Ty12 base12 arr12) (B Ty12 base12 arr12).
Definition Con12 : Set
:= forall (Con12 : Set)
(nil : Con12)
(snoc : Con12 -> Ty12 -> Con12)
, Con12.
Definition nil12 : Con12
:= fun Con12 nil12 snoc => nil12.
Definition snoc12 : Con12 -> Ty12 -> Con12
:= fun Γ A Con12 nil12 snoc12 => snoc12 (Γ Con12 nil12 snoc12) A.
Definition Var12 : Con12 -> Ty12 -> Set
:= fun Γ A =>
forall (Var12 : Con12 -> Ty12 -> Set)
(vz : forall Γ A, Var12 (snoc12 Γ A) A)
(vs : forall Γ B A, Var12 Γ A -> Var12 (snoc12 Γ B) A)
, Var12 Γ A.
Definition vz12 {Γ A} : Var12 (snoc12 Γ A) A
:= fun Var12 vz12 vs => vz12 _ _.
Definition vs12 {Γ B A} : Var12 Γ A -> Var12 (snoc12 Γ B) A
:= fun x Var12 vz12 vs12 => vs12 _ _ _ (x Var12 vz12 vs12).
Definition Tm12 : Con12 -> Ty12 -> Set
:= fun Γ A =>
forall (Tm12 : Con12 -> Ty12 -> Set)
(var : forall Γ A , Var12 Γ A -> Tm12 Γ A)
(lam : forall Γ A B , Tm12 (snoc12 Γ A) B -> Tm12 Γ (arr12 A B))
(app : forall Γ A B , Tm12 Γ (arr12 A B) -> Tm12 Γ A -> Tm12 Γ B)
, Tm12 Γ A.
Definition var12 {Γ A} : Var12 Γ A -> Tm12 Γ A
:= fun x Tm12 var12 lam app =>
var12 _ _ x.
Definition lam12 {Γ A B} : Tm12 (snoc12 Γ A) B -> Tm12 Γ (arr12 A B)
:= fun t Tm12 var12 lam12 app =>
lam12 _ _ _ (t Tm12 var12 lam12 app).
Definition app12 {Γ A B} : Tm12 Γ (arr12 A B) -> Tm12 Γ A -> Tm12 Γ B
:= fun t u Tm12 var12 lam12 app12 =>
app12 _ _ _
(t Tm12 var12 lam12 app12)
(u Tm12 var12 lam12 app12).
Definition v012 {Γ A} : Tm12 (snoc12 Γ A) A
:= var12 vz12.
Definition v112 {Γ A B} : Tm12 (snoc12 (snoc12 Γ A) B) A