Coq is version 8.10.2 and I use category-theory library made by jwiegley.
I want to define Category whose objects are Euclidean spaces and arrows are Parametrised function (P -> A -> B) between Objects A and B. parameter P is arbitrary Euclidean space but not object of Category.
I wrote this code. Definition of Category Class is here
Require Import Coq.Reals.Reals.
Require Import Category.Theory.
Inductive Euc:nat -> Type:=
|RO : Euc 0
|Rn : forall n:nat, R -> Euc n -> Euc (S n).
Record SuperEuc := {
dim : nat;
}.
Program Instance Para :Category:= {
obj := SuperEuc;
hom := fun A B:SuperEuc => forall {P:SuperEuc}, Euc (dim P) -> Euc (dim A) -> Euc (dim B);
compose := fun A B C I J {P:SuperEuc} (p:Euc (dim P)) (a:Euc (dim A)) {Q:SuperEuc} (q:Euc (dim Q))
=> J _ q ((I _ p) a);
}.
The error message is this.
The type of this term is a product while it is expected to be (Euc (dim C)).
I want to pass the two parameters of different Euclidean spaces to I and J like this.
compose := fun A B C I J {P:SuperEuc} (p:Euc (dim P)) (a:Euc (dim A)) {Q:SuperEuc} (q:Euc (dim Q))
=> J _ q ((I _ p) a);
But in fact, compose accepts only one parameter like this.
compose := fun A B C I J {P:SuperEuc} (p:Euc (dim P)) (a:Euc (dim A))
=> J _ p (I _ p a);
Why does compose accept only one parameter? How do I fix it?