1: \begin{abstract}
2: We describe in this paper a connection between bifix codes, symbolic
3: dynamical systems
4: and free groups. This is in the spirit of the
5: connection
6: established previously for the symbolic systems
7: corresponding to Sturmian words. We introduce a class of sets of
8: factors of an infinite word with linear factor complexity
9: containing Sturmian sets
10: and regular interval exchange sets, namely the class of tree
11: sets.
12: We prove as a main result that for a uniformly recurrent
13: tree set $S$,
14: a finite bifix
15: code $X$ on the alphabet $A$ is $S$-maximal of $S$-degree $d$ if and only if it
16: is the basis of a subgroup of index $d$ of the free group on $A$.
17: \end{abstract}
18: