Fixpoint arity (T:Type) (n:nat) :=
 match n with
 | 0 => Prop
 | S p => T -> arity T p
 end.(* Warning cartesianPower T 0 represents T but it is never used *)

Fixpoint cartesianPowerAux (T:Type) (n:nat) :=
 match n with
 | 0 => T
 | S p => (T * cartesianPowerAux T p)%type
 end.Definition cartesianPower T n := cartesianPowerAux T (n-1).Definition headCP {T:Type} {n:nat} (cp : cartesianPower T (S n)) : T.Definition headCPbis {T:Type} {n:nat} (cp : cartesianPower T (S n)) : cartesianPower T 1.Definition tailCP {T:Type} {n:nat} (cp : cartesianPower T (S (S n))) : (cartesianPower T (S n)).Definition tailDefaultCP {T:Type} {n:nat} (cp : cartesianPower T (S n)) (Default : cartesianPower T n) : (cartesianPower T n).Definition allButLastCP {T:Type} {n:nat} (cp : cartesianPower T (S (S n))) : (cartesianPower T (S n)).

(* Specifications: *)
Lemma allButLastCPTl {T:Type} {n:nat} : forall (cp : cartesianPower T (S (S (S n)))), allButLastCP (tailCP cp) = tailCP (allButLastCP cp).