I am defining partial functions $f_i: A \rightarrow A$. The functions may be partial, that is $f(x)$ may be undefined for some input. I would like to define a partial composition operator $\mathsf{condcmp}(a,b,c)(x) = z$ so that $z=b(y)$ if $y=a(x)$ is defined or $z=c(x)$ otherwise. I was wondering if the problem could be easier to formulate by using relations rather than functions, and if a "conditional composition operator" has been defined elsewhere before.
Remember to vote up questions/answers you find interesting or helpful (requires 15 reputation points)
|
0
|
||||
|
closed as off topic by S. Carnahan♦ Jan 11 2011 at 20:56 |
|
0
|
I have never heard of this, why do you need it?. I don't think it will be easier to define using relations. But here is my go at it. Let $f:A\rightarrow B$, $g:B\rightarrow C$, be partial functions, and $h:A\rightarrow C$, a function. We can define the composition of two partial functions by \begin{equation} g\circ f={(a,c)\in A\times C\;|\; (a,b)\in f\quad (b,c)\in g \text{ for some } b\in B}. \end{equation} Denote by $\pi_1:A\times C\rightarrow A$ the projection to the first coordinate (the domain). Then the partial composition can be defined by \begin{equation} \text{condcmp}(a,b,c)=g\circ f \cup(c\cap(\pi^{-1}(A\setminus\pi_1(g\circ f)). \end{equation} I doubt this can be simplified much more, and I don't think it is cleaner than the description you gave. |
||
|
|

