2

Suppose I have a vector $\boldsymbol{x} = (x_1,x_2,\ldots,x_N)$ in $\mathbb{R}^N$. I need to express a function $\boldsymbol{y} : \mathbb{R}^N \mapsto \mathbb{R}^{M(\boldsymbol{x})}$ where $M(\boldsymbol{x}) \le N$ such that the vector $\boldsymbol{y}(\boldsymbol{x})$ contains the elements of $\boldsymbol{x}$ that are not equal to some constant $q \in \mathbb{R}$.

For example, if $$\boldsymbol{x}=(23, 17, 1, 99, 122, 17, 40)$$ and $q=17$, then $$ \boldsymbol{y}(\boldsymbol{x})=(23,1,99,122,40).$$

But I'm struggling with how to define this function $\boldsymbol{y}$. In particular, it is important that the ordering of the elements in $\boldsymbol{y}$ be the same as the ordering of the same elements in $\boldsymbol{x}$, but I don't know how notationally to express this.

How could I define this function?

synaptik
  • 311
  • 2
    Currently, this function is not well-defined. For example, the vectors $(17, 0, 0)$ and $(17, 17, 0)$ will be sent to $\mathbb{R}^2$ and $\mathbb{R}$ respectively. – Michael Albanese Dec 30 '13 at 14:54
  • If I understand you correctly, then I would say that different vectors, such as you mention, can be sent to differently dimensioned vector spaces. It's not important that all R^N vectors be sent to R^M for the same M. So, yes, it's not well defined, but what I'm writing here will hopefully make it more clear what I should have said. – synaptik Dec 30 '13 at 14:56
  • 1
    Maybe it is better to consider a map from $\mathbb{R}^N$ to the set of subsets of ${1,\ldots,N}$. – Jas Ter Dec 30 '13 at 14:56
  • @SimenK. Yes, that's a better way of expressing the mapping. But, how can I express the mechanics of precisely what constitutes the vector $\boldsymbol{y}(\boldsymbol{x})$? – synaptik Dec 30 '13 at 14:59
  • 1
    Why don't you define the function as a map $\mathbb{R}^N \to \bigoplus_{i=1}^N\mathbb{R}^i$? You still have to decide what will happen to $(17, 17, \dots, 17)$ though. – Michael Albanese Dec 30 '13 at 14:59
  • @MichaelAlbanese Yes, that makes sense. Granted about the (17,...,17) issue. As for precisely how $\boldsymbol{y}(\boldsymbol{x})$ is constructed from $\boldsymbol{x}$, would you suggest that I just define it in words similar to how I did in the original question? – synaptik Dec 30 '13 at 15:04
  • 1
    I'm of the opinion that the best way to do this is to simply state in words what you want $\mathbf{y}$ to be, like how you did in your question itself. Maybe you could call $\mathbf{y}$ something else though, like $\hat{\mathbf{x}}_q$. And just let anything like $(q,\dotsc,q)$ be the empty set perhaps. Though that depends on what you're using this for. – Josh Dec 30 '13 at 15:08
  • @JoshChen That's a good idea. Thanks. – synaptik Dec 30 '13 at 15:11
  • 1
    This is a good question, and surprisingly non-trivial. Also, I don't accept the claim that the case $(17,...,17)$ is somehow problematic. The result of applying the function of interest to this vector lives naturally in $\mathbb{R}^0 \cong 1,$ the generic singleton set. – goblin GONE Dec 30 '13 at 15:11
  • @JoshChen To make the point about the order of the elements in $\boldsymbol{y}(\boldsymbol{x})$, would it make sense to say something like, "the elements in $\boldsymbol{y}(\boldsymbol{x})$ are ordered according to their relative lexicographic ordering in $\boldsymbol{x}$"? – synaptik Dec 30 '13 at 15:13
  • "Lexicographic" doesn't make sense in this context (it could even be construed to mean reordered according to the usual $<$ order on $\mathbb{R}$); something like "maintaining the ordering" would be better. – Josh Dec 30 '13 at 15:27
  • @JoshChen Ahh, I see. OK, Thanks. – synaptik Dec 30 '13 at 16:24

2 Answers2

2

The question is surprisingly non-trivial. Here's the simplest answer I've been able to come up with; we begin with a couple of definitions.

Definition 0. If $\alpha$ is a well-ordered set and $A$ is a subset of $\alpha$, then let us write $A^*$ for the corresponding canonical function $\mathrm{ord}(A) \rightarrow \alpha$.

Definition 1. Let $X$ denote an arbitrary set, and suppose $\alpha$ is a well-ordered set. Then given a function $f : \alpha \rightarrow X$ and a subset $B$ of $X$, define that $f \vartriangle B = f \circ (f^{-1}(B))^*.$

We're now in a position to give a formal answer to your question, namely the following. If $\boldsymbol{x} \in \mathbb{R}^\alpha$ and $q \in \mathbb{R}$, then the entity of interest can be defined as follows.

$$\boldsymbol{x} \vartriangle (\mathbb{R} \setminus \{q\})$$

Of course this is quite complicated, so you should explain to the reader first the idea of the definition (as, for example, in Josh Chen's answer, with the example you give in your question) before going to the formal viewpoint.

goblin GONE
  • 67,744
  • 1
    If I've used terms or notation you're unfamiliar with, please comment. – goblin GONE Dec 30 '13 at 15:37
  • 1
    Ouch, that's pretty sophisticated.. Maybe this is a slightly less painful way to do the painful: :P define $\sigma_q : \mathbb{R} \rightarrow {{x},|,x\in\mathbb{R}}\cup{\varnothing}$ by $\sigma_q(x)={x}$ if $x\neq q$ and $\sigma_q(x)=\varnothing$ if $x=q$. Then $\mathbf{y}=\sigma_q(x_1)\times\dotsb\times\sigma_q(x_n)$. – Josh Dec 30 '13 at 15:55
  • @user18921 Question: what are the meanings of: the "ord" in Definition 0; and the open dot after $f$ in Definition 1? – synaptik Dec 30 '13 at 16:27
  • I accepted @JoshChen 's answer because in an engineering context (in which this arose for me), the mathematical sophistication here is certainly more than is necessary. Nevertheless, I'm quite interested in understanding this answer (I'm an engineer, not a mathematician, so perhaps I'm a little slower than most participants in this discussion). – synaptik Dec 30 '13 at 16:30
  • @synaptik, no worries. The "ord" in Definition 0 refers to the order-type of the subset. For example, let $W={0,1,2,3,4}$ be ordered in the usual way, and let $A$ denote the subset ${0,2,4}.$ Then we can "squish" $A$ down by computing its order-type $\mathrm{ord}(A) = {0,1,2}$ ordered in the usual way. In this case, the canonical function $A^$ is the unique function $A^ : \mathrm{ord}(A) \rightarrow A$ that maps $0$ to $0$, $1$ to $2$, and $2$ to $4$. – goblin GONE Dec 31 '13 at 03:22
  • @synaptik, and the open circle refers to function composition. Please feel free to ask further questions. – goblin GONE Dec 31 '13 at 03:25
  • @user18921 I see, thanks. What is the meaning of the symbol $\bigoplus$ in $\mathbb{R}^N \mapsto \bigoplus_{i=1}^N \mathbb{R}^i$? I realize it wasn't you who suggested this notation, but could you explain what it means in this context? – synaptik Jan 01 '14 at 18:04
  • @synaptik, it is safe to view $\bigoplus$ as denoting union in this particular context. However, it would be better to view $\bigoplus$ as the discriminated union of sets. – goblin GONE Jan 02 '14 at 03:24
  • 1
    @synaptik, by the way, the easiest way to understand the discriminated union is by thinking about the case of two sets $X$ and $Y$, in which case their discriminated union is the unique collection of ordered pairs $X \oplus Y$ with the property that $(a,i) \in X \oplus Y$ iff $a \in X$ and $i=0$, or else $a \in Y$ and $i=1$. So basically, $X \oplus Y$ is the result of sticking $X$ and $Y$ together, no overlap. – goblin GONE Jan 02 '14 at 03:24
1

In general, if you find no (reasonably) straightforward way to cast a conceptually straightforward definition in common mathematical notation, it's probably best to just state in words what you'd like the thing you're defining to be, and give an enlightening example.

In this case you'd probably want something like

Let $\hat{\mathbf{x}}_q$ be the vector consisting of the entries of $\mathbf{x}$ not equal to $q$, with the original ordering maintained.

And don't forget to say what $\widehat{(q,\dotsc,q)}_q$ should be.

(I stress that this advice only applies in general to conceptually straightforward definitions, where to give an entirely formal definition would only cause confusion and muddy what should have been a clearcut idea. Of course if you'd like to be more formal see user18921's answer or my comment beneath it.)

Josh
  • 2,539