Upon watching a lecture on quaternions (Youtube link), I came across the following math: $$(a,\vec{v})(a,- \vec{v})=(a^2+(\vec{v}\cdot \vec{v}),-a\vec{v}+a\vec{v}+(\vec{v}\times \vec{v}))$$ where $a$ is scalar and $\vec{v}$ is a quaternion vector.
Perhaps I am missing something obvious, but how did he make that equality? He's not using "matrix multiplication" as the vectors are not the right dimensions and neither is this a situation where FOIL would apply. I am confused since it seems to me that I have missed something obvious.
You seem to have missed that the definition of quaternion multiplication is $$(a_1+b_1i+c_1j+d_1k)\cdot (a_2+b_2i+c_2j+d_2k)=$$
$$(a_1a_2 - b_1b_2 - c_1c_2 - d_1d_2)\\ {}+ (a_1b_2 + b_1a_2 + c_1d_2 - d_1c_2)i\\ {}+ (a_1c_2 - b_1d_2 + c_1a_2 + d_1b_2)j\\ {}+ (a_1d_2 + b_1c_2 - c_1b_2 + d_1a_2)k$$ (look at time 11:30).
You can choose to express a quaternion $a+bi+cj+dk$ as the pair $(a,\vec{v})$ where $\vec{v}=\langle b,c,d\rangle$ (look at time 12:30).
Thus, going directly from the definition, if we use this alternative way of expressing quaternions, $$(a_1,\vec{v}_1)\cdot (a_2,\vec{v}_2)=(z,\vec{w})$$ where $z$ is the scalar $$z=a_1a_2 - b_1b_2 - c_1c_2 - d_1d_2$$ and $\vec{w}$ is the vector $$\vec{w}=\Bigl\langle a_1b_2 + b_1a_2 + c_1d_2 - d_1c_2,\;\; a_1c_2 - b_1d_2 + c_1a_2 + d_1b_2,\;\; a_1d_2 + b_1c_2 - c_1b_2 + d_1a_2\Bigr\rangle$$ You can check that $$z=a_1a_2-(\vec{v}_1\cdot \vec{v}_2)\\ \vec{w}=a_1\vec{v}_2+a_2\vec{v}_1+(\vec{v}_1\times\vec{v}_2)$$ which is exactly what's written on the board at time 14:25.
Therefore $$(a,\vec{v})\cdot (a,-\vec{v})=(a^2+(\vec{v}\cdot\vec{v}),-a\vec{v}+a\vec{v}+(\vec{v}\times\vec{v})).$$