I think we are thinking of these indetermanents wrongly--they are  
dummy variables and have should really have no context outside of the  
function definition. Another problem is that, if we say f = sin(a)+cos 
(x), then f(1,2) is ambiguous. Here's what I think should happen:

f = sin(x) should be illegal (though I'm not sure how to throw an  
informative error here). Instead one should have to type f(x) = sin 
(x). This would be pre-parsed to something like

with inject_indetermanents('x'):
     f = sin(x)

Here inject_indetermanents would be assign x to an indetermanent that  
knows both its name (for printing) and its position (in the tuple if  
f is called with multiple arguments, and x is recursively called down  
the tree). It would be a morphism of the category of sets and always  
act as the identity function on __call__. It could, say, know how to  
differentiate itself (return 1 if the variable with respect to  
integration matches self.name, 0 (or dx/dother) otherwise. It would  
support addition, exponentiation, etc. via a generic "sum" class that  
takes two functions and returns a function. Coercible into R[x], etc.

(I'm not sure how contexts work, perhaps the all the indetermanents  
in the block would have to be wrapped... this is still doable via  
regular expressions...)

Any comments?

- Robert

On Dec 4, 2006, at 11:26 AM, William Stein wrote:

> On Mon, 04 Dec 2006 06:38:16 -0800, Joel B. Mohler
> <[EMAIL PROTECTED]> wrote:
>> I'm not sure I entirely agree with this.  I see that it could be done
>> this
>> way, but it seems quite mathematically strange to me.  The fraction
>> field of
>> a ring is a well-known mathematical object, but the idea of putting a
>> generator for a polynomial ring in an exponent is entirely  
>> undefined in
>> any
>> abstract sense (unless there's some mathematics I'm missing).
>
> It defines the formal function x |--> x^x, which is defined on all
> numbers x such that x^x is defined.  It is at least as meaningful as
> the following:
>
>   def f(x):
>       return x^x
>
> William
>
> 

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~----------~----~----~----~------~----~------~--~---

Reply via email to