Gram–Schmidt orthogonalizes an independent list: $u_j=v_j-\sum_{i<j}u_i\langle u_i,v_j\rangle/\langle u_i,u_i\rangle$, then $q_j=u_j/\|u_j\|$. The output is orthonormal and spans the same subspace. Each prefix preserves span. In floating point, use modified Gram–Schmidt or Householder methods when stability is important.