On Mon, Mar 17, 2014 at 09:27:06PM -0400, Mark Shimozono wrote:
> There needs to be some serious thought about computability in Hom
> categories.. In what categories can one automatically compute the
> inverse of an invertible map, tell whether a morphism is zero,
> optimize composition of morphisms, etc. The TestSuites should be
> smart enough to automatically reflect this.
Yup! Please throw your ideas in #10668! With would-be doctests is best!
> I am coming around to the viewpoint that one should almost never
> need to use "orphan" functions. (Yet I have been using a lot of them
> for doctests in new smash product code, where the required actions
> are not necessarily already incorporated into existing objects).
>
> For identity morphisms, one can define a single global "_the_id" identity
> pure function
> and have everyone's identity morphism wrap it by calling SetMorphism.
> It passes pickling, is as cheap as possible, and provides identity morphisms,
> which, for categorical and other reasons, are needed.
>
> But the right solution is to do the same thing but "officially" by
> strengthening the Hom code to supply identity morphisms and their
> properties. Implementation of categories should be enhanced to have
> special objects such as identity objects. So when you get around to
> messing with Homs, please add identity morphisms as
> category-flavored wrappers around a single little pure identity
> function, and the knowledge to the Hom code that the identity
> morphism composes trivially.
There already is some stuff in that direction:
sage: sage: S = Sets().example()
sage: S
Set of prime numbers (basic implementation)
sage: H = End(S)
sage: id = H.identity(); id
Identity endomorphism of Set of prime numbers (basic implementation)
sage: id * id
Identity endomorphism of Set of prime numbers (basic implementation)
sage: h = H(lambda p: p.next_prime()); h
Generic endomorphism of Set of prime numabers (basic implementation)
sage: h(3)
5
sage: id * h
Generic endomorphism of Set of prime numbers (basic implementation)
sage: h * id # Oops!
Composite map:
From: Set of prime numbers (basic implementation)
To: Set of prime numbers (basic implementation)
Defn: Identity endomorphism of Set of prime numbers (basic
implementation)
then
Generic endomorphism of Set of prime numbers (basic
implementation)
Cheers,
Nicolas
--
Nicolas M. ThiƩry "Isil" <[email protected]>
http://Nicolas.Thiery.name/
--
You received this message because you are subscribed to the Google Groups
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.