C Content Element Definitions

Overview: Mathematical Markup Language (MathML) Version 2.0 (Second Edition)
Previous: B Content Markup Validation Grammar
Next: D Document Object Model for MathML

C Content Element Definitions
    C.1 About Content Markup Elements
        C.1.1 The Default Definitions
        C.1.2 The Structure of an MMLdefinition.
    C.2 Definitions of MathML Content Elements
        C.2.1 Token Elements
            C.2.1.1 cn
            C.2.1.2 ci
            C.2.1.3 csymbol
        C.2.2 Basic Content Elements
            C.2.2.1 apply
            C.2.2.2 reln
            C.2.2.3 fn
            C.2.2.4 interval
            C.2.2.5 inverse
            C.2.2.6 sep
            C.2.2.7 condition
            C.2.2.8 declare
            C.2.2.9 lambda
            C.2.2.10 compose
            C.2.2.11 ident
            C.2.2.12 domain
            C.2.2.13 codomain
            C.2.2.14 image
            C.2.2.15 domainofapplication
            C.2.2.16 piecewise
            C.2.2.17 piece
            C.2.2.18 otherwise
        C.2.3 Arithmetic Algebra and Logic
            C.2.3.1 quotient
            C.2.3.2 factorial
            C.2.3.3 divide
            C.2.3.4 max
            C.2.3.5 min
            C.2.3.6 minus
            C.2.3.7 plus
            C.2.3.8 power
            C.2.3.9 rem
            C.2.3.10 times
            C.2.3.11 root
            C.2.3.12 gcd
            C.2.3.13 and
            C.2.3.14 or
            C.2.3.15 xor
            C.2.3.16 not
            C.2.3.17 implies
            C.2.3.18 forall
            C.2.3.19 exists
            C.2.3.20 abs
            C.2.3.21 conjugate
            C.2.3.22 arg
            C.2.3.23 real
            C.2.3.24 imaginary
            C.2.3.25 lcm
            C.2.3.26 floor
            C.2.3.27 ceiling
        C.2.4 Relations
            C.2.4.1 eq
            C.2.4.2 neq
            C.2.4.3 gt
            C.2.4.4 lt
            C.2.4.5 geq
            C.2.4.6 leq
            C.2.4.7 equivalent
            C.2.4.8 approx
            C.2.4.9 factorof
        C.2.5 Calculus and Vector Calculus
            C.2.5.1 int
            C.2.5.2 diff
            C.2.5.3 partialdiff
            C.2.5.4 lowlimit
            C.2.5.5 uplimit
            C.2.5.6 bvar
            C.2.5.7 degree
            C.2.5.8 divergence
            C.2.5.9 grad
            C.2.5.10 curl
            C.2.5.11 laplacian
        C.2.6 Theory of Sets
            C.2.6.1 set
            C.2.6.2 list
            C.2.6.3 union
            C.2.6.4 intersect
            C.2.6.5 in
            C.2.6.6 notin
            C.2.6.7 subset
            C.2.6.8 prsubset
            C.2.6.9 notsubset
            C.2.6.10 notprsubset
            C.2.6.11 setdiff
            C.2.6.12 card
            C.2.6.13 cartesianproduct
        C.2.7 Sequences and Series
            C.2.7.1 sum
            C.2.7.2 product
            C.2.7.3 limit
            C.2.7.4 tendsto
        C.2.8 Elementary Classical Functions
            C.2.8.1 exp
            C.2.8.2 ln
            C.2.8.3 log
            C.2.8.4 sin
            C.2.8.5 cos
            C.2.8.6 tan
            C.2.8.7 sec
            C.2.8.8 csc
            C.2.8.9 cot
            C.2.8.10 sinh
            C.2.8.11 cosh
            C.2.8.12 tanh
            C.2.8.13 sech
            C.2.8.14 csch
            C.2.8.15 coth
            C.2.8.16 arcsin
            C.2.8.17 arccos
            C.2.8.18 arctan
            C.2.8.19 arccosh
            C.2.8.20 arccot
            C.2.8.21 arccoth
            C.2.8.22 arccsc
            C.2.8.23 arccsch
            C.2.8.24 arcsec
            C.2.8.25 arcsech
            C.2.8.26 arcsinh
            C.2.8.27 arctanh
        C.2.9 Statistics
            C.2.9.1 mean
            C.2.9.2 sdev
            C.2.9.3 variance
            C.2.9.4 median
            C.2.9.5 mode
            C.2.9.6 moment
            C.2.9.7 momentabout
        C.2.10 Linear Algebra
            C.2.10.1 vector
            C.2.10.2 matrix
            C.2.10.3 matrixrow
            C.2.10.4 determinant
            C.2.10.5 transpose
            C.2.10.6 selector
            C.2.10.7 vectorproduct
            C.2.10.8 scalarproduct
            C.2.10.9 outerproduct
        C.2.11 Constants and Symbol Elements
            C.2.11.1 integers
            C.2.11.2 reals
            C.2.11.3 rationals
            C.2.11.4 naturalnumbers
            C.2.11.5 complexes
            C.2.11.6 primes
            C.2.11.7 exponentiale
            C.2.11.8 imaginaryi
            C.2.11.9 notanumber
            C.2.11.10 true
            C.2.11.11 false
            C.2.11.12 emptyset
            C.2.11.13 pi
            C.2.11.14 eulergamma
            C.2.11.15 infinity

C.1 About Content Markup Elements

The primary role of MathML content elements is to provide a mechanism for recording that a particular notational structure has a particular mathematical meaning. To this end, every content element must have a mathematical definition associated with it in some form. The purpose of this appendix is to provide default definitions. (An index to the definitions is provided later in this document.) Authors may adapt the notation to their own particular needs by using mechanisms provided to override these default definitions for selected content elements.

The mathematical definitions below are not restricted to any one format. There are several reasons for allowing this, nearly all derived from the fact that it is extremely important to allow authors to make use of existing definitions from the mathematical literature.

  1. There is no suitable notation in common use. For example, the mathematical libraries of even the most extensive mathematical computation systems in use today capture only a small fraction of the mathematical literature and furthermore much of mathematics is not computational.

  2. In most cases, the translation of a mathematical definition into a new notation is an inappropriate use of an author's energy and time.

  3. The task of designing a new machine readable language suitable for recording semantic descriptions is one that goes substantially beyond the scope of this particular recommendation. It would also overlap substantially with the efforts of such groups as the OpenMath Consortium (see also the North American OpenMath Initiative, and the European OpenMath Consortium).

The key issues for both archival and computational purposes are that there be a definition and that the author have a mechanism to specify which definition is intended for a given instance of a notational construct. This requirement is important whether or not there is an implementation of a particular concept or object in a mathematical computation system. The definition may be as vague as claiming that, say, F is an unknown but differentiable function from the real numbers to the real numbers, or as complicated as requiring that F be an elaborate function or operation as defined in a specific research paper. The important thing is that the reader always have a way of determining how the notation is being used.

C.1.1 The Default Definitions

An author's decision to use content elements is a decision to use defined objects. To make this easier, default definitions are provided. In this way, an author need only provide explicit definitions where the usage differs from the default. Where possible the default definitions have naturally been chosen to reflect common usage.

Definitions are overridden in a particular instance by making use of the definitionURL attribute. The value of this attribute is a URI (notwithstanding its old-style name) and beyond that its format is unspecified. It may even be the case that the definitionURL's value is just a name invented by the author. In that case it serves to warn the reader (and computational systems) that the author is using a private local definition. It may be the URL of a mathematical paper, or a reference to a traditional source in which the construct is defined. If the author's mathematical operator matches exactly an operator in a particular computational system, an appropriate definition might use a MathML semantics element to establish a correspondence between two encodings. Whatever format is chosen, the only requirement is that some sort of definition be indicated.

The rest of this appendix provides detailed descriptions of the default semantics associated with each of the MathML content elements. Since this is exactly the role intended for the encodings under development by the OpenMath Consortium, and one of our goals is to foster cooperation in such standardization efforts, we have presented the default definitions in a format modeled on OpenMath's content dictionaries. While the actual details differ somewhat from the OpenMath specification, the underlying principles are the same.

Several of the definitions provided here refer to one or more of the standard mathematical references Abramowitz and Stegun [Abramowitz1997] and Standard Mathematical Tables and Formulae [Zwillinger1988].

C.1.2 The Structure of an MMLdefinition.

In the XML source for this appendix each MathML element is described using an XML vocabulary designed for the purpose. Though well adapted to machine processing the XML form of the definitions is difficult to read for humans. Therefore the text below is composed in a way automatically derived by XSL transformations (and typesetting in the case of the PDF versions of the MathML specification) from the XML source, but formatted so that it is much easier to read and comprehend. The conventions employed will be explained just below in the course of going through the elements of the XML markup in the XML source. The first example definition, but only that one, will be provided in both the more legible form and in raw XML, so the difference can be appreciated.

The top element is MMLdefinition. The sub-elements identify the various parts of the description and include:

name

PCDATA providing the name of the MathML element.

description

A CDATA description of the object that an element represents. This will often reference more traditional texts or papers or existing papers on the Web.

classification

Each MathML element must be classified according to its mathematical role.

punctuation

Some elements exist simply as an aid to parsing. For example the sep element is used to separate the CDATA defining a rational number into two parts in a manner that is easily parsed by an XML application. These objects are referred to as punctuation.

descriptor

Some elements exist simply to modify the properties of an existing element or mathematical object. For example the declare construct is used to reset the default attribute values, or to associate a name with a specific instance of an object. These kinds of elements are referred to as descriptors and the type of the resulting object is the same as that of element being modified, but with the new attribute values.

function (operator)

The traditional mathematical functions and operators are represented in MathML by empty XML elements such as plus and sin. These function elements can be assigned alternative definitions (indicating, for example, that they represent operations on elements from some author defined algebra) through use of the definitionURL attribute. They can be included in expressions on their own such as when discussing the properties of a function, or they can be applied to arguments using apply. The latter case is referred to as function application.

Functions are often classified according to how they are used. For example the plus element is an n-ary operator. This additional information is captured by the signature. The signature of a function (see below) describes how it is to be used as a mathematical function inside an apply element. Each combination of types of function arguments used inside an apply gives rise to an apply element of a given type.

constant

Mathematical constants are generally represented by empty elements and are distinguished from functions by the fact that they are not used as the first argument of an apply. Their signature is simply the type of the object they represent.

constructor

The remaining objects that "contain" sub-elements are all object constructors of some sort or another. They combine the sub-elements into a compound mathematical object such as a constant, set, list, or a function application. For example, the lambda element constructs a function definition from a list of variables and an expression. while the apply element constructs a function application. By function application we mean the result of applying the first element of the apply (the function) to the zero or more remaining elements (the arguments). A function application represents an object in the range of the function.

For each given combination of type and order of XML children, the signature of a constructor indicates the type (and sometimes subtype) of the resulting object.

MMLattribute

Some of the XML attributes of a MathML content element have a direct impact on the mathematical semantics of the object. For example the type attribute of the cn element is used to determine what type of constant (integer, real, etc.) is being constructed. Only those attributes that affect the mathematical properties of an object are listed here and typically these also appear explicitly in the signature.

signature

The signature is a systematic representation that associates the types of different possible combinations of attributes and function arguments with the type of mathematical object that is constructed. The possible combinations of parameter and argument types (the left-hand side) each result in an object of some type (the right-hand side). In effect, it describes how to resolve operator overloading.

For constructors, the left-hand side of the signature describes the types of the child elements and the right-hand side describes the type of object that is constructed. For functions, the left-hand side of the signature indicates the types of the parameters and arguments that would be expected when it is applied, or used to construct a relation, and the right-hand side represents the mathematical type of the object constructed by the apply. Modifiers modify the attributes of an existing object. For example, a symbol might become a symbol of type vector.

The signature must be able to record specific attribute values and argument types on the left, and parameterized types on the right.. The syntax used for signatures is of the general form:

[<attribute name>=<attribute-value>]( <list of argument types> )
--> <mathematical result type>(<mathematical subtype>)

The MMLattributes, if any, appear in the form <name>=<value>. They are separated notationally from the rest of the arguments by square brackets. The possible values are usually taken from an enumerated list, and the signature is usually affected by selection of a specific value.

For the actual function arguments and named parameters on the left, the focus is on the mathematical types involved. The function argument types are presented in a syntax similar to that used for a DTD, with the one main exception. The types of the named parameters appear in the signature as <elementname>=<type> in a manner analogous for that used for attribute values. For example, if the argument is named (e.g. bvar) then it is represented in the signature by an equation as in:

[<attribute name>=<attributevalue>]( bvar=symbol,<argument list> ) -->
<mathematical result type>(<mathematical subtype>)

There is no formal type system in MathML. The type values that are used in the signatures are common mathematical types such as integer, rational, real, complex (such as found in the description of cn), or a name such as string or the name of a MathML constructor. Various collections of types such as anything, matrixtype are used from time to time. The type name mmlpresentation is used to represent any valid MathML presentation object and the name MathMLtype is used to describe the collection of all MathML types. The type domainofapp is used to represent a domain of application. Whereever it occurs, it can be replaced by one of the various abbreviated forms as described in the validation grammar. For example, the signatures

(domainofapp,function) -> anything
(bvar+,domainofapp,anything) -> anything

imply all of the alternative forms

(interval,function) -> anything
(domainofapplication,function) -> anything
(bvar+,domainofapplication,anything) -> anything
(bvar+,condition,anything) -> anything
(bvar+,lowlimit,uplimit?,anything) -> anything

The type algebraic is used for expressions constructed FROM ONE OR MORE symbols through arithmetic operations and interval-type refers to the valid types of intervals as defined in chapter 4. The collection of types is not closed. Users writing their own definitions of new constructs may introduce new types.

Depending on the types involved, more than one signature may apply. For example, many arithmetic operations involving integers map to integers, but since integers are real numbers, the signature for real numbers also is valid. Generally, the signature providing the most information is most appropriate.

No mathematical evaluation ever takes place in MathML. Every MathML content element either refers to a defined object such as a mathematical function or it combines such objects in some way to build a new object. For purposes of the signature, the constructed object represents an object of a certain type parameterized type. For example the result of applying plus to arguments is an expression that represents a sum. The type of the resulting expression depends on the types of the operands, and the values of the MathML attributes.

example

Examples of the use of this object in MathML are included in these elements.

property

This element describes the mathematical properties of such objects. For simple associations of values with specific instances of an object, the first child is an instance of the object being defined. The second is a value or approx (approximation) element that contains a MathML description of this particular value. More elaborate conditions on the object are expressed using the MathML syntax.

comment

These elements contain only PCDATA and can occur as a child of the MMLdefinition at any point.

C.2 Definitions of MathML Content Elements

C.2.1 Token Elements

C.2.1.1 MMLdefinition: cn

Description

The cn element is used to encode numerical constants. The mathematical type of number is given as an attribute. The default type is "real". Numbers such as e-notation, rational and complex, require two parts for a complete specification. The parts of such a number are separated by an empty sep element.

Many of the commonly occurring numeric constants such as &pi; have their own elements.

See also 4.4.1.1 Number (cn).

Classification
constant
MMLattribute
Name Value Default
definitionURL URI identifying the definition APPENDIX_C
encoding CDATA MathML
type integer | rational | complex-cartesian | complex-polar | real | e-notation | MathMLtype real
base integer between 2 and 36 10
Signature

[type=integer](numstring) -> constant(integer)

[base=base-value](numstring) -> constant(integer)

[type=rational](numstring,numstring) -> constant(rational)

[type=complex-cartesian](numstring,numstring) -> constant(complex)

[type=e-notation](numstring,numstring) -> constant(e-notation)

[type=complex-polar](numstring,numstring) -> constant(rational)

[definitionURL=definition](numstring*) -> constant(user-defined)

Property
<apply><eq/><cn base="16"> A </cn><cn> 10 </cn></apply>
Property
<apply><eq/><cn base="16"> B </cn><cn> 11 </cn></apply>
Property
<apply><eq/><cn base="16"> C </cn><cn> 12 </cn></apply>
Property
<apply><eq/><cn base="16"> D </cn><cn> 13 </cn></apply>
Property
<apply><eq/><cn base="16"> E </cn><cn> 14 </cn></apply>
Property
<apply><eq/><cn base="16"> F </cn><cn> 15 </cn></apply>
Example
<cn> 245 </cn>
Example
<cn type="integer"> 245 </cn>
Example
<cn type="integer" base="16"> A </cn>
Example
<cn type="rational"> 245 <sep/> 351 </cn>
Example
<cn type="complex-cartesian"> 1 <sep/> 2 </cn>
Example
<cn> 245 </cn>
Example
<apply><eq/>
<cn type="e-notation"> 2 <sep/> 5 </cn>
<apply><times/><cn>2</cn><apply><power/><cn>10</cn><cn>5</cn></apply></apply>
</apply>

C.2.1.2 MMLdefinition: ci

Description

This element constructs an identifier (symbolic name). The type attribute is used to indicate the type of object being specified. By default, the type is real.

See also 4.4.1.2 Identifier (ci).

Classification
constructor
MMLattribute
Name Value Default
definitionURL URI identifying the definition APPENDIX_C
encoding CDATA MathML
type constant | matrix | set | vector | list | MathMLtype real
Signature

({string|mmlpresentation}) -> symbol

[type=typename]({string|mmlpresentation}) -> symbol(typename)

Example
<ci> xyz </ci>
Example
<ci  type="vector"> v </ci>

C.2.1.3 MMLdefinition: csymbol

Description

The csymbol element allows a writer to introduce new objects into MathML. The objects are linked to external definitions by means of the definitionURL attribute and encoding attribute. The csymbol element becomes the "name" of the new object. The new objects are typically either constants or functions.

See also 4.4.1.3 Externally defined symbol (csymbol).

Classification
constant function
MMLattribute
Name Value Default
definitionURL URI identifying the definition APPENDIX_C
encoding CDATA MathML
Signature

[definitionURL=definition]({string|mmlpresentation}) -> defined_symbol

[type=typename]({string|mmlpresentation}) -> defined_symbol(typename)

Example
<csymbol definitionURL=".../mydefinitionofPi">&pi;</csymbol>

C.2.2 Basic Content Elements

C.2.2.1 MMLdefinition: apply

Description

This is the MathML constructor for function application. The first argument is applied to the remaining arguments. It may be the case that some of the child elements are named elements. (See the signature.)

See also 4.4.2.1 Apply (apply).

Classification
constructor
MMLattribute
Name Value Default
definitionURL a URI identifying the definition APPENDIX_C
encoding CDATA MathML
Signature

(function,anything*) -> apply

Example
<apply><plus/>
<ci>x</ci>
<cn>1</cn>
</apply>
Example
<apply><sin/>
<ci>x</ci>
</apply>

C.2.2.2 MMLdefinition: reln

Description

This constructor has been deprecated. All uses of reln are replaced by apply.

This is the MathML 1.0 constructor for expressing a relation between two or more mathematical objects. The first argument indicates the type of "relation" between the remaining arguments. (See the signature.) No assumptions are made about the truth value of such a relation. Typically, the relation is used as a component in the construction of some logical assertion. Relations may be combined into sets, etc. just like any other mathematical object.

See also 4.4.2.2 Relation (reln).

Classification
constructor
MMLattribute
Name Value Default
definitionURL a URI identifying the definition APPENDIX_C
encoding CDATA MathML
Signature

(function,anything*) -> apply

Example

No examples of deprecated constructions are provided.

        

C.2.2.3 MMLdefinition: fn

Description

This constructor has been deprecated.

This was the MathML 1.0 constructor for building new functions. Its role was to identify a general MathML content object as a function in such a way that it could have a definition and be used in a function context such as in apply and declare. This is now accomplished through the use of definitionURL and the fact that declare and apply allow any content element as their first argument.

See also 4.4.2.3 Function (fn).

Classification
constructor
MMLattribute
Name Value Default
definitionURL a URI identifying the definition APPENDIX_C
encoding CDATA MathML
Signature

(anything) -> function

[definitionURL=functiondef](anything) ->function

Example

No examples of deprecated constructions are provided.

        
      

C.2.2.4 MMLdefinition: interval

Description

This is the MathML constructor element for building an interval on the real line. While an interval can be expressed by combining relations appropriately, they occur here explicitly because of the frequency of their use.

See also 4.4.2.4 Interval (interval).

Classification
constructor
MMLattribute
Name Value Default
definitionURL a URI identifying the definition APPENDIX_C
encoding CDATA MathML
type closed | open | open-closed | closed-open closed
Signature

[type=interval-type](algebraic,algebraic) -> interval(interval-type)

Example
<interval closure="open">
  <ci>x</ci>
  <cn>1</cn>
</interval>
Example
<interval closure="open-closed">
  <cn>0</cn>
  <cn>1</cn>
</interval>
Example
<interval>
  <bvar><ci>x</ci></bvar>
  <condition>
    <apply><lt/><cn>0</cn><ci>x</ci></apply>
    </condition>
</interval>
Example
<apply><int/>
  <interval><cn>0</cn><cn>1</cn></interval>
  <ci type="function">f</ci>
</apply>

C.2.2.5 MMLdefinition: inverse

Description

This MathML element is applied to a function in order to construct a new function that is to be interpreted as the inverse function of the original function. For a particular function F, inverse(F) composed with F behaves like the identity map on the domain of F and F composed with inverse(F) should be an identity function on a suitably restricted subset of the Range of F. The MathML definitionURL attribute should be used to resolve notational ambiguities, or to restrict the inverse to a particular domain or to make it one-sided.

See also 4.4.2.5 Inverse (inverse).

Classification
operator
MMLattribute
Name Value Default
definitionURL a URI identifying the definition APPENDIX_C
encoding CDATA MathML
Signature

(function) -> function

[definitionURL=URI](function) -> function(definition)

Property

ForAll( y, such y in domain( f^(-1) ), f( f^(-1)(y) ) = y

          
<apply><forall/>
  <bvar><ci>y</ci></bvar>
  <bvar><ci type="function">f</ci></bvar>
  <condition>
    <apply><in/>
      <ci>y</ci>
      <apply><csymbol definitionURL="domain"><mtext>Domain</mtext></csymbol>
        <apply><inverse/><ci type="function">f</ci></apply>
      </apply>
    </apply>
  </condition>
  <apply><eq/>
    <apply><ci type="function">f</ci>
      <apply><apply><inverse/><ci type="function">f</ci></apply>
        <ci>y</ci>
      </apply>
    </apply>
    <ci>y</ci>
  </apply>
</apply>
Example
<apply><inverse/>
  <sin/>
</apply>
Example
<apply><inverse definitionURL="www.example.com/MathML/Content/arcsin"/>
  <sin/>
</apply>

C.2.2.6 MMLdefinition: sep

Description

This is the MathML infix constructor used to sub-divide PCDATA into separate components. This is used in the description of a multi-part number such as a rational or a complex number.

See also 4.4.2.6 Separator (sep).

Classification
punctuation
Example
<cn type="complex-polar">123<sep/>456</cn>
Example
<cn>123</cn>

C.2.2.7 MMLdefinition: condition

Description

This is the MathML constructor for building conditions. A condition differs from a relation in how it is used. A relation is simply an expression, while a condition is used as a predicate to place conditions on bound variables.

You can build compound conditions by applying operators such as "and" or "or" .

See also 4.4.2.7 Condition (condition).

Classification
constructor
MMLattribute
Name Value Default
definitionURL a URI identifying the definition APPENDIX_C
encoding CDATA MathML
Signature

(apply) -> predicate

(boolean) -> predicate

Example
<condition>
  <apply><lt/>
    <apply><power/><ci>x</ci><cn>5</cn></apply>
    <cn>3</cn>
  </apply>
</condition>
Example
<apply><int/>
  <bvar><ci>x</ci></bvar>
  <condition><apply><in/><ci>x</ci><ci type="set">C</ci></apply></condition>
  <apply><ci type="function">f</ci><ci>x</ci></apply>
</apply>

C.2.2.8 MMLdefinition: declare

Description

This is the MathML constructor for associating default attribute values and values with mathematical objects. For example V may be an identifier declared to be a vector (has the attribute of being a vector), or V may be a name that stands for a particular vector.

The attribute values of the declare statement itself become the default attribute values of the first argument of the declare.

If there is a second argument, the first argument becomes an alias for the second argument and it also assumes all the properties of the second argument . For example, a ci identifier v, declared to be the vector (1,2,3) would appear in the type style of a vector, and would have a norm which is the norm of (1,2,3)

See also 4.4.2.8 Declare (declare).

Classification
modifier
MMLattribute
Name Value Default
definitionURL a URI identifying the definition APPENDIX_C
encoding CDATA MathML
type MathMLtype none
nargs number of arguments for an object of operator *
occurrence infix | prefix prefix
Signature

[(attributename=attributevalue)*](anything) -> [(attributename=attributevalue)*](anything)

[(attributename=attributevalue)*](anything,anything) -> [(attributename=attributevalue)*](anything)

(anything,anything) -> (anything)

Example
<declare>
  <ci>y</ci>
  <apply><plus/><ci>x</ci><cn>3</cn></apply>
</declare>
Example
<declare type="vector"> <ci> V </ci> </declare>
Example
<declare type="vector">
  <ci> V </ci>
  <vector><cn> 1 </cn><cn> 2 </cn><cn> 3 </cn></vector>
</declare>

C.2.2.9 MMLdefinition: lambda

Description

This is the operation of lambda calculus that constructs a function from an expression and a variable. Lambda is an n-ary function, where all but an optional domain of application and the last argument are bound variables and the last argument is an expression possibly involving those variables. The lambda function can be viewed as the inverse of function application.

For example, Lambda( x, F ) is written as \lambda x [F] in the lambda calculus literature. The expression F may contain x but the full lambda expression is regarded to be free of x. A computational application receiving a MathML lambda expression should not evaluate x or test for x. Such an application may apply the lambda expression as a function to arguments in which case any result that is computed is computed through parameter substitutions into F.

Note that a lambda expression on an arbitrary function applied to a the bound variable is equivalent to that arbitrary function. A domain of application can be used to restrict the defined function to a specific domain.

See also 4.4.2.9 Lambda (lambda).

Classification
constructor
MMLattribute
Name Value Default
definitionURL a URI identifying the definition APPENDIX_C
encoding CDATA MathML
Signature

(bvar*,anything) -> function

(domainofapp,function) -> function

(bvar+,domainofapp,anything) -> function

Property

ForAll( F, lambda(x,F(x)) = F )

          
<apply><forall/>
  <bvar><ci>F</ci></bvar>
  <apply><eq/>
    <lambda>
      <bvar><ci>x</ci></bvar>
      <apply><ci>F</ci><ci>x</ci></apply>
    </lambda>
    <ci>F</ci>
  </apply>
</apply>
Example
<lambda>
  <bvar><ci>x</ci></bvar>
  <apply><sin/><apply><plus/><ci> x </ci><cn> 3 </cn></apply></apply>
</lambda>

C.2.2.10 MMLdefinition: compose

Description

This is the MathML constructor for composing functions. In order for a composition to be meaningful, the range of the first function should be the domain of the second function, etc. . However, since no evaluation takes place in MathML, such a construct can safely be used to make statements such as that f composed with g is undefined.

The result is a new function whose domain is the domain of the first function and whose range is the range of the last function and whose definition is equivalent to applying each function to the previous outcome in turn as in:

(f @ g )( x ) == f( g(x) ).

This function is often denoted by a small circle infix operator.

See also 4.4.2.10 Function composition (compose).

Classification
function
MMLattribute
Name Value Default
definitionURL a URI identifying the definition APPENDIX_C
encoding CDATA MathML
Signature

(function*) -> function

Property

ForAll( x, (f@g)(x) = f(g(x) )

          
<apply><forall/>
  <bvar><ci>x</ci></bvar><bvar><ci>f</ci></bvar><bvar><ci>g</ci></bvar>   
  <apply><eq/>
    <apply><apply><compose/><ci>f</ci><ci>g</ci></apply>
      <ci>x</ci>
    </apply>
    <apply><ci>f</ci><apply><ci>g</ci><ci>x</ci></apply></apply>
  </apply>
</apply>
Example

The use of fn is deprecated. Use type="function" instead.

          
<apply><compose/>
  <ci type="function"> f </ci>
  <ci type="function"> g </ci>
  <sin/>
</apply>

C.2.2.11 MMLdefinition: ident

Description

The ident element represents the identity function. MathML makes no assumption about the function space in which the identity function resides. Proper interpretation of the domain (and hence range) of the identity function depends on the context in which it is used.

See also 4.4.2.11 Identity function (ident).

Classification
constructor
MMLattribute
Name Value Default
definitionURL a URI identifying the definition APPENDIX_C
encoding CDATA MathML
Signature

function

Property

ForAll( x, ident(x) = x )

          
<apply><forall/>
  <bvar><ci>x</ci></bvar>
  <apply><eq/>
    <apply><ident/><ci>x</ci></apply>
    <ci>x</ci>
  </apply>
</apply>
Example
<apply><eq/>
  <apply><compose/>
    <ci type="function"> f </ci>
    <apply><inverse/><ci type="function"> f </ci></apply>
  </apply>
  <ident/>
</apply>

C.2.2.12 MMLdefinition: domain

Description

The domain element denotes the domain of a given function, which is the set of values over which it is defined.

To override the default semantics for this element, or to associate a more specific definition, use the definitionURL and encoding attributes

See also 4.4.2.12 Domain (domain).

Classification
function
MMLattribute
Name Value Default
definitionURL a URI identifying the definition APPENDIX_C
encoding CDATA MathML
Signature

(function) -> set

Example
<apply><eq/>
  <apply><domain/><ci>f</ci></apply>
  <reals/>
</apply>

C.2.2.13 MMLdefinition: codomain

Description

The codomain (range) element denotes the codomain of a given function, which is a set containing all values taken by the function. The codomain may contain additional points which are not realized by applying the the function to elements of the domain.

To override the default semantics for this element, or to associate a more specific definition, use the definitionURL and encoding attributes

See also 4.4.2.13 codomain (codomain).

Classification
function
MMLattribute
Name Value Default
definitionURL a URI identifying the definition APPENDIX_C
encoding CDATA MathML
Signature

(function) -> set

Property

ForAll( y, Exists(x,y =f(x)), member(y,codomain(f)) )

          
        
Example
<apply><eq/>
  <apply><codomain/><ci>f</ci></apply>
  <rationals/>
</apply>

C.2.2.14 MMLdefinition: image

Description

The image element denotes the image of a given function, which is the set of values taken by the function. Every point in the image is generated by the function applied to some point of the domain.

To override the default semantics for this element, or to associate a more specific definition, use the definitionURL and encoding attributes

See also 4.4.2.14 Image (image).

Classification
function
MMLattribute
Name Value Default
definitionURL a URI identifying the definition APPENDIX_C
encoding CDATA MathML
Signature

(function) -> set

Property

ForAll( x, x in image(f), ThereExists(y,f(y)=x) )

          
Example
<apply><eq/>
  <apply><image/><sin/></apply>
  <interval><cn>-1</cn><cn> 1</cn></interval>
</apply>
Example
<apply><forall/>
  <bvar><ci>x</ci></bvar>
  <condition>
    <apply><in/>
      <ci>x</ci>
      <apply><image/><ci>f</ci></apply>
    </apply>
  </condition>
  <apply><in/>
    <ci>x</ci>
    <apply><codomain/><ci>f</ci></apply>
  </apply>
</apply>

C.2.2.15 MMLdefinition: domainofapplication

Description

The domainofapplication element is a qualifier used by a number of defined functions. It denotes the domain over which a given function is being applied. Special cases of this qualifier can be abbreviated using one of interval condition or an (lowlimit,uplimit) pair. It is constructed from a set or the name of a set.

To override the default semantics for this element, or to associate a more specific definition, use the definitionURL and encoding attributes

See also 4.4.2.15 Domain of Application (domainofapplication).

Classification
function
MMLattribute
Name Value Default
definitionURL a URI identifying the definition APPENDIX_C
encoding CDATA MathML
Signature

(set) -> domain

(identifier) -> domain

Example
<apply><int/>
  <domainofapplication><ci>C</ci></domainofapplication>
  <ci>f </ci>
</apply>
Example
<apply><int/>
      <domainofapplication>
        <set>
          <bvar><ci>t</ci></bvar>
          <condition>
            <apply><in/>
              <ci>t</ci>
              <ci type="set">C</ci>
            </apply>
          </condition>
        </set>
      </domainofapplication>
      <ci>f</ci>
</apply>

C.2.2.16 MMLdefinition: piecewise

Description

The piecewise, piece, and otherwise elements are used to support 'piecewise' declarations of the form H(x) = 0 if x less than 0, H(x) = 1 otherwise. The piece and otherwise elements describe evaluation rules. If no rule applies or if more than one rule applies but they give different answers then the expression is undefined.

To override the default semantics for this element, or to associate a more specific definition, use the definitionURL and encoding attributes

See also 4.4.2.16 Piecewise declaration (piecewise, piece, otherwise) .

Classification
constructor
MMLattribute
Name Value Default
definitionURL a URI identifying the definition APPENDIX_C
encoding CDATA MathML
Signature

(piece*, otherwise?) -> algebraic

(piece*, otherwise?) -> anything

Property

ForAll( x, x in domain(f), the evaluation rules collectively produce at most one value in codomain(f) )

          
Example
<piecewise>
  <piece><cn> 0</cn><apply><lt/><ci> x</ci> <cn> 0</cn></apply></piece>
  <otherwise><ci>x</ci></otherwise>
</piecewise>
Example

The value of the abs function evaluated at x can be written as:

          <piecewise>
  <piece>
    <apply><minus/><ci>x</ci></apply>
    <apply><lt/><ci> x</ci><cn> 0</cn></apply>
  </piece>
  <piece>
    <cn>0</cn>
    <apply><eq/><ci>x</ci><cn>0</cn></apply>
  </piece>
  <piece>
    <ci>x</ci>
    <apply><gt/><ci>x</ci><cn>0</cn></apply>
  </piece>
</piecewise>

C.2.2.17 MMLdefinition: piece

Description

The piece element is used to construct the conditionally defined values as part of a piecewise object.

To override the default semantics for this element, or to associate a more specific definition, use the definitionURL and encoding attributes

See also 4.4.8.1 common trigonometric functions .

Classification
constructor
MMLattribute
Name Value Default
definitionURL a URI identifying the definition APPENDIX_C
encoding CDATA MathML
Signature

(algebraic, boolean) -> piece

(anything, boolean) -> piece

Example
<piecewise>
  <piece><cn>0</cn><apply><lt/><ci> x</ci> <cn> 0</cn></apply></piece>
  <otherwise><ci>x</ci></otherwise>
</piecewise>

C.2.2.18 MMLdefinition: otherwise

Description

The otherwise element is used to describe the value of a piecewise construct when none of the conditions of the associated pieces are satisfied.

To override the default semantics for this element, or to associate a more specific definition, use the definitionURL and encoding attributes

See also 4.4.8.1 common trigonometric functions .

Classification
constructor
MMLattribute
Name Value Default
definitionURL a URI identifying the definition APPENDIX_C
encoding CDATA MathML
Signature

(algebraic) -> otherwise

(anything) -> otherwise

Example
<piecewise>
  <piece><cn> 0</cn><apply><lt/><ci> x</ci> <cn> 0</cn></apply></piece>
  <otherwise><ci>x</ci></otherwise>
</piecewise>

C.2.3 Arithmetic Algebra and Logic

C.2.3.1 MMLdefinition: quotient

Description

quotient is the binary function used to represent the operation of integer division. quotient(a,b) denotes q such that a = b*q+r, with |r| less than |b| and a*r non-negative.

See also 4.4.3.1 Quotient (quotient).

Classification
function
MMLattribute
Name Value Default
definitionURL URI identifying the definition APPENDIX_C
encoding CDATA MathML
type MathMLType integer
Signature

(integer, integer) -> integer

Property

ForAll( [a,b], b != 0, a = b*quotient(a,b) + rem(a,b) )

          <apply><forall/>
  <bvar><ci>a</ci></bvar>
  <bvar><ci>b</ci></bvar>
  <condition><apply><neq/><ci>b</ci><cn>0</cn></apply></condition>
  <apply><eq/>
    <ci>a</ci>
    <apply><plus/>
      <apply><times/>
          <ci>b</ci>
          <apply><quotient/><ci>a</ci><ci>b</ci></apply>
      </apply>
      <apply><rem/><ci>a</ci><ci>b</ci></apply>
    </apply>
  </apply>
</apply>
Example
<apply><quotient/>
  <ci> a </ci>
  <ci> b </ci>
</apply>
Example
<apply>
<quotient/>
<cn>5</cn>
<cn>4</cn>
</apply>

C.2.3.2 MMLdefinition: factorial

Description

This is the unary operator used to construct factorials. Factorials are defined by n! = n*(n-1)* ... * 1

See also 4.4.3.2 Factorial (factorial).

Classification
function
MMLattribute
Name Value Default
definitionURL URI identifying the definition APPENDIX_C
encoding CDATA MathML
type MathMLType integer
Signature

(algebraic) -> algebraic

(integer) -> integer

Property

ForAll( n, n \gt 0, n! = n*(n-1)! )

          
<apply><forall/>
  <bvar><ci>n</ci></bvar>
  <condition><apply><gt/><ci>n</ci><cn>0</cn></apply></condition>
  <apply><eq/>
    <apply><factorial/><ci>n</ci></apply>
    <apply><times/>
      <ci>n</ci>
      <apply><factorial/>
        <apply><minus/><ci>n</ci><cn>1</cn></apply>
      </apply>
    </apply>
  </apply>
</apply>
Property

0! = 1

          
<apply><eq/>
  <apply><factorial/><cn>0</cn></apply>
  <cn>1</cn>
</apply>
Example
<apply><factorial/>
  <ci>n</ci>
</apply>

C.2.3.3 MMLdefinition: divide

Description

This is the binary MathML operator that is used indicate the mathematical operation a "divided by" b.

See also 4.4.3.3 Division (divide).

Classification
function
MMLattribute
Name Value Default
definitionURL URI identifying the definition APPENDIX_C
encoding CDATA MathML
type MathMLType real
Signature

(algebraic, algebraic) -> algebraic

(complex, complex) -> complex

(real, real) -> real

(rational, rational) -> rational

(integer, integer) -> rational

Property

Division by Zero error

          
<apply><forall/>
  <bvar><ci>a</ci></bvar>
  <apply><eq/>
    <apply><divide/><ci> a </ci><cn> 0 </cn></apply>
    <notanumber/>
  
</apply>
Property

ForAll( a, a!= 0, a/a = 1 )

          
<apply><forall/>
  <bvar><ci>a</ci></bvar>
  <condition><apply><neq/><ci>a</ci><cn>0</cn></apply></condition>
  <apply><eq/>
    <apply><divide/><ci>a</ci><ci>a</ci></apply>
    <cn>1</cn>
  </apply>
</apply>
Example
<apply><divide/>
  <ci> a </ci>
  <ci> b </ci>
</apply>

C.2.3.4 MMLdefinition: max

Description

This is the n-ary operator used to represent the maximum of a set of elements. The elements may be listed explicitly or they may be described by a domainofapplication, for example, the maximum over all x in the set A. The domainofapplication is often abbreviated by placing a condition directly on a bound variable.

See also 4.4.8.1 common trigonometric functions .

Classification
function
MMLattribute
Name Value Default
definitionURL URI identifying the definition APPENDIX_C
encoding CDATA MathML
type MathMLType real