In the mathematical subject of group theory, the Stallings theorem about ends of groups states that a finitely generated group G has more than one end if and only if the group G admits a nontrivial decomposition as an amalgamated free product or an HNN extension over a finite subgroup. In the modern language of Bass–Serre theory the theorem says that a finitely generated group G has more than one end if and only if G admits a nontrivial (that is, without a global fixed point) action on a simplicial tree with finite edge-stabilizers and without edge-inversions.
The theorem was proved by John R. Stallings, first in the torsion-free case (1968) and then in the general case (1971).
Let Γ be a connected graph where the degree of every vertex is finite. One can view Γ as a topological space by giving it the natural structure of a one-dimensional cell complex. Then the ends of Γ are the ends of this topological space. A more explicit definition of the number of ends of a graph is presented below for completeness.
Let n ≥ 0 be a non-negative integer. The graph Γ is said to satisfy e(Γ) ≤ n if for every finite collection F of edges of Γ the graph Γ − F has at most n infinite connected components. By definition, e(Γ) = m if e(Γ) ≤ m and if for every 0 ≤ n < m the statement e(Γ) ≤ n is false. Thus e(Γ) = m if m is the smallest nonnegative integer n such that e(Γ) ≤ n. If there does not exist an integer n ≥ 0 such that e(Γ) ≤ n, put e(Γ) = ∞. The number e(Γ) is called the number of ends of Γ.