I am going over some excercises from the excellent Models of Computation book-thing and I have difficulties formulating a proposition to prove.
We have a definition of substring available, which using an array-indexed notation for strings and goes as follows:
$$ w[i..j] := \epsilon\ if\ j
And from it we also have the notion of prefix, which is defined as any substring of the form: $$w[1..j]$$
We are then asked to prove that for any string s of length n, there exist exactly n + 1 prefixes. I have problems formulating the proposition. My idea so far would be to create a definition to enumerate all prefixes of an arbitrary string of length w and use the size of the aforementioned set to formulate the following:
$$ \forall s \in string, |enumPrefixes(s)| = |s| + 1 $$
However I am not sure if I can add a new definition and also it feels like there should be a simpler way.