If I have two sets $A = \{a_1,a_2,\dots,a_n\}$ and $B = \{b_1,b_2,\dots,b_m\}$, can I define a matrix in the following way?
$C = \{c_{ij} \mid (i,j) \in A \times B\}$
or do the $i$ and $j$ refer to the values of $a_1,a_2$, etc - and not their indices?
As you say, $(i,j)\in A \times B$ refers to the elements, not to the indices, sets have no notion of indices. So if you want to be really strict and rigorous with your notation, you have to use ordered sets $A=\langle a_1, a_2, ... \rangle$ and $B=\langle b_1, b_2, ... \rangle$ (or some kind of similar construction). However, what does $c_{ij}$ means here? If you already have a way of specifying $c_{ij}$, then using $A$ and $B$ is not necessary.