Decomposing a binary function, into (1) a continuous function and (2) a thresholding function.

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
1
down vote

favorite












Suppose $f$ is an arbitrary binary function and it is given to us:
$$
f: mathbbR^d rightarrow 0, 1
$$
Prove that it is always possible to write this function, as a composition of two functions:



  1. A continuous function: $g: mathbbR^d rightarrow (0, 1) $

  2. A thresholding function: $h: (0, 1) rightarrow 0, 1$, e.g. $h(x) = 0.5 + 0.5 sgn(x - 0.5)$

such that: $ forall X in mathbbR^d : ; ; ; f(x) = h(g(x))$.



If there is any requirement needed to have such decomposition, please state it.










share|cite|improve this question























  • I'm assuming that the shareholding function is a function with a single step? That is all values above the threshold are 1 and all values below are 0?
    – Q the Platypus
    Aug 31 at 0:28










  • yeah, I have given an example.
    – Daniel
    Aug 31 at 1:44














up vote
1
down vote

favorite












Suppose $f$ is an arbitrary binary function and it is given to us:
$$
f: mathbbR^d rightarrow 0, 1
$$
Prove that it is always possible to write this function, as a composition of two functions:



  1. A continuous function: $g: mathbbR^d rightarrow (0, 1) $

  2. A thresholding function: $h: (0, 1) rightarrow 0, 1$, e.g. $h(x) = 0.5 + 0.5 sgn(x - 0.5)$

such that: $ forall X in mathbbR^d : ; ; ; f(x) = h(g(x))$.



If there is any requirement needed to have such decomposition, please state it.










share|cite|improve this question























  • I'm assuming that the shareholding function is a function with a single step? That is all values above the threshold are 1 and all values below are 0?
    – Q the Platypus
    Aug 31 at 0:28










  • yeah, I have given an example.
    – Daniel
    Aug 31 at 1:44












up vote
1
down vote

favorite









up vote
1
down vote

favorite











Suppose $f$ is an arbitrary binary function and it is given to us:
$$
f: mathbbR^d rightarrow 0, 1
$$
Prove that it is always possible to write this function, as a composition of two functions:



  1. A continuous function: $g: mathbbR^d rightarrow (0, 1) $

  2. A thresholding function: $h: (0, 1) rightarrow 0, 1$, e.g. $h(x) = 0.5 + 0.5 sgn(x - 0.5)$

such that: $ forall X in mathbbR^d : ; ; ; f(x) = h(g(x))$.



If there is any requirement needed to have such decomposition, please state it.










share|cite|improve this question















Suppose $f$ is an arbitrary binary function and it is given to us:
$$
f: mathbbR^d rightarrow 0, 1
$$
Prove that it is always possible to write this function, as a composition of two functions:



  1. A continuous function: $g: mathbbR^d rightarrow (0, 1) $

  2. A thresholding function: $h: (0, 1) rightarrow 0, 1$, e.g. $h(x) = 0.5 + 0.5 sgn(x - 0.5)$

such that: $ forall X in mathbbR^d : ; ; ; f(x) = h(g(x))$.



If there is any requirement needed to have such decomposition, please state it.







real-analysis functional-analysis functions function-and-relation-composition






share|cite|improve this question















share|cite|improve this question













share|cite|improve this question




share|cite|improve this question








edited Aug 31 at 1:44

























asked Aug 30 at 23:54









Daniel

1,104921




1,104921











  • I'm assuming that the shareholding function is a function with a single step? That is all values above the threshold are 1 and all values below are 0?
    – Q the Platypus
    Aug 31 at 0:28










  • yeah, I have given an example.
    – Daniel
    Aug 31 at 1:44
















  • I'm assuming that the shareholding function is a function with a single step? That is all values above the threshold are 1 and all values below are 0?
    – Q the Platypus
    Aug 31 at 0:28










  • yeah, I have given an example.
    – Daniel
    Aug 31 at 1:44















I'm assuming that the shareholding function is a function with a single step? That is all values above the threshold are 1 and all values below are 0?
– Q the Platypus
Aug 31 at 0:28




I'm assuming that the shareholding function is a function with a single step? That is all values above the threshold are 1 and all values below are 0?
– Q the Platypus
Aug 31 at 0:28












yeah, I have given an example.
– Daniel
Aug 31 at 1:44




yeah, I have given an example.
– Daniel
Aug 31 at 1:44










1 Answer
1






active

oldest

votes

















up vote
1
down vote



accepted










Let's say the threshold is $t$, and that $h(x)=1$ when $x> t$ and $h(x)=0$ when $xle t$. The other possibility is to have $h(x)=1$ for $xge t$ instead, I will deal with this at the end.



If $f=hcirc g$, then $f^-1(1)=g^-1(h^-1(1))=g^-1((t,1))$. Since $g$ is continuous and $(t,1)$ is open, this implies $f^-1(1)$ is an open set. This gives a necessary condition for the decomposition to exist; $f^-1(1)$ must be open.



This condition is also sufficient. If $f^-1(1)$ is open, then $C:= f^-1(0)$ is closed. Let $d:mathbb R^nto mathbb R$ be defined by
$$
d(x)= textdist(x,C)=inf_cin C|x-c|
$$
Since $C$ is closed, it follows $d(x)=0$ if and only if $xin C$. Therefore, letting $$g(x)=frac12 + frac12cdot fracd(x)1+d(x),$$
then $g(x)=frac12$ when $xin C$, while $g(x)>frac12$ when $xnotin C$. This means that letting $h(x)=1$ when $x>frac12$ and $h(x)=0$ when $xle frac12$, then $f=hcirc g$.



If you use the other type of threshold function, where $h(x)=1$ for $xge t$, then you instead get the necessary condition that $f^-1(1)$ must be closed, but otherwise the same logic works. That is, the condition you need is that $f^-1(1)$ is either open or closed.






share|cite|improve this answer




















  • Can one say that, if $f$ is Riemann integrable, then it would satisfy such decomposition? (i.e. does Riemann integrablity entail the open/clsoed argument you mentioned?)
    – Daniel
    Sep 1 at 20:23










  • No. For example, let $$ f(x) = begincases1 & 0le x <1 \ 0 &textotherwise endcases $$ Then $f$ is Riemann integrable, but $f$ cannot be decomposed the way you want it. Note $f^-1(1)=[0,1)$ is neither open nor closed.
    – Mike Earnest
    Sep 1 at 20:36










  • I see that's a good point.
    – Daniel
    Sep 1 at 21:17










  • One more question: does this decomposition always result in a Lipschitz construction? I.e. is it possible to prove that your refined $g(x)$ is Lipschitz? (i.e. has finite derivative).
    – Daniel
    Sep 1 at 21:17










  • Yes, $g(x)$ is always Lipschitz, with constant $1/2$. This follows because $d(x)$ is $1$-Lipschitz, which can be proved using the triangle inequality (exercise left to reader).
    – Mike Earnest
    Sep 1 at 21:23











Your Answer




StackExchange.ifUsing("editor", function ()
return StackExchange.using("mathjaxEditing", function ()
StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix)
StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
);
);
, "mathjax-editing");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "69"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
noCode: true, onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













 

draft saved


draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f2900147%2fdecomposing-a-binary-function-into-1-a-continuous-function-and-2-a-threshol%23new-answer', 'question_page');

);

Post as a guest






























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
1
down vote



accepted










Let's say the threshold is $t$, and that $h(x)=1$ when $x> t$ and $h(x)=0$ when $xle t$. The other possibility is to have $h(x)=1$ for $xge t$ instead, I will deal with this at the end.



If $f=hcirc g$, then $f^-1(1)=g^-1(h^-1(1))=g^-1((t,1))$. Since $g$ is continuous and $(t,1)$ is open, this implies $f^-1(1)$ is an open set. This gives a necessary condition for the decomposition to exist; $f^-1(1)$ must be open.



This condition is also sufficient. If $f^-1(1)$ is open, then $C:= f^-1(0)$ is closed. Let $d:mathbb R^nto mathbb R$ be defined by
$$
d(x)= textdist(x,C)=inf_cin C|x-c|
$$
Since $C$ is closed, it follows $d(x)=0$ if and only if $xin C$. Therefore, letting $$g(x)=frac12 + frac12cdot fracd(x)1+d(x),$$
then $g(x)=frac12$ when $xin C$, while $g(x)>frac12$ when $xnotin C$. This means that letting $h(x)=1$ when $x>frac12$ and $h(x)=0$ when $xle frac12$, then $f=hcirc g$.



If you use the other type of threshold function, where $h(x)=1$ for $xge t$, then you instead get the necessary condition that $f^-1(1)$ must be closed, but otherwise the same logic works. That is, the condition you need is that $f^-1(1)$ is either open or closed.






share|cite|improve this answer




















  • Can one say that, if $f$ is Riemann integrable, then it would satisfy such decomposition? (i.e. does Riemann integrablity entail the open/clsoed argument you mentioned?)
    – Daniel
    Sep 1 at 20:23










  • No. For example, let $$ f(x) = begincases1 & 0le x <1 \ 0 &textotherwise endcases $$ Then $f$ is Riemann integrable, but $f$ cannot be decomposed the way you want it. Note $f^-1(1)=[0,1)$ is neither open nor closed.
    – Mike Earnest
    Sep 1 at 20:36










  • I see that's a good point.
    – Daniel
    Sep 1 at 21:17










  • One more question: does this decomposition always result in a Lipschitz construction? I.e. is it possible to prove that your refined $g(x)$ is Lipschitz? (i.e. has finite derivative).
    – Daniel
    Sep 1 at 21:17










  • Yes, $g(x)$ is always Lipschitz, with constant $1/2$. This follows because $d(x)$ is $1$-Lipschitz, which can be proved using the triangle inequality (exercise left to reader).
    – Mike Earnest
    Sep 1 at 21:23















up vote
1
down vote



accepted










Let's say the threshold is $t$, and that $h(x)=1$ when $x> t$ and $h(x)=0$ when $xle t$. The other possibility is to have $h(x)=1$ for $xge t$ instead, I will deal with this at the end.



If $f=hcirc g$, then $f^-1(1)=g^-1(h^-1(1))=g^-1((t,1))$. Since $g$ is continuous and $(t,1)$ is open, this implies $f^-1(1)$ is an open set. This gives a necessary condition for the decomposition to exist; $f^-1(1)$ must be open.



This condition is also sufficient. If $f^-1(1)$ is open, then $C:= f^-1(0)$ is closed. Let $d:mathbb R^nto mathbb R$ be defined by
$$
d(x)= textdist(x,C)=inf_cin C|x-c|
$$
Since $C$ is closed, it follows $d(x)=0$ if and only if $xin C$. Therefore, letting $$g(x)=frac12 + frac12cdot fracd(x)1+d(x),$$
then $g(x)=frac12$ when $xin C$, while $g(x)>frac12$ when $xnotin C$. This means that letting $h(x)=1$ when $x>frac12$ and $h(x)=0$ when $xle frac12$, then $f=hcirc g$.



If you use the other type of threshold function, where $h(x)=1$ for $xge t$, then you instead get the necessary condition that $f^-1(1)$ must be closed, but otherwise the same logic works. That is, the condition you need is that $f^-1(1)$ is either open or closed.






share|cite|improve this answer




















  • Can one say that, if $f$ is Riemann integrable, then it would satisfy such decomposition? (i.e. does Riemann integrablity entail the open/clsoed argument you mentioned?)
    – Daniel
    Sep 1 at 20:23










  • No. For example, let $$ f(x) = begincases1 & 0le x <1 \ 0 &textotherwise endcases $$ Then $f$ is Riemann integrable, but $f$ cannot be decomposed the way you want it. Note $f^-1(1)=[0,1)$ is neither open nor closed.
    – Mike Earnest
    Sep 1 at 20:36










  • I see that's a good point.
    – Daniel
    Sep 1 at 21:17










  • One more question: does this decomposition always result in a Lipschitz construction? I.e. is it possible to prove that your refined $g(x)$ is Lipschitz? (i.e. has finite derivative).
    – Daniel
    Sep 1 at 21:17










  • Yes, $g(x)$ is always Lipschitz, with constant $1/2$. This follows because $d(x)$ is $1$-Lipschitz, which can be proved using the triangle inequality (exercise left to reader).
    – Mike Earnest
    Sep 1 at 21:23













up vote
1
down vote



accepted







up vote
1
down vote



accepted






Let's say the threshold is $t$, and that $h(x)=1$ when $x> t$ and $h(x)=0$ when $xle t$. The other possibility is to have $h(x)=1$ for $xge t$ instead, I will deal with this at the end.



If $f=hcirc g$, then $f^-1(1)=g^-1(h^-1(1))=g^-1((t,1))$. Since $g$ is continuous and $(t,1)$ is open, this implies $f^-1(1)$ is an open set. This gives a necessary condition for the decomposition to exist; $f^-1(1)$ must be open.



This condition is also sufficient. If $f^-1(1)$ is open, then $C:= f^-1(0)$ is closed. Let $d:mathbb R^nto mathbb R$ be defined by
$$
d(x)= textdist(x,C)=inf_cin C|x-c|
$$
Since $C$ is closed, it follows $d(x)=0$ if and only if $xin C$. Therefore, letting $$g(x)=frac12 + frac12cdot fracd(x)1+d(x),$$
then $g(x)=frac12$ when $xin C$, while $g(x)>frac12$ when $xnotin C$. This means that letting $h(x)=1$ when $x>frac12$ and $h(x)=0$ when $xle frac12$, then $f=hcirc g$.



If you use the other type of threshold function, where $h(x)=1$ for $xge t$, then you instead get the necessary condition that $f^-1(1)$ must be closed, but otherwise the same logic works. That is, the condition you need is that $f^-1(1)$ is either open or closed.






share|cite|improve this answer












Let's say the threshold is $t$, and that $h(x)=1$ when $x> t$ and $h(x)=0$ when $xle t$. The other possibility is to have $h(x)=1$ for $xge t$ instead, I will deal with this at the end.



If $f=hcirc g$, then $f^-1(1)=g^-1(h^-1(1))=g^-1((t,1))$. Since $g$ is continuous and $(t,1)$ is open, this implies $f^-1(1)$ is an open set. This gives a necessary condition for the decomposition to exist; $f^-1(1)$ must be open.



This condition is also sufficient. If $f^-1(1)$ is open, then $C:= f^-1(0)$ is closed. Let $d:mathbb R^nto mathbb R$ be defined by
$$
d(x)= textdist(x,C)=inf_cin C|x-c|
$$
Since $C$ is closed, it follows $d(x)=0$ if and only if $xin C$. Therefore, letting $$g(x)=frac12 + frac12cdot fracd(x)1+d(x),$$
then $g(x)=frac12$ when $xin C$, while $g(x)>frac12$ when $xnotin C$. This means that letting $h(x)=1$ when $x>frac12$ and $h(x)=0$ when $xle frac12$, then $f=hcirc g$.



If you use the other type of threshold function, where $h(x)=1$ for $xge t$, then you instead get the necessary condition that $f^-1(1)$ must be closed, but otherwise the same logic works. That is, the condition you need is that $f^-1(1)$ is either open or closed.







share|cite|improve this answer












share|cite|improve this answer



share|cite|improve this answer










answered Sep 1 at 16:59









Mike Earnest

18.1k11850




18.1k11850











  • Can one say that, if $f$ is Riemann integrable, then it would satisfy such decomposition? (i.e. does Riemann integrablity entail the open/clsoed argument you mentioned?)
    – Daniel
    Sep 1 at 20:23










  • No. For example, let $$ f(x) = begincases1 & 0le x <1 \ 0 &textotherwise endcases $$ Then $f$ is Riemann integrable, but $f$ cannot be decomposed the way you want it. Note $f^-1(1)=[0,1)$ is neither open nor closed.
    – Mike Earnest
    Sep 1 at 20:36










  • I see that's a good point.
    – Daniel
    Sep 1 at 21:17










  • One more question: does this decomposition always result in a Lipschitz construction? I.e. is it possible to prove that your refined $g(x)$ is Lipschitz? (i.e. has finite derivative).
    – Daniel
    Sep 1 at 21:17










  • Yes, $g(x)$ is always Lipschitz, with constant $1/2$. This follows because $d(x)$ is $1$-Lipschitz, which can be proved using the triangle inequality (exercise left to reader).
    – Mike Earnest
    Sep 1 at 21:23

















  • Can one say that, if $f$ is Riemann integrable, then it would satisfy such decomposition? (i.e. does Riemann integrablity entail the open/clsoed argument you mentioned?)
    – Daniel
    Sep 1 at 20:23










  • No. For example, let $$ f(x) = begincases1 & 0le x <1 \ 0 &textotherwise endcases $$ Then $f$ is Riemann integrable, but $f$ cannot be decomposed the way you want it. Note $f^-1(1)=[0,1)$ is neither open nor closed.
    – Mike Earnest
    Sep 1 at 20:36










  • I see that's a good point.
    – Daniel
    Sep 1 at 21:17










  • One more question: does this decomposition always result in a Lipschitz construction? I.e. is it possible to prove that your refined $g(x)$ is Lipschitz? (i.e. has finite derivative).
    – Daniel
    Sep 1 at 21:17










  • Yes, $g(x)$ is always Lipschitz, with constant $1/2$. This follows because $d(x)$ is $1$-Lipschitz, which can be proved using the triangle inequality (exercise left to reader).
    – Mike Earnest
    Sep 1 at 21:23
















Can one say that, if $f$ is Riemann integrable, then it would satisfy such decomposition? (i.e. does Riemann integrablity entail the open/clsoed argument you mentioned?)
– Daniel
Sep 1 at 20:23




Can one say that, if $f$ is Riemann integrable, then it would satisfy such decomposition? (i.e. does Riemann integrablity entail the open/clsoed argument you mentioned?)
– Daniel
Sep 1 at 20:23












No. For example, let $$ f(x) = begincases1 & 0le x <1 \ 0 &textotherwise endcases $$ Then $f$ is Riemann integrable, but $f$ cannot be decomposed the way you want it. Note $f^-1(1)=[0,1)$ is neither open nor closed.
– Mike Earnest
Sep 1 at 20:36




No. For example, let $$ f(x) = begincases1 & 0le x <1 \ 0 &textotherwise endcases $$ Then $f$ is Riemann integrable, but $f$ cannot be decomposed the way you want it. Note $f^-1(1)=[0,1)$ is neither open nor closed.
– Mike Earnest
Sep 1 at 20:36












I see that's a good point.
– Daniel
Sep 1 at 21:17




I see that's a good point.
– Daniel
Sep 1 at 21:17












One more question: does this decomposition always result in a Lipschitz construction? I.e. is it possible to prove that your refined $g(x)$ is Lipschitz? (i.e. has finite derivative).
– Daniel
Sep 1 at 21:17




One more question: does this decomposition always result in a Lipschitz construction? I.e. is it possible to prove that your refined $g(x)$ is Lipschitz? (i.e. has finite derivative).
– Daniel
Sep 1 at 21:17












Yes, $g(x)$ is always Lipschitz, with constant $1/2$. This follows because $d(x)$ is $1$-Lipschitz, which can be proved using the triangle inequality (exercise left to reader).
– Mike Earnest
Sep 1 at 21:23





Yes, $g(x)$ is always Lipschitz, with constant $1/2$. This follows because $d(x)$ is $1$-Lipschitz, which can be proved using the triangle inequality (exercise left to reader).
– Mike Earnest
Sep 1 at 21:23


















 

draft saved


draft discarded















































 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f2900147%2fdecomposing-a-binary-function-into-1-a-continuous-function-and-2-a-threshol%23new-answer', 'question_page');

);

Post as a guest













































































這個網誌中的熱門文章

tkz-euclide: tkzDrawCircle[R] not working

How to combine Bézier curves to a surface?

1st Magritte Awards