-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathTestConTy.agda
67 lines (46 loc) · 1.8 KB
/
TestConTy.agda
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
{-# OPTIONS --rewriting --allow-unsolved-metas #-}
open import II using (PS; P; S)
open import EWRSg
open import Lib
module TestConTy (C' : Set) (T' : Set) where
Γ : Con
Γ = ∙ ▶S U -- Con
▶S ΠS (vz{S}) U -- Ty
Nil : TyP Γ
Nil = El (vs{S}{S} (vz{S}))
Γ' : Con
Γ' = Γ ▶P Nil -- nil
Γ''aux : Con
Γ''aux = Γ' ▶P El (vs{S}{P}{Γ} (vs{S}{S} (vz{S})))
Ext : TyP Γ'
Ext = ΠP {Γ'} (vs{S}{P}{Γ} (vs{S}{S}{∙ ▶S U} (vz{S})))
(ΠP{Γ''aux} (appS{Γ'} (vs{S}{P}{Γ} (vz{S})))
(El (vs{S}{P}{Γ''aux} (vs{S}{P}{Γ'} (vs{S}{P}{Γ} (vs{S}{S}{∙ ▶S U} vz))))))
Γ'' : Con
Γ'' = Γ' ▶P Ext --ext
Unit : TyP Γ
Unit = ΠP (vs{S}{S}{∙ ▶S U} (vz{S})) (El (appS (vz{S}{∙ ▶ U})))
Γ''' : Con
Γ''' = Γ'' ▶P Unit [ wk{P}{Γ} ]TP [ wk{P}{Γ'} ]TP --unit
PiCon : TmS Γ'' U
PiCon = vs{S}{P}{Γ'} (vs{S}{P}{Γ} (vs{S}{S}{∙ ▶S U} (vz{S})))
PiTy : TmS Γ'' (ΠS PiCon U)
PiTy = vs{S}{P}{Γ'} (vs{S}{P}{Γ} (vz{S}))
PiA : TmS (Γ'' ▶P El PiCon) U
PiA = appS PiTy
PiΓACon : TmS (Γ'' ▶P El PiCon ▶P El PiA) U
PiΓACon = vs{S}{P}{Γ'' ▶P El PiCon} (vs{S}{P}{Γ''} PiCon)
PiΓATy : TmS (Γ'' ▶P El PiCon ▶P El PiA) (ΠS PiΓACon U)
PiΓATy = vs{S}{P}{Γ'' ▶P El PiCon} (vs{S}{P}{Γ''} PiTy)
PiExtΓ : TmP (Γ'' ▶P El PiCon) (ΠP PiA (El PiΓACon))
PiExtΓ = appP (vz{P}{Γ'}{Ext})
PiExtΓA : TmP (Γ'' ▶P El PiCon ▶P El PiA) (El PiΓACon)
PiExtΓA = appP PiExtΓ
PiB : TmS (Γ'' ▶P El PiCon ▶P El PiA) U
PiB = atS{Γ'' ▶P El PiCon ▶P El PiA}{PiΓACon}{U} PiΓATy PiExtΓA
PiRet : TmS (Γ'' ▶P El PiCon ▶P El PiA ▶P El PiB) U
PiRet = vs{S}{P}{Γ'' ▶P El PiCon ▶P El PiA} (vs{S}{P}{Γ'' ▶P El PiCon} PiA)
Pi : TyP Γ''
Pi = ΠP PiCon (ΠP PiA (ΠP PiB (El PiRet)))
Γ'''' : Con
Γ'''' = Γ''' ▶P Pi [ wk{P}{Γ''} ]TP