Let be the category whose objects are sets and whose morphisms are functions. In more detail, for any two sets
and
let
be their Cartesian product and let
be the power set of
. Then
is the subset of
defined by the condition
In particular, is a locally small category. Going forward we will use the standard functional notation
to denote
A function is said to be injective if
and surjective if
where A function which is both injective and surjective is called bijective.
Problem 1.1. Prove that two sets are isomorphic if and only if
contains a bijection.
A natural set is a set of the form where
is a natural number. By Problem 1.1, two natural sets
and
are isomorphic if and only if
in which case
Thus, the full subcategory
of
whose objects are natural sets is a skeletal category.
Definition 1.1. A set is said to be finite if it is isomorphic to a natural set.
Since is skeletal, this means that there is one and only one natural number
such that
contains an isomorphism. This natural number is called the cardinality of the finite set
and we write
Let
be the full subcategory of
whose objects are finite sets.
Problem 1.2. Given finite sets and
with
and
prove that
is a finite set and calculate its cardinality.
Problem 1.2 shows that the category is enriched over itself.
is called the classical computational category because its objects and morphisms can be encoded using classical bits, and thus instantiated on a computer. The adjective “classical” is used to contrast
with the quantum computational category, whose objects and morphisms can presumably be instantiated on a quantum computer.
We will construct the quantum computational category in Lecture 2. In the remainder of Lecture 1, we focus on encoding objects and morphisms in Let
and
be natural numbers, and let
be a set, not necessarily finite.
Definition 1.2. An matrix over
is an element of
Given a matrix , the notation
is used for its values, and we write
instead of
for the set of
matrices over
This is because matrices
are typically thought of as two-dimensional arrays populated by elements of
Matrices are called column matrices because they are visualized as arrays consisting of a single column,
while matrices are called row matrices because they are visualized as arrays consisting of a single row,
While these visualizations are very convenient, one should remember that an matrix over
is really a function in
Classical computation utilizes matrices over which are called binary matrices. Since
is a finite set, binary matrices are morphisms in
Let
be a set of cardinality
. Then
contains an isomorphism
, and hence
contains an isomorphism
An isomorphism
is referred to as an ordering of
and we write
Using this enumeration of the elements of , we can define an injective function
by
The injection is called the one-hot encoding of
relative to the ordering
and the output
is called the column matrix of
relative to this ordering.
Now let and
be two sets of cardinalities
and
respectively, and let
and
be orderings of these sets. Using these orderings, we can define an injective function
by
The injection is called the binary encoding of
relative to the orderings
and
. The definition of
may be equivalently stated as follows: for each
column
of
is the one-hot encoding of
relative to the ordering
of
Now let be three finite sets of cardinalities
respectively. Let
and
and
be orderings of these sets. Let
and
be given functions, and let
be their composition. We want to understand the relationship between the matrices
of the functions and
relative to the given orderings of
Problem 1.3. Prove that the matrix defined by
in fact belongs to and that