# Language Syntax

This section describes the syntax used to enter mathematical content into MathLex. All input consists of Tokens or strings of characters representing mathematical symbols or quantities. For example, the token '>=' represents the mathematical symbol ≥ and the concept "greater than or equal to". Tokens in the input string may be separated by spaces, but MathLex is intelligent enough to automatically separate tokens in most cases. MathLex looks for tokens in a greedy fashion in which it tries to match the largest token possible. For example 5!=120 would be interpreted as 5 ≠ 120 even though the intended meaning might have been 5! = 120. Therefore, it is necessary to insert spaces to separate tokens that might be part of other tokens.

The basic types of tokens in MathLex are Numbers (further subdivided into Integers and Floats/Decimals), Identifiers (further subdivided into Keywords and Variables), Constants, and Operators. After these basic types are defined, the collection of all tokens is presented in two sets of tables: the first is organized by how symbols are used in mathematics (e.g. binary operators, relations, etc.); the second is organized by topic (e.g. calculus, set theory, etc.). The second set of tables is redundant but included for clarity.

## Numbers

A Number is exactly as it seems: 42, 3.14, etc. Scientific notation is also allowed: 5e-2, 3.0E8. In either case, decimal points do not need a leading or trailing zero: .5, 78., 9.E-4, .22E7.

Note that negative numbers are treated as a negation operation on the positive value of the number (consistent with algebraic notation). Likewise, fractions are treated as division operations on whole numbers.

## Identifiers

An Identifier is an upper- or lowercase letter followed by any number of upper- or lowercase letters, numbers, or underscores (_). All of the following are valid identifiers: x, A, b0, my_var, infinity, union, and arccos. Identifiers fall under two categories: reserved and unreserved. Reserved identifiers, also called keywords, may be synonyms for certain constants or operators or may be the names of known functions. Each keyword for a constant or operator has its own token. They are listed in the Table of Reserved Constant and Operator Keywords below and again later in the Table of Constants and the Operator Tables. The keywords for known functions are assigned as TIdentifier tokens and are treated as general functions by the parser. They only get treated as specific functions by the translators and renderers. These function names are listed in the Table of Reserved Function Name Keywords below and again later in the Table of Functions (and occasionally in other tables). Unreserved identifiers may be used as variables or user-defined functions. Of the above identifiers, infinity is a constant keyword, union is an operator keyword, and arccos is a known function keyword, while the rest are valid variable or user-defined function names.

 and as congruent divides equiv exists false forall if iff impliedby implies in infinity intersect minus mod ndivide ndivides nequiv not notdivide notdivides onlyif or para parallel perp perpendicular propersubset propersuperset propersupset propsubset propsuperset propsupset psubset psuperset psupset sim similar subset superset supset then true union unique when
 abs acos acosh acot acoth acsc acsch arccos arccosh arccot arccoth arccsc arccsch arcsec arcsech arcsin arcsinh arctan arctanh asec asech asin asinh atan atanh C ceil ceiling cos cosh cot coth csc csch curl diff div exp floor gamma grad int int Integral integral Intersect lim limit ln log P pdiff prod product root sec sech sin sinh sqrt sum tan tanh Union

## Constants

Similar to identifiers, Constants are globally defined values or constructs. In MathLex, constants are typed as a number sign (#; also called hash, sharp, or pound) followed by the name of the constant. For example, in MathLex, one would type #pi (or #p for short) to represent "pi" ($$\pi$$) and #R to represent the set of real numbers ($$\mathbb{R}$$). See the Table of Constants below for a comprehensive list.

## Operators

An Operator is just a catch-all term for any symbol that is not a Number, Identifier, or Constant, but is generally a mathematical operation or delimiter. With the exception of a few reserved keywords, operators usually consist of a few non-alphanumeric characters. Some operators start with an ampersand (&) to distinguish them from similar symbols. Some mathematical operators can be represented in multiple ways in MathLex. The following tables outline all mathematical operators understood by MathLex and all ways to represent them. Pick your favorite.

The numbers in the Precedence column of operator tables reflect which operations are more tightly bound (e.g. the "PEMDAS" order of operations from grade school mathematics). Operators of higher precedence (greater numerical value) will be identified and grouped before operators with lower precedence (lesser numerical value). Operators of equal precedence will be grouped as they are found according to their associativity.

for unary and binary operators, the number in the Precedence/Associativity (P/A) column is followed by an indicator of Associativity, i.e. how chained operations would be bound together:

• Left-associative (L) operators will be grouped from left to right (like subtraction and division): a-b-c-d = ((a-b)-c)-d
• Right-associative (R) operators will be grouped from right to left (like exponents): a^b^c^d = a^(b^(c^d)).
• Non-associative (N) operators cannot be chained. For example, the triple dot product &v a &. &v b &. &v c does not make any sense since the result of a dot product is a scalar.
• Associative operators (like addition and multiplication) may be considered left- or right-associative without loss of meaning. However, MathLex handles such operators as left-associative for definiteness.

At present, MathLex cannot chain relations, so they are regarded as non-associative.

## Symbols by Type

Constants
Name Symbol Code Description
Pi $$\pi$$ #pi, #p 3.14…
Tau $$\tau$$ #tau $$2 \pi$$ ≈ 6.28…
E $$\mathrm{e}$$ #e 2.718…, Natural Base, Euler-Napier number
Gamma $$\gamma$$ #gamma 0.577…, Euler-Mascheroni constant
Infinity $$\infty$$ #infinity, infinity ERROR: memory overflow
Imaginary Unit $$i$$ #i $$\sqrt{-1}$$
True $$\mathbf{T}$$ #T, #true, true Case-insensitive
False $$\mathbf{F}$$ #F, #false, false Case-insensitive
Natural Numbers $$\mathbb{N}$$ #N
Integer Ring $$\mathbb{Z}$$ #Z
Rational Field $$\mathbb{Q}$$ #Q
Real Field $$\mathbb{R}$$ #R
Complex Field $$\mathbb{C}$$ #C
Quaternion Ring $$\mathbb{H}$$ #H Hamilton numbers
Octonian Algebra $$\mathbb{O}$$ #O Cayley numbers, Type "Oh"
Universal Set $$\mathbb{U}$$ #U
Empty Set $$\emptyset$$ #empty, {}
Zero Vector $$\vec{0}$$ #v0
$$x$$ Unit Vector $$\hat{\imath}$$ #ui, #vi
$$y$$ Unit Vector $$\hat{\jmath}$$ #uj, #vj
$$z$$ Unit Vector $$\hat{k}$$ #uk, #vk
Zero Matrix $$\mathbf{0}$$ #0 Type "zero"
Unit Matrix $$\mathbf{I}$$ #1 Identity Matrix, Type "one"
Unary Operators
Name Symbol Code Description P/A
Positive $$+a$$ +a 17R
Negative $$-a$$ -a 17R
Positive/Negative $$\pm a$$ +/-a, &pm a 17R
Negative/Positive $$\mp a$$ -/+, &mp a 17R
Square Root $$\sqrt{a}$$ sqrt(a) *
Factorial $$n!$$ a! 21L
Natural Exponential $$\exp(a)$$ exp(a) *
Natural Logarithm $$\ln(a)$$ ln(a) *
Real Part $$\Re a$$ &Re a 17R
Imaginary Part $$\Im a$$ &Im a 17R
Not $$\neg p$$ ~p, !p, not p Logical Negation 17R
Prime derivative $$f'$$ f' Derivative w.r.t. $$x$$ or first or only variable 21L
Dot derivative $$\dot{f}$$ f. Derivative w.r.t. $$t$$ or second variable 21L
Change $$\Delta x$$ &D x Coordinate Difference 17N
Differential $$\mathrm{d} x$$ &d x 17N
Partial Differential $$\partial x$$ &pd x 17N
Vector $$\vec{a}$$ &v a 17N
Unit Vector $$\hat{a}$$ &u a 17N
Gradient $$\vec{\nabla} f$$, $$\mathrm{grad}(f)$$ &del f, grad(f) 17R
Divergence $$\vec{\nabla} \cdot F$$, $$\mathrm{div}(F)$$ &del. F, div(F) 17N
Curl $$\vec{\nabla} \times F$$, $$\mathrm{curl}(F)$$ &delx F, curl(F) 17R

Note that \prefix operators are generally right-associative and postfix operators are generally left-associative.

* Although not listed, a pair of parentheses, when used as a function application, may be considered a postfix unary operator. As such, it is left-associative and has a precedence of 18, just below that of function composition and exponents.

Binary Operators
Name Symbol Code Description P/A
Plus $$a + b$$ a + b Addition 9L
Minus $$a - b$$ a - b Subtraction 9L
Plus/Minus $$a \pm b$$ a +/- b, a &pm b 9L
Minus/Plus $$a \mp b$$ a -/+ b, a &mp b 9L
Times $$a \cdot b$$ a * b Multiplication 14L
Divided by $$\frac{a}{b}$$, $$a/b$$ a/b, a &/ b Division 14L
Power $$a^b$$ a^b, a**b Exponentiation 20R
$$n$$-th Root $$\sqrt[n]{a}$$ root(a, n) *
Logarithm with Base $$\log_b{a}$$ log(a, b) *
Ratio $$p : q$$ p&:q 8N
Modulus $$a \pmod{n}$$ a%n, a mod n 14L
Combination $$\binom{n}{r}$$ C(n,r), combination(n,r), n choose r Binomial Coefficient; choose; comb for short *
Permutation $$P(n,r)$$ P(n,r), permutation(n,r) perm for short *
Function Composition $$f \circ g$$ f @ g 19L
Function Repeated Composition $$f^{\circ n}$$ f @@ n not implemented 20R
Dot Product $$\vec{a} \cdot \vec{b}$$ &v a &. &v b 15N
Cross Product $$\vec{a} \times \vec{b}$$ &v a &x &v b 16L
Wedge Product $$\vec{a} \wedge \vec{b}$$ &v a &w &v b 16L
Tensor Product $$T \otimes S$$ T &ox S 16L
Cartesian Product $$A \times B$$ A &* B, A &x B 16L
Direct Sum $$A \oplus B$$ A &o+ B 11L
Subscript $$a_b$$ a&_b Indexing 22L
Multiple Subscript $$a_{i,j,k}$$ a &_[i,j,k]
Superscript $$a^b$$ a&^b Indexing 22L
Multiple Superscript $$a^{i,j,k}$$ a &^[i,j,k]
Mixed Subscripts and Superscripts $$T{}^i{}_j{}^k$$ T &^i &_j &^k Tensor Indexing
Union $$a \cup b$$ a union b 12L
Intersection $$a \cap b$$ a intersect b 13L
Set Difference $$a \setminus b$$ a \ b, a minus b 10L
Logical Connectives and Quantifiers
Name Symbol Code Description P/A
And $$p \wedge q$$ p && q, p and q Conjugation 5L
Or $$p \vee q$$ p || q, p or q Disjunction 3L
Exclusive Or $$p \veebar q$$ p xor q Exclusion 4L
Implies $$p \rightarrow q$$ p -> q, p implies q, p onlyif q, if p then q Conditional 2L
Implied By $$p \leftarrow q$$ p <- q, p imqliedby q, p if q, p when q, p whenever q Reverse Conditional 2L
If And Only If $$p \leftrightarrow q$$ p <-> q, p iff q Biconditional 1N
Such That $$p : q$$ p:q Used with set builder and quantifiers
Universal Quantifier $$\forall x$$ (we have) $$P(x)$$ forall x -> P(x) "For all …" 6L
$$\forall x :~Q(x)$$ (we have) $$P(x)$$ forall x : Q(x) -> P(x)
Existential Quantifier $$\exists x :~Q(x)$$ exists x : Q(x) "There exists … such that …" 6L
Unique Quantifier $$\exists ! x :~Q(x)$$ unique x : Q(x) "There exists a unique … such that …" 6L
Relations
Name Symbol Code Prec.
Equal $$a = b$$ a = b, a == b 7
Not Equal $$a \ne b$$ a /= b, a != b, a <> b 7
Less Than $$a < b$$ a < b 7
Greater Than $$a > b$$ a > b 7
Less Than or Equal $$a \le b$$ a <= b 7
Greater Than or Equal $$a \ge b$$ a >= b 7
Divides $$p \mid q$$ p|q, p divides q 7
Not Divides $$p \nmid q$$ p/|q, p~|q, p ndivides q, p ndivide q, p notdivides q, p notdivide q 7
Ratio Equality $$a:b :: c:d$$ a&:b :: c&:d, a&:b as c&:d 7
Congruent $$A \cong B$$ A ~= B, A congruent B 7
Similar $$A \sim B$$ A ~ B, A sim B, A similar B 7
Parallel $$A \parallel B$$ A para B, A parallel B 7
Perpendicular $$A \perp B$$ A perp B, A perpendicular B 7
Subset $$A \subseteq B$$ A subset B 7
Superset $$A \supseteq B$$ A superset B, A supset B 7
Proper Subset $$A \subset B$$ A propersubset B, A propsubset B, A psubset B 7
Proper Superset $$A \supset B$$ A propersuperset B, A propsuperset B, A psuperset B, A propersupset B, A propsupset B, A psupset B 7
Inclusion $$a \in A$$ a in A 7
Equivalent $$A \equiv B$$ A === B, A equiv B 0
Not Equivalent $$A \not\equiv B$$ A /== B, A !== B, A nequiv B 0

As previously stated, all relations are non-associative since a = b = c = d is NOT the same as ((a = b) = c) = d or a = (b = (c = d)). Later versions of MathLex may support such expressions as a = b = c = d to be "syntactic sugar" for (a = b) and (b = c) and (c = d)

Delimiters and Indexing
Name Symbol Code Description
Parentheses $$\left( \ \right)$$ ( ) Order of operation
Curly Braces $$\left\{ \ \right\}$$ { } Sets
Square Brackets $$\left[ \ \right]$$ [ ] Lists
Angle Brackets $$\left\langle \ \right\rangle$$ < >, <: :> Vectors
Matrix $$\left[ \left\langle \ \right\rangle, \left\langle \ \right\rangle \right]$$ [< >, < >], [<: :>, <: :>] Row of Columns
$$\left\langle \left[ \right], \left[ \right] \right\rangle$$ [< >, < >], [<: :>, <: :>] Column of Rows
Vertical Bars $$\left| \ \right|$$ | |, |: :| Absolute Value, Length, Determinant, Norm
Double Bars $$\left\| \ \right\|$$ || ||, ||: :|| Length, Norm
Floor $$\left\lfloor x \right\rfloor$$ floor(x)
Ceiling $$\left\lceil x \right\rceil$$ ceil(x), ceiling(x)
Such That $$p : q$$ p:q Used with set builder and quantifiers
List Separator $$,$$ ,
Subscript $$a_b$$ a &_b Indexing
Multiple Subscript $$a_{i,j,k}$$ a &_[i,j,k]
Superscript $$a^b$$ a &^b Indexing
Multiple Superscript $$a^{i,j,k}$$ a &^[i,j,k]
Mixed Subscripts and Superscripts $$T{}^i{}_j{}^k$$ T &^i &_j &^k Tensor Indexing
Open Interval $$\left( a,b \right)$$ (:a,b:) Exclusive Range Delimiters
Closed Interval $$\left[ a,b \right]$$ [:a,b:] Inclusive Range Delimiters
Half-Open Interval $$\left[ a,b \right)$$ [:a,b:) Mixed Range Delimiters
Bra-Ket Notation $$\left\langle A \mid B \right\rangle$$ <A||B>, <:A|B:>
Bra $$\left\langle A \right|$$ <A|
Ket $$\left| B \right\rangle$$ |B>

Note that some delimiters have more than one format either with or without colons. Namely, absolute value can be written as | | or |: :|, norm can be written as || || or ||: :||, and vectors can be surrounded by either < > or <: :>. Those with colons are matched pairs and should be used whenever there might be a chance of confusion about pairing. Those without colons are context-sensitive in that they have multiple meanings and therefore may not be automatically matched by the Lexer. Additionally, if an expression opened with one type of delimiter, it must be closed with the same type (i.e. matched vs. context-sensitive).

All delimiters have "infinite" precedence; any and all contents will be grouped together.

Functions
Name Symbol Code Description
Trig $$\sin(\theta)$$, … sin(theta), … Also cos, tan, cot, sec, csc
Inverse Trig $$\arcsin(x)$$, … arcsin(x), asin(x), … Also arccos, acos, arctan, atan, arccot, acot, arcsec, asec, arccsc, acsc
Hyperbolic Trig $$\sinh(\lambda)$$, … sinh(lambda), … Also cosh, tanh, coth, sech, csch
Inv. Hyp. Trig $$\mathrm{arcsinh}(x)$$, … arcsinh(x), asinh(x), … Also arccosh, acosh, arctanh, atanh, arccoth, acoth, arcsech, asech, arccsch, acsch
Absolute Value $$\left| a \right|$$ abs(a) May be expressed with "pipe" delimiters.
Floor $$\left\lfloor x \right\rfloor$$ floor(x)
Ceiling $$\left\lceil x \right\rceil$$ ceil(x), ceiling(x)
Square Root $$\sqrt{a}$$ sqrt(a)
$$n$$th Root $$\sqrt[n]{a}$$ root(a, n)
Natural Exponential $$\exp(a)$$ exp(a)
Natural Logarithm $$\ln(a)$$ ln(a)
Logarithm with Base $$\log_b{a}$$ log(a, b)
Combination $$\binom{n}{r}$$ C(n,r), combination(n,r), comb(n,r) Binomial Coefficient, choose
Permutation $$P(n,r)$$ P(n,r), permutation(n,r), perm(n,r)
Limit $$\displaystyle\lim_{x\to a} f(x)$$ lim(f(x), a, x), limit(f(x), x, a), &lim &_(x -> a) f(x) Also limit, Lim, Limit, …
Derivative $$\displaystyle \frac{\mathrm{d}}{\mathrm{d}x} \left( f(x) \right)$$ diff(f(x), x), &df(x)/&dx
Partial Derivative $$\displaystyle \frac{\partial}{\partial x} \left( f(x,y) \right)$$ pdiff(f(x,y), x), &pdf(x)/&pdx
Indefinite Integral $$\displaystyle \int f(x) \,\mathrm{d}x$$ int(f(x),x), &int f(x) &dx Also Int, integral, Integral, …
Definite Integral $$\displaystyle \int_a^b f(x) \,\mathrm{d}x$$ int(f(x),x,a,b), &int &_a &^b f(x) &dx (see note above)
Sum Over Range $$\displaystyle \sum_{i=m}^n a_i$$ sum(a&_i,i,m,n), &sum &_(i=m) &^n a&_i Also Sum
Sum Over Set $$\displaystyle \sum_{i \in S} a_i$$ sum(a&_i, i in S), &sum &_(i in S) a&_i (see note above)
Product Over Range $$\displaystyle \prod_{i=m}^n a_i$$ prod(a&_i,m,n), product(a&_i,m,n), &prod &_(i=m) &^n a&_i Also product, Prod, Product, …
Product Over Set $$\displaystyle \prod_{i \in S} a_i$$ prod(a&_i, i in S), product(a&_i, i in S), &prod &_(i in S) a&_i (see note above)
Union Over Range $$\displaystyle \bigcup_{i=m}^n S_i$$ Union(S&_i,m,n), &Union &_(i=m) &^n S&_i
Union Over Set $$\displaystyle \bigcup_{i \in T} S_i$$ Union(S&_i, i in T), &Union &_(i in T) S&_i
Intersection Over Range $$\displaystyle \bigcap_{i=m}^n S_i$$ Intersect(S&_i,m,n), &Intersect &_(i=m) &^n S&_i
Intersection Over Set $$\displaystyle \bigcap_{i \in T} S_i$$ Intersect(S&_i, i in T), &Intersect &_(i in T) S&_i

## Symbols by Topic

Repetition can lead to discrepancy, and this section is already quite repetetive. Please refer to the tables above for precedence and associativity information. These tables are provided merely for convenience when attempting to find a particular token. Hence it is redundant to provide extra information.

Arithmetic
Name Symbol Code Description
Plus, Positive $$+$$ + binary or unary
Minus, Negative $$-$$ - binary or unary
Plus/Minus $$\pm$$ +/-, &pm binary or unary
Minus/Plus $$\mp$$ -/+, &mp binary or unary
Times $$\cdot$$ * Multiplication
Divided by $$\frac{a}{b}$$, $$a/b$$ a/b, a &/ b Division
Power $$a^b$$ a^b, a**b Exponentiation
Square Root $$\sqrt{a}$$ sqrt(a)
$$n$$-th Root $$\sqrt[n]{a}$$ root(a, n)
Log base n $$\log_n{a}$$ log(a, n)
Natural Exponential $$\exp(a)$$ exp(a)
Natural Logarithm $$\ln(a)$$ ln(a)
Absolute Value $$\left| a \right|$$ |a|, |:a:|, abs(a)
Factorial $$n!$$ a!
Imaginary Unit $$i$$ #i $$\sqrt{-1}$$
Real Part $$\Re a$$ &Re a
Imaginary Part $$\Im a$$ &Im a
Ratio $$a:b$$ a&:b
Ratio Equality $$a:b :: c:d$$ a&:b :: c&:d, a&:b as c&:d
Equal $$=$$ =, ==
Not Equal $$\ne$$ /=, !=, <>
Less Than $$<$$ <
Greater Than $$>$$ >
Less Than or Equal $$\le$$ <=
Greater Than or Equal $$\ge$$ >=
Parentheses $$\left( \ \right)$$ ( )
Algebra
Name Symbol Code Description
Natural Numbers $$\mathbb{N}$$ #N
Integer Ring $$\mathbb{Z}$$ #Z
Rational Field $$\mathbb{Q}$$ #Q
Real Field $$\mathbb{R}$$ #R
Complex Field $$\mathbb{C}$$ #C
Function Composition $$f \circ g$$ f @ g
Function Repeated Composition $$f^{\circ n}$$ f @@ n
Sum Over Range $$\displaystyle \sum_{i=m}^n a_i$$ sum(a&_i,i,m,n), &sum &_(i=m) &^n a&_i Also Sum
Sum Over Set $$\displaystyle \sum_{i \in S} a_i$$ sum(a&_i, i in S), &sum &_(i in S) a&_i (see note above)
Product Over Range $$\displaystyle \prod_{i=m}^n a_i$$ prod(a&_i,m,n), product(a&_i,m,n), &prod &_(i=m) &^n a&_i Also product, Prod, Product
Product Over Set $$\displaystyle \prod_{i \in S} a_i$$ prod(a&_i, i in S), product(a&_i, i in S), &prod &_(i in S) a&_i (see note above)
Geometry
 Name Symbol Code Description Pi $$\pi$$ #pi, #p 3.14… Tau $$\tau$$ #tau $$2 \pi$$ ≈ 6.28… Open Interval $$\left( a,b \right)$$ (:a,b:) Exclusive Range Delimiters Closed Interval $$\left[ a,b \right]$$ [:a,b:] Inclusive Range Delimiters Half-Open Interval $$\left[ a,b \right)$$ [:a,b:) Mixed Range Delimiters Congruent $$\cong$$ ~=, congruent Similar $$\sim$$ ~, sim, similar Parallel $$\parallel$$ para, parallel Perpendicular $$\perp$$ perp, perpendicular Vector Components $$\left\langle a, b, c \right\rangle$$ < a, b, c >, <: a, b, c :> Vector $$\vec{a}$$ &v a Unit Vector $$\hat{a}$$ &u a Vector Length $$\left| \vec{a} \right|$$ | &v a |, |: &v a :| $$\left\| \vec{a} \right\|$$ || &v a ||, ||: &v a :|| Zero Vector $$\vec{0}$$ #v0 $$x$$ Unit Vector $$\hat{\imath}$$ #ui, #vi $$y$$ Unit Vector $$\hat{\jmath}$$ #uj, #vj $$z$$ Unit Vector $$\hat{k}$$ #uk, #vk Dot Product $$\vec{a} \cdot \vec{b}$$ &v a &. &v b Cross Product $$\vec{a} \times \vec{b}$$ &v a &x &v b
Trigonometry
Name Symbol Code Description
Trig $$\sin(\theta)$$, … sin(theta), … Also cos, tan, cot, sec, csc
Inverse Trig $$\arcsin(x)$$, … arcsin(x), asin(x), … Also arccos, acos, arctan, atan, arccot, acot, arcsec, asec, arccsc, acsc
Hyperbolic Trig $$\sinh(\lambda)$$, … sinh(lambda), … Also cosh, tanh, coth, sech, csch
Inv. Hyp. Trig $$\mathrm{arcsinh}(x)$$, … arcsinh(x), asinh(x), … Also arccosh, acosh, arctanh, atanh, arccoth, acoth, arcsech, asech, arccsch, acsch
Discrete
Name Symbol Code Description
Natural Numbers $$\mathbb{N}$$ #N
Integer Ring $$\mathbb{Z}$$ #Z
Factorial $$n!$$ a!
Floor $$\left\lfloor x \right\rfloor$$ floor(x)
Ceiling $$\left\lceil x \right\rceil$$ ceil(x), ceiling(x)
Modulus $$a \pmod{n}$$ a%n, a mod n
Divides $$p \mid q$$ p|q, p divides q
Not Divides $$p \nmid q$$ p/|q, p~|q, p ndivides q, p ndivide q, p notdivides q, p notdivide q
Combination $$\binom{n}{r}$$ C(n,r) Binomial Coefficient; Choose
Permutation $$P(n,r)$$ P(n,r)
Sum Over Range $$\displaystyle \sum_{i=m}^n a_i$$ sum(a&_i,i,m,n), &sum &_(i=m) &^n a&_i Also Sum
Sum Over Set $$\displaystyle \sum_{i \in S} a_i$$ sum(a&_i, i in S), &sum &_(i in S) a&_i (see note above)
Product Over Range $$\displaystyle \prod_{i=m}^n a_i$$ prod(a&_i,m,n), product(a&_i,m,n), &prod &_(i=m) &^n a&_i Also product, Prod, Product
Product Over Set $$\displaystyle \prod_{i \in S} a_i$$ prod(a&_i, i in S), product(a&_i, i in S), &prod &_(i in S) a&_i (see note above)
Union Over Range $$\displaystyle \bigcup_{i=m}^n S_i$$ Union(S&_i,m,n), &Union &_(i=m) &^n S&_i
Union Over Set $$\displaystyle \bigcup_{i \in T} S_i$$ Union(S&_i, i in T), &Union &_(i in T) S&_i
Intersection Over Range $$\displaystyle \bigcap_{i=m}^n S_i$$ Intersect(S&_i,m,n), &Intersect &_(i=m) &^n S&_i
Intersection Over Set $$\displaystyle \bigcap_{i \in T} S_i$$ Intersect(S&_i, i in T), &Intersect &_(i in T) S&_i
Calculus
Name Symbol Code Description
Pi $$\pi$$ #pi, #p 3.14…
Tau $$\tau$$ #tau $$2 \pi$$ ≈ 6.28…
E $$\mathrm{e}$$ #e 2.718…, Natural Base, Euler-Napier number
gamma $$\gamma$$ #gamma 0.577…, Euler-Mascheroni constant
infinity $$\infty$$ #infinity, infinity $$\infty$$ ≈ #!ERROR: memory overflow
Limit $$\displaystyle\lim_{x\to a} f(x)$$ lim(f(x), a, x), limit(f(x), x, a), &lim &_(x -> a) f(x) Also limit, Lim, Limit
Derivative $$\displaystyle \frac{\mathrm{d}}{\mathrm{d}x} \left( f(x) \right)$$ diff(f(x), x), &df(x)/&dx
Partial Derivative $$\displaystyle \frac{\partial}{\partial x} \left( f(x,y) \right)$$ pdiff(f(x,y), x), &pdf(x)/&pdx
Prime derivative $$f'$$ f' Derivative w.r.t. $$x$$ or first or only variable
Dot derivative $$\dot{f}$$ f. Derivative w.r.t. $$t$$ or second variable
Change $$\Delta x$$ &D x Coordinate Difference
Differential $$\mathrm{d} x$$ &d x
Partial Differential $$\partial x$$ &pd x
Riemann Sum $$\displaystyle \sum_{i=1}^n f(x_i) \, \Delta x_i$$ sum(f(x&_i)*&Dx&_i, i, 1, n), &sum &_(i=1) &^n F(x&_i)*&Dx&_i Also Sum
Indefinite Integral $$\displaystyle \int f(x) \,\mathrm{d}x$$ int(f(x),x), &int f(x) &dx Also Int, integral, Integral
Definite Integral $$\displaystyle \int_a^b f(x) \,\mathrm{d}x$$ int(f(x),x,a,b), &int &_a &^b f(x) &dx (see note above)
Infinite Series $$\displaystyle \sum_{i=1}^\infty a_i$$ sum(a&_i, i, 1, infinity), &sum &_(i=1) &^infinity a&_i (see note above)
Gradient $$\vec{\nabla} f$$, $$\mathrm{grad}(f)$$ &del f, grad(f)
Divergence $$\vec{\nabla} \cdot F$$, $$\mathrm{div}(F)$$ &del. F, div(F)
Curl $$\vec{\nabla} \times F$$, $$\mathrm{curl}(F)$$ &delx F, curl(F)
Logic
Name Symbol Code Description
True $$\mathbf{T}$$ #T, #true, true Case-insensitive
False $$\mathbf{F}$$ #F, #false, false Case-insensitive
And $$p \wedge q$$ p && q, p and q Conjugation
Or $$p \vee q$$ p || q, p or q Disjunction
Exclusive Or $$p \veebar q$$ p xor q Exclusion
Not $$\neg p$$ ~p, !p, not p
Implies $$p \rightarrow q$$ p -> q, p implies q, p onlyif q, if p then q Conditional
Implied By $$p \leftarrow q$$ p <- q, p imqliedby q, p if q, p when q, p whenever q Reverse Conditional
If And Only If $$p \leftrightarrow q$$ p <-> q, p iff q Biconditional
Equivalent $$\equiv$$ ===, equiv
Not Equivalent $$\not\equiv$$ !==, /==, nequiv
Universal Quantifier $$\forall x$$ (we have) $$P(x)$$ forall x -> P(x) "For all …"
$$\forall x :~Q(x)$$ (we have) $$P(x)$$ forall x : Q(x) -> P(x)
Existential Quantifier $$\exists x :~Q(x)$$ exists x : Q(x) "There exists … such that …"
Unique Quantifier $$\exists ! x :~Q(x)$$ unique x : Q(x) "There exists a unique … such that …"
Set Theory
Name Symbol Code Description
Set Delimiters $$\left\{ \ \right\}$$ { }
Such That $$p : q$$ p:q Used with set builder and quantifiers
Universal Set $$\mathbb{U}$$ #U
Empty Set $$\emptyset$$ #empty, {}
Natural Numbers $$\mathbb{N}$$ #N
Integer Ring $$\mathbb{Z}$$ #Z
Rational Field $$\mathbb{Q}$$ #Q
Real Field $$\mathbb{R}$$ #R
Complex Field $$\mathbb{C}$$ #C
Quaternion Ring $$\mathbb{H}$$ #H Hamilton numbers
Octonian Algebra $$\mathbb{O}$$ #O Cayley numbers, Type "Oh"
Subset $$A \subseteq B$$ A subset B
Superset $$A \supseteq B$$ A superset B, A supset B
Proper Subset $$A \subset B$$ A propersubset B, A propsubset B, A psubset B
Proper Superset $$A \supset B$$ A propersuperset B, A propsuperset B, A psuperset B, A propersupset B, A propsupset B, A psupset B
Inclusion $$a \in A$$ a in A
Union $$a \cup b$$ a union b
Intersection $$a \cap b$$ a intersect b
Set Difference $$a \setminus b$$ a \ b, a minus b
Cartesian Product $$A \times B$$ A &* B, A &x B
Direct Sum $$A \oplus B$$ A &o+ B
Union Over Range $$\displaystyle \bigcup_{i=m}^n S_i$$ Union(S&_i,m,n), &Union &_(i=m) &^n S&_i
Union Over Set $$\displaystyle \bigcup_{i \in T} S_i$$ Union(S&_i, i in T), &Union &_(i in T) S&_i
Intersection Over Range $$\displaystyle \bigcap_{i=m}^n S_i$$ Intersect(S&_i,m,n), &Intersect &_(i=m) &^n S&_i
Intersection Over Set $$\displaystyle \bigcap_{i \in T} S_i$$ Intersect(S&_i, i in T), &Intersect &_(i in T) S&_i
Linear Algebra
Name Symbol Code Description
Vector Delimiters $$\left\langle \ \right\rangle$$ < >, <: :>
Zero Vector $$\vec{0}$$ #v0
$$x$$ Unit Vector $$\hat{\imath}$$ #ui, #vi
$$y$$ Unit Vector $$\hat{\jmath}$$ #uj, #vj
$$z$$ Unit Vector $$\hat{k}$$ #uk, #vk
Matrix Delimiters $$\left[ \left\langle \ \right\rangle, \left\langle \ \right\rangle \right]$$ [ < >, < > ] Row of Columns
$$\left\langle \left[ \ \right], \left[ \ \right] \right\rangle$$ < [ ], [ ] > Column of Rows
Zero Matrix $$\mathbf{0}$$ #0 Type "zero"
Unit Matrix $$\mathbf{I}$$ #1 Identity Matrix, Type "one"