Why are the domains PositiveInteger? and NonNegativeInteger? defined as SubDomains of Integer insteadof the other way around? Here is a (still somewhat imperfect) example of one way of defining Integer from a more primitive domain (some domain without negatives and perhaps without zero, sometimes called a rig - ring without negative) although Axiom does not currently implement such a category. (Related: category RNG - ring without identity). - John Baez wrote:
- Rigs are neglected in ordinary algebra texts, a deficiency that someday must be fixed. Why? First, a lot of stuff that’s true about rings is still true about rigs. Second, and much more importantly, any approach to algebra that doesn’t make room for the natural numbers is clearly defective: the natural numbers are a fundamental algebraic structure that must be reckoned with!
http://golem.ph.utexas.edu/category/2008/05/theorems_into_coffee_iii.html (Refer also to his discussion of PROPS.) Most CAS doesn't bother to define natural numbers via the Peano Axioms and then derive integers, for example, as an equivalence class of pairs of natural numbers so that (a, b) ~ (c, d) iff a + d = b + c. The question is whether a compiler could be smart enough to replace the definition via equivalence classes by an efficient representation that is, for example, used by GMP. First let's define a constructor name fricas (1) -> <spad> fricas )abbrev domain DIFF Difference Difference(T:Join(Monoid, fricas Compiling FriCAS source code from file /var/lib/zope2.10/instance/axiom-wiki/var/LatexWiki/7646994448072444383-25px001.spad using old system compiler. DIFF abbreviates domain Difference ------------------------------------------------------------------------ initializing NRLIB DIFF for Difference compiling into NRLIB DIFF ****** Domain: T$ already in scope ****** Domain: T$ already in scope ****** Domain: T$ already in scope processing macro definition Rep ==> Record(neg: T$, Now use DIFF to define an "Integer" fricas i:DIFF(CardinalNumber) Type: Voidfricas i:=2
Type: Difference(CardinalNumber?)fricas j:=i-4
Type: Difference(CardinalNumber?)fricas k:=j+2
Type: Difference(CardinalNumber?)fricas test(k=0)
Type: Booleanfricas i:=1234567
Type: Difference(CardinalNumber?)fricas j:=i-7654321
Type: Difference(CardinalNumber?)fricas k:=j+6666666-246912
Type: Difference(CardinalNumber?)fricas test(k=0)
Type: BooleanThe point of this construction is to illustrate several problems. One such problem is that current generation of compilers in computer algebra systems such as Axiom, specifically Spad and Aldor, are not able to automatically convert this presumably mathematically correct specification to an efficient implementation, e.g. signed integers. Another issue is why these languages do not have some built-in support for such common algebraic constructions as "taking a quotient". In particular, there seems to be no general way of defining a "canonical representation". |

A mathematician, a biologist and a physicist--Bill Page, Sun, 27 Jul 2008 11:11:48 -0700 reply