Package sage :: Package rings :: Module ideal :: Class Ideal_principal
[hide private]
[frames] | no frames]

Class Ideal_principal

source code

                      object --+                
                               |                
structure.sage_object.SageObject --+            
                                   |            
           structure.element.Element --+        
                                       |        
         structure.element.MonoidElement --+    
                                           |    
                               Ideal_generic --+
                                               |
                                              Ideal_principal
Known Subclasses:
Ideal_pid


A principal ideal.



Instance Methods [hide private]
 
__init__(self, ring, gen)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
__repr__(self)
File: sage/structure/sage_object.pyx (starting at line 86)
source code
 
is_principal(self)
Returns True if the ideal is principal in the ring containing the ideal.
source code
 
gen(self)
Returns the generator of the principal ideal.
source code
 
__contains__(self, x)
Returns True if x is in the ideal self.
source code
 
__cmp__(self, other)
cmp(x,y)
source code
 
divides(self, other)
Returns True if self divides other.
source code

Inherited from Ideal_generic: __add__, __mul__, __nonzero__, __radd__, __rmul__, _contains_, _latex_, base_ring, category, gens, gens_reduced, is_maximal, is_prime, is_trivial, reduce, ring

Inherited from Ideal_generic (private): _repr_short

Inherited from structure.element.MonoidElement: __new__, __pow__, __rpow__, _mul_, multiplicative_order, order

Inherited from structure.element.Element: __eq__, __ge__, __gt__, __hash__, __le__, __lt__, __ne__, __reduce__, __rxor__, __xor__, _cmp_, _im_gens_, _repr_, _richcmp_, base_base_extend, base_base_extend_canonical_sym, base_extend, base_extend_canonical, base_extend_canonical_sym, base_extend_recursive, is_zero, n, parent, subs, substitute

Inherited from structure.sage_object.SageObject: _axiom_, _axiom_init_, _gap_, _gap_init_, _gp_, _gp_init_, _interface_, _interface_init_, _interface_is_cached_, _kash_, _kash_init_, _macaulay2_, _macaulay2_init_, _magma_, _magma_init_, _maple_, _maple_init_, _mathematica_, _mathematica_init_, _maxima_, _maxima_init_, _octave_, _octave_init_, _pari_, _pari_init_, _r_init_, _sage_, _singular_, _singular_init_, db, dump, dumps, plot, rename, reset_name, save, version

Inherited from object: __delattr__, __getattribute__, __reduce_ex__, __setattr__, __str__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, ring, gen)
(Constructor)

source code 
x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Overrides: Ideal_generic.__init__

__repr__(self)
(Representation operator)

source code 
File: sage/structure/sage_object.pyx (starting at line 86)

Overrides: Ideal_generic.__repr__

is_principal(self)

source code 

Returns True if the ideal is principal in the ring containing the
ideal. When the ideal construction is explicitly principal (i.e.
when we define an ideal with one element) this is always the case.

EXAMPLES:
Note that SAGE automatically coerces ideals into principals ideals
during initialization:
    sage: R = ZZ[x]
    sage: I = R.ideal(x)
    sage: J = R.ideal(2,x)
    sage: K = R.base_extend(QQ).ideal(2,x)
    sage: I
    Principal ideal (x) of Univariate Polynomial Ring in x
    over Integer Ring
    sage: J
    Ideal (2, x) of Univariate Polynomial Ring in x over Integer Ring
    sage: K
    Principal ideal (1) of Univariate Polynomial Ring in x
    over Rational Field
    sage: I.is_principal()
    True
    sage: K.is_principal()
    True

Overrides: Ideal_generic.is_principal

gen(self)

source code 

Returns the generator of the principal ideal. The generators are
elements of the ring containing the ideal.

EXAMPLES:
A simple example in the integers:
    sage: R = ZZ
    sage: I = R.ideal(7)
    sage: J = R.ideal(7, 14)
    sage: I.gen(); J.gen()
    7
    7
    
Note that the generator belongs to the ring from which the
ideal was initialized:
    sage: R = ZZ[x]
    sage: I = R.ideal(x)
    sage: J = R.base_extend(QQ).ideal(2,x)
    sage: a = I.gen(); a
    x
    sage: b = J.gen(); b
    1
    sage: a.base_ring()
    Integer Ring
    sage: b.base_ring()
    Rational Field

__contains__(self, x)
(In operator)

source code 

Returns True if x is in the ideal self.

EXAMPLES:
    sage: P.<x> = PolynomialRing(ZZ)
    sage: I = P.ideal(x^2-2)
    sage: x^2 in I
    False
    sage: x^2-2 in I
    True
    sage: x^2-3 in I
    False

Overrides: Ideal_generic.__contains__

__cmp__(self, other)
(Comparison operator)

source code 
cmp(x,y)

Overrides: Ideal_generic.__cmp__

divides(self, other)

source code 

Returns True if self divides other.

EXAMPLES:
    sage: P.<x> = PolynomialRing(QQ)
    sage: I = P.ideal(x)
    sage: J = P.ideal(x^2)
    sage: I.divides(J)
    True
    sage: J.divides(I)
    False