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 \paren { {a_j}^2 + m {b_j}^2} = 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 $\map P n$ be the proposition:
 * $\displaystyle \prod_{j \mathop = 1}^n \paren { {a_j}^2 + m {b_j}^2} = c^2 + m d^2$

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

$\map P 1$ is the trivial case:

Thus $\map P 1$ is seen to hold.

Basis for the Induction
$\map P 2$ is the case:

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:
 * $\displaystyle \prod_{j \mathop = 1}^k \paren { {a_j}^2 + m {b_j}^2} = 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} \paren { {a_j}^2 + m {b_j}^2} = c^2 + m d^2$

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

Induction Step
This is the induction step:

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}$:
 * $\displaystyle \prod_{j \mathop = 1}^n \paren { {a_j}^2 + m {b_j}^2} = c^2 + m d^2$

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