Table of contents: Introduction - Language documentation - Markup for Fungrim entries - Variable-generating expressions - Sequence-generating expressions - Cosmetic markup

Formulas in Fungrim are represented using symbolic expressions
that encode mathematical objects and operations in a semantic way.
The symbolic expression language is called Grim.
The LaTeX output rendered on the Fungrim website is
produced automatically from the symbolic Grim expressions.

Definitions:

Fungrim symbol | Notation | Short description |
---|

Source code for this entry:

Entry(ID("6db9b2"), SymbolDefinition(Entry, Ellipsis, "Entry"))

Definitions:

Fungrim symbol | Notation | Short description |
---|

Source code for this entry:

Entry(ID("0d9952"), SymbolDefinition(ID, Ellipsis, "Entry ID"))

Definitions:

Fungrim symbol | Notation | Short description |
---|

Source code for this entry:

Entry(ID("c2fb41"), SymbolDefinition(Formula, Ellipsis, "Formula"))

Definitions:

Fungrim symbol | Notation | Short description |
---|

Source code for this entry:

Entry(ID("f37520"), SymbolDefinition(Variables, Ellipsis, "Declaration of variables"))

Definitions:

Fungrim symbol | Notation | Short description |
---|

Source code for this entry:

Entry(ID("3c8d31"), SymbolDefinition(Assumptions, Ellipsis, "Assumptions (domain declaration) for the variables"))

Definitions:

Fungrim symbol | Notation | Short description |
---|

Source code for this entry:

Entry(ID("8af90e"), SymbolDefinition(References, Ellipsis, "References"))

Definitions:

Fungrim symbol | Notation | Short description |
---|

Source code for this entry:

Entry(ID("b976df"), SymbolDefinition(Description, Ellipsis, "Text description"))

Called with a tuple of symbols, `For(Tuple(x, y, z))`, each symbol
becomes a locally bound variable.

Called with several arguments, for example `For(x, a, b, c)`, the additional parameters $a$
$b$
$c$
specify information about the range of $x$. The interpretation of the parameters is up to the parent operator $f$. Most operators recognize `For()` with two additional parameters as
specifying an iteration range: for example, `Sum(Factorial(n), For(n, 2, 10))` gives $\sum_{n=2}^{10} n !$. (When `For(n, a, b)` is used in this sense, the endpoints $a$
and $b$
must be integers or possibly $a = -\infty$
and/or $b = \infty$
where an infinite sequence makes sense. The iteration sequence is empty if $b < a$.)

There are various exceptions. For example, `Integral` understands two
parameters as representing the endpoints (not necessarily integers)
of a directed line segment to integrate over: `Integral(Cos(x), For(x, Neg(Pi), Pi))` becomes $\int_{-\pi}^{\pi} \cos(x) \, dx$. `Derivative` takes one or two parameters denoting the evaluation point and optionally the order of differentiation: `Derivative(Sin(x), For(x, y))` becomes $\sin'(y)$
and `Derivative(Sin(x), For(x, y, 2))` becomes $\sin''(y)$.

Definitions:

Fungrim symbol | Notation | Short description |
---|---|---|

Sum | $\sum_{n} f(n)$ | Sum |

Factorial | $n !$ | Factorial |

Infinity | $\infty$ | Positive infinity |

Integral | $\int_{a}^{b} f(x) \, dx$ | Integral |

Cos | $\cos(z)$ | Cosine |

Pi | $\pi$ | The constant pi (3.14...) |

Derivative | $\frac{d}{d z}\, f\!\left(z\right)$ | Derivative |

Sin | $\sin(z)$ | Sine |

Source code for this entry:

Entry(ID("43cc72"), SymbolDefinition(For, Ellipsis, "General-purpose generator"), Description(SourceForm(For(x)), "declares the given symbol as locally bound variable in the scope of the parent call. For example,", SourceForm(f(a, For(x), b)), "declares", x, "as a locally bound variable that may be used within the expressions ", a, "and", b, ". The interpretation of the variable is left to the parent operator", f, "."), Description("Called with a tuple of symbols,", SourceForm(For(Tuple(x, y, z))), ", each symbol becomes a locally bound variable."), Description(" Called with several arguments, for example ", SourceForm(For(x, a, b, c)), ", the additional parameters", a, b, c, "specify information about the range of", x, ".", "The interpretation of the parameters is up to the parent operator", f, ". Most operators recognize ", SourceForm(For()), "with two additional parameters as specifying an iteration range: for example, ", SourceForm(Sum(Factorial(n), For(n, 2, 10))), "gives", Sum(Factorial(n), For(n, 2, 10)), ".", "(When", SourceForm(For(n, a, b)), " is used in this sense, the endpoints", a, "and", b, "must be integers or possibly", Equal(a, Neg(Infinity)), "and/or", Equal(b, Infinity), "where an infinite sequence makes sense. ", "The iteration sequence is empty if", Less(b, a), ".)"), Description(" There are various exceptions. For example,", SourceForm(Integral), "understands two parameters as representing the endpoints (not necessarily integers) of a directed line segment to integrate over: ", SourceForm(Integral(Cos(x), For(x, Neg(Pi), Pi))), "becomes", Integral(Cos(x), For(x, Neg(Pi), Pi)), ". ", SourceForm(Derivative), "takes one or two parameters", "denoting the evaluation point and optionally the order of differentiation:", SourceForm(Derivative(Sin(x), For(x, y))), "becomes", Derivative(Sin(x), For(x, y)), "and", SourceForm(Derivative(Sin(x), For(x, y, 2))), "becomes", Derivative(Sin(x), For(x, y, 2)), "."))

Definitions:

Fungrim symbol | Notation | Short description |
---|---|---|

ZZ | $\mathbb{Z}$ | Integers |

Sum | $\sum_{n} f(n)$ | Sum |

Pow | ${a}^{b}$ | Power |

Source code for this entry:

Entry(ID("978576"), SymbolDefinition(ForElement, Ellipsis, "Generator for all the elements of a set"), Description(SourceForm(ForElement(x, S)), "declares the variable", SourceForm(x), "just like", SourceForm(For(x)), "and additionally tells the parent operator", "that", x, "is to range over the elements of the set", S, ". ", "Examples: ", SourceForm(Set(Mul(2, n), ForElement(n, ZZ))), "becomes", Set(Mul(2, n), ForElement(n, ZZ)), ". ", SourceForm(Sum(Div(1, Pow(n, 2)), ForElement(n, SetMinus(ZZ, Set(0))))), "becomes", Sum(Div(1, Pow(n, 2)), ForElement(n, SetMinus(ZZ, Set(0)))), ". "))

Represents the first arguments repeated the number of times specified by the last argument. This expression does not represent a mathematical object: it only exists at the expression level, and injects the sequence between surrounding arguments. To construct a mathematical object, we must pass the generator expression to a function such as `Tuple`. Example: `Formula(Tuple(Repeat(1, N), 0, Repeat(1, 2, 3, M), 1, 2))` renders as $\left(\underbrace{1, \ldots, 1}_{N \text{ times}}, 0, \underbrace{1, 2, 3, \ldots, 1, 2, 3}_{\left(1, 2, 3\right) \; M \text{ times}}, 1, 2\right)$.

Definitions:

Fungrim symbol | Notation | Short description |
---|

Source code for this entry:

Entry(ID("82c978"), SymbolDefinition(Repeat, Repeat(x, n), "Repeating sequence"), Description("Represents the first arguments repeated the number of times ", "specified by the last argument. This expression does not represent ", "a mathematical object: it only exists at the expression level, and ", "injects the sequence between surrounding arguments. ", "To construct a mathematical object, we must pass the generator expression ", "to a function such as", SourceForm(Tuple), ". Example: ", SourceForm(Formula(Tuple(Repeat(1, N), 0, Repeat(1, 2, 3, M), 1, 2))), "renders as ", Tuple(Repeat(1, N), 0, Repeat(1, 2, 3, M), 1, 2), "."))

$f\!\left({1}^{2}, {2}^{2}, \ldots, {10}^{2}\right)$

$\left(\underbrace{0, \ldots, 0}_{0 \text{ times}}, \underbrace{1, \ldots, 1}_{1 \text{ times}}, \ldots, \underbrace{N, \ldots, N}_{N \text{ times}}\right)$

$\left(1, 2, 2, \underbrace{3, \ldots, 3}_{3 \text{ times}}, \underbrace{4, \ldots, 4}_{4 \text{ times}}, \ldots, \underbrace{N, \ldots, N}_{N \text{ times}}\right)$

Definitions:

Fungrim symbol | Notation | Short description |
---|---|---|

Pow | ${a}^{b}$ | Power |

Source code for this entry:

Entry(ID("73f5e7"), SymbolDefinition(Step, Step(f(n), For(n, a, b)), "Enumerated sequence"), Description(SourceForm(Step(f(n), For(n, a, b))), " represents the sequence of values ", f(n), "for ", n, "between ", "the integers", a, "and", b, ". ", "The sequence is empty if ", Less(b, a), ". ", "This expression does not represent ", "a mathematical object: it only exists at the expression level, and ", "injects the sequence between a surrounding arguments. ", "To construct a mathematical object, we must pass the generator expression ", "to a function such as", SourceForm(Tuple), ". Examples: "), Description(SourceForm(f(Step(Pow(k, 2), For(k, 1, 10))))), Description(f(Step(Pow(k, 2), For(k, 1, 10)))), Description(SourceForm(Tuple(Step(Repeat(n, n), For(n, 0, N))))), Description(Tuple(Step(Repeat(n, n), For(n, 0, N)))), Description(SourceForm(Tuple(1, 2, 2, Step(Repeat(n, n), For(n, 3, N))))), Description(Tuple(1, 2, 2, Step(Repeat(n, n), For(n, 3, N)))))

Hints that the enclosed expression should be rendered surrounded by parentheses. Semantically represents the identity function: `Parentheses(x)` is equivalent to `x`.

Definitions:

Fungrim symbol | Notation | Short description |
---|

Source code for this entry:

Entry(ID("ecfe08"), SymbolDefinition(Parentheses, Parentheses(Ellipsis), "Parentheses"), Description("Hints that the enclosed expression should be rendered surrounded by parentheses. ", "Semantically represents the identity function: ", SourceForm(Parentheses(x)), " is equivalent to ", SourceForm(x), "."))

Hints that the enclosed expression should be rendered surrounded by square brackets. Semantically represents the identity function: `Brackets(x)` is equivalent to `x`.

Definitions:

Fungrim symbol | Notation | Short description |
---|

Source code for this entry:

Entry(ID("d14265"), SymbolDefinition(Brackets, Brackets(Ellipsis), "Square brackets"), Description("Hints that the enclosed expression should be rendered surrounded by square brackets. ", "Semantically represents the identity function: ", SourceForm(Brackets(x)), " is equivalent to ", SourceForm(x), "."))

Hints that the enclosed expression should be rendered surrounded by curly braces. Semantically represents the identity function: `Braces(x)` is equivalent to `x`.

Definitions:

Fungrim symbol | Notation | Short description |
---|

Source code for this entry:

Entry(ID("ca1edc"), SymbolDefinition(Braces, Braces(Ellipsis), "Curly braces"), Description("Hints that the enclosed expression should be rendered surrounded by curly braces. ", "Semantically represents the identity function: ", SourceForm(Braces(x)), " is equivalent to ", SourceForm(x), "."))

Copyright (C) Fredrik Johansson and contributors. Fungrim is provided under the MIT license. The source code is on GitHub.

2021-03-15 19:12:00.328586 UTC