On 06/12/2010 01:50 PM, Waldek Hebisch wrote:
> Bill Page wrote:
>> Ralf,
>>
>> I think that the map
>>
>>    coerce : Fraction Polynomial Complex Integer -> %
>>
>> which is apparently  x+-> [x,x]
>>
>> in
>>
>> )sh DirectProduct(2,Fraction Polynomial Complex Integer)
>>
>> should not be called a coercion.
> 
> Good spot.  AFAICS that coercion is defined because we have
> 
>     if R has SetCategory then FullyRetractableTo R
> 
> in DirectProductCategory.  IMHO this does not make sense.
> But before removing it one have to fix a few places in algebra
> (at least retract in SquareMatrix) where the retraction from direct
> product to scalars is used.

Waldek,

what exactly is the problem?

coerce: R -> %

or

retract % -> R

for % being DirectProduct(ndim, R)?

Bill and me discussed the coercion. If you check hyperdoc for
DirectProduct and click on "origin" for the function "coerce", then you
see that coerce: R -> % comes from Algebra(R). It just needs that R is a
CommutativeRing. Thus, removing FullyRetractableTo R will probably have
no effect on my original problem.

As for 'retract'. I think that this is not realy dangerous. It is
implemented as

      if R has SetCategory then
        same?: % -> Boolean
        same? z == every?(x +-> x = z(minIndex z), z)

        retract(z:%):R ==
          same? z => z(minIndex z)
          error "Not retractable"

So why do you think that it doesn't make sense?
I would have thought that one would naturally perhaps rather ask

  if R has CommutativeRing then ...

in order to be in some sense the inverse for the coerce function, but I
cannot currently see that "R has SetCategory" is much of a problem.

Ralf

-- 
You received this message because you are subscribed to the Google Groups 
"FriCAS - computer algebra system" group.
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/fricas-devel?hl=en.

Reply via email to