avewright/proofwiki-math huggingface dataset:
Theorem: Solution of Pell's Equation is a Convergent

Let $x = a, y = b$ be a positive solution to Pell's equation $x^2 - n y^2 = 1$.
Then $\dfrac a b$ is a convergent of $\sqrt n$.

Proof:
Let $a^2 - n b^2 = 1$.
Then we have:
:$\paren {a - b \sqrt n} \paren {a + b \sqrt n} = 1$.
So:
:$a - b \sqrt n = \dfrac 1 {a + b \sqrt n} > 0$
and so $a > b \sqrt n$.
Therefore:
{{begin-eqn}}
{{eqn | l = \size {\sqrt n - \frac a b}
      | r = \frac {a - b \sqrt n} b
      | c = 
}}
{{eqn | r = \frac 1 {b \paren {a + b \sqrt n} }
      | c = 
}}
{{eqn | o = <
      | r = \frac 1 {b \paren {b \sqrt n + b \sqrt n} }
      | c = 
}}
{{eqn | r = \frac 1 {2 b^2 \sqrt n}
      | c = 
}}
{{eqn | o = <
      | r = \frac 1 {2 b^2}
      | c = 
}}
{{end-eqn}}
The result follows from Condition for Rational to be Convergent.
{{qed}}
Category:Pell's Equation
Category:Continued Fractions
i4aafba4gb8afprq1bl47ogbwm51evn
Theorem: Convergence of P-Series

Let $p \in \C$ be a complex number.
=== Absolute Convergence if $\map \Re p > 1$ ===
{{:Convergence of P-Series/Absolute Convergence if Real Part of p Greater than 1}}
=== Divergence if $0 <\map \Re p \le 1$ ===
{{:Convergence of P-Series/Divergence if p between 0 and 1}}
=== Real Case ===
{{:Convergence of P-Series/Real}}

Proof:
By the Cauchy Integral Test:
:$\ds \sum_{n \mathop = 1}^\infty \frac 1 {n^x}$ converges {{iff}} the improper integral $\ds \int_1^\infty \frac {\d t} {t^x}$ exists.
The result follows from Integral to Infinity of Reciprocal of Power of x.
{{qed}}
Theorem: Convergence of P-Series

Let $p \in \C$ be a complex number.
=== Absolute Convergence if $\map \Re p > 1$ ===
{{:Convergence of P-Series/Absolute Convergence if Real Part of p Greater than 1}}
=== Divergence if $0 <\map \Re p \le 1$ ===
{{:Convergence of P-Series/Divergence if p between 0 and 1}}
=== Real Case ===
{{:Convergence of P-Series/Real}}

Proof:
Let $p = 1$.
Then from Harmonic Series is Divergent the $p$-series diverges.
So let $p > 1$.
We note that the sequence of partial sums is increasing.
Hence it is sufficient to show that they are bounded above.
Let:
:$s_{2^N} := 1 + \dfrac 1 {2^p} + \dfrac 1 {3^p} + \dotsb + \dfrac 1 {N^p}$
Then:
{{begin-eqn}}
{{eqn | l = s_N
      | o = \le
      | r = S_{2^N - 1}
      | c = 
}}
{{eqn | r = 1 + \dfrac 1 {2^p} + \dfrac 1 {3^p} + \dfrac 1 {4^p} + \dotsb + \dfrac 1 {\paren {2^N - 1}^p}
      | c = 
}}
{{eqn | r = 1 + \paren {\dfrac 1 {2^p} + \dfrac 1 {3^p} } + \paren {\dfrac 1 {4^p} + \dfrac 1 {5^p} + \dfrac 1 {6^p} + \dfrac 1 {7^p} } + \dotsb + \paren {\dfrac 1 {2^{\paren {N - 1} p} } + \dotsb + \dfrac 1 {\paren {2^N - 1}^p} }
      | c = 
}}
{{eqn | o = \le
      | r = 1 + \paren {\dfrac 1 {2^p} + \dfrac 1 {2^p} } + \paren {\dfrac 1 {4^p} + \dfrac 1 {4^p} + \dfrac 1 {4^p} + \dfrac 1 {4^p} } + \dotsb + \paren {\dfrac 1 {2^{\paren {N - 1} p} } + \dotsb + \dfrac 1 {2^{\paren {N - 1} p} } }
      | c = 
}}
{{eqn | r = 1 + \dfrac 2 {2^p} + \dfrac 4 {4^p} + \dotsb + \dfrac {2^{N - 1} } {2^{\paren {N - 1} p} }
      | c = 
}}
{{eqn | r = 1 + \dfrac 1 {2^{p - 1} } + \paren {\dfrac 1 {2^{p - 1} } }^2 + \dotsb + \paren {\dfrac 1 {2^{p - 1} } }^{n - 1}
      | c = 
}}
{{eqn | r = \dfrac {1 - \paren {1 / 2^{p - 1} }^N} {1 - \paren {1 / 2^{p - 1} } }
      | c = 
}}
{{eqn | o = \le
      | r = \dfrac 1 {1 - \paren {1 / 2^{p - 1} } }
      | c = 
}}
{{end-eqn}}
Hence the result.
{{qed}}
Theorem: Square Modulo 4

Let $x \in \Z$ be an integer.
Then $x$ is:
:even {{iff}} $x^2 \equiv 0 \pmod 4$
:odd {{iff}} $x^2 \equiv 1 \pmod 4$

Proof:
{{begin-eqn}}
{{eqn | l = x
      | r = 2 k
      | c = 
}}
{{eqn | ll= \leadstoandfrom
      | l = x^2
      | r = \paren {2 k}^2
      | c = 
}}
{{eqn | r = 4 k^2
      | c = 
}}
{{eqn | o = \equiv
      | r = 0
      | rr= \pmod 4
      | c = 
}}
{{end-eqn}}
{{qed|lemma}}
{{begin-eqn}}
{{eqn | l = x
      | r = 2 k + 1
      | c = 
}}
{{eqn | ll= \leadstoandfrom
      | l = x^2
      | r = \paren {2 k + 1}^2
      | c = 
}}
{{eqn | r = 4 \paren {k^2 + k} + 1
      | c = 
}}
{{eqn | o = \equiv
      | r = 1
      | rr= \pmod 4
      | c = 
}}
{{end-eqn}}
{{qed}}
Theorem: Parity of Smaller Elements of Primitive Pythagorean Triple

Let $\left({x, y, z}\right)$ be a Pythagorean triple, that is, integers such that $x^2 + y^2 = z^2$.
Then $x$ and $y$ are of opposite parity.

Proof:
From Smaller Elements of Pythagorean Triple not both Odd, $x$ and $y$ are not both odd.
{{AimForCont}} $x$ and $y$ are both even.
Then by definition they have $2$ as a common divisor.
But from Elements of Primitive Pythagorean Triple are Pairwise Coprime this cannot be the case.
So by Proof by Contradiction, $x$ and $y$ cannot both be even.
It follows that $x$ and $y$ are of opposite parity.
{{qed}}
Category:Pythagorean Triples
lutvr5hektr7ps1ssx5cnyixsv1qvfr
Theorem: Dirichlet Series is Analytic

Let $(a_n)$ be sequence of complex numbers.
Let:
:$\ds \map f z = \sum_{n \mathop = 1}^\infty \frac {a_n} {n^z}$
be the associated Dirichlet Series, which is defined at the points where the series converges.
Then $f$ is analytic in every open set such that the sum converges in the set.

Proof:
{{ProofWanted}}
Category:Dirichlet Series
0jy9evo5zxvsiiapob40ddmut40aecw
Theorem: Consecutive Integers are Coprime

$\forall h \in \Z$, $h$ and $h + 1$ have only two common factors: $1$ and $-1$.
That is, consecutive integers are always coprime.

Proof:
$\gcd \set {h + 1, h} = \gcd \set {h, 1} = \gcd \set {1, 0} = 1$ from the Euclidean Algorithm.
{{qed}}
Theorem: Consecutive Integers are Coprime

$\forall h \in \Z$, $h$ and $h + 1$ have only two common factors: $1$ and $-1$.
That is, consecutive integers are always coprime.

Proof:
Let $k \in \Z: k \divides h$.
Also assume $k \divides \paren {h + 1}$.
Thus:
:$\exists a, b \in \N: a k = h, b k = \paren {h + 1}$
Then:
:$\paren {h + 1} - h = b k - a k$
and so:
:$1 = \paren {b - a} k$
Since the integers form an integral domain, $\paren {b - a} \in \Z$.
Thus either $k = 1$ and $b - a = 1$, or $k = -1$ and $b - a = -1$.
Therefore, only $1$ and $-1$ can be factors of both $h$ and $\paren {h + 1}$.
{{qed}}
Theorem: Consecutive Integers are Coprime

$\forall h \in \Z$, $h$ and $h + 1$ have only two common factors: $1$ and $-1$.
That is, consecutive integers are always coprime.

Proof:
A direct application of GCD of Integer with Integer + $n$:
:$\gcd \set {a, a + n} \divides n$
{{qed}}
Theorem: Elements of Primitive Pythagorean Triple are Pairwise Coprime

Let $\tuple {x, y, z}$ be a primitive Pythagorean triple.
Then:
:$x \perp y$
:$y \perp z$
:$x \perp z$
That is, all elements of $\tuple {x, y, z}$ are pairwise coprime.

Proof:
We have that $x \perp y$ by definition.
Suppose there is a prime divisor $p$ of both $x$ and $z$.
That is:
:$\exists p \in \mathbb P: p \divides x, p \divides z$
Then from Prime Divides Power:
:$p \divides x^2, p \divides z^2$
Then from Common Divisor Divides Integer Combination:
:$p \divides \paren {z^2 - x^2} = y^2$
So from Prime Divides Power again:
:$p \divides y$
and:
:$x \not \perp y$
This contradicts our assertion that $\tuple {x, y, z}$ is a primitive Pythagorean triple.
Hence $x \perp z$.
The same argument shows that $y \perp z$.
{{qed}}
Category:Pythagorean Triples
Category:Coprime Integers
8qsgq5gevl1ehybvgql79khf41s4nji
Theorem: Elements of Primitive Pythagorean Triples Modulo 4

Let $x \in \Z: x > 2$.
Then $x$ is an element of some primitive Pythagorean triple {{iff}} $x \not \equiv 2 \pmod 4$.

Proof:
Let $m = k + 1, n = k$ where $k \in \Z: k \ge 1$.
From Consecutive Integers are Coprime, $m \perp n$.
Then we have:
:$m, n \in \Z$ are positive integers
:$m \perp n$, that is, $m$ and $n$ are coprime
:$m$ and $n$ are of opposite parity
:$m > n$.
From Solutions of Pythagorean Equation, these conditions are necessary and sufficient for $\tuple {2 m n, m^2 - n^2, m^2 + n^2}$ to be a primitive Pythagorean triple.
Substituting for $m$ and $n$, we get:
:$\tuple {2 k^2 + 2 k, 2 k + 1, 2 k^2 + 2 k + 1}$ is a primitive Pythagorean triple.
So we see that for all $k \ge 1$, $2 k + 1$ is an element of a primitive Pythagorean triple.
So every odd integer from $3$ upwards is an element of some primitive Pythagorean triple.
That is, any integer $x$ such that $x \equiv 1$ or $x \equiv 3 \pmod 4$.
Now, consider $m = 2 k, n = 1$ where $k \in \Z: k \ge 1$.
These also fit the criteria for $\tuple {2 m n, m^2 - n^2, m^2 + n^2}$ to be a primitive Pythagorean triple.
Substituting for $m$ and $n$, we get:
:$\tuple {4 k, 4 k^2 - 1, 4 k^2 + 1}$ is a primitive Pythagorean triple.
This means that for all $k \ge 1$, $4 k$ is an element of a primitive Pythagorean triple.
So every multiple of $4$ is an element of some primitive Pythagorean triple.
That is, any integer $x$ such that $x \equiv 0 \pmod 4$.
Now, consider the general primitive Pythagorean triple $\tuple {2 m n, m^2 - n^2, m^2 + n^2}$.
As $m$ and $n$ are of opposite parity, they can be expressed as $2 r$ and $2 s + 1$.
So:
:$2 m n = 2 \paren {2 r} \paren {2 s + 1} = 4 r \paren {2 s + 1}$
So $2 m n$ is divisible by $4$.
As the only even elements of a primitive Pythagorean triple are of this form $2 m n$ from Parity of Smaller Elements of Primitive Pythagorean Triple, there can be no such elements $x$ of the form $x = 2 \pmod 4$.
Hence the result.
{{qed}}
Category:Pythagorean Triples
5bfnj611qn7g2mie9nh7q7mrj1pp1v6
Theorem: Odd Square Modulo 8

Let $x \in \Z$ be an odd square.
Then $x \equiv 1 \pmod 8$.

Proof:
Let $x \in \Z$ be an odd square.
Then $x = n^2$ where $n$ is also odd.
Thus $n$ can be expressed as $2 k + 1$ for some $k \in \Z$.
Hence:
{{begin-eqn}}
{{eqn | l = x
      | r = n^2
      | c = 
}}
{{eqn | r = \paren {2 k + 1}^2
      | c = 
}}
{{eqn | r = 4 k^2 + 4 k + 1
      | c = 
}}
{{eqn | r = 4 k \paren {k + 1} + 1
      | c = 
}}
{{end-eqn}}
But $k$ and $k + 1$ are of opposite parity and can therefore be expressed as $2 r$ and $2 s + 1$ (either way round).
{{begin-eqn}}
{{eqn | l = x
      | r = 4 k \paren {k + 1} + 1
      | c = 
}}
{{eqn | r = 4 \paren {2 r} \paren {2 s + 1} + 1
      | c = 
}}
{{eqn | r = 8 r \paren {2 s + 1} + 1
      | c = 
}}
{{end-eqn}}
Hence the result.
{{qed}}
Theorem: Sum of Consecutive Triangular Numbers is Square

The sum of two consecutive triangular numbers is a square number.

Proof:
Let $T_{n - 1}$ and $T_n$ be two consecutive triangular numbers.
From Closed Form for Triangular Numbers, we have:
:$T_{n - 1} = \dfrac {\paren {n - 1} n} 2$
:$T_n = \dfrac {n \paren {n + 1} } 2$
So:
{{begin-eqn}}     
{{eqn | l = T_{n - 1} + T_n
      | r = \frac {\paren {n - 1} n} 2 + \frac {n \paren {n + 1} } 2
      | c = 
}}
{{eqn | r = \frac {\paren {n - 1 + n + 1} n} 2
      | c = 
}}
{{eqn | r = \frac {2 n^2} 2
      | c = 
}}
{{eqn | r = n^2
      | c = 
}}
{{end-eqn}}
{{qed}}
Theorem: If n is Triangular then so is 9n + 1

Let $n$ be a triangular number.
Then $9 n + 1$ is also triangular.

Proof:
Let $n$ be triangular.
Then:
:$\exists k \in \Z: n = \dfrac {k \paren {k + 1} } 2$
So:
{{begin-eqn}}
{{eqn | l = 9 n + 1
      | r = 9 \frac {k \paren {k + 1} } 2 + 1
      | c = 
}}
{{eqn | r = \frac {9 k^2 + 9 k + 2} 2
      | c = 
}}
{{eqn | r = \frac {\paren {3 k + 1} \paren {3 k + 2} } 2
      | c = 
}}
{{end-eqn}}
which is triangular.
{{qed}}
Theorem: Sum of Arithmetic Sequence

Let $\sequence {a_k}$ be an arithmetic sequence defined as:
:$a_k = a + k d$ for $k = 0, 1, 2, \ldots, n - 1$
Then its closed-form expression is:
{{begin-eqn}}
{{eqn | l = \sum_{k \mathop = 0}^{n - 1} \paren {a + k d}
      | r = n \paren {a + \frac {n - 1} 2 d}
      | c = 
}}
{{eqn | r = \frac {n \paren {a + l} } 2
      | c = where $l$ is the last term of $\sequence {a_k}$
}}
{{end-eqn}}

Proof:
We have that:
:$\ds \sum_{k \mathop = 0}^{n - 1} \paren {a + k d} = a + \paren {a + d} + \paren {a + 2 d} + \dotsb + \paren {a + \paren {n - 1} d}$
Then:
{{begin-eqn}}
{{eqn | l = 2 \sum_{k \mathop = 0}^{n - 1} \paren {a + k d}
      | r = 2 \paren {a + \paren {a + d} + \paren {a + 2 d} + \dotsb + \paren {a + \paren {n - 1} d} }
}}
{{eqn | r = \paren {a + \paren {a + d} + \dotsb + \paren {a + \paren {n - 1} d} }
}}
{{eqn | o =
      | ro= +
      | r = \paren {\paren {a + \paren {n - 1} d} + \paren {a + \paren {n - 2} d} + \dotsb + \paren {a + d} + a}
}}
{{eqn | r = \paren {2 a + \paren {n - 1} d}_1 + \paren {2 a + \paren {n - 1} d}_2 + \dotsb + \paren {2 a + \paren {n - 1} d}_n
}}
{{eqn | r = n \paren {2 a + \paren {n - 1} d}
}}
{{end-eqn}}
So:
{{begin-eqn}}
{{eqn | l = 2 \sum_{k \mathop = 0}^{n - 1} \paren {a + k d}
      | r = n \paren {2 a + \paren {n - 1} d}
}}
{{eqn | ll= \leadsto
      | l = \sum_{k \mathop = 0}^{n - 1} \paren {a + k d}
      | r = \frac {n \paren {2 a + \paren {n - 1} d} } 2
}}
{{eqn | r = \frac {n \paren {a + l} } 2
      | c = {{Defof|Last Term of Arithmetic Sequence|Last Term}} $l$
}}
{{end-eqn}}
Hence the result.
{{qed}}
Theorem: Sum of Arithmetic Sequence

Let $\sequence {a_k}$ be an arithmetic sequence defined as:
:$a_k = a + k d$ for $k = 0, 1, 2, \ldots, n - 1$
Then its closed-form expression is:
{{begin-eqn}}
{{eqn | l = \sum_{k \mathop = 0}^{n - 1} \paren {a + k d}
      | r = n \paren {a + \frac {n - 1} 2 d}
      | c = 
}}
{{eqn | r = \frac {n \paren {a + l} } 2
      | c = where $l$ is the last term of $\sequence {a_k}$
}}
{{end-eqn}}

Proof:
{{begin-eqn}}
{{eqn | l = \sum_{j \mathop = m}^n j
      | r = \sum_{j \mathop = 0}^{n - m} \paren {m + j}
      | c = Translation of Index Variable of Summation
}}
{{eqn | r = \paren {n - m + 1} \paren {m + \frac {n - m} 2}
      | c = Sum of Arithmetic Sequence
}}
{{eqn | r = m \paren {n - m + 1} + \frac 1 2 \paren {n - m} \paren {n - m + 1}
      | c = 
}}
{{eqn | r = m n - m^2 + m + \frac 1 2 \paren {n^2 - m n + n - m n + m^2 - m}
      | c = 
}}
{{eqn | r = \frac {m + n^2 + n - m^2 + m} 2
      | c = 
}}
{{eqn | r = \frac {n \paren {n + 1} } 2 -  \frac {m \paren {m - 1} } 2
      | c = 
}}
{{end-eqn}}
{{qed}}
Theorem: Sum of Arithmetic Sequence

Let $\sequence {a_k}$ be an arithmetic sequence defined as:
:$a_k = a + k d$ for $k = 0, 1, 2, \ldots, n - 1$
Then its closed-form expression is:
{{begin-eqn}}
{{eqn | l = \sum_{k \mathop = 0}^{n - 1} \paren {a + k d}
      | r = n \paren {a + \frac {n - 1} 2 d}
      | c = 
}}
{{eqn | r = \frac {n \paren {a + l} } 2
      | c = where $l$ is the last term of $\sequence {a_k}$
}}
{{end-eqn}}

Proof:
{{begin-eqn}}
{{eqn | l = \sum_{j \mathop = m}^n j
      | r = \sum_{j \mathop = 0}^n j - \sum_{j \mathop = 0}^{m - 1} j
      | c = 
}}
{{eqn | r = \frac {n \paren {n + 1} } 2 - \frac {\paren {m - 1} m} 2
      | c = Closed Form for Triangular Numbers
}}
{{end-eqn}}
Theorem: Odd Square is Eight Triangles Plus One

Let $n \in \Z$ be an odd integer.
Then $n$ is square {{iff}} $n = 8 m + 1$ where $m$ is triangular.

Proof:
Follows directly from the identity:
{{begin-eqn}}
{{eqn | l = 8 \frac {k \paren {k + 1} } 2 + 1
      | r = 4 k^2 + 4 k + 1
      | c = 
}}
{{eqn | r = \paren {2 k + 1}^2
      | c = 
}}
{{end-eqn}}
as follows:
Let $m$ be triangular.
Then from Closed Form for Triangular Numbers:
:$\exists k \in \Z: m = \dfrac {k \paren {k + 1} } 2$
From the above identity:
:$8 m + 1 = \paren {2 k + 1}^2$
which is an odd square.
Let $n$ be an odd square.
Then $n = r^2$ where $r$ is odd.
Let $r = 2 k + 1$, so that $n = \paren {2 k + 1}^2$.
From the above identity:
:$n = 8 \dfrac {k \paren {k + 1} } 2 + 1 = 8 m + 1$
where $m$ is triangular.
{{qed}}
Theorem: Triangular Number Modulo 3 and 9

Let $n$ be a triangular number.
Then one of the following two conditions applies:
:$n \equiv 0 \pmod 3$
:$n \equiv 1 \pmod 9$

Proof:
Let $n = T_r$.
Then from Closed Form for Triangular Numbers:
:$n = \dfrac {r \paren {r + 1} } 2$
It suffices from Euclid's Lemma to investigate the nature of $r \paren {r + 1}$ modulo $3$.
There are three cases to consider:
:$r \equiv 0 \pmod 3$
:$r \equiv 1 \pmod 3$
:$r \equiv 2 \pmod 3$
Let $r \equiv 0 \pmod 3$.
Then:
:$r \paren {r + 1} \equiv 0 \pmod 3$
and so $T_r \equiv 0 \pmod 3$.
{{qed|lemma}}
Let $r \equiv 2 \pmod 3$.
Then:
:$r + 1 \equiv 3 \equiv 0 \pmod 3$
So:
:$r \paren {r + 1} \equiv 0 \pmod 3$
and so $T_r \equiv 0 \pmod 3$.
{{qed|lemma}}
Let $r \equiv 1 \pmod 3$.
Then $\exists k \in \Z: r = 3 k + 1$.
So $r \paren {r + 1} = \paren {3 k + 1} \paren {3 k + 2}$
{{begin-eqn}}
{{eqn | l = r \paren {r + 1}
      | r = \paren {3 k + 1} \paren {3 k + 2}
      | c = 
}}
{{eqn | r = 9 k^2 + 9 k + 2
      | c = 
}}
{{eqn | r = 9 k \paren {k + 1} + 2
      | c = 
}}
{{end-eqn}}
So:
:$T_r = 9 \dfrac {k \paren {k + 1} } 2 + 1$
Thus $T_r \equiv 1 \pmod 9$.
{{qed}}
Category:Triangular Numbers
6sz2adb5815zf1l230hqpetyfnrcmb9
Theorem: Closed Form for Polygonal Numbers

Let $\map P {k, n}$ be the $n$th $k$-gonal number.
The closed-form expression for $\map P {k, n}$ is given by:
{{begin-eqn}}
{{eqn | l = \map P {k, n}
      | r = \frac n 2 \paren {\paren {k - 2} n - k + 4}
}}
{{eqn | r = \frac {k - 2} 2 \paren {n^2 - n} + n
}}
{{eqn | r = 2 n + \dfrac 1 2 n k \paren {n - 1} - n^2
}}
{{end-eqn}}

Proof:
By definition of the $n$th $k$-gonal number:
$\map P {k, n} = \begin{cases}
0 & : n = 0 \\
\map P {k, n - 1} + \paren {k - 2} \paren {n - 1} + 1 & : n > 0
\end{cases}$
Then:
:$\paren {\paren {k - 2} \paren {j - 1} + 1}$
is an arithmetic sequence.
Its initial term $a$ is $1$, and its common difference $d$ is $k - 2$.
Hence:
{{begin-eqn}}
{{eqn | l = \map P {k, n}
      | r = \sum_{j \mathop = 1}^n \paren {\paren {k - 2} \paren {j - 1} + 1}
      | c = Sum of Arithmetic Sequence
}}
{{eqn | r = \frac {n \paren {2 + \paren {n - 1} \paren {k - 2} } } 2
      | c = 
}}
{{eqn | r = \frac n 2 \paren {\paren {k - 2} n - \paren {k - 2} + 2}
      | c = 
}}
{{eqn | r = \frac n 2 \paren {\paren {k - 2} n - k + 4}
      | c = 
}}
{{end-eqn}}
as required.
{{qed}}
Theorem: Difference Between Adjacent Polygonal Numbers is Triangular Number

Let $\map P {k, n}$ be the $n$th $k$-gonal number.
Then:
:$\map P {k + 1, n} - \map P {k, n} = T_{n - 1}$
where $T_n$ is the $n$th triangular number.

Proof:
From Closed Form for Polygonal Numbers:
:$\map P {k, n} = \dfrac n 2 \paren {\paren {k - 2} n - k + 4}$
Thus:
{{begin-eqn}}
{{eqn | l = \map P {k + 1, n} - \map P {k, n}
      | r = \dfrac n 2 \paren {\paren {\paren {k + 1} - 2} n - \paren {k + 1} + 4} - \dfrac n 2 \paren {\paren {k - 2} n - k + 4}
      | c = 
}}
{{eqn | r = \dfrac n 2 \paren {\paren {k - 1} n - k + 3} - \dfrac n 2 \paren {\paren {k - 2} n - k + 4}
      | c = 
}}
{{eqn | r = \dfrac n 2 \paren {k n - n - k + 3} - \dfrac n 2 \paren {k n - 2 n - k + 4}
      | c = 
}}
{{eqn | r = \dfrac n 2 \paren {k n - n - k + 3 - k n + 2 n + k - 4}
      | c = 
}}
{{eqn | r = \dfrac n 2 \paren {- n + 3 + 2 n - 4}
      | c = 
}}
{{eqn | r = \frac {n \paren {n - 1} } 2
      | c = 
}}
{{eqn | r = T_{n - 1}
      | c = 
}}
{{end-eqn}}
{{qed}}
Theorem: Method of Infinite Descent

{{mistake|This technique only works if you can prove that there exists some $n_\gamma$ such that $0 \le n_\gamma < n_\alpha$ for which $\map P {n_\gamma}$ does not work. Otherwise, technically speaking, the proof by Fermat in the historical note is not actually an example of this proof technique. I challenge the student to come up with a proof which genuinely uses the technique as presented here, because I am not sure that it makes logical sense.}}
Let $\map P {n_\alpha}$ be a propositional function depending on $n_\alpha \in \N$.
Let $\map P {n_\alpha} \implies \map P {n_\beta}$ such that $0 < n_\beta < n_\alpha$.
Then we may deduce that $\map P n$ is false for all $n \in \N$.
That is, suppose that by assuming the truth of $\map P {n_\alpha}$ for ''any'' natural number $n_\alpha$, we may deduce that there always exists ''some'' number $n_\beta$ strictly less than $n_\alpha$ for which $\map P {n_\beta}$ is also true, then $\map P {n_\alpha}$ cannot be true after all.
This technique is known as the '''method of infinite descent'''.
The process of deducing the truth of $\map P {n_\beta}$ from $\map P {n_\alpha}$ such that $0 < n_\beta < n_\alpha$ is known as the '''descent step'''.

Proof:
Suppose that $\map P {n_\alpha}$ holds.
Then from the descent step, $\exists n_\beta \in \N_{n_\alpha}: \map P {n_\beta}$.
The descent step then tell us we can deduce a smaller positive solution, $n_\gamma$, such that $\map P {n_\gamma}$ is true and $n_\gamma \in \N_{n_\beta}$.
And again, the descent step tells us we can deduce a still smaller positive solution, $n_\delta$, such that $\map P {n_\delta}$ is true and $n_\delta \in \N_{n_\gamma}$.
Now, consider the unending sequence: $n_\alpha > n_\beta > n_\gamma > n_\delta > \cdots > 0$.
The set $S = \set {n_\alpha, n_\beta, n_\gamma, n_\delta, \ldots}$ is not bounded below, as for any $\forall x \in S: \exists y \in S: y < x$.
By the Well-Ordering Principle, any non-empty subset of $\N$ must have a least element.
As $S$ is not bounded below, it has no least element, so must be empty.
{{qed}}
Theorem: Brahmagupta-Fibonacci Identity

Let $a, b, c, d$ be numbers.
Then:
:$\paren {a^2 + b^2} \paren {c^2 + d^2} = \paren {a c + b d}^2 + \paren {a d - b c}^2$

Proof:
From the extension to the general Brahmagupta-Fibonacci Identity:
:$\ds \prod_{j \mathop = 1}^n \paren { {a_j}^2 + m {b_j}^2} = c^2 + m d^2$
for some $c, d \in \Z$, for all $m \in \Z$.
The result follows by setting $m = 1$.
{{qed}}
Theorem: Brahmagupta-Fibonacci Identity

Let $a, b, c, d$ be numbers.
Then:
:$\paren {a^2 + b^2} \paren {c^2 + d^2} = \paren {a c + b d}^2 + \paren {a d - b c}^2$

Proof:
The proof proceeds by induction.
For all $n \in \Z_{>0}$, let $\map P n$ be the proposition:
:$\ds \prod_{j \mathop = 1}^n \paren { {a_j}^2 + {b_j}^2} = c^2 + d^2$
for some $c, d \in \Z$.
$\map P 1$ is the trivial case:
{{begin-eqn}}
{{eqn | l = \prod_{j \mathop = 1}^1 \paren { {a_j}^2 + {b_j}^2}
      | r = {a_1}^2 + {b_1}^2
      | c = 
}}
{{eqn | r = c^2 + d^2
      | c = setting $c = a_1$ and $d = b_1$
}}
{{end-eqn}}
Thus $\map P 1$ is seen to hold.
=== Basis for the Induction ===
$\map P 2$ is the case:
{{begin-eqn}}
{{eqn | l = \prod_{j \mathop = 1}^2 \paren { {a_j}^2 + {b_j}^2}
      | r = \paren { {a_1}^2 + {b_1}^2} \paren { {a_2}^2 + {b_2}^2}
      | c = 
}}
{{eqn | r = \paren {a_1 a_2 + b_1 b_2}^2 + \paren {a_1 b_2 - b_1 a_2}^2
      | c = Brahmagupta-Fibonacci Identity
}}
{{eqn | r = c^2 + d^2
      | c = setting $c = a_1 a_2 + b_1 b_2$ and $d = a_1 b_2 - b_1 a_2$
}}
{{end-eqn}}
Thus $\map P 2$ is seen to hold.
This is the basis for the induction.
=== Induction Hypothesis ===
Now it needs to be shown that, if $\map P k$ is true, where $k \ge 2$, then it logically follows that $\map P {k + 1}$ is true.
So this is the induction hypothesis:
:$\ds \prod_{j \mathop = 1}^k \paren { {a_j}^2 + {b_j}^2} = c^2 + d^2$
for some $c, d \in \Z$.
from which it is to be shown that:
:$\ds \prod_{j \mathop = 1}^{k + 1} \paren { {a_j}^2 + {b_j}^2} = c^2 + d^2$
for some $c, d \in \Z$.
=== Induction Step ===
This is the induction step:
{{begin-eqn}}
{{eqn | l = \prod_{j \mathop = 1}^{k + 1} \paren { {a_j}^2 + {b_j}^2}
      | r = \prod_{j \mathop = 1}^k \paren { {a_j}^2 + {b_j}^2} \paren { {a_{k + 1} }^2 + {b_{k + 1} }^2}
      | c = 
}}
{{eqn | r = \paren { {c'}^2 + {d'}^2} \paren { {a_{k + 1} }^2 + {b_{k + 1} }^2}
      | c = Induction Hypothesis: for some $c', d' \in \Z$
}}
{{eqn | r = c^2 + m d^2
      | c = Basis for the Induction: for some $c, d \in \Z$
}}
{{end-eqn}}
So $\map P k \implies \map P {k + 1}$ and the result follows by the Principle of Mathematical Induction.
Therefore, for all $n \in \Z_{>0}$:
:$\ds \prod_{j \mathop = 1}^n \paren { {a_j}^2 + {b_j}^2} = c^2 + d^2$
for some $c, d \in \Z$.
{{qed}}