Previous Page Next Page Contents

Dom::Fraction -- the field of fractions of an integral domain

Introduction

Dom::Fraction(R) creates a domain which represents the field of fractions of an integral domain R.

Domain

Dom::Fraction(R)

Parameters

R - an integral domain, i.e., a domain of category Cat::IntegralDomain

Details

Creating Elements

Dom::Fraction(R)(r)

Parameters

r - a rational expression, or an element of R

Categories

Cat::QuotientField(R)
if R is a Cat::DifferentialRing, then
Cat::DifferentialRing
if R is a Cat::PartialDifferentialRing, then
Cat::PartialDifferentialRing

Related Domains

Dom::Rational

Details

Entries

characteristic

is the characteristic of R.

coeffRing

is the integral domain R.

one

is the one of the field of fractions of R, i.e., the fraction 1/1.

zero

is the zero of the field of fractions of R, i.e., the fraction 0/1.

Method _divide: divides two fractions

Method _invert: inverts a fraction

Method _less: less-than relation

Method _mult: multiplies fractions by fractions or rational expressions

Method _negate: negates a fraction

Method _power: the integer power of a fraction

Method _plus: adds fractions

Method D: the differential operator

Method denom: the denominator of a fraction

Method diff: differentiation of fractions

Method equal: test on equality of fractions

Method factor: factorizes the numerator and denominator of a fraction

Method intmult: integer multiple of a fraction

Method iszero: test for zero

Method numer: the numerator of a fraction

Method random: random fraction generation

Method convert_to: fraction conversion

Method expr: converts a fraction into an object of a kernel domain

Method TeX: TeX formatting of a fraction

Method retract: retraction to base domain

Method normalize: normalizing fractions

Method normalizePrime: normalizing fractions over integral domains with a gcd

Example 1

We define the field of rational functions over the rationals:

>> F := Dom::Fraction(Dom::Polynomial(Dom::Rational))
          Dom::Fraction(Dom::Polynomial(Dom::Rational, LexOrder))

and create an element of F:

>> a := F(y/(x - 1) + 1/(x + 1))
                              x + y + x y - 1
                              ---------------
                                   2
                                  x  - 1

To calculate with such elements use the standard arithmetical operators:

>> 2*a, 1/a, a*a
                                  2
      2 x + 2 y + 2 x y - 2      x  - 1
      ---------------------, ---------------,
              2              x + y + x y - 1
             x  - 1
      
                        2    2        2      2      2  2
         - 2 x - 2 y + x  + y  + 2 x y  + 2 x  y + x  y  + 1
         ---------------------------------------------------
                                2    4
                           - 2 x  + x  + 1

Some system functions are overloaded for elements of domains generated by Dom::Fraction, such as diff, numer or denom (see the description of the corresponding methods "diff", "numer" and "denom" above).

For example, to differentiate the fraction a with respect to x enter:

>> diff(a, x)
                                         2    2
                      2 x - y - 2 x y - x  - x  y - 1
                      -------------------------------
                                   2    4
                              - 2 x  + x  + 1

If one knows the variables in advance, then using the domain Dom::DistributedPolynomial yields a more efficient arithmetic of rational functions:

>> Fxy := Dom::Fraction(
     Dom::DistributedPolynomial([x, y], Dom::Rational)
   )
      Dom::Fraction(Dom::DistributedPolynomial([x, y],
      
         Dom::Rational, LexOrder))
>> b := Fxy(y/(x - 1) + 1/(x + 1)): 
   b^3
                              2    3      2    3        2      2
      (3 x + 3 y - 3 x y - 3 x  + x  - 3 y  + y  - 3 x y  - 3 x  y +
      
              3      3        2  2      2  3      3  2    3  3
         3 x y  + 3 x  y + 3 x  y  + 3 x  y  + 3 x  y  + x  y  - 1) /
      
             2      4    6
         (3 x  - 3 x  + x  - 1)

Example 2

We create the field of rational numbers as the field of fractions of the integers, i.e., Q = {x/y | x,y in Z }:

>> Q := Dom::Fraction(Dom::Integer):
   Q(1/3)
                                    1/3
>> domtype(%)
                        Dom::Fraction(Dom::Integer)

Another representation of Q in MuPAD is the domain Dom::Rational where the rationals are of the kernel domains DOM_INT and DOM_RAT. Therefore it is much more efficient to work with Dom::Rational than with Dom::Fraction(Dom::Integer).

Super-Domain

Dom::BaseDomain

Axioms

Ax::normalRep
if R has Ax::canonicalRep
if R is a Cat::GcdDomain
if R has Ax::canonicalUnitNormal

Changes




Do you have questions or comments?


Copyright © SciFace Software GmbH & Co. KG 2000