About

LurchMath is an easy-to-write markup language for mathematics.
It extends a proper subset of AsciiMath, $\LaTeX$, and CAS software in natural ways.
It is currently under development, and more features will be added in the future.




Features

LurchMath currently supports a small subset of AsciiMath, $\LaTeX$, and notation found in CAS software. Many symbols can be displayed using a TeX command but a preceeding backslash is not required.

Symbols can be more than one character long, are case sensitive, contain only letters and digits, cannot start with a digit, and cannot be a reserved term. Multiplication must be explicitly entered with ā‹…, cdot or *.

English phrases such as Given or declare are case sensitive and will produce LaTeX with the same phrase in the same case. Spaces within an expression are usually ignored and can be used for legibility. The main exception is that there cannot be any spaces between a function and the parentheses containing its arguments in a function application expression.

A comma separated sequence preceeded by one of the Given keywords has the same effect as saying that each of them is a Given individually. The shortcut declaration Let x in A has the same meaning as Let x be such that x in A. In a Let declaration a comma may replace the phrase be such that, so Let a, b in ZZ, a|n, b|n means Let a, b in ZZ be such that a|n, b|n. Similarly, the declaration P(x), Q(x) for some x in A has the same meaning as P(x), Q(x) x in A for some x.

The following symbols are automatically declared to be constants globally in every document.
šœ† āž¤ AlgebraRule NoMatrixOps Arithmetic ChainsRule EquationsRule SetBuilderRule ā„• ℤ ā„š ā„ ā„‚ defint integral product Union Intersect maps index tuple set sum sumOver class setbuilder trans_chain range interval seq> floor ceiling.

Examples

If you type any of these it renders as this
Propositional logic
P iff Q
P ⇔ Q
$P\Leftrightarrow Q$
P implies Q
P ⇒ Q
$P\Rightarrow Q$
P or Q $P\text{ or }Q$
P vee Q
P ∨ Q
$P\vee Q$
P and Q $P\text{ and }Q$
P wedge Q
P ∧ Q
$P\wedge Q$
not P $\text{not } P$
neg P
¬P
$\neg P$
Quantifiers and bindings
forall x.x leq x+1
for all x.x leq x+1
āˆ€x.x leq x+1
$\forall x.\, x\leq x+1$
exists x.x=2 cdot x
∃x.x=2ā‹…x
$\exists x.\, x=2\cdot x$
exists unique x.x=2*x
∃!x.x=2ā‹…x
$\exists! x.\, x=2\cdot x$
x.x+2
x mapsto x+2
x↦x+2
$x.\, x+2$
Relations
f : A to B $f\colon A\to B$
a cong b mod m
a = b mod m
$a\underset{m}{\equiv}b$
25 cong 13 mod 6 $25\underset{6}{\equiv}13$
a subgroup b
a sqsubseteq b
a āŠ‘ b
$a\sqsubseteq b$
K is a subgroup of G $K\text{ is a subgroup of }G$
K is not a subgroup of G $K\text{ is not a subgroup of }G$
a normal b
a ⊓ b
$a\trianglelefteq b$
N is a normal subgroup of G $N\text{ is a normal subgroup of }G$
N is not a normal subgroup of G $N\text{ is not a normal subgroup of }G$
a in b
a ∈ b
$a\in b$
x is an element of S $x\text{ is an element of }S$
x is not an element of S $x\text{ is not an element of }S$
⟨x,y⟩ in ~ $\left\langle{x,y}\right\rangle\in \sim$
a notin b
a āˆ‰ b
$a\notin b$
a neq b
a ne b
a ≠ b
$a\neq b$
x neq 0 $x\neq 0$
P is a partition of S $P\text{ is a partition of }S$
P is not a partition of S $P\text{ is not a partition of }S$
R is a relation on A $R\text{ is a relation on }A$
R is not a relation on A $R\text{ is not a relation on }A$
A is a subset of B $A\text{ is a subset of }B$
A is not a subset of B $A\text{ is not a subset of }B$
d is a divisor of n $d\text{ is a divisor of }n$
d is not a divisor of n $d\text{ is not a divisor of }n$
M is an upper bound of S $M\text{ is an upper bound of }S$
M is not an upper bound of S $M\text{ is not an upper bound of }S$
m is a lower bound of S $m\text{ is a lower bound of }S$
m is not a lower bound of S $m\text{ is not a lower bound of }S$
x is open in y $x\text{ is open in }y$
x is not open in y $x\text{ is not open in }y$
x is closed in y $x\text{ is closed in }y$
x is not closed in y $x\text{ is not closed in }y$
N is a neighborhood of x in T $N\text{ is a neighborhood of }x\text{ in }T$
N is a limit point of x in T $N\text{ is a limit point of }x\text{ in }T$
N is a boundary point of x in T $N\text{ is a boundary point of }x\text{ in }T$
N is an interior point of x in T $N\text{ is an interior point of }x\text{ in }T$
N is an exterior point of x in T $N\text{ is an exterior point of }x\text{ in }T$
a ~ b $a\sim b$
a ~_(u) b $a\sim_{u}b$
a approx b
a ā‰ˆ b
$a\approx b$
a approx_(u) b $a\approx_{u}b$
a sim b $a\sim b$
a rel b $a\backsim b$
a rel_(u) b $a\backsim_{u}b$
a =_(u) b $a=_{u}b$
a loves b $a\text{ loves }b$
a love b $a\text{ love }b$
a fears b $a\text{ fears }b$
a fear b $a\text{ fear }b$
a does not love b $a\text{ does not love }b$
a does not fear b $a\text{ does not fear }b$
a is not b $a\text{ is not }b$
a is not an b $a\text{ is not an }b$
a is not a b $a\text{ is not a }b$
a are not b $a\text{ are not }b$
a is b $a\text{ is }b$
a is an b $a\text{ is an }b$
a is a b $a\text{ is a }b$
a is the b $a\text{ is the }b$
a are b $a\text{ are }b$
āŠ† is transitive $\subseteq\text{ is }\text{transitive}$
Transitive chains
x=y $x=y$
x=y=z $x=y=z$
a < b
a lt b
$a\lt b$
a leq b
a ≤ b
$a\leq b$
1 < 2 = 1+1 leq 3 $1\lt 2=1+1\leq 3$
a cong_(m) b $a\underset{m}{\equiv}b$
a cong_(m) b cong_(m) c $a\underset{m}{\equiv}b\underset{m}{\equiv}c$
a cong b
a ≅ b
$a\cong b$
a | b $a\mid b$
a divides b $a\text{ divides }b$
2 | 4 | 8 $2\mid 4\mid 8$
a subseteq b
a subset b
a āŠ† b
$a\subseteq b$
A āŠ† A ∪ B āŠ† S $A\subseteq A\cup B\subseteq S$
Sequents
A ⊢ B
A vdash B
A proves B
$A\vdash B$
(⊢ B)
(vdash B)
$\left(\vdash B\right)$
(A, B ⊢ C) $\left(A, B\vdash C\right)$
(A, B ⊢ C, D) $\left(A, B\vdash C, D\right)$
A ⊢_(Gamma) B $A\vdash_{\Gamma} B$
not (A ⊢ B)
A does not prove B
$\text{not } \left(A\vdash B\right)$
Set and algebraic operators
A setminus B
A āˆ– B
$A\setminus B$
A times B
A cross B
A Ɨ B
$A\times B$
A cup B
A union B
A ∪ B
$A\cup B$
A cap B
A intersect B
A ∩ B
$A\cap B$
f circ g
f comp g
f ∘ g
$f\circ g$
n choose k $\binom{n}{k}$
(n+1) choose (k-1) $\binom{n+1}{k-1}$
a + b $a+b$
a - b $a-b$
a ā‹… b
a cdot b
a * b
$a\cdot b$
a / b $\frac{a}{b}$
a ā˜… b
a star b
$a \star b$
a āŠ• b
a oplus b
$a \oplus b$
x oplus_(n) y $x\oplus_{n}y$
a āŠ— b
a otimes b
$a \otimes b$
a āŠ™ b
a odot b
$a \odot b$
Big operators
sum(f, k, a, b)
sum k = a to b of f
$\displaystyle\sum_{k=a}^{b} f$
sum(3*k, k, 2, 5)
sum k = 2 to 5 of 3*k
$\displaystyle\sum_{k=2}^{5} 3\cdot k$
sum k to b of f $\displaystyle\sum_{k=0}^{b} f$
sum k in S of f
sum of f for k in S
$\displaystyle\sum_{k\in S} f$
sum of 3*k for k in A $\displaystyle\sum_{k\in A} 3\cdot k$
int(f, x, a, b)
integral(f, x, a, b)
int x = a to b of f
integral x = a to b of f
defint(f, x, a, b)
$\displaystyle\int_{a}^{b} f\,\mathrm{d}x$
int x to b of f
integral x to b of f
$\displaystyle\int_{0}^{b} f\,\mathrm{d}x$
int x = 0 to 2 of x^2 $\displaystyle\int_{0}^{2} {x}^{2}\,\mathrm{d}x$
int(f, x)
integral(f, x)
int f dx
integral f dx
$\displaystyle\int f\,\mathrm{d}x$
int x^2 dx $\displaystyle\int {x}^{2}\,\mathrm{d}x$
product(f, k, a, b) $\displaystyle\prod_{k=a}^{b} f$
product(k^2, k, 1, n) $\displaystyle\prod_{k=1}^{n} {k}^{2}$
Union(B, k, S)
Cup(B, k, S)
bigcup(B, k, S)
Union k in S of B
Cup k in S of B
bigcup k in S of B
Union of B for k in S
Cup of B for k in S
bigcup of B for k in S
$\displaystyle\bigcup_{k\in S} B$
Union k in A of B(k) $\displaystyle\bigcup_{k\in A} B\left(k\right)$
Intersect(B, k, S)
Cap(B, k, S)
bigcap(B, k, S)
Intersect k in S of B
Cap k in S of B
bigcap k in S of B
Intersect of B for k in S
Cap of B for k in S
bigcap of B for k in S
$\displaystyle\bigcap_{k\in S} B$
Delimited forms
[ G : H ]
index(G,H)
$\left[G\mathbin{:}H\right]$
⌊ x āŒ‹
floor(x)
$\left\lfloor x\right\rfloor$
⌈ x āŒ‰
ceiling(x)
$\left\lceil x\right\rceil$
Constants and phrases
ā„•
NN
$\mathbb{N}$
ℤ
ZZ
$\mathbb{Z}$
ā„š
QQ
$\mathbb{Q}$
ā„
RR
$\mathbb{R}$
ā„‚
CC
$\mathbb{C}$
š•€
II
$\mathbb{I}$
š•†
OO
$\mathbb{O}$
infty
infinity
$\infty$
sigma $\sigma$
→←
contradiction
$\rightarrow\leftarrow$
equivalenceRelation
equivalence relation
$\text{equivalence relation}$
strictPartialOrder
strict partial order
$\text{strict partial order}$
partialOrder
partial order
$\text{partial order}$
totalOrder
total order
$\text{total order}$
topSpace
topological space
$\text{topological space}$
AlgebraRule
"algebra rule"
algebra rule
$\text{algebra rule}$
ChainsRule
"chains rule"
chains rule
$\text{chains rule}$
EquationsRule
"equations rule"
equations rule
$\text{equations rule}$
SetBuilderRule
"set builder rule"
set builder rule
$\text{set builder rule}$
natural
"natural number"
natural number
$\text{natural number}$
Algebraic expressions
(x) $\left(x\right)$
2+x+y $2+x+y$
-x $-x$
1-x $1-x$
1/x $\frac{1}{x}$
2*1/x*y $2\cdot \frac{1}{x}\cdot y$
(2*1)/(x*y) $\frac{2\cdot 1}{x\cdot y}$
x^2 ${x}^{2}$
x factorial
x!
$x!$
multinomial(m,n) $\left(m,n\right)$
abs((1-x)/(1+x)) $\left| \frac{1-x}{1+x} \right|$
x star y star z $x \star y \star z$
Fib_(n+2) $F_{n+2}$
Sets, functions, and tuples
{a,b,c}
set(a,b,c)
$\left\{\,a,b,c\,\right\}$
{ p:p is prime}
set(p:p is prime)
$\left\{\,p:\,p\text{ is }\text{prime}\right\}$
A'
A complement
A°
${A}'$
powerset(A)
š’«(A)
$\mathscr{P}\left(A\right)$
f:A→B $f\colon A\to B$
f(x) $f\left(x\right)$
f_(x) $f_{x}$
f_(0)(x)_(n+1) $f_{0}\left(x\right)_{n+1}$
[x,y]
pair(x,y)
tuple(x,y)
⟨x,y⟩
$\left\langle{x,y}\right\rangle$
[x,y,z]
triple(x,y,z)
tuple(x,y,z)
⟨x,y,z⟩
$\left\langle{x,y,z}\right\rangle$
[w,x,y,z]
tuple(w,x,y,z)
⟨w,x,y,z⟩
$\left\langle{w,x,y,z}\right\rangle$
[[1,2],[3,4]] $\left[\begin{matrix} 1 & 2 \\ 3 & 4 \end{matrix}\right]$
[x,y]' $\left[\begin{matrix} x \\ y \end{matrix}\right]$
[x,y,z]' $\left[\begin{matrix} x \\ y \\ z \end{matrix}\right]$
[[1,2,3],[4,5,6]]' $\left[\begin{matrix} 1 & 4 \\ 2 & 5 \\ 3 & 6 \end{matrix}\right]$
class(a) $\left[a\right]$
class(a,~) $\left[a\right]_{\sim}$
Assumptions and Declarations (case insensitive, phrase is echoed)
Assume P
Given P
From P
Suppose P
If P
Define P
:P
$\text{Assume } P$
Let x $\text{Let }x$
Let x in A $\text{Let }x\in A$
Let x be such that x in RR
Let x such that x in RR
$\text{Let }x\text{ be such that } x\in \mathbb{R}$
Let x in RR be such that 0 leq x $\text{Let }x\in \mathbb{R}\text{ be such that } 0\leq x$
Let x in RR, 0 leq x $\text{Let }x\in \mathbb{R}, 0\leq x$
f(c)=0 for some c $f\left(c\right)=0\text{ for some }c$
f(c)=0 for some c in A $f\left(c\right)=0\text{ for some }c\in A$
Declare is, 0, +, cos $\text{Declare } \text{is}\text{, }0\text{, }+\text{, }\textcolor{black}{\text{and }}\text{cos}$
c := f(a,b)
write c for f(a,b)
$c\mathrel{:=}f\left(a,b\right)$
c(s,t) := f(s,t)
Write c(s,t) for f(s,t)
$c\left(s,t\right)\mathrel{:=}f\left(s,t\right)$
Mentioning an operator as a symbol (any operator name or glyph)
(star)
'star'
$\left(\star\right)$
(subset)
'āŠ†'
$\left(\subseteq\right)$
oplus(x,y)
'āŠ•'(x,y)
(āŠ•)(x,y)
$\oplus\left(x,y\right)$
~ is reflexive
'~' is reflexive
$\sim\text{ is }\text{reflexive}$
⟨x,y⟩ in '~'
⟨x,y⟩ in ~
$\left\langle{x,y}\right\rangle\in \sim$
star is associative $\star\text{ is }\text{associative}$
oplus is associative $\oplus\text{ is }\text{associative}$
otimes is associative $\otimes\text{ is }\text{associative}$
odot is associative $\odot\text{ is }\text{associative}$
'~' is an equivalence relation $\sim\text{ is an }\text{equivalence relation}$
'~' is a strict partial order $\sim\text{ is a }\text{strict partial order}$
'~' is a partial order $\sim\text{ is a }\text{partial order}$
'~' is a total order $\sim\text{ is a }\text{total order}$
Miscellaneous
1.23[456] $1.23\overline{456}$
x^-
x⁻
${x}^{-}$
@P(k)
šœ†P(k)
$\mathcal{P}\left(k\right)$

Precedence

The precedence of operations from highest to lowest are given in the following table. There are a few fine points to be aware of.

Precedence (high to low)
parentheses $(~~)$, tuples $\langle~~\rangle$, equivalence classes $[~~]$, symbols, numbers
exponentials $\left(x^2\right)$
function application $\left(f_0(x,y)(z)\right)$
postfix ($n!$, $f'$)
abstract infix operators ($\star$, $\oplus$, $\otimes$, $\odot$)
negation ($-x$), reciprocal ($1/2$)
product ($2\cdot x$)
summation $\left(\sum_{k=0}^n f(k)\right)$
indexed union and intersection $\left(\bigcup_{i \in \mathbb{N}} A_{i}\right)$
sum ($x+y-1$)
choose $\binom{m+n}{m}$
composition $\left(g\circ f\right)$
intersection ($A\cap B$)
union ($A\cup B$)
cartesian product ($A\times B$)
relative complement ($A\setminus B$)
relations ($f:A\to B$, $\underset{m}{\equiv}$, $\subseteq$, $\in$, $\notin$, $\mid$, $\leq$, $\lt$, $=$, $\neq$, $\sim$, 'is', 'loves')
not ($\neg$)
and ($\wedge$)
or ($\vee$)
implies ($\Rightarrow$)
iff ($\Leftrightarrow$)
binding ($x.P(x)$)
quantified ($\forall x.P(x)$)
declarations ('Declare', 'Let', 'for some')
environment $\{~\}$