Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A polynomial ring contains its basering #23203

Closed
saraedum opened this issue Jun 9, 2017 · 29 comments
Closed

A polynomial ring contains its basering #23203

saraedum opened this issue Jun 9, 2017 · 29 comments

Comments

@saraedum
Copy link
Member

saraedum commented Jun 9, 2017

Currently, this fails

sage: R.<x> = ZZ[]
sage: S.<y> = R[]
sage: R.is_subring(S)
NotImplementedError

Depends on #23204

CC: @jpflori

Component: commutative algebra

Keywords: sd86.5, sd87

Author: Julian Rüth

Branch/Commit: 5f99cf9

Reviewer: Claire Tomesch

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

@saraedum

This comment has been minimized.

@saraedum
Copy link
Member Author

saraedum commented Jun 9, 2017

Dependencies: #23204

@saraedum
Copy link
Member Author

saraedum commented Jun 9, 2017

@saraedum
Copy link
Member Author

saraedum commented Jun 9, 2017

New commits:

17b8374A polynomial ring contains its basering

@saraedum
Copy link
Member Author

saraedum commented Jun 9, 2017

Commit: 17b8374

@saraedum
Copy link
Member Author

saraedum commented Jun 9, 2017

comment:5

(needs review: the is_subring does not work without #23204.)

@saraedum
Copy link
Member Author

Author: Julian Rüth

@tscrim
Copy link
Collaborator

tscrim commented Jun 23, 2017

comment:8

While it is a degenerate case, a polynomial ring could be isomorphic to its base ring:

sage: PolynomialRing(ZZ, [])
Multivariate Polynomial Ring in no variables over Integer Ring

@roed314
Copy link
Contributor

roed314 commented Jul 17, 2017

Changed keywords from sd86.5 to sd86.5, sd87

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jul 17, 2017

Changed commit from 17b8374 to a9d8b4f

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jul 17, 2017

Branch pushed to git repo; I updated commit sha1. Last 10 new commits:

4b17dd8Fixing doctest errors from the change to natural_map in ring homsets
80cd0ffMerge branch 'develop' into t/23204/remove_ringhomomorphism_coercion
5c7d1b9Merge branch 'develop' of git://trac.sagemath.org/sage into t/23204/remove_ringhomomorphism_coercion
2043ff3Fixing doctest errors
d7eb179Remove RingHomomorphism_coercion
dbd5b0dfix morphism printing in doctests
f606020Fixed some doctests
db5cee6implement zero() for ring homsets
a42ebcfimplement `__nonzero__` when there is no zero element
a9d8b4fMerge branch 't/23204/remove_ringhomomorphism_coercion' into t/23203/a_polynomial_ring_contains_its_basering

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jul 20, 2017

Changed commit from a9d8b4f to 5f99cf9

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jul 20, 2017

Branch pushed to git repo; I updated commit sha1. New commits:

5f99cf9Merge branch 'develop' into t/23203/a_polynomial_ring_contains_its_basering

@sagetrac-cmt
Copy link
Mannequin

sagetrac-cmt mannequin commented Jul 20, 2017

Reviewer: cmt

@jpflori
Copy link
Contributor

jpflori commented Jul 20, 2017

comment:13

Full names in reviewer field please :)

@sagetrac-cmt
Copy link
Mannequin

sagetrac-cmt mannequin commented Jul 20, 2017

Changed reviewer from cmt to none

@saraedum
Copy link
Member Author

Reviewer: Claire Tomesch

@sagetrac-cmt
Copy link
Mannequin

sagetrac-cmt mannequin commented Jul 21, 2017

comment:16

After fetching and merging #23204 into my local branch for this ticket, I built sage. I then ran ./sage -coverage <files> for all the files listed in the diff for this ticket, and compared that to the results of running the same command for the latest build of develop (8.0 rc2). The same number of missing doctests occurred in each build for each file, and although the total number of doctests for src/sage/rings/morphism.pyx and src/sage/rings/polynomial/polynomial_element.pyx changed between the develop build and this build, this was to be expected given the number of methods deleted (__nonzero__ and is_zero) and the number of trivial methods added (is_injective and (is_surjective), respectively. So, it appears that functionally the doctest coverage remained the same.

I am still within the (lengthly) process of running ./sage -tp 8 --long src/ now. It has produced some errors, which I will attempt to replicate before posting about them. Running all of the doctests may have been a mistake... I will also retry a more limited set of doctests shortly as well.

@adeines
Copy link
Mannequin

adeines mannequin commented Jul 21, 2017

comment:17

I just updated #23204 to fix typos in two of the doctest. If you are getting a two failures, you might try checking out the updated ticket.

Replying to @sagetrac-cmt:

After fetching and merging #23204 into my local branch for this ticket, I built sage. I then ran ./sage -coverage <files> for all the files listed in the diff for this ticket, and compared that to the results of running the same command for the latest build of develop (8.0 rc2). The same number of missing doctests occurred in each build for each file, and although the total number of doctests for src/sage/rings/morphism.pyx and src/sage/rings/polynomial/polynomial_element.pyx changed between the develop build and this build, this was to be expected given the number of methods deleted (__nonzero__ and is_zero) and the number of trivial methods added (is_injective and (is_surjective), respectively. So, it appears that functionally the doctest coverage remained the same.

I am still within the (lengthly) process of running ./sage -tp 8 --long src/ now. It has produced some errors, which I will attempt to replicate before posting about them. Running all of the doctests may have been a mistake... I will also retry a more limited set of doctests shortly as well.

@sagetrac-cmt
Copy link
Mannequin

sagetrac-cmt mannequin commented Jul 21, 2017

comment:18

Okay, something in my configuration had gotten messed up, so I started over entirely. I just pulled the latest version of this branch (5f99cf980c), which has the content of #23204 already merged in, merged in the latest develop branch (74b03027bc), and rebuilt. I then ran the following limited set of doctests and got these results:

bash-3.2$ ./sage -tp 8 --long src/sage/structure/ src/sage/categories/ src/sage/rings/ src/sage/modular/ src/sage/schemes/

too few successful tests, not using stored timings
Running doctests with ID 2017-07-21-16-33-34-b8fb451a.
Git branch: t/23203/a_polynomial_ring_contains_its_basering
Using --optional=ccache,mpir,python2,sage
Sorting sources by runtime so that slower doctests are run first....
Doctesting 883 files using 8 threads.

...

sage -t --long src/sage/schemes/curves/projective_curve.py
**********************************************************************
File "src/sage/schemes/curves/projective_curve.py", line 1304, in sage.schemes.curves.projective_curve.ProjectivePlaneCurve.ordinary_model
Failed example:
    D = C.ordinary_model(); D # long time (2 seconds)
Exception raised:
    Traceback (most recent call last):
      File "/Sage/sage/local/lib/python2.7/site-packages/sage/doctest/forker.py", line 509, in _run
        self.compile_and_execute(example, compiler, test.globs)
      File "/Sage/sage/local/lib/python2.7/site-packages/sage/doctest/forker.py", line 872, in compile_and_execute
        exec(compiled, globs)
      File "<doctest sage.schemes.curves.projective_curve.ProjectivePlaneCurve.ordinary_model[8]>", line 1, in <module>
        D = C.ordinary_model(); D # long time (2 seconds)
      File "/Sage/sage/local/lib/python2.7/site-packages/sage/schemes/curves/projective_curve.py", line 1393, in ordinary_model
        emb = extension(C.singular_subscheme())
      File "/Sage/sage/local/lib/python2.7/site-packages/sage/schemes/curves/projective_curve.py", line 1373, in extension
        pts = self.change_ring(F.embeddings(QQbar)[0]).rational_points()
      File "/Sage/sage/local/lib/python2.7/site-packages/sage/schemes/generic/algebraic_scheme.py", line 1846, in change_ring
        I = [f.change_ring(R) for f in self.defining_polynomials()]
      File "sage/rings/polynomial/multi_polynomial.pyx", line 873, in sage.rings.polynomial.multi_polynomial.MPolynomial.change_ring (build/cythonized/sage/rings/polynomial/multi_polynomial.c:13133)
        return self.parent().change_ring(R)(self)
      File "sage/rings/polynomial/multi_polynomial_ring_generic.pyx", line 985, in sage.rings.polynomial.multi_polynomial_ring_generic.MPolynomialRing_generic.change_ring (build/cythonized/sage/rings/polynomial/multi_polynomial_ring_generic.c:15237)
        return PolynomialRing(base_ring, self.ngens(), names, order=order)
      File "/Sage/sage/local/lib/python2.7/site-packages/sage/rings/polynomial/polynomial_ring_constructor.py", line 438, in PolynomialRing
        raise TypeError('base_ring must be a ring')
    TypeError: base_ring must be a ring
**********************************************************************
File "src/sage/schemes/curves/projective_curve.py", line 1321, in sage.schemes.curves.projective_curve.ProjectivePlaneCurve.ordinary_model
Failed example:
    all([D.codomain().is_ordinary_singularity(Q) for Q in D.codomain().singular_points()]) # long time
Exception raised:
    Traceback (most recent call last):
      File "/Sage/sage/local/lib/python2.7/site-packages/sage/doctest/forker.py", line 509, in _run
        self.compile_and_execute(example, compiler, test.globs)
      File "/Sage/sage/local/lib/python2.7/site-packages/sage/doctest/forker.py", line 872, in compile_and_execute
        exec(compiled, globs)
      File "<doctest sage.schemes.curves.projective_curve.ProjectivePlaneCurve.ordinary_model[9]>", line 1, in <module>
        all([D.codomain().is_ordinary_singularity(Q) for Q in D.codomain().singular_points()]) # long time
    NameError: name 'D' is not defined
**********************************************************************
File "src/sage/schemes/curves/projective_curve.py", line 1329, in sage.schemes.curves.projective_curve.ProjectivePlaneCurve.ordinary_model
Failed example:
    C.ordinary_model() # long time (5 seconds)
Exception raised:
    Traceback (most recent call last):
      File "/Sage/sage/local/lib/python2.7/site-packages/sage/doctest/forker.py", line 509, in _run
        self.compile_and_execute(example, compiler, test.globs)
      File "/Sage/sage/local/lib/python2.7/site-packages/sage/doctest/forker.py", line 872, in compile_and_execute
        exec(compiled, globs)
      File "<doctest sage.schemes.curves.projective_curve.ProjectivePlaneCurve.ordinary_model[13]>", line 1, in <module>
        C.ordinary_model() # long time (5 seconds)
      File "/Sage/sage/local/lib/python2.7/site-packages/sage/schemes/curves/projective_curve.py", line 1393, in ordinary_model
        emb = extension(C.singular_subscheme())
      File "/Sage/sage/local/lib/python2.7/site-packages/sage/schemes/curves/projective_curve.py", line 1373, in extension
        pts = self.change_ring(F.embeddings(QQbar)[0]).rational_points()
      File "/Sage/sage/local/lib/python2.7/site-packages/sage/schemes/generic/algebraic_scheme.py", line 1846, in change_ring
        I = [f.change_ring(R) for f in self.defining_polynomials()]
      File "sage/rings/polynomial/multi_polynomial.pyx", line 873, in sage.rings.polynomial.multi_polynomial.MPolynomial.change_ring (build/cythonized/sage/rings/polynomial/multi_polynomial.c:13133)
        return self.parent().change_ring(R)(self)
      File "sage/rings/polynomial/multi_polynomial_ring_generic.pyx", line 985, in sage.rings.polynomial.multi_polynomial_ring_generic.MPolynomialRing_generic.change_ring (build/cythonized/sage/rings/polynomial/multi_polynomial_ring_generic.c:15237)
        return PolynomialRing(base_ring, self.ngens(), names, order=order)
      File "/Sage/sage/local/lib/python2.7/site-packages/sage/rings/polynomial/polynomial_ring_constructor.py", line 438, in PolynomialRing
        raise TypeError('base_ring must be a ring')
    TypeError: base_ring must be a ring
**********************************************************************
1 item had failures:
   3 of  15 in sage.schemes.curves.projective_curve.ProjectivePlaneCurve.ordinary_model
    [328 tests, 3 failures, 65.69 s]

...

----------------------------------------------------------------------
sage -t --long src/sage/schemes/curves/projective_curve.py  # 3 doctests failed
----------------------------------------------------------------------
Total time for all tests: 1958.8 seconds
    cpu time: 6272.7 seconds
    cumulative wall time: 15257.4 seconds

I also ran the same tests on the latest develop build (74b03027bc) and they passed, so it seems like there is still something to fix here.

Since I think someone with fresh eyes should take a look at this ticket the next time it comes up for review, I am taking my name out of the reviewer field.

@sagetrac-cmt
Copy link
Mannequin

sagetrac-cmt mannequin commented Jul 21, 2017

Changed reviewer from Claire Tomesch to none

@saraedum
Copy link
Member Author

comment:20

cmt: Thanks for pointing this out. This is a problem in #23204. I'll fix it there.

@saraedum
Copy link
Member Author

comment:21

Fixed in #23204.

@saraedum
Copy link
Member Author

Reviewer: Claire Tomesch

@saraedum
Copy link
Member Author

comment:23

Claire: We usually do not remove people from the Reviewers field, i.e., it is just a list of everybody that had a look at the ticket.

@sagetrac-cmt
Copy link
Mannequin

sagetrac-cmt mannequin commented Jul 22, 2017

comment:24

Julian: Thanks, and my apologies! I didn't realize that was the convention.

@sagetrac-cmt
Copy link
Mannequin

sagetrac-cmt mannequin commented Jul 22, 2017

comment:25

I just merged the latest version of #23204 (382e2d1807) into the latest version of this ticket (5f99cf980c), rebuilt, and reran the same limited set of tests (./sage -tp 8 --long src/sage/structure/ src/sage/categories/ src/sage/rings/ src/sage/modular/ src/sage/schemes/) which all passed!

I am now running all doctests.

@sagetrac-cmt
Copy link
Mannequin

sagetrac-cmt mannequin commented Jul 22, 2017

comment:26

I just ran all tests in src/sage and produced only the following weird failed tests:

$ ./sage -tp 8 --long src/sage/
too few successful tests, not using stored timings
Running doctests with ID 2017-07-22-12-22-47-8f9951fd.
Git branch: t/23203/a_polynomial_ring_contains_its_basering
Using --optional=ccache,mpir,python2,sage
Sorting sources by runtime so that slower doctests are run first....
Doctesting 2969 files using 8 threads.

...

sage -t --long src/sage/tests/cmdline.py
**********************************************************************
File "src/sage/tests/cmdline.py", line 814, in sage.tests.cmdline.test_executable
Failed example:
    test_executable(["sage", "--rst2sws", input, output])
Expected:
    ('', '', 0)
Got:
    ('',
     'Traceback (most recent call last):\n  File "/Sage/sage/src/bin/sage-rst2sws", line 131, in <module>\n    from sagenb.notebook.notebook import Notebook\n  File "/Sage/sage/local/lib/python2.7/site-packages/sagenb/notebook/notebook.py", line 46, in <module>\n    from . import js           # javascript\n  File "/Sage/sage/local/lib/python2.7/site-packages/sagenb/notebook/js.py", line 34, in <module>\n    from .compress.JavaScriptCompressor import JavaScriptCompressor\nImportError: No module named JavaScriptCompressor\n',
     1)
**********************************************************************
File "src/sage/tests/cmdline.py", line 817, in sage.tests.cmdline.test_executable
Failed example:
    f = tarfile.open(output, 'r')
Exception raised:
    Traceback (most recent call last):
      File "/Sage/sage/local/lib/python2.7/site-packages/sage/doctest/forker.py", line 509, in _run
        self.compile_and_execute(example, compiler, test.globs)
      File "/Sage/sage/local/lib/python2.7/site-packages/sage/doctest/forker.py", line 872, in compile_and_execute
        exec(compiled, globs)
      File "<doctest sage.tests.cmdline.test_executable[242]>", line 1, in <module>
        f = tarfile.open(output, 'r')
      File "/Sage/sage/local/lib/python2.7/tarfile.py", line 1680, in open
        raise ReadError("file could not be opened successfully")
    ReadError: file could not be opened successfully
**********************************************************************
File "src/sage/tests/cmdline.py", line 818, in sage.tests.cmdline.test_executable
Failed example:
    print(f.extractfile('sage_worksheet/worksheet.html').read())
Exception raised:
    Traceback (most recent call last):
      File "/Sage/sage/local/lib/python2.7/site-packages/sage/doctest/forker.py", line 509, in _run
        self.compile_and_execute(example, compiler, test.globs)
      File "/Sage/sage/local/lib/python2.7/site-packages/sage/doctest/forker.py", line 872, in compile_and_execute
        exec(compiled, globs)
      File "<doctest sage.tests.cmdline.test_executable[243]>", line 1, in <module>
        print(f.extractfile('sage_worksheet/worksheet.html').read())
    AttributeError: 'file' object has no attribute 'extractfile'
**********************************************************************
File "src/sage/tests/cmdline.py", line 832, in sage.tests.cmdline.test_executable
Failed example:
    print(f.extractfile('sage_worksheet/worksheet.txt').read())
Exception raised:
    Traceback (most recent call last):
      File "/Sage/sage/local/lib/python2.7/site-packages/sage/doctest/forker.py", line 509, in _run
        self.compile_and_execute(example, compiler, test.globs)
      File "/Sage/sage/local/lib/python2.7/site-packages/sage/doctest/forker.py", line 872, in compile_and_execute
        exec(compiled, globs)
      File "<doctest sage.tests.cmdline.test_executable[244]>", line 1, in <module>
        print(f.extractfile('sage_worksheet/worksheet.txt').read())
    AttributeError: 'file' object has no attribute 'extractfile'
**********************************************************************
1 item had failures:
   4 of 246 in sage.tests.cmdline.test_executable
    [245 tests, 4 failures, 155.43 s]
----------------------------------------------------------------------
sage -t --long src/sage/tests/cmdline.py  # 4 doctests failed
----------------------------------------------------------------------

However! When I run these same doctests on my latest build of the develop branch (74b03027bc), the exact same tests also fail.

Therefore, I'm going to positively review this ticket -- if others think this is a problem they are welcome to revert the status as they see fit.

@vbraun
Copy link
Member

vbraun commented Aug 3, 2017

Changed branch from u/saraedum/a_polynomial_ring_contains_its_basering to 5f99cf9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants