Group homomorphism

[summary: A group homomorphism is a function between [3gd groups] which "respects the group structure".]

[summary(Technical): Formally, given two groups $(G, +)$ and $(H, *)$ (which hereafter we will abbreviate as $G$ and $H$ respectively), a group homomorphism from $G$ to $H$ is a [-3jy] $f$ from the underlying set $G$ to the underlying set $H$, such that $f(a) * f(b) = f(a+b)$ for all $a, b \in G$.]

A group homomorphism is a function between [3gd groups] which "respects the group structure".

#Definition

Formally, given two groups $(G, +)$ and $(H, *)$ (which hereafter we will abbreviate as $G$ and $H$ respectively), a group homomorphism from $G$ to $H$ is a [-3jy] $f$ from the underlying set $G$ to the underlying set $H$, such that $f(a) * f(b) = f(a+b)$ for all $a, b \in G$.

#Examples

 - For any group $G$, there is a group homomorphism $1_G: G 	o G$, given by $1_G(g) = g$ for all $g \in G$. This homomorphism is always [499 bijective].
 - For any group $G$, there is a (unique) group homomorphism into the group $\{ e \}$ with one element and the only possible group operation $e * e = e$. This homomorphism is given by $g \mapsto e$ for all $g \in G$. This homomorphism is usually not [4b7 injective]: it is injective if and only if $G$ is the group with one element. (Uniqueness is guaranteed because there is only one *function*, let alone group homomorphism, from any set $X$ to a set with one element.)
 - For any group $G$, there is a (unique) group homomorphism from the group with one element into $G$, given by $e \mapsto e_G$, the identity of $G$. This homomorphism is usually not [4bg surjective]: it is surjective if and only if $G$ is the group with one element. (Uniqueness is guaranteed this time by the property proved below that the identity gets mapped to the identity.)
 - For any group $(G, +)$, there is a bijective group homomorphism to another group $G^{\mathrm{op}}$ given by taking inverses: $g \mapsto g^{-1}$. The group $G^{\mathrm{op}}$ is defined to have underlying set equal to that of $G$, and group operation $g +_{\mathrm{op}} h := h + g$.
 - For any pair of groups $G, H$, there is a homomorphism between $G$ and $H$ given by $g \mapsto e_H$.
 - There is only one homomorphism between the group $C_2 = \{ e_{C_2}, g \}$ with two elements and the group $C_3 = \{e_{C_3}, h, h^2 \}$ with three elements; it is given by $e_{C_2} \mapsto e_{C_3}, g \mapsto e_{C_3}$. For example, the function $f: C_2 	o C_3$ given by $e_{C_2} \mapsto e_{C_3}, g \mapsto h$ is *not* a group homomorphism, because if it were, then $e_{C_3} = f(e_{C_2}) = f(gg) = f(g) f(g) = h h = h^2$, which is not true. (We have used that the identity gets mapped to the identity.)

# Properties

- The identity gets mapped to the identity. ([49z Proof.])
- The inverse of the image is the image of the inverse. ([4b1 Proof.])
- The [3lh image] of a group under a homomorphism is another group. ([4b4 Proof.])
- The composition of two homomorphisms is a homomorphism. ([4b6 Proof.])


Cyclic group

[summary: The cyclic [3gd groups] are the simplest kind of group; they are the groups which can be made by simply "repeating a single element many times". For example, the rotations of a polygon.]

[summary(technical):  A [3gd group] $G$ is **cyclic** if it has a single [generator_mathematics generator]: there is one [element_mathematics element] $g$ such that every element of the group is a [ power] of $g$.]

# Definition

A cyclic group is a group $(G, +)$ (hereafter abbreviated as simply $G$) with a single generator, in the sense that there is some $g \in G$ such that for every $h \in G$, there is $n \in \mathbb{Z}$ such that $h = g^n$, where we have written $g^n$ for $g + g + \dots + g$ (with $n$ terms in the summand).
That is, "there is some element such that the group has nothing in it except powers of that element".

We may write $G = \langle g
angle$ if $g$ is a generator of $G$.

# Examples

 - $(\mathbb{Z}, +) = \langle 1
angle = \langle -1
angle$
 - The group with two elements (say $\{ e, g \}$ with identity $e$ with the only possible group operation $g^2 = e$) is cyclic: it is generated by the non-identity element. Note that there is no requirement that the powers of $g$ be distinct: in this case, $g^2 = g^0 = e$.
 - The integers [modular_arithmetic modulo] $n$ form a cyclic group under addition, for any $n$: it is generated by $1$ (or, indeed, by $n-1$).
 - The [497 symmetric groups] $S_n$ for $n > 2$ are *not* cyclic. This can be deduced from the fact that they are not [3h2 abelian] (see below).

# Properties

## Cyclic groups are [3h2 abelian]
Suppose $a, b \in G$, and let $g$ be a generator of $G$. Suppose $a = g^i, b = g^j$. Then $ab = g^i g^j = g^{i+j} = g^{j+i} = g^j g^i = ba$.

## Cyclic groups are [2w0 countable]
The elements of a cyclic group are nothing more nor less than $\{ g^0, g^1, g^{-1}, g^2, g^{-2}, \dots \}$, which is an enumeration of the group (possibly with repeats).


Integer

An **integer** is a [-54y] that can be represented as either a [-45h] or its [-additive_inverse]. -4, 0, and 1,003 are examples integers. 499.99 is not an integer. Integers are real numbers; they are [-4zq rational numbers]; and they are not [-fraction fractions] or [-decimal decimals].

## A Mathier Definition ##

Instead of describing the properties of an integer we'll describe the membership rules for the [-3jz] $\mathbb{Z}$. After we're done, anything that's been allowed into $\mathbb{Z}$ counts as an integer.

Start by putting $0$ and $1$ into $\mathbb{Z}$. Now, pick an element of $\mathbb{Z}$, pick another element of $\mathbb{Z}$, and add them together (you can pick the same element twice). Is that number in $\mathbb{Z}$ yet? No?! Well let's put it in there fast. We can do the same thing as before except instead of adding, we subtract, and if the difference isn't in $\mathbb{Z}$ yet, we put it in there. Anything that could be let into $\mathbb{Z}$ with these procedures is an integer.

This is not an efficient algorithm for building out $\mathbb{Z}$, but it does show the primary motivation for having integers in the first place. Natural numbers (positive integers) are closed under addition, meaning that if you add any two elements in the set, the sum will be in the set, but natural numbers are not closed under subtraction. Integers are what you get when you expand natural numbers to make a set that is closed under subtraction as well.

## Formal construction

Given access to the set $\mathbb{N}$ of [45h natural numbers], we may construct $\mathbb{Z}$ as follows.
Take the collection of all pairs $(a, b)$ of natural numbers, and take the [-quotient] by the [-53y] $\sim$ such that $(a,b) \sim (c,d)$ if and only if $a+d = b+c$.
(The intuition is that the pair $(a,b)$ stands for the integer $a-b$, and we take the quotient so that any given integer has just one representative.)

Writing $[a,b]$ for the equivalence class of the pair $(a,b)$, we define the [-55j] structure as:

- $[a,b] + [c,d] = [a+c,b+d]$
- $[a, b] 	imes [c, d] = [ac+bd, bc+ad]$
- $[a,b] \leq [c,d]$ if and only if $a+d \leq b+c$.

This does define the structure of a totally ordered ring ([ proof]).


Square visualization of probabilities on two events

$$

ewcommand{	rue}{	ext{True}}

ewcommand{alse}{	ext{False}}

ewcommand{P}{\mathbb{P}}
$$

[summary:
$$

ewcommand{	rue}{	ext{True}}

ewcommand{alse}{	ext{False}}

ewcommand{P}{\mathbb{P}}
$$

We can represent a [joint_probability_distribution_on_event probability distribution] $P(A,B)$ over  two [event_probability events] $A$ and $B$ as a square:

We could also represent $P$ by [factoring_probability factoring], so using $P(A,B) = P(A)\; P(B \mid A)$ we'd make this picture:

]

Say we have two [event_probability events], $A$ and $B$, and a [joint_probability_distribution_on_event probability distribution] $P$ over whether or not they happen. We can represent $P$ as a square:

So for example, the [1rh probability] $P(A,B)$ of both $A$ and $B$ occurring is the ratio of \[the area of the dark red region\] to \[the area of the entire square\]:

Visualizing probabilities in a square is neat because we can draw simple pictures that highlight interesting facts about our probability distribution.

Below are some pictures illustrating:

* [4cf independent events] (What happens if the columns and the rows in our square *both* line up?)

* [marginal_probability marginal probabilities] (If we're looking at a square of probabilities, where's the probability $P(A)$ of $A$ or the probability $P(
eg B)$?)

* [1rj conditional probabilities] (Can we find in the square the probability $P(B \mid A)$ of $B$ if we condition on seeing $A$? What about the conditional probability $P(A \mid B)$?)

* [factoring_probability factoring a distribution] (Can we always write $P$ as a square? Why do the columns line up but not the rows?)

* the process of computing [1rh joint probabilities] from [factoring_probability factored probabilities]

Independent events
===

Here's a picture of the joint distribution of [4cf two independent events] $A$ and $B$:

Now the rows for $P(B)$ and  $P(
eg B)$ line up across the two columns. This is because $P(B \mid A) = P(B) = P(B \mid
eg A)$. When $A$ and $B$ are independent, updating on $A$ or $
eg A$ doesn't change the probability of $B$.

For more on this visualization of independent events, see the aptly named [4cl].

Marginal probabilities
===

We can see the [marginal_probability marginal probabilities] of $A$ and $B$ by looking at some of the blocks in our square. For example, to find the probability $P(
eg A)$ that $A$ doesn't occur, we just need to add up all the blocks where $
eg A$ happens: $P(
eg A) = P(
eg A, B) + P(
eg A,
eg B)$.

Here's the probability $P(A)$ of $A$, and the probability $P(
eg A)$ of $
eg A$:

Here's the probability $P(
eg B)$ of $
eg B$:

In these pictures we're dividing by the area of the whole square. Since the probability of anything at all happening is 1, we could just leave it out, but it'll be helpful for comparison while we think about conditionals next.

Conditional probabilities
===

We can start with some probability $P(B)$, and then *assume* that $A$ is true to get a [1rj conditional probability] $P(B \mid A)$ of $B$. Conditioning on $A$ being true is like restricting our whole attention to just the possible worlds where $A$ happens:

Then the conditional probability of $B$ given $A$ is the proportion of these $A$ worlds where $B$ also happens:

If instead we condition on $
eg A$, we get:

So our square visualization gives a nice way to see, at a glance, the conditional probabilities of $B$ given $A$ or given $
eg A$:

 We don't get such nice pictures for $P(A \mid B)$:

More on this next.

Factoring a distribution
===

Recall the square showing our joint distribution $P$:

Notice that in the above square, the reddish blocks for $P(A,B)$ and $P(A,
eg B)$ are the same width and form a column; and likewise the blueish blocks for $P(
eg A,B)$ and $P(
eg A,
eg B)$. This is because we chose to [factoring_probability factor] our probability distribution starting with $A$:

$$P(A,B) = P(A) P( B \mid A)\ .$$

Let's use the [event_variable_equivalence equivalence] between [event_probability events] and [binary_variable binary random variables], so if we say $P( B= 	rue \mid A= alse)$ we mean $P(B \mid
eg A)$. For any choice of truth values $t_A \in \{	rue, alse\}$ and $t_B \in \{	rue, alse\}$, we have

$$P(A = t_A,B= t_B) = P(A= t_A)\; P( B= t_B \mid A= t_A)\ .$$

The first factor $P(A = t_A)$ tells us how wide to make the red column $(P(A = 	rue))$ relative to the blue column $(P(A = alse))$. Then the second factor $P( B= t_B \mid A= t_A)$ tells us the proportions of dark $(B = 	rue)$ and light $(B = alse)$ within the column for $A = t_A$.

We could just as well have factored by $B$ first:

$$P(A = t_A,B= t_B) = P(B= t_B)\; P( A= t_A \mid B= t_b)\ .$$

Then we'd draw a picture like this:

By the way, earlier when we factored by $A$ first, we got simple pictures of the probabilities $P(B \mid A)$ for $B$ conditioned on $A$.  Now that we're factoring by $B$ first, we have simple pictures for the conditional probability $P(A \mid B)$:

and for the conditional probability $P(A \mid
eg B)$:

Computing joint probabilities from factored probabilities
===

Let's say we know the factored probabilities for $A$ and $B$, factoring by $A$. That is, we know $P(A = 	rue)$, and we also know $P(B = 	rue \mid A = 	rue)$ and $P(B = 	rue \mid A = alse)$. How can we recover the joint probability $P(A = t_A, B = t_B)$ that $A = t_A$ is the case and also $B = t_B$ is the case?

Since

$$P(B = alse \mid A = 	rue) = rac{P(A = 	rue, B = alse)}{P(A = 	rue)}\ ,$$

we can multiply the prior $P(A)$ by the conditional $P(
eg B \mid A)$ to get the joint $P(A,
eg B)$:

$$P(A = 	rue)\; P(B = alse \mid A = 	rue) = P(A = 	rue, B = alse)\ .$$

If we do this at the same time for all the possible truth values $t_A$ and $t_B$, we get back the full joint distribution:

[todo: information theory. a couple things, then point to another page. eg show example when two things have lots of mutual info.]


Symmetric group

The notion that group theory captures the idea of "symmetry" derives from the notion of the symmetric group, and the very important theorem due to Cayley that every group is a subgroup of a symmetric group.

# Definition

Let $X$ be a [-3jz]. A [499 bijection] $f: X 	o X$ is a *permutation* of $X$.
Write $\mathrm{Sym}(X)$ for the set of permutations of the set $X$ (so its elements are functions).

Then $\mathrm{Sym}(X)$ is a group under the operation of composition of functions; it is the *symmetric group on $X$*.
(It is also written $\mathrm{Aut}(X)$, for the *automorphism group*.)

We write $S_n$ for $\mathrm{Sym}(\{ 1,2, \dots, n\})$, the *symmetric group on $n$ elements*.

# Elements of $S_n$

We can represent a permutation of $\{1,2,\dots, n\}$ in two different ways, each of which is useful in different situations.

## Double-row notation

Let $\sigma \in S_n$, so $\sigma$ is a function $\{1,2,\dots,n\} 	o \{1,2,\dots,n\}$.
Then we write $$egin{pmatrix}1 & 2 & \dots & n \ \sigma(1) & \sigma(2) & \dots & \sigma(n) \ \end{pmatrix}$$
for $\sigma$.
This has the advantage that it is immediately clear where every element goes, but the disadvantage that it is quite hard to see the properties of an element when it is written in double-row notation (for example, "$\sigma$ cycles round five elements" is hard to spot at a glance), and it is not very compact.

## Cycle notation

[49f Cycle notation] is a different notation, which has the advantage that it is easy to determine an element's order and to get a general sense of what the element does.
Every element of $S_n$ [49k can be expressed in (disjoint) cycle notation in an essentially unique way].

## Product of transpositions

It is a useful fact that every permutation in a (finite) symmetric group [4cp may be expressed] as a product of [4cn transpositions].

# Examples

- The group $S_1$ is the group of permutations of a one-point set. It contains the identity only, so $S_1$ is the trivial group.
- The group $S_2$ is isomorphic to the [-47y] of order $2$. It contains the identity map and the map which interchanges $1$ and $2$.

Those are the only two [3h2 abelian] symmetric groups.
Indeed, in cycle notation, $(123)$ and $(12)$ do not commute in $S_n$ for $n \geq 3$, because $(123)(12) = (13)$ while $(12)(123) = (23)$.

- The group $S_3$ contains the following six elements: the identity, $(12), (23), (13), (123), (132)$. It is isomorphic to the [-4cy] $D_6$ on three vertices. ([group_s3_isomorphic_to_d6 Proof.])

# Why we care about the symmetric groups

A very important (and rather basic) result is [49b Cayley's Theorem], which states the link between group theory and symmetry.

%%%knows-requisite([4bj]):
# Conjugacy classes of $S_n$

It is a useful fact that the conjugacy class of an element in $S_n$ is precisely the set of elements which share its [4cg cycle type]. ([4bh Proof.])
We can therefore [4bk list the conjugacy classes] of $S_5$ and their sizes.
%%%

# Relationship to the [-4hf]

The [-4hf] $A_n$ is defined as the collection of elements of $S_n$ which can be made by an even number of [4cn transpositions]. This does form a group ([4hg proof]).

%%%knows-requisite([4h6]):
In fact $A_n$ is a [-4h6] of $S_n$, obtained by taking the quotient by the [4hk sign homomorphism].
%%%


Bijective function

A bijective function is a [-3jy] which has an inverse. Equivalently, it is both [injective_function injective] and [surjective_function surjective].


Cayley's Theorem on symmetric groups

Cayley's Theorem states that every group $G$ appears as a certain subgroup of the [-497] $\mathrm{Sym}(G)$ on the [-3gz] of $G$.

# Formal statement

Let $G$ be a group.
Then $G$ is [49x isomorphic] to a subgroup of $\mathrm{Sym}(G)$.

# Proof

Consider the left regular [3t9 action] of $G$ on $G$: that is, the function $G 	imes G 	o G$ given by $(g, h) \mapsto gh$.
This [49c induces a homomorphism] $\Phi: G 	o \mathrm{Sym}(G)$ given by [-currying]: $g \mapsto (h \mapsto gh)$.

Now the following are equivalent:

- $g \in \mathrm{ker}(\Phi)$ the [49y kernel] of $\Phi$
- $(h \mapsto gh)$ is the identity map
- $gh = h$ for all $h$
- $g$ is the identity of $G$

Therefore the kernel of the homomorphism is trivial, so it is injective.
It is therefore bijective onto its [3lh image], and hence an isomorphism onto its image.

Since [4b4 the image of a group under a homomorphism is a subgroup of the codomain of the homomorphism], we have shown that $G$ is isomorphic to a subgroup of $\mathrm{Sym}(G)$.


Group action induces homomorphism to the symmetric group

Just as we can [currying curry] functions, so we can "curry" [47t homomorphisms] and [3t9 actions].

Given an action $
ho: G 	imes X 	o X$ of group $G$ on set $X$, we can consider what happens if we fix the first argument to $
ho$. Writing $
ho(g)$ for the induced map $X 	o X$ given by $x \mapsto
ho(g, x)$, we can see that $
ho(g)$ is a [499 bijection].

Indeed, we claim that $
ho(g^{-1})$ is an inverse map to $
ho(g)$.
Consider $
ho(g^{-1})(
ho(g)(x))$.
This is precisely $
ho(g^{-1})(
ho(g, x))$, which is precisely $
ho(g^{-1},
ho(g, x))$.
By the definition of an action, this is just $
ho(g^{-1} g, x) =
ho(e, x) = x$, where $e$ is the group's identity.

We omit the proof that $
ho(g)(
ho(g^{-1})(x)) = x$, because it is nearly identical.

That is, we have proved that $
ho(g)$ is in $\mathrm{Sym}(X)$, where $\mathrm{Sym}$ is the [-497]; equivalently, we can view $
ho$ as mapping elements of $G$ into $\mathrm{Sym}(X)$, as well as our original definition of mapping elements of $G 	imes X$ into $X$.

# $
ho$ is a homomorphism in this new sense

It turns out that $
ho: G 	o \mathrm{Sym}(X)$ is a homomorphism.
It suffices to show that $
ho(gh) =
ho(g)
ho(h)$, where recall that the operation in $\mathrm{Sym}(X)$ is composition of permutations.

But this is true: $
ho(gh)(x) =
ho(gh, x)$ by definition of $
ho(gh)$; that is $
ho(g,
ho(h, x))$ because $
ho$ is a group action; that is $
ho(g)(
ho(h, x))$ by definition of $
ho(g)$; and that is $
ho(g)(
ho(h)(x))$ by definition of $
ho(h)$ as required.


Cycle notation in symmetric groups

There is a convenient way to represent the elements of a [-497] on a finite set.

# $k$-cycle

A $k$-cycle is a member of $S_n$ which moves $k$ elements to each other cyclically.
That is, letting $a_1, \dots, a_k$ be distinct in $\{1,2,\dots,n\}$, a $k$-cycle $\sigma$ is such that $\sigma(a_i) = a_{i+1}$ for $1 \leq i < k$, and $\sigma(a_k) = a_1$, and $\sigma(x) = x$ for any $x
ot \in \{a_1, \dots, a_k \}$.

We have a much more compact notation for $\sigma$ in this case: we write $\sigma = (a_1 a_2 \dots a_k)$.
(If spacing is ambiguous, we put in commas: $\sigma = (a_1, a_2, \dots, a_k)$.)
Note that there are several ways to write this: $(a_1 a_2 \dots a_k) = (a_2 a_3 \dots a_k a_1)$, for example.
It is conventional to put the smallest $a_i$ at the start.

Note also that a cycle's inverse is extremely easy to find: the inverse of $(a_1 a_2 \dots a_k)$ is $(a_k a_{k-1} \dots a_1)$.

For example, the double-row notation $$egin{pmatrix}1 & 2 & 3 \ 2 & 3 & 1 \ \end{pmatrix}$$
is written as $(123)$ or $(231)$ or $(312)$ in cycle notation.

However, it is unclear without context which symmetric group $(123)$ lies in: it could be $S_n$ for any $n \geq 3$.
Similarly, $(145)$ could be in $S_n$ for any $n \geq 5$.

# General elements, not just cycles

Not every element of $S_n$ is a cycle. For example, the following element of $S_4$ has [4cq order] $2$ so could only be a $2$-cycle, but it moves all four elements:
$$egin{pmatrix}1 & 2 & 3 & 4 \ 2 & 1 & 4 & 3 \ \end{pmatrix}$$

However, it may be written as the composition of the two cycles $(12)$ and $(34)$: it is the result of applying one and then the other.
Note that since the cycles are disjoint (having no elements in common), [49g it doesn't matter in which order we perform them].
It is a very important fact that [49k every permutation may be written as the product of disjoint cycles].
If $\sigma$ is a permutation obtained by first doing cycle $c_1 = (a_1 a_2 \dots a_k)$, then by doing cycle $c_2$, then cycle $c_3$, we write $\sigma = c_3 c_2 c_1$; this is by analogy with function composition, indicating that the first permutation to apply is on the rightmost end of the expression.
(Be aware that some authors differ on this.)

## Order of an element

Firstly, a cycle has [4cq order] equal to its length.
Indeed, the cycle $(a_1 a_2 \dots a_k)$ has the effect of rotating $a_1 \mapsto a_2 \mapsto a_3 \dots \mapsto a_k \mapsto a_1$, and if we do this $k$ times we get back to where we started.
(And if we do it fewer times - say $i$ times - we can't get back to where we started: $a_1 \mapsto a_{i+1}$.)

Now, suppose we have an element in disjoint cycle notation: $(a_1 a_2 a_3)(a_4 a_5)$, say, where all the $a_i$ are different.
Then the order of this element is $3 	imes 2 = 6$, because:

- $(a_1 a_2 a_3)$ and $(a_4 a_5)$ are disjoint and hence commute, so $[(a_1 a_2 a_3)(a_4 a_5)]^n = (a_1 a_2 a_3)^n (a_4 a_5)^n$
- $(a_1 a_2 a_3)^n (a_4 a_5)^n$ is the identity if and only if $(a_1 a_2 a_3)^n = (a_4 a_5)^n = e$ the identity, because otherwise (for instance, if $(a_1 a_2 a_3)^n$ is not the identity) it would move $a_1$.
- $(a_1 a_2 a_3)^n$ is the identity if and only if $n$ is divisible by $3$, since $(a_1 a_2 a_3)$'s order is $3$.
- $(a_4 a_5)^n$ is the identity if and only if $n$ is divisible by $2$.

This reasoning generalises: the order of an element in disjoint cycle notation is equal to the [-least_common_multiple] of the lengths of the cycles.

# Examples

- The element $\sigma$ of $S_5$ given by first performing $(123)$ and then $(345)$ is $(345)(123) = (12453)$. Indeed, the first application takes $1$ to $2$ and the second application does not affect the resulting $2$, so $\sigma$ takes $1$ to $2$; the first application takes $2$ to $3$ and the second application takes the resulting $3$ to $4$, so $\sigma$ takes $2$ to $4$; the first application does not affect $4$ and the second application takes $4$ to $5$, so $\sigma$ takes $4$ to $5$; and so on.

This example suggests a general procedure for expressing a permutation which is already in cycle form, in *disjoint* cycle form. It turns out that [49k this can be done in an essentially unique way].

## Cycle type

The [-4cg] is given by taking the list of lengths of the cycles in the disjoint cycle form.


Disjoint cycles commute in symmetric groups

[summary: In a symmetric group, if we are applying a collection of permutations which are each disjoint cycles, we get the same result no matter the order in which we perform the cycles.]

Consider two [49f cycles] $(a_1 a_2 \dots a_k)$ and $(b_1 b_2 \dots b_m)$ in the [-497] $S_n$, where all the $a_i, b_j$ are distinct.

Then it is the case that the following two elements of $S_n$ are equal:

- $\sigma$, which is obtained by first performing the permutation notated by $(a_1 a_2 \dots a_k)$ and then by performing the permutation notated by $(b_1 b_2 \dots b_m)$
- $	au$, which is obtained by first performing the permutation notated by $(b_1 b_2 \dots b_m)$ and then by performing the permutation notated by $(a_1 a_2 \dots a_k)$

Indeed, $\sigma(a_i) = (b_1 b_2 \dots b_m)[(a_1 a_2 \dots a_k)(a_i)] = (b_1 b_2 \dots b_m)(a_{i+1}) = a_{i+1}$ (taking $a_{k+1}$ to be $a_1$), while $	au(a_i) = (a_1 a_2 \dots a_k)[(b_1 b_2 \dots b_m)(a_i)] = (a_1 a_2 \dots a_k)(a_i) = a_{i+1}$, so they agree on elements of $(a_1 a_2 \dots a_k)$.
Similarly they agree on elements of $(b_1 b_2 \dots b_m)$; and they both do not move anything which is not an $a_i$ or a $b_j$.
Hence they are the same permutation: they act in the same way on all elements of $\{1,2,\dots, n\}$.

This reasoning generalises to more than two disjoint cycles, to show that disjoint cycles commute.


Disjoint cycle notation is unique

[todo: state and prove the theorem]


Pi

Pi, usually written $π$, is a number equal to the ratio of a circle's [-circumference] to its [-diameter]. The value of $π$ is approximately $3.141593$.

![](http://rlv.zcache.ca/mathematical_definition_of_pi_ceramic_tiles-r78c5d7b1adfa46d7b24e2c8bc3bb3f65_agtk1_8byvr_324.jpg)

If the length of a curve seems like an ill-defined concept to you (maybe you only understand how lines could have lengths), consider bigger and bigger [-regular_polygon regular polygons] that make better and better approximations of the circle. As the number of sides $N$ of the polygon goes to $∞$, the perimeter will approach a length of $π$ times the diameter.

One could also define $π$ to be the area of a circle divided the area of a square, whose edge is the radius of the circle.

## What Kind of Number It Is ##

It's not an [48l].

![](https://sensemadehere.files.wordpress.com/2015/03/pi.png?w=584)

If the diameter here is 1, then the perimeter of the hexagon is 3, the perimeter of the square is 4, and the circumference of the circle is in between. There are no integers between 3 and 4.

It's [not rational](https://en.wikipedia.org/wiki/Proof_that_%CF%80_is_irrational), [nor is it algebraic](https://en.wikipedia.org/wiki/Lindemann%E2%80%93Weierstrass_theorem#Transcendence_of_e_and_.CF.80). It's transcendental.


Complexity theory

[summary: Study of the computational resources needed to solve a problem, usually time and memory]

**Complexity theory** is the study of the efficiency of algorithms with respect to several metrics, usually time and memory usage. Complexity theorists aim to classify different problems into [complexity_class classes of difficulty] and study the relations that hold between the classes.

When studying [ computability], we are concerned with the identification of that which is or not computable in an ideal sense, without worrying about time or memory limitations.

However, often in practice we have to be more pragmatic. A program which takes a [42m googol] years to run is not going to see much use. If you need more [ GbBytes] to solve a computational problem that atoms exist in the universe, you may as well go ahead and declare the problem unsolvable for all practical purposes.

**Complexity theory** raises the standards of computability in drawing the boundary between that which you can do with a computer and that which you cannot. It concerns the study of the [oh_notation asymptotic behavior] of programs when fed inputs of growing size, in terms of the resources they consume. The kind of resources with which complexity theorists work more often are the *time* a program takes to finish and the highest *memory usage* %%note:the memory usage is frequently called **space complexity**%% in any given point of the execution.

Complexity theory allows us to have a deeper understanding of what makes an algorithm efficient, which in turn allows us to develop better and faster algorithms. Surprisingly enough, it turns out that proving that some computational problems are hard to solve has incredibly important practical applications in [-cryptography].

----

The abstract framework in which we develop this theory are [ Turing machines] and [ decision problems]. In this context, the [ time complexity] is associated with the number of steps a TM takes to halt and return an output, while the [ space complexity] corresponds to the length of the tape we would need for the TM to never fall off when moving left or right.

One may worry that the complexity measures are highly dependent on the choice of computational framework used. After all, if we allow our TM to skip two spaces per step each time it moves it is going to take potentially half the time to compute something. However, the asymptotic behavior of complexity is [robustness_of_tm surprisingly robust], though there are [failure_of_strong_CT some caveats].

The most interesting characterization of complexity comes in the form of [ complexity classes], which break down the family of [ decision problems] into sets of problems which can be solved with particular constraints.

Perhaps the most important complexity class is [ $P$], the class of decision problems which can be efficiently computed %%note:For example, checking whether a graph is connected or not%%. The second best known class is [ $NP$], the class of problems whose solutions can be easily checked %%note:An example is factoring a number: it is hard to factor $221$, but easy to multiply $13$ and $17$ and check that $13 \cdot 17 = 221$%% . It is an open problem whether those two classes are [4bd one and the same]; that is, that every problem whose solutions are easy to check is also easy to solve.

There are many more important complexity classes, and it can be daunting to contemplate the sheer variety with which complexity theory deals. Feel free to take a guided tour though the [4b9 complexity zoo] if you want an overview of some of the most relevant.

An important concept is that of a [ reduction]. Some complexity classes have problems such that if you were able to solve them efficiently you could translate other problems in the class to this one and solve them efficiently. Those are called [ complete problems of a complexity class].

-----

This page is meant to be a starting point to learn complexity theory from an entry level. If there is any concept which feels mysterious to you, try exploring the greenlinks in their order of appearance. If you feel like the concepts presented are too basic, try a different lens.


Group isomorphism

A group isomorphism is a [-47t] which is [499 bijective].
We say that two groups are *isomorphic* if there is an isomorphism between them.

It turns out that isomorphism is a much more useful concept than true equality of [-3gd groups], and it captures the idea that "these two objects are the same group": the isomorphism shows us how to relabel the elements to see that they are indeed the same group.

For example, the trivial group is in some sense "the only group with one element", but it can be instantiated in many different ways: as $(\{ a \}, +_a)$, or $(\{ b \}, +_b)$, and so on (where $+_x$ is the [-3kb] taking $(x, x)$ to $x$).
They all behave in exactly the same ways for the purpose of group theory, but they are not literally identical.
They are all isomorphic, though: the map $\{a \} 	o \{ b \}$ given by $a \mapsto b$ is an isomorphism of the respective groups.

Two groups are isomorphic if and only if they have the same [cayley_table Cayley table], possibly with rearrangement of rows/columns and with relabelling of elements.


Kernel of group homomorphism

The kernel of a [-47t] $f: G 	o H$ is the collection of all elements $g$ in $G$ such that $f(g) = e_H$ the identity of $H$.

It is important to note that the kernel of any group homomorphism $G 	o H$ is always a subgroup of $G$.
Indeed:

- if $f(g_1) = e_H$ and $f(g_2) = e_H$ then $e_H = f(g_1) f(g_2) = f(g_1 g_2)$, so the kernel is closed under $G$'s operation;
- if $f(x) = e_H$ then $e_H = f(e_G) = f(x^{-1} x) = f(x^{-1}) f(x) = f(x^{-1})$ (where we have used that [49z the image of the identity is the identity]), so inverses are contained in the putative subgroup;
- $f(e_G) = e_H$ because the image of the identity is the identity, so the identity is contained in the putative subgroup.

It turns out that the notion of "[-4h6]" coincides exactly with the notion of "kernel of homomorphism". ([4h7 Proof.])
The "kernel of homomorphism" viewpoint of normal subgroups is much more strongly motivated from the point of view of [-4c7]; Timothy Gowers [considers this to be the correct way](https://gowers.wordpress.com/2011/11/20/normal-subgroups-and-quotient-groups/) to introduce the teaching of normal subgroups in the first place.


Image of the identity under a group homomorphism is the identity

For any [-47t] $f: G 	o H$, we have $f(e_G) = e_H$ where $e_G$ is the identity of $G$ and $e_H$ the identity of $H$.

Indeed, $f(e_G) f(e_G) = f(e_G e_G) = f(e_G)$, so premultiplying by $f(e_G)^{-1}$ we obtain $f(e_G) = e_H$.


Under a group homomorphism, the image of the inverse is the inverse of the image

For any [-47t] $f: G 	o H$, we have $f(g^{-1}) = f(g)^{-1}$.

Indeed, $f(g^{-1}) f(g) = f(g^{-1} g) = f(e_G) = e_H$, and similarly for multiplication on the left.


The image of a group under a homomorphism is a subgroup of the codomain

Let $f: G 	o H$ be a [-47t], and write $f(G)$ for the set $\{ f(g) : g \in G \}$.
Then $f(G)$ is a group under the operation inherited from $H$.

# Proof

To prove this, we must verify the group axioms.
Let $f: G 	o H$ be a group homomorphism, and let $e_G, e_H$ be the identities of $G$ and of $H$ respectively.
Write $f(G)$ for the image of $G$.

Then $f(G)$ is closed under the operation of $H$: since $f(g) f(h) = f(gh)$, so the result of $H$-multiplying two elements of $f(G)$ is also in $f(G)$.

$e_H$ is the identity for $f(G)$: it is $f(e_G)$, so it does lie in the image, while it acts as the identity because $f(e_G) f(g) = f(e_G g) = f(g)$, and likewise for multiplication on the right.

Inverses exist, by "the inverse of the image is the image of the inverse".

The operation remains associative: this is inherited from $H$.

Therefore, $f(G)$ is a group, and indeed is a subgroup of $H$.


Expected value

The expected value of an action is the [-mean] numerical outcome of the possible results weighted by their [-1rf]. It may actually be impossible to get the expected value, for example, if a coin toss decides between you getting \$0 and \$10, then we say you get "\$5 in expectation" even though there is no way for you to get \$5.

The expectation of V (often shortened to "the expected V") is how much V you expect to get on average. For example, the expectation of a payoff, or an expected payoff, is how much money you will get on average; the expectation of the duration of a speech, or an expected duration, is how long the speech will last "on average."

Suppose V has discrete possible values, say $V = x_{1},$ or $V = x_{2}, ..., $ or $V = x_{k}$. Let $P(x_{i})$ refer to the probability that $V = x_{i}$. Then the expectation of V is given by:

$$\sum_{i=1}^{k}x_{i}P(x_{i})$$

Suppose V has continuous possible values, x. For instance, let $x \in \mathbb{R}$. Let $P(x)$ be the continuous probability distribution, or $\lim_{dx 	o 0}$ of the probability that $x<V<(x+dx)$ divided by $dx$. Then the expectation of V is given by:

$$\int_{-∞}^{∞}xP(x)dx$$

## Importance ##

A common principle of reasoning under uncertainty is that if you are trying to achieve a good G, you should choose the act that maximizes the expectation of G.


The composition of two group homomorphisms is a homomorphism

Given two [47t group homomorphisms] $f: G 	o H$ and $g: H 	o K$, the composition $gf: G 	o K$ is also a homomorphism.

To prove this, note that $g(f(x)) g(f(y)) = g(f(x) f(y))$ since $g$ is a homomorphism; that is $g(f(xy))$ because $f$ is a homomorphism.


Injective function

A [-3jy] $f: X 	o Y$ is *injective* if it has the property that whenever $f(x) = f(y)$, it is the case that $x=y$. Given an element in the [3lm image], it came from applying $f$ to exactly one element of the [3js domain].

This concept is also commonly called being "one-to-one".
That can be a little misleading to someone who does not already know the term, however, because many people's natural interpretation of "one-to-one" (without otherwise having learnt the term) is that every element of the domain is matched up in a one-to-one way with *every* element of the domain, rather than simply with *some* element of the domain.
That is, a rather natural way of interpreting "one-to-one" is as "[499 bijective]" rather than "injective".

# Examples

- The function $\mathbb{N} 	o \mathbb{N}$ (where $\mathbb{N}$ is the set of [-45h natural numbers]) given by $n \mapsto n+5$ is injective: since $n+5 = m+5$ implies $n = m$. Note that this function is not [4bg surjective]: there is no natural number $k$ such that $k+5 = 2$, for instance, so $2$ is not in the range of the function.
- The function $f: \mathbb{N} 	o \mathbb{N}$ given by $f(n) = 6$ for all $n$ is not injective: since $f(1) = f(2)$ but $1
ot = 2$, for instance.


Complexity theory: Complexity zoo

Welcome, visitor! Get ready to exercise your sense of wonder and expand your mind on the **zoo of complexity**.

That where are the cages of the animals, you ask? No cage could contain our specimens, I must say. But you can get a glimpse of their nature through the chalky definitions in each of those blackboards. Where shall we go first?

----

Oh yes! [ $P$], the class of problems solvable in polynomial time. A popular creature in our installations. It is commonly accepted that this  class encompasses the problems which can be solved efficiently. Now, bear in mind that the classes in this zoo only classify problems attending to how fast the computational power you need to solve them grows compared to the size of the problem you are solving! That means, even if all grow at the same polynomial pace, some of the problems who lurk inside this class need a huge overload of resources from the very beginning, which makes them intractable! Not to talk about the multiplicative factor, which also gets ignored in making this distinction between classes, or the degree of the polynomial which upper bounds the function! Beliefs like that $x$ grows as fast as $1000 x^{42}+10^{100}$ can be misleading if not properly understood.

However, in practice such instances are rare, and $P$ is still used thorough all computer science as a synonym of efficiency - though they pay special attention to the degree and distinguish between functions in $\mathcal{O}(n)$ and functions in $\mathcal{O}(n*log(n))$, even though all programs associated fall within $P$.

----

The next creature is without a doubt the most famous of the zoo! Meet [ $NP$], the class of problems whose solution are easily checkable. This little creature is the responsible of modern cryptography, which relies on [one_way_functions functions easy to compute but hard to invert].

$NP$ also is the main star, together with $P$, of one great show in the zoo. Oh, look! It is about to start!...

*Announcer*: Ladies, gentlemen and children who are today with us! We present to you the main attraction of our bestiary, the infamous [ $P$ vs $NP$]!

*Announcer*: You may already have seen both of those creatures, but are they two different beasts? Or only two aspects of the same thing?

*Announcer*: Look again at them, and realize. If finding a solution to a problem is easy, then checking whether a given solution is true is also easy! You can always just find the solution again from scratch and check that both coincide. So we conclude that $P\subset NP$. Can the reverse inclusion be true as well?

*Announcer*: Imagine for a moment! The hard problems of creativity, solved at once through the clever application of an efficient algorithm! [Entscheidungsproble Automated short proof writing]! Instant reversal of one way functions!

*Announcer*: However, we suspect that they are different, though a proof has remained elusive through the years.

(the public cries: If we have been searching for decades for such a proof and none has been found then you should revise your beliefs and update against that! Why suspect otherwise?)

*Announcer*: We seem to have an exceptionally well educated audience today! Then again, we have been also on the search for a proof of the opposite without fruition. Why give this fact more weight in the Bayesian scheme of the things? There happens to be a somewhat convoluted reason for this. For if $P=NP$, then we would expect proofs to be easier to find, while if $P!=NP$ the opposite is true! So it only makes sense that is more probable that we live in the world where $P!=NP$%%note:For a formalization of this notion check [ natural proofs]. Also, see [4bf Arguments against $P=NP$]%%!

*Announcer*: And that's all for today, folks. Keep enjoying your visit though the zoo!

---

(To be continued)


Real number

A **real number** is any number that can be used to represent a physical quantity.

Intuitively, real numbers are any number that can be found between two [48l integers], such as $0,$ $1,$ $-1,$ $rac{3}{2},$ $rac{-7}{2},$ [49r $\pi,$] [e $e$], $100 \cdot \sqrt{2},$ and so on. The set of real numbers is written $\mathbb R.$ You can think of $\mathbb R$ as [4zq $\mathbb Q$] extended to include the [54z irrational numbers] like $\pi$ and $e$ which can be found between rational numbers but which cannot be completely written out in [-4sl].

## Definitions of the real numbers

The most commonly used definitions of the real numbers are constructions as extensions of the [4zq rational numbers], which involve either [53b Cauchy sequences] or [dedekind_cut Dedekind cuts].

### Cauchy sequences

Broadly speaking, a Cauchy sequence is a sequence where as the sequence goes on, all the elements past that point get closer and closer together. In the real numbers, every Cauchy sequence [convergence_analysis converges] to a real number. However, in the set of rational numbers, not all Cauchy sequences converge to a rational number.
In the set of rationals, a Cauchy sequence which does not converge to a rational number cannot really be said to "converge" at all: the set of rationals is "missing some of the points" that would be required to make every Cauchy sequence converge.

For example, the sequence of fractions of consecutive Fibonacci numbers $1/1, 2/1, 3/2, 5/3, 8/5, \ldots$ gets closer and closer to $rac{1 + \sqrt{5}}{2}$, but cannot be said to converge to that number because it is not in the set of rational numbers.

For each of these non-convergent Cauchy sequences, we define a new irrational number to "fill in the gap", and for the Cauchy sequences that do converge, we define a real number equal to that rational number.

### Dedekind cuts

A Dedekind cut of a [-540] is a [-partition] of that set into two sets so that every element in the first set is [ less than] every element in the second set, and the second set has no smallest element. The latter restriction requires that the set also be a [ perfect set] (have no [isolated_point isolated points]), in the sense used in topology.

In the real numbers, such a partition will always have the first set having a greatest element, which is known as the least-upper-bound property. However, in the rational numbers, we might come across a partition where the first set does not have such an element.

For example, define a Dedekind cut $(A, B)$ of the rational numbers such that $B = \{x \in \mathbb{Q} \ | \ x > 0 \wedge x^2 > 2\}$ and $A$ is the complement of $B$. In plainer language, $B$ consists of all the numbers greater than $\sqrt{2}$, but because $\sqrt{2}$ doesn't exist in the space of rational numbers, we can't use that to formulate our definition. Obviously every element of $A$ is less than every element of $B$, but $A$ has no greatest element either, because we can create a sequence of numbers in $A$ that gets bigger and bigger (as it approaches $\sqrt{2}$) but never stops at a maximum value.

For each of these "strict cuts" where neither set has a "boundary element", we define a new irrational number to "fill in the gap", just like with the Cauchy sequences. For the Dedekind cuts where one of the sets does have a least or greatest element, we define a real number equal to that rational number.

This definition has the advantage that each real number is represented by a unique Dedekind cut, unlike the Cauchy sequences where multiple sequences can converge to the same number.


P vs NP

[summary: Are problems with solutions easy to check also easy to solve? ]

The greatest currently open problem in complexity theory and computer science in general, which talks about the relationship between the class of efficiently solvable problems, [ $P$], and the class of problems with easily checkable solutions, [ $NP$].

It is a basic result that [ $P\subseteq NP$]. However, we still do not know whether the reverse implication, $P \supseteq NP$, holds.

A positive, constructive result would have profound implications through all the fields of science and math, not to mention the whole of society.


P vs NP: Arguments against P=NP

[summary:

 - Proving $P
eq NP$ is harder if true than proving $P=NP$ if true.
 - After 50 years we haven't found any efficient algorithm for $NP$-complete problems.
 - The polynomial hierarchy is compared to the arithmetical hierarchy, and the analogy implies $P
eq NP$
]

#Natural proofs
If $P
eq NP,$ then there are results showing that lower bounds in complexity are inherently harder to prove in a [natural_proof technical yet natural sense]. In other words, if $P
eq NP$ then proving $P
eq NP$ is hard.

The opposite proposition for $P=NP$ is also expected to be true. That is, it would make sense that if $P=NP,$ then it should be easier to prove, since we could build far more efficient [ theorem provers].

#Empirical argument
We have been trying to get a fast algorithm for [ $NP$-complete] problems since the 70s, without success. And take into account that "we" does not only comprise a minor group of theoretical computer scientists, but a whole industry trying to get faster algorithms for commercial purposes.

One could also argue more weakly that if $P=NP$, then evolution could have made use of this advantage to sped up its search process, or create more efficient minds to solve $NP$-complete problems at thoughtspeed.

#The arithmetical hierarchy argument
Some authors have drawn an analogy between the [ polynomial hierarchy] and the [1mg arithmetical hierarchy].

There are results showing that the [ arithmetical hierarchy is strict], and if the analogy holds then we would have that the polynomial hierarchy is strict as well, [collapse_of_the_polynomial_hierarchy which automatically implies $P
eq NP$].


Surjective function

A function $f:A 	o B$ is *surjective* if every $b \in B$ has some $a \in A$ such that $f(a) = b$.
That is, its [3lg codomain] is equal to its [3lh image].

This concept is commonly referred to as being "onto", as in "The function $f$ is onto."

# Examples

- The function $\mathbb{N} 	o \{ 6 \}$ (where $\mathbb{N}$ is the set of [45h natural numbers]) given by $n \mapsto 6$ is surjective. However, the same function viewed as a function $\mathbb{N} 	o \mathbb{N}$ is not surjective, because it does not hit the number $4$, for instance.
- The function $\mathbb{N} 	o \mathbb{N}$ given by $n \mapsto n+5$ is *not* surjective, because it does not hit the number $2$, for instance: there is no $a \in \mathbb{N}$ such that $a+5 = 2$.


Conjugacy class is cycle type in symmetric group

In the [-497] on a finite set, the [-4bj] of an element is determined exactly by its [4cg cycle type].

More precisely, two elements of $S_n$ are [group_conjugate conjugate] in $S_n$ if and only if they have the same cycle type.

# Proof

## Same conjugacy class implies same cycle type
Suppose $\sigma$ has the cycle type $n_1, \dots, n_k$; write $$\sigma = (a_{11} a_{12} \dots a_{1 n_1})(a_{21} \dots a_{2 n_2}) \dots (a_{k 1} a_{k 2} \dots a_{k n_k})$$
Let $	au \in S_n$.

Then $	au \sigma 	au^{-1}(	au(a_{ij})) = 	au \sigma(a_{ij}) = a_{i (j+1)}$, where $a_{i (n_i+1)}$ is taken to be $a_{i 1}$.

Therefore $$	au \sigma 	au^{-1} = (	au(a_{11}) 	au(a_{12}) \dots 	au(a_{1 n_1}))(	au(a_{21}) \dots 	au(a_{2 n_2})) \dots (	au(a_{k 1}) 	au(a_{k 2}) \dots 	au(a_{k n_k}))$$
which has the same cycle type as $\sigma$ did.

## Same cycle type implies same conjugacy class

Suppose $$\pi = (b_{11} b_{12} \dots b_{1 n_1})(b_{21} \dots b_{2 n_2}) \dots (b_{k 1} b_{k 2} \dots b_{k n_k})$$
so that $\pi$ has the same cycle type as the $\sigma$ from the previous direction of the proof.

Then define $	au(a_{ij}) = b_{ij}$, and insist that $	au$ does not move any other elements.

Now $	au \sigma 	au^{-1} = \pi$ by the final displayed equation of the previous direction of the proof, so $\sigma$ and $\pi$ are conjugate.

# Example
This result makes it rather easy to [4bk list the conjugacy classes] of $S_5$.


Conjugacy class

Given an element $g$ of a [-3gd] $G$, the conjugacy class of $g$ in $G$ is $\{ x g x^{-1} : x \in G \}$.
It is the collection of elements to which $g$ is [4gk conjugate].

[todo: examples]
[todo: class equation]
[todo: it is the stabiliser of a certain action, which we can show conditionally on the right requisites]


Conjugacy classes of the symmetric group on five elements

The [-497] $S_5$ on five generators has size $5! = 120$ (where the exclamation mark denotes the [-factorial] function).
By the result that [4bh in a symmetric group, conjugacy classes coincide with cycle types], we can list the conjugacy classes of $S_5$ easily.

# The table

$$egin{array}{|c|c|c|c|}
\hline
	ext{Representative}& 	ext{Size of class} & 	ext{Cycle type} & 	ext{Order of element} \ \hline
(12345) & 24 & 5 & 5 \ \hline
(1234) & 30 & 4,1 & 4 \ \hline
(123) & 20 & 3,1,1 & 3 \ \hline
(123)(45) & 20 & 3,2 & 6 \ \hline
(12)(34) & 15 & 2,2,1 & 2 \ \hline
(12) & 10 & 2,1,1,1 & 2 \ \hline
e & 1 & 1,1,1,1,1 & 1 \ \hline
\end{array}$$

# Determining the list of cycle types and sizes

There are five elements to permute; we need to find all the possible ways of grouping them up into disjoint cycles.
We will go through this systematically.
Note first that since there are only five elements to permute, there cannot be any element with a $6$-cycle or higher.

## Those with largest cycle of length $5$

If there is a $5$-cycle, then it permutes everything, so its [4cg cycle type] is $5$.
That is, we can take a representative $(12345)$, and this is the only conjugacy class with a $5$-cycle.

Recall that every cycle of length $5$ may be written in five different ways: $(12345)$ or $(23451)$ or $(34512)$, and so on.
Without loss of generality, we may assume $1$ comes at the start (by cycling round the permutation if necessary).

Then there are $4!$ ways to fill in the remaining slots of the cycle (where the exclamation mark denotes the [-factorial] function).

Hence there are $24$ elements of this conjugacy class.

## Those with largest cycle of length $4$

If there is a $4$-cycle, then it permutes everything except one element, so its cycle type must be $4,1$ (abbreviated as $4$).
That is, we can take a representative $(1234)$, and this is the only conjugacy class with a $4$-cycle.

Either the element $1$ is permuted by the $4$-cycle, or it is not.

- In the first case, we have $4$ possible ways to pick the image $a$ of $1$; then $3$ possible ways to pick the image $b$ of $a$; then $2$ possible ways to pick the image $c$ of $b$; then $c$ must be sent back to $1$.
That is, there are $4 	imes 3 	imes 2 = 24$ possible $4$-cycles containing $1$.
- In the second case, the cycle does not contain $1$, so there are $3$ possible ways to pick the image $a$ of $2$; then $2$ possible ways to pick the image $b$ of $a$; then $1$ possible way to pick the image $c$ of $b$; then $c$ must be sent back to $2$.
So there are $3 	imes 2 	imes 1 = 6$ possible $4$-cycles not containing $1$.

This comes to a total of $30$ possible $4$-cycles in this conjugacy class.

## Those with largest cycle of length $3$

Now we have two possible conjugacy classes: $3,1,1$ and $3,2$.

### The $3,1,1$ class

An example representative for this class is $(123)$.

We proceed with a slightly different approach to the $4,1$ case.
Using the notation for the [-binomial_coefficient], we have $inom{5}{3} = 10$ possible ways to select the numbers which appear in the $3$-cycle.
Each selection has two distinct ways it could appear as a $3$-cycle: the selection $\{1,2,3\}$ can appear as $(123)$ (or the duplicate cycles $(231)$ and $(312)$), or as $(132)$ (or the duplicate cycles $(321)$ or $(213)$).

That is, we have $2 	imes 10 = 20$ elements of this conjugacy class.

### The $3,2$ class

An example representative for this class is $(123)(45)$.

Again, there are $inom{5}{3} = 10$ possible ways to select the numbers which appear in the $3$-cycle; having made this selection, we have no further choice about the $2$-cycle.

Given a selection of the elements of the $3$-cycle, as before we have two possible ways to turn it into a $3$-cycle.

We are also given the selection of the elements of the $2$-cycle, but there is no choice about how to turn this into a $2$-cycle because, for instance, $(12)$ is equal to $(21)$ as cycles.
So this time the selection of the elements of the $3$-cycle has automatically determined the corresponding $2$-cycle.

Hence there are again $2 	imes 10 = 20$ elements of this conjugacy class.

## Those with largest cycle of length $2$

There are two possible cycle types: $2,2,1$ and $2,1,1,1$.

### The $2,2,1$ class

An example representative for this class is $(12)(34)$.

There are $inom{5}{2}$ ways to select the first two elements; then once we have done so, there are $inom{3}{2}$ ways to select the second two.
Having selected the elements moved by the first $2$-cycle, there is only one distinct way to make them into a $2$-cycle, since (for example) $(12)$ is equal to $(21)$ as permutations; similarly the selection of the elements determines the second $2$-cycle.

However, this time we have double-counted each element, since (for example) the permutation $(12)(34)$ is equal to $(34)(12)$ by the result that [49g disjoint cycles commute].

Therefore there are $inom{5}{2} 	imes inom{3}{2} / 2 = 15$ elements of this conjugacy class.

### The $2,1,1,1$ class

An example representative for this class is $(12)$.

There are $inom{5}{2}$ ways to select the two elements which this cycle permutes.
Once we have selected the elements, there is only one distinct way to put them into a $2$-cycle, since (for example) $(12)$ is equal to $(21)$ as permutations.

Therefore there are $inom{5}{2} = 10$ elements of this conjugacy class.

## Those with largest cycle of length $1$

There is only the identity in this class, so it is of size $1$.


Church-Turing thesis

[summary:Every [-effectively_computable] [-3jy] is [Turing_machine Turing-computable].]

The **Church-Turing thesis** (often abbreviated **CT thesis**) states:
> Every effectively computable function is Turing-computable

That is, for every function which can be computed by physical means %%note:So no [ hypercomputers]%% there exists a [ Turing machine] which computes exactly that.

The Church-Turing thesis is not a definite mathematical statement, but an inductive statement which affirms that every sensible model of computation we can come up with is equivalent or at least [reduction reducible] to the model proposed by Turing. Thus, we cannot prove it in a mathematical sense, but we can [ gather evidence for it].

For example, this model was proven to coincide with Church's lambda calculus, another universal model of computation, and the equivalence between Church's lambda calculus and Turing's automatic machines is often taken as [4j7 evidence] that they correctly capture our intuition of "effectively computable".

There are many [ consequences] of the CT thesis for computer science in general, artificial intelligence, [11w epistemology], and other fields of knowledge.


Properties of the logarithm

[summary:

- $\log_b(x \cdot y) = \log_b(x) + \log_b(y)$ for any $b$, this is the defining characteristic of logarithms.
- $\log_b(1) = 0,$ because $\log_b(1) = \log_b(1 \cdot 1) = \log_b(1) + \log_b(1).$
- $\log_b\left(\frac{1}{x}\right) = -\log_b(x),$ because $\log_b(1) = \log_b\left(x \cdot \frac{1}{x}\right) = \log_b(x) + \log_b\left(\frac{1}{x}\right) = 0.$
- $\log_b\left(\frac{x}{y}\right) = \log_b(x) - \log_b(y),$ which follows immediately from the above.
- $\log_b\left(x^n\right) = n \cdot \log_b(x),$ because $x^n$ = $\underbrace{x \cdot x \cdot \ldots x}_{n\text{ times}}$.
- $\log_b\left(\sqrt[n]{x}\right) = \frac{\log_b(x)}{n},$ because $\log_b(x) = \log_b\left((\sqrt[n]{x})^n\right) = n \cdot \log_b(\sqrt[n]{x}).$
- For every $f$ that satisfies $f(x \cdot y) = f(x) + f(y)$ for all $x, y \in \mathbb R^+,$ either $f$ sends every input to 0 or there exists some $b$ such that $f(b) = 1,$ in which case we call $f$ $\log_b.$ Thus, $\log_b(b) = 1.$
- $\log_b(b^n) = n,$ because $\log_b(x^n) = n \log_b(x)$ and $\log_b(b) = 1.$
]

With a [45q solid interpretation of logarithms] under our belt, we are now in a position to look at the basic properties of the logarithm and understand what they are saying. The defining [47k characteristic of logarithm functions] is that they are [-real_valued] functions $f$ such that

__Property 1: Multiplying inputs adds outputs.__
$$
f(x \cdot y) = f(x) + f(y) \tag{1}
$$
for all $x, y \in$ [positive_reals $\mathbb R^+$]. This says that whenever the input grows (or shrinks) by a factor of $y$, the output goes up (or down) by only a fixed amount, which depends on $y$. In fact, equation (1) alone tells us quite a bit about the behavior of $f,$ and from it, we can _almost_ guarantee that $f$ is a logarithm function. First, let's see how far we can get using equation (1) all by itself:

---

__Property 2: 1 is mapped to 0.__
$$
f(1) = 0. \tag{2}
$$

This says that the amount the output changes if the input grows by a factor of 1 is zero — i.e., the output does not change if the input changes by a factor of 1. This is obvious, as "the input changed by a factor of 1" means "the input did not change."

__Exercise:__ Prove (2) from (1).
%%hidden(Proof):
$$f(x) = f(x \cdot 1) = f(x) + f(1),\text{ so }f(1) = 0.$$
%%

---

__Property 3: Reciprocating the input negates the output.__
$$
f(x) = -f\left(\frac{1}{x}\right). \tag{3}
$$

This says that the way that growing the input by a factor of $x$ changes the output is exactly the opposite from the way that shrinking the input by a factor of $x$ changes the output. In terms of the "communication cost" interpretation, if doubling (or tripling, or $n$-times-ing) the possibility space increases costs by $c$, then halving (or thirding, or $n$-parts-ing) the space decreases costs by $c.$

__Exercise:__ Prove (3) from (2) and (1).
%%hidden(Proof):
$$x \cdot \frac{1}{x} = 1,\text{ so }f(1) = f\left(x \cdot \frac{1}{x}\right) = f(x) + f\left(\frac{1}{x}\right).$$

$$f(1)=0,\text{ so }f(x)\text{ and }f\left(\frac{1}{x}\right)\text{ must be opposites.}$$
%%

---

__Property 4: Dividing inputs subtracts outputs.__

$$
f\left(\frac{x}{y}\right) = f(x) - f(y). \tag{4}
$$

This follows immediately from (1) and (3).

__Exercise:__ Give an interpretation of (4).
%%hidden(Interpretation):
There are at least two good interpretations:

1. $f\left(x \cdot \frac{1}{y}\right) = f(x) - f(y),$ i.e., shrinking the input by a factor of $y$ is the opposite of growing the input by a factor of $y.$
2. $f\left(z \cdot \frac{x}{y}\right) = f(z) + f(x) - f(y),$ i.e., growing the input by a factor of $\frac{x}{y}$ affects the output just like growing the input by $x$ and then shrinking it by $y.$

Try translating these into the communication cost interpretation if it is not clear why they're true.
%%

---

__Property 5: Exponentiating the input multiplies the output.__

$$
f\left(x^n\right) = n \cdot f(x). \tag{5}
$$

This says that multiplying the input by $x$, $n$ times incurs $n$ identical changes to the output. In terms of the communication cost metaphor, this is saying that you can emulate an $x^n$ digit using $n$ different $x$-digits.

__Exercise:__ Prove (5).
%%hidden(Proof):
This is easy to prove when $n \in \mathbb N:$
$$f\left(x^n\right) = f(\underbrace{x \cdot x \cdot \ldots x}_{n\text{ times}}) = \underbrace{f(x) + f(x) + \ldots f(x)}_{n\text{ times}} = n \cdot f(x).$$

For $n \in \mathbb Q,$ this is a bit more difficult; we leave it as an exercise to the reader. Hint: Use the proof of (6) below, for $n \in \mathbb N,$ to bootstrap up to the case where $n \in \mathbb Q.$

For $n \in \mathbb R,$ this is actually _not_ provable from (1) alone; we need an additional assumption (such as [-continuity]) on $f$.
%%

Property 5 is actually _false,_ in full generality — it's possible to create a function $f$ that obeys (1), and obeys (5) for $n \in \mathbb Q,$ but which exhibits pathological behavior on irrational numbers. For more on this, see [ pathological near-logarithms].

This is the first place that property (1) fails us: 5 is true for $n \in \mathbb Q,$ but if we want to guarantee that it's true for $n \in \mathbb R,$ we need $f$ to be [continuity continuous], i.e. we need to ensure that if $f$ follows 5 on the rationals it's not allowed to do anything insane on irrational numbers only.

---

__Property 6: Rooting the input divides the output.__

$$
f(\sqrt[n]{x}) = \frac{f(x)}{n}. \tag{6}
$$

This says that, to change the output one $n$th as much as you would if you multiplied the input by $x$, multiply the input by the $n$th root of $x$. See [44l] for a physical interpretation of this fact.

__Exercise:__ Prove (6).
%%hidden(Proof):
$$(\sqrt[n]{x})^n = x,\text{ so }f\left((\sqrt[n]{x})^n\right)\text{ has to equal }f(x).$$

$$f\left((\sqrt[n]{x})^n\right) = n \cdot f(\sqrt[n]{x}),\text{ so }f(\sqrt[n]{x}) = \frac{f(x)}{n}.$$
%%

As with (5), (6) is always true if $n \in \mathbb Q,$ but not necessarily always true if $n \in \mathbb R.$ To prove (6) in full generality, we additionally require that $f$ be continuous.

---

__Property 7: The function is either trivial, or sends some input to 1.__

$$
\text{Either $f$ sends all inputs to $0$, or there exists a $b \neq 1$ such that $f(b)=1.$}\tag{7}
$$

This says that either $f$ is very boring (and does nothing regardless of its inputs), or there is some particular factor $b$ such that when the input changes by a factor of $b$, the output changes by exactly $1$. In the communication cost interpretation, this says that if you're measuring communication costs, you've got to pick some unit (such as $b$-digits) with which to measure.

__Exercise:__ Prove (7).
%%%hidden(Proof):
Suppose $f$ does not send all inputs to $0$, and let $x$ be an input that $f$ sends to some $y \neq 0.$ Then $f(\sqrt[y]{x}) = \frac{f(x)}{y} = 1.$%%note: You may be wondering, "what if $y$ is negative, or a fraction?" If so, see [ Strange roots]. Short version: $\sqrt[-3/4]{x}$ is perfectly well-defined.%%

$b$ is $\sqrt[y]{x}.$ We know that $b \neq 1$ because $f(b) = 1$ whereas, by (2), $f(1) = 0$.
%%%

---

__Property 8: If the function is continuous, it is either trivial or a logarithm.__

$$
\text{If $f(b)=1$ then } f(b^x) = x. \tag{8}
$$

This property follows immediately from (5). Thus, (8) is always true if $x$ is a [4zq rational], and if $f$ is continuous then it's also true when $x$ is irrational.

Property (8) states that if $f$ is non-trivial, then it inverts [4ts exponentials] with base $b.$ In other words, $f$ counts the number of $b$-factors in $x$. In other words, $f$ counts how many times you need to multiply $1$ by $b$ to get $x$. In other words, $f = \log_b$!

---

Many texts take (8) to be the defining characteristic of the logarithm. As we just demonstrated, one can also define logarithms by (1) as [continuity continuous] [trivial_mathematics non-trivial] functions whose outputs grow by a constant (that depends on $y$) whenever their inputs grow by a factor of $y$. All other properties of the logarithm follow from that.

If you want to remove the "continuous" qualifier, you're still fine as long as you stick to [4zq rational] inputs. If you want to remove the "non-trivial" qualifier, you can interpret the function $z$ that sends everything to zero as [4c8 $\log_\infty$]. Allowing $\log_\infty$ and restricting ourselves to rational inputs, _every_ function $f$ that satisfies equation (1) is [4f4 isomorphic] to a logarithm function.

In other words, if you find a function whose output changes by a constant (that depends on $y$)  whenever its input grows by a factor of $y$, there is basically only one way it can behave. Furthermore, that function only has one degree of freedom — the choice of $b$ such that $f(b)=1.$ As we will see next, even that degree of freedom is rather paltry: All logarithm functions behave in essentially the same way. As such, if we find any $f$ such that $f(x \cdot y) = f(x) + f(y)$ (or any physical process well-modeled by such an $f$), then we immediately know quite a bit about how $f$ behaves.


Category theory

[summary:
**Category theory** studies the abstraction of mathematical objects (such as [3jz sets], [3gd groups], and [topology topological spaces]) in terms of the [4d8 morphisms] between them. ]

[summary(technical):
A **[-4cx category]** consists of a
collection of [-object_category_theory objects] and a collection of [-4d8 morphisms] (also called arrows). To each morphism $f$ is associated a pair of objects: $	ext{dom}(f)$ which is the **source** or [domain_of_function **domain**] and $	ext{cod}(f)$ which is the **target** or [codomain_of_function **codomain**] of $f$. If $	ext{dom}(f) = X$ and $	ext{cod}(f) = Y$, this is written $f: X
ightarrow Y$.

These morphisms must satisfy three conditions:

 1. [Composition_of_functions **Composition**]: For any two morphisms $f: X
ightarrow Y$ and $g: Y
ightarrow Z$, there exists a morphism $X
ightarrow Z$, written as $g \circ f$ or simply $gf$.
 2. [3h4 **Associativity**]: For any morphisms $f: X
ightarrow Y$, $g: Y
ightarrow Z$ and $h:Z
ightarrow W$  composition is associative, i.e., $h(gf) = (hg)f$.
 3. [identity_map **Identity**]: For any object $X$, there is a (unique) morphism, $1_X : X
ightarrow X$ which, when composed with another morphism, leaves it unchanged. I.e., given $f:W
ightarrow X$ and $g:X
ightarrow Y$ it holds that: $1_X f = f$ and $g 1_X = g$.
]

[summary(motivation):
Many mathematical constructions (such as [-product_mathematics products]) appear across different fields of mathematics, consisting of different ingredients but nevertheless capturing a similar idea (and often even under the same name). Category theory allows one to precisely describe the property that these different constructions all at once. This allows one to prove [-theorem theorems] about all these structures at once. Hence, once you prove that a specific mathematical structure is, say, a product, then all the category-theoretic theorems about products are true for that structure. In fact, sometimes there are structures which non-obviously satisfy a category-theoretic property. Especially when [duality_category_theory category-theoretic duality] is involved.

In addition, category theory allows the simple description of [-functor functors], [-natural_transformation natural transformations] and [-adjunction adjunctions]. These are mathematically powerful concepts which are very difficult to describe without the language of category theory. In fact, one of the founders of category theory, [Saunders Mac Lane](https://en.wikipedia.org/wiki/Saunders_Mac_Lane), has remarked that category theory was initially developed in order to provide a language in which to speak about natural transformations.

Powerfully, functors and adjunctions between categories allow one to translate concepts from one mathematical theory to another. They provide a "translation" (either full or partial) that allows one type of object to be viewed as another, and theorems to be translated across domains. In fact, using [-duality_cateory_theory duality], very non-obvious translations can be found because a theorem in one category can be translated to its "opposite theory" in the other category. Connections which are not obvious in the language of the mathematical theories themselves, become clear in the language of category theory.
]

**Category theory** studies the abstraction of mathematical objects (such as [3jz sets], [3gd groups], and [topology topological spaces]) in terms of the [4d8 morphisms] between them. Such a collection of objects and morphisms is a [4cx category]. Morphisms often represent [3jy functions]. For example, in the category of sets, morphisms represent all functions, in the category of groups they represent group homomorphism and in the category of topological spaces, they represent [continuous continuous] maps.

Categories are usually drawn as diagrams with the objects represented by variables or points with (labeled) arrows between them representing morphisms. For this reason, morphisms are also referred to as arrows.

Morphisms do not have to represent functions. For example, any [3rb partially ordered set] $(P, \leq)$ may be seen as a category where the objects are the elements of the poset and there is a (unique) morphism $x
ightarrow y$ between two elements $x$ and $y$ if and only if $x \leq y$.

## Definition ##
A **category** consists of a
collection of [-object_category_theory objects] and a collection of [-4d8 morphisms]. A morphism $f$ goes from one object, say $X$, to another, say $Y$, and is drawn as an arrow from $X$ to $Y$. Note that $X$ may equal $Y$ (in which case $f$ is referred to as an [endomorphism **endomorphism**]). The object $X$ is called the **source** or [domain_of_function **domain**] of $f$ and $Y$ is called the **target** or [codomain_of_function **codomain**] of $f$. This is written as $f: X
ightarrow Y$.

These morphisms must satisfy three conditions:

 1. [Composition_of_functions **Composition**]: For any two morphisms $f: X
ightarrow Y$ and $g: Y
ightarrow Z$, there exists a morphism $X
ightarrow Z$, written as $g \circ f$ or simply $gf$.
 2. [3h4 **Associativity**]: For any morphisms $f: X
ightarrow Y$, $g: Y
ightarrow Z$ and $h:Z
ightarrow W$  composition is associative, i.e., $h(gf) = (hg)f$.
 3. [identity_map **Identity**]: For any object $X$, there is a (unique) morphism, $1_X : X
ightarrow X$ which, when composed with another morphism, leaves it unchanged. I.e., given $f:W
ightarrow X$ and $g:X
ightarrow Y$ it holds that: $1_X f = f$ and $g 1_X = g$.

Note that composition is written 'backwards' since given an element $x \in X$ and two functions $f: X
ightarrow Y$ and $g: Y
ightarrow Z$, the result of applying $f$ then $g$ is $g(f(x))$ which equals $(g \circ f)(x)$.

## Motivation ##

Many mathematical constructions (such as [-product_mathematics products]) appear across different fields of mathematics, consisting of different ingredients but nevertheless capturing a similar idea (and often even under the same name). Category theory allows one to precisely describe the property that these different constructions all at once. This allows one to prove [-theorem theorems] about all these structures at once. Hence, once you prove that a specific mathematical structure is, say, a product, then all the category-theoretic theorems about products are true for that structure. In fact, sometimes there are structures which non-obviously satisfy a category-theoretic property. Especially when [duality_category_theory category-theoretic duality] is involved.

In addition, category theory allows the simple description of [-functor functors], [-natural_transformation natural transformations] and [-adjunction adjunctions]. These are mathematically powerful concepts which are very difficult to describe without the language of category theory. In fact, one of the founders of category theory, [Saunders Mac Lane](https://en.wikipedia.org/wiki/Saunders_Mac_Lane), has remarked that category theory was initially developed in order to provide a language in which to speak about natural transformations.

Powerfully, functors and adjunctions between categories allow one to translate concepts from one mathematical theory to another. They provide a "translation" (either full or partial) that allows one type of object to be viewed as another, and theorems to be translated across domains. In fact, using [-duality_cateory_theory duality], very non-obvious translations can be found because a theorem in one category can be translated to its "opposite theory" in the other category. Connections which are not obvious in the language of the mathematical theories themselves, become clear in the language of category theory.

##Categories Give an External View##
Although the objects and morphisms of a category are intended to *represent* e.g. sets and functions, from the [-personification_of_mathematics point of view of the category] the objects and morphisms have no internal structure. It is not possible to talk directly about the elements of an object or how a given morphism maps elements. Instead (from the viewpoint of the category) the information about the objects and morphisms are given completely by which objects are sources and targets for the morphisms and how the morphisms are composed.

In fact, this is the strength of category theory: abstracting away the internal details allows one to focus only on relevant information and also capture information about multiple similar types of structures that act in a certain way across different mathematical theories.

This is similar to the way that a group abstracts away what elements are whilst only capturing the information of how they are 'added' or 'multiplied'.

It is also somewhat similar to the concept of a program's API (or an interface in Java); we can't see inside the program or know how it implements something, but we know what kind of inputs and outputs programs have, and what kinds of inputs and outputs a composition of such programs have.

Note that since it abstracts something away, a category does not always capture enough information for one's purposes. For example, there is addition of group homomorphisms defined pointwise. For this purpose, other structures such as [enriched_category enriched categories] and [n_category n-categories] may be used. However, for many purposes, categories are at a very good between isomorphic objects. This is considered a feature of category theory.

##Common Symbols: Convention##
Different texts make use of different conventions. This site makes use of the following common convention:

 - Categories are written in blackboard bold upper-case letters and are usually near the beginning of the alphabet. E.g. $\mathbb{A}, \mathbb{B}, \mathbb{C}$.
 - Objects are written as upper-case letters usually near the beginning or end of the alphabet. E.g. $A, B, C, W, X, Y, Z$.
 - Morphisms are labelled with lower-case letters, usually near f or near u. E.g. $e, f, g, h, u, v, w$.
 - Elements of an object, where necessary, are written as lower-case letters, usually near the beginning or end of the alphabet. E.g. $a, b, c, x, y, z$
 - Functors are written as upper-case letters usually near F. E.g. $E, F, G, H$.
 - Natural transformations are written as Greek letters, usually near the beginning of the alphabet. E.g. $lpha, eta, \gamma, \delta$.
 - The morphisms forming part of a cone or cocone for a limit or colimit are often written as Greek letters with subscripts, usually $\kappa$ or $\lambda$.

These conventions are merely guidelines and far from universally followed. Check the definition for the symbol in question to see what it represents

##[-isomorphism_category_theory Isomorphisms in Category Theory]##
In category theory, [-4f4 isomorphic] objects are not distinguished. Many [-universal_constructions] do not pin down a [-specific_construction_category_theory specific construction] but instead only specify it [-isomorphism_category_theory up to isomorphism].

Doing something in category theory which relies on a specific construction, that is, requiring objects to be equal instead of merely isomorphic, is colloquially referred to as [-evil_category_theory evil].

##[-600 Universal Properties]##
One of the most important concepts in category theory is that of a [600 universal property]. An object in a category which satisfies a universal property is in a sense the 'best' (often meaning smallest or largest) object satisfying a certain property. This can often be used to describe in a universal way constructions like [4mj products] which are defined for multiple distinct structures. In category theory, it is defined once without referring to a specific construction. This definition can then be applied to multiple categories.

The simplest [trivial non-trivial] universal construction is the [terminal_object terminal object]. Given a category $\mathbb{C}$, an object $T$ in $\mathbb{C}$ is called a **terminal object** if, for any object $X$ in $\mathbb{C}$, there is a [unique unique] morphism $f: X
ightarrow T$. In other words there is some $f: X
ightarrow T$ and if there is also $g: X
ightarrow T$ then $f=g$. In the category of sets, the terminal objects are exactly the one element sets. Given a one element set $\{a\}$, and any set $X$, there is a unique morphism $f: X
ightarrow \{a\}$, namely the function taking every $x$ in $X$ to $a$. In the category of groups, terminal objects are exactly one-element groups. Note that terminal objects need not exist. Consider a [poset_as_category poset seen as a category]. If it has a largest element $T$, then each object is less than or equal to $T$. So from each object there is a unique morphism to $T$ and hence it is terminal. If, however, there is no largest element then the category has no terminal object.

As another example, [4mj products] can be defined by a universal property: Given a pair of objects $X$ and $Y$, an object $P$ *along with a pair of morphisms* $f: P
ightarrow X$ and $g: P
ightarrow Y$ is called the **product** of $X$ and $Y$ if, given any other object $W$ and morphisms $u: W
ightarrow X$ and $v:W
ightarrow Y$ there is a *unique* morphism $h: W
ightarrow P$ such that $fh = u$ and $gh = v$.

The above are both special cases of a very important and more general [-universal_construction universal construction]: the [-limit_category_theory limit]. This (along with the [-colimit_category_theory colimit]) is described in more detail further below.

##[-duality_category_theory Duality]##
For any notion in a category, its **dual** is obtained by `reversing all the arrows' and 'reversing the order of composition'. If a statement is true in any category, then its dual is true in any category. As a [-corollary corollary], if a statement is true in some categories, its dual is true in the duals of those categories.

As an example, consider the definition of a [-terminal_object terminal object] given above. A statement about terminal object is that any two terminal objects are isomorphic. Let's examine the exact statement. Assume $T$ is terminal. Then for any $X$ there is unique $f: X
ightarrow T$. If we reverse the arrows, we get that for every $X$ there is unique $f: X \leftarrow T$. This is the definition of an [-initial_object initial object]. Consider another terminal object $T'$. The statement that $T'$ is isomorphic to $T$ is means that there is some $f: T
ightarrow T'$ and $g: T'
ightarrow T$ such that $gf = 1_T$ and $fg = 1_{T'}$. The dual of this is just the statement that there is some $f: T \leftarrow T'$ and $g: T' \leftarrow T$ such that $fg = 1_T$ and $gf = 1_{T'}$, this is exactly the same property! (The morphisms $f$ and $g$ have just been renamed). Hence, the dual of the statement that a terminal object is unique up to isomorphism is the statement that every initial object is unique up to isomorphism.

Similarly, if something is true for every category with an initial object, its dual will be true for every category with a terminal object.

The concept of duality can be a powerful way of obtaining new results which come easily within category theory, but which are not obvious in the theory to which category theory is being applied. As an advanced example, the category of [-boolean_algebra Boolean Algebras] is dual to the category of [-stone_space Stone Spaces]. See, [Stone Duality on Wikipedia](https://en.wikipedia.org/wiki/Stone's_representation_theorem_for_Boolean_algebras) for the motivation.

[todo: Add better example(s) of duality]

##[-Functor Functors]##
A **functor** is a morphism between categories.

Given two categories $\mathbb{A}$ and $\mathbb{B}$, a functor $F$ from $\mathbb{A}$ to $\mathbb{B}$, written $F: \mathbb{A}
ightarrow \mathbb{B}$ is defined as a pair of functions:

 - $F_0:$ Objects($\mathbb{A}$) $
ightarrow$ Objects($\mathbb{B}$)
 - $F_1:$ Morphisms($\mathbb{A}$) $
ightarrow$ Morphisms($\mathbb{B}$)

Which satisfy:

 1.
Preservation of domain and codomain:
If $f: X
ightarrow Y$ then $F_1(f): F_0(X)
ightarrow F_1(Y)$. (
Put differently,
Dom($F_1(f)$) = $F_0$(Dom($f$)) and Cod($F_1(f)$) = $F_0$(Cod($f$)) for every morphism $f$. )

 2. Preservation of Identity:
If the morphism $1_X: X
ightarrow X$ is the identity on $X$, then the morphism $F_1(1_X): F_0(X)
ightarrow F_0(X)$ is the identity on $F_0(X)$.

 3. Preservation of composition:
Given morphisms $f: X
ightarrow Y$ and $g: Y
ightarrow Z$, then the composition of their images $F_1(g) \circ F_1(f): F_0(X)
ightarrow F_0(Z)$ is the image of their composition $F_1(g \circ f): F_0(X)
ightarrow F_0(Z)$.

Instead of differentiating $F_0$ and $F_1$, they are usually both written simply as $F$. E.g. $F(f): F(X)
ightarrow F(Y)$.

##[-morphism_category_theory Properties of Morphisms]##
Morphisms are the central objects of study in category theory. For this reason, properties of morphisms can be very important.
A morphism $f: X
ightarrow Y$ is called the following if it satisfies the given property:

 - **[-isomorphism_category_theory Isomorphism]:**
 ([-self_dual_category_theory Self-dual])

There exists some $g: Y
ightarrow X$ such that $gf = 1_X$ and $fg = 1_Y$.

Intuitively, an isomorphism is a way of transforming from one object to another in a way that makes them indistinguishable using the information of the category.

 - **[-monomorphism Monomorphism]:** ([-duality_category_theory Dual] to epimorphic)

For any object $W$ and morphisms $g,h: W
ightarrow X$, if $fg = fh$ then $g = h$.

Intuitively, $f$ being a monomorphism indicates that *all of the information captured by the collection of morphisms into $X$ is preserved when composing by $f$*. It generalizes the notion of an [4b7 injective function], since in most [-concrete_category concrete categories] (like [-3jz sets], [-3gd groups], and [-topology topological spaces]) every injective map is a monomorphism. However, even in concrete categories (and certainly more generally), monomorphisms need not be injective.

 - **[-epimorphism Epimorphism]:** (Dual to monomorphic)

For any object $Z$ and morphisms $g,h: X
ightarrow Z$, if $gf = hf$ then $g = h$.

Intuitively, $f$ being an epimorphism indicates that *all the information captured by the collection of morphisms out of $Y$ is preserved when composing by $f$.*. It generalizes the notion of a [-4bg surjective function]. However, in an even stronger sense than for monomorphisms, a function being epimorphic and a function being surjective are far from equivalent.

Properties that more closely match surjectivity include [-section_category_theory Section / Split Epimorphism], and [-regular_epimorphism regular epimorphism]. [-strict_epimorphism strict epimorphism], [-strong_epimorphism strong epimorphism], and [-extremal_epimorphism extremal epimorphism]. Note that despite the names, not all of these are necessarily epimorphisms, but are epimorphisms in "nice" categories.

 - **[-endomorphism Endomorphism]:** (Self-dual)

$X = Y$, i.e., $f: X
ightarrow X$.

An endomorphism is a morphism from an object to itself.

 - **[-automorphism Automorphism]:** (Self-dual)

The morphism $f$ is both an endomorphism and an isomorphism.

An automorphism is a morphism from a structure to itself that preserves all the information of the structure that is distinguishable by the category. Intuitively, it gives "another view" of a structure (say, by moving around its elements) that leaves it essentially unchanged.

 - **[-retraction_category_theory Retraction / Split Monomorphism]:** (Dual to split epimorphic)

There exists some $g: Y
ightarrow X$ such that $gf = 1_X$

A morphism is a **retraction** if its effect can be "reversed" or inverted by another morphism applied after it. For example, every injective map is a retraction. The morphism which inverts the retraction is a **section**.

 - **[-section_category_theory Section / Split Epimorphism]:** (Dual to split monomorphic)

There exists some $g: Y
ightarrow X$ such that $fg = 1_Y$

A morphism is a **section** if it "reverses" the effect of some other morphism applied before it. The morphism which is inverted is a **retraction**.

##[-limit_category_theory Limits] and [-colimit_category_theory Colimits]##

##[-universal_construction Further Universal Constructions]##

##[-natural_transformation Natural Transformations]##

##[-Constructions_on_categories Constructions on Categories]##

##[-adjunction_category_theory Adjunctions and Adjoint Functors]##


Log base infinity

There is no $\log_{\infty},$ because $\infty$ is not a [-4bc]. Nevertheless, the function $z$ defined as $z(x) = 0$ for all $x \in$ [positive_reals $\mathbb R^+$] can pretty readily be interpreted as $\log_{\infty}$.

That is, $z$ satisfies all properties of the basic [4bz properties of the logarithm] except for the one that says there exists a $b$ such that $\log(b) = 1.$ In the case of $\log_\infty,$ the logarithm base infinity claims "well, if you gave me a $b$ that was _large enough_ I might return 1, but for all measly finite numbers I return 0." In fact, if you're feeling ambitious, you can define $\log_\infty$ to be a [-multifunction] which allows infinite inputs, and define $\log_\infty(\infty)$ to return any positive real number that you'd like (1 included). This requires a few hijinks (like defining $\infty^0$ to also return any number that you'd like), but can be made to work and satisfy all the basic logarithm properties (if you strategically re-interpret some '$=$' signs as '[set_contains $\in$]' signs).

The moral of the story is that functions that send everything to zero are _almost_ logarithm functions, with the minor caveat that they utterly destroy all the intricate structure that logarithm functions tap into. (That's what happens when you choose "0" as your arbitrary scaling factor when tapping into [-4gp].)


Two independent events

$$

ewcommand{P}{\mathbb{P}}
$$

[summary:
$$

ewcommand{P}{\mathbb{P}}
$$
We say that two [event_probability events], $A$ and $B$, are *independent* when learning that $A$ has occurred does not change your probability that $B$ occurs. That is, $P(B \mid A) = P(B)$.
Another way to state independence is that $P(A,B) = P(A) P(B)$. ]

We say that two [event_probability events], $A$ and $B$, are *independent* when learning that $A$ has occurred does not change your probability that $B$ occurs. That is, $P(B \mid A) = P(B)$.
Equivalently,  $A$ and $B$ are independent if $P(A)$ doesn't change if you condition on $B$: $P(A \mid B) = P(A)$.

Another way to state independence is that $P(A,B) = P(A) P(B)$.

All these definitions are equivalent:

$$P(A,B) = P(A)\;  P(B \mid A)$$

by the [chain_rule_probability chain rule], so

$$P(A,B) = P(A)\;  P(B)\;\; \Leftrightarrow \;\; P(A)\;  P(B \mid A) = P(A)\;  P(B) \ ,$$

and similarly for $P(B)\;  P(A \mid B)$.


Cycle type of a permutation

Given an element $\sigma$ of a [-497] $S_n$ on finitely many elements, we may express $\sigma$ in [49f cycle notation].
The cycle type of $\sigma$ is then a list of the lengths of the cycles in $\sigma$, where conventionally we omit length-$1$ cycles from the cycle type.
Conventionally we list the lengths in decreasing order, and the list is presented as a comma-separated collection of values.

The concept is well-defined because [-49k] up to reordering of the cycles.

# Examples

- The cycle type of the element $(123)(45)$ in $S_7$ is $3,2$, or (without the conventional omission of the cycles $(6)$ and $(7)$) $3,2,1,1$.
- The cycle type of the identity element is the empty list.
- The cycle type of a $k$-cycle is $k$, the list containing a single element $k$.


Two independent events: Square visualization

$$

ewcommand{	rue}{	ext{True}}

ewcommand{alse}{	ext{False}}

ewcommand{P}{\mathbb{P}}
$$

[summary:
$$

ewcommand{	rue}{	ext{True}}

ewcommand{alse}{	ext{False}}

ewcommand{P}{\mathbb{P}}
$$

Say $A$ and $B$ are independent [event_probability events], so $P(A, B) = P(A)P(B).$ Then we can draw their joint probability distribution using the using the [496 square visualization] of probabilities:

]

This is what independence looks like, using the [496 square visualization] of probabilities:

We can see that the [event_probability events] $A$ and $B$ don't interact; we say that $A$ and $B$ are *independent*. Whether we look at the whole square, or just the red part of
the square where $A$ is true, the probability of $B$ stays the same. In other words, $P(B \mid A) = P(B)$. That's what we mean by independence: the
probability of $B$ doesn't change if you condition on $A$.

Our square of probabilities can be generated by multiplying together the probability of $A$ and the probability of $B$:

This picture demonstrates another way to define what it means for $A$ and $B$ to be independent:

$$P(A, B) = P(A)P(B)\ .$$

In terms of factoring a joint distribution
--

Let's contrast independence with non-independence. Here's a picture of two ordinary, non-independent events $A$ and $B$:

(If the meaning of this picture isn't clear, take a look at [496].)

We have the red blocks for $P(A)$ and the blue blocks for $P(
eg A)$ lined up in columns. This means we've [factoring_probability factored] our
probability distribution using $A$ as the first factor:

$$P(A,B) = P(A) P(B \mid A)\ .$$

We could just as well have factored by $B$ first: $P(A,B) = P(B) P( A \mid B)\ .$ Then we'd draw a picture like this:

Now, here again is the picture of [4cf two independent events] $A$ and $B$:

In this picture, there's red and blue lined-up columns for $P(A)$ and $P(
eg A)$, and there's *also*  dark and light lined-up rows for $P(B)$ and
$P(
eg B)$. It looks like we somehow [factoring_probability factored] our probability distribution $P$ using both $A$ and
$B$ as the first factor.

In fact, this is exactly what happened: since $A$ and $B$ are [4cf independent], we have that $P(B \mid A) = P(B)$. So the diagram
above is actually factored according to $A$ first: $P(A,B) = P(A) P(B \mid A)$. It's just that $P(B \mid A)= P(B) = P(B \mid
eg A)$, since $B$
is independent from $A$. So we don't need to have different ratios of dark to light (a.k.a. conditional probabilities of $B$) in the left and right columns:

In this visualization, we can see what happens to the probability of $B$ when you condition on $A$ or on $
eg A$: it doesn't change at all. The ratio of
\[the area where $B$ happens\] to \[the whole area\], is the same as the ratio $P(B \mid A)$ where we only look at the area where $A$ happens, which is the
same as the ratio $P(B \mid
eg A)$ where we only look at the area where $
eg A$ happens. The fact that the probability of $B$ doesn't change when we
condition on $A$ is exactly what we mean when we say that $A$ and $B$ are independent.

The square diagram above is *also* factored according to $B$ first, using $P(A,B) = P(B) P(A \mid B)$. The red / blue ratios are the same in both rows
because $P(A \mid B) = P(A) = P(A \mid
eg B)$, since $A$ and $B$ are independent:

We couldn't do any of this stuff if the columns and rows didn't both line up. (Which is good, because then we'd have proved the false statement that any two
events are independent!)

In terms of multiplying marginal probabilities
---

Another way to say that $A$ and $B$ are independent variables %note:We're using  the [event_variable_equivalence equivalence] between [event_probability
events] and [binary_random_variable binary variables].% is that for any truth values $t_A,t_B \in \{	rue, alse\},$

$$P(A = t_A, B= t_B) = P(A = t_A)P(B = t_B)\ .$$

So the [1rh joint probabilities] for $A$ and $B$ are computed by separately getting the probability of $A$ and the probability of $B$, and then
multiplying the two probabilities together. For example, say we want to compute the probability $P(A,
eg B) = P(A = 	rue, B = alse)$. We start with
the [marginal_probability marginal probability] of $A$:

and the probability of $
eg B$:

and then we multiply them:

We can get all the joint probabilities this way. So we can visualize the whole joint distribution as the thing that you get when you multiply two independent
probability distributions together. We just overlay the two distributions:

To be a little more mathematically elegant, we'd use the [topological_product topological product of two spaces] shown earlier to draw the joint distribution
as a product of the distributions of $A$ and $B$:


Transposition (as an element of a symmetric group)

In a [-497], a transposition is a permutation which has the effect of swapping two elements while leaving everything else unchanged.
More formally, it is a permutation of [order_of_a_group_element order] $2$ which fixes all but two elements.

%%%knows-requisite([4cg]):
A transposition is precisely an element with cycle type $2$.
%%%

# Example

In $S_5$, the permutation $(12)$ is a transposition: it swaps $1$ and $2$ while leaving all three of the elements $3,4,5$ unchanged.
However, the permutation $(124)$ is not a transposition, because it has order $3$, not order $2$.


Every member of a symmetric group on finitely many elements is a product of transpositions

Given a permutation $\sigma$ in the [-497] $S_n$, there is a finite sequence $	au_1, \dots, 	au_k$ of [4cn transpositions] such that $\sigma = 	au_k 	au_{k-1} \dots 	au_1$.
Equivalently, symmetric groups are generated by their transpositions.

Note that the transpositions might "overlap".
For example, $(123)$ is equal to $(23)(13)$, where the element $3$ appears in two of the transpositions.

Note also that the sequence of transpositions is by no means uniquely determined by $\sigma$.

# Proof

It is enough to show that a [49f cycle] is expressible as a sequence of transpositions.
Once we have this result, we may simply replace the successive cycles in $\sigma$'s disjoint cycle notation by the corresponding sequences of transpositions, to obtain a longer sequence of transpositions which multiplies out to give $\sigma$.

It is easy to verify that the cycle $(a_1 a_2 \dots a_r)$ is equal to $(a_{r-1} a_r) (a_{r-2} a_r) \dots (a_2 a_r) (a_1 a_r)$.
Indeed, that product of transpositions certainly does not move anything that isn't some $a_i$; while if we ask it to evaluate $a_i$, then the $(a_1 a_r)$ does nothing to it, $(a_2 a_r)$ does nothing to it, and so on up to $(a_{i-1} a_r)$.
Then $(a_i a_r)$ sends it to $a_r$; then $(a_{i+1} a_r)$ sends the resulting $a_r$ to $a_{i+1}$; then all subsequent transpositions $(a_{i+2} a_r), \dots, (a_{r-1} a_r)$ do nothing to the resulting $a_{i+1}$.
So the output when given $a_i$ is $a_{i+1}$.

# Why is this useful?

It can make arguments simpler: if we can show that some property holds for transpositions and that it is closed under products, then it must hold for the entire symmetric group.


Order of a group element

Given an element $g$ of group $(G, +)$ (which henceforth we abbreviate simply as $G$), the order of $g$ is the number of times we must add $g$ to itself to obtain the identity element $e$.

%%%knows-requisite([3gg]):
Equivalently, it is the order of the group $\langle g
angle$ generated by $g$: that is, the order of $\{ e, g, g^2, \dots, g^{-1}, g^{-2}, \dots \}$ under the inherited group operation $+$.
%%%

Conventionally, the identity element itself has order $1$.

# Examples

%%%knows-requisite([497]):
In the [-497] $S_5$, the order of an element is the [-least_common_multiple] of its [4cg cycle type].
%%%
%%%knows-requisite([47y]):
In the [-47y] $C_6$, the order of the generator is $6$.
If we view $C_6$ as being the integers [modular_arithmetic modulo] $6$ under addition, then the element $0$ has order $1$; the elements $1$ and $5$ have order $6$; the elements $2$ and $4$ have order $3$; and the element $3$ has order $2$.
%%%

In the group $\mathbb{Z}$ of [48l integers] under addition, every element except $0$ has infinite order. $0$ itself has order $1$, being the identity.


Strong Church Turing thesis

> Every realistic model of computation is [ polynomial time reducible] to [ probabilistic Turing machines]

Which amounts to saying that every computable process in the universe can be efficiently simulated by a probabilistic Turing machine.

The definition of *realistic model* appeals to intuition rather than a precise definition of realistic. A rule of thumb is that a computation model is realistic if it could be used to accurately model some physical process. For example, there is a clear relation between the model of [ register machines] and the inner workings of personal computers. On the other hand, a computational model which can access an [ NP oracle] does not have a physical counterpart.

As it happened with the standard [4bw], this is an inductive rather than a mathematically defined statement. However, unlike the standard CT thesis, it is [ widely believed to be wrong], primarily because [ quantum computation] stands as a highly likely counterexample to the thesis.

We remark that non-deterministic computation is not a candidate counterexample to the strong CT thesis, since it is not realistic. That said, we can find a relation between the two concepts: if [4bd $P=NP$] and [ $BQP\subset NP$] then $BQP = P$, so quantum computation can be efficiently simulated, and we lose the strongest contestant for a counterexample to Strong CT.

#Consequences of falsehood

The falsehood of the Strong CT thesis opens up the possibility of the existence of physical processes that, while computable, cannot be modeled in a reasonable time with a classical computer. One consequence of this, that would also mean that if quantum computing is possible the speed .up it provides is non-trivial.

Epistemic processes which assign priors using a penalty for computational time complexity are misguided if the Strong CT thesis is false. See for example [ Levin search].

[todo: show when QM is covered?The failure of Strong CT raises the possibility for human minds in particular, and general intelligence in general being  impossible to simulate without a quantum speedup, *if* it turns out that human minds take advantage of quantum phenomena. We suspect, however, that this is false.] [comment: probably not worth raising? human brains have crazy-low decoherence times.]