Proving a function is well defined The question I'm working on asks:

Let $J_4 =\{0,1,2,3\}$. Then $J_4 −\{0\}=\{1,2,3\}$. Student C tries to define
  a function S: $J_4 -\{0\}\to J_4 -\{0\}$ as follows: For each $x \in J_4 - \{0\}$,
  $S(x)$ is the number $y$ so that $(xy) \bmod 4 = 1$. Student F claims that $S$
  is not well defined. Who is right: student C or student D? Justify
  your answer.

I have several questions:


*

*What is the salience of $J_4 - \{0\}$ ? I see that it removes $0$ from the list of elements, but this notation confuses me. I'm not sure exactly what it does, and it appears to be done twice (See function $S$).

*Does subscript in $J_4$ mean $\bmod 4$ anything in the set?

*The statement "$S(x)$ is the number $y$ so that $(xy) \bmod 4 = 1$" is also confusing me. $x$ remains the input and $y$ is the result of function $S$, right? 

*To show that this is ill-defined would require showing that for an $x$, there are multiple $y$, making this not a function. To that it is well-defined I would have to do the opposite, right? For a problem like this, should I start off by just plugging numbers in and seeing what happens, or is there a systematic approach I should be aware of?
 A: *

*If you keep $0$ in the set, then $S(x)$ is undefined, and that is because there is no number $y$ such that $(xy) \mod 4 =1$, becasue that would mean that $(0y) \mod 4 =1$, i.e. that $0 \mod 4 =1$, which is false.

*We can't tell why they put the $4$ in $J_4$; it is just an index that typically serves to differentiate that $J$ from other sets $J$ ... it has no other meaning.  My guess is that they used the $4$ to indicate that it has 4 elements, but again, nothing is forced here; they might just as well have used $J_5$

*Yes, x is the input, and y is the output.  So, for example, for $x=1$, you get $y=1$, since that is the only y for which $(xy) \mod 4 = 1$, so $S(1) =1$

*Proceeding with the idea in 3: what is $S(2)$, i.e. what is 'the' $y$ such that $(2y) \mod 4 = 1$? Well, there is no such y! Hence, this function value is undefined.  And, since we typically want function values to be defined, we would say that this is an ill-defined function.
A: 1) "$J_4 - \{0\}$" describes a set.  It doesn't mean "remove $\{0\}$ from $J_4$.  It is equivalent to defining $X = J_4 - \{0\}$ and then using $X$ in both places
2) No. I think it's just a name.
3) That is correct.  
4) A function is ill-defined if it is ambiguous what the output should be, or ( I think ) if the output is not in the range, or there is no output for some given input.  So, for example "$S(x)$ is the greatest integer larger than $x$" is ill-defined.  As is "$S(x)$ is the number $y$ such that $y$ divides $x$".  
A: 1.) I take $J_4-\{0\}$ in this context to just mean $J_4 \setminus \{0\}$, which is a more common notation in set theory, i.e $J$ "minus" $\{0\}$. There does not seem to be any ambiguity here.
2.) No, this is just standard (more or less) notation for $J_n=\{0,1,2,...,n-1\}$, which will have $n$ elements. Modulo is then a relation that you could invoke on the set. So we could say that we are "counting in $\mathbb{Z}_4=\{0,1,2,3\}$". This would usually refer to counting modulo $4$, in which we only use the numbers in $\mathbb{Z}_4$. (To be formal one defines these things using equivalence classes, but that is somewhat out of scope.)
3.) I understand how it can sound confusing but yes, it is exactly as it is written (I assume of course, I did not write it). So $S(x)=y$.
4.) If you think about it for a while, what is $S(1)$? It can only be sent to any of the elements in $J_4\setminus \{0\}$, i.e to any of $1,2,3$. But what number(s) $y$ has the property that $(xy)=1 \mod 4$? In conclusion, that it is not well defined refers to that it is not defined for all elements of its domain, i.e $J_4\setminus \{0\}$ in this case.
Hope this helps.
