# Exercise from mathematical Logic about length of sentences in SL

Problem is that : Let $\phi%$ be a sentence of length $n$. Show that for $1\leqslant k<n$, $r(\phi,k)<l(\phi,k)$, where each of them represents the number of left(or right) parenthesis among the first $k$ symbols of $\phi$.

My sketch of answer is that:using induction. base case is trivial. Let $r(\phi,k)=f(k)$ and $l(\phi,k)=g(k)$. And assume that $f(k)<g(k)$ And I pin down what values a function $f'(k)=r((\neg \phi),k)$ and $g'(k)=l((\neg \phi),k)$ has according to $k$. i.e. if k=1or 2, then $f'(k)=0$ and $g'(k)=1$

Since the language my textbook present only contain two connective negation and conditional, I could build similar function about conditional. Is it the right way to solve?

edit: my text is Enderton's a mathematical introduction to Logic. And definition of sentence is in it that either it is a member of L ,or negation or conditional of sentences.

• You probably should add the definition of a sentence provided by the author as this claim doesn't hold for what I consider to be the "standard definition" of first order sentences. Commented Sep 2, 2015 at 11:40
• @Stefan An example,please? Commented Sep 2, 2015 at 11:41
• @Git $\forall x \colon x = x$ Commented Sep 2, 2015 at 11:42
• @Stefan OK. I would never consider that standard, but there's no point in going into that here. Commented Sep 2, 2015 at 11:43
• @Darae Not that it matters much, but is this a problem in propositional or predicate calculus? Commented Sep 2, 2015 at 11:46

If we consider $\lnot$, we have that : $\phi := (\lnot \psi)$ and we know that (induction hypotheses) :
for $1⩽k<n_{\psi}, \ r(\psi,k) < l(\psi,k)$.
But $n_{\phi}=n_{\psi}+3$; thus $l(\phi,k)=l(\psi,k)+1$, while $r(\phi,k)=r(\psi,k)$for $1⩽k<n_{\phi}$.