Naming convention for unused variables

155 Views Asked by At

First of all, I am coming from a computer science background so bear with me if this is a silly question :)

I am trying to proof something with tuples of type $(a, b, c) \in Z$ where $Z \subseteq A \times B \times C$.

For the sake of a simplified example, suppose I want to make a statement that all elements in $A$ that are used in $Z$ shall be part of another set $A'$. The way I am currently expressing this would be

\begin{equation} A' := \{a \mid (a,b,c) \in Z\}. \end{equation}

where I actually don't care about $b$ and $c$. Now I am running into an issue where I am littering my proof with a bunch of unused variables and where I'd like to use the variable names $b$ and $c$ elsewhere further down in my proof in a context where I actually care about them. I want to differentiate that these are not the same as in the definition of $A'$. Of course I could use different names or rename the $b$ and $c$ I used previously to something like

\begin{equation} A' := \{a \mid (a,b',c') \in Z\}. \end{equation}

however it still feels a bit silly to declare a bunch of unused variables, confusing the reader with stuff like $\forall b'''' \in B: \dots$ just because I've used up other names for a $b$ in other unrelated contexts and still want to (or have to) differentiate between them.

In computes science some programming languages have a convention (or language feature) stating that a "_" character (depending on the programming language) may be used to express that that variable should be "discarded" and will not be used. This also helps to clarify to anyone reading that code that this variable was knowingly not used further and therefore this convention helps with readability.

for example in C# I could write something like this

foreach ((int a, _, _) in Z)
{
    // do something with a
}

instead of

foreach ((int a, int b, int c) in Z)
{
    // do something with a, but leave anyone to guess what's gonna happen with b and c.
}

In computer science I can use this convention to tell the compiler and anyone reading the code that I am aware that there are also $b$ and $c$ values in $Z$ but that I don't care about them in this context.

Now I wonder if there exists a similar concept to this in mathematics? Is there an agreed-upon standard, be it a prefix, symbol or letter, to tell the reader of my proof that I am aware of- but not interested in- the $b$ and $c$ values in

\begin{equation} A' := \{a \mid (a,b,c) \in Z\} \end{equation}

?

2

There are 2 best solutions below

1
On BEST ANSWER

In mathematics, we often use the symbol $\bullet$ in the same way as you use _ in programming languages. So to express that $A'$ is the set of values $a$ that appear in first position of a tuple, you'd say $$ A' := \{a | (a,\bullet,\bullet) \in Z \}. $$

1
On

The example you make in terms of C# does not reproduce your original concern. In that piece of code, even though the unused variables were named instead of using underscores those names could have been used outside that lexical scope with completely different meaning (that is, they are local). The same in math: those variable names are local in that set definition and do not clash with other same-named variable outside that set definition. Anyway for the specific set you are defining there exists a compact notation because it's the natural projection of $Z$ over $A$: $$A'=\varphi_A(Z)$$ where the map $\textit{natural projection over }A$ is always provided with a direct product of sets like yours: $A\times B \times C $, that is it is intrinsic with the definition of direct product: $$\varphi_A\colon Z \to A; (a, b, c)\mapsto a$$

On the other hand, dots as placeholders for variables are usually used in variable arguments of multivariable functions for partial evaluation. That is, being $f: X\times Y\to Z$ a function, the notation $$f(a, \cdot)$$ is a shortcut for defining this new function: $$Y\to Z; y \mapsto f(a, y)$$