Ticket #1242 (closed defect: fixed)

Opened 3 years ago

Last modified 3 years ago

coercion problem in reduction of an elliptic curve at a prime ideal

Reported by: wuthrich Owned by: was
Priority: major Milestone: sage-2.9
Component: number theory Keywords: elliptic curves
Cc: Author(s):
Report Upstream: Reviewer(s):
Merged in: Work issues:

Description

The lines

 K.<s> = NumberField(x^2+23)
 OK = K.ring_of_integers()
 E = EllipticCurve([0,0,0,K(1),K(5)])
 pp = K.factor_integer(13)[0][0]
 Fpp = OK.residue_field(pp)
 E.base_extend(Fpp)

produce the error

---------------------------------------------------------------------------
<type 'exceptions.RuntimeError'>          Traceback (most recent call last)

/local/pmzcw/prog/sage-2.8.5.1/devel/sage-mine/sage/schemes/elliptic_curves/<ipython console> in <module>()

/local/pmzcw/prog/sage/local/lib/python2.5/site-packages/sage/schemes/elliptic_curves/ell_generic.py in base_extend(self, R)
    692
    693     def base_extend(self, R):
--> 694         return constructor.EllipticCurve(R, [R(a) for a in self.a_invariants()])
    695
    696     def base_ring(self):

/local/pmzcw/prog/sage/local/lib/python2.5/site-packages/sage/schemes/elliptic_curves/constructor.py in EllipticCurve(x, y)
    104             return ell_rational_field.EllipticCurve_rational_field(x, y)
    105         elif rings.is_FiniteField(x):
--> 106             return ell_finite_field.EllipticCurve_finite_field(x, y)
    107         elif rings.is_pAdicField(x):
    108             return ell_padic_field.EllipticCurve_padic_field(x, y)

/local/pmzcw/prog/sage/local/lib/python2.5/site-packages/sage/schemes/elliptic_curves/ell_finite_field.py in __init__(self, x, y)
     53
     54         EllipticCurve_field.__init__(
---> 55             self, [field(x) for x in ainvs])
     56
     57         self._point_class = ell_point.EllipticCurvePoint_finite_field

/local/pmzcw/prog/sage/local/lib/python2.5/site-packages/sage/schemes/elliptic_curves/ell_generic.py in __init__(self, ainvs, extra)
    100             ainvs = [K(0),K(0),K(0)] + ainvs
    101         self.__ainvs = ainvs
--> 102         if self.discriminant() == 0:
    103             raise ArithmeticError, \
    104                   "Invariants %s define a singular curve."%ainvs

/local/pmzcw/prog/sage/local/lib/python2.5/site-packages/sage/schemes/elliptic_curves/ell_generic.py in discriminant(self)
    839         except AttributeError:
    840             b2, b4, b6, b8 = self.b_invariants()
--> 841             self.__discriminant = -b2**2*b8 - 8*b4**3 - 27*b6**2 + 9*b2*b4*b6
    842             return self.__discriminant
    843

/local/pmzcw/prog/sage-2.8.5.1/devel/sage-mine/sage/schemes/elliptic_curves/element.pyx in sage.structure.element.RingElement.__mul__()

/local/pmzcw/prog/sage-2.8.5.1/devel/sage-mine/sage/schemes/elliptic_curves/coerce.pyx in sage.structure.coerce.CoercionModel_cache_maps.bin_op_c()

/local/pmzcw/prog/sage-2.8.5.1/devel/sage-mine/sage/schemes/elliptic_curves/coerce.pyx in sage.structure.coerce.CoercionModel_cache_maps.canonical_coercion_c()

/local/pmzcw/prog/sage-2.8.5.1/devel/sage-mine/sage/schemes/elliptic_curves/coerce.pyx in sage.structure.coerce.CoercionModel_cache_maps._coercion_error()

<type 'exceptions.RuntimeError'>: There is a bug in the coercion code in SAGE.
Both x (=0) and y (=12) are supposed to have identical parents but they don't.
In fact, x has parent 'Residue field of Fractional ideal (13, s - 4)'
whereas y has parent 'Ring of integers modulo 13'

Original elements 0 (parent Residue field of Fractional ideal (13, s - 4)) and 12 (parent Ring of integers modulo 13) and morphisms
<type 'NoneType'> None
<type 'sage.rings.integer_mod.IntegerMod_to_IntegerMod'> Natural morphism:
  From: Ring of integers modulo 13
  To:   Residue field of Fractional ideal (13, s - 4)

Change History

  Changed 3 years ago by mabshoff

  • milestone set to sage-2.8.14

in reply to: ↑ description   Changed 3 years ago by wuthrich

Replying to wuthrich:

The lines {{{ K.<s> = NumberField?(x2+23) OK = K.ring_of_integers() E = EllipticCurve?([0,0,0,K(1),K(5)]) pp = K.factor_integer(13)[0][0] Fpp = OK.residue_field(pp) E.base_extend(Fpp) }}} produce the error {{{ --------------------------------------------------------------------------- <type 'exceptions.RuntimeError?'> Traceback (most recent call last) /local/pmzcw/prog/sage-2.8.5.1/devel/sage-mine/sage/schemes/elliptic_curves/<ipython console> in <module>() /local/pmzcw/prog/sage/local/lib/python2.5/site-packages/sage/schemes/elliptic_curves/ell_generic.py in base_extend(self, R) 692 693 def base_extend(self, R): --> 694 return constructor.EllipticCurve?(R, [R(a) for a in self.a_invariants()]) 695 696 def base_ring(self): /local/pmzcw/prog/sage/local/lib/python2.5/site-packages/sage/schemes/elliptic_curves/constructor.py in EllipticCurve?(x, y) 104 return ell_rational_field.EllipticCurve?_rational_field(x, y) 105 elif rings.is_FiniteField(x): --> 106 return ell_finite_field.EllipticCurve?_finite_field(x, y) 107 elif rings.is_pAdicField(x): 108 return ell_padic_field.EllipticCurve?_padic_field(x, y) /local/pmzcw/prog/sage/local/lib/python2.5/site-packages/sage/schemes/elliptic_curves/ell_finite_field.py in init(self, x, y) 53 54 EllipticCurve?_field.init( ---> 55 self, [field(x) for x in ainvs]) 56 57 self._point_class = ell_point.EllipticCurvePoint?_finite_field /local/pmzcw/prog/sage/local/lib/python2.5/site-packages/sage/schemes/elliptic_curves/ell_generic.py in init(self, ainvs, extra) 100 ainvs = [K(0),K(0),K(0)] + ainvs 101 self.ainvs = ainvs --> 102 if self.discriminant() == 0: 103 raise ArithmeticError?, \ 104 "Invariants %s define a singular curve."%ainvs /local/pmzcw/prog/sage/local/lib/python2.5/site-packages/sage/schemes/elliptic_curves/ell_generic.py in discriminant(self) 839 except AttributeError?: 840 b2, b4, b6, b8 = self.b_invariants() --> 841 self.discriminant = -b2**2*b8 - 8*b4**3 - 27*b6**2 + 9*b2*b4*b6 842 return self.discriminant 843 /local/pmzcw/prog/sage-2.8.5.1/devel/sage-mine/sage/schemes/elliptic_curves/element.pyx in sage.structure.element.RingElement?.mul() /local/pmzcw/prog/sage-2.8.5.1/devel/sage-mine/sage/schemes/elliptic_curves/coerce.pyx in sage.structure.coerce.CoercionModel?_cache_maps.bin_op_c() /local/pmzcw/prog/sage-2.8.5.1/devel/sage-mine/sage/schemes/elliptic_curves/coerce.pyx in sage.structure.coerce.CoercionModel?_cache_maps.canonical_coercion_c() /local/pmzcw/prog/sage-2.8.5.1/devel/sage-mine/sage/schemes/elliptic_curves/coerce.pyx in sage.structure.coerce.CoercionModel?_cache_maps._coercion_error() <type 'exceptions.RuntimeError?'>: There is a bug in the coercion code in SAGE. Both x (=0) and y (=12) are supposed to have identical parents but they don't. In fact, x has parent 'Residue field of Fractional ideal (13, s - 4)' whereas y has parent 'Ring of integers modulo 13' Original elements 0 (parent Residue field of Fractional ideal (13, s - 4)) and 12 (parent Ring of integers modulo 13) and morphisms <type 'NoneType?'> None <type 'sage.rings.integer_mod.IntegerMod?_to_IntegerMod'> Natural morphism: From: Ring of integers modulo 13 To: Residue field of Fractional ideal (13, s - 4)

}}}

The problem comes from the coercion in Sequence :

ared = [Fpp(a) for a in E.a_invariants()]
[a.parent() for a in ared]

gives

[Residue field of Fractional ideal (13, s - 4), Residue field of
Fractional ideal (13, s - 4), Residue field of Fractional ideal (13, s -
4), Ring of integers modulo 13, Residue field of Fractional ideal (13, s
- 4)]

But

Sequence(ared)

fails.

  Changed 3 years ago by was

This will be fixed by #1183.

  Changed 3 years ago by mabshoff

  • status changed from new to closed
  • resolution set to fixed

resolved due to patch set from #1183

Note: See TracTickets for help on using tickets.