16
$\begingroup$

Is there a mathematical symbol that means "For every element"? I want the meaning to have similar function as an iteration, say for loop.

  • 7
    What about the "for all" quantifier, i.e. $\forall$?2012-06-19
  • 0
    I don't think that counts since it takes all elements at once and is not iterable.2012-06-19
  • 2
    @drum: If I understand your last comment, no; unless you happen to have some enumeration indexed by $\mathbb{N}$, in which case the usual way of writing it is "for $i=1,2,3,\ldots$"2012-06-19
  • 0
    @ArturoMagidin: Yes that's what I meant. If you say so, I guess I have no choice but keep writing that over and over again...sigh...time to invent a new symbol!2012-06-19
  • 6
    In writing, you'll probably be better off being clear and using words, not symbols.2012-06-19
  • 5
    Your question would be much clearer if you gave an example of an actual use. Maybe you are looking for induction? E.g. *"By induction over $i\ge 2$, define $a_i=a_{i-1}+a_{i-2}$."* This applies to any well-ordered set.2012-06-19

4 Answers 4

5

The very concept of "doing something in some order" doesn't really make sense in mathematics. Things are defined once and for all, the whole set exists "all the time". This has the great advantage that there is no ambiguity: "do you mean, the variable at position $n$ before or after we looped past it?"

If you come from imperative programming, you may be surprised that it's possible to do any useful stuff when you're not allowed to modify something after its definition. But it's quite possible – also in programming! What you could write in C as

int v[14]; v[0] = first_value; for(int i=1; i<14; ++i)   v[i] = function_for_next(v[i-1]); 

can also be written, without explicit mention of an "order" in which the set is traversed, as recursive buildup of e.g. a linked list. In Haskell,

v = vBuild 0 firstValue      where vBuild 14 _ = []            vBuild i lastValue                = lastValue : vBuild (i+1) (functionForNext lastValue) 

or simply

v = take 14 $ iterate functionForNext firstValue 

This also works for arbitrarily more complicated examples, in fact you only need a very simple notational system to calculate anything that can be calculated at all. And in mathematics, you're usually not so much interested in how to calculate results (so it's not a problem if some calculations are a bit less efficient without explicit state, mutable variables, iterations etc.), but it's always very important that expressions aren't ambiguous so you can prove various properties.

  • 0
    Do you mind elaborating the last paragraph with an example? It's hard to wrap around my head the "Why would maths not be concerned with how results are worked out"?2017-11-23
  • 0
    @Pacerier mathematical theorems are often formulated like “there exists $X$ such that $P$”, without any direct elaboration as to how $X$ can actually be obtained. In fact, for some examples like [Banach-Tarski](https://en.wikipedia.org/wiki/Banach%E2%80%93Tarski_paradox) it's not really possible to [construct](https://en.wikipedia.org/wiki/Constructivism_(mathematics)) the concrete solution, instead its existance is inferred from an [axiom](https://en.wikipedia.org/wiki/Axiom_of_choice).2017-11-23
  • 0
    What are good examples of "there exists `X` such that `P`"?2017-11-23
  • 0
    @Pacerier [Picard-Lindelöf](https://en.wikipedia.org/wiki/Picard%E2%80%93Lindel%C3%B6f_theorem): there exists a unique solution to any Lipschitz-continuous ODE. [Nash existance theorem](https://en.wikipedia.org/wiki/Nash_equilibrium#Nash.27s_Existence_Theorem): in a game with a finite number of players who can choose from finitely many pure strategies, there exists a Nash equilibrium. [Borsuk-Ulam theorem](https://en.wikipedia.org/wiki/Borsuk%E2%80%93Ulam_theorem): for any continuous mapping from the $n$-sphere, there exists a pair of antipodal points with identical function values.2017-11-23
50

This should work.

$\forall x\in A\cdots$

  • 0
    Just to make sure I follow, this means something along the lines of "for all x containing member A", right?2015-04-16
  • 6
    For all x in A. You have it backwards.2015-04-16
  • 2
    These conditions should be separate. It would be too easy to think that this means "for all elements in A" it should read: ∀x; x ∈ A. Which separately says "for all x" and then "x is an element of A".2017-10-26
13

I still think the universal quantifier is the answer you are looking for.

From the wording you use e.g. "loop" and "iteration", I infer that your confusion might be coming form the fact that in mathematics there are no variables only constants (here I using the meaning from computer science). For example when you define $x = 2$, even if mathematician would say it is a variable, in fact (in computer science sense) it is a constant: you set $x$ only once, and afterwards it does not change. If it would, then we would have a contradiction i.e. $x = 2 \land x \neq 2$ (please note, that if there are other $x$-es in the text, it just means that those are different constants, but with the same name).

So, when computer scientist wrote

for i from 2 to n do      a[i] := a[i-1] + a[i-2] 

then mathematician would write $\forall i \in \{2,\ldots,n\}.\ a_i = a_{i-1} + a_{i-2}$. The order does not matter, $a_i$-s are constants that are defined by such recursive formula and that's it. You might not know how many solutions there are (none, single, many?), but usually you do if the formula is simple enough. You don't care how to compute it, how much time would it take or worry if you have enough memory to calculate it--those problems are just uninteresting :-)

Welcome to mathematics!

P.S. Naturally, there are domains of mathematics (notably theoretical computer science :D) in which you do care about such things, I am just teasing you ;-)

  • 2
    How might you extend this notation to higher dimensions. This would be useful for nested loops. For example $\forall i\in \{1,\dots,I\}, \ \forall j\in \{1,\dots,J\}, \ \forall k\in \{1,\dots,K\}\ \ a_{ijk}=\cdots$. However this notation seems a bit cumbersome at higher dimensions.2016-07-22
  • 0
    @AaronHendrickson Note, that even the identifier with indices $a_{i, j, k, l, m, n, \ldots}$ is cumbersome at higher dimensions. On the other hand, observe that $\forall i \in I.\ \forall j \in J.\ a_{i,j} = \ldots$ is equivalent to $\forall (i,j) \in I \times J.\ a_{i,j}$. So, in higher dimensions, instead multiple indices one would use tuples, and then quantify over product of relevant sets. For example, if we wanted $i_1 \in I_1$ and so on up to $i_k \in I_k$, then we could set $\mathcal{I} = \prod_{j=1}^{k}I_j$ and write $\forall \bar\imath \in \mathcal{I}.\ a_{\bar\imath}=\ldots$.2016-07-22
  • 0
    You say that there variables can't vary in maths, but when you do `∀i` isn't the `i` a different value each time ?2017-11-23
  • 0
    @Pacerier There is no "each time" (because there is no time). If you want to use time, then they would be there all at the same time. The exact meaning of the quantifier is a bit more involved, but a rough simplification would be that you get a bunch of formulas $a_{34}=a_{33}+a_{32}$, $a_{5426}=a_{5425}+a_{5424}$, and so on with every possible/allowed values, and the $i$ is not even there. As I said, that's not technically correct (study logic if you want to know more), but this is a good intuition for quantification over finite sets.2017-11-23
  • 0
    @dtldarek, So is it that when you do `∀i` for the range 10 to 15, we end up having i1, i2, i3, i4, i5, i6? Thus, it's like an array?2017-11-23
  • 0
    @Pacerier I'm not sure I understand you. $\forall i \in \{10,11,12,13,14,15\}.\ a_i = a_{i-1} + a_{i-2}$ is roughly $a_{10}=a_{9}+a_{8} \land a_{11}=a_{10}+a_{9}\land a_{12}=a_{11}+a_{10}\land a_{13}=a_{12}+a_{11}\land a_{14}=a_{13}+a_{12}\land a_{15}=a_{14}+a_{13}$. Does that agree with your understanding?2017-11-24
5

From your comments, it seems that you want to take the elements of your index set in a specific order, as in an iteration.

There is no single symbol for that; the general shorthand only works when the index set has order type $\omega$, that is, it is indexed by $\mathbb{N}$, in which case the standard way of signaling this would be "for $i=1,2,3,\ldots$".