The lambda element
(Excerpt from "The MathML Handbook" by Pavi Sandhu)
The lambda element is used to represent the concept of a lambda function, used in calculus. The lambda calculus provides a formal syntax for specifying a statement of the form "let f be a function that takes x to x2". A typical notation for the above statement looks like .
In content markup, the concept of a lambda function is expressed using the lambda element. A function having n variables is specified using a lambda element with n + 1 child elements. Each of the first n child elements is a bvar element that represents one of the variables of the function. The (n + 1)th element is an expression that defines the function itself. Here is an example:
<lambda> <bvar> <ci>x</ci> </bvar> <apply> <power/> <ci>x</ci> <cn>2</cn> </apply> </lambda>
The following markup uses the declare and lambda elements to construct a function f for which :
<declare type="fn"> <ci> f </ci> <lambda> <bvar><ci>x</ci></bvar> <bvar><ci>y</ci></bvar> <apply> <plus/> <apply> <power/> <ci>x</ci> <cn>2</cn> </apply> <apply> <power/> <ci>y</ci> <cn>2</cn> </apply> <apply> <times/> <ci>x</ci> <cn>y</cn> </apply> </apply> </lambda> </declare>
Copyright © CHARLES RIVER MEDIA, INC., Massachusetts (USA) 2003
Printing of the online version is permitted exclusively for private use. Otherwise this chapter from the book "The MathML Handbook" is subject to the same provisions as those applicable for the hardcover edition: The work including all its components is protected by copyright. All rights reserved, including reproduction, translation, microfilming as well as storage and processing in electronic systems.
CHARLES RIVER MEDIA, INC., 20 Downer Avenue, Suite 3, Hingham, Massachusetts 02043, United States of America