What should be my induction hypothesis for proving the unique readability of terms in first order logic? The thing I want to prove is:
If a term is one of the following then it is uniquely defined

*

*a variable

*a constant

*complex form, $f t_1 t_2 \cdots t_n$ where $f$ is a function of arity $n$ and $t_i$ are terms.

My attempt:
The first two cases are trivial, so I'm kinda avoiding it here.
To prove the third case, let's say the term $t$ is indeed defined in two distinct ways
$$
t :\equiv f t_1 t_2 \cdots t_n\\
t: \equiv f' t'_1 t'_2 \cdots t'_{n'}$$
the items $f$ and $f'$, $t_i$ and $t'_i$ are individually different from each other but when stacked they convey the same information. We wish to prove that $f = f'$ and $t_i = t'_i$.
Is this argument: $f$ and $f'$ are same because if they were different then the string of symbols would start with different symbols and hence the two strings will not be equivalent, sound?
What would be induction hypothesis for proving $t_1 = t'_1$?
 A: Hint: work from right to left not left to right, parsing each trailing subword of the word you are working on as a sequence $t_1t_2\ldots t_m$ of terms. When you encounter a function symbol of arity $n$, if you have parsed what follows it as $t_1t_2\ldots t_m$ where $m \ge n$, then you can continue by parsing what you have as $(ft_1\ldots t_n)t_{n+1}\ldots t_m$; if $m < n$, then the word you are looking at is not a valid term. When you have worked all the way to the left, the word is a valid term if you have a sequence with just one element $t_1$. This approach to syntax is most commonly used with the symbols written from left to right: see reverse Polish notation.
For an inductive proof, you need to prove the stronger statement that any word $w_1\ldots w_k$ in the symbols denoting the variables, constants and functions that can be parsed while respecting the arities of the function symbols, can be parsed in at most one way as a sequence $t_1\ldots t_n$ of terms for some $n$. Then proceed by induction on $k$ taking your inductive hypothesis to be that $w_2\ldots w_k$ has this property.
