I know that given an orthogonal matrix $A\in\mathbb{R}^{n\times n}$, $A^\top A=AA^\top=I_n$.
I saw that the $ij$-element of $A^\top A$ can be expressed as
$$(A^\top A)_{ij} = (A^\top a_j)_i=(\text{row $i$ of $A^\top$})^\top a_j = a_i^\top a_j.$$
I think the way the above expressions were formed is based on the column view of matrix products, but I am still not too sure exactly how $(A^\top A)_{ij}=a_i^\top a_j$ using the above steps.
Can I please get an explanation of how the above steps were done?
In general, $(AB)_{ij}=$($i$th row $A$)($j$th col $B$). Thus, if A has column vectors $a_k$, then $A^T$ has corresponding row vectors $a_k^T$. Finally, $$(A^TA)_{ij}=(i\text{th row} A^T)(j\text{th col} A)=a_i^Ta_j$$