algebraic data types - In Agda is it possible to define a datatype that has equations? -
I want to describe the integer: set the data integer: Z: Integer succ: integer - & gt; Integer Completed: Integer - & gt; Maximum Marks ?? Do not define the above integers and we need Succ (Pred x) = x and Pred (Succ x) = x, however, spReduce: (m: integer) - & gt; Succ (Pred m) = m psReduce: (m: integer) - & gt; Pred (Succ m) = m Can not be added to the data type A better definition of integer is most definitely, Data Integers: set Pauses: Net - & gt; Integer negative: Net - & gt; Integers But I'm curious if there is a way to add equations to datat. It looks like what you want to do, your Integers equivalence relationship Type as a quotient type which recognizes m with Succ (Pred M) and so on. Now Agda does not support - an experimental library had tried to do this (it was defined through an auxiliary work to force all actions on the basis of a subsidiary, for which proof of the reciprocal invariance required ), But then someone...