QR Factorisation of congurent vectors There are n linearly independent vectors $x_1,x_2.........x_n$ $\in R^{m}$, another set of vectors $y_1,y_2.........y_n$ $\in R^{m}$ is congurent to it in the sense that the all the length and  distances are equal i.e.
$\|x_i\|_2 = \|y_i\|_2$ and $\|x_i - x_j\|_2  = \|y_i - y_j\|_2$  defining matrices X and Y as $[x_1,x_2..........x_n]$ and $[y_1,y_2.............y_n]$ respectively. I need to show that in reduced QR factorisation $R$ is same for both these matrices.
I started with multiplying both X and Y by there transpose.
$X^T * X = R^T * R$ $\& $
$Y^T * Y = R_1^T * R_1$
now i am unable to find any relation between these 2 terms please suggest me approach to proceed from here
 A: 
Fact 1: $X$ and $Y$ have congruent columns if and only if then $X^TX=Y^TY$.

From $\|x_i\|_2=\|y_i\|_2$ we have that
$$\tag{1}
x_i^Tx_i=y_i^Ty_i, \quad i=1,\ldots, n.
$$
This shows that the diagonals of $X^TX$ and $Y^TY$ are the same. Next, from $\|x_i-x_j\|_2=\|y_i-y_j\|_2$, we have
$$
x_i^Tx_i+x_j^Tx_j-2x_i^Tx_j=y_i^Ty_i+y_j^Ty_j-2y_i^Ty_j.
$$
Using (1) we get
$$
x_i^Tx_j=y_i^Ty_j,\quad i,j=1,\ldots,n.
$$
This proves the equality of the off-diagonal entries. $\square$
Now we could take a shortcut and use the fact that $X^TX=Y^TY$ implies that $X=UY$ for some orthonormal $U$ and we would be done (see, e.g., here). If $X=QR$ is a QR factorization of $X$, then $Y=(U^TQ)R$ is that of $Y$.
We can also take a more elementary approach.

Fact 2: If $X^TX=Y^TY$ and $R_x$ and $R_y$ are the triangular factors of their QR factorizations, then $R_y=DR_x$, where $D$ is a diagonal matrix with $\pm 1$ entries on the diagonal.

Assume that $X=Q_xR_x$ and $Y=Q_yR_y$. Then from $X^TX=Y^TY$ we have
$$\tag{2}
\begin{split}
R_x^TR_x=R_y^TR_y&\iff I=R_x^{-T}R_y^TR_yR_x^{-1}=(R_yR_x^{-1})^T(R_yR_x^{-1})
\\&\iff (R_yR_x^{-1})^{-T}=R_yR_x^{-1}.
\end{split}
$$
Since the matrix on the left and right-hand side is lower and upper triangular, respectively, this implies that $R_yR_x^{-1}=D$ is a diagonal matrix and putting this back to (2) we get that $I=D^2$. That is, $D$ has $\pm 1$ elements on the diagonal. $\square$
This is a well-known fact about the QR factorization or Cholesky decomposition, that the triangular factors are not unique unless we fix the signs on their diagonals (e.g., positive). If we do that, we have necessarily that $D=I$ and hence $R_x=R_y$.
