[Haskell-cafe] Sum and Product do not respect the Monoid laws

Carter Schonwald carter.schonwald at gmail.com
Sat Sep 27 19:36:56 UTC 2014


To replicate the explanation i gave on IRC,

(to use subscripting in pseudo haskell)

for any type where we can define some sort of distance (induced via a norm
via dist a b = norm (a -b ), ignoring overflow issues)

lets define a quantitative version of equality

a ==_{r} b =  if  dist a b <= r then True else False

then we use the triangle inequality (dist a c <= dist a b + dist b c)
to get the following quantitative analogue of  transitivity

a ==_{r1} b &&  b ==_{r2} c  IMPLIES   a ==_{r1 + r2} c

this is a bit more general (and weaker) than the notion of equality that
we're accustomed to, but still a  pretty natural idea.
you can consider more general things than using the + function too, like
min/max/sum of squares etc. But I leave that as a fun exercise for the
reader.

this gets into talking about reasoning about things using tools from
Analysis rather than Algebra, and that sort of modeling is pretty powerful.
http://en.wikipedia.org/wiki/Normed_vector_space and the associated page on
Hilber tSpaces can be a useful starting point i guess.

I guess my point is Analysis is a very powerful far reaching mathematical
tool, and only considering models that elide that is ...  :)







On Sat, Sep 27, 2014 at 1:12 PM, Albert Y. C. Lai <trebla at vex.net> wrote:

> On 14-09-27 10:02 AM, Carter Schonwald wrote:
>
>> Its approximately transitive. Distances always obey the triangle
>> Inequality.  Good enough for geometry.  Also the emphasis is on the
>> geometry / distance.
>>
>
> You've got me curious. How do we define "approximately transitive"?
>
> (I am not one of those who want to rid floating point of Eq and Ord, or
> rid of floating point altogether.)
>
>
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20140927/7dc87c6c/attachment.html>


More information about the Haskell-Cafe mailing list