For my thesis I'm trying to think of an intuitive example to illustrate properties of different relations.
For a set of family members $S = \{\texttt{A1}, \texttt{A2}, \dots, \texttt{C3}\}$, I created the following family tree...
...and defined the following relations...
$$ \begin{aligned} R_\textrm{mother} & = \{(\texttt{A1},\texttt{B1}),(\texttt{A1},\texttt{B2}),(\texttt{A3},\texttt{B3}),(\texttt{B2},\texttt{C1}),(\texttt{B2},\texttt{C2}),(\texttt{B2},\texttt{C3})\}\\ R_\textrm{father} & = \{(\texttt{A2},\texttt{B1}),(\texttt{A2},\texttt{B2}),(\texttt{A4},\texttt{B3}),(\texttt{B3},\texttt{C1}),(\texttt{B3},\texttt{C2}),(\texttt{B3},\texttt{C3})\}\\ R_\textrm{parent} & = R_\textrm{mother} \cup R_\textrm{father} \end{aligned} $$
Is there a convenient way to (recursively) construct a transitive set $R_\textrm{ancestor}$ from $R_\textrm{parent}$ (or from the others) that includes relations such as $(\texttt{A1},\texttt{C1})$ and $(\texttt{B3}, \texttt{C2})$, as in, if $(x,y)$ and $(y,z)$ are elements of $R_\textrm{parent}$, then $(x,z) \in R_\textrm{ancestor}$? (notice that $R_\textrm{parent} \subseteq R_\textrm{ancestor}$)
I want to keep the solution as general as possible. I'd also be open to change the naming system of the family members, i.e., using some $a_{ij}$ indexing system where $i$ describes the generation or "row" of the family tree and $j$ its "column".
I also thought of creating two functions $m,f: S \rightarrow S$ that, for a given person $s$, return their mother or father respectively, thus $(m(s),s) \in R_\textrm{mother}$ and $(f(s),s) \in R_\textrm{father}$. However I'm not sure how to notate the recursive behavior in a set.
