-
Notifications
You must be signed in to change notification settings - Fork 3
/
test2.sott
57 lines (49 loc) · 1.4 KB
/
test2.sott
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
define proof_irrel :
(A : Set)(B : Set)(p : [A = B])(q : [A = B]) -> [p : [A = B] = q : [A = B]]
as \A B p q ->
refl
define trans :
(A : Set)(B : Set)
(a : A) (b : B) (c : B) ->
[a : A = b : B] ->
[b : B = c : B] ->
[a : A = c : B]
as
\A -> \B -> \a -> \b -> \c -> \p -> \q ->
coerce(p,[a : A = b : B],[a : A = c : B],
subst(B,z.[a : A = z : B],b,c,q))
define symm :
(A : Set)(x : A)(y : A)(p : [x : A = y : A]) -> [y : A = x : A]
as
\A x y p ->
coerce(refl,[x : A = x : A],[y : A = x : A],subst(A,z.[z : A = x : A],x,y,p))
define coh_test :
(A : Set)(B : Set)(x : A)(p : [A = B]) -> [x : A = coerce(x,A,B,p) : B]
as \A B x p -> coherence(p)
(* introduce A B x p, conclude [x : A = coerce(x,A,B,p) : B] by coherence. *)
(*
define symm :
(A : Set)(B : Set)(x : A)(y : B)(p : [x : A = y : B]) -> [y : B = x : A]
as
\A -> \B -> \x -> \y -> \p ->
coerce(refl,[x : A = x : A],[y : B = x : A],
subst((X : Set) * X,
z.[snd z : fst z = x : A],
(A,x),
(B,y),
paireq ))
*)
(*
subst : (P : (A : Set) -> A -> Set)
(A : Set)
(a : A)
(p : P A a)
(B : Set)
(b : B) ->
[a : A = b : B] ->
[P A a = P B b]
or just:
tyeq : [a : A = b : B] -> [A = B]
and
small_ty_eq : [a : A = b : B] -> [A : Set = B : Set], when A and B are in Set
*)