Let $n$, $x$, $y$ and $z$ be positive integers. Fermat's Last Theorem states that there are no solutions of the following equations for $n≧3$.
$$x^n+y^n=z^n\ …(1)$$
If two variables of $x$, $y$ and $z$ have a same prime as factor, then a rest of those must include the prime. Therefore, we suppose these variables do not have a same prime factor and there is no loss of generality in this way. We will consider below by dividing the cases depending on whether $n$ is an odd prime, $4$ or some other value.
Ⅰ. When $n$ is an odd prime
Let $a$ be a positive integer. We suppose $z≢0\ (mod\ n)$ holds and there is no loss of generality in making this supposition. We suppose the following equation holds.
$$z^n=(x+y)a$$
We will consider as follows by dividing the cases according to whether $z^n/a$ is divisible by $z$ or not.
ⅰ. When $z^n/a$ is a multiple of $z$
Let $b$ and $z'$ be positive integers and $z'$ is a prime factor of $x+y$. We suppose the following equation holds.
$$z^n/a=x+y=bz\ …(2)$$
Since $a=\sum_{i=0}^{n-1}x^{n-1-i}(-y)^i$ holds,
$$z^n/(x+y)≡nx^{n-1}\ (mod\ z')$$
holds. The value on the right side is not $0$ since $x$ and $z$ are relatively prime and $z≢0\ (mod\ n)$ holds. Therefore, $a$ and $x+y$ have no common prime factors. By the equation (2),
$$(x+y)a=((x+y)/b)^n$$
$$ab^n=(x+y)^{n-1}$$
holds. Let $c$ be a positive integer. Since $a$ and $x+y$ are prime to each other,
$$b^n=(x+y)^{n-1}c$$
holds. Thus, $a=1$ holds since $ac=1$ holds. By the equations (1) and (2), $x^n+y^n=x+y$ holds. The positive solutions are $x=1$ and $y=1$ when $n≧3$ holds. Then, $z$ is not an integer since $z^n=2$ holds.
ⅱ. When $z^n/a$ is not a multiple of $z$
Let $d$, $e$ and $a'$ be integers and $a'$ is a prime factor of $a$. In the case ⅱ, there is at least one prime factor $a'$ where $z^n/a≢0\ (mod\ a')$ holds. In this instance, $x+y$ does not have a prime $a'$ as a factor. By the way, we suppose $z^n/a=dz+e$ and $e≢0\ (mod\ z)$ hold.
$$z^n=(dz+e)a$$
$$a≡0\ (mod\ z)$$
Hence, $x+y=1$ holds since $x+y$ does not have any prime factors of $a$. In this case, the equation (1) has no positive integer solutions.
Ⅱ. When $n$ is $4$
We suppose $x$ is even and $y$ and $z$ are odd since there are no integer solutions to the equation (1) when $z$ is even. Let $f$ be a positive integer. We suppose the following equation holds.
$$y^4=(x+z)f$$
We will consider as follows by dividing the cases according to whether $y^4/f$ is divisible by $y$ or not.
ⅰ. When $y^4/f$ is a multiple of $y$
Let $g$ and $y'$ be positive integers. We suppose the following equation holds.
$$y^4/f=x+z=gy\ …(3)$$
Since $f=\sum_{i=0}^3x^{3-i}(-z)^i$ holds,
$$z^4/(x+z)≡4x^3 \ (mod\ y')$$
holds. The value on the right side is not $0$ since $x$ and $y$ are relatively prime and $y$ is odd. Therefore, $f$ and $x+z$ have no common prime factors. By the equation (2),
$$(x+z)f=((x+z)/g)^4$$
$$fg^4=(x+z)^3$$
holds. Let $h$ be a positive integer. Since $f$ and $x+z$ are prime to each other,
$$g^4=(x+z)^3h$$
holds. Thereby, $f=1$ holds since $fh=1$ holds. By the equations (1) and (3),
$$z^4-x^4=x+z$$
$$(x^2+z^2)(z-x)=1$$
holds. In order for this equation to have integer solutions, $x^2+z^2=1$ and $z-x=1$ must hold. The integer solutions are $(x, z)=(0, 1), (-1, 0)$. Therefore, the equation (1) does not have a positive solution.
ⅱ. When $y^4/f$ is not a multiple of $y$
Let $j$, $k$ and $f'$ be integers and $f'$ is a prime factor of $f$. In the case ⅱ, $y^4/f≢0\ (mod\ f')$ holds for at least one prime factor $f'$. And $x+z$ does not have a prime $f'$ as a factor. On the other hand, we suppose $y^4/f=jy+k$ and $k≢0\ (mod\ y)$ hold.
$$y^4=(jy+k)f$$
$$f≡0\ (mod\ y)$$
Hence, $x+z=1$ holds since $x+z$ has no prime factors of $f$ and the equation (1) has no positive integer solutions.
Ⅲ. When $n$ is not an odd prime and $n≧6$ holds.
We will take account of two cases depending on the order as follows.
ⅰ. When the order includes an odd prime
Let $p_i$ be an odd prime and $q_i$ and $r$ be positive integers. Let $l$, $m$, $x'$, $y'$ and $z'$ be positive integers and $m=\prod_{i=1}^rp_i^{q_i}×2^l$ holds. We suppose the following equation holds when the order is $m$.
$$(x'^{m/p_i})^{p_i}+(y'^{m/p_i})^{p_i}=(z'^{m/p_i})^{p_i}$$
However, there are no positive integer solutions to this equation since this is the equation (1) when $x=x'^{m/p_i}$, $y=y'^{m/p_i}$, $z=z'^{m/p_i}$ and $n=p_i$ hold.
ⅱ. When the order does not include an odd prime
In this instance, we use the fact that there is no integer solution when $n=4$ holds, which was proven by Fermat. Let $s$ be an integer and $s≧3$ holds. Let $x''$, $y''$ and $z''$ be positive integers. We suppose the following equation holds when the order is $2^s$.
$$(x''^{2^{s-2}})^4+(y''^{2^{s-2}})^4=(z''^{2^{s-2}})^4$$
Though, no positive integer solutions exist to this equation since this is the equation (1) when $x=x''^{2^{s-2}}$, $y=y''^{2^{s-2}}$, $z=z''^{2^{s-2}}$ and $n=4$ hold.
From the above, it is proved that Fermat's Last Theorem is true. (Q.E.D.)