Brahmagupta-Fibonacci Identity/Extension/General

Extension to Brahmagupta-Fibonacci Identity
Let $a_1, a_2, \ldots, a_n, b_1, b_2, \ldots, b_n, m$ be integers.

Then:
 * $\displaystyle \prod_{j \mathop = 1}^n \left({ {a_j}^2 + m {b_j}^2}\right) = c^2 + m d^2$

for some $c, d \in \Z$.

That is: the set of all integers of the form $a^2 + m b^2$ is closed under multiplication.

Proof
The proof proceeds by induction.

For all $n \in \Z_{> 0}$, let $P \left({n}\right)$ be the proposition:
 * $\displaystyle \prod_{j \mathop = 1}^n \left({ {a_j}^2 + m {b_j}^2}\right) = c^2 + m d^2$

for some $c, d \in \Z$.

$P \left({1}\right)$ is the trivial case:

Thus $P \left({1}\right)$ is seen to hold.

Basis for the Induction
$P \left({2}\right)$ is the case:

Thus $P \left({2}\right)$ is seen to hold.

This is the basis for the induction.

Induction Hypothesis
Now it needs to be shown that, if $P \left({k}\right)$ is true, where $k \ge 2$, then it logically follows that $P \left({k + 1}\right)$ is true.

So this is the induction hypothesis:
 * $\displaystyle \prod_{j \mathop = 1}^k \left({ {a_j}^2 + m {b_j}^2}\right) = c^2 + m d^2$

for some $c, d \in \Z$.

from which it is to be shown that:
 * $\displaystyle \prod_{j \mathop = 1}^{k + 1} \left({ {a_j}^2 + m {b_j}^2}\right) = c^2 + m d^2$

for some $c, d \in \Z$.

Induction Step
This is the induction step:

So $P \left({k}\right) \implies P \left({k + 1}\right)$ and the result follows by the Principle of Mathematical Induction.

Therefore, for all $n \in \Z_{> 0}$:
 * $\displaystyle \prod_{j \mathop = 1}^n \left({ {a_j}^2 + m {b_j}^2}\right) = c^2 + m d^2$

for some $c, d \in \Z$.