[Agda] simple question

Kyle Miller kmill at berkeley.edu
Tue Oct 14 07:22:49 CEST 2014


Induction is not needed here:

eq-succ : {n m : Nat} → n == m → succ n == succ m
eq-succ (refl m) = refl (succ x)

I am not certain of the details, but I believe that the pattern (refl m) makes
it so you only need to prove  succ m == succ m  because of unification.

On Mon, Oct 13, 2014 at 7:13 PM, Andrew Harris <andrew.unit at gmail.com>
wrote:

> Hello,
>
>    I'm trying to follow along in the very good paper "Dependent Types At
> Work" written by Ana Bove and Peter Dybjer.  I'm stuck at trying to prove
> "eq-succ", which is one of the exercises in Section 4.4.  The closest I can
> make it is the following:
>
> {- proof of eq-succ -}
> eq-succ : {n m : Nat} → n == m → succ n == succ m
> eq-succ (refl m) = natrec {(\k → (k + m) == (plus k m))} (refl m) (\i h →
> ((succ i) + m) == (plus (succ i) m)) m
>
> But this does not typecheck, I get the error:
>
> Set !=< (succ i + m) == plus (succ i) m of type Set₁
> when checking that the expression (succ i + m) == plus (succ i) m
> has type (succ i + m) == plus (succ i) m
>
> I'm stuck -- I don't quite understand what I'm supposed to create an
> element of Set_1 that has a signature of (succ i + m) == plus (succ i) m, (if
> that's what I'm supposed to do).  Any hints would be appreciated!
>
> -andrew
>
> _______________________________________________
> Agda mailing list
> Agda at lists.chalmers.se
> https://lists.chalmers.se/mailman/listinfo/agda
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.chalmers.se/pipermail/agda/attachments/20141013/27d2f406/attachment-0001.html


More information about the Agda mailing list