Bijective Function: Intro (Math 0)

##Comparing Amounts##
Consider the Count von Count. He cares only about counting things. He doesn't care what they are, just how many there are. He decides that he wants to collect items into plastic crates, and he considers two crates equal if both contain the same number of items.

![Equivalent Crates](http://i.imgur.com/sG7Qfyv.jpg)

Now Elmo comes to visit, and he wants to impress the Count, but Elmo is not great at counting. Without counting them explicitly, how can Elmo tell if two crates contain the same number of items?

Well, he can take one item out of each crate and put the pair to one side.

![Pairing one pair of items](https://i.imgur.com/myTqIrRl.jpg)

 He continues pairing items up in this way and when one crate runs out he checks if there are any left over in the other crate. If there aren't any left over, then he knows there were the same number of items in both crates.

![Pairing all items in one crate with items in the other](https://i.imgur.com/S87JO2nl.jpg)

Since the Count von Count only cares about counting things, the two crates are basically equivalent, and might as well be the same crate to him. Whenever two objects are the same from a certain perspective, we say that they are **isomorphic**.

In this example, the way in which the crates were the same is that each item in one crate could be paired with an item in the other.

![Pairing all items in one box with items in the other](https://i.imgur.com/S87JO2nl.jpg)

![Bijection between crates](https://i.imgur.com/53YbraFl.jpg)

This wouldn't have been possible if the crates had different numbers of items in them.

![Different numbers of items](https://i.imgur.com/F5rLwAsl.jpg)

![No way to pair items](https://i.imgur.com/KCI9UOvl.jpg)

Whenever you can match each item in one collection with exactly one item in another collection, we say that the collections are **[bijective](https://arbital.com/p/-499)** and the way you paired them is a **[bijection](https://arbital.com/p/-499)**. A bijection is a specific kind of isomorphism.

![Bijection between crates](https://i.imgur.com/53YbraFl.jpg)

Note that there might be many different bijections between two bijective things.

![Another bijection between crates](http://i.imgur.com/Q6Si1ZX.png)

In fact, all that counting involves is pairing up the things you want to count, either with your fingers, or with the concepts of 'numbers' in your head. If there are as many objects in one crate as there are numbers from one to seven, and there are as many objects in another crate as numbers from one to seven, then both crates contain the same number of objects.


Convex set

A convex set is a [https://arbital.com/p/-3jz](https://arbital.com/p/-3jz) of [vectors](https://arbital.com/p/3w0) that contains all line segments between vectors in the set.  Consider the following shape:

![a convex set](https://upload.wikimedia.org/wikipedia/commons/thumb/6/6b/Convex_polygon_illustration1.svg/634px-Convex_polygon_illustration1.svg.png)

As shown, a line segment between two points $x$ and $y$ in this shape lies entirely within the shape.  In fact, this is true for any pair of points in the shape.  Therefore, this shape is convex.  For comparison, the following shape is not convex:

![a non-convex set](https://upload.wikimedia.org/wikipedia/commons/thumb/6/6c/Convex_polygon_illustration2.svg/634px-Convex_polygon_illustration2.svg.png)

The fact that part of the line segment between $x$ and $y$ (both inside the shape) lies outside the shape proves that this shape is not convex.

Formally, a set $S$ is convex if

$$\forall x, y \in S, \theta \in [1](https://arbital.com/p/0,): \theta x + (1 - \theta) y \in S$$

(images are from Wikipedia: [here](https://en.wikipedia.org/wiki/File:Convex_polygon_illustration1.svg) and [here](https://en.wikipedia.org/wiki/File:Convex_polygon_illustration2.svg))


Factorial

Factorial is most simply defined as a [https://arbital.com/p/-3jy](https://arbital.com/p/-3jy) on positive [integers](https://arbital.com/p/48l). 5 factorial (written as $5!$) means $1*2*3*4*5$. In general then, for a positive integer $n$, $n!=\prod_{i=1}^{n}i$. For applications to [combinatorics](https://arbital.com/p/), it will also be useful to define $0! = 1$.

## Applications to Combinatorics ##

$n!$ is the number of possible orders for a set of $n$ objects. For example, if we arrange the letters $A$, $B$, and $C$, here are all the options:
$$ABC$$
$$ACB$$
$$BAC$$
$$BCA$$
$$CAB$$
$$CBA$$
You can see that there are $6$ possible orders for $3$ objects, and $6 = 3*2*1 = 3!$. Why does this work? We can [prove this by induction](https://arbital.com/p/5fz). First, we'll see pretty easily that it works for $1$ object, and then we can show that if it works for $n$ objects, it will work for $n+1$. Here's the case for $1$ object.
$$A$$
$$1 = \prod_{i=1}^{1}i = 1!$$
Now we have the objects $\{A_{1},A_{2},...,A_{n},A_{n+1}\}$, and $n+1$ slots to put them in. If $A_{n+1}$ is in the first slot, now we're ordering $n$ remaining objects in $n$ remaining slots, and by our [induction hypothesis](https://arbital.com/p/5fz), there are $n!$ ways to do this. Now let's suppose $A_{n+1}$ is in the second slot. Any orderings that result from this will be completely unique from the orderings where $A_{n+1}$ was in the first slot. Again, there are $n$ remaining slots, and $n$ remaining objects to put in them, in an arbitrary order. There are another $n!$ possible orderings. We can put $A_{n+1}$ in each slot, one by one, and generate another $n!$ orderings, all of which are unique, and by the end, we will have every possible ordering. We know we haven't missed any because $A_{n+1}$ has to be somewhere. The total number of orderings we get is $n!*(n+1)$, which equals $(n+1)!$.

## Extrapolating to [Real Numbers](https://arbital.com/p/50d) ##

The factorial function can be defined in a different way so that it is defined for all real numbers (and in fact for complex numbers too).

%%hidden(Definition):
We define $x!$ as follows:
$$x! = \Gamma (x+1),$$
where $\Gamma $ is the [gamma function](https://arbital.com/p/):
$$\Gamma(x)=\int_{0}^{\infty}t^{x-1}e^{-t}\mathrm{d} t$$
Why does this correspond to the factorial function as defined previously? We can prove by induction that for all positive integers $x$:
$$\prod_{i=1}^{x}i = \int_{0}^{\infty}t^{x}e^{-t}\mathrm{d} t$$
First, we verify for the case where $x=1$. Indeed:
$$\prod_{i=1}^{1}i = \int_{0}^{\infty}t^{1}e^{-t}\mathrm{d} t$$
$$1=1$$
Now we suppose that the equality holds for a given $x$:
$$\prod_{i=1}^{x}i = \int_{0}^{\infty}t^{x}e^{-t}\mathrm{d} t$$
and try to prove that it holds for $x + 1$:
$$\prod_{i=1}^{x+1}i = \int_{0}^{\infty}t^{x+1}e^{-t}\mathrm{d} t$$
We'll start with the induction hypothesis, and manipulate until we get the equality for $x+1$.
$$\prod_{i=1}^{x}i = \int_{0}^{\infty}t^{x}e^{-t}\mathrm{d} t$$
$$(x+1)\prod_{i=1}^{x}i = (x+1)\int_{0}^{\infty}t^{x}e^{-t}\mathrm{d} t$$
$$\prod_{i=1}^{x+1}i = (x+1)\int_{0}^{\infty}t^{x}e^{-t}\mathrm{d} t$$
$$= 0+\int_{0}^{\infty}(x+1)t^{x}e^{-t}\mathrm{d} t$$
$$= \left[](https://arbital.com/p/)_{0}^{\infty}+\int_{0}^{\infty}(x+1)t^{x}e^{-t}\mathrm{d} t$$
$$= \left[](https://arbital.com/p/)_{0}^{\infty}-\int_{0}^{\infty}(x+1)t^{x}(-e^{-t})\mathrm{d} t$$
By the product rule of integration:
$$=\int_{0}^{\infty}t^{x+1}e^{-t}\mathrm{d} t$$
This completes the proof by induction, and that's why we can define factorials in terms of the gamma function.
%%

Michael Cohen
Patrick Stevens
Douglas Weathers
Eric Bruylant
Henri Lemoine


Convex function

A convex [https://arbital.com/p/-3jy](https://arbital.com/p/-3jy) "only curves upwards."  To check whether a function is convex, use the following procedure:

1. Draw the graph of the function.

![graph of a function](http://i.imgur.com/bJAKquW.png)

2. Select any two points in the graph.

![graph with two points](http://i.imgur.com/j3MsPWR.png)

3. Draw a line segment connecting the two points.

![graph with two points connected](http://i.imgur.com/MoZTIK1.png)

4. See whether this line segment is ever lower than the graph.

![graph with part of line segment highlighted](http://i.imgur.com/4piUSZJ.png)

If the line segment is ever lower than the graph, the function is not convex.  The function graphed above is not convex, as can be seen by looking at the red part of the line segment.  On the other hand, if the line segment never goes below the graph (no matter which two initial points you selected), then the function is convex.

Equivalently, a function is convex if its [https://arbital.com/p/-epigraph](https://arbital.com/p/-epigraph) is a [https://arbital.com/p/-5bs](https://arbital.com/p/-5bs).


Needs accessible summary

This tag is for pages which have a summary of some kind but don't have a summary which is accessible to a relevant audience.

Some pages may require a [technical](https://arbital.com/p/4pt) or [brief](https://arbital.com/p/4q2) summary.


Reflexive relation

A binary [relation](https://arbital.com/p/3nt) over some set is **reflexive** when every element of that set is related to itself. (In symbols, a relation $R$ over a set $X$ is reflexive if $\forall a \in X, aRa$.) For example, the relation $\leq$ defined over the real numbers is reflexive, because every number is less than or equal to itself.

A relation is **anti-reflexive** when *no* element of the set over which it is defined is related to itself. $<$ is an anti-reflexive relation over the real numbers. Note that a relation doesn't have to be either reflexive or anti-reflexive; if Alice likes herself but Bob doesn't like himself, then the relation "_ likes _" over the set $\{Alice, Bob\}$ is neither reflexive nor anti-reflexive.

The **reflexive closure** of a relation $R$ is the union of $R$ with the [identity relation](https://arbital.com/p/Identity_relation); it is the smallest relation that is reflexive and that contains $R$ as a subset. For example, $\leq$ is the reflexive closure of $<$.

Some other simple properties that can be possessed by binary relations are [symmetry](https://arbital.com/p/Symmetric_relation) and [transitivity](https://arbital.com/p/573).

A reflexive relation that is also transitive is called a [preorder](https://arbital.com/p/Preorder).

Eric Bruylant
Ryan Hendrickson
Alexei Andreev


Algebraic structure tree

Some classes of [https://arbital.com/p/-3gx](https://arbital.com/p/-3gx) are given special names based on the properties of their sets and operations. These terms grew organically over the history of modern mathematics, so the overall list of names is a bit arbitrary (and in a few cases, some authors will use slightly different assumptions about certain terms, such as whether a semiring needs to have identity elements). This list is intended to clarify the situation to someone who has some familiarity with what an algebraic structure is, but not a lot of experience with using these specific terms.

%%comment:Tree is the wrong word; this should be more of an algebraic structure collection of disjoint directed acyclic graphs? But this is what other pages seem to have chosen to link to, so here we are!%%

# One set, one binary operation

* [https://arbital.com/p/Groupoid](https://arbital.com/p/Groupoid), sometimes known as a magma. This is the freebie. Have a set and a binary operation? That's a groupoid.
    * A [https://arbital.com/p/-semigroup](https://arbital.com/p/-semigroup) is a groupoid where *the operation is [associative](https://arbital.com/p/3h4)*.
        * A [https://arbital.com/p/-3h3](https://arbital.com/p/-3h3) is a semigroup where *the operation has an [https://arbital.com/p/-54p](https://arbital.com/p/-54p)*.
            * A [https://arbital.com/p/-3gd](https://arbital.com/p/-3gd) is a monoid where *every element has an [https://arbital.com/p/-inverse_element](https://arbital.com/p/-inverse_element) under the binary operation*.
                * An [https://arbital.com/p/3h2](https://arbital.com/p/3h2) is a group where *the binary operation is [commutative](https://arbital.com/p/3jb)*.
        * A [https://arbital.com/p/-semilattice](https://arbital.com/p/-semilattice) is a semigroup where *the operation is [idempotent](https://arbital.com/p/Idempotent_operation) and commutative*.
    * A [https://arbital.com/p/-quasigroup](https://arbital.com/p/-quasigroup) is a groupoid where *every element has a [left and right quotient](https://arbital.com/p/quotient_algebra) under the binary operation* (sometimes called the [https://arbital.com/p/Latin_square_property](https://arbital.com/p/Latin_square_property)).
        * A [loop](https://arbital.com/p/Algebraic_loop) is a quasigroup *with identity*.
        * A **group**, as defined above, can also be defined as a (non-empty) quasigroup where *the operation is associative* ([quotients and associativity give a two-sided identity and two-sided inverses](https://arbital.com/p/), provided there's at least one element to be that identity).

# One set, two binary operations

For the below, we'll use $*$ and $\circ$ to denote the two binary operations in question. It might help to think of $*$ as "like addition" and $\circ$ as "like multiplication", but be careful—in most of these structures, properties of addition and multiplication like commutativity won't be assumed!

* [https://arbital.com/p/Ringoid](https://arbital.com/p/Ringoid) assumes only that $\circ$ distributes over $*$—in other words, $a \circ (b * c) = (a \circ b) * (a \circ c)$ and $(a * b) \circ c = (a \circ c) * (b \circ c)$.
    * A [https://arbital.com/p/-semiring](https://arbital.com/p/-semiring) is a ringoid where *both $*$ and $\circ$ define semigroups*.
        * An [https://arbital.com/p/-additive_semiring](https://arbital.com/p/-additive_semiring) is a semiring where $*$ *is commutative*.
            * A [https://arbital.com/p/-rig](https://arbital.com/p/-rig) is an additive semiring where $*$ *has an identity element*. (It's almost a ring! It's just missing <b>n</b>egatives.)
                * A [https://arbital.com/p/-3gq](https://arbital.com/p/-3gq) is a rig where *every element has an inverse element under* $*$. (Some authors also require $\circ$ to have an identity to call the structure a ring.)
                    * A **ring with unity** is a ring where $\circ$ *has an identity*. (Some authors just use the word "ring" for this; others use variations like "unit ring".)
                        * A [https://arbital.com/p/-division_ring](https://arbital.com/p/-division_ring) is a ring with unity where *every element (except for the identity of $*$) has an inverse element under* $\circ$.
                            * A [field](https://arbital.com/p/481) is a division ring where $\circ$ *is commutative*.
    * A [lattice](https://arbital.com/p/46c) is a ringoid where *both $*$ and $\circ$ define semilattices, and satisfy the absorption laws ($a \circ (a * b) = a * (a \circ b) = a$)*. (While we'll continue to use $*$ and $\circ$ here, the two operations of a lattice are almost always denoted with [$\wedge$ and $\vee$](https://arbital.com/p/3rc).)
        * A [https://arbital.com/p/-bounded_lattice](https://arbital.com/p/-bounded_lattice) is a lattice where *both operations have identities*.

Eric Bruylant
Ryan Hendrickson
Kevin Clancy


Bayes' rule: Beginner's guide

This arc teaches basic understanding of [https://arbital.com/p/1lz](https://arbital.com/p/1lz) via [https://arbital.com/p/1x5](https://arbital.com/p/1x5). This arc should work for [https://arbital.com/p/1r5](https://arbital.com/p/1r5)-type readers.

Eric Bruylant
Nate Soares
Alexei Andreev


Lattice: Exercises

Try these exercises to test your knowledge of lattices.

## Distributivity

Does the lattice meet operator distribute over joins? In other words, for all lattices $L$ and all $p, q, r \in L$, is it necessarily true that $p \wedge (q \vee r) = (p \wedge q) \vee (p \wedge r)$? Prove your answer.

%%hidden(Solution):
The following counterexample shows that lattice meets do not necessarily distribute over joins.

![A non-distributive lattice called as M3](http://i.imgur.com/SKJirZx.png)

%%%comment:
dot source:

digraph G {
  node [= 0.1, height = 0.1](https://arbital.com/p/width)
  edge [= "none"](https://arbital.com/p/arrowhead)

  rankdir = BT;
  t -> p
  t -> q
  t -> r
  p -> s
  q -> s
  r -> s
}
%%%

In the above lattice, $p \wedge (q \vee r) = p \neq t = (p \wedge q) \vee (p \wedge r)$.
%%

## Common elements

Let $L$ be a lattice, and let $J$ and $K$ be two finite subsets of $L$ with a non-empty intersection. Prove that $\bigwedge J \leq \bigvee K$.

%%hidden(Solution):
If $J$ and $K$ have a non-empty intersection, then there exists some lattice element $p$ such that $p \in J$ and $p \in K$. Since $\bigwedge J$ is a lower bound of $J$, we have $\bigwedge J \leq p$. Since $\bigvee K$ is an upper bound of $K$, we have $p \leq \bigvee K$. By transitivity, we have $\bigwedge J \leq p \leq \bigvee K$.
%%

## Another inequality

Let $L$ be a lattice, and let $J$ and $K$ be two finite subsets of $L$ such that for all $j \in J$ and $k \in K$, $j \leq k$. Prove that $\bigvee J \leq \bigwedge K$.

%%hidden(Solution):
Rephrasing the problem statement, we have that every element of $J$ is a lower bound of $K$ and that every element of $K$ is an upper bound of $J$. It the follows that for $j \in J$, $j \leq \bigwedge K$. Hence, $\bigwedge K$ is an upper bound of $J$, and therefore it is greater than or equal to the *least* upper bound of $J$: $\bigvee J \leq \bigwedge K$.
%%

## The minimax theorem

Let $L$ be a lattice and $A$ an $m \times n$ matrix of elements of $L$. Prove the following inequality: $$\bigvee_{i=1}^m \bigwedge_{j=1}^n A_{ij} \leq \bigwedge_{j=1}^n \bigvee_{i=1}^m A_{ij}$$.

%%hidden(Solution):
To get an intuitive feel for this theorem, it helps to first consider a small concrete instantiation. Consider the $3 \times 3$ matrix depicted below, with elements $a,b,c,d,e,f,g,h$, and $i$. The inequality instantiates to $(a \wedge b \wedge c) \vee (d \wedge e \wedge f) \vee (g \wedge h \wedge i) \leq (a \vee d \vee g) \wedge (b \vee e \vee h) \wedge (c \vee f \vee i)$. Why would this inequality hold?

$$\left[\begin{array}{ccc}
a & b & c \\
d & e & f \\
g & h & i \\
\end{array} \right](https://arbital.com/p/)$$

Notice that each parenthesized expression on the left hand side of the inequality shares an element with each parenthesized expression on the right hand side of the inequality.This is true because the parenthesized expressions on the left hand side correspond to rows and the parenthesized expressions on the right hand side correspond to columns; each row of a matrix shares an element with each of its columns. The theorem proven in the *Common elements* exercise above then tells us that each parenthesized expression on the left hand side is less than or equal to each parenthesized expression on the right hand side.

Let $J = \{ a \wedge b \wedge c, d \wedge e \wedge f, g \wedge h \wedge i \}$ and $K = \{ a \vee d \vee g, b \vee e \vee h, c \vee f \vee i \}$. Then the hypothesis for the theorem proven in the *Another inequality* exercise holds, giving us $\bigvee J \leq \bigwedge K$, which is exactly what we wanted to prove. Extending this approach to the general case is straightforward.
%%


Mathematical induction

The **principle of mathematical induction** is a proof technique in which a statement, $P(n)$, is proven about a set of [natural numbers](https://arbital.com/p/45h) $n$. It may be best understood as treating the statements like dominoes: a statement $P(n)$ is true if the $n$-th domino is knocked down. We must knock down a first domino, or prove that a **base case** $P(m)$ is true. Next we must make sure the dominoes are close enough together to fall, or that the **inductive step** holds; in other words, we prove that if $k \geq m$ and $P(k)$ is true, $P(k+1)$ is true. Then since $P(m)$ is true, $P(m+1)$ is true; and since $P(m+1)$ is true, $P(m+2)$ is true, and so on.

An example
=======

We'll do an example to build our intuition before giving the proper definition of the principle. We'll provide yet another proof that
$$ 1 + 2 + \cdots + n = \frac{n(n+1)}{2}$$
for all integers $n \ge 1$. First, let's check the base case, where $n=1$:
$$ 1 = \frac{1(1+1)}{2} = \frac{2}{2} = 1.$$
This is (fairly obviously) true, so we can move forward with the inductive step. The inductive step includes an assumption, namely that the statement is true for some integer $k$ that is larger than the base integer. For our example, if $k\ge1$, we assume that
$$1 + 2 + \cdots + k = \frac{k(k+1)}{2}$$
and try to prove that
$$ 1 + 2 + \cdots + k + (k+1) = \frac{(k+1)([https://arbital.com/p/k+1](https://arbital.com/p/k+1)+1)}{2}.$$
Take our assumption and add $k+1$ to both sides:
$$1+2+\cdots + k + (k+1) = \frac{k(k+1)}{2} + k + 1.$$
Now the left-hand sides of what we know and what we want are the same. Hopefully the right-hand side will shake out to be the same. Get common denominators so that the right-hand side of the above equation is
$$\frac{k(k+1)}{2} + \frac{2(k+1)}{2} = \frac{(k+2)(k+1)}{2} = \frac{(k+1)([https://arbital.com/p/k+1](https://arbital.com/p/k+1)+1)}{2}.$$
Therefore,
$$ 1 + 2 + \cdots + k + (k+1) = \frac{(k+1)([https://arbital.com/p/k+1](https://arbital.com/p/k+1)+1)}{2}$$
as desired.

Let $P(n)$ be the statement for $n \ge 1$ that the sum of all integers between 1 and $n$ is $n(n+1)/2$. At the beginning we showed that the base case, $P(1)$, is true. Next we showed the inductive step, that if $k \ge 1$ and $P(k)$ is true, then $P(k+1)$ is true. This means that since $P(1)$ is true, $P(2)$ is true; and since $P(2)$ is true, $P(3)$ is true; etc., so that $P(n)$ is true for all integers $n \ge 1$.

Definition for the natural numbers
======

We are ready to properly define mathematical induction.

Weak mathematical induction
-------

Let $P(n)$ be a statement about the natural numbers. Then $P$ is true for all $n \ge m$ if

 1. $P(m)$ is true, and
 2. For all $k \ge m$, $P(k+1)$ is true if $P(k)$ is.

Strong mathematical induction
-----

Let $P(n)$ be a statement about the natural numbers. Then $P$ is true for all $n \ge m$ if

 1. $P(m)$ is true, and
 2. For all $k \ge m$, $P(k)$ is true so long as $P(\ell)$ is true for all $m \le \ell < k$.

A note: **strong mathematical induction** is a variant on mathematical induction by requiring a stronger inductive step, namely that the statement is true for *all* smaller indices, not just the immediate predecessor.

Induction on a well-ordered set
=====

Well done if your immediate response to the above material was, "Well, am I only restricted to this technique on the natural numbers?" No. As long as your index set is [well-ordered](https://arbital.com/p/55r), then strong mathematical induction will work.

However, if your ordered set is not well-ordered, you can prove properties 1 and 2 above, and still not have it hold for all elements beyond the base case. For instance, consider the set of nonnegative real numbers, and let $P(x)$ be the claim $x\leq 1$. Then $P(0)$ is true, and for all real numbers $x\ge 0$, $P(x)$ is true whenever $P(y)$ is true for all $0 \le y < x$. But of course $P(2)$ is false.

Kevin Clancy
Patrick LaVictoire
Dylan Hendrickson
Douglas Weathers
Eric Bruylant


Proposed A-Class

Post pages which you think should be A-Class in a comment here. Subscribe to this page to get updates about new proposals.

Once the number of approvals from [reviewers](https://arbital.com/p/5ft) reaches $3-rejections*2$ the page can be given an [A-Class](https://arbital.com/p/4yf) tag.


Proposed B-Class

Post pages which you think should be B-Class in a comment here. Subscribe to this page to get updates about new proposals.

Once the number of approvals from [reviewers](https://arbital.com/p/5ft) reaches $1-rejections*2$ the page can be given an [B-Class](https://arbital.com/p/4yd) tag.


Standard provability predicate

We know that every theory as [expressive](https://arbital.com/p/expressiveness_mathematics) as [https://arbital.com/p/-minimal_arithmetic](https://arbital.com/p/-minimal_arithmetic) (i.e., [$PA$](https://arbital.com/p/Peano_Arithmetic)) is capable of talking about [statements](https://arbital.com/p/statement_mathematics) about itself via [encodings](https://arbital.com/p/encoding) of [sentences](https://arbital.com/p/sentence_mathematics) of the language of [https://arbital.com/p/-arithmetic](https://arbital.com/p/-arithmetic) into the [natural numbers](https://arbital.com/p/45h).

Of particular interest is figuring out whether it is possible to write a formula $Prv(x)$ which is true [https://arbital.com/p/-46m](https://arbital.com/p/-46m) there exists a proof of $x$ from the axioms and rules of inference of our theory.

If we reflect on what a proof is, we will come to the conclusion that a proof is a sequence of symbols which follows certain rules. Concretely, it is a sequence of strings such that either:

1. The string is an [https://arbital.com/p/-axiom](https://arbital.com/p/-axiom) of the system or...
2. The string is a theorem that can be deduced from previous strings of the system by applying a [rule of inference](https://arbital.com/p/).

And the last string in the sequence corresponds to the theorem we want to prove.

If the axioms are a [https://arbital.com/p/-computable_set](https://arbital.com/p/-computable_set), and the rules of inference are also effectively computable, then checking whether a certain string is a proof of a given theorem is also computable.

Since every computable set can be defined by a [$\Delta_1$-formula](https://arbital.com/p/) in arithmetic %%note:[Proof](https://arbital.com/p/)%% then we can define the $\Delta_1$-formula $Prv(x,y)$ such that $PA\vdash Prv(n,m)$ iff $m$ encodes a proof of the sentence of arithmetic encoded by $n$.

Then a sentence $S$ is a theorem of $PA$ if $PA\vdash \exists y Prv(\ulcorner S \urcorner, y)$.

This formula is the standard provability predicate, which we will abbreviate as $\square_{PA}(x)$, and has some nice properties which correspond to what one would expect of a [https://arbital.com/p/-5j7](https://arbital.com/p/-5j7).

However, due to [non-standard models](https://arbital.com/p/non_standard_model), there are some intuitions about provability that the standard provability predicate fails to capture. For example, it turns out that $\square_{PA}A\rightarrow A$ [is not always a theorem of $PA$](https://arbital.com/p/55w).

There are non-standard models of $PA$ which contain numbers other than $0,1,2,..$ (called [non-standard models of arithmetic](https://arbital.com/p/non_standard_models_of_arithmetic)). In those models, the standard predicate $\square_{PA}x$ can be true even if for no natural number $n$ it is the case that $Prv(x,n)$. %%note:This condition is called [$\omega$-inconsistency](https://arbital.com/p/)%% This means that there is a non-standard number which satisfies the formula, but nonstandard numbers do not encode standard proofs!

Eric Rogstad
Eric Bruylant
Jaime Sevilla Molina

In theories extending [https://arbital.com/p/-minimal_arithmetic](https://arbital.com/p/-minimal_arithmetic) there exists a $\exists_1$-formula $\square_T$(x) which defines the existence of a proof in an [axiomatizable theory](https://arbital.com/p/) $T$.

The formula satisfies [some nice propereties](https://arbital.com/p/5j7), but fails to capture some intuitions about provability due to non-standard weirdness.


Löb's theorem and computer programs

The close relationship between [logic and computability](https://arbital.com/p/) allows us to frame Löb's theorem in terms of a computer program which is systematically looking for proofs of mathematical statements, `ProofSeeker(X)`.

ProofSeeker can be something like this:

    ProofSeeker(X):
        n=1
        while(True):
            if Prv(X,n): return True
            else n = n+1

Where `Prv(X,n)` is true if $n$ [encodes](https://arbital.com/p/) a proof of $X$%%note:See [https://arbital.com/p/-5gt](https://arbital.com/p/-5gt) for more info on how to talk about provablity%%.

Now we form a special sentence called a *reflection principle*, of the form $L(X)$= "*If `ProofSeeker(X)` halts, then X is true*". (This requires a [quine](https://arbital.com/p/322) to construct.)

Reflection principles are intuitively true, since ProofSeeker clearly halts iff it finds a proof of $X$, and if there is a proof of $X$, then $X$ must be true if we have chosen an appropriate [https://arbital.com/p/-5hh](https://arbital.com/p/-5hh) to search for proofs. For example, let's say that `ProofSeeker` is looking for proofs within [https://arbital.com/p/3ft](https://arbital.com/p/3ft).

The question now becomes, what happens when we call `ProofSeeker` on $L(X)$? Is $PA$ capable of proving that the reflection principle for any given $X$ is true, and therefore `ProofSeeker` will eventually halt? Or will it run forever?

Several possibilities appear:

1. If $PA\vdash X$, then certainly $PA\vdash L(X)$, since if the consequent of $L(X)$ is provable, then the whole sentence is provable.
2. If $PA\vdash \neg X$, then we cannot assert that $PA\vdash L(X)$, for that would imply asserting that $PA\vdash$"There is no proof of X". This is tantamount to $PA$ asserting the [https://arbital.com/p/-5km](https://arbital.com/p/-5km) of $PA$, which is forbidden by [Gödel's second incompleteness theorem](https://arbital.com/p/).
3. If $X$ is undecidable in $PA$, then if it were the case that $PA\vdash L(X)$ it would be inconsistent that $PA\vdash \neg X$ for the same reason as when $X$ is disprovable, and thus $PA\vdash X$, contradicting that it was undecidable.

**Löb's theorem** is the assertion that $PA$ proves the reflection principle for $X$ only if $PA$ proves $X$.

Or conversely, Löb's theorem states that if $PA\not\vdash X$ then $PA\not\vdash \square_{PA} X \rightarrow X$.

It can be [proved](https://arbital.com/p/) in $PA$ and stronger systems. It has a very strong link with Gödel's second incompleteness theorem, and in fact [they both are equivalent](https://arbital.com/p/).

Malcolm McCrimmon
Jaime Sevilla Molina
Eric Rogstad
Patrick LaVictoire


Gödel II and Löb's theorem

The abstract form of [Gödel's second incompleteness theorem](https://arbital.com/p/) states that if $P$ is a provability predicate in a [consistent](https://arbital.com/p/5km), [https://arbital.com/p/-axiomatizable](https://arbital.com/p/-axiomatizable) theory $T$ then $T\not\vdash \neg P(\ulcorner S\urcorner)$ for a disprovable $S$.

On the other hand, [Löb's theorem](https://arbital.com/p/55w) says that in the same conditions and for every sentence $X$, if $T\vdash P(\ulcorner X\urcorner)\rightarrow X$, then $T\vdash X$.

It is easy to see how GII follows from Löb's. Just take $X$ to be $\bot$, and since $T\vdash \neg \bot$ (by definition of $\bot$), Löb's theorem tells that if $T\vdash \neg P(\ulcorner \bot\urcorner)$ then $T\vdash \bot$. Since we assumed $T$ to be consistent, then the consequent is false, so we conclude that $T\neg\vdash \neg P(\ulcorner \bot\urcorner)$.

The rest of this article exposes how to deduce Löb's theorem from GII.

Suppose that $T\vdash P(\ulcorner X\urcorner)\rightarrow X$.

Then $T\vdash \neg X \rightarrow \neg P(\ulcorner X\urcorner)$.

Which means that $T + \neg X\vdash \neg P(\ulcorner X\urcorner)$.

From Gödel's second incompleteness theorem, that means that $T+\neg X$ is inconsistent, since it proves $\neg P(\ulcorner X\urcorner)$ for a disprovable $X$.

Since $T$ was consistent before we introduced $\neg X$ as an axiom, then that means that $X$ is actually a consequence of $T$. By completeness, that means that we should be able to prove $X$ from $T$'s axioms, so $T\vdash X$ and the proof is done.

[Gödel's second incompleteness theorem](https://arbital.com/p/) and [Löb's theorem](https://arbital.com/p/) are equivalent to each other.


Provability predicate

A provability predicate is a formula $P$ of a theory satisfying the Hilbert-Bernais derivability conditions. If the diagonal theorem is applicable in the theory as well, then [https://arbital.com/p/55w](https://arbital.com/p/55w) and [Gödel's second incompleteness theorem](https://arbital.com/p/) are provable for $P$.

The Hilbert-Bernais derivability conditions are as follows:

1. (**Necessitation**) If $T\vdash S$, then $T\vdash P(\ulcorner S \urcorner)$
2. (**Provability of modus ponens / distributive axioms**) $T\vdash P(\ulcorner A\rightarrow B \urcorner)\rightarrow (P(\ulcorner A \urcorner)\rightarrow P(\ulcorner B \urcorner))$
3. (**Provability of renecessitation**) $T\vdash P(\ulcorner S \urcorner)\rightarrow P(\ulcorner P(\ulcorner S \urcorner) \urcorner)$

The derivability conditions are tighlty related to the axioms and rules of inference of [https://arbital.com/p/-534](https://arbital.com/p/-534). In fact, the normal systems of provability are defined as those that have necessitation as a rule and the distributive axioms. %%note:They also have to be closed under substitution%% On the other hand, D3 is the axiom that defines the system [K4](https://arbital.com/p/), and it is also satisfied by [https://arbital.com/p/GL](https://arbital.com/p/GL).

##Examples

The **verum** formula $x=x$ trivially satisfies the derivability conditions.

The [https://arbital.com/p/-5gt](https://arbital.com/p/-5gt) of arithmetic is a provability predicate.

A provability predicate of a theory $T$ is a formula $P(x)$ with one free variable $x$ such that:

1. If $T\vdash S$, then $T\vdash P(\ulcorner S \urcorner)$
2. $T\vdash P(\ulcorner A\rightarrow B \urcorner)\rightarrow (P(\ulcorner A \urcorner)\rightarrow P(\ulcorner B \urcorner))$
3. $T\vdash P(\ulcorner S \urcorner)\rightarrow P(\ulcorner P(\ulcorner S \urcorner) \urcorner)$


Normal system of provability logic

Between the modal systems of provability, the normal systems distinguish themselves by exhibiting nice properties that make them useful to reason.

A normal system of provability is defined as satisfying the following conditions:

1. Has **necessitation** as a rule of inference. That is, if $L\vdash A$ then $L\vdash \square A$.
2. Has **modus ponens** as a rule of inference: if $L\vdash A\rightarrow B$ and $L\vdash A$ then $L\vdash B$.
3. Proves all **tautologies** of propositional logic.
4. Proves all the **distributive axioms** of the form $\square(A\rightarrow B)\rightarrow (\square A \rightarrow \square B)$.
5. It is **closed under substitution**. That is, if $L\vdash F(p)$ then $L\vdash F(H)$ for every modal sentence $H$.

The simplest normal system, which only has as axioms the tautologies of propositional logic and the distributive axioms, it is known as the [K system](https://arbital.com/p/).

##Normality
The good properties of normal systems are collectively called **normality**.

Some theorems of normality are:

* $L\vdash \square(A_1\wedge ... \wedge A_n)\leftrightarrow (\square A_1 \wedge ... \wedge \square A_n)$
* Suppose $L\vdash A\rightarrow B$. Then $L\vdash \square A \rightarrow \square B$ and $L\vdash \diamond A \rightarrow \diamond B$.
* $L\vdash \diamond A \wedge \square B \rightarrow \diamond (A\wedge B)$

##First substitution theorem
Normal systems also satisfy the first substitution theorem.
>(**First substitution theorem**) Suppose $L\vdash A\leftrightarrow B$, and $F(p)$ is a formula in which the sentence letter $p$ appears. Then $L\vdash F(A)\leftrightarrow F(B)$.

##The hierarchy of normal systems
The most studied normal systems can be ordered by extensionality:

![Hierarchy of normal systems](http://i.imgur.com/1yrL9FU.png)

Those systems are:

* The system K
* The system K4
* The system [GL](https://arbital.com/p/5l3)
* The system T
* The system S4
* The system B
* The system S5


Group presentation

summary(Technical): A presentation $\langle X \mid R \rangle$ of a [group](https://arbital.com/p/3gd) $G$ is a set $X$ of *generators* and a set $R$ of *relators* which are words on $X \cup X^{-1}$, such that $G \cong F(X) / \llangle R \rrangle^{F(X)}$ the [https://arbital.com/p/-normal_closure](https://arbital.com/p/-normal_closure) of $\llangle R \rrangle$ with respect to the [https://arbital.com/p/-5kg](https://arbital.com/p/-5kg) $F(X)$.

A presentation $\langle X \mid R \rangle$ of a group $G$ is an object that can be viewed in two ways:

 - a way of making $G$ as a [quotient](https://arbital.com/p/4tq) of the [https://arbital.com/p/-5kg](https://arbital.com/p/-5kg) on some set $X$
 - a set $X$ of *generators* (from which we form the set $X^{-1}$ of formal inverses to $X$%%note:For example, if $X = \{ a, b \}$ then $X^{-1}$ is a set of new symbols which we may as well write $\{ a^{-1}, b^{-1} \}$. %%), and a set $R$ of *relators* (which must be [freely reduced words](https://arbital.com/p/5jc) on $X \cup X^{-1}$), such that every element of $G$ may be written as a product of the generators and such that by combining elements of $R$ we can obtain every possible way of expressing the identity element of $G$ as a product of elements of $X$.

Every group $G$ has a presentation with $G$ as the set of generators, and the set of relators is the set containing every trivial word.
Of course, this presentation is in general not unique: we may, for instance, add a new generator $t$ and the relator $t$ to any presentation to obtain an [isomorphic](https://arbital.com/p/49x) presentation.

The above presentation corresponds to taking the quotient of the free group $F(G)$ on $G$ by the homomorphism $\phi: F(G) \to G$ which sends a word $(a_1, a_2, \dots, a_n)$ to the product $a_1 a_2 \dots a_n$.
This is an instance of the more widely-useful fact that every group is a [quotient](https://arbital.com/p/4tq) of a [https://arbital.com/p/-5kg](https://arbital.com/p/-5kg) ([proof](https://arbital.com/p/5jb)).

# Examples

- The [https://arbital.com/p/-47y](https://arbital.com/p/-47y) $C_2$ on two elements has a presentation $\langle x \mid x^2 \rangle$. That is, it has just one generator, $x$, and the relator $x^2$ tells us that $x^2$ is the [identity](https://arbital.com/p/54p) $e$.
Notice that $\langle x \mid x^4 \rangle$ would also satisfy the description that "there is one generator, and $x^4$ is the identity". However, the group corresponding to *this* presentation contains four elements, not two, so it is not $C_2$. This demonstrates the fact that if we have a presentation $\langle X \mid R \rangle$, and a group can be written in such a way that all the relators hold in the group, and the group can be generated by the elements of $X$, that still doesn't mean the presentation describes the group; it could be that extra relations hold in the group that aren't listed in $R$. (In this case, for example, $x^2 = e$ is not listed in $\langle x \mid x^4 \rangle$.)
- The presentation $\langle x, y \mid xyx^{-1}y^{-1} \rangle$ describes a group with two generators, such that the only nontrivial relation is $xyx^{-1}y^{-1} = e$ (and anything that can be built up from that). That relation may be written as $xy=yx$: that is, $x$ and $y$ [commute](https://arbital.com/p/3jb). This tells us that the group is [abelian](https://arbital.com/p/3h2), since every generator commutes with every other generator. In fact, this group's elements are just words $x^n y^m$ for some integers $n, m$; this follows because, for instance, $xyx = xxy = x^2y$, and in general we can pull all the instances of the letter $x$ (and $x^{-1}$) out to the front of the word. Therefore we can write an element of this group as $(m, n)$ where $m, n$ are integers; hence the group is just $\mathbb{Z}^2$ with pointwise addition as its operation.
- The presentation $\langle x, y \mid x^2, y \rangle$ is just $C_2$ again. Indeed, we have a relator telling us that $y$ is equal to the identity, so we might as well just omit it from the generating set (because it doesn't add anything new to any word in which it appears).
- The presentation $\langle a, b \mid aba^{-1}b^{-2}, bab^{-1}a^{-2} \rangle$ is a longwinded way to define the trivial group (the group with one element). To prove this, it is enough to show that each generator represents the identity, because then every word on the generators has been made up from the identity element so is itself the identity. We have access to the facts that $ab = b^2 a$ and that $ba = a^2 b$ in this group (because, for example, $aba^{-1} b^{-2} = e$). The rest of the proof is an exercise.

%%hidden(Show solution):
We have $ab = b^2 a$ from the first relator; that is $b ba$.
But $ba = a^2 b$ is the second relator, so that is $b a^2 b$; hence $ab = b a^2 b$ and so $a = b a^2$ by cancelling the rightmost $b$.
Then by cancelling the rightmost $a$, we obtain $e = ba$, and hence $a = b^{-1}$.

But now by the first relator, $ab = b^2 a = b b a$; using that both $ab$ and $ba$ are the identity, this tells us that $e = b$; so $b$ is trivial.

Now $a = b^{-1}$ and so $a$ is trivial too.
%%

A presentation $\langle X \mid R \rangle$ of a [group](https://arbital.com/p/3gd) is, informally, a way of specifying the group by a set $X$ of *generators* together with a set $R$ of *relators*.
Every element of the group is some product of generators, and the relators tell us when a product is trivial.


Every group is a quotient of a free group

Given a [group](https://arbital.com/p/3gd) $G$, there is a [https://arbital.com/p/-free_group](https://arbital.com/p/-free_group) $F(X)$ on some set $X$, such that $G$ is [isomorphic](https://arbital.com/p/49x) to some [quotient](https://arbital.com/p/4tq) of $F(X)$.

This is an instance of a much more general phenomenon: for a general [monad](https://arbital.com/p/monad_category_theory) $T: \mathcal{C} \to \mathcal{C}$ where $\mathcal{C}$ is a category, if $(A, \alpha)$ is an [algebra](https://arbital.com/p/eilenberg_moore_category) over $T$, then $\alpha: TA \to A$ is a [coequaliser](https://arbital.com/p/coequaliser_category_theory). ([Proof.](https://arbital.com/p/algebras_are_coequalisers))

# Proof
Let $F(G)$ be the free group on the elements of $G$, in a slight abuse of notation where we use $G$ interchangeably with its [https://arbital.com/p/-3gz](https://arbital.com/p/-3gz).
Define the [homomorphism](https://arbital.com/p/47t) $\theta: F(G) \to G$ by "multiplying out a word": taking the word $(a_1, a_2, \dots, a_n)$ to the product $a_1 a_2 \dots a_n$.

This is indeed a group homomorphism, because the group operation in $F(G)$ is concatenation and the group operation in $G$ is multiplication: clearly if $w_1 = (a_1, \dots, a_m)$, $w_2 = (b_1, \dots, b_n)$ are words, then $$\theta(w_1 w_2) = \theta(a_1, \dots, a_m, b_1, \dots, b_m) = a_1 \dots a_m b_1 \dots b_m = \theta(w_1) \theta(w_2)$$

This immediately expresses $G$ as a quotient of $F(G)$, since [kernels of homomorphisms are normal subgroups](https://arbital.com/p/4h7).


Freely reduced word

summary: A "word" over a set $X$ is a finite ordered list of elements from $X$ and $X^{-1}$ (where $X^{-1}$ is the set of formal inverses of the elements of $X$), as if we were treating the elements of $X$ and $X^{-1}$ as letters of an alphabet. A "freely reduced" word over $X$ is one which doesn't contain any consecutive cancelling letters such as $x x^{-1}$.

Given a [set](https://arbital.com/p/3jz) $X$, we can make a new set $X^{-1}$ consisting of "formal inverses" of elements of $X$.
That is, we create a set of new symbols, one for each element of $X$, which we denote $x^{-1}$; so $$X^{-1} = \{ x^{-1} \mid x \in X \}$$

By this stage, we have not given any kind of meaning to these new symbols.
Though we have named them suggestively as $x^{-1}$ and called them "inverses", they are at this point just objects.

Now, we apply meaning to them, giving them the flavour of group inverses, by taking the [union](https://arbital.com/p/set_union) $X \cup X^{-1}$ and making finite "words" out of this combined "alphabet".

A finite word over $X \cup X^{-1}$ consists of a list of symbols from $X \cup X^{-1}$.
For example, if $X = \{ 1, 2 \}$ %%note:Though in general $X$ need not be a set of numbers.%%, then some words are:

- The empty word, which we commonly denote $\varepsilon$
- $(1)$
- $(2)$
- $(2^{-1})$
- $(1, 2^{-1}, 2, 1, 1, 1, 2^{-1}, 1^{-1}, 1^{-1})$

For brevity, we usually write a word by just concatenating the "letters" from which it is made:

- The empty word, which we commonly denote $\varepsilon$
- $1$
- $2$
- $2^{-1}$
- $1 2^{-1} 2 1 1 1 2^{-1} 1^{-1} 1^{-1}$

For even more brevity, we can group together successive instances of the same letter.
This means we could also write the last word as $1 2^{-1} 2 1^3 2^{-1} 1^{-2}$.

Now we come to the definition of a **freely reduced** word: it is a word which has no subsequence $r r^{-1}$ or $r^{-1} r$ for any $r \in X$.

# Example

If $X = \{ a, b, c \}$, then we might write $X^{-1}$ as $\{ a^{-1}, b^{-1}, c^{-1} \}$ (or, indeed, as $\{ x, y, z \}$, because there's no meaning inherent in the $a^{-1}$ symbol so we might as well write it as $x$).

Then $X \cup X^{-1} = \{ a,b,c, a^{-1}, b^{-1}, c^{-1} \}$, and some examples of words over $X \cup X^{-1}$ are:

- The empty word, which we commonly denote $\varepsilon$
- $a$
- $aaaa$
- $b$
- $b^{-1}$
- $ab$
- $ab^{-1}cbb^{-1}c^{-1}$
- $aa^{-1}aa^{-1}$

Of these, all except the last two are freely reduced.
However, $ab^{-1}cbb^{-1}c^{-1}$ contains the substring $bb^{-1}$, so it is not freely reduced; and $aa^{-1}aa^{-1}$ is not freely reduced (there are several ways to see this: it contains $aa^{-1}$ twice and $a^{-1} a$ once).

%%hidden(Alternative, more opaque, treatment which might help with one aspect):
This chunk is designed to get you familiar with the idea that the symbols $a^{-1}$, $b^{-1}$ and so on in $X^{-1}$ don't have any inherent meaning.

If we had (rather perversely) gone with $\{ x, y, z \}$ as the corresponding "inverses" to $\{ a, b, c \}$ (in that order), rather than $\{ a^{-1}, b^{-1}, c^{-1} \}$ as our "inverses" %%note:Which you should never do. It just makes things harder to read.%%, then the above words would look like:

- The empty word, which we commonly denote $\varepsilon$
- $a$
- $aaaa$, which we might also write as $a^4$
- $b$
- $y$
- $ab$
- $aycbyz$
- $axax$

For the same reasons, all but the last two would be freely reduced.
However, $aycbyz$ contains the substring $by$ so it is not freely reduced; and $axax$ is not freely reduced (there are several ways to see this: it contains $ax$ twice and $xa$ once).
%%

# Why are we interested in this?

We can use the freely reduced words to construct the [https://arbital.com/p/-5kg](https://arbital.com/p/-5kg) on a given set $X$; this group has as its elements the freely reduced words over $X \cup X^{-1}$, and as its group operation "concatenation followed by free reduction" (that is, removal of pairs $r r^{-1}$ and $r^{-1} r$). %%note:We make this construction properly rigorous, and check that it is indeed a group, on the [https://arbital.com/p/5kg](https://arbital.com/p/5kg) page.%%
The notion of "freely reduced" basically tells us that $r r^{-1}$ is the identity for every letter $r \in X$, as is $r^{-1} r$; this cancellation of inverses is a property we very much want out of a group.

The free group is (in a certain well-defined sense from [https://arbital.com/p/-4c7](https://arbital.com/p/-4c7)%%note:See [https://arbital.com/p/free_group_functor_is_left_adjoint_to_forgetful](https://arbital.com/p/free_group_functor_is_left_adjoint_to_forgetful) for the rather advanced reason why.%%) the purest way of making a group containing the elements $X$, but to make it, we need to throw in inverses for every element of $X$, and then make sure the inverses play nicely with the original elements (which we do by free reduction).
That is why we need "freely-reducedness".

Eric Rogstad
Eric Bruylant
Patrick Stevens


Division of rational numbers (Math 0)

So far in our study of the [arithmetic](https://arbital.com/p/514) of [rational numbers](https://arbital.com/p/4zq), we've had [addition](https://arbital.com/p/55m) ("putting apples and chunks of apples side by side and counting what you've got"), [subtraction](https://arbital.com/p/56x) ("the same, but you're allowed anti-apples too"), and [multiplication](https://arbital.com/p/59s) ("make a rational number, but instead of starting from $1$ apple, start from some other number").

**Division** is what really sets the rational numbers apart from the [integers](https://arbital.com/p/53r), and it is the mathematician's answer to the question "if I have some apples, how do I share them among my friends?".

# What's wrong with the integers?

If you have an integer number of apples (that is, some number of apples and anti-apples - no chunks allowed, just whole apples and anti-apples), and you want to share them with friends, sometimes you'll get lucky.
If you have four apples, for instance, then you can share them out between yourself and one friend, giving each person two apples.

But sometimes (often, in fact) you'll get unlucky.
If you want to share four apples between yourself and two others, then you can give each person one apple, but there's this pesky single apple left over which you just can't share.

# What the rationals do for us

The trick, obvious to anyone who has ever eaten a cake, is to cut the leftover apple into three equally-sized pieces and give each person a piece.
Now we have shared out all four apples equally.

But in order to do so, we've left the world of the integers, and in getting out our knife, we started working in the rationals.
How much apple has everyone received, when we shared four apples among three people (that is, myself and two friends as recipients of apple)?
%%hidden(Show solution):
Everyone got $\frac{4}{3}$.

Indeed, everyone got one whole apple; and then we chopped the remaining apple into three $\frac{1}{3}$-chunks and gave everyone one chunk.
So everyone ended up with one apple and one $\frac{1}{3}$-chunk.

By our instant addition rule %%note:If you've forgotten it, check out the [addition page](https://arbital.com/p/55m) again; it came from working out a chunk size out of which we can make both the $\frac{1}{3}$-chunk and the $1$-chunk.%%, $$1 + \frac{1}{3} = \frac{1}{1} + \frac{1}{3} = \frac{3 \times 1 + 1 \times 1}{3 \times 1} = \frac{3+1}{3} = \frac{4}{3}$$

There's another way to see this, if (laudably!) you don't like just applying rules.
We could cut *every* apple into three pieces at the beginning, so we're left with four collections of three $\frac{1}{3}$-sized chunks.
But now it's easy to share this among three people: just give everyone one of the $\frac{1}{3}$-chunks from each apple.
We gave everyone four chunks in total, so this is $\frac{4}{3}$.
%%

The rationals provide the natural answer to all "sharing" questions about apples.

We write "rational number $x$ divided by rational number $y$" as $\frac{x}{y}$: that is, $x$ apples divided amongst $y$ people.
(We'll soon get to what it means to divide by a non-integer number of people; just roll with it for now.)
If space is a problem, we can write $a/n$ instead.
Notice that our familiar notation of "$\frac{1}{m}$-sized chunks" is actually just $1$ apple divided amongst $m$ people: it's the result of dividing $1$ into $m$ equal chunks.
So the notation does make sense, and it's just an extension of the notation we've been using already.

# Division by a natural number

In general, $\frac{a}{m}$ apples, divided amongst $n$ people, is obtained by the "other way" above.
Cut the $\frac{a}{m}$ into $n$ pieces, and then give everyone an equal number of pieces.

Remember, $\frac{a}{m}$ is made of $a$ copies of pieces of size $\frac{1}{m}$; so what we do is cut all of the $\frac{1}{m}$-chunks individually into $n$ pieces, and then give everyone $a$ of the little pieces we've made.
But "cut a $\frac{1}{m}$-chunk into $n$ pieces" is just "cut an apple into $n$ pieces, but instead of doing it to one apple, do it to a $\frac{1}{m}$-chunk": that is, it is $\frac{1}{m} \times \frac{1}{n}$, or $\frac{1}{m \times n}$.

So the answer is just $$\frac{a}{m} / n = \frac{a}{m \times n}$$

## Example

# Division by a negative integer

What would it even mean to divide an apple between four anti-people?
How about a simpler question: dividing an apple between one anti-person%%note:Remembering that dividing $x$ apples between one person just gives $x$, since there's not even any cutting of the apples necessary.%%? (The answer to this would be $\frac{1}{-1}$.) It's not obvious!

Well, the thing to think about here is that if I take an apple, and share it among one person %%note:Myself, probably. I'm very selfish.%%, then I've got just the same apple as before (cut into no chunks): that is, $\frac{1}{1} = 1$.
Also, if I take an apple and share it among one person who is *not* myself (and I don't give any apple to myself), then we've also just got the same unsliced apple as before: $\frac{1}{1} = 1$ again.

But if I take an apple, and give it to an *anti*-person%%note:Being very careful not to touch them, because I would annihilate an anti-person!%%, then from their perspective *I*'m the anti-person, and I've just given them an anti-apple.
There's a law of symmetry built into reality: the laws of physics are invariant if we reflect "thing" and "anti-thing" throughout the universe.%%note:Technically this is not *quite* true: the actual symmetry is on reflecting charge, parity and time all together, rather than just parity alone. But for the purposes of this discussion, let's pretend that the universe is parity-symmetric.%%
The anti-person sees the universe in a way that's the same as my way, but where the "anti" status of everything (and everyantithing) is flipped.

Put another way, "anti-ness" is not an absolute notion but a relative one.
I can only determine whether something is the same anti-ness or the opposite anti-ness to myself.

Sear this into your mind: the laws of rational-number "physics" are the same no matter who is observing.
If I observe a transaction, like "I, a person, give someone an apple", then an external person will observe "The author, a person, gave someone an apple", while an external anti-person will observe "The author, an anti-person, gave an anti-person an anti-apple".

From the external person's perspective, they saw "someone (of the same anti-ness as me) gave someone else (of the same anti-ness as me) an apple (of the same anti-ness as me)".
From the anti-person's perspective, everything is relatively the same: "someone (of the opposite anti-ness to me) gave someone else (of the opposite anti-ness to me) an apple (of the opposite anti-ness to me)".

So $\frac{-1}{-1}$, being "one anti-apple shared among one anti-person", can be viewed instead from the perspective of an anti-person; they see one *apple* being given to one *person*: that is, $\frac{-1}{-1}$ is equal to $1$.

Armed with the fact that $\frac{-1}{-1} = 1$, we can just apply our usual multiplication rule that $\frac{a}{m} \times \frac{b}{n} = \frac{a \times b}{m \times n}$, to deduce that $$\frac{1}{-m} = \frac{1}{-m} \times 1 = \frac{1}{-m} \times \frac{-1}{-1} = \frac{-1 \times 1}{-m \times -1} = \frac{-1}{m}$$

The law of symmetry-of-the-universe basically says that $\frac{a}{-b} = \frac{-a}{b}$.

Division captures the idea of "sharing" apples between people, and it is the core motivating idea of the rational numbers.


Monotone function

Let $\langle P, \leq_P \rangle$ and $\langle Q, \leq_Q \rangle$ be [posets](https://arbital.com/p/3rb). Then a function $\phi : P \rightarrow Q$ is said to be **monotone** (alternatively, **order-preserving**) if for all $s, t \in P$, $s \le_P t$ implies $\phi(s) \le_Q \phi(t)$.

Positive example
------

![A simple monotone map phi](http://i.imgur.com/6w11VT2.png)

%%comment:
dot source:

digraph G {
  node [= 0.1, height = 0.1](https://arbital.com/p/width)
  rankdir = BT;
  rank = same;
  compound = true;
  fontname="MathJax_Main";

  subgraph cluster_P {
    node [https://arbital.com/p/style=filled,color=white](https://arbital.com/p/style=filled,color=white);
    edge [= "none"](https://arbital.com/p/arrowhead);
    style = filled;
    color = lightgrey;
    fontcolor = black;
    label = "P";
    labelloc = b;
    b -> a;
    c -> a;

  }
  subgraph cluster_Q {
    node [https://arbital.com/p/style=filled](https://arbital.com/p/style=filled);
    edge [= "none"](https://arbital.com/p/arrowhead);
    color = black;
    fontcolor = black;
    label= "Q";
    labelloc = b;
    u -> t;
  }
  edge [= blue, style = dashed](https://arbital.com/p/color)
  fontcolor = blue;
  label = "φ";
  labelloc = t;
  b -> t [= false](https://arbital.com/p/constraint);
  a -> t [= false](https://arbital.com/p/constraint);
  c -> u [= false](https://arbital.com/p/constraint);
}

%%

Here is an example of a monotone map $\phi$ from a poset $P$ to another poset $Q$. Since $\le_P$ has two comparable pairs of elements, $(c,a)$ and $(b,a)$, there are two constraints that $\phi$ must satisfy to be considered monotone. Since $c \leq_P a$, we need $\phi(c) = u \leq_Q t = \phi(a)$. This is, in fact, the case. Also, since $b \leq_P a$, we need $\phi(b) = t \leq_Q t = \phi(a)$. This is also true.

Negative example
---------------

![A simple, non-monotone map](http://i.imgur.com/Zp0wSnP.png)

%%comment:
dot source:

digraph G {
  node [= 0.1, height = 0.1](https://arbital.com/p/width)
  rankdir = BT;
  rank = same;
  compound = true;
  fontname="MathJax_Main";

  subgraph cluster_P {
    node [https://arbital.com/p/style=filled,color=white](https://arbital.com/p/style=filled,color=white);
    edge [= "none"](https://arbital.com/p/arrowhead);
    style = filled;
    color = lightgrey;
    fontcolor = black;
    label = "P";
    labelloc = b;
    a -> b;
  }

  subgraph cluster_Q {
    node [https://arbital.com/p/style=filled](https://arbital.com/p/style=filled);
    edge [= "none"](https://arbital.com/p/arrowhead);
    color = black;
    fontcolor = black;
    label= "Q";
    labelloc = b;
    w -> u;
    w -> v;
    u -> t;
    v -> t;
  }
  edge [= blue, style = dashed](https://arbital.com/p/color)
  fontcolor = blue;
  label = "φ";
  labelloc = t;
  b -> u [= false](https://arbital.com/p/constraint);
  a -> v [= false](https://arbital.com/p/constraint);
}
%%

Here is an example of another map $\phi$ between two other posets $P$ and $Q$. This map is not monotone, because $a \leq_P b$ while $\phi(a) = v \parallel_Q u = \phi(b)$.

Additional material
----------------------------------

For some examples of montone functions and their applications, see [https://arbital.com/p/5lf](https://arbital.com/p/5lf). To test your knowledge of monotone functions, head on over to [https://arbital.com/p/6pv](https://arbital.com/p/6pv).


Exponential notation for function spaces

If $X$ and $Y$ are sets, the set of functions from $X$ to $Y$ (often written $X \to Y$) is sometimes also written $Y^X$. This latter notation, which we'll call *exponential notation*, is related to the notation for finite powers of sets (e.g., $Y^3$ for the set of triples of elements of $Y$) as well as the notation of exponentiation for numbers.

Without further ado, here are some reasons this is good notation.

- A function $f : X \to Y$ can be thought of as an "$X$ wide" tuple of elements of $Y$. That is, a tuple of elements of $Y$ where the positions in the tuple are given by elements of $X$, generalizing the notation $Y^n$ which denotes the set of $n$ wide tuples of elements of $Y$. Note that if $|X| = n$, then $Y^X \cong Y^n$.

- This notion of exponentiation together with cartesian product as multiplication and disjoint union as addition satisfy the same relations as exponentiation, multiplication, and addition of natural numbers. Namely,

  - $Z^{X \times Y} \cong (Z^X)^Y$ (this isomorphism is called currying)
  - $Z^{X + Y} \cong Z^X \times Z^Y$
  - $Z^1 \cong Z$ (where $1$ is a one element set, since there is one function into $Z$ for every element of $Z$)
  - $Z^0 \cong 1$ (where $0$ is the empty set, since there is one function from the empty set to any set)

More generally, $Y^X$ is good notation for the exponential object representing $\text{Hom}_{\mathcal{C}}(X, Y)$ in an arbitrary cartesian closed category $\mathcal{C}$ for the first set of reasons listed above.


Free group

Intuitively, the free [https://arbital.com/p/-3gd](https://arbital.com/p/-3gd) $F(X)$ on the [set](https://arbital.com/p/3jz) $X$ is the group whose elements are the [freely reduced words](https://arbital.com/p/5jc) over $X$, and whose group operation is "[https://arbital.com/p/-concatenation](https://arbital.com/p/-concatenation) followed by free reduction".

The free group can be constructed rigorously in several equivalent ways, some of which are easy to construct but hard to understand, and some of which are intuitive but rather hard to define properly.
Our formal construction (detailed on the [Formal Definition lens](https://arbital.com/p/5s1)) will be one of the more opaque definitions; there, we eventually show that the formal construction yields a group which is [isomorphic](https://arbital.com/p/49x) to the intuitive version, and this will prove that the intuitive version does in fact define a group with the right properties for the free group.

# Intuitive definition

Given a set $X$, the free group $F(X)$ (or $FX$) on $X$ has:

- as its elements, the [freely reduced words](https://arbital.com/p/5jc) over $X$;
- as its group [operation](https://arbital.com/p/3h7), "concatenation followed by free reduction".

## Example

The free group on the set $X = \{ a, b \}$ contains the following elements (among others):

- The word $(a,b,a,a,a,b^{-1})$, which is written in shorthand as $abaaab^{-1}$ or (most commonly) as $aba^3b^{-1}$
- The empty word $()$, which is written as $\varepsilon$
- The word $(b,b,b)$, which is written as $b^3$
- The word $(a^{-1}, b^{-1}, b^{-1})$, or $a^{-1} b^{-2}$

(From now on, we will only use the common shorthand to denote words, except in cases where this interferes with something else we're doing.)

Some things which the same free group does *not* contain are:

- $aa^{-1}$, since this is not freely reduced
- $c$, for the fatuous reason that $c$ is not a word over the alphabet $\{a,b\}$
- $abb^{-1}a$, since this is not freely reduced.

Some examples of this group's group operation (which we will write as $\cdot$) in action are:

- $aba \cdot bab = ababab$
- $aba^2 \cdot a^3b = aba^5b$
- $aba^{-1} \cdot a = ab$, obtained as the free reduction of $aba^{-1}a$
- $ab \cdot b^{-1} a^{-1} = \varepsilon$, obtained as $abb^{-1}a^{-1} = aa^{-1}$ (reduction of $b$) and then $a a^{-1} = \varepsilon$.

# Examples

- The free group on the empty set is just the trivial group, the group with just one element. Indeed, we must have an identity (the empty word), but there are no extra generators to throw in, so there are no longer words.
- The free group on a set with one element is isomorphic to the group of integers under addition. Indeed, say our set is $\{ a \}$; then every member of the free group is a word of the form $a^n$ or $a^{-n}$ or $a^0$. Then the isomorphism is that $a^i$ is sent to $i \in \mathbb{Z}$.
- The free group on two elements is [countable](https://arbital.com/p/2w0). Indeed, its elements are all of the form $a^{i_1} b^{j_1} a^{i_2} b^{j_2} \dots a^{i_n} b^{j_n}$, and so the free group [injects](https://arbital.com/p/4b7) into the [set of natural numbers](https://arbital.com/p/45h) by the (rather convoluted) $$a^{i_1} b^{j_1} a^{i_2} b^{j_2} \dots a^{i_n} b^{j_n} \mapsto 2^{\mathrm{sgn}(i_1)+2} 3^{|i_1|} 5^{\mathrm{sgn}(j_1)+2} 7^{|j_1|} \dots$$
where we produce the natural number %%note:Uniquely, by the [https://arbital.com/p/-5rh](https://arbital.com/p/-5rh).%% whose prime factors tell us exactly how to construct the original word. %%note:This trick is extremely useful in determining whether a set is countable, and you should go over it until you are sure you understand it.%% (The $\mathrm{sgn}$ function outputs $-1$ if its input is negative; $1$ if the input is positive; and $0$ if its input is $0$.)
As a related exercise, you should prove that the free group on a countable set is countable.

# Why are the free groups important?

It is a fact that [https://arbital.com/p/-5jb](https://arbital.com/p/-5jb).
Therefore the free groups can be considered as a kind of collection of "base groups" from which all other groups can be made as quotients.
This idea is made more concrete by the idea of the [https://arbital.com/p/-5j9](https://arbital.com/p/-5j9), which is a notation that specifies a group as a quotient of a free group. %%note:Although it's not usually presented in this way at first, because the notation has a fairly intuitive meaning on its own.%%

## Free groups "have no more relations than they are forced to have"

The crux of the idea of the group presentation is that the free group is the group we get when we take all the elements of the set $X$ as elements which "generate" our putative group, and then throw in every possible combination of those "generators" so as to complete it into a bona fide group.
We explain why the free group is (informally) a "pure" way of doing this, by walking through an example.

%%%hidden(Example):
If we want a group which contains the elements of $X = \{ a, b \}$, then what we *could* do is make it into the [https://arbital.com/p/-47y](https://arbital.com/p/-47y) on the two elements, $C_2$, by insisting that $a$ be the [identity](https://arbital.com/p/54p) of the group and that $b \cdot b = a$.
However, this is a very ad-hoc, "non-pure" way of making a group out of $X$. %%note:For those who are looking out for that sort of thing, to do this in generality will require heavy use of the [axiom of choice](https://arbital.com/p/69b).%%
It adds the "relation" $b^2 = a$ which wasn't there before.

Instead, we might make the free group $FX$ by taking the two elements $a, b$, and throwing in everything we are forced to make if no non-trivial combination is the identity.
For example:

- we have no reason to suspect that either $a$ or $b$ is already the identity, so we must throw in an identity which we will label $\varepsilon$;
- we have no reason to suspect that $a \cdot b$ should be equal to $a$ or to $b$ or to $\varepsilon$, so we must throw in an element equal to $a \cdot b$ which we will label $ab$;
- we *do* have a reason to suspect that $a^{-1} \cdot a$ is already in the group (because it "ought to be" the identity $\varepsilon$), so we don't throw in the element $a^{-1} a$;
- and so on through all the words, such as $a^{-1}ba^2b^{-2}$ and so forth.

This way adds an awfully large number of elements, but it doesn't require us to impose any arbitrary relations.
%%%

# Universal property of the free group

The free group [has a universal property](https://arbital.com/p/free_group_universal_property), letting us view groups from the viewpoint of [https://arbital.com/p/-4c7](https://arbital.com/p/-4c7).
Together with the idea of the [quotient](https://arbital.com/p/4tq) (which can be formulated in category theory as the [https://arbital.com/p/-coequaliser](https://arbital.com/p/-coequaliser)) and the subsequent idea of the [https://arbital.com/p/-5j9](https://arbital.com/p/-5j9), this lets us construct any group in a category-theoretic way.

Indeed, every group $G$ has a presentation $\langle X \mid R \rangle$ say, which expresses $G$ as a quotient (i.e. a certain coequaliser) of the free group $F(X)$.
We can construct $F(X)$ through the universal property, so we no longer need to say anything at all about the elements or group operation of $G$ to define it.

# Properties

- It is not obvious, but $FX$ is isomorphic to $FY$ if and only if $X$ and $Y$ have the same [https://arbital.com/p/-4w5](https://arbital.com/p/-4w5) as sets. ([Proof.](https://arbital.com/p/free_group_isomorphic_iff_sets_biject)) This completely classifies the free groups and tells us just when two free groups are "the same", which is nice to have.
- The only two [abelian groups](https://arbital.com/p/3h2) which are free are the trivial group (of one element; i.e. the free group on no generators), and $\mathbb{Z}$ the free group on one generator. No others are abelian because if there are two or more generators, pick $a, b$ to be two of them; then $ab \not = ba$ by free-ness. %%note: To be completely precise about this, using the [formal definition](https://arbital.com/p/5s1), $\rho_a \rho_b \not = \rho_b \rho_a$ because they have different effects when applied to the empty word $\varepsilon$. One produces $ab$; the other produces $ba$. %%
- The free groups are all [torsion](https://arbital.com/p/torsion_group_theory)-free %%note:"Torsion-free" means "free of torsion", where the word "free" is nothing to do with "free group".%%: that is, no element has finite [order](https://arbital.com/p/4cq) unless it is the identity $\varepsilon$. ([Proof.](https://arbital.com/p/5kz)) This property helps us to recognise when a group is *not* free: it is enough to identify an element of finite order. However, the test doesn't go the other way, because there are torsion-free groups which are not free.

%%hidden(Proof that "the rationals under addition" is torsion-free but not free):
Suppose the order of an element $x \in \mathbb{Q}$ were finite and equal to $n \not = 0$, say.
Then $x+x+\dots+x$, $n$ times, would yield $0$ (the [identity](https://arbital.com/p/54p) of $(\mathbb{Q}, +)$).
But that would mean $n \times x = 0$, and so $n=0$ or $x = 0$; since $n \not = 0$ already, we must have $x = 0$, so $x$ is the identity after all.

The group is not free: suppose it were free. It is abelian, so it must be isomorphic to either the trivial group (clearly not: $\mathbb{Q}$ is infinite but the trivial group isn't) or $\mathbb{Z}$.
It's not isomorphic to $\mathbb{Z}$, though, because $\mathbb{Z}$ is cyclic: there is a "generating" element $1$ such that every element of $\mathbb{Z}$ can be made by adding together (possibly negatively-many) copies of $1$.
$\mathbb{Q}$ doesn't have this property, because if $x$ were our attempt at such a generating element, then $\frac{x}{2}$ could not be made, so $x$ couldn't actually be generating after all.
%%

Dylan Hendrickson
Eric Bruylant
Eric Rogstad
Patrick Stevens

The free [https://arbital.com/p/-3gd](https://arbital.com/p/-3gd) $F(X)$ on the [set](https://arbital.com/p/3jz) $X$ is the group whose elements are the [freely reduced words](https://arbital.com/p/5jc) over $X$, and whose group operation is "[https://arbital.com/p/-concatenation](https://arbital.com/p/-concatenation) followed by free reduction".


Consistency

A consistent [https://arbital.com/p/-theory](https://arbital.com/p/-theory) is one in which there are well-formed statements that you cannot prove from its axioms; or equivalently, that there is no $X$ such that $T\vdash X$ and $T\vdash \neg X$.

From the point of view of [https://arbital.com/p/-model_theory](https://arbital.com/p/-model_theory), a consistent theory is one whose axioms are [https://arbital.com/p/-satisfiable](https://arbital.com/p/-satisfiable). Thus, to prove that a set of axioms is consistent you can resort to constructing a model using a formal system whose consistency you trust (normally using [https://arbital.com/p/set_theory](https://arbital.com/p/set_theory)) in which all the axioms come true.

Arithmetic is [expressive enough](https://arbital.com/p/) to talk about consistency within itself. If $\square_{PA}$ represents the [https://arbital.com/p/-5gt](https://arbital.com/p/-5gt) in [https://arbital.com/p/3ft](https://arbital.com/p/3ft) then a sentence of the form $\neg\square_{PA}(\ulcorner 0=1\urcorner)$ represents the consistency of $PA$, since it comes to say that there exists a disprovable sentence for which there is no proof. [Gödel's second incompleteness theorem](https://arbital.com/p/) comes to say that such a sentence is not provable from the axioms of $PA$.


Free groups are torsion-free

Given the [https://arbital.com/p/-5kg](https://arbital.com/p/-5kg) $FX$ on a set $X$, it is the case that $FX$ has no [torsion](https://arbital.com/p/torsion_group_theory) elements.
That is, every element has infinite order except for the [https://arbital.com/p/-54p](https://arbital.com/p/-54p).

# Proof

Recall that we can view every element of the free group as being a [https://arbital.com/p/-5jc](https://arbital.com/p/-5jc) whose letters are elements of $X$.
Also the group operation is "concatenation of words, followed by free reduction".
It is certainly intuitively plausible that if we repeatedly concatenate a word with more copies of itself, and then perform free reduction, we will never reach the empty word; this is what we shall prove.
The cancellations in the process of free reduction are everything here, because the only way the powers of a word can get shorter (and hence the only way the powers of a word can ever come to the empty word) is by those cancellations.
So we are going to have to analyse the behaviour of words at their start and ends, because when we take powers of a word, the start and end are the places where cancellation may happen.

We will say a word is *cyclically reduced* if it is not only freely reduced, but also it is "freely reduced if we rotate the word round one place".
Formally, a freely reduced word $a_1 a_2 \dots a_n$ is cyclically reduced if and only if $a_1 \not = a_n^{-1}$.
This captures the idea that "the word doesn't admit any cancellation when we take powers of it".

%%hidden(Examples):

%%

Now, every freely reduced word may $w$ be written as $r w^\prime r^{-1}$ where $r$ is a freely reduced word and $w^\prime$ is a cyclically reduced word, and there is no cancellation between $r$, $r^{-1}$ and $w^\prime$.
This is easily proved by [https://arbital.com/p/-5fz](https://arbital.com/p/-5fz) on the length of $w$: it is immediate if $w$ is already cyclically reduced (letting $r = \varepsilon$ the empty word, and $w^\prime = w$), while if $w$ is not cyclically reduced then it is $a v a^{-1}$ for some letter $a \in X$ and some freely reduced word $v$.
But then by the inductive hypothesis (since $v$ is shorter than $w$), $v$ may be written as $r v^\prime r^{-1}$ where $v^\prime$ is cyclically reduced; so $w = a r v^\prime r^{-1} a^{-1} = (ar) v^\prime (ar)^{-1}$ as required.

Moreover, this decomposition is *unique*, since if $r w^\prime r^{-1} = s v^\prime s^{-1}$ then $s^{-1} r w^\prime r^{-1} s = v^\prime$; but $v^\prime$ is cyclically reduced so there are only two ways to prevent cancellation:

- $s$ is the identity, whereupon $v^\prime = r w^\prime r^{-1}$ is cyclically reduced, so (by freely-reducedness of $w = r w^\prime r^{-1}$) we have $r = e$ as well, and $v^\prime = w^\prime = w$.
- $s$ is not the identity but it entirely cancels with something in $r^{-1}$; hence $s$ is a sub-word of $r$. But by symmetry, $r$ is a sub-word of $s$, so they are the same (because without loss of generality $r$ is also not the identity); and therefore $v^\prime = w^\prime$.

Finally, to complete the proof that the free group is torsion-free, simply take a putative word $w$ whose order $n$ is finite.
Express it uniquely as $r w^\prime r^{-1}$ as above; then $(rw^\prime r^{-1})^n = r (w^\prime)^n r^{-1}$ which is expected to become the empty word after free reduction.
But we already know there is no cancellation between $r$ and $w^\prime$ and $r^{-1}$, so there cannot be any cancellation between $r, (w^\prime)^n, r^{-1}$ either, and by the cyclically-reduced nature of $w^\prime$, our power $r (w^\prime)^n r^{-1}$ is actually freely reduced already.
Hence our power of the word is emphatically not the empty word.


Provability logic

The Gödel -Löb system of provability logic, or $GL$ for short, is a [https://arbital.com/p/-5j8](https://arbital.com/p/-5j8) which captures important notions about [provability predicates](https://arbital.com/p/5j7). It can be regarded as a formalism which allows to decide whether certain sentences in which a provability predicate appears are in fact theorems of [https://arbital.com/p/3ft](https://arbital.com/p/3ft).

$GL$ has two rules of inference:

* **Modus ponens** allows to infer $B$ from $A\to B$ and $A$.
* **Necessitation** says that if $GL\vdash A$ then $GL\vdash \square A$.

The axioms of $GL$ are as follows:

* $GL\vdash \square (A\to B)\to(\square A \to \square B)$ (**Distibutive axioms**)
* $GL\vdash \square (\square A \to A)\to \square A$ (**Gödel-Löb axioms**)
* Propositional tautologies are axioms of $GL$.

**Exercise**: Show using the rules of $GL$ that $\square \bot \leftrightarrow \square \diamond p$. %%note:$\diamond p$ is short for $\neg \square \neg p$.%%

%%hidden(Show solution):
Those problems are best solved by working backwards.

We want to show that $GL\vdash \square \bot \leftrightarrow \square \diamond p$.

What can lead us to that? Well, we know that because of [normality](https://arbital.com/p/), this can be deduced from $GL\vdash \square (\bot \leftrightarrow \diamond p)$.

Similarly, that can be derived from necessitation of $GL\vdash \bot \leftrightarrow \diamond p$.

The propositional calculus shows that $GL\vdash \bot \to \diamond p$ is a tautology, so we can prove by following the steps backward that $GL\vdash \square \bot \to \square \diamond p$.

Now we have to prove that $GL\vdash \square \diamond p\to \square \bot$ and we are done.

For that we are going to go forward from the tautology $GL\vdash \bot \to \neg p$.

By normality, $GL\vdash \square \bot \to \square \neg p$.

Contraposing, $Gl\vdash \neg \square \neg p\to\neg\square\bot$. By necessitation and normality, $Gl\vdash \square \neg \square \neg p\to\square \neg\square\bot$.

But $\square\neg\square\bot$ is equivalent to $\square[\bot \to \bot](https://arbital.com/p/\square)$, and it is an axiom that $GL\vdash \square[\bot \to \bot](https://arbital.com/p/\square) \to\square \bot$, so by modus ponens, $Gl\vdash \square \neg \square \neg p\to\square \bot$, and since $\diamond p = \neg \square \neg p$ we are done.
%%

It is fairly easy to see that GL is consistent. If we interpret $\square$ as the verum operator which is always true, we realize that every theorem of $GL$ is assigned a value of true according to this interpretation and the usual rules of propositional calculus %%note:[proof](https://arbital.com/p/) %%. However, there are well formed modal sentences such as $\neg \square \bot$ such that the assigned value is false, and thus they cannot be theorems of $GL$.

##Semantics
However simple the deduction procedures of $GL$ are, they are bothersome to use in order to find proofs. Thankfully, an alternative interpretation in terms of [Kripke models](https://arbital.com/p/5ll) has been developed that allows to decide far more conveniently whether a modal sentence is a theorem of $GL$.

$GL$ is adequate for finite, transitive and irreflexive Kripke models. That is, a sentence $A$ is a theorem of $GL$ if and only if $A$ is valid in every finite, transitive and irreflexive model%%note: [proof](https://arbital.com/p/)%%. Check out the page on Kripke models if you do not know how to construct Kripke models or decide if a sentence is valid in it.

An important notion in this kind of models is that of *rank*. The rank $\rho$ of a world $w$ from which no world is visible is $\rho(w)=0$. The rank of any other world is defined as the maximum among the ranks of its successors, plus one. In other words, the rank of a world is the length of the greatest "chain of worlds" in the model such that $w$ can view the first slate of the chain.

Since models are irreflexive and finite, the rank is a well-defined notion: no infinite chain of worlds is ever possible.

**Exercise**: Show that the Gödel-Löb axioms are valid in every finite, transitive and irreflexive Kripke model.

%%hidden(Show solution):
Suppose there is a finite, transitive and irreflexive Kripke model in which an sentence of the form $\square[A\to A](https://arbital.com/p/\square)\to \square A$ is not valid.

Let $w$ be the lowest rank world in the model such that $w\not\models \square[A\to A](https://arbital.com/p/\square)\to \square A$. Then we have that $w\models \square[A\to A](https://arbital.com/p/\square)$ but $w\not \models \square A$.

Therefore, there exists $x$ such that $w R x$, also $x\models \neg A$ and $x\models \square A\to A$. But then $x\models \neg\square A$.

Since $x$ has lower rank than $w$, we also have that $x\models \square[A\to A](https://arbital.com/p/\square)\to \square A$. Combining those two last facts we get that $x\not\models \square[A\to A](https://arbital.com/p/\square)$, so there is $y$ such that $xRy$ and $y\not\models \square A\to A$.

But by transitivity $wRy$, contradicting that $w\models \square[A\to A](https://arbital.com/p/\square)$. So the supposition was false, and the proof is done.
%%

The Kripke model formulation specially simplifies reasoning in cases in which [no sentence letters appear](https://arbital.com/p/constant_sentences). A polynomial time algorithm can be written for deciding theoremhood this case.

Furthermore, $GL$ is [https://arbital.com/p/-decidable](https://arbital.com/p/-decidable). However, it is [$PSPACE$-complete](https://arbital.com/p/) %%note:[proof](https://arbital.com/p/)%%.

##Arithmetical adequacy
You can translate sentences of modal logic to sentences of arithmetic using *realizations*.

A realization $*$ is a function such that
$A\to B*=A*\to B*$,
$(\square A)* =\square_{PA}(A*)$,
and $p* = S_p$ for every sentence letter $p$, where each $S_p$ is an arbitrary well formed closed sentence of arithmetic.

[Solovay's adequacy theorem for GL](https://arbital.com/p/) states that a modal sentence $A$ is a theorem of $GL$ iff $PA$ proves $A*$ for every realization $*$.

Thus we can use $GL$ to reason about arithmetic and viceversa.

Notice that $GL$ is decidable while [arithmetic is not](https://arbital.com/p/). This is explained by the fact that $GL$ only deals with a specific subset of logical sentences, in which quantification plays a restricted role. In fact, quantified provability logic is undecidable.

Another remark is that while knowing that $GL\not\vdash A$ implies that there is a realization such that $PA\not\vdash A*$, we do not know whether a specific realization of A is a theorem or not. A related result, the [uniform completeness theorem for $GL$](https://arbital.com/p/), proves that there exists a specific realization $\#$ such that $PA\not \vdash A^{\#}$ if $GL\not\vdash A$, which works for every $A$.

##Fixed points
One of the most important results in $GL$ is the existence of fixed points of sentences of the form $p\leftrightarrow \phi(p)$. Concretely, the [fixed point theorem](https://arbital.com/p/) says that for every sentence $\phi(p)$ modalized in $p$ %%note:that is, every $p$ occurs within the scope of a $\square$%% there exists $H$ in which $p$ does not appear such that $GL\vdash \square [\phi](https://arbital.com/p/p\leftrightarrow) \leftrightarrow \square (p\leftrightarrow h)$. Furthermore, there are constructive proofs which allow to build such an $H$.

In arithmetic, there are plenty of interesting [self referential sentences](https://arbital.com/p/59c) such as the [Gödel sentence](https://arbital.com/p/godel_first_incompleteness_theorem) for which the fixed point theorem is applicable and gives us insights about their meaning.

For example, the modalization of the Gödel sentence is something of the form $p\leftrightarrow \neg\square p$. The procedure for finding fixed points tells us that $GL\vdash \square (p\leftrightarrow \neg\square p)\to \square(p\leftrightarrow \neg\square\bot$. Thus by arithmetical adequacy, and since [everything $PA$ proves is true](https://arbital.com/p/)  we can conclude that the Gödel sentence is equivalent to the [consistency of arithmetic](https://arbital.com/p/5km).


Monotone function: examples

Here are some examples of monotone functions.

A cunning plan
--------

There's a two-player game called 10 questions, in which player A begins the game by stating "I'm thinking of an X", where X can be replaced with any noun of player A's choosing.

Then player B asks player A a series of questions, which player A must answer with either truthfully with "yes" or "no". After asking 10 questions, player B is forced to guess what the object player A was thinking of. Player B wins if the guess is correct, and loses otherwise. Player B may guess before 10 turns have expired, in which case the guess counts as one of
their questions.

Here is an example of a game of 10 questions:

A: I'm thinking of a food.

Question 1.
B: Is it healthy?
A: Yes.

Question 2.
B: Is it crunchy?
A: No.

Question 3.
B: Must it be prepared before it is eaten?
A: No.

Question 4.
B: Is yellow?
A: Yes.

Question 5.
B: Is it a banana?
A: Yes.

**Player B wins**

Now suppose that you are playing 10 questions as player B. Player A begins by stating
"I'm thinking of a letter of the alphabet." You immediately think of a strategy
that requires no more than 5 guesses: repeatedly ask "does it come after $\star$?"
where $\star$ is near the middle of the contiguous sequence of letters that you have
not yet eliminated. Initially the contiguous sequence of letters between A and Z
have not been eliminated.

Question 1.
*You:* Does it come after M?
*Player A:* Yes.

At this point, the contiguous sequence of 13 letters that have not been eliminated is N-Z,
inclusive.

Question 2.
*You:* Does it come after S? *Player A:* No.

At this point, the contiguous sequence of 6 letters that have not been eliminated is N-S,
inclusive.

Question 3. *You:* Does it come after P?  *Player A:* Yes.

We've now narrowed it down to Q,R,and S.

Question 4. *You:* Does it come after R? *Player A:* No.

Question 5. *You:* Does it come after Q? *Player A:* No.

*You:* Is it Q? *Player A:* Yes.

**You win**

But what does this have to do with monotone functions? The letters of the alphabet form a poset $Alph = \langle \{A,...,Z\}, \leq_{Alph} \rangle$ (in fact, a [totally ordered set](https://arbital.com/p/540)) under the standard alphabetic order. Your strategy for playing 10 questions can be viewed as probing a monotone function from $Alph$ to the 2-element poset **2** of a [boolean values](https://arbital.com/p/57f), where $false <_{\textbf{2}} true$. Specifically, the probed function $f : Alph \to \textbf{2}$ is defined such that $f(\star) \doteq Q >_{Alph} \star$

The monotonicity of $f$ is crucial to being able to eliminate possibilities at each step. If we probe $f$ at a letter $\star_1$ and observe a false result, then any letter $\star_2$ less than $\star_1$ must map to false as well: $\star_2 \leq_{Alph} \star_1$ implies $f(\star_2) \leq_{\textbf{2}} f(\star_1)$. Yes, we can demonstrate the aformentioned monotone function with a diagram, but since its size is unwieldy, it has been placed in the following hidden text block.

%%hidden(Show solution):
![Diagram of f](http://i.imgur.com/ILepmis.png)
%%

Deduction systems
---------------

[https://arbital.com/p/deduction_systems](https://arbital.com/p/deduction_systems) allow one to infer new judgments from a set of known judgments. They are often specified as a set of rules, in which each rule is represented as a horizontal bar with one or more premises appearing above the bar and a conclusion that can be deduced from those premises appearing below the bar.

![A deduction system](http://i.imgur.com/OFx6REF.png)

The above rules form a fragment of [propositional logic](https://arbital.com/p/57f). $\phi$ and $\psi$ are used to denote logical statements, called *propositions*. $\wedge$ and $\to$ are binary logical operators, each of which maps a pair of propositions to a single proposition. $\wedge$ is the *and* operator: if $\phi$ and $\psi$ are logical statements, then $\phi \wedge \psi$ is the simultaneous assertion of both $\phi$ and $\psi$. $\to$ is the *implication* operator: $\phi \to \psi$ asserts that if we know $\phi$ to be true, then we can conclude $\psi$ is true as well.

The leftmost rule has two premises $\phi$ and $\psi$, and concludes from these premises the proposition $\phi \wedge \psi$. Invoking a rule to deduce its conclusion from its premises is called *applying* the rule. A tree of rule applications is called a [proof](https://arbital.com/p/proof).

Deduction systems are often viewed as proof languages. However, it can also be fruitful to view a deduction system as a function which, given a set of input propositions, produces the set of all propositions that can be concluded from exactly one rule application, using the input propositions as premises. More concretely, letting $X$ be the set of propositions, the above set of deduction rules corresponds to the following function $F : \mathcal P(X) \to \mathcal P(X)$.

$F(A) = \\ ~~ \{ \phi \wedge \psi\mid\phi \in A, \psi \in A \} \cup \\ ~~ \{ \phi \mid \phi \wedge \psi \in A \} \cup \\ ~~ \{ \psi \mid \phi \wedge \psi \in A \} \cup \\ ~~ \{ \phi \mid \psi \in A, \psi \to \phi \in A \}$

$F$ is a montone function from the poset $\langle \mathcal P(X), \subseteq \rangle$ to itself. The reason that $F$ is monotone is that larger input sets give us more ways to apply the rules of our system, yielding larger outputs.

In addition to standard logical notions, deduction systems can be used to describe [type systems](https://arbital.com/p/type_system), [program logics](https://arbital.com/p/program_logic), and [operational semantics](https://arbital.com/p/operational_semantics).

Additional material
-------------

If you still haven't had enough monotonicity, might I recommend trying some of the [exercises](https://arbital.com/p/6pv)?

%comment:
Increasing functions
----------------

A monotone function between two [totally ordered sets](https://arbital.com/p/540) is called increasing. For example, the graph of a monotone function from the poset $\langle \mathbb R, \le \rangle$ to itself has an upward slope. Such functions can be searched efficiently using the [binary search algorithm](https://arbital.com/p/binary_search).
%


Kripke model

**Kripke models** are [interpretations](https://arbital.com/p/) of [https://arbital.com/p/-534](https://arbital.com/p/-534) which turn out to be adequate under some basic constraints for a wide array of systems of modal logic.

#Definition
A Kripke model $M$ is formed by three elements:

* A set of **worlds** $W$
* A **visibility relationship** between worlds $R$. If $wRx$, we will say that $w$ sees $x$ or that $x$ is a successor of $w$.
* A **valuation function** $V$ that associates pairs of worlds and sentence letters to truth values.

You can visualize Kripke worlds as a [https://arbital.com/p/-digraph](https://arbital.com/p/-digraph) in which each node is a world, and the edges represent visibility.

The valuation function can be extended to assign truth values to whole modal sentences. We will say that a world $w\in W$ makes a modal sentence $A$ true (*notation*: $M,w\models A$) if it is assigned a truth value of true according to the following rules:

* If $A$ is a sentence letter $p$, then $M,w\models p$ if $V(w,p)=\top$.
* If $A$ is a truth functional compound of sentences, then its value comes from the propositional calculus and the values of its components. For example, if $A=B\to C$, then $M,w\models A$ [https://arbital.com/p/-46m](https://arbital.com/p/-46m) $M,w\not\models B$ or $M,w\models C$.
* If $A$ is of the form $\square B$, then $M,w\models \square B$ if $M,x\models B$ for every successor $x$ of $w$.

Given this way of assigning truth values to sentences, we will say the following:

* $A$ is valid in a model $M$ (*notation*: $M\models A$) if $M,w\models A$ for every $w$ in $W$.
* $A$ is valid in a class of models if it is valid in every model of the class.
* $A$ is satisfiable in a model $M$ if there exists $w\in W$ such that $M,w\models A$.
* $A$ is satisfiable in a class of models if it is satisfiable in some model of the class.

Notice that a sentence $A$ is valid in a class of models iff its negation is not satisfiable.

#Kripke models as semantics of modal logic
Kripke models are tightly connected to the interpretations of certain modal logics.

For example, they model well the rules of [normal provability systems](https://arbital.com/p/5j8).

**Exercise**: show that Kripke models satisfy the necessitation rule of modal logic. That is, if $A$ is valid in $M$, then $\square A$ is valid in $M$.

%%hidden(Show solution):
Let $w\inW$ be a world of $M$. Let $x$ be an arbitrary successor of $w$. Then, as $M\models A$, then $M,x\models A$. Since $x$ was arbitrary, every successor of $w$ models $A$, so $w\models \square A$. As $w$ was arbitrary, then every world in $M$ models $\square A$, and thus $M\models \square A$.
%%

**Exercise**: Show that the distributive axioms are always valid in Kripke models. Distributive axioms are modal sentences of the form $\square[B](https://arbital.com/p/A\to)\to(\square A \to \square B)$.

%%hidden(Show solution):
Suppose that $w\in W$ is such that $w\models \square[B](https://arbital.com/p/A\to)$ and $w\models \square A$.

Let $x$ be a successor of $w$. Then $x\models A\to B$ and $x\models A$. We conclude by the propositional calculus that $x\models B$, so as $x$ was an arbitrary successor we have that $w\models \square B$, and thus $w\models\square[B](https://arbital.com/p/A\to)\to(\square A \to \square B)$.

We conclude that $M\models\square[B](https://arbital.com/p/A\to)\to(\square A \to \square B)$, no matter what $M$ is.
%%

Those two last exercises prove that the [K system](https://arbital.com/p/) of modal logic is [sound](https://arbital.com/p/soundness) for the class of all Kripke models. This is because we have proved that its axioms and rules of inference hold in all Kripke models (propositional tautologies and modus ponens trivially hold).

##Some adequacy theorems
Now we present a relation of modal logics and the class of Kripke models in which they are [adequate](https://arbital.com/p/adequacy). You can check the proofs of adequacy in their respective pages.

* The class of *all* Kripke models is adequate to the [K system](https://arbital.com/p/)
* The class of [transitive](https://arbital.com/p/573) Kripke models is adequate to [K4](https://arbital.com/p/)
* The class of [reflexive](https://arbital.com/p/) Kripke models is adequate to [T](https://arbital.com/p/)
* The class of [reflexive](https://arbital.com/p/) and [transitive](https://arbital.com/p/573) Kripke models is adequate to [S4](https://arbital.com/p/)
* The class of [reflexive](https://arbital.com/p/) and [symmetric](https://arbital.com/p/) Kripke models is adequate to [B](https://arbital.com/p/)
* The class of [reflexive](https://arbital.com/p/) and [euclidean](https://arbital.com/p/) Kripke models is adequate to [S5](https://arbital.com/p/)
* The class of [finite](https://arbital.com/p/), [irreflexive](https://arbital.com/p/) and [transitive](https://arbital.com/p/573) Kripke models is adequate to [GL](https://arbital.com/p/5l3)

Notice that as the constraint on the models becomes stronger, the set of valid sentences increases, and thus the correspondent adequate system is stronger.

A note about notation may be in order. We say that a Kripke model is, e.g, [transitive](https://arbital.com/p/573) if its visibility relation is transitive %%note:Same for reflexive, symmetric and euclidean %%. Similarly, a Kripke model is finite if its set of worlds is finite.


Antisymmetric relation

An antisymmetric relation is a relation where no two distinct elements are related in both directions. In other words. $R$ is antisymmetric iff

$(aRb ∧ bRa) → a = b$

or, equivalently, $a ≠ b → (¬aRb ∨ ¬bRa)$

Antisymmetry isn't quite the [compliment](https://arbital.com/p/set_theory_compliment) of [Symmetry](https://arbital.com/p/symmetric_relation). Due to the fact that $aRa$ is allowed in an antisymmetric relation, the equivalence relation, $\{(0,0), (1,1), (2,2)...\}$ is both symmetric and antisymmetric.

Examples of antisymmetric relations also include the successor relation, $\{(0,1), (1,2), (2,3), (3,4)...\}$, or this relation linking numbers to their prime factors $\{...(9,3),(10,5),(10,2),(14,7),(14,2)...)\}$