Front for Mathphys Archive

  "I write not because I know something but to learn something." "The most important book to me is my own notebook because it...

Tuesday, October 14, 2025

Group Theory 8: Homomorphisms

 In this lecture note, we study maps from a group into another group that carry over the same group structure i.e preserve group operations. Such maps are called homomorphisms. It turns out that, for groups, it suffices to require a homomorphism to preserve a binary operation only. Then the unary operation (inverses) and the nullary operation (the identity element) are automatically preserved.

Definition. Let $(G,\ast)$ and $(G',\sharp)$ be two groups. A map $\varphi: G\longrightarrow G'$ is called a homomorphism if $\varphi(a\ast b)=\varphi(a)\sharp\varphi(b)$.

Example. Define $\varphi: (\mathbb{R}^+,\cdot)\longrightarrow(\mathbb{R},+)$ by
$$\varphi(x)=\log_{10}x,\ \forall x\in\mathbb{R}^+.$$
Then $\varphi$ is a homomorphism. In addition, $\varphi$ is one-to-one and onto. A homomorphism which is one-to-one and onto is called an isomorphism. If there is an isomorphism from a group onto another group, they are the same group meaning we do not distinguish them.

Example. The map $\varphi: \mathbb{Z}\longrightarrow\mathbb{Z}_n$ defined by
$$\varphi(x)=[x],\ \forall\ x\in\mathbb{Z}$$
is a homomorphism called the canonical or the natural homomorphism. The canonical homomorphism is onto.

Example. Let $G$ be a group and $A(G)$ the set of all bijective (i.e. one-to-one and onto) maps of $G$ onto itself. Recall that $A(G)$ forms a group with composition. Let $a\in G$. Define $T_a: G\longrightarrow G$ by
$$T_ax=ax\ \forall\ x\in G.$$ Hence $\forall a\in G$, $T_a\in A(G)$. Furthermore, $\forall a,b\in G$, $T_aT_b=T_{ab}$: $\forall x\in G$,
$$T_aT_b(x)=T_a(T_bx)=T_a(bx)=a(bx)=(ab)x=T_{ab}x.$$
Define $\varphi: G\longrightarrow A(G)$ by
$$\varphi(a)=T_a,\ \forall\ a\in G.$$
Then $\varphi$ is a homomorphism. In addition, it is one-to-one. If $|G|=n$, then $|A(G)|=n!$, so $\varphi$ cannot be onto.

Definition. A homomorphism which is one-to-one (injective) is called a monomorphism. A homomorphism which is onto (surjective) is called an epimorphism. A homomorphism which is one-to-one and onto (bijective) is called an isomorphism as mentioned above. $G$ is said to be isomorphic to $G'$ if there exists an isomorphism from $G$ onto $G'$. If $G$ is isomorphic to $G'$, we write $G\cong G'$. An isomorphism from a group $G$ onto itself is called an automorphism.

Theorem. [Cayley's Theorem] Every group $G$ is isomorphic to some subgroup of $A(S)$, for an appropriate set $S$.

We in fact proved this theorem in the previous example by taking $S$ to be the group $G$ itself. But there may be other choices for $S$. If $G$ is finite, $S$ may be taken to be a finite set in which case $A(S)$ is $S_n$, the group of permutations of $\{1,2,\cdots,n\}$. In this case, Cayley's Theorem is stated as: A finite group can be represented as a group of permutations.

Example. Let $G$ be a group and $a\in G$ be fixed. The map $\varphi: G\longrightarrow G$ defined by
$$\varphi(x)=a^{-1}xa,\ \forall x\in G$$
is an automorphism called the inner automorphism of $G$ induced by $a$.

Example. Define $\varphi: (\mathbb{R},+)\longrightarrow (\mathbb{C}\setminus\{0\},\cdot)$ by
$$\varphi(x)=e^{ix},\ \forall x\in\mathbb{R}.$$
While $\varphi$ is a homomorphism, it is neither one-to-one nor onto.

Lemma. Let $\varphi: G\longrightarrow G'$ be a homomorphism. Then

  1. $\varphi(e)=e'$.
  2. $\varphi(a^{-1})=\varphi(a)^{-1}$.

Proof.

  1. Let $a\in G$. Then $ae=a$. Since $\varphi$ is a homomorphism, $$\varphi(ae)=\varphi(a)\varphi(e)=\varphi(a)=\varphi(a)e'.$$ So by the cancellation law, we obatin $\varphi(e)=e'$.
  2. Let $a\in G$. Then \begin{align*}\varphi(a)\varphi(a^{-1})&=\varphi(aa^{-1})\ (\mbox{because $\varphi$ is a homomorphism})\\&=\varphi(e)\\&=e'\ (\mbox{by part 1})\end{align*}

Hence, $\varphi(a)^{-1}=\varphi(a^{-1})$.

Lemma. Let $\varphi: G\longrightarrow G'$ be a homomorphism. Then $\varphi(G)\leq G'$.

In here, the kernel of a function was introduced. Let $\varphi: G\longrightarrow G'$ be a homomorphism and $K=\varphi^{-1}(e')=\{a\in G: \varphi(a)=e'\}$. Then $\ker\varphi$ and $K=\varphi^{-1}(e')$, the preimage of $e'$ under $\varphi$ are closely related as:
\begin{align*}
(a,b)\in\ker\varphi&\Longleftrightarrow\varphi(a)=\varphi(b)\\
&\Longleftrightarrow\varphi(ab^{-1})=e'\\
&\Longleftrightarrow ab^{-1}\in K.
\end{align*}
So, in group theory we define $K=\varphi^{-1}(e')$ to be $\ker\varphi$, the kernel of $\varphi$.

Theorem. $\varphi: G\longrightarrow G'$ is one-to-one if and only if $\ker\varphi=\{e\}$.

Proof. ($\Rightarrow$) Suppose that $\varphi$ is one-to-one and let $a\in\ker\varphi$. Then $\varphi(a)=\varphi(e)=e'$. Since $\varphi$ is one-to-one, $a=e$.

($\Leftarrow$) Suppose that $\ker\varphi=\{e\}$ and let $\varphi(a)=\varphi(b)$. Then
\begin{align*}
 \varphi(ab^{-1})=e'&\Longrightarrow ab^{-1}\in\ker\varphi\\
 &\Longrightarrow ab^{-1}=e\\
 &\Longrightarrow a=b.
\end{align*}
So, $\varphi$ is one-to-one.

Theorem. Let $\varphi: G\longrightarrow G'$ be a homomorphism. Then $\ker\varphi\leq G$.

Theorem. Let $K=\ker\varphi$. Then $\forall a\in G$, $aK=Ka$.

Proof. It suffices to show (why?) that $\forall a\in G$, $a^{-1}Ka\subset K$. Let $a\in G$. Then $\forall k\in K$,
$$\varphi(a^{-1}ka)=\varphi(a)^{-1}\varphi(k)\varphi(a)=e'\Longrightarrow a^{-1}ka\in K.$$

Thursday, September 4, 2025

NT: Congruences and Modular Arithmetic 2

Theorem 1 (Fermat's Little Theorem). Let $p$ be a prime. Then for any integer $a$,
$$a^p\equiv a\mod p$$
and for any integer $a$ not divisible by $p$,
$$a^{p-1}\equiv 1\mod p.$$

Proof. We prove the second statement first. Suppose that $p\not| a$. If
$i\equiv j\mod p$ then clearly $ai\equiv aj\mod p$. Conversely, if
$ai\equiv aj\mod p$ then
$$p|ai-aj=a(i-j).$$
Since $(a,p)=1$, $p|i-j$, i.e., $i\equiv j\mod p$. So, $0a,1a,2a,\cdots,(p-1)a$ are a complete set of residues $\mod p$, that is, they are rearrangement of $0,1,2,\cdots,p-1$ when considered $\mod p$. Hence,
$$(p-1)!a^{p-1}\equiv(p-1)!\mod p,$$
i.e., $p|(p-1)!(a^{p-1}-1)$. Since $p\not|(p-1)!$ then $p|a^{p-1}-1$, i.e.,
$$a^{p-1}\equiv 1\mod p.$$
If $a$ is divisible by $p$, then clearly
$$a^p\equiv a\mod p$$
since either side is congruent to $0\mod p$.

Corollary 2. If $p\not| a$ and if $n\equiv m\mod p-1$ then $$a^n\equiv a^m\mod p.$$

Proof. Say $n>m$. Since $n\equiv m\mod p-1$,
$$n=m+(p-1)c$$
for some $c\in\mathbb{Z}$. By Fermat's Little Theorem (Theorem 1),
$$a^{p-1}\equiv 1\mod p$$
and so
$$a^{c(p-1)}\equiv 1\mod p\Longrightarrow a^n=a^{m+(p-1)c}\equiv a^m\mod p.$$

Example. Find the last base-$7$ digit in $2^{1000000}$.

Solution: Let $p=7$. Since $1000000$ leaves a remainder of $4$ when divided by $p-1=6$,
$$1000000\equiv 4\mod 6=7-1$$
and $7\not|2$. By Corollary 2,
$$2^{1000000}\equiv 2^4=16\equiv 2\mod 7.$$
Thus, $2$ is the answer.

Lemma 3. If $a\equiv b\mod m$, $a\equiv b\mod n$, and
$(m,n)=1$, then $a\equiv b\mod mn$.

Proof. Since $a\equiv b\mod m$, $b-a=md$ for some $d\in\mathbb{Z}$.
\begin{align*}
a\equiv b\mod n&\Longrightarrow n|md\\
&\Longrightarrow n|d\ \mbox{since}\ (m,n)=1\\
&\Longrightarrow d=ns\ \mbox{for some}\ s\in\mathbb{Z}\\
&\Longrightarrow b-a=mns\\
&\Longrightarrow a\equiv b\mod mn.
\end{align*}

Definition (Euler phi function).
For any positive integer $n$, $\phi(n)$ is defined to be the number
of integers $a$, $1\leq a\leq n$, such that $(a,n)=1$. The function
$\phi$ is called the Euler phi function or totient function. As the name suggests, this function was introduced by Leonhard Euler but the name totient was coined by J. J. Sylvester.

Example. $\phi(1)=1$ by definition.

To calculate $\phi(6)$, we write all positive integers that are
less than or equal to $6$ and then cross out the ones that are not
relatively prime to $6$. Counting the remaining numbers will give
$\phi(6)$: $$1,\not 2,\not 3,\not 4,5,\not 6.$$ Hence, $\phi(6)=2$.

Since $7$ is a prime number, any positive integer that are less than
$7$ are relatively prime to $7$, so $\phi(7)=6$. In general, if $p$
is a prime number then
$$
\phi(p)=p-1. \tag{1}
$$

In order to calculate $\phi(12)$, we write
$$1,\not 2,\not 3,\not 4,5,\not 6,7,\not 8,\not 9,\not 10,11,\not 12$$
Thus, $\phi(12)=4$.

As one can easily imagine, if a number $n$ gets larger, computing
$\phi(n)$ will become more difficult.

The following theorem provides a short cut to computing $\phi(n)$.

Theorem 4. If $k$ and $a$ are positive integers such that all primes dividing
$k$ also divide $a$, then
$$
\phi(ka)=k\phi(a). \tag{2}
$$

Proof. We first write all positive integers that are less than or equal to $ka$:
$$
\begin{array}{cccc}
1 & 2 & \cdots & a\\
a+1 & a+2 & \cdots & 2a\\
& & \vdots &\\(k-1)a+1 & (k-1)a+2 & \cdots & ka
\end{array}
$$
and then cross out the entries that are not relatively prime to $ka$. It is easy to see that this amounts to crossing out everything not relatively prime to $a$. Clearly, any prime that divides $a$ divides $ka$. Conversely, if a prime divides $ka$, then it divides $k$ or $a$. If the prime divides $k$ then by the assumption, it divides $a$ as well. By Theorem 5 here, the pattern of crossing out is the same in each row. Since there are $\phi(a)$ entries left in the first row, there must be $k\phi(a)$ entries left in all. So,
$$\phi(ka)=k\phi(a).$$

It would be also interesting to study the relationship between $\phi(pa)$ and $\phi(a)$ when $p\not|a$. First note that if $(a,n)>1$ then clearly $(pa,n)>1$ but the converse need not be true. If a prime number $q>1$ divides $pa$ then $q|p$ or $q|a$. If $q|p$ then $q=p$. That is, if $(pa,n)>1$ then $p|n$ or $(a,n)>1$. After crossing out all $n$ such that $(a,n)>1$, $p\phi(a)$ integers left and yet more to be eliminated, namely, the multiples of $p$, $1p,2p,\cdots,ap$. Of these, those $kp$ such that $(k,a)>1$ have already been eliminated, and there are just $\phi(a)$ more to cross out. Thus,
\begin{align*}
\phi(pa)&=p\phi(a)-\phi(a)\\
&=(p-1)\phi(a).
\end{align*}
Hence, we proved the following theorem.

Theorem 5. Let $a$ be a positive integer and $p$ a prime such that $p\not|a$. Then
$$
\phi(pa)=(p-1)\phi(a). \tag{3}
$$

Example.
\begin{align*}
\phi(10^6)&=\phi(10^5\cdot 10)\\
&=10^5\phi(10)\ \mbox{by (2)}\\
&=10^5\phi(2\cdot 5)\\
&=10^5(2-1)\phi(5)\ \mbox{by (3)}\\
&=10^5\cdot 4 \ \mbox{by (1)}\\
&=400,000.\\\phi(60)&=\phi(2^2\cdot 3\cdot 5)\\
&=2\phi(2\cdot 3\cdot 5) \ \mbox{by (2)}\\
&=2\cdot(2-1)\phi(3\cdot 5) \ \mbox{by (3)}\\
&=2(3-1)\phi(5)\ \mbox{by (3)}\\
&=16 \ \mbox{by (1)}.\\
\phi(62)&=\phi(2\cdot 31)\\
&=(2-1)\phi(31)\ \mbox{by (3)}\\
&=30\ \mbox{by (1)}.
\end{align*}

Theorem 6. Let $p$ be a prime and $\alpha$ a positive integer. Then
$$
\phi(p^\alpha)=p^\alpha\left(1-\frac{1}{p}\right). \tag{4}
$$

Proof. It follows immediately from (2) and (1).
\begin{align*}\phi(p^\alpha)&=p\phi(p^{\alpha-1})\\
&=p^2\phi(p^{\alpha-2})\\
&=\cdots\\ &=p^{\alpha-1}\phi(p)\\
&=p^{\alpha-1}(p-1)\\
&=p^{\alpha}\left(1-\frac{1}{p}\right).
\end{align*}

Maxima. In Maxima, we have the command totient:

(%i1) totient(62);

(%o1) 30

Theorem 7 (Chinese Remainder Theorem) Suppose that we want to solve a system of congruences to different moduli:
\begin{align*}
x&\equiv a_1\mod m_1,\\
x&\equiv a_2\mod m_2,\\
&\cdots\ \ \ \ \ \cdots \tag{5}\\
x&\equiv a_r\mod m_r.
\end{align*}
Suppose that each pair of moduli is relatively prime: $(m_i,m_j)=1$ for $i\ne j$. Then there exists a simultaneous solution $x$ to all of the congruences, and any two solutions are congruent to one another modulo $M=m_1m_2\cdots m_r$.

Proof. First we prove uniqueness modulo $M$. Suppose that $x'$ and $x^{\prime\prime}$
are two solutions to the system of congruences (5). Let $x=x'-x^{\prime\prime}$. Then for all $i=1,\cdots,r$,
\begin{align*}
x'&\equiv a_i\mod m_i,\\
x^{\prime\prime}&\equiv a_i\mod m_i.
\end{align*}
This implies that
\begin{align*}
x=x'-x^{\prime\prime}\equiv 0\mod m_i&\Longrightarrow x\equiv 0\mod M\ \mbox{by Lemma 3}\\
&\Longrightarrow x'\equiv x^{\prime\prime}\mod M.
\end{align*}
We now show how to construct a solution $x$. For each $i=1,\cdots,r$, define $M_i:=M/m_i$. Then $(m_i,M_i)=1$, so by Bézout's Lemma there exist $y,z\in\mathbb{Z}$ such that
$$M_iy+m_iz=1.$$
This implies that
$$M_iy\equiv 1\mod m_i.$$
Write $y:=N_i$, i.e.,
$$M_iN_i\equiv 1\mod m_i.$$
Set
$$x:=\sum_{i=1}^ra_iM_iN_i.$$
Since $m_i|M_j$ whenever $i\ne j$,
$$x\equiv a_iM_iN_i\equiv a_i\mod m_i.$$

The reason Theorem 7 is called the Chinese Remainder Theorem is that its oldest reference was found in a 3rd century AD (Tang Dynasty) Chinese math book called Sunzi Suanjing (孫子算經). The book title's literal translation is Master Sun's Book of Arithmetic. Not much is know for the author Sunzi or Sun Tzu (孫子) but one thing for sure is he is not the same person as the famous Chinese military strategist who was the author of The Art of War. In the book Sunzi Suanjing, the following question is mentioned: "Han Xing asks how many soldiers are in his army. If you let them parade in 3 rows of soldiers, 2 soldiers will be left. If you let them parade in 5 rows of soldiers, 3 will be left. And in 7 rows of soldiers, 2 will be left. How many soldiers are there?" This question can be formulated as solving a system of linear congruences in the following example.

Example. Solve the system of linear congruences
\begin{align*}
x&\equiv 2\mod 3\\
x&\equiv 3\mod 5\\
x&\equiv 2\mod 7
\end{align*}

Solution. Let $m_1=3$, $m_2=5$, and $m_3=7$. Let $M=m_1m_2m_3=105$ and
\begin{align*}
M_1&=\frac{M}{m_1}=35\\
M_2&=\frac{M}{m_2}=21\\
M_3&=\frac{M}{m_3}=15
\end{align*}
Since $(M_i,m_i)=1$, $M_iy_i+m_iz_i=1$ has a solution for each $i=1,2,3$. They can be found as $y_1=-1$, $y_2=y_3=1$. Let $N_i=y_i$ for each $i=1,2,3$ and $a_1=2$, $a_2=3$, and $a_3=2$. Then $x=\sum_ia_iM_iN_i=23$ is a solution to the system and the general solution is $x=23+105k$. This does not answer Han Xing's question. His army could have had as little as 23 or as large as 128,233,373 (for $k=1221270$) or more.

Maxima. Maxima has a built-in command for solving a system of congruences. It is chinese([a1,...,ar],[m1,...,mr]). For the Han Xing's problem:

(%i1) chinese([2,3,2],[3,5,7]);

(%o1) 23

Corollary 8. The Euler phi function is multiplicative, i.e., $$\phi(mn)=\phi(m)\phi(n)$$ whenever $(m,n)=1$.

Proof. We must count the number of integers between $0$ and $mn-1$ which have no common factor with $mn$. For each $0\leq j\leq mn-1$, let $j_1$ be its least nonnegative residue$\mod m$ (i.e., $0\leq j_1<m$ and $j\equiv j_1\mod m$) and $j_2$ be its least nonnegative residue$\mod n$ (i.e., $0\leq j_2<n$ and $j\equiv j_2\mod n$). It follows from the Chinese Remainder Theorem (Theorem 7) that for each pair $j_1,j_2$ there is one and only one $j$ between $0$ and $mn-1$ for which $$j\equiv j_1\mod m,\ j\equiv j_2\mod n.$$ Notice that $j$ has no common factor with $mn$ if and only if it has no common factor with $m$ (which is equivalent to $j_1$ having no common factor with $m$) and $j$ has no common factor with $n$ (which is equivalent to $j_2$ having no common factor with $n$). Thus, the $j$'s which we must count are in $1:1$ correspondence with the pairs $j_1,j_2$ for which $$0\leq j_1<m,\ (j_1,m)=1;\ 0\leq j_2<n,(j_2,n)=1.$$ The number of possible $j_1$'s is $\phi(m)$ and the number of possible $j_2$'s is $\phi(n)$. So, the number of pairs is $\phi(m)\phi(n)$.

Corollary 9. For any positive integer $n$,
$$
\phi(n)=n\prod_{p|n}\left(1-\frac{1}{p}\right). \tag{6}
$$

Proof. Let $n=p_1^{\alpha_1}p_2^{\alpha_2}\cdots p_r^{\alpha_r}$ be the prime factorization of $n$. Then by Corollary 8,
\begin{align*}
\phi(n)&=\phi(p_1^{\alpha_1})\phi(p_2^{\alpha_2})\cdots\phi(p_r^{\alpha_r})\\
&=p_1^{\alpha_1}\left(1-\frac{1}{p_1}\right)p_2^{\alpha_2}\left(1-\frac{1}{p_2}\right)\cdots p_r^{\alpha_r}\left(1-\frac{1}{p_r}\right)\ \mbox{by (4)}\\
&=p_1^{\alpha_1}p_2^{\alpha_2}\cdots p_r^{\alpha_r}\left(1-\frac{1}{p_1}\right)\left(1-\frac{1}{p_2}\right)\cdots\left(1-\frac{1}{p_r}\right)\\
&=n\prod_{p|n}\left(1-\frac{1}{p}\right).
\end{align*}

Example.
\begin{align*}
\phi(60)&=\phi(2^2\cdot 3\cdot 5)\\
&=60\left(1-\frac{1}{2}\right)\left(1-\frac{1}{3}\right)\left(1-\frac{1}{5}\right)\\
&=16.\\\phi(62)&=\phi(2\cdot 31)\\
&=62\left(1-\frac{1}{2}\right)\left(1-\frac{1}{31}\right)\\
&=30.\\\phi(360)&=\phi(2^3\cdot 3^2\cdot 5)\\
&=360\left(1-\frac{1}{2}\right)\left(1-\frac{1}{3}\right)\left(1-\frac{1}{5}\right)\\
&=96.
\end{align*}

The following theorem is a generalization of Fermat's Little Theorem
(Theorem 1) due to Euler.

Theorem 10 (Euler-Fermat Theorem). If $(a,m)=1$ then
$$
a^{\phi(m)}\equiv 1\mod m. \tag{7}
$$

Proof. First consider the case when $m$ is a prime power, say $m=p^\alpha$.
We use induction on $\alpha$. The case $\alpha=1$ is precisely Fermat's Little Theorem. Suppose that $\alpha\geq 2$ and the formula (7) holds for the $(\alpha-1)$-st power of $p$. Then
\begin{align*}
\phi(p^{\alpha-1})&=p^{\alpha-1}\left(1-\frac{1}{p}\right)\\
&=p^{\alpha-1}-p^{\alpha-2}
\end{align*}
and
\begin{align*}
a^{\phi(p^{\alpha-1})}&=a^{p^{\alpha-1}-p^{\alpha-2}}\\
&\equiv 1\mod p^{\alpha-1}.
\end{align*}
That is,
$$a^{p^{\alpha-1}-p^{\alpha-2}}=1+p^{\alpha-1}b\ \mbox{for some}\ b\in\mathbb{Z}.$$
Thus,
\begin{align*}
a^{\phi(p^\alpha)}&=(a^{p^{\alpha-1}-p^{\alpha-2}})^p\\
&=(1+p^{\alpha-1}b)^p.
\end{align*}
Note that the binomial coefficients of $(1+x)^p$ are each divisible by $p$ except in the $1$ and $x^p$ in the ends. This means the binomial coefficients of $(1+p^{\alpha-1}b)^p$ are each divisible by $p^\alpha$ except in the $1$ and $p^{p(\alpha-1)}b^p$ in the ends. Now,
$$p^{p(\alpha-1)}b^p=p^\alpha p^{p(\alpha-1)-\alpha}b^p.$$
Since $p$ is a prime, $p\geq 2$. So,
\begin{align*}
p(\alpha-1)-\alpha&\geq 2(\alpha-1)-\alpha\\
&=\alpha-2\geq 0\ \mbox{by assumption}.
\end{align*}
This means $p^{p(\alpha-1)}b^p$ is also divisible by $p^\alpha$. Hence,
$$a^{\phi(p^\alpha)}\equiv 1\mod p^\alpha.$$
Let $m=p_1^{\alpha_1}p_2^{\alpha_2}\cdots p_r^{\alpha_r}$ be the prime factorization of $m$. Then by the multiplicity of $\phi$ (Corollary 8),
\begin{align*}
\phi(m)&=\phi(p_1^{\alpha_1}p_2^{\alpha_2}\cdots p_r^{\alpha_r})\\
&=\phi(p_1^{\alpha_1})\cdots \phi(p_r^{\alpha_r}).
\end{align*}
For each $i=1,\cdots,r$,
$$a^{\phi(p_i^{\alpha_i})}\equiv 1\mod p_i^{\alpha_i}.$$
Let $M_i:=\phi(m)/\phi(p_i^{\alpha_i})$ for $i=1,\cdots,r$. Then
\begin{align*}
a^{\phi(m)}&=a^{\phi(p_1^{\alpha_1})\cdots \phi(p_r^{\alpha_r})}\\
&=(a^{\phi(p_i^{\alpha_i})})^{M_i}\\
&\equiv 1\mod p_i^{\alpha_i}.
\end{align*}
Since $(p_i^{\alpha_i},p_j^{\alpha_j})=1$ if $i\ne j$,
$$a^{\phi(m)}\equiv 1\mod m=p_1^{\alpha_1}\cdots p_r^{\alpha_r}$$
by Lemma 3.

Remark. Suppose that $a$ is any positive integer such that $(a,105)=1$.
\begin{align*}
\phi(105)&=\phi(3\cdot 5\cdot 7)\\
&=105\left(1-\frac{1}{3}\right)\left(1-\frac{1}{5}\right)\left(1-\frac{1}{7}\right)\\
&=48.
\end{align*}
So, by Euler's Theorem (Theorem 10)
$$a^{48}\equiv 1\mod 105.$$
As we have seen in the proof of Theorem 10, there is a smaller power of $a$ which gives $1\mod m=105=3\cdot 5\cdot 7$.
\begin{align*}
a^{\phi(3)}=a^2\equiv 1\mod 3,\\
a^{\phi(5)}=a^4\equiv 1\mod 5,\\
a^{\phi(7)}=a^6\equiv 1\mod 7.
\end{align*}
The least common multiple of $\phi(3)=2,\phi(5)=4,\phi(7)=6$ is 12 and so
\begin{align*}
a^{12}&\equiv 1\mod 3,\\
a^{12}&\equiv 1\mod 5,\\
a^{12}&\equiv 1 \mod 7.
\end{align*}
By Lemma 3, $$a^{12}\equiv 1\mod3\cdot 5\cdot 7=105.$$

Example. Compute $2^{1000000}\mod 77$.

Solution. $77=7\cdot 11$ and $\phi(7)=6,\ \phi(11)=10$. The least common multiple of $6$ and $10$ is $30$. So,
$$2^{30}\equiv 1\mod 77.$$
Since $1000000=30\cdot 33333+10$,
$$2^{1000000}\equiv 2^{10}\mod 77\equiv 23\mod 77.$$

There is an alternative way to calculate $2^{1000000}\mod 77$. First compute $2^{1000000}\mod 7$.
$$2^{\phi(7)}=2^6\equiv 1\mod 7.$$
Since $1000000=6\cdot 166666+4$,
$$2^{1000000}\equiv 2^4\equiv 2\mod 7.$$
On the other hand,
$$2^{10}\equiv 1\mod 11.$$ So, $$2^{1000000}\equiv 1\mod 11.$$
We now find $0\leq x\leq 76$ which satisfies
\begin{align*}
x&\equiv 2\mod 7\\
x&\equiv 1\mod 11
\end{align*}
by the Chinese Remainder Theorem (Theorem 7).
Let $M=7\cdot 11=77$, $M_1=11$, and $M_2=7$. Since $(7,11)=1$, there exist $y,z\in\mathbb{Z}$ such that $7y+11z=1$. By Euclidean algorithm, one can find solution $y=-3$, $z=2$. Thus,
\begin{align*}
a_1&=2,\ m_1=7,\ M_1=11,\ N_1=2,\\
a_2&=1,\ m_2=11,\ M_2=7,\ N_2=-3.
\end{align*}
Hence,
\begin{align*}
x&=\sum_{i=1}^2a_iM_iN_i\\
&=23\mod 77.
\end{align*}

Theorem 11.
$$
\sum_{d|n}\phi(d)=n. \tag{8}
$$

Proof. Let
$$f(n):=\sum_{d|n}\phi(d).$$
First we show that $f(n)$ is multiplicative. Suppose that $(m,n)=1$ and $d|mn$. Then $d$ can be written in the form $d=d_1d_2$ such that $d_1|m$ and $d_2|n$. Since $(d_1,d_2)=1$, by Corollary 8,
$$\phi(d)=\phi(d_1d_2)=\phi(d_1)\phi(d_2).$$
Now,
\begin{align*}
f(mn)&=\sum_{d|mn}\phi(d)\\
&=\sum_{d_1|m}\sum_{d_2|n}\phi(d_1)\phi(d_2)\\
&=\sum_{d_1|m}\phi(d_1)\left(\sum_{d_2|n}\phi(d_2)\right)\\
&=\sum_{d_1|m}\phi(d_1)f(n)\\&=f(n)\sum_{d_1|m}\phi(d_1)\\
&=f(m)f(n).
\end{align*}
Let $n=p_1^{\alpha_1}p_2^{\alpha_2}\cdots p_r^{\alpha_r}$ be the prime factorization of $n$. Then
$$f(n)=f(p_1^{\alpha_1})f(p_2^{\alpha_2})\cdots f(p_r^{\alpha_r})$$
and for each $i=1,\cdots, r$,
\begin{align*}
f(p_i^{\alpha_i})&=\sum_{d|p_i^{\alpha_i}}\phi(d)\\
&=\sum_{j=0}^{\alpha_i}\phi(p_i^j)\\
&=\sum_{j=1}^{\alpha_i}p_i^j\left(1-\frac{1}{p_i}\right)+1\\
&=\sum_{j=1}^{\alpha_i}(p_i^j-p_i^{j-1})+1\\
&=p_i^{\alpha_i}.\end{align*}
Therefore,
$$f(n)=p_1^{\alpha_1}p_2^{\alpha_2}\cdots p_r^{\alpha_r}=n.$$

NT: Congruences and Modular Arithmetic 1

Definition. Let $m>0$. We say that $a$ is congruent to $b$ modulo $m$ and write $a\equiv b\mod m$ if $m|b-a$.

Example. Since $6|7-1$, $1\equiv 7\mod 6$. Since $6|13-1$, $1\equiv 13\mod 6$. Since $6\not|7-2$, $7\not\equiv 2\mod 6$.

Theorem 1. Let $a,a',b,b',c,d$, and $m$ be integers with $d>0$ and $m>0$. Then

  1. $a\equiv a\mod m$.
  2. If $a\equiv b\mod m$ then $b\equiv a\mod m$.
  3. If $a\equiv b\mod m$ and $b\equiv c\mod m$ then $a\equiv c\mod m$.
  4. If $a\equiv b\mod m$ and $a'\equiv b'\mod m$ then $a+a'\equiv b+b'\mod m$.
  5. If $a\equiv b\mod m$ and $a'\equiv b'\mod m$ then $aa'\equiv bb'\mod m$.
  6. If $a\equiv b\mod m$ and $d|m$ then $a\equiv b\mod d$.


Proof.

  1. Since $m|0=a-a$, $a\equiv a\mod m$.
  2. Let $a\equiv b\mod m$. Then $m|b-a$ and so $b-a=mk$ for some $k\in\mathbb{Z}$. Since $a-b=m(-k)$ and $-k\in\mathbb{Z}$, then $m|a-b$, i.e., $b\equiv a\mod m$.
  3. Suppose that $a\equiv b\mod m$ and $b\equiv c\mod m$. Then $m|b-a$ and $m|c-b$, so $$m|(b-a)+(c-b)=c-a.$$ Hence, $a\equiv c\mod m$.
  4. Suppose that $a\equiv b\mod m$ and $a'\equiv b'\mod m$. Then $m|b-a$ and $m|b'-a'$, so $$m|(b-a)+(b'-a')=(b+b')-(a+a'),$$ that is, $a+a'\equiv b+b'\mod m$.
  5. Suppose that $a\equiv b\mod m$ and $a'\equiv b'\mod m$. Then $m|b-a$ and $m|b'-a'$. Now, $$bb'-aa'=(b-a)a'+(b'-a')b.$$ Since $m|b-a$ and $m|b'-a'$, $m|bb'-aa'$, i.e., $aa'\equiv bb'\mod m$.
  6. If $a\equiv b\mod m$ then $m|b-a$. If $d|m$ then $d|b-a$ and so $a\equiv b\mod d$.


Remark 1. Properties 1-3 tell us that $\equiv\mod m$ is an equivalence relation on $\mathbb{Z}$. Properties 1-5 tell us that $\equiv\mod m$ is a congruence relation, an equivalence relation that preserves operations, on $\mathbb{Z}$. One could easily guess that $\equiv\mod m$ is where the name congruence relation is originated from. For more details about congruence relation, see the reference [1] below.

Definition. If $m>0$ and $r$ is the remainder when the division algorithm is used to divide $b$ by $m$, then $r$ is called the least residue of $b$ modulo $m$.

Example.

  1. The least residue of $12\mod 7$ is $5$.
  2. The least residue of $20\mod 4$ is $0$.
  3. The least residue of $-12\mod 7$ is $2$.
  4. The least residue of $-3\mod 7$ is $4$.

Theorem 2. Let $m>0$. Then

  1. If $r$ and $b$ are integers such that $r\equiv b\mod m$ and $0\leq r<m$, then $r$ is the least residue $\mod m$.
  2. Two integers are congruent $\mod m$ if and only if they have the same least residue $\mod m$.

Proof.

  1. Suppose that $r\equiv b\mod m$. Then $m|b-r$ and so $b=mq+r$ for some $q\in\mathbb{Z}$. If $0\leq r<m$ then by the uniqueness of the quotient and the remainder, $r$ must be the least residue $\mod m$.
  2. Suppose that $b$ and $b'$ have the same remainder when divided by $m$, say $$b=mq+r\ {\rm and}\ b'=mq'+r$$ for some $q,q'\in\mathbb{Z}$. Then $b-b'=m(q-q')$ and so $b\equiv b'\mod m$. Conversely, suppose that $b\equiv b'\mod m$ and $b=mq+r$ with $0\leq r<m$. Then $b'\equiv b\mod m$ and $b\equiv r\mod m$, thus $b'\equiv r\mod m$. Therefore by part 1, $r$ is the least residue of $b'\mod m$.

Example. Find the least residue of $33\cdot 26^2\mod 31$.

Solution: $33\equiv 2\mod 31$ and $26\equiv -5\mod 31$. So, \begin{align*} 33\cdot 26^2&\equiv 2\cdot (-5)^2\mod 31\\ &\equiv 50\mod 31\\ &\equiv 19\mod 31.\end{align*} Since $0\leq 19<31$, the least residue is $19$.

Maxima. Maxima has a function to compute the least residue of $a$ modulo $m$. The command is mod(a,m). The preceding example can be computed in Maxima as:

(%i3) mod(33*26^2,31);

(%o3) 19

Theorem 3 (The Cancellation Theorem). If $a,b>0$, $x$ and $x'$ are integers such that $(a,b)=1$, then $ax\equiv ax'\mod b$ implies $x\equiv x'\mod b$.

The following example shows that the Cancellation Theorem does not necessarily hold unless the condition $(a,b)=1$ is satisfied.

Example. $(2,4)=2\ne 1$. $2\cdot 1\equiv 2\cdot 3\mod 4$ but $1\not\equiv 3\mod4$.

The Cancellation Theorem is a special case of the following more general theorem.

Theorem 4. If $a,b>0$, $x$ and $x'$ are integers such that $(a,b)=d$, then
$ax\equiv ax'\mod b$ if and only if $x\equiv x'\mod b/d$.

Proof.
\begin{align*}
ax\equiv ax'\mod b&\Longrightarrow b|a(x'-x)\\
&\Longrightarrow a(x'-x)=bk\ \mbox{for some}\ k\in\mathbb{Z}\\
&\Longrightarrow \frac{a}{d}(x'-x)=\frac{b}{d}k\\
&\Longrightarrow \frac{b}{d}|\frac{a}{d}(x'-x)\\
&\Longrightarrow \frac{b}{d}|x'-x\ \mbox{since}\ \left(\frac{a}{d},\frac{b}{d}\right)=1\\
&\Longrightarrow x\equiv x'\mod\frac{b}{d}.
\end{align*}
Conversely, if $x\equiv x'\mod\frac{b}{d}$, then
\begin{align*}
x'-x=\frac{b}{d}k\ \mbox{for some}\ k&\Longrightarrow ax'-ax=b\left(\frac{a}{d}\right)k\\
&\Longrightarrow ax\equiv ax'\mod b.
\end{align*}

Theorem 5. If $a>0, b$, and $b'$ are integers such that
$b\equiv b'\mod a$, then $(a,b)=(a,b')$.

Proof. \begin{align*} b\equiv b'\mod a&\Longrightarrow b'-b=aq\ \mbox{for some}\ q\in\mathbb{Z}\\ &\Longrightarrow b'=b+aq\\ &\Longrightarrow (a,b)=(a,b') \end{align*} by Lemma 3 here.

As mentioned in Remark 1, $\equiv\mod m$ is an equivalence relation on $\mathbb{Z}$. For fixed $m$, each equivalence class with respect to $\equiv\mod m$ has one and only one representative between $0$ and $m-1$. Denote by $\mathbb{Z}/m\mathbb{Z}$ or $\mathbb{Z}_m$ the set of all equivalence classes, called the residue classes. Then
$$\mathbb{Z}/m\mathbb{Z}=\{[0],[1],\cdots,[m-1]\}.$$
Often $\mathbb{Z}/m\mathbb{Z}$ is written simply as
$$\mathbb{Z}/m\mathbb{Z}=\{0,1,\cdots,m-1\},$$
i.e, those residue classes are represented by their representatives (typically those least residues $\mod m$) unless there is a confusion.

Define the binary operations $+$ and $\cdot$ on $\mathbb{Z}/m\mathbb{Z}$: For any $[a],[b]\in\mathbb{Z}/m\mathbb{Z}$,
$$[a]+[b]:=[a+b],\ [a]\cdot[b]:=[a\cdot b].$$
Then $+$ and $\cdot$ are well-defined due to properties (4) and (5), respectively in Theorem 1.

Theorem 6. $(\mathbb{Z}/m\mathbb{Z},+,\cdot)$ is a commutative ring with unity.

Consider $\mathbb{Z}/9\mathbb{Z}$. Its multiplication table is given by
$$
\begin{array}{|c|c|c|c|c|c|c|c|c|c|}
\hline
\cdot & 0 & 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8\\
\hline
0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0\\
\hline
1 & 0 & 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8\\
\hline
2 & 0 & 2 & 4 & 6 & 8 & 1 & 3 & 5 & 7\\
\hline
3 & 0 & 3 & 6 & 0 & 3 & 6 & 0 & 3 & 6\\
\hline
4 & 0 & 4 & 8 & 3 & 7 & 2 & 6 & 1 & 5\\
\hline
5 & 0 & 5 & 1 & 6 & 2 & 7 & 3 & 8 & 4\\
\hline
6 & 0 & 6 & 3 & 0 & 6 & 3 & 0 & 6 & 3\\
\hline
7 & 0 & 7 & 5 & 3 & 1 & 8 & 6 & 4 & 2\\
\hline
8 & 0 & 8 & 7 & 6 & 5 & 4 & 3 & 2 & 1\\
\hline
\end{array}
$$
As one can see clearly, not every nonzero element of $\mathbb{Z}/9\mathbb{Z}$ has a multiplicative inverse. So, $\mathbb{Z}/9\mathbb{Z}$ cannot be a field. However, there are elements of $\mathbb{Z}/9\mathbb{Z}$ that have multiplicative inverses. They are $1,2,4,5,7,8$. As representatives of residue classes, they are all relatively prime to $9$. In fact, the following theorem holds in general.

Theorem 7. The elements of $\mathbb{Z}/m\mathbb{Z}$ which have multiplicative inverses are those which are relatively prime to $m$, i.e., the numbers $a$ for which there exists $b$ with $ab\equiv 1\mod m$ are precisely those $a$ for which $(a,m)=1$.

Proof. Let $d=(a,m)$ and suppose that there exists $b\in\mathbb{Z}$ such that $ab\equiv 1\mod m$. Then by property 6 in Theorem 1 $ab\equiv 1\mod d$. Since $d|a$, $d$ must divide $1$, i.e., $d=1$. Conversely, if $(a,m)=1$ then by Bézout's Lemma (Theorem 5 here), there exist $x,y\in\mathbb{Z}$ such that $ax+my=1$. Choose $b=x$. Then $ab\equiv 1\mod m$.

Definition. If $(a,m)=1$ then by negative power $a^{-n}\mod m$ we mean the $n$-th powers of the inverse residue class, i.e., it is represented by the $n$-th power of any integer $b$ for which $ab\equiv 1\mod m$.

Example. Find $160^{-1}\mod 841$, i.e., the inverse of $160\mod 841$.

Solution: First check if $(160,841)=1$ by the Euclidean algorithm.
\begin{align*} 841&=160\cdot 5+41,\\ 160&=41\cdot 3+37,\\ 41&=37\cdot 1+4,\\ 37&=4\cdot 9+1. \end{align*} So, $(160,841)=1$. Now by working backward, let us find $b$ such that $160\cdot b\equiv 1\mod 841$. \begin{align*} 1&=37-4\cdot 9\\ &=37-(41-37)9\\ &=10\cdot 37-9\cdot 41\\ &=10(160-3\cdot 41)-9\cdot 41\\ &=10\cdot 160-39\cdot 41\\ &=10\cdot 160-39(841-5\cdot 160)\\ &=205\cdot 160-39\cdot 841.\end{align*} Hence, $b=205=160^{-1}$.

Maxima. Maxima can compute the inverse of $a$ modulo $m$ with the command inv_mod(a,m). For example, the inverse of 160 modulo 841 can be computed in Maxima as:

(%i4) inv_mod(160,841);

(%o4) 205

Corollary 8. If $p$ is a prime number then every nonzero residue class has a multiplicative inverse, i.e, $\mathbb{Z}/p\mathbb{Z}$ is a field. We often denote this finite field of $p$ elements by $\mathbb{F}_p$.

Corollary 9. Suppose $0\leq a,b<m$. If $(a,m)=1$ then there exists $x_0\in\mathbb{Z}$ such that $ax_0\equiv b\mod m$ and all solutions of $ax\equiv b\mod m$ are of the form $x=x_0+mn$ for $n$ an integer. If $(a,m)=d$ then there exists $x\in\mathbb{Z}$ such that $ax\equiv b\mod m$ if and only if $d|b$ and in that case our congruence is equivalent to the congruence $a'x\equiv b'\mod m'$, where $a'=a/d,b'=b/d,m'=m/d$.

Proof. If $(a,m)=1$ then there exists $a^{-1}\in\mathbb{Z}$ such that $a\cdot a^{-1}\equiv 1\mod m$, so $a\cdot (a^{-1}b)\equiv b\mod m$. Choose $x_0=a^{-1}b$. Since $(a,m)=1$, by Theorem 7 here, all solutions of equation $ax\equiv b\mod m$ or equivalently $ax+mq=b$ for some $q\in\mathbb{Z}$ are given in the form $$x=x_0+mn$$ for some $n\in\mathbb{Z}$. Let $(a,m)=d$. If there exists $x\in\mathbb{Z}$ such that $ax\equiv b\mod m$, then clearly $d|b$. Conversely, suppose that $d|b$. Since $(a/d,m/d)=1$, there exists $x\in\mathbb{Z}$ such that $\frac{a}{d}x\equiv\frac{b}{d}\mod\frac{m}{d}$ and this is clearly equivalent to $ax\equiv b\mod m$.

References:

  1. Stanley Burris and H. P. Sankappanavar, A Course in Universal Algebra, Springer-Verlag, 1981

Monday, September 1, 2025

Group Theory 7: Congruence Modulo $n$

 In this note, we study the congruence modulo $n$, $\equiv\mod n$ on $\mathbb{Z}$ more in depth. As seen here, $\equiv\mod n$ is an equivalence relation on $\mathbb{Z}$. It turns out that $\equiv\mod n$ is more than just an equivalence relation. $\equiv\mod n$ also preserves operations $+$ and $\cdot$ on $\mathbb{Z}$. (See #1 of Problem Set 5 here) Because of this, we can define an operation $+$ on the quotient set $\mathbb{Z}/\equiv\mod n$ so that it becomes a quotient group. In general, if an equivalence relation on an algebra preserves operations, it is called a congruence relation and a congruence relation allows us to define a quotient algebra, for example, a quotient group. Let $G$ be a group and $H\leq G$. We studied the equivalence relation $\sim$ on $G$: $\forall a,b\in G$,
$$a\sim b \Longleftrightarrow ab^{-1}\in H.$$ The equivalence relation $\sim$ is a congruence relation i.e. it preserves the group operation $\cdot$ if $H$ is a normal subgroup of $G$.

Let us recall that on $\mathbb{Z}$, $a\equiv b\mod n$, we say $a$ is congruent to $b$ modulo $n$, if $n|a-b$. The equivalence class of $a$
$$[a]=\{a+nk: k\in\mathbb{Z}\}$$ is called the congruence class of $a$. By Euclid's algorithm, $\forall b\in\mathbb{Z}$, $b=qn+r$ where $0\leq r<n$. This implies that $b\equiv r\mod n$ and so $[b]=[r]$. Hence, there are exactly $n$ distinct congruence classes $[0],[1],\cdots,[n-1]$. Let
$$\mathbb{Z}_n=\{[0],[1],\cdots,[n-1]\}.$$ That is, $\mathbb{Z}_n$ is the quotient set modulo the equivalence relation $\equiv\mod n$, $\mathbb{Z}/\equiv\mod n$. Define $+$ on $\mathbb{Z}_n$: $\forall [a],[b]\in\mathbb{Z}_n$,
$$[a]+[b]:=[a+b].$$ Then $+$ is well-defined on $\mathbb{Z}_n$. What this means is that $+$ is well-defined as a function $+:\mathbb{Z}_n\times\mathbb{Z}_n\longrightarrow\mathbb{Z}_n$. In other words, if $[a]=[a']$ and $[b]=[b']$ then $[a+b]=[a'+b']$. This can be shown straightforwardly and is left for the readers as an exercise. One can readily see that $(\mathbb{Z}_n,+)$ is an abelian group. Define $\cdot $ on $\mathbb{Z}_n$: $\forall [a],[b]\in\mathbb{Z}_n$,
$$[a]\cdot[b]:=[ab].$$ Then $\cdot$ is also well-defined on $\mathbb{Z}_n$. However, $(\mathbb{Z}_n,\cdot)$ is not a group. $\forall [a]\in\mathbb{Z}_n$, $[0][a]=[0]$ and $[1]$ is the identity for the multiplication, so $[0]$ does not have a multiplicative inverse. Would the nonzero elements of $\mathbb{Z}_n$ form a group then? The answer is no. For instance, in $\mathbb{Z}_6$, $[2],[3]\ne [0]$ but $[2][3]=[6]=[0]$. Such elements like $[2]$ and $[3]$ in $\mathbb{Z}_6$ are called zero divisors. So, is there a subset of $\mathbb{Z}_n$ that forms a group under $\cdot$? The answer is affirmative. Let $\mathbb{Z}_n^\ast=\{[a]\in\mathbb{Z}_n: (a,n)=1\}$. First, note that for $[a]=[b]$, $(a,n)=1$ if and only if $(b,n)=1$. This can be proved by contrapositive. Suppose that $[a]=[b]$. Then $a\equiv b\mod n\Rightarrow a-b=nk$ for some $k\in\mathbb{Z}$. If $(b,n)=d>1$ then since $d|b$ and $ d|n$, $d|a=b+nk\Rightarrow (a,n)\ne 1$. In the same manner, it can be also shown that if $(a,n)\ne 1$ then $(b,n)\ne 1$. Recall the property that if $(a,n)=1$ and $(b,n)=1$, then $(ab,n)=1$. (# 4 of Problem Set 1 here.) This implies that $[a][b]=[ab]\in\mathbb{Z}_n^\ast$. Now suppose that $[a][b]=[a][c]$. Then
\begin{align*}
[ab]=[ac]&\Longrightarrow n|a(b-c)\\
&\Longrightarrow n|b-c\ (\mbox{since}\ (a,n)=1)\\
&\Longrightarrow [b]=[c].
\end{align*}
That is, $\mathbb{Z}_n^\ast$ has the cancellation property, so $(\mathbb{Z}_n^\ast,\cdot)$ is a group. (See # 2 of Problem Set 5 here.) In some textbooks, $\mathbb{Z}_n^\ast$ is also denoted by $U_n$. The order of $\mathbb{Z}_n^\ast$ is the number of integers $1\leq m<n$ such that $(m,n)=1$.

Definition. The Euler $\varphi$-function, $\varphi(n)$, is defined by $\varphi(1)=1$ and for $n>1$, $\varphi(n)=$ the number of positive integers $m$ with $1\leq m<n$ such that $(m,n)=1$. Hence, $|\mathbb{Z}_n^\ast|=\varphi(n)$. If $n=p$, a prime, then $\varphi(p)=p-1$.

Note that the Euler $\varphi$-function is multiplicative, namely if $(m,n)=1$, then $\varphi(mn)=\varphi(m)\varphi(n)$.

Example. $\varphi(8)=4$, $\varphi(15)=8$.

Example.
\begin{align*}
\mathbb{Z}_8^\ast&=\{[1],[3],[5],[7]\},\\
\mathbb{Z}_{15}^\ast&=\{[1],[2],[4],[7],[8],[11],[13],[14]\}.
\end{align*}

Example. $\mathbb{Z}_9^\ast=\{[1],[2],[4],[5],[7],[8]\}$.
\begin{align*}
[2]^1&=[2],\ [2]^2=[4],\ [2]^3=[8],\ [2]^4=[16]=[7],\\
[2]^5&=[32]=[5],\ [2]^6=[2][2]^5=[2][5]=[10]=[1].
\end{align*}
Hence, $\mathbb{Z}_9^\ast$ is a cyclic group $\mathbb{Z}_9^\ast=\langle[2]\rangle$.

As a summary,

Theorem. $\mathbb{Z}_n^\ast$ forms an abelian group under the product $[a][b]=[ab]$, of order $\varphi(n)$, where $\varphi(n)$ is the Euler $\varphi$-function.

Theorem. [Euler]
If $(a,n)=1$ then $a^{\varphi(n)}\equiv 1\mod n$.

Proof. Since $\mathbb{Z}_n^\ast$ is a group of order $\varphi(n)$, $[a]^{\varphi(n)}=[1]$, $\forall [a]\in\mathbb{Z}_n^\ast$. So,
$$[a^{\varphi(n)}]=[a]^{\varphi(n)}=[1]\Longrightarrow a^{\varphi(n)}\equiv 1\mod n.$$

Corollary. [Fermat]

If $p$ is a prime and $p\not | a$, then
$$a^{p-1}\equiv 1\mod p.$$
For any integer $b$, $b^p\equiv b\mod p$. This corollary is usually called Fermat's Little Theorem.

Proof. If $p$ is a prime and $p\not |a$, then $(a,p)=1$, so by the preceding theorem,
$$a^{\varphi(p)}=a^{p-1}\equiv 1\mod p$$
For any integer $b$, if $p\not b$ then
$$b^{p-1}\equiv 1\mod p\Rightarrow b^p=b^{p-1}b\equiv b\mod p,$$
since $\equiv\mod p$ preserves multiplication. One can also show that using only the definition of $\equiv\mod p$:
\begin{align*}
b^{p-1}\equiv 1\mod p &\Longrightarrow b^{p-1}-1=pk\ \mbox{for some integer}\ k\\
&\Longrightarrow b^p-b=p(bk)\\
&\Longrightarrow b^p\equiv b\mod p.
\end{align*}
If $p|b$, then $b\equiv 0\mod p\Longrightarrow b^p\equiv 0\mod p$. Hence, for any $b\in\mathbb{Z}$, $b^p\equiv b\mod p$.

Example. Compute the remainder of $8^{103}$ when it is divided by 13.

Solution. Since 13 is a prime and $13\not|8$, by Fermat's Little Theorem we have
$$8^{13-1}=8^{12}\equiv 1\mod 13.$$ Dividing 103 by 13, we obtain $103=12\cdot 8+7$. So,
\begin{align*}
8^{103}&= (8^{12})^88^7\\
&\equiv 8^7\mod 13\\
&\equiv (-5)^7\mod 13\ (8\equiv -5\mod 13)\\
&\equiv (25)^3(-5)\mod 13\\
&\equiv (-1)^3(-5)\equiv 5\mod 13\ (25\equiv -1\mod 13).
\end{align*}

Example. Show that $2^{11,213}-1$ is not divisible by 11.

Solution. Since $11$ is a prime and $11\not| 2$, by Fermat's Little Theorem we have $$2^{11-1}=2^{10}\equiv 1\mod 11.$$
$11,213=10\cdot 1,121+3$, so
\begin{align*}
2^{11,213}-1&= (2^{10})^{1,121}\cdot 2^3-1\\
&\equiv 2^3-1\mod 11\\
&\equiv 7\mod 11.
\end{align*}
Hence, when $2^{11,213}-1$ is divided by 11, the remainder is 7.

The number $11,213$ is a prime and $2^{11,213}-1$ is also a prime. In number theory, primes of the form $2^p-1$ where $p$ is a prime are called Mersenne primes.

Monday, August 11, 2025

NT: Linear Combinations

 Theorem 1. Given integers $a$, $b$, and $c$ with $a$ and $b$ not both $0$, there exist $x,y\in\mathbb{Z}$ such that $ax+by=c$ if and only if $(a,b)|c$.

Proof. Left as an exercise. See Number Theory Problem Set 2 #4.

Corollary. Let $a$ and $b$ be integers. Then there exist $x,y\in\mathbb{Z}$ such that $ax+by=1$ if and only if $(a,b)=1$ i.e. $a$ and $b$ are relatively prime.

Corollary. Let $a,a',b\in\mathbb{Z}$. If $(a,b)=1$ and $(a',b)=1$, then $(aa',b)=1$.

Proof. Since $(a,b)=1$ and $(a',b)=1$, there exist $x,y,x',y'\in\mathbb{Z}$ such that $ax+by=1$ and $a'x'+by'=1$. Now,
 \begin{align*}
  1&=(ax+by)(a'x'+by')\\
   &=aa'xx'+b(axy'+a'x'y+byy')
 \end{align*}
Hence, $(aa',b)=1$.

Theorem 2. If $a,b$ and $c$ are integers such that $(a,b)=1$ and $a|bc$, then $a|c$.

Proof. Since $(a,b)=1$, there exist $x,y\in\mathbb{Z}$ such that $ax+by=1$. So, we obtain $acx+bcy=c$. Since $a|ac$ and $a|bc$, $a|c$.

Remark. $a|bc$ does not necessarily imply that $a|b$ or $a|c$. For example, $6|36=4\cdot 9$ but $6\not|4$ and $6\not|9$. However, the following theorem holds.

Theorem. If $p$ is a prime number and $p|ab$, then $p|a$ or $p|b$.

Proof. Let $p$ be a prime number and $p|ab$. Suppose that $p\not|a$ and $p\not|b$. Since $p$ is prime and $p\not|a$, $(p,a)=1$ and so $px+ay=1$ for some $x,y\in\mathbb{Z}$. Now, $p|pbx+aby=b$ but this is a contradiction to the assumption that $p\not|b$. Therefore, $p|a$ or $p|b$.

The following proof is essentially the same as the above proof. But instead of proving the statement indirectly by contradiction, it proves the statement directly. It is always good to practice different ways of proving a statement.

Proof. Let $p$ be a prime number and $p|ab$. If $p|a$, we are done. Suppose that $p\not|a$. Then since $p$ is prime, $(p,a)=1$ and so $px+ay=1$ for some $x,y\in\mathbb{Z}$. Now, $p|pbx+aby=b$. This completes the proof.

Theorem. If $a$ and $b$ are integers and $(a,b)=d$, then $\frac{a}{d}$ and $\frac{b}{d}$ are relatively prime.

Proof. Since $(a,b)=d$, there exist $x,y\in\mathbb{Z}$ such that $ax+by=d$. Dividing the equation by $d$, we obtain
 $\frac{a}{d}x+\frac{b}{d}y=1$. By theorem 1, this implies that $\left(\frac{a}{d},\frac{b}{d}\right)=1$.

Example. Consider the equation $9x+24y=15$. Since $(9,24)=3$ and $3|15$, from theorem 1, we know that a solution exist. First, we can find a solution to $9x+24y=3$ using the Euclidean algorithm as seen before.
 \begin{align*}
  24&=9\cdot 2+6\\
   9&=6\cdot 1+3\\
   6&=3\cdot 2+0
 \end{align*}
Thus,
\begin{align*}
   3&=9-6\cdot 1\\
    &=9-(24-9\cdot 2)\cdot 1\\
    &=9\cdot 3+24\cdot(-1)
\end{align*}
Hence, $x'=3$ and $y'=-1$ is a solution to $9x+24y=3$ and thereby $x=5x'=15$ and $y=5y'=-5$ is a solution to $9x+24y=15$. Finding a solution is not a big deal. But there are other solutions. For instance, $x=-1$ and $y=1$ is also a solution to $9x+24y=15$. How do we find other solutions? We now turn our attention to this question.

Suppose that $(x_0,y_0)$ is a solution to
$$
 ax+by=c \tag{1}
$$
Then
$$
 ax_0+by_0=c \tag{2}
$$
Subtracting (2) from (1), we obtain
$$
a(x-x_0)=b(y_0-y) \tag{3}
$$
Let $d=(a,b)$. Dividing (3) by $d$, we obtain
$$
\frac{a}{d}(x-x_0)=\frac{b}{d}(y_0-y) \tag{4}
$$
This means that $\frac{a}{d}|\frac{b}{d}(y_0-y)$. Since $\left(\frac{a}{d},\frac{b}{d}\right)=1$, by theorem 2, $\frac{a}{d}|y_0-y$ and so, $y_0-y=\frac{a}{d}t$ for some $t\in\mathbb{Z}$. From (4) we also obtain $x-x_0=\frac{b}{d}t$. Therefore, $x$ and $y$ are written as
$$
  x=x_0+\frac{b}{d}t,\ y=y_0-\frac{a}{d}t \tag{5}
$$
where $t\in\mathbb{Z}$. Conversely, any $(x,y)$ in the form (5) satisfies the equation (1).
$$a\left(x_0+\frac{b}{d}t\right)+b\left(y_0-\frac{a}{d}t\right)=ax_0+by_0=c$$

Theorem 3. Suppose that $a\ne 0$, $b\ne 0$, and $c$ are integers. Let $(x_0,y_0)$ be a particular solution to $ax+by=c$. Then all solutions to $ax+by=c$ are given by
 $$x=x_0+\frac{b}{d}t,\ y=y_0-\frac{a}{d}t$$
 where $t\in\mathbb{Z}$ and $(a,b)=d$.

Example. In preceding example, we found $(x_0,y_0)=(15,-5)$. So by theorem 3, all solutions to $9x+24y=15$ are given by
$$x=15+8t,\ y=-5-3t$$
where $t\in\mathbb{Z}$.

Example. Find all positive integers $x,y$ such that $4x+6y=100$.

Solution. $(4,6)=2$ and $2|100$, so a solution exists.
$6=4\cdot 1+2$ i.e. $2=4\cdot (-1)+6\cdot 1$. $x_0=-50$ and $y_0=50$ is a particular solution to $4x+6y=100$. By theorem 3, all solutions are given by
$$x=-50+3t,\ y=50-2t$$
where $t\in\mathbb{Z}$. Since $x$ and $y$ are required to be positive, we find that $17\leq t\leq 24$. The following table shows all those solutions.
$$
\begin{array}{|c||c|c|c|c|c|c|c|c|}
\hline
t & 17 & 18 & 19 & 20 & 21 & 22 & 23 & 24\\
\hline
x & 1 & 4 & 7 & 10 & 13 & 16 & 19 & 22\\
\hline
y & 16 & 14 & 12 & 10 & 8 & 6 & 4 & 2\\
\hline
\end{array}
$$

Example. A man paid 11.37 dollars for some 39-cent pens and 69-cent pens. How many of each did he buy?

Solution. The problem is equivalent to solving the equation
$$
39x+69y=1137 \tag{6}
$$
where $x$ and $y$ are nonnegative integers. $(39,69)=3$ and $3|1137$, so the equation has a solution. Solving the equation (6) is equivalent to solving
$$
13x+23y=379 \tag{7}
$$
where $x$ and $y$ are nonnegative integers. Since $(13,23)=1$, by the Euclidean algorithm, one can find a solution $x'=-7$ and $y'=4$ to $13x+23y=1$. $x_0=379x'=-2653$ and $y_0=379\cdot y'=1516$ is then a solution to (7). By theorem 3, all integer solutions to (7) are given by
$$x=-2653+23t,\ y=1516-13t,\ t\in\mathbb{Z}$$
From the conditions $x\geq 0, y\geq 0$, we obtain the inequality $115\frac{8}{23}\leq t\leq 116\frac{8}{23}$. There is only one integer $t=116$ that satisfies the inequality. $x=-2653+23\cdot 116=15$ and $y=1516-13\cdot 116=8$. So, the man bought 15 39-cent pens and 8 69-cent pens.

Thursday, August 7, 2025

The Binomial Asset Pricing Model: One-Period Binomial Model

In this note, we model stock prices in discrete time, assuming that at each step the price per share of stock will be one of two possible values determined by the outcome of a coin toss.

Let $S_0$ be the initial stock price. We introduce two numbers  $u$ and $d$  with $0<d<u$ such that the stock price will be either $dS_0$ or $uS_0$ at the next period. Suppose that we are tossing a coin and when we get a Head ($H$) the stock price goes up and when we get a Tail ($T$), the price goes down. Denote the price at time $1$ by $S_1(H)=uS_0$ if the toss results in $H$ and by $S_1(T)=dS_0$ if the toss results in $T$. After the second toss the price will be one of
\begin{align*}
 S_2(HH)&=uS_1(H)=u^2S_0,\ S_2(HT)=dS_1(H)=duS_0,\\
 S_2(TH)&=uS_1(T)=udS_0,\ S_2(TT)=dS_1(T)=d^2S_0
\end{align*}
Suppose that the 3rd toss is the last one. Then
$$\Omega=\{HHH, HHT, HTH, THH, THT, TTH, TTT\}$$
is the set of all possible outcomes of the three tosses. $\Omega$ is called the sample space for the experiment and each $\omega\in\Omega$ is called a sample point.

We now introduce a money market with interest $r$. We take $r$ to be the interest rate for both borrowing and lending. One dollar invested in the money market at time $0$ will yield $(1+r)$ dollars at time $1$. One dollar borrowed from the money market at time $0$ will result in a debt of $(1+r)$ dollars at time $1$.

In this model, we assume no arbitrage. So, we require that $0<d<1+r<u$ for one-period binomial model. If $d\geq 1+r$, one can start with no money and borrow from the money market to buy the stock. Even in the case of a tail, the stock at time $1$ will be worth enough to pay off the money market debt. This provides an arbitrage. On the other hand, if $u\leq r+1$, one can sell the stock short and invest the proceeds in the money market. Even in the case of a head, the cost of replacing it at time $1$ will be less than or equal to the value of the money market investment. This again provides an arbitrage.

We now consider a European call option, which confers on its owner the right but not the obligation to buy one share of the stock at time $1$ for the strike price of $K$. We assume that $S_1(T)<K<S_1(H)$. If we get a tail, the option expires worthless. If we get a head, the option can be exercised and yields a profit of $S_1(H)-K$. This situation can be described as saying the option at time $1$ is worth $(S_1-K)^+$ where $(S_1-K)^+=\max\{S_1(\omega_1)-K,0\}$.

Example. Let $S_0=4$, $u=2$, $d=\frac{1}{2}$, and $r=\frac{1}{4}$. Then $S_1(H)=8$ and $S_1(T)=2$. Suppose the strike price of the European call option is $K=5$. Suppose we begin with the initial wealth $X_0=1.20$ and buy $\Delta_0=\frac{1}{2}$ shares of stock at time $0$. Since the stock costs $4$ per share at time $0$, we must use our initial wealth $X_0=1.20$ and borrow an additional $0.80$ to buy $\frac{1}{2}$ shares of stock. This leaves us with a cash position $X_0-\Delta_0S_0=-0.80$ (i.e. a debt of $0.80$ to the money market). At time $1$, our cash position will be $(1+r)(X_0-\Delta_0S_0)=-1$. On the other hand, at time $1$ we will have stock valued at either $\frac{1}{2}S_1(H)=4$ or $\frac{1}{2}S_1(T)=1$. If the coin toss results in a head, the value of our portfolio of stock and money market account at time $1$ will be
 $$X_1(H)=\frac{1}{2}S_1(H)+(1+r)(X_0-\Delta_0S_0)=3$$
 If the coin toss results in a tail, the value of our portfolio at time $1$ will be
 $$X_1(T)=\frac{1}{2}S_1(T)+(1+r)(X_0-\Delta_0S_0)=0$$
 In either case, the value of the portfolio agrees with the value of the option at time $1$, which is either $(S_1(H)-5)^+=3$ or $(S_1(T)-5)^+=0$. We have replicated the option by trading in the stock and money markets.

In the one-period model, a derivative security is a security that pays $V_1(H)$ at time $1$ if the coin toss results in $H$ and pays $V_1(T)$ at time $1$ if the coin toss results in $T$. We want to determine the price $V_0$, i.e. how much the option is worth at time $0$. Suppose that we begin we begin with wealth $X_0$ and buy $\Delta_0$ shares of stock at time $0$. This leaves us with a cash position $X_0-\Delta_0S_0$. The value of our portfolio of stock and money market account at time $1$ is
\begin{align*}
 X_1&=\Delta_0S_1+(1+r)(X_0-\Delta_0S_0)\\
 &=(1+r)X_0+\Delta_0(S_1-(1+r)S_0)
\end{align*}
We want to choose $X_0$ and $\Delta_0$ so that $X_1(H)=V_1(H)$ and $X_1(T)=V_1(T)$. Replication of the derivative security requires that
\begin{align*}
 (1+r)X_0+\Delta_0(S_1(H)-(1+r)S_0)&=V_1(H) \tag{1}\\
 (1+r)X_0+\Delta_0(S_1(T)-(1+r)S_0)&=V_1(T) \tag{2}
\end{align*}
Subtracting (2) from (1), we have
$$V_1(H)-V_1(T)=\Delta_0(S_1(H)-S_1(T))$$
Solving this for $\Delta_0$ we obtain
$$
 \Delta_0=\frac{V_1(H)-V_1(T)}{S_1(H)-S_1(T)} \tag{3}
$$
(3) is called the delta-hedging formula. (1) along with (3) can be solved for $X_0$ as
$$
X_0=\frac{1}{1+r}\left[\frac{1+r-d}{u-d}V_1(H)+\frac{u-(1+r)}{u-d}V_1(T)\right] \tag{4}
$$
Introducing new variables $a$ and $b$ such that $u=1+a$ and $d=1+b$, (4) can be written as
$$
 X_0=\frac{1}{1+r}\left[\frac{r-b}{a-b}V_1(H)+\frac{a-r}{a-b}V_1(T)\right] \tag{5}
$$
To summarize, if an agent begins with wealth $X_0$ given by (5) and at time $0$ buys $\Delta_0$ shares of stock given by (3), then at time $1$, if the coin toss results in $H$, the agent will have a portfolio worth $V_1(H)$, and if the coin toss results in $T$, the portfolio will be worth $V_1(T)$. The agent hedged a short position in the derivative security. The derivative security that pays $V_1$ at time $1$ should be priced at
$$
 V_0=\frac{1}{1+r}\left[\frac{r-b}{a-b}V_1(H)+\frac{a-r}{a-b}V_1(T)\right] \tag{6}
$$
at time $0$. This price allows the seller to hedge the short position in the claim.

Let
$$
p=\frac{r-b}{a-b}\ \mathrm{and}\ q=\frac{a-r}{a-b} \tag{7}
$$
Then $p+q=1$, and (5) and (6) can be written as
$$
V_0=X_0=\frac{1}{1+r}[pV_1(H)+qV_1(T)] \tag{8}
$$
Alternatively, (8) can be written as
$$
 V_0=\frac{1}{1+r}[p(S_0(a+1)-K)^++(1-p)(S_0(b+1)-K)^+] \tag{9}
$$
Can $p$ be interpreted as a probability? Suppose that the stock price goes up from $S_0$ to $uS_0$ with probability (Note this $q$ is different from $q$ in (7)) $q$ and it goes down from $S_0$ to $dS_0$ with probability $1-q$. If investors were risk-neutral, the expected rate of return on the stock would be the riskless interest rate, so we have
$$q(uS_0)+(1-q)(dS_0)=(1+r)S_0$$
Solving this equation for $q$, we obtain
$$q=\frac{1+r-d}{u-d}=p$$
Hence, the value of the call can be interpreted as the expectation of its discounted future value in a risk-neutral world.

A Glossary of Finance:

  1. Arbitrage: Arbitrage is the simultaneous purchase and sale of the same or similar asset in different markets in order to profit from tiny differences in the asset's listed price. It exploits short-lived variations in the price of identical or similar financial instruments in different markets or in different forms. 
  2. derivative:  The term derivative refers to a type of financial contract whose value is dependent on an underlying asset, group of assets, or benchmark. A derivative is set between two or more parties that can trade on an exchange or over-the-counter (OTC). These contracts can be used to trade any number of assets and carry their own risks. Prices for derivatives derive from fluctuations in the underlying asset. These financial securities are commonly used to access certain markets and may be traded to hedge against risk. Derivatives can be used to either mitigate risk (hedging) or assume risk with the expectation of commensurate reward (speculation). Derivatives can move risk (and the accompanying rewards) from the risk-averse to the risk seekers. 
  3. European call option: A European option is a version of an options contract that limits execution to its expiration date. In other words, if the underlying security such as a stock has moved in price, an investor would not be able to exercise the option early and take delivery of or sell the shares. Instead, the call or put action will only take place on the date of option maturity.
  4. hedge: To hedge, in finance, is to take an offsetting position in an asset or investment that reduces the price risk of an existing position. A hedge is therefore a trade that is made with the purpose of reducing the risk of adverse price movements in another asset. Normally, a hedge consists of taking the opposite position in a related security or in a derivative security based on the asset to be hedged. Derivatives can be effective hedges against their underlying assets because the relationship between the two is more or less clearly defined. Derivatives are securities that move in correspondence to one or more underlying assets. They include options, swaps, futures, and forward contracts. The underlying assets can be stocks, bonds, commodities, currencies, indexes, or interest rates. It's possible to use derivatives to set up a trading strategy in which a loss for one investment is mitigated or offset by a gain in a comparable derivative. 
  5. Option:  The term option refers to a financial instrument that is based on the value of underlying securities such as stocks, indexes, and exchange traded funds (ETFs). An options contract offers the buyer the opportunity to buy or sell-depending on the type of contract they hold-the underlying asset. Unlike futures, the holder is not required to buy or sell the asset if they decide against it. Each options contract will have a specific expiration date by which the holder must exercise their option. The stated price on an option is known as the strike price. Options are typically bought and sold through online or retail brokers. 
  6. Short position: A short, or a short position, is created when a trader sells a security first with the intention of repurchasing it or covering it later at a lower price. A trader may decide to short a security when she believes that the price of that security is likely to decrease in the near future. There are two types of short positions: naked and covered. A naked short is when a trader sells a security without having possession of it. However, that practice is illegal in the U.S. for equities. It is banned fully in India and other countries. A covered short is when a trader borrows the shares from a stock loan department; in return, the trader pays a borrowing rate during the time the short position is in place. In the futures or foreign exchange markets, short positions can be created at any time. 
  7. Short selling: Short selling is an investment or trading strategy that speculates on the decline in a stock or other security's price. It is an advanced strategy that should only be undertaken by experienced traders and investors.

Monday, August 4, 2025

Complex Line Integrals 1: Complex Line Integrals

Let $f(z): \mathcal{R}\longrightarrow\mathbb{C}$ be a piecewise continuous function defined in a domain $\mathcal{R}$ and let $C$ be the differentiable curve $\gamma(t): [a,b]\longrightarrow\mathcal{R}$. Here we assume that $\gamma(t)$ is differentiable on an open interval containing $[a,b]$. The complex line integral of $f(z)$ along the curve $C$, $\int_Cf(z)dz$ is defined to be
$$
\int_Cf(z)dz=\int_a^bf(\gamma(t))\gamma'(t)dt
$$

The complex line integral of $f(z)$ along the curve $C$ satisfies the following properties.

Theorem
.
\begin{align*}
\int_Cz_0f(z)dz&=z_0\int_Cf(z)dz \tag{1}\\
\int_C[f(z)+g(z)]dz&=\int_Cf(z)dz+\int_Cg(z)dz \tag{2}
\end{align*}
These two properties (1) and (2) imply that $\int_Cf(z)dz$ is linear.

Let $-C$ denote the same curve as $C$ with opposite orientation. Let $C$ be $\gamma(t): [a,b]\longrightarrow\mathcal{R}$. Then $-C$ is defined by $\gamma(\tau)$ where $\tau=a+b-t$.
\begin{align*}
\int_{-C}f(z)dz&=\int_b^a f(\gamma(\tau))\gamma'(\tau)d\tau\\
&=-\int_a^bf(\gamma(t))\gamma'(t)dt\\
&=-\int_Cf(z)dz
\end{align*}
Hence, we have
$$
\int_{-C}f(z)dz=-\int_Cf(z)dz
$$

Suppose that $C$ is a path that consists of a path $C_1$:  $\gamma(t)$, $a\leq t\leq c$ followed by a path $C_2$: $\gamma(t)$, $c\leq t\leq b$. Then
\begin{align*}
\int_{C_1}f(z)dz+\int_{C_2}f(z)dz&=\int_a^cf(\gamma(t))\gamma'(t)dt+\int_c^bf(\gamma(t))\gamma'(t)dt\\
&=\int_a^bf(\gamma(t))\gamma'(t)dt\\
&=\int_Cf(z)dz
\end{align*}
Hence, we have
$$
\int_Cf(z)dz=\int_{C_1}f(z)dz+\int_{C_2}f(z)dz
$$

Example. Evaluate the integral $\int_C\bar z dz$ where $C$ is the right half of the circle $|z|=2$.

Solution. Let $C$: $\gamma(\theta)=2e^{i\theta}$, $-\frac{\pi}{2}\leq\theta\leq\frac{\pi}{2}$. Then
\begin{align*}
\int_C\bar z dz&=\int_{-\frac{\pi}{2}}^{\frac{\pi}{2}}\overline{2e^{i\theta}}(2e^{i\theta})'d\theta\\
&=4i\int_{-\frac{\pi}{2}}^{\frac{\pi}{2}}d\theta=4\pi i
\end{align*}

Remark
. The result in the preceding example can be used to evaluate $\int_C\frac{1}{z}dz$ where $C$ is the same path in the example.
\begin{align*}
\int_C\frac{1}{z}dz&=\int_C\frac{\bar z}{z\bar z}dz\\
&=\int_C\frac{\bar z}{|z|^2}dz\\
&=\frac{1}{4}\int_C\bar z dz\ (|z|=2)\\
&=\pi i
\end{align*}

Example. Let $C_1$ denote the path $OAB$ and $C_2$ denote the path $OB$ in figure 1. 

Figure 1. Path dependence
Evaluate the integrals $\int_{C_1}f(z)dz$ and $\int_{C_2}f(z)dz$, where $f(z)=y-x-i3x^2$ ($z=x+iy$).

Solution. The path $OAB$ can be represented by
$$
\gamma(t)=\left\{\begin{array}{ccc}
it & \mbox{if} & 0\leq t\leq 1\\
(t-1)+i & \mbox{if} & 1\leq t\leq 2
\end{array}
\right.
$$
Thus,
\begin{align*}
\int_{C_1}f(z)dz&=\int_0^1f(\gamma(t))\gamma'(t)dt+\int_1^2f(\gamma(t))\gamma'(t)dt\\
&=i\int_0^1tdt+\int_1^2[2-t-i3(t-1)^2]dt\\
&=\frac{1-i}{2}
\end{align*}
Alternatively, the path $OA$ can be represented by $z=0+iy$, $0\leq y\leq 1$, while the path $AB$ can be represented by $z=x+i$, $0\leq x\leq 1$. Hence, we have
\begin{align*}
\int_{C_1}f(z)dz&=\int_{\overline{OA}}f(z)dz+\int_{\overline{AB}}f(z)dz\\
&=i\int_0^1ydy+\int_0^1(1-x-i3x^2)dx\\
&=\frac{1-i}{2}
\end{align*}
$C_2$ can be represented by $z=x+ix$, $0\leq x\leq 1$ and
\begin{align*}
\int_{C_2}f(z)dz&=\int_0^1-i3x^2(1+i)dx\\
&=3(1-i)\int_0^1x^2dx\\
&=1-i.
\end{align*}
As seen in this example, while the two paths $C_1$ and $C_2$ have the same initial and terminal points, the integrals $\int_{C_1}f(z)dz$ and $\int_{C_2}f(z)dz$ have different values. This means that the line integrals are in general depend on the paths.