Math Demo

Temml renders $…$ and $$…$$ to native MathML. The samples below are the notation the discrete-math labs use.

Logic connectives

A proposition is a statement that is definitely true or false — a bool. We name them p and q and combine them with four connectives:

LogicMeansIn code
¬pNOT!p
p∧qANDp && q
p∨qORp || q
p⇒qIMPLIES(no operator)
p⇔qIFFp === q

Quantifiers

∀x∈S,P(x)∃x∈S,P(x)

Read ∀ as .every() and ∃ as .some(). The usual domains are ℕ, ℤ, and ℝ.

Sets

The even integers, written with set-builder braces that markdown must not eat:

{n∈ℤ|nmod2=0}

Negation

¬∀xP(x)≡∃x¬P(x)

A short derivation:

¬(p∧q)≡¬p∨¬q¬(p∨q)≡¬p∧¬q

Calculus (sanity check)

∫0∞x2exdx

Edge cases

TeX source in inline code stays literal: \forall, \exists, \in.

A fenced example must not be rendered as math:

\forall x \in S,\; P(x)
$5 is not math either

Currency prose is not math: tickets cost $5 and $10.