[Agda] what is happening here?

Thorsten Altenkirch Thorsten.Altenkirch at nottingham.ac.uk
Sun Mar 8 19:26:23 CET 2020


I define

record isMonoid {A : Set}(e : A)(_•_ : A → A → A) : Prp where
  field
    lneutr : {x : A} → e • x ≡ x
    rneutr : {x : A} → x • e ≡ x
    assoc : {x y z : A} → (x • y) • z ≡ x • (y • z)

and I have shown all 3 properties, in particular:

assoc+ : {l m n : ℕ} → (l + m) + n ≡ l + (m + n)

but when I try

isMonoid : isMonoid zero _+_
+isMonoid = record {
  lneutr = lneutr+ ;
  rneutr = rneutr+ ;
  assoc = assoc+ }

I get some unsolved constraints, even though my proof and the goal are alpha-equivalent! Ok I can fix this by eta expanding:

  assoc = λ {x}{y}{z} → assoc+ {x}{y}{z}

But this shouldn’t be necessary.






This message and any attachment are intended solely for the addressee
and may contain confidential information. If you have received this
message in error, please contact the sender and delete the email and
attachment. 

Any views or opinions expressed by the author of this email do not
necessarily reflect the views of the University of Nottingham. Email
communications with the University of Nottingham may be monitored 
where permitted by law.




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.chalmers.se/pipermail/agda/attachments/20200308/b1f583f4/attachment.html>


More information about the Agda mailing list