Package sage :: Package categories :: Module pushout
[hide private]
[frames] | no frames]

Module pushout

source code

Classes [hide private]
  ConstructionFunctor
  CompositeConstructionFunctor
  IdentityConstructionFunctor
  PolynomialFunctor
  MatrixFunctor
  LaurentPolynomialFunctor
  VectorFunctor
  SubspaceFunctor
  FractionField
  LocalizationFunctor
  CompletionFunctor
  QuotientFunctor
  AlgebraicExtensionFunctor
  AlgebraicClosureFunctor
Functions [hide private]
 
BlackBoxConstructionFunctor(ConstructionFunctor) source code
 
pushout(R, S)
Given a pair of Objects R and S, try and construct a reasonable object $Y$ and return maps such that cannonically $R \leftarrow Y ightarrow S$.
source code
 
pushout_lattice(R, S)
Given a pair of Objects R and S, try and construct a reasonable object $Y$ and return maps such that cannonically $R \leftarrow Y ightarrow S$.
source code
 
pp(lattice)
Used in debugging to print the current lattice.
source code
 
construction_tower(R) source code
 
type_to_parent(P) source code
Function Details [hide private]

pushout(R, S)

source code 

Given a pair of Objects R and S, try and construct a 
reasonable object $Y$ and return maps such that 
cannonically $R \leftarrow Y 
ightarrow S$. 

ALGORITHM: 
   This incorperates the idea of functors discussed SAGE Days 4. 
   Every object $R$ can be viewed as an initial object and 
   a series of functors (e.g. polynomial, quotient, extension, 
   completion, vector/matrix, etc.) Call the series of 
   increasingly-simple rings (with the associated functors) 
   the "tower" of $R$. The \code{construction} method is used to
   create the tower. 
   
   Given two objects $R$ and $S$, try and find a common initial
   object $Z$. If the towers of $R$ and $S$ meet, let $Z$ be their
   join. Otherwise, see if the top of one coerces naturally into
   the other. 
   
   Now we have an initial object and two \emph{ordered} lists of 
   functors to apply. We wish to merge these in an unambiguous order, 
   popping elements off the top of one or the other tower as we 
   apply them to $Z$. 
   
   - If the functors are distinct types, there is an absolute ordering 
       given by the rank attribute. Use this. 
   - Otherwise:
      - If the tops are equal, we (try to) merge them.
      - If \emph{exactly} one occurs lower in the other tower
          we may unambiguously apply the other (hoping for a later merge).
      - If the tops commute, we can apply either first.
      - Otherwise fail due to ambiguity.
          
EXAMPLES:
    Here our "towers" are $R = Complete_7(Frac(\Z)$ and $Frac(Poly_x(\Z))$, which give us $Frac(Poly_x(Complete_7(Frac(\Z)))$
        sage: from sage.categories.pushout import pushout
        sage: pushout(Qp(7), Frac(ZZ['x']))
        Fraction Field of Univariate Polynomial Ring in x over 7-adic Field with capped relative precision 20
        
    Note we get the same thing with
        sage: pushout(Zp(7), Frac(QQ['x']))
        Fraction Field of Univariate Polynomial Ring in x over 7-adic Field with capped relative precision 20
        sage: pushout(Zp(7)['x'], Frac(QQ['x']))
        Fraction Field of Univariate Polynomial Ring in x over 7-adic Field with capped relative precision 20            

    Note that polynomial variable ordering must be unambiguously determined. 
        sage: pushout(ZZ['x,y,z'], QQ['w,z,t'])
        Traceback (most recent call last):
        ...
        TypeError: Ambiguous Base Extension
        sage: pushout(ZZ['x,y,z'], QQ['w,x,z,t'])
        Multivariate Polynomial Ring in w, x, y, z, t over Rational Field

    Some other examples
        sage: pushout(Zp(7)['y'], Frac(QQ['t'])['x,y,z'])
        Multivariate Polynomial Ring in x, y, z over Fraction Field of Univariate Polynomial Ring in t over 7-adic Field with capped relative precision 20
        sage: pushout(ZZ['x,y,z'], Frac(ZZ['x'])['y'])
        Multivariate Polynomial Ring in y, z over Fraction Field of Univariate Polynomial Ring in x over Integer Ring
        sage: pushout(MatrixSpace(RDF, 2, 2), Frac(ZZ['x']))
        Full MatrixSpace of 2 by 2 dense matrices over Fraction Field of Univariate Polynomial Ring in x over Real Double Field
        sage: pushout(ZZ, MatrixSpace(ZZ[['x']], 3, 3))
        Full MatrixSpace of 3 by 3 dense matrices over Power Series Ring in x over Integer Ring
        sage: pushout(QQ['x,y'], ZZ[['x']])
        Univariate Polynomial Ring in y over Power Series Ring in x over Rational Field
        sage: pushout(Frac(ZZ['x']), QQ[['x']])
        Laurent Series Ring in x over Rational Field

AUTHORS: 
   -- Robert Bradshaw

pushout_lattice(R, S)

source code 

Given a pair of Objects R and S, try and construct a 
reasonable object $Y$ and return maps such that 
cannonically $R \leftarrow Y 
ightarrow S$. 

ALGORITHM: 
   This is based on the model that arose from much discussion at SAGE Days 4. 
   Going up the tower of constructions of $R$ and $S$ (e.g. the reals
   come from the rationals come from the integers) try and find a 
   common parent, and then try and fill in a lattice with these 
   two towers as sides with the top as the common ancestor and 
   the bottom will be the desired ring. 
   
   See the code for a specific worked-out example. 
   
EXAMPLES: 
    sage: from sage.categories.pushout import pushout_lattice
    sage: A, B = pushout_lattice(Qp(7), Frac(ZZ['x']))
    sage: A.codomain()
    Fraction Field of Univariate Polynomial Ring in x over 7-adic Field with capped relative precision 20
    sage: A.codomain() is B.codomain()
    True
    sage: A, B = pushout_lattice(ZZ, MatrixSpace(ZZ[['x']], 3, 3))
    sage: B
    Identity endomorphism of Full MatrixSpace of 3 by 3 dense matrices over Power Series Ring in x over Integer Ring
   
AUTHOR: 
   -- Robert Bradshaw