#16507: Better handling of subspace construction in pushout
-------------------------------------+-------------------------------------
Reporter: pbruin | Owner:
Type: defect | Status: needs_review
Priority: minor | Milestone: sage-6.4
Component: categories | Resolution:
Keywords: pushout subspace, | Merged in:
sd59 | Reviewers:
Authors: Peter Bruin, | Work issues:
Robert Bradshaw | Commit:
Report Upstream: N/A | 60be6dc68909aae573ab970f797b603013eaf62d
Branch: | Stopgaps:
u/robertwb/ticket/16507 |
Dependencies: |
-------------------------------------+-------------------------------------
Changes (by {'newvalue': u'Peter Bruin, Robert Bradshaw', 'oldvalue': u'Peter
Bruin'}):
* commit: 1e75320fbe3cbc7d0b639f789aa0c0ef71cad746 =>
60be6dc68909aae573ab970f797b603013eaf62d
* author: Peter Bruin => Peter Bruin, Robert Bradshaw
Old description:
> When taking a pushout of two modules in the case where the construction
> of exactly one of them involves a subspace construction, the result does
> not have a coercion map from the other object:
> {{{
> sage: A = ZZ^2
> sage: V = span([[1, 2]], QQ)
> sage: P = sage.categories.pushout.pushout(A, V)
> sage: P
> Vector space of degree 2 and dimension 1 over Rational Field
> User basis matrix:
> [1 2]
> sage: P.has_coerce_map_from(A)
> False
> }}}
> The explanation is that for the other currently existing constructions
> `F`, the result `F(X)` of applying the construction to `X` has a coercion
> map ''from'' `X`, but for the subspace construction, `F(X)` only has a
> coercion map ''to'' `X`.
>
> This ticket addresses this by equipping the class `ConstructionFunctor`
> with an attribute `coercion_reversed`, which is `False` by default; if it
> is `True` for a construction `F`, then the pushout of two objects omits
> `F` in the case where (at a given step of constructing the pushout)
> exactly one of the two constructions is `F`. Of course, we set
> `coercion_reversed = True` for the subspace construction.
>
> No change is necessary in the case where both constructions involve `F`,
> since this situation should be taken care of by `F.merge()`. This is
> indeed true for the subspace construction, where `F.merge()` takes the
> sum of the two subspaces.
>
> The situation described above can be viewed as the case where one of the
> two constructions involves a "trivial" application of `F`, i.e. with the
> subspace equal to the whole space. Hence we should interpret our
> situation as a case where the effect of `merge()` with one trivial
> argument is desired.
>
> In the above example, this strategy will cause `P` to be equal to `QQ^2`,
> as might be expected.
New description:
When taking a pushout of two modules in the case where the construction of
exactly one of them involves a subspace construction, the result does not
have a coercion map from the other object:
{{{
sage: A = ZZ^2
sage: V = span([[1, 2]], QQ)
sage: P = sage.categories.pushout.pushout(A, V)
sage: P
Vector space of degree 2 and dimension 1 over Rational Field
User basis matrix:
[1 2]
sage: P.has_coerce_map_from(A)
False
}}}
The explanation is that for the other currently existing constructions
`F`, the result `F(X)` of applying the construction to `X` has a coercion
map ''from'' `X`, but for the subspace construction, `F(X)` only has a
coercion map ''to'' `X`.
This ticket addresses this by equipping the class `ConstructionFunctor`
with an attribute `coercion_reversed`, which is `False` by default; if it
is `True` for a construction `F`, then the pushout of two objects omits
`F` in the case where (at a given step of constructing the pushout)
including it would not yield a coercion to the final domain. Of course,
we set `coercion_reversed = True` for the subspace construction.
No change is necessary in the case where both constructions involve `F`,
since this situation should be taken care of by `F.merge()`. This is
indeed true for the subspace construction, where `F.merge()` takes the sum
of the two subspaces.
The situation described above can be viewed as the case where one of the
two constructions involves a "trivial" application of `F`, i.e. with the
subspace equal to the whole space. Hence we should interpret our
situation as a case where the effect of `merge()` with one trivial
argument is desired.
In the above example, this strategy will cause `P` to be equal to `QQ^2`,
as might be expected.
--
Comment:
New commits:
||[http://git.sagemath.org/sage.git/commit/?id=5edca1c7dc3e76b4c2012089192b5121f1fa82f7
5edca1c]||{{{Merge branch 'u/pbruin/16507-pushout_coercion_reversed' of
git://trac.sagemath.org/sage into coerce-16507}}}||
||[http://git.sagemath.org/sage.git/commit/?id=60be6dc68909aae573ab970f797b603013eaf62d
60be6dc]||{{{Check coercions when applying coercion reversed construction
functors.}}}||
--
Ticket URL: <http://trac.sagemath.org/ticket/16507#comment:8>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" 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-trac.
For more options, visit https://groups.google.com/d/optout.