I'm having trouble passing a parameter to a product type in coq. I have a definition that looks like,
Definition bar (a:Type) := a->Type.
I need to define a function that takes in 'a' and the thing made by 'bar a' and outputs their product/ordered pair. So I tried the following.
Definition foo (a:Type)(b:bar a):= prod a b.
Which gives me the error
The term "b" has type "bar a" while it is expected to have type "Type".
What's really confusing here is that this,
Definition foo (a:Type) := prod a (bar a).
works just fine. Clearly 'bar a' has type 'Type', so I'm not sure how to fix my original definition. I suspect I'm not passing variables properly.