2
$\begingroup$

I'm looking to formally define a tree and then extract the leaves from it in a concise way. Does this look ok? What is the best way of doing this?

$ Y = \{a,b,c,d,e,f,g\} \\ R = \{a \mapsto b, a \mapsto d, d \mapsto e, d \mapsto f, f \mapsto g\} \ \text{, where R is a relation on Y.} \\ R^+ = \{a \mapsto b, a \mapsto d, d \mapsto e, d \mapsto f, a \mapsto e, a \mapsto f, a \mapsto g\} \ \text{, where $R^+$ is the transitive closure of R.} \\ leaves = \{x \in range(R^+) \mid \ x \notin dom(R^+) \} $

$\endgroup$
3
  • $\begingroup$ why you need $R^+$? $\endgroup$ Commented Aug 20, 2021 at 5:23
  • $\begingroup$ To be honest im not sure why I did that, its redundant $\endgroup$
    – newlogic
    Commented Aug 20, 2021 at 18:48
  • $\begingroup$ Also i made a typo it should be x and not R(x) $\endgroup$
    – newlogic
    Commented Aug 20, 2021 at 18:51

1 Answer 1

2
$\begingroup$

How about this: $leaves = Y \setminus Preimage(R)$

$\endgroup$
2
  • $\begingroup$ Is this the same as $leaves = \{x \in range(R) \mid \ x \notin dom(R) \} $ $\endgroup$
    – newlogic
    Commented Aug 20, 2021 at 18:50
  • $\begingroup$ @newlogic No, it is different. Domain of $R$ is basically the entire set $Y$. Whereas, preimage of $R$ is a subset of the domain; it contains those elements that actually participate in the relation $R$. See this for a formal definition. $\endgroup$ Commented Aug 21, 2021 at 4:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.