sagemath / sage

Main repository of SageMath
https://www.sagemath.org
Other
1.3k stars 449 forks source link

FreeModule(QQ, 2) not in Modules(QQ).FiniteDimensional() #30192

Open mkoeppe opened 4 years ago

mkoeppe commented 4 years ago
sage: V = FreeModule(QQ, 2)
sage: V.category()
Category of finite dimensional vector spaces with basis over (number fields and quotient fields and metric spaces)
sage: V in Modules(QQ)
True
sage: V in Modules(QQ).FiniteDimensional()
False

sage: V.Hom(V)
Set of Morphisms (Linear Transformations) from Vector space of dimension 2 over Rational Field to Vector space of dimension 2 over Rational Field
sage: V.Hom(V) is V.Hom(V, category=Modules(QQ))
False

CC: @tscrim

Component: categories

Issue created by migration from https://trac.sagemath.org/ticket/30192

tscrim commented 4 years ago
comment:1

This is actually an issue with the category framework:

sage: V = QQ^3
sage: V.category()
Category of finite dimensional vector spaces with basis over (number fields and quotient fields and normed rings)
sage: V in Modules.FiniteDimensional
True

So why is the category not over a base ring, that is because we didn't want to have to create a new category when we range over different finite fields. This caused a lot of slowdown. So we shifted to allowing the base ring of the category to instead be the category of the base ring.

What you are seeing here is a limitation of this. This is a little more tricky to work out as there is a bunch of technical issues with the containment checking, but it is something we want to do. It might be possible to hack around it, but I don't see how from a quick look.

mkoeppe commented 3 years ago
comment:3

Setting new milestone based on a cursory review of ticket status, priority, and last modification date.