
You’re not going to find an official definition of mathematics that everyone will agree on, but many people would be okay with saying that it involves reasoning about quantity, change, structure, chance, causality, and space aided by the discovery of abstract patterns and the invention of models.
Math aims to help us both (1) explain real-world phenomena and (2) discover truths that transcend the physical world. It’s such a well-known human activity that Wikipedia has an article on it! Seriously! Who knew?
No one knows for sure, but there’s a great book on the topic that just might have the answer. If you look at the evolution of life and consciousness you might get some ideas. The earliest life forms may have only survived by bumping into food. Natural selection led to sensing abilities enabling organisms to move toward the food. Next, lifeforms capable of making “models of their surroundings” so they could both navigate around obstacles and remember where the food was gained an evolutionary advantage.
This question has been asked millions of times. Seriously.
The answer is probably both!
The question is so popular we can even question the question:

Whatever your take on this question is, Math has proven to be unreasonably effective in the natural sciences.
Math is a big field of study. Here’s how Wikipedia breaks it down (others may have different takes):
| Branch | Topics |
|---|---|
| Foundations | Philosophy of Mathematics • Mathematical Logic • Information Theory • Set Theory • Type Theory • Category Theory |
| Algebra | Abstract • Boolean • Clifford • Commutative • Elementary • Field Theory • Group Theory • Homological • Lie • Linear • Multilinear • Ring Theory • Universal |
| Analysis | Calculus • Real Analysis • Complex Analysis • Hypercomplex Analysis • Differential Equations • Functional Analysis • Harmonic Analysis • Measure Theory |
| Discrete | Combinatorics • Discrete Geometry • Graph Theory • Matroid Theory • Order Theory |
| Geometry | Algebraic • Affine • Analytic • Arithmetic • Complex • Computational • Convex • Differential • Discrete • Euclidean • Finite • Information • Projective |
| Number Theory | Algebraic • Analytic • Arithmetic • Diophantine Geometry |
| Topology | General • Algebraic • Differential • Geometric • Homotopy Theory • Knot Theory |
| Applied | Control theory • Operations Research • Probability • Statistics • Game Theory |
| Computational | Computer Science • Theory of Computation • Computational Complexity • Numerical Analysis • Optimization • Computer Algebra |
Another organization of topics can be found at Quanta Magazine’s Map of Mathematics. There’s also a cool Map of Mathematics video by Dominic Walliman, from which this poster can be found:

In computer science—a field that many argue is just a branch of mathematics—a handful of mathematical topics are particularly important. These include the Foundations of Mathematics, since it was the so-called “foundational crisis of mathematics” that literally led to the birth of computer science. Let’s begin there.
We want to put math on a solid foundation so we know that we are not talking nonsense.
Here’s part of the Wikipedia article on the foundations of mathematics:
Foundations of mathematics are the logical and mathematical frameworks that allow the development of mathematics without generating self-contradictory theories, and to have reliable concepts of theorems, proofs, algorithms, etc. in particular. This may also include the philosophical study of the relation of this framework with reality.
If we can reduce everything down to a few very basic concepts and rules that people can agree upon, then show how to carefully and systematically derive all of mathematics from them, building things up in a way everyone can agree is valid, we can have confidence that mathematics does what it is supposed to do.
Whether you believe philosophically that this is possible or not doesn’t matter for now. What matters is putting in the effort to build a foundation and learning from the effort. Honestly, some fascinating discoveries and useful inventions have come from past work in foundations.
What we now understand to be the foundations of mathematics today are relatively recent developments, primarily from the late 19th and early 20th centuries. Prior to this time, most of what mathematicians did was just taken for granted. But the the late 1800s and early 1900s saw a rise surprising and paradoxical conclusions from relatively benign claims, and debates about the nature of mathematical truth, leading to what’s now known as the foundational crisis of mathematics.
Several schools of thought emerged to address the foundational crisis. The three main schools were logicism, which aimed to reduce mathematics to logic; formalism, which sought to establish a consistent set of axioms and rules for mathematics; and intuitionism, which emphasized the mental construction of mathematical objects and rejected non-constructive proofs.
Math is just logic
Math is done by manipulating symbols according to rules
Math is only what we invent and can construct or demonstrate
Today, this crisis pretty much considered resolved. In the decades of work to complete the resolution, the new field of mathematical logic was born, as were (1) modern versions of Set Theory, Type Theory, and Category Theory, which provide rigorous foundations for mathematics, (2) practical theories such as proof theory, model theory, computability theory, and complexity theory, and (3) the field of computer science itself.
Good question! Many mathematicians don’t pursue a deep understanding of the foundations of math because they don’t need it in their daily work. But the field turns out to be really useful for computation, theoretical computer science, formal verification of program correctness (used in computer security), and proving complex theorems with the aid of a computer. In other words, it’s important for computer science, particularly in the study of programming languages.
Mathematical foundations underline much of computer science.
And actually, there is some mind-blowing stuff here.
There are many theories within mathematics. But there are three kinds of theories that can be viewed as providing a foundation for (all of) math: set theories, type theories, and category theories.
See the Wikipedia page on Foundations of Mathematics and the SEP article on Philosophy of Mathematics for a history of the subject.
Oversimplifying a bit, here’s a bit about these three theories (or technically, theory families):
| Set Theory | Type Theory | Category Theory | |
|---|---|---|---|
| Philosophy and Approach | Math is about classification of objects by arranging them in sets. Set Theory requires logic (generally a classical one) to already exist. | Math is about manipulating objects according to the types they inhabit. Logic emerges from the theory. Usually constructive in nature (though classical type theories do exist). | Math is about structures and the relationships between them, without worrying about internal details. |
| Key Features | Sets are built up from smaller sets, with rules to avoid paradoxes. Generally, everything is a set, which is both a strength and a weakness. | Terms have types. Types can depend on other types as well as on terms. Propositions are types. Proofs are programs. | Categories have objects and morphisms (arrows or relationships). Functors map between categories. Commutative diagrams are used a lot. |
| Concepts | Elements, membership, subsets, power sets, tuples, sequences, partitions, relations, equivalence relations, orders, cardinality. | Types, terms, inductive types, sums ($+$), products ($\times$), dependent types ($\Pi$ and $\Sigma$), propositions as types, proofs as programs, equality types, universes. | Objects, morphisms, functors, natural transformations, limits, colimits, adjunctions, monads, categories, monoids, topoi. |
| Characteristic Notation | $x \in S$ means $x$ is an element of set $S$. | $x : A$ means the term $x$ is of type $A$. | $X \xrightarrow{f} Y$ means $f$ is a morphism from category $X$ to category $Y$. |
| Applications | Used everywhere—most mathematicians are familiar with much of it. | Computer science, formal verification, proof assistants. | Abstract algebra, topology, geometry, mathematical logic. |
| Exemplars | Some set theories are: ZF and ZFC, NBG, NF and NFU, MK, KP, CST. | Some type theories are: Simply-Typed $\lambda$ calculus, MLTT, System F, DTT, CoC, HoTT. | Some category theories are: ETCS, Topos Theory, Abelian, Monoidal. |
Math and LogicMath and logic are related, but not the same thing. Mathematicians do quite a lot of logic. If interested, I have more extensive notes that get into logic in more detail, with coverage of non-bivalent, intuitionistic, paraconsistent, fuzzy, non-monotonic, and a bunch of other types of logic. They get into metalogical notions of soundness and completeness, too.
Mathematics is concerned with objects and the relationships between them, with a focus on the laws the objects obey.
Computer Science is concerned with objects and the relationships between them, with a focus on the behavior of the objects and the processes that manipulate them.
Let’s take an inventory of the kinds of things that humans work with in mathematics that show up often in computer science. We’ll look both at laws and behaviors, since both views are isomorphic. In no particular order, here’s an incomplete sampling of useful mathematical objects:
Booleans Numbers Tuples Sets Relations Functions Sequences Lists Characters Strings Maps Graphs Vectors Matrices Tensors
Let’s visit the basic ideas behind some of these objects.
The boolean objects are $\textsf{true}$ and $\textsf{false}$. They obey several laws, including:
A computational view might be that $\land$ and $\lor$ are operations. But again, the laws and the operations are two sides of the same coin.
Numbers are useful. Seriously. We use them to count, measure, order, compare, and so much more.
Some people love numbers. Some numbers have a lot of fascinating properties. Some are interesting philosophically and recreationally. If you like numbers, or even if you think you don’t, browse Robert Munafo’s pages on notable numbers. Then you will like numbers too!
Numbers are classified by how we use them. Here is a small sampling:
| Type | Concept | What it tells us |
|---|---|---|
| Cardinal Numbers | Quantity | How many discrete items |
| Ordinal Numbers | Sequence | The position of something in an ordering |
| Scalar Numbers | Magnitude | How much (continuous quantity) of something there is |
| Coordinate Numbers | Location | Numbers that represent a position in space |
| Vector Numbers | Direction and Magnitude | Which way and how far |
| Nominal Numbers | Identification | A convenient label |
Here is another way to classify numbers:
| Kind | Symbol | Informal Description |
|---|---|---|
| Natural Numbers | $\mathbb{N}$ | $\{0, 1, 2, 3, \ldots\}$ |
| Integers | $\mathbb{Z}$ | $\{\ldots, -3, -2, -1, 0, 1, 2, 3, \ldots\}$ |
| Rational Numbers | $\mathbb{Q}$ | $\{\frac{a}{b} \mid a, b \in \mathbb{Z} \land b \neq 0\}$ |
| Real Numbers | $\mathbb{R}$ | (See the Wikipedia article) |
| Complex Numbers | $\mathbb{C}$ | Has 2 real components, written ($a+bi$) |
| Quaternions | $\mathbb{H}$ | Has 4 real components, written ($a+bi+cj+dk$) |
| Octonions | $\mathbb{O}$ | 8 real components, with units $e_0 ... e_7$ |
| Sedenions | $\mathbb{S}$ | 16 real components |
There are more! Did you know that algebraic and transcendental numbers were things? This amazing diagram by Keith Enevoldsen shows how they fit in (up to the complex numbers, at least):

Computable numbers and describable numbers are very useful in computer science theory, but missing from the diagram above. Here is where they land in the real numbers hierarchy:
That’s right! There are real numbers that we can describe but not compute. There are real numbers that exist but that we can’t even describe. This makes computer science (and math) interesting. How we know that we have proper containment at each level of this hierarchy is a little beyond the scope of these notes, but something you should research and internalize at some point.
ΩThe number $\Omega$ in the diagram above is Chaitin’s constant, a number we can describe but not compute. It’s not the same $\Omega$ as the mathematically inconsistent, self-contradictory “absolute infinity” from the Vi Hart video later in these notes.
Things get interesting when you go beyond the reals. What isn’t “real” by the way? Imaginary perhaps? Not a good name, as Jade shows:
Perhaps if they got a better name, the video would have had a different title.
Before we get to foundational definitions of numbers, let’s look, informally, at some of the basic operations we can perform with them.
For natural numbers:
Addition, multiplication, and exponentiation work for real numbers too. There are also inverses:
Got all that? Do you have a good sense of these numbers and operations? You should. Being numerically literate, with a good feel for numbers gives you agency in the world, become less likely to be taken advantage of, and helps you become a better citizen. Watch Vi Hart’s piece which should give you a feel for what having feels about numbers entails:
Also important:
In computer science, integers, rationals, and reals are often compressed into fixed size registers, yielding classes of bounded numbers. You can study these in more depth in the notes on Numbers and Numeric Encoding.
Robert Munafo has another catalog of numbers, his Large Numbers pages, which you absolutely don’t want to miss. It includes not only large numbers, but the transfinite ordinals.
Seriously, don’t miss it!
Have ten hours to spare? This will take you through large finite numbers only, but in doing so, will give you a sense that thinking that infinity is not a big deal isn’t really accurate. Though easy to describe, it’s so far beyond direct experience. You just can’t.
If you want to become immersed and well-versed in this stuff, start at the Googology Wiki. Have fun!
One small nitThis video seems to suggest that infinity is a number, which isn’t really accurate. Infinity is not a number, but there are numbers that represent infinities in various mathematical contexts.
There are not only so many kinds of numbers but there are even many kinds of transfinite numbers. Perhaps you encountered a few of these already in Robert Munafo’s Large Numbers pages. Whether you have or have not, Vsauce gives a careful explanation of cardinals (“how many”) and ordinals (“position of”) that really helps!
Vsauce does not go far enough. Vi Hart takes us much, much further:
So many types of numbers in this video: cardinals in Set Theory, surreals in Game Theory, supernaturals in Field Theory, ordinal spaces in Topology, Hilbert spaces in Analysis and Quantum Physics, and more.
Many of the infinities are best understood in the context of Set Theory. So we’ll defer a proper treatment of cardinals and ordinals to our upcoming notes on Set Theory.
A pair, also called an ordered pair, is an object $(a, b)$ where $a$ is the first element and $b$ is the second element. The order of the elements matters, meaning that the pair $(a, b)$ is only the same as the pair $(b, a)$ when $a = b$.
Pairs are a fundamental building block for more complex structures.
A tuple is an object such as $(21,F)$, $(a,a,b,a,b,a,b,b)$, or $(do, re, mi, fa, so, la, ti, do)$. The elements of a tuple are ordered. Given a tuple $t$, you access the $i$th element with the notation $\:t\!\downarrow\!i$.
Tuples are just pairs. For example, The $3$-tuple $(a, b, c)$ is the pair $(a, (b, c))$, and a the $4$-tuple $(a, b, c, d)$ is the pair $(a, (b, (c, d)))$, and so on. Tuple notation is just sugar for the true, underlying pair notation.
In general, $(a_1, \ldots, a_n)$ sugars $(a_1, (a_2, (\ldots, (a_{n-1}, a_n)\ldots)))$ and is called an $n$-tuple. Its length is $n$. Because tuples are pairs, every tuple has a length of at least $2$.
That said, we can get a little informal, and speak of $1$-tuples and $0$-tuples, too. The convention is $a = (a)$ for a $1$-tuple and the $0$-tuple is simply $()$.
Tuples can be concatenated. If $t_1$ is an $m$-tuple and $t_2$ is an $n$-tuple then $t_1 • t_2$ is an $(m+n)$-tuple:
$$(a_1, \ldots, a_m) • (b_1, \ldots, b_n) = (a_1, \ldots, a_m, b_1, \ldots, b_n)$$We will allow the concatenation operator to work with $0$-tuples and $1$-tuples as well, so $(a,b) • c = (a,b,c)$, $a • b = (a,b)$, and $a • () = a$.
A set, in practice, is an unordered collection of unique elements. We denote sets by (1) enumerating their elements or (2) using a filtering notation to select certain elements from an existing set. You can use prose as long as the precise meaning can be recovered exactly and uniquely.
Crisp and Fuzzy SetsWhat does it mean to be a member? It can vary.
- For crisp sets, you’re either in or you’re out. No in-between. This is the most common kind of set.
- For fuzzy sets, membership can be partial. For example, you might be 0.8 in the set of tall people.
These notes will only cover crisp sets.
There is a lot of notation surrounding sets:
AMBIGUOUS NOTATION ALERT: $A^n$The notation $A^n$ is horribly overloaded! When $A$ is a plain old set, the notation indicates tuple construction, as shown above. When $A$ is a relation or function (terms we’ll define later), the notation indicates repeated composition. When $A$ is an alphabet (also something we’ll define later), the notation indicates the set of strings with a given length. When $A$ is a language (you guessed it, something we’ll define later), the notation indicates sets of strings made by concatenating strings from $A$ a given number of times.
In each of these cases, the value of $A^n$ is completely different!
Context is crucial to understanding the meaning. Ambiguity is very common in math. Math is supposed to be convenient for humans, not rigid, so we expect it to be ambiguous and confusing. You can always do programming if you don’t like ambiguity.
Assuming you already know first-order classical logic, you can use the definitions above to prove some interesting laws that sets obey. The following are theorems of all the major set theories—shown here with all free variables implicitly universally quantified:
A notion that comes up often when working with sets is that of separating out the elements of a set into non-overlapping groups. Two technical terms are useful here.
$A$ and $B$ are disjoint iff $A \cap B = \varnothing$
$\Pi = \{P_1, P_2, \ldots, P_n\} \subseteq \mathcal{P}(A)$ is a partition of $A$ iff:
When we say “Five is less than eight” we are expressing a relation between two numbers. You can probably think of many more, For numbers, there is $\leq$, $\gt$, and $\geq$. For sets, there is $\subseteq$. For people, the relation “likes” comes to mind. The relation $=$ is defined for every kind of object.
When $a$ is related to $b$ by a relation $R$, we write $aRb$.
When using relations, there’s a little bit of terminology and a couple operators to know. First, some special types of relations:
And some more:
Relations can be composed: If $aRb$ and $bSc$, then $a$ is related to $c$ by the composed relation $S \circ R$. The $\circ$ symbol is read ”after”, since we look at $S$ after $R$. It can be proven that composition is associative, which allows us to write things like $R \circ R \circ R \circ R$ without parentheses. An in yet another overloading of notation, you’ll find $R^n$ used for the $n$-fold composition of $R$ with itself, so $R^1 = R$, $R^2 = R \circ R$, $R^3 = R \circ R \circ R$, and so on. There’s also $R^*$, which means related to in any number of steps, including $0$.
Relations are frequently used in computation theory to describe state changes in nondeterministic systems. The relation is sometimes called a transition relation and denoted by $\longmapsto$ so you’ll see something like $\psi_1 \longmapsto \psi_2$ meaning the computation system can move from state $\psi_1$ to state $\psi_2$.

A function maps an input to an output, such that given any input (called the argument), you get the same output every time you apply the function.
To apply or invoke the function $f$ on argument $a$, we write $f\,a$ or $f(a)$. To represent a function explicitly, we write:
$$\lambda x_t. e$$where $x$ is the argument of the function and $t$ is the the type or set (depending on whether your context is Type Theory or Set Theory), respectively, of the argument—and $e$ is the expression that computes the output based on $x$. Usually the output type or set is inferrable, but if it is not, you can be explicit.
To be a real mathematical function, the function must declare beforehand the type (or set) of its argument and the type (or set) of its result. The former is the domain and the latter is the codomain.
Pay attention: $f$ is a function (of type or set $A \to B$) but $f(x)$ is the result of applying the function. So $f(x)$ is not the function itself, but rather the output.
AMBIGUOUS LANGUAGE ALERT: $f(x)$If $f$ is a function, do not say “the function $f(x)$” unless the function $f$, when applied to $x$, actually yields a function. Also do not say things like “the function $n^2$” because $n^2$ is a number. The function you probably have in mind is $\lambda n. n^2$. That doesn’t stop people from abusing the notation, though.
Mathematics is often about communicating ideas, not about absolute precision. Confusing people is part of the fun of math, it seems. Context matters. When something is ambiguous, ask about it.
The restriction of function arguments and bodies to particular types or particular sets is crucial to the foundations of mathematics. Allowing functions to operate on anything whatsoever can give you a version of Russell’s Paradox, which leads to inconsistency and your whole theory collapsing into triviality. An anything-goes approach to defining functions belongs to informal, naïve mathematics.
We often give names to functions, for example:
$ \textsf{plusTwo} =_{\small{\textrm{def}}} \lambda n_{\textsf{Nat}}. \textsf{s}\,\textsf{s}\,n $
$ \textsf{isZero} =_{\small{\textrm{def}}} \lambda n_{\textsf{Nat}}. n = 0 \\ $
We can create functions for any operation we like, such as $\textsf{and}$ for logical conjunction, $\textsf{or}$ for logical disjunction, $\textsf{not}$ for logical negation, $\textsf{plus}$ for addition, $\textsf{times}$ for multiplication, and $\textsf{exp}$ for exponentiation, and define different versions of these for different numeric types. Relations can be defined as functions whose codomain is the boolean type (or set):
$ \textsf{lt} =_{\small{\textrm{def}}} \\ \lambda x_{\textsf{Nat}}. \lambda y_{\textsf{Nat}}. \exists k_{\textsf{Nat}}.\, k \neq 0 \land x + k = y $
And here is something remarkably useful:
$ \textsf{cond} =_{\small{\textrm{def}}} \iota f_{\textsf{Bool} \rightarrow t \rightarrow t \rightarrow t}.\;f\,\mathsf{true}\,x\,y = x \land f\,\mathsf{false}\,x\,y = y \\ $
This is a cool way to define the function! It literally says “$\textsf{cond}$ is the function $f$ for which $f\,\mathsf{true}\,x\,y = x$ and $f\,\mathsf{false}\,x\,y = y$.” But there are other notations. They hinge on the fact that there are only two boolean values and we need to do different things based on the input. The case expression form is:
$ \textsf{cond} =_{\small{\textrm{def}}} \lambda b_{\textsf{Bool}}. \lambda x_t. \lambda y_t. [\,b \ \Vert \ \mathsf{true} \to x \mid \mathsf{false} \to y\,] $
If you are switching on the parameter itself, you can use this handy shorthand:
$ \textsf{cond} =_{\small{\textrm{def}}} \lambda(\mathsf{true} \to \lambda x_t. \lambda y_t. x \mid \mathsf{false} \to \lambda x_t. \lambda y_t. y) $
The switching needs to be based on the way the types are defined. We’ll cover this in more detail when we look at Type Theory.
PolymorphismThe $\textsf{cond}$ function we defined above is an example of a polymorphic function. It can operate on any type $t$, not just a specific type like $\textsf{Nat}$ or $\textsf{Bool}$. This is powerful. Many programming languages make use of this idea.
The word comes from the Greek words poly meaning many and morph meaning form.
You can also think of $\textsf{cond}$ as being a template for an infinite number of functions, one for each type.
In the foundations of mathematics, we can consider all operations to be functions, including all of the logical and arithmetic operations. We typically sugar many of these calls, giving us the notation that is familiar to us today:
$\begin{array}{lll} \neg b & \text{for} & \textsf{not}\;b \\ a \land b & \text{for} & \textsf{and}\;a\;b \\ a \lor b & \text{for} & \textsf{or}\;a\;b \\ a \supset b & \text{for} & \textsf{or}\;(\textsf{not}\;a)\;b \\ \textsf{if}\;b\;\textsf{then}\;x\;\textsf{else}\;y & \text{for} & \textsf{cond}\;b\;x\;y \\ n + 1 & \text{for} & \textsf{s}\;n \\ m + n & \text{for} & \textsf{plus}\;m\;n \\ m \times n & \text{for} & \textsf{times}\;m\;n \\ m^n & \text{for} & \textsf{exp}\;m\;n \\ m \uparrow\uparrow n & \text{for} & \textsf{tetrate}\;m\;n \\ m \lt n & \text{for} & \textsf{lt}\;m\;n \\ m \le n & \text{for} & \textsf{le}\;m\;n \\ m \gt n & \text{for} & \textsf{gt}\;m\;n \\ m \ge n & \text{for} & \textsf{ge}\;m\;n \\ \textsf{let}\;x = e\;\textsf{in}\;e' & \text{for} & (\lambda x.\,e')\;e \\ e'\;\mathsf{where}\;x = e & \text{for} & (\lambda x.\,e')\;e \end{array}$
Heck we’ll even write $xy$ for $x \times y$ except when it makes things too confusing.
OverloadingYou might notice that some symbols and operators, like $+$, $\times$, and so on will be used across multiple arithmetic types, and perhaps on nonarithmetic types too. While such cases represent fundamentally distinct functions, we’ll happily overload the symbols and rely on context to suss out which specific function is meant.
A few forms make $\lambda$-expressions easier to read. The first is the amazing let-notation that we saw earlier in passing, but did not really dive into. Here it is again, because it is so useful and is used all the time:
Where-notation is a close relative of let-notation:
If-notation:
Equivalently, for those who really like to spread things out on the page:
Substitution:
The operator $\circ$ is pronounced “after,” i.e., $f \circ g$ is the function that applies $f$ after applying $g$:
Function iteration:
AMBIGUOUS NOTATION ALERT: $sin^2\theta$Many mathematicians purposefully blur the distinction between $\sin^2\theta$ and $(\sin \theta)^2$, leaving you, the poor reader, to figure out what they mean by context. It can be very annoying.
It appears that for trigonometric functions, people tend to use the iterative form for the power form, but for other functions the iterative form usually means iteration. Maybe?
Don’t worry too much. It’s all a consequence of the fact that everyone is allowed to invent their own notation. Just remember, all things are contextual.
A sequence is an ordering of elements indexed by natural numbers, and written $\langle a_0, a_1, a_2, \dots, a_{n-1} \rangle$. The length of the sequence is $n$. The common operation is to lookup elements by position. It is common to think of the sequence as a function from natural numbers to the type or set of sequence elements plus $\bot$, where $\bot$ stands for the absence of a value at a particular index.
Both the set-theoretic and type-theoretic encodings of sequences are fascinating. They will be covered later in the course.
A list is defined inductively like this:
This means a list is an ordered collection of elements. This shows in the conventional notation: We write ${[x]}$ for $(x\,\textbf{::}\,[\,])$, ${[x,y,z]}$ for $(x\,\textbf{::}\,(y\,\textbf{::}\,(z\,\textbf{::}\,[\,])))$, and so on.
Lists are particularly useful in mathematics and computer science, and appear in nearly every mainstream programming language. Several dozen useful lists operations are known, among them:
head: Returns the first element of the list (or $\bot$ if empty).tail: Returns the list without the first element (or $\bot$ if empty).append: Concatenates two lists together, end to end.length: Returns the number of elements in the list.map: Applies a function to each element of the list.filter: Returns a list of elements that satisfy a predicate.A character is a primitive unit of textual information. In practice, we create sets of characters called alphabets.
The most common alphabet in the world today is Unicode. Characters in Unicode have both a code point (a unique natural number identifying the character) and a name, such as U+0041 LATIN CAPITAL LETTER A.
The science of characters is quite vast. You can learn by browsing the resources available through unicode.org, or, for a computer science approach, see the course notes on Characters and Character Encoding.
A string is a list of characters. Sets of strings are called languages. We cover strings and languages in much more detail in our notes on Language Theory, where we will encounter a great many operations.
A map or dictionary is often visualized as a lookup table but as a mathematical object, it’s just a function, with a codomain extended to return $\bot$ for keys not present in the map. Here’s an example:
$ (\lambda s. \bot)[\texttt{a} \mapsto 1][\texttt{b} \mapsto 2][\texttt{c} \mapsto 3] $
though more conveniently shown as:
$ \{ \texttt{a}\!: 1, \texttt{b}\!: 2, \texttt{c}\!: 3 \}$
The latter is syntactic sugar for the former. For this particular map, we have:
Also, because maps are just functions, the substitution notation works for them too. If $m$ is the map above, we can write things like $m[\texttt{d} \mapsto 4]$ for the map just like $m$ with the additional key-value pair mapping $d$ to $4$, and $m[\texttt{b} \mapsto 0]$ for the map like $m$ except $\texttt{b}$ now maps to $0$.
Structurally, a graph consist of vertices and edges connecting pairs of vertices. Here’s an example:

Behaviorally, a graph comes with associated operations such as finding paths, computing connectivity, traversal and much more. Rather than looking at definitions, here’s terminology introduced by example:
There are a few terms that apply only to connected graphs. Consider the block in the graph above containing vertices $\{D, C, O, N\}$ and edges $\{q, p, h, i, t, j\}$:
The next three objects form a natural progression. A scalar is just a number. A vector is a 1-dimensional array of numbers. A matrix is a 2-dimensional array. A tensor generalizes all of them to any number of dimensions. Structurally, each is just a (nested) tuple of numbers; what makes each one interesting is the operations and laws that come along for the ride.
Structurally, a vector is a tuple that contains numbers, that adhere to certain operations, among them are (where $\vec u, \vec v, \vec w$ are vectors and $c, d$ are scalars):
From these definitions, you’ll note various laws:
Structurally, a matrix is a two-dimensional array of numbers. Behaviorally, a matrix comes with associated operations obeying the laws of matrix algebra.
A matrix with $m$ rows and $n$ columns is called an $m \times n$ matrix. As with vectors, addition of matrices and scalar multiplication is component-wise. Multiplication is a little different. To compute $A$ times $B$, you must have that $A$ is an $m\times k$ matrix and $B$ must be a $k \times n$ matrix. The result is an $m \times n$ matrix $C = AB$, where each element $c_{ij}$ is computed as the dot product of the $i$th row of $A$ and the $j$th column of $B$.
Matrix multiplication is not commutative. In general, $AB \neq BA$.
Here are a few representative laws, where $A$, $B$, $C$ are matrices and $I$ is the identity matrix:
Structurally, a tensor is a multi-dimensional array of numbers, generalizing scalars (rank 0), vectors (rank 1), and matrices (rank 2) to any rank $n$. Behaviorally, addition and scalar multiplication generalize the same way they do for vectors and matrices, component-wise across however many indices the tensor has:
Wait, what exactly is a tensor?In mathematics, not just any array of numbers is a tensor. A genuine tensor is defined by how its components transform under a change of coordinates, not merely by its shape. In computer science, however, the term is used loosely for any $n$-dimensional array (as in a “tensor” in PyTorch or TensorFlow).
Much of mathematics is aided by the use of computers. Computers speed up time, allowing us to think previously unthinkable thoughts. Computers make science and mathematics qualitatively different. Computers augment and amplify human thought. In math, complex proofs can be found or checked by automated proof assistants.
Generally, these proof assistants are based on Type Theory, not Set Theory, for various reasons (many taken from these slides by Sergey Goncharov):
Remember how we started with the observation that Logic is a prerequisite for Set Theory, but Logic emerges from Type Theory? Perhaps this means Type Theory is more fundamental? Maybe. But it does indicate something: there must be a deep connection between Logic and Type Theory.
We won’t cover it all right now, but will leave you with something to think about. Here is the type inference rule that tells us the type of the output of a function application:
That looks like Modus Ponens in logic. Is that a coincidence or an interesting correspondence?
And the inference rule for inferring the type of a pair is:
Can’t you just feel logical conjunction here?
This is just a small part of the Curry-Howard correspondence, which we’ll see when we cover Type Theory in depth.
Our focus on this page has been on introducing the notation and fundamental mathematical objects that play a large role in computation. But there’s much more to math that is useful in computer science. You might want to check out:
Did you watch the Vsauce video above? Kind of cool how Michael says we can do math that isn’t science and just invent things that we declare to be true, like transfinite infinities, and yeah, as long as we don’t have contradictions, let’s go. The first two frames of the famous XKCD Every Major’s Terrible has fun with this idea:

Sometimes our inventions do give us good models. Cohl Furey explains it in two minutes:
Intrigued? Watch her entire Division Algebras And the Standard Model playlist. Or checkout this article on her work.
Here are some questions useful for your spaced repetition learning. Many of the answers are not found on this page. Some will have popped up in lecture. Others will require you to do your own research.
head and tail considered partial functions? "x" to 21, "y" to 8, "z" to 55, and every other input to 0, in both lambda notation and as a map? We’ve covered: