login  home  contents  what's new  discussion  bug reports     help  links  subscribe  changes  refresh  edit

Edit detail for SandBoxMorphism revision 13 of 15

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
Editor: Bill Page
Time: 2008/06/18 19:31:51 GMT-7
Note: new Rep for Morphism

changed:
-If we define 'elt' (commented out above), then 'f(1.1)' gives the following::
The naive represetation of 'Rep == (source->target)' gives the
following error.

changed:
-  Fast links are on: do (si::use-fast-links nil) for debugging
-  Error signalled by RETURN.
-  Broken at APPLY.  Type :H for Help.
-  BOOT>>
-  Error: The variable QUIT is unbound.
-  Fast links are on: do (si::use-fast-links nil) for debugging
  ...

changed:
-But the same coercion works in the interpreter.
But using 'SExpression' seems to work.

added:
g:Morphism(Integer,String):=(i:Integer):String +-> i::String
g(1985)

\begin{spad}
)abbrev domain MORPH Morphism
T ==> SetCategory
Morphism(source:T, target:T): with
  domain:%->T
  codomain:%->T
  coerce:(source->target)  -> %
  coerce:%->(source->target)
  coerce:%->OutputForm
  elt:(%,source)->target
 == (source->target) add
  -- Rep == (source->target)
  Rep == SExpression
  domain(p:%):T == source
  codomain(p:%):T == target
  coerce(r:(source->target)):% == per(r pretend SExpression)
  coerce(p:%):(source->target) == (rep(p) pretend (source->target))
  coerce(p:%):OutputForm == p pretend OutputForm
  elt(f,x) == (rep(f) pretend (source->target))(x)
\end{spad}

The naive represetation of Rep == (source->target) gives the following error.

Error: Caught fatal error [memory may be damaged] ... Error signalled by EVALHOOK. Backtrace: system:universal-error-handler > evalhook > lambda > lambda-closure > block > apply > APPLY

But using SExpression seems to work. \begin{axiom} )show Morphism(Float,Integer) f:Morphism(Float,Integer) f:=(x:Float):Integer +->wholePart(x) f(1.1) (f::(Float->Integer))(1.1) domain f codomain f (f::(domain(f)->codomain(f)))(1.1) g:Morphism(Integer,String):=(i:Integer):String +-> i::String g(1985) \end{axiom}

Next let's study how this sort of thing is accomplished in a similar domain. \begin{spad} )abbrev domain HOM Hom ++ Based on Automorphism by: Manuel Bronstein ++ Description: ++ Hom(R,S) is the domain of homomorphisms - Mapping(S,R). Hom(R:SetCategory,S:SetCategory): Join(SetCategory, Eltable(R, S)) with morphism: (R -> S) -> % ++ morphism(f) returns the non-invertible morphism given by f. == add -- Why doesn't the obvious representation just (R->S) work? Rep == SExpression morphism(f) == per(f pretend SExpression) elt(f, r) == (rep(f) pretend (R->S))(r)

--Rep == List(R -> S) --morphism(f) == per([f #1]) --elt(f, r) == (rep(f)(1))(r)

--Rep := ((R, Integer) -> S) --morphism(f) == (#2; f(#1)) --elt(f, r) == (g := f pretend ((R, Integer) -> S); g(r, 1))

f = g == EQ(f, g)$Lisp coerce(f:%):OutputForm == message("theMap ...")

\end{spad}

\begin{axiom} p:=morphism((x:Integer):Float +-> x+1.0)$Hom(Integer,Float) p(2) p(-1) \end{axiom}


Some or all expressions may not have rendered properly, because Axiom returned the following error:
Error: export AXIOM=/usr/local/lib/open-axiom/x86_64-unknown-linux/1.2.0-2008-05-25; export ALDORROOT=/usr/local/aldor/linux/1.1.0; export PATH=$ALDORROOT/bin:$PATH; export HOME=/var/zope2/var/LatexWiki; ulimit -t 120; $AXIOM/bin/AXIOMsys < /var/zope2/var/LatexWiki/5664080456631055190-25px.axm


Some or all expressions may not have rendered properly, because Latex returned the following error:
This is pdfTeXk, Version 3.141592-1.40.3 (Web2C 7.5.6)
 \write18 enabled.
 %&-line parsing enabled.
entering extended mode
(./1849614615055905063-18.0px.tex
LaTeX2e <2005/12/01>
Babel <v3.8h> and hyphenation patterns for english, usenglishmax, dumylang, noh
yphenation, arabic, farsi, croatian, ukrainian, russian, bulgarian, czech, slov
ak, danish, dutch, finnish, basque, french, german, ngerman, ibycus, greek, mon
ogreek, ancientgreek, hungarian, italian, latin, mongolian, norsk, icelandic, i
nterlingua, turkish, coptic, romanian, welsh, serbian, slovenian, estonian, esp
eranto, uppersorbian, indonesian, polish, portuguese, spanish, catalan, galicia
n, swedish, ukenglish, pinyin, loaded.
(/usr/share/texmf-texlive/tex/latex/base/article.cls
Document Class: article 2005/09/16 v1.4f Standard LaTeX document class
(/usr/share/texmf-texlive/tex/latex/base/size12.clo))
(/usr/share/texmf-texlive/tex/latex/amsmath/amsmath.sty
For additional information on amsmath, use the `? option.
(/usr/share/texmf-texlive/tex/latex/amsmath/amstext.sty
(/usr/share/texmf-texlive/tex/latex/amsmath/amsgen.sty))
(/usr/share/texmf-texlive/tex/latex/amsmath/amsbsy.sty)
(/usr/share/texmf-texlive/tex/latex/amsmath/amsopn.sty))
(/usr/share/texmf-texlive/tex/latex/amsfonts/amsfonts.sty)
(/usr/share/texmf-texlive/tex/latex/amsfonts/amssymb.sty)
(/usr/share/texmf-texlive/tex/latex/amscls/amsthm.sty)
(/usr/share/texmf-texlive/tex/latex/setspace/setspace.sty
Package: `setspace 6.7 <2000/12/01>
) (/usr/share/texmf-texlive/tex/generic/xypic/xy.sty
(/usr/share/texmf-texlive/tex/generic/xypic/xy.tex Bootstrap'ing: catcodes,
docmode, (/usr/share/texmf-texlive/tex/generic/xypic/xyrecat.tex)
(/usr/share/texmf-texlive/tex/generic/xypic/xyidioms.tex)

Xy-pic version 3.7 <1999/02/16> Copyright (c) 1991-1998 by Kristoffer H. Rose <krisrose@ens-lyon.fr> Xy-pic is free software: see the User's Guide for details.

Loading kernel: messages; fonts; allocations: state, direction, utility macros; pictures: \xy, positions, objects, decorations; kernel objects: directionals, circles, text; options; algorithms: directions, edges, connections; Xy-pic loaded) (/usr/share/texmf-texlive/tex/generic/xypic/xyall.tex Xy-pic option: All features v.3.3 (/usr/share/texmf-texlive/tex/generic/xypic/xycurve.tex Xy-pic option: Curve and Spline extension v.3.7 curve, circles, loaded) (/usr/share/texmf-texlive/tex/generic/xypic/xyframe.tex Xy-pic option: Frame and Bracket extension v.3.7 loaded) (/usr/share/texmf-texlive/tex/generic/xypic/xycmtip.tex Xy-pic option: Computer Modern tip extension v.3.3 (/usr/share/texmf-texlive/tex/generic/xypic/xytips.tex Xy-pic option: More Tips extension v.3.3 loaded) loaded) (/usr/share/texmf-texlive/tex/generic/xypic/xyline.tex Xy-pic option: Line styles extension v.3.6 loaded) (/usr/share/texmf-texlive/tex/generic/xypic/xyrotate.tex Xy-pic option: Rotate and Scale extension v.3.3 loaded) (/usr/share/texmf-texlive/tex/generic/xypic/xycolor.tex Xy-pic option: Colour extension v.3.3 loaded) (/usr/share/texmf-texlive/tex/generic/xypic/xymatrix.tex Xy-pic option: Matrix feature v.3.4 loaded) (/usr/share/texmf-texlive/tex/generic/xypic/xyarrow.tex Xy-pic option: Arrow and Path feature v.3.5 path, \ar, loaded) (/usr/share/texmf-texlive/tex/generic/xypic/xygraph.tex Xy-pic option: Graph feature v.3.7 loaded) loaded)) (/usr/share/texmf-texlive/tex/latex/graphics/graphicx.sty (/usr/share/texmf-texlive/tex/latex/graphics/keyval.sty) (/usr/share/texmf-texlive/tex/latex/graphics/graphics.sty (/usr/share/texmf-texlive/tex/latex/graphics/trig.sty) (/etc/texmf/tex/latex/config/graphics.cfg) (/usr/share/texmf-texlive/tex/latex/graphics/dvips.def))) (/usr/share/texmf-texlive/tex/latex/graphics/color.sty (/etc/texmf/tex/latex/config/color.cfg) (/usr/share/texmf-texlive/tex/latex/graphics/dvipsnam.def)) (/usr/share/texmf-texlive/tex/latex/tools/verbatim.sty) (/usr/share/texmf/tex/latex/graphviz/graphviz.sty (/usr/share/texmf-texlive/tex/latex/psfrag/psfrag.sty)) (/usr/share/texmf/tex/latex/sagetex.sty Writing sage input file 1849614615055905063-18.0px.sage (./1849614615055905063-18.0px.sout)) (/usr/share/texmf-texlive/tex/latex/gnuplottex/gnuplottex.sty (/usr/share/texmf-texlive/tex/latex/base/latexsym.sty) (/usr/share/texmf-texlive/tex/latex/moreverb/moreverb.sty)) (./1849614615055905063-18.0px.aux) Overfull \hbox (19.45984pt too wide) in paragraph at lines 63--82 []\OT1/cmr/m/n/12 )abbrev do-main MORPH Mor-phism T ==> Set-Cat-e-gory Mor-phis m(source:T,

Overfull \hbox (21.96378pt too wide) in paragraph at lines 63--82 \OT1/cmr/m/n/12 tar-get:T): with domain:codomain:coerce:(source->target) -> co- erce:coerce:elt:(==

Overfull \hbox (160.7693pt too wide) in paragraph at lines 63--82 \OT1/cmr/m/n/12 (source->target) add -- Rep == (source->target) Rep == SEx-pres -sion domain(p:codomain(p:coerce(r:(source- [1] [2] Overfull \hbox (27.85265pt too wide) in paragraph at lines 97--109 \OT1/cmr/m/n/12 Map-ping(S,R). Hom(R:SetCategory,S:SetCategory): Join(SetCatego ry, Eltable(R, You can't use `macro parameter character #' in horizontal mode. l.111 --morphism(f) == per([f # 1])

Overfull \hbox (13.3474pt too wide) in paragraph at lines 110--113 []\OT1/cmr/m/n/12 --Rep == List(R -> S) --morphism(f) == per([f 1]) --elt(f, r) == (rep(f)(1))(r) You can't use `macro parameter character #' in horizontal mode. l.115 ... --morphism(f) == (# 2; f(#1)) You can't use `macro parameter character #' in horizontal mode. l.115 ...rphism(f) == (#2; f(# 1)) (/usr/share/texmf-texlive/tex/latex/amsfonts/umsa.fd) (/usr/share/texmf-texlive/tex/latex/amsfonts/umsb.fd) (/usr/share/texmf-texlive/tex/latex/base/ulasy.fd) Missing $ inserted. <inserted text> $ l.120

[3] [4] [5] (./1849614615055905063-18.0px.aux) ) (see the transcript file for additional information) Output written on 1849614615055905063-18.0px.dvi (5 pages, 2892 bytes). Transcript written on 1849614615055905063-18.0px.log.