Package sage :: Package structure :: Module element :: Class CommutativeRingElement
[hide private]
[frames] | no frames]

Class CommutativeRingElement



            object --+                
                     |                
sage_object.SageObject --+            
                         |            
                   Element --+        
                             |        
                 ModuleElement --+    
                                 |    
                       RingElement --+
                                     |
                                    CommutativeRingElement
Known Subclasses:
FieldElement, CommutativeAlgebraElement, functions.elementary.ElementaryFunction_class, rings.integer_mod.IntegerMod_abstract, IntegralDomainElement, rings.polynomial.multi_polynomial.MPolynomial, rings.polynomial.polynomial_quotient_ring_element.PolynomialQuotientRingElement, rings.padics.local_generic_element.LocalGenericElement, rings.padics.valuation.Valuation

Instance Methods [hide private]
 
__new__(T, S, ...)
 
_im_gens_(...)
File: sage/structure/element.pyx (starting at line 1608)
 
divides(...)
File: sage/structure/element.pyx (starting at line 1620) Return True if self divides x.
 
inverse_mod(...)
File: sage/structure/element.pyx (starting at line 1613) Return an inverse of self modulo the ideal $I$, if defined, i.e., if $I$ and self together generate the unit ideal.
 
mod(...)
File: sage/structure/element.pyx (starting at line 1642) Return a representative for self modulo the ideal I (or the ideal generated by the elements of I if I is not an ideal.) EXAMPLE: Integers Reduction of 5 modulo an ideal: sage: n = 5 sage: n.mod(3*ZZ) 2 Reduction of 5 modulo the ideal generated by 3.

Inherited from RingElement: __div__, __idiv__, __imul__, __invert__, __mul__, __pos__, __pow__, __rdiv__, __rmul__, __rpow__, __rtruediv__, __truediv__, _div_, _idiv_, _imul_, _mul_, abs, additive_order, is_nilpotent, is_one, is_unit, multiplicative_order, order

Inherited from ModuleElement: __add__, __iadd__, __isub__, __neg__, __radd__, __rsub__, __sub__, _add_, _iadd_, _ilmul_, _isub_, _lmul_, _neg_, _rmul_, _sub_

Inherited from ModuleElement (private): _lmul_nonscalar, _rmul_nonscalar

Inherited from Element: __cmp__, __eq__, __ge__, __gt__, __hash__, __init__, __le__, __lt__, __ne__, __nonzero__, __reduce__, __rxor__, __xor__, _cmp_, _repr_, _richcmp_, base_base_extend, base_base_extend_canonical_sym, base_extend, base_extend_canonical, base_extend_canonical_sym, base_extend_recursive, base_ring, category, is_zero, n, parent, subs, substitute

Inherited from sage_object.SageObject: __repr__, _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]

__new__(T, S, ...)

 


Returns:
a new object with type S, a subtype of T

Overrides: RingElement.__new__

_im_gens_(...)

 
File: sage/structure/element.pyx (starting at line 1608)

Overrides: Element._im_gens_

divides(...)

 
File: sage/structure/element.pyx (starting at line 1620)

Return True if self divides x.

EXAMPLES:
    sage: P.<x> = PolynomialRing(QQ)
    sage: x.divides(x^2)
    True
    sage: x.divides(x^2+2)
    False
    sage: (x^2+2).divides(x)
    False
    sage: P.<x> = PolynomialRing(ZZ)
    sage: x.divides(x^2)
    True
    sage: x.divides(x^2+2)
    False
    sage: (x^2+2).divides(x)
    False

mod(...)

 
File: sage/structure/element.pyx (starting at line 1642)

Return a representative for self modulo the ideal I (or the ideal
generated by the elements of I if I is not an ideal.)

EXAMPLE:  Integers
Reduction of 5 modulo an ideal:
    sage: n = 5
    sage: n.mod(3*ZZ)
    2

Reduction of 5 modulo the ideal generated by 3.
    sage: n.mod(3)
    2

Reduction of 5 modulo the ideal generated by 15 and 6, which is $(3)$.            
    sage: n.mod([15,6])
    2


EXAMPLE: Univiate polynomials
    sage: R.<x> = PolynomialRing(QQ)
    sage: f = x^3 + x + 1
    sage: f.mod(x + 1)
    -1

When little is implemented about a given ring, then mod may
return simply return $f$.  For example, reduction is not
implemented for $\Z[x]$ yet. (TODO!)

    sage: R.<x> = PolynomialRing(ZZ)
    sage: f = x^3 + x + 1
    sage: f.mod(x + 1)
    x^3 + x + 1
    


EXAMPLE: Multivariate polynomials
We reduce a polynomial in two variables modulo a polynomial
and an ideal:
    sage: R.<x,y,z> = PolynomialRing(QQ, 3)
    sage: (x^2 + y^2 + z^2).mod(x+y+z)
    2*y^2 + 2*y*z + 2*z^2

Notice above that $x$ is eliminated.  In the next example,
both $y$ and $z$ are eliminated.
    
    sage: (x^2 + y^2 + z^2).mod( (x - y, y - z) )
    3*z^2
    sage: f = (x^2 + y^2 + z^2)^2; f
    x^4 + 2*x^2*y^2 + y^4 + 2*x^2*z^2 + 2*y^2*z^2 + z^4
    sage: f.mod( (x - y, y - z) )
    9*z^4

In this example $y$ is eliminated.
    sage: (x^2 + y^2 + z^2).mod( (x^3, y - z) )
    x^2 + 2*z^2