I'm reading the book Software Foundation. On the chapter "More on Induction", the authors talk about the induction principle generated by coq when a inductive type is define.
An exercice is the following. Encapsulate the notion of association for "+" in a definition and then apply the nat_ind on it.
My first guess for the definition was the following :
Definition P_plusassoc (n m o:nat) : Prop :=
n + (m+ o) = (n+m) +o.
But then, I have the problem when I want to proof this :
Theorem plus_assoct : forall o m n, P_plusassoc n m o.
Proof.
apply nat_ind.
nat_ind
doesn't work. So I thought it was because P_plusassoc
does not depend of just one integer but three.
So I rewrite P_plusassoc
this way :
Definition P_plusassoc (n:nat) : nat->nat->Prop :=
fun (m o:nat) => n + (m+ o) = (n+m) +o.
But it still doesn't work. Where is the problem ? How can I define P_plusassoc
to use nat_ind
?