On Fri, May 15, 2009 at 03:23:33AM +0200, Franz Lehner wrote:
Now it more or less works, included is a first example
of a bialgebra (just too lazy to write up the antipode):
axiom
)library TENSORC TENSORP TENSORD
TensorProductCategory is now explicitly exposed in frame initial
TensorProductCategory will be automatically loaded when needed from
/var/zope2/var/LatexWiki/TENSORC.NRLIB/code
TensorProductProperty is now explicitly exposed in frame initial
TensorProductProperty will be automatically loaded when needed from
/var/zope2/var/LatexWiki/TENSORP.NRLIB/code
TensorProduct is now explicitly exposed in frame initial
TensorProduct will be automatically loaded when needed from
/var/zope2/var/LatexWiki/TENSORD.NRLIB/code
spad
)abbrev category COALG CoAlgebra
CoAlgebra(R : CommutativeRing, RR : TensorProductCategory(R, %, %)) : Category == _
Module(R) with
Delta : % -> RR
++ delta is comultiplication
counit: % -> R
++ counit
)abbrev category BIALG BiAlgebra
BiAlgebra(R : CommutativeRing, RR : TensorProductCategory(R, %, %)) : Category == _
Join(Algebra(R), CoAlgebra(R, RR))
)abbrev category HOPFALG HopfAlgebra
HopfAlgebra(R : CommutativeRing, RR : TensorProductCategory(R, %, %)) : Category _
== BiAlgebra(R, RR) with
S : % -> %
++ the antipode
)abbrev domain PHALG PolyHopfAlgebra
PolyHopfAlgebra(R: CommutativeRing,x: Symbol): C == T where
S == Variable x
FM == FreeMonoid Symbol
PxP == TensorProduct(R, FM, FM, %, %)
-- C == Join(FreeModule(R, FM),HopfAlgebra(R, PxP))
C == Join(UnivariatePolynomialCategory(R), _
FreeModuleCat(R, FM), BiAlgebra(R, PxP))
TERM == Record(k: FM,c: R)
T == SparseUnivariatePolynomial(R) add
Rep:= SparseUnivariatePolynomial(R)
monom(a:FM,r:R):% ==
one? a => monomial(r, 0@NonNegativeInteger)
monomial(r, nthExpon(a, 1@Integer))
-- monomial(r:R, n:NonNegativeInteger) == monomial(r,n)@Rep
coerce(p:%):OutputForm == outputForm(p,outputForm x)$Rep
Delta1(n:NonNegativeInteger):PxP ==
res: PxP := 0
nn:List NonNegativeInteger := [k for k in 0..n]
for k1 in nn for k2 in reverse nn repeat
res:= res + binomial(n,k1)*product(monomial(1@R,k1),monomial(1@R,k2))$PxP
res
ListOfTerms(p:%):List TERM ==
res:List TERM := []
while not zero? p repeat
m:FM := (variable()$S)**degree p
m1:TERM := [m,leadingCoefficient p]
res:=concat!(res, m1)
p:=reductum p
res
Delta(p:%):PxP ==
zero? p => 0
lt:R := leadingCoefficient p
lt * Delta1(degree p) + Delta reductum p
counit(p:%):R == coefficient(p,0)
spad
Compiling FriCAS source code from file
/var/zope2/var/LatexWiki/8300278871242681918-25px002.spad using
old system compiler.
COALG abbreviates category CoAlgebra
------------------------------------------------------------------------
initializing NRLIB COALG for CoAlgebra
compiling into NRLIB COALG
;;; *** |CoAlgebra| REDEFINED
Time: 0 SEC.
finalizing NRLIB COALG
Processing CoAlgebra for Browser database:
--------(Delta (RR %))---------
--------(counit (R %))---------
--->-->CoAlgebra(constructor): Not documented!!!!
--->-->CoAlgebra(): Missing Description
------------------------------------------------------------------------
CoAlgebra is now explicitly exposed in frame initial
CoAlgebra will be automatically loaded when needed from
/var/zope2/var/LatexWiki/COALG.NRLIB/code
BIALG abbreviates category BiAlgebra
------------------------------------------------------------------------
initializing NRLIB BIALG for BiAlgebra
compiling into NRLIB BIALG
;;; *** |BiAlgebra| REDEFINED
Time: 0 SEC.
finalizing NRLIB BIALG
Processing BiAlgebra for Browser database:
--->-->BiAlgebra(): Missing Description
------------------------------------------------------------------------
BiAlgebra is now explicitly exposed in frame initial
BiAlgebra will be automatically loaded when needed from
/var/zope2/var/LatexWiki/BIALG.NRLIB/code
HOPFALG abbreviates category HopfAlgebra
------------------------------------------------------------------------
initializing NRLIB HOPFALG for HopfAlgebra
compiling into NRLIB HOPFALG
;;; *** |HopfAlgebra| REDEFINED
Time: 0 SEC.
finalizing NRLIB HOPFALG
Processing HopfAlgebra for Browser database:
--------(S (% %))---------
--->-->HopfAlgebra(constructor): Not documented!!!!
--->-->HopfAlgebra(): Missing Description
------------------------------------------------------------------------
HopfAlgebra is now explicitly exposed in frame initial
HopfAlgebra will be automatically loaded when needed from
/var/zope2/var/LatexWiki/HOPFALG.NRLIB/code
PHALG abbreviates domain PolyHopfAlgebra
------------------------------------------------------------------------
initializing NRLIB PHALG for PolyHopfAlgebra
compiling into NRLIB PHALG
compiling exported monom : (FreeMonoid Symbol,R) -> $
Time: 0.12 SEC.
compiling exported coerce : $ -> OutputForm
Time: 0 SEC.
compiling local Delta1 : NonNegativeInteger -> TensorProduct(R,FreeMonoid Symbol,FreeMonoid Symbol,$,$)
Time: 0.03 SEC.
compiling exported ListOfTerms : $ -> List Record(k: FreeMonoid Symbol,c: R)
Time: 0.04 SEC.
compiling exported Delta : $ -> TensorProduct(R,FreeMonoid Symbol,FreeMonoid Symbol,$,$)
Time: 0.06 SEC.
compiling exported counit : $ -> R
Time: 0.01 SEC.
augmenting (SingletonAsOrderedSet): (ConvertibleTo (InputForm))
****** Domain: R already in scope
augmenting R: (ConvertibleTo (InputForm))
augmenting (SingletonAsOrderedSet): (ConvertibleTo (Pattern (Float)))
****** Domain: R already in scope
augmenting R: (ConvertibleTo (Pattern (Float)))
augmenting (SingletonAsOrderedSet): (ConvertibleTo (Pattern (Integer)))
****** Domain: R already in scope
augmenting R: (ConvertibleTo (Pattern (Integer)))
augmenting (SingletonAsOrderedSet): (PatternMatchable (Float))
****** Domain: R already in scope
augmenting R: (PatternMatchable (Float))
augmenting (SingletonAsOrderedSet): (PatternMatchable (Integer))
****** Domain: R already in scope
augmenting R: (PatternMatchable (Integer))
****** Domain: $ already in scope
augmenting $: (CharacteristicNonZero)
****** Domain: R already in scope
augmenting R: (PolynomialFactorizationExplicit)
****** Domain: $ already in scope
augmenting $: (CharacteristicNonZero)
****** Domain: R already in scope
augmenting R: (PolynomialFactorizationExplicit)
****** Domain: R already in scope
augmenting R: (Algebra (Fraction (Integer)))
****** Domain: R already in scope
augmenting R: (Algebra (Fraction (Integer)))
****** Domain: R already in scope
augmenting R: (Field)
****** Domain: R already in scope
augmenting R: (GcdDomain)
****** Domain: R already in scope
augmenting R: (IntegralDomain)
****** Domain: R already in scope
augmenting R: (LinearlyExplicitRingOver (Integer))
****** Domain: R already in scope
augmenting R: (OrderedSet)
****** Domain: R already in scope
augmenting R: (PartialDifferentialRing (Symbol))
****** Domain: R already in scope
augmenting R: (PolynomialFactorizationExplicit)
****** Domain: R already in scope
augmenting R: (RetractableTo (Fraction (Integer)))
****** Domain: R already in scope
augmenting R: (RetractableTo (Integer))
****** Domain: R already in scope
augmenting R: (StepThrough)
(time taken in buildFunctor: 49)
;;; *** |PolyHopfAlgebra| REDEFINED
;;; *** |PolyHopfAlgebra| REDEFINED
Time: 0.60 SEC.
Warnings:
[1] not known that (OrderedSet) is of mode (CATEGORY domain (SIGNATURE * ($ (Symbol) $)) (SIGNATURE * ($ $ (Symbol))) (SIGNATURE ** ($ (Symbol) (NonNegativeInteger))) (SIGNATURE hclf ($ $ $)) (SIGNATURE hcrf ($ $ $)) (SIGNATURE lquo ((Union $ failed) $ $)) (SIGNATURE rquo ((Union $ failed) $ $)) (SIGNATURE divide ((Union (Record (: lm $) (: rm $)) failed) $ $)) (SIGNATURE overlap ((Record (: lm $) (: mm $) (: rm $)) $ $)) (SIGNATURE size ((NonNegativeInteger) $)) (SIGNATURE factors ((List (Record (: gen (Symbol)) (: exp (NonNegativeInteger)))) $)) (SIGNATURE nthExpon ((NonNegativeInteger) $ (Integer))) (SIGNATURE nthFactor ((Symbol) $ (Integer))) (SIGNATURE mapExpon ($ (Mapping (NonNegativeInteger) (NonNegativeInteger)) $)) (SIGNATURE mapGen ($ (Mapping (Symbol) (Symbol)) $)) (IF (has (Symbol) (OrderedSet)) (ATTRIBUTE (OrderedSet)) noBranch))
[2] Delta1: not known that (OrderedSet) is of mode (CATEGORY domain (SIGNATURE * ($ (Symbol) $)) (SIGNATURE * ($ $ (Symbol))) (SIGNATURE ** ($ (Symbol) (NonNegativeInteger))) (SIGNATURE hclf ($ $ $)) (SIGNATURE hcrf ($ $ $)) (SIGNATURE lquo ((Union $ failed) $ $)) (SIGNATURE rquo ((Union $ failed) $ $)) (SIGNATURE divide ((Union (Record (: lm $) (: rm $)) failed) $ $)) (SIGNATURE overlap ((Record (: lm $) (: mm $) (: rm $)) $ $)) (SIGNATURE size ((NonNegativeInteger) $)) (SIGNATURE factors ((List (Record (: gen (Symbol)) (: exp (NonNegativeInteger)))) $)) (SIGNATURE nthExpon ((NonNegativeInteger) $ (Integer))) (SIGNATURE nthFactor ((Symbol) $ (Integer))) (SIGNATURE mapExpon ($ (Mapping (NonNegativeInteger) (NonNegativeInteger)) $)) (SIGNATURE mapGen ($ (Mapping (Symbol) (Symbol)) $)) (IF (has (Symbol) (OrderedSet)) (ATTRIBUTE (OrderedSet)) noBranch))
[3] Delta: not known that (OrderedSet) is of mode (CATEGORY domain (SIGNATURE * ($ (Symbol) $)) (SIGNATURE * ($ $ (Symbol))) (SIGNATURE ** ($ (Symbol) (NonNegativeInteger))) (SIGNATURE hclf ($ $ $)) (SIGNATURE hcrf ($ $ $)) (SIGNATURE lquo ((Union $ failed) $ $)) (SIGNATURE rquo ((Union $ failed) $ $)) (SIGNATURE divide ((Union (Record (: lm $) (: rm $)) failed) $ $)) (SIGNATURE overlap ((Record (: lm $) (: mm $) (: rm $)) $ $)) (SIGNATURE size ((NonNegativeInteger) $)) (SIGNATURE factors ((List (Record (: gen (Symbol)) (: exp (NonNegativeInteger)))) $)) (SIGNATURE nthExpon ((NonNegativeInteger) $ (Integer))) (SIGNATURE nthFactor ((Symbol) $ (Integer))) (SIGNATURE mapExpon ($ (Mapping (NonNegativeInteger) (NonNegativeInteger)) $)) (SIGNATURE mapGen ($ (Mapping (Symbol) (Symbol)) $)) (IF (has (Symbol) (OrderedSet)) (ATTRIBUTE (OrderedSet)) noBranch))
Cumulative Statistics for Constructor PolyHopfAlgebra
Time: 0.86 seconds
--------------non extending category----------------------
.. PolyHopfAlgebra(#1,#2) of cat
(|Join| (|UnivariatePolynomialCategory| |#1|)
(|FreeModuleCat| |#1| (|FreeMonoid| (|Symbol|)))
(|BiAlgebra| |#1|
(|TensorProduct| |#1| (|FreeMonoid| (|Symbol|))
(|FreeMonoid| (|Symbol|)) $ $))) has no outputForm : (%,OutputForm) -> OutputForm
finalizing NRLIB PHALG
Processing PolyHopfAlgebra for Browser database:
--->-->PolyHopfAlgebra(): Missing Description
------------------------------------------------------------------------
PolyHopfAlgebra is now explicitly exposed in frame initial
PolyHopfAlgebra will be automatically loaded when needed from
/var/zope2/var/LatexWiki/PHALG.NRLIB/code
axiom
P:=PolyHopfAlgebra(Integer,'u)
Type: Domain
axiom
p:=monomial(1,1)$P
Type: PolyHopfAlgebra
?(Integer,u)
axiom
Delta p
Type: TensorProduct
?(Integer,FreeMonoid
? Symbol,FreeMonoid
? Symbol,PolyHopfAlgebra
?(Integer,u),PolyHopfAlgebra
?(Integer,u))
axiom
Delta(p^2)
Type: TensorProduct
?(Integer,FreeMonoid
? Symbol,FreeMonoid
? Symbol,PolyHopfAlgebra
?(Integer,u),PolyHopfAlgebra
?(Integer,u))
axiom
Delta(p)^2
Type: TensorProduct
?(Integer,FreeMonoid
? Symbol,FreeMonoid
? Symbol,PolyHopfAlgebra
?(Integer,u),PolyHopfAlgebra
?(Integer,u))
axiom
q:=p+3
Type: PolyHopfAlgebra
?(Integer,u)
axiom
Delta(q^2)
Type: TensorProduct
?(Integer,FreeMonoid
? Symbol,FreeMonoid
? Symbol,PolyHopfAlgebra
?(Integer,u),PolyHopfAlgebra
?(Integer,u))
Please comment.
Next comes the old problem come with iterated structures.
Is it in principle possible to have:
TensorProduct(R:CommutativeRing,LB:List OrderedSet, LM:List FreeModuleCat(R))?
Since the coproduct is coassociative, we might want to define "powers",
but I realize that tensor powers are actually feasible.
Actually the basis is not redundant;
in the attached example the implementation of the Coalgebra
does not use the basis which it pretends to the tensor product.
Still exporting a basis would be a nice thing.
More questions:
- How far are we from having unicode in output?
- CoAlgebra? or Coalgebra?
- Delta or coproduct? epsilon or counit? S or antipode?
or both?
- I do not see which domains should use TensorProductProperty?,
the target module S is not part of the domain.
Anyways morphisms have to be implemented in packages
("TensorProductFunctions2?" or something like that)
- For now TensorProduct? relies on FreeModuleCat?.
To make use of the existing applicable domains we have
to add FreeModuleCat? everywhere. Extend would be good ...
First of course comes a cleanup of FreeModule? itself.
The example I cooked up in the attachment is rather ugly and fragile.
- The compiler does not warn about missing exports.
(this is a really nice feature of the aldor compiler)
I can add all categories I like, they pass the compiler
and )sh domain shows all the operations exported by the
categories. The only way to detect missing ones is by
runtime errors.
- ceterum censeo Aldorem esse liberandam
(ok, that suffices for now)