TITLE: Existence of a zero-sum subset
QUESTION [79 upvotes]: Some time ago I heard this question and tried playing around with it. I've never succeeded to making actual progress. Here it goes:
Given a finite (nonempty) set of real numbers, $S=\{a_1,a_2,\dots, a_n\}$, with the property that for each $i$ there exist $j,k$ (not necessarily distinct) so that $a_i=a_j+a_k$ (i.e. every element in $S$ can be written as a sum of two elements in $S$, note that this condition is trivially satisfied if $0\in S$ as then every $x\in S$ can be written as $x+0$).
Must there exist $\{i_1,i_2,\dots, i_m\}$ (distinct) so that $a_{i_1}+a_{i_2}+\cdots +a_{i_m}=0$?
ETA: A possible reformulation can be made in terms of graphs. We can take the vertex set $\{1,\dots ,n\}$ and for each equation $a_i=a_j+a_k$ in S add an edge $[ij]$ and its "dual" $[ik]$. The idea is to find a cycle in this graph, whose dual is a matching.

REPLY [17 votes]: The brilliant proof  of Seva, János and Péter seems pretty short for me. Here it is.
We prove the following statement which obviously implies the claim.

Let $S$ be a non-empty finite set of variables. Assume that for each $a\in S$ we have a linear form $\ell_a:=b(a)+c(a)-a$ for certain $b(a),c(a)\in S\setminus\{a\}$ (possibly $b(a)=c(a)$). Then there exists a non-empty set $A\subset S$ such that all coefficients of the linear form $\sum_{a\in A}\ell_a$ belong to $\{0,1\}$.

By induction, we may assume that this holds for smaller values of $|S|$.
Consider the multiset $T=\{b(a),c(a):a\in S\}$. We have $|T|=2|S|$. If $T$-multiplicity of every element $x\in S$ equals 2, we have $\sum_{a\in S} \ell_a=\sum_{x\in S} x$, so we may take $A=S$. If $T$-multiplicity of some $x\in S$ equals 0, just remove $x$ from $S$ ($S$ remains non-empty) and apply induction.
It remains to consider the case when $T$-multiplicity of some $z\in S$ equals 1. Say, $z=b(x)$, $\ell_x=z+y-x$ for certain $y\notin \{x,z\}$. Denote $T=S\setminus \{x,z\}$.  For $a\in T$ consider the linear form $\ell_a'$, obtained from $\ell_a$ by replacing $x$ by $y$ if necessary (note that if this happens for $\ell_y$, i.e., $\ell_y=x+t-y$, then $\ell_y+\ell_x=z+t$ and we may take $A=\{x,y\}$.) By induction, the sum of several such forms $\ell_a'$ have coefficients 0's and 1's. For the corresponding forms $\ell_a$ this means either what we need, or that the coefficient of $y$ in their sum equals -1 and the coefficient of $x$ equals 1 or 2. In the latter case add $\ell_x$ to their sum.