Transitivity of a square of a relation Transitivity
$\def\p{\mathrel p}$If $\p$ is a relation on a set $A$, define $\p^2$ by $a \mathrel{\p^2} b$ if and only if there exists $c$ with $a \p c$ and $c \p b$. 
If $p$ is reflexive/symmetric/transitive does $p^2$ have the same properties?
So i understand and have proven the reflexive and symmetric properties (see also this question: Reflexivity, Transitivity, Symmertry of the square of an relation), however is this correct for transitivty.
Suppose $\p$ is transitive
Let $a,b,c$ $\in$ A
WTS - a $\p^2$ b, b  $\p^2$ c, therefore a $\p^2$ c
So if p is transitive that means :
$a \p b$  
$b \p c$ 
$a \p c$
For  b  $\p^2$ c we need $a \p c$ and $c \p c$ for it to be related
So since p is transitive we can say that $a \p c$  and that $c \p c$ since its reflexive, so then we have our condition satisfied so therefor we can say that if 
a  $\p^2$ b and b  $\p^2$ c 
Then a  $\p^2$ c since condition $a \p c$, $c \p c$ is satisfied because p is transitive 
qed
am i on the right track here?
 A: HINT: You’ve correctly identified what you want to show, but your argument isn’t really on the right track. Your assumptions are that $a\mathbin{p^2}b$ and $b\mathbin{p^2}c$, and you want to show that $a\mathbin{p^2}c$. 
Now $a\mathbin{p^2}b$ means that there is some $x\in A$ such that $a\mathbin{p}x$ and $x\mathbin{p}b$. Do not use $c$ where I have $x$: $c$ already refers to a specific element of $A$, and this $x$ may be a completely different element. Similarly, $b\mathbin{p^2}c$ means that there is some $y\in A$ such that $b\mathbin{p}y$ and $y\mathbin{p}c$. That is, we have the following chain of relationships:
$$a\mathbin{p}x\mathbin{p}b\mathbin{p}y\mathbin{p}c\;.\tag{1}$$
In order to show that $a\mathbin{p^2}c$, you must show that there is some $z\in A$ such that $a\mathbin{p}z$ and $z\mathbin{p}c$. Is there any way to get that from $(1)$?
Yes, and here’s where we use the fact that $p$ is transitive. Remember that $a\mathbin{p}x$ and $x\mathbin{p}b$; since $p$ is transitive, this means that $a\mathbin{p}b$. Thus, we can replace the chain $(1)$ by
$$a\mathbin{p}b\mathbin{p}y\mathbin{p}c\tag{2}\;.$$
Can you take one more step to find a $z\in A$ such that $a\mathbin{p}z$ and $z\mathbin{p}c$? (Note that this $z$ may be one of the elements of $A$ to which we’ve already given names.)
