Hi Shashank,
you cannot introduce p and q as constructors by "data" and *also*
provide equations for them by "def". So, you have to introduce p,q by
fun-declarations and can then provide def-computation rules. For
fun p : (A : Set) -> (B : El A -> Set) -> El (Sigma A B) -> El A ;
def p _ _ (pair _ _ a _) = a ;
this is ok, and the compiler accepts it. But for q, with
fun q : (A : Set) -> (B : El A -> Set) -> (c : El (Sigma A B)) -> El (B (p A B c)) ;
def q A B (pair A B a b) = b ;
you still get an error message:
DepType.gf:
DepType.gf:14:
Happened in the definition of function q
{a <> p A B (pair A B a b)}
It seems to me that for c = (pair A B a b),
El (B (p A B c)) = El (B (p A B (pair A B a b)))
is not the same as El (B a), so the computation rule for p apparently is
not available to prove
El (B (p A B (pair A B a b))) = El (B a).
I don't know why this is so.
Hans