>> ...
>> What bothers me more is the meaning of the category Eltable. In
>> typical Axiom style we are not told very much about what it means.
>> In some cases, e.g. Ring, not much more is needed than a reference
>> to ring as a well-known mathematical object. But really we should
>> probably expect a set of axioms to be associated with each category.
>> What axioms should we associate with Eltable? We are only told that
>> the members of % are "data structures" and "algebraic structures' that
>> have some kind of "indexed elements". My point is that I suspect that
>> we can not specify reasonable axioms for Eltable without requiring
>> equality on S. Maybe I am wrong.
>
> 1) You can use equality in axioms without having equality as
> export.
The concept of using equality in the definition of a category without
exporting it strongly contrasts your view of the FriCAS/Axiom library
from my own. I specifically said library and not just SPAD because
you are perfectly correct that it is possible to do anything you like
when using SPAD as a general purpose programming language, say for
writing a accounting application. But in the design of the FriCAS
library it seems to me very natural to think of every domain and
category as a mathematical object - not just *representing* some
mathematics but actually *being* a concrete realization of some
mathematical concept. Of course to a greater or lesser extent the
identification of FriCAS objects as mathematical depends on one's
imagination but this is strongly aided by the association of exported
operations with essential attributes of objects. In essence an object
is defined by what it exports (and a set of axioms).
So for example among a few other things RING exports:
?*? : (%,%) -> %
?+? : (%,%) -> %
-? : % -> %
?=? : (%,%) -> Boolean
1 : () -> %
0 : () -> %
with these axioms:
For all a, b in %, the result of the operation a + b is also in %.
For all a, b in %, the result of the operation a * b is also in %.
There exists an element 0 in %, such that for all elements a in %, the
equation 0 + a = a + 0 = a holds.
For all a, b and c in %, the equation (a + b) + c = a + (b + c) holds.
For all a and b in %, the equation a + b = b + a holds.
For each a in %, there exists an element -a in R such that a + (-a) =
0, where 0 is the additive identity element.
There exists an element 1 in %, such that for all elements a in %, the
equation 1 * a = a * 1 = a holds.
For all a, b and c in %, the equation (a * b) * c = a * (b * c) holds.
For all a and b in %, the equation a * b = b * a holds.
For all a, b and c in %, the equation (a + b) * c = (a * c) + (b * c) holds.
For all a, b and c in %, the equation a * (b + c) = (a * b) + (a * c) holds.
These axioms can all be expressed in terms of just those the operators
that are exported. It would seem exceedingly strange to me if Ring did
not export =.
> 2) I am not sure we can give nice axioms for Eltable. To say
> the truth I am afraid that nice axioms are just product
> of sloppy way of developing math.
That is a remarkable statement!! Of course I did not claim that the
axioms had to be "nice" whatever that means.
> More precisely, we
> can give nice axioms for isolated domains. But when we
> try to fit them together we frequently have cases when
> we want to use code even when assumptions are violated.
For me this would mean that it was time to review the axioms.
> Case in point is Euclid's algorithm. Theoretically we
> need EuclideanDomain, that is ring without zero divisors
> to use it. But we may try to use it for polynomials over
> product of fields. If we hit zero divisor, then we fail.
> But if all divisons work then we get GCD.
Now you introduce a new concept: "fail". To me this means that the
logic is no longer simply Aristotelian (i.e. every statement is either
"true" or "false"). In principle I have no objection to this but I
think it deserves to be reconized explicitly and for the most part in
FriCAS it is via the 'Union(%,"failed")' construct.
> 3) Equality is fundamental to math, frequently it is considered
> part of logic. Without equality it is hard to formulate
> any axioms. So still I do not see why you worry about
> Eltable and accept categories and domains without equality.
>
Yes you are right. In fact it seems to me that a domain without any
kind of equality is a kind of lie. But a fundamental division in the
FriCAS library occurs at the top of the category lattice heterarchy
between BasicType and Aggregate. Everything below BasicType exports =
while those below Aggregate export
eq? : (%,%) -> Boolean
where
eq?(x,y) -> true if x is identical to y, otherwise false
Presumably 'eq?' is often implemented as just EQ$Lisp. Aggregates are
supposedly "data structure"-like objects with things of BasicType are
supposedly "algebraic". But some domains are both, e.g. Set.
My point here is to refer again to the article by Davenport "Equality
in Computer Algebra and Beyond".
It is not clear to me whether or not Eltable is intended to be "data
structure"-like or not and whether the index domain S should also be
just "data structure"-like or mathematical. Right now the definition
says it should be mathematical.
>> >> > If equality in not computable, than having no equality is
>> >> > natural.
>> >> >
>> >>
>> >> Can you give an example?
>> >
>> > Canonical example are functions given by their code. Also
>> > various lazy infinite structures like computable reals.
>> > Ralf mentioned streams and series: currently we cheat and
>> > provide fake equality but since real equality is not
>> > computable it would be more natural to provide none.
>>
>> Then this should also apply to Expression, no? If not, then why can we
>> not do for these other domains what we do for Expression?
>
> Expression is at edge of computability: on large subsets mathematical
> equality is decidable. And current equality is a well defined
> equivalence relation which agrees with mathematical equality
> on many important subsets. We do not know is something similar
> is possible for other domains (and if possible how to do it).
>
If equality really is not computable than maybe it would be more
"natural" if equality was defined as
= : (?,?) -> Union(Boolean,"failed")
>> > AFAICS modification to XHashTable can be done without touching
>> > any other domain, in particular other domains will not get any
>> > extra exports. We need to adjust categories, but relaxed
>> > parameters do not affect any existing domain.
>> >
>>
>> So, with TableAggregate(Key: Type,Entry: Type), if we specify a Key
>> that does not export =$key will TableAggregate still export 'table()'
>> with no arguments? If so, what will XHashTable do to implement it?
>
> Well, 'table()' should be a conditional export of TableAggregate...
>
So this means that TableAggregate only provides a means to create
members of % if Key is of type SetCategory, otherwise creating members
is somehow unique to the domain. This works but I am not sure if we
should consider it fully satisfactory.
Bill.