qqGlebqq said:
Thank you!
You use the transition function (so you use set theory) in definition of formal language (and also "ordered set") , but as we didn't have FL, we didn't have set theory, so it becomes circular, no? I think I don't get from what we start and what we have in the beginning. Maybe you could advice me a book which would also help me with this confusion?
I wouldn't call it set theory. We have to use the fundamental concept of a set without bothering any logical fallacies like Russel's paradox. Just the way you learned about the set of integers or the set of rational numbers. You can add numbers without knowing about set theory, can't you? Accepting a set as a collection of elements is sufficient in this context. Of course, some fundamental terms like empty set, subset, power set, union, intersection, and complement will be useful. That is Venn diagrams, not set theory.
And, yes, we need order very much because of the examples I gave. But that's just an enumeration. A set isn't ordered: ##\{1,2,3\} = \{3,2,1\}## but the (ordered / enumerated) sequences ##(1,2,3)\neq (3,2,1).## That is basically it.
My book is not in English, and I don't have other recommendations. My approach would be to find lecture notes on the internet. E.g. a search by "formal language + pdf" brought me to
https://www.its.caltech.edu/~matilde/FormalLanguageTheory.pdf
on the Caltech server. This should be a reliable reference.
Note that definitions and notations can vary between authors and sources. My book defines an automaton as a quintuple. Others might have less or more.
Don't think about set theory for too long, unless it will be necessary. We only need sets as a container for things - unordered, and sequences if ordered. I can't rule out that logical subtleties of set theory won't become an issue at some stage in the theory of formal languages, but certainly not at the beginning.