Why do they write textbooks as lists of theorems and definitions, with unsolved exercises and proofs left to the reader? Most of the advanced textbooks (college level textbooks, especially graduate), are written as a list of theorems and definitions, little or none of the exercises have solutions and many proofs and explanations are left to the reader.

My question is: Is there any reason why they do this? What is the purpose of writing a textbook if you make it hard for the reader to learn from it?

If I had to make a textbook I would try to make it as friendly and as intuitive as possible since I know that students buy it to learn something from it, otherwise why would I even write it? I couldn't imagine myself thinking "oh wait, let me give 0 examples, and let me leave this to the students otherwise it's explained too well" it's pretty funny (or depressing).
Is there any advantage of studying from this kind of textbooks? And there's no way that reading the same page for days in a row trying to understand the same line (when maybe one just needed a little example) is productive or it will stick in your mind for longer, if something is explained well and easy to understand you'd be able to learn more stuff (therefore be more productive) and remember it for a long time as well.
(P.s: I understand that for older textbooks, sometimes they were very concise to save paper, but now it's 2020..)
 A: The way you learn mathematics when you are an advanced college student, a grad student or even a fresh Ph.D. is very different from the way you do when you are in school. That is mainly because you need to acquire working knowledge about the subject and the potential ability to improve on it. For, you need an active attitude and an habit of independent thinking about the subject.
A well-chosen list of problems ranging from straightforward to difficult (or very difficult) is very useful to train your abilities.
In fact, having to think independently about the subject may help understanding its fine points. I remember, back in my undergrad years in Rome, a professor telling that the best way to approach a grad level textbook is: read first the statements of the theorems, then try to solve the exercises and only after that go back to the proofs of the theorems and try to understand them.
You may argue that long lists of problems like those in Hartshorne's Algebraic Geometry GTM book or Lang's (in)famous approach to homological algebra ("Take any textbook in homological algebra, read the statements and prove them") may not considered friendly to the student, but why learning in depth a technical subject should be regarded as needing a friendly approach?
Talking about exercises, I think there is a very important reason why answers should not be provided. A math problem may have different ways to be solved, sometimes using different ideas. If the author gives an answer, the student may be led to think that that way of tackling the problem is the standard one, or the canon. But this would discourage independent thinking which is--or should be--a main goal in teaching mathematics (or teaching anything except maybe religious dogma, for that matter).
A: By the time that a student is at a graduate level of mathematics, a number of things should have happened:

*

*Their academic maturity should be sufficiently well-developed that the need for a more exercise- or computational-oriented text is significantly less.

*The direction of their mathematical development ought to be toward asking questions about various mathematical statements or claims, and thinking about how those statements could be proven.  In a sense, brevity is a means by which some authors evoke this type of thinking in the reader--it is a feature, not a bug.

Additionally:


*Side explanations and commentary are often not wanted by more experienced mathematicians who studied the material in the past, but need to go back and revisit it/refresh their memory.

*Papers written by mathematicians are often very succinct and only provide the minimum necessary details to establish results, with the expectation that the reader (who is also a mathematician, and quite often one who specializes in the same field as the author) is familiar enough with the context to do any calculations or minor points of reasoning for themselves.  Therefore, this is a skill that must be fostered in preparation for a career in mathematics research.

A: I think that you are correct to point these issues out. When I started out studying mathematics I thought the same. However, many people who went through an academic degree forget that they were not isolated with the textbooks but they were taught by people. So most people actually had the concepts explained to them by someone. Be it through problem solving sessions, lectures, and so on. So by the time you have a bachelors or masters degree or a PhD you usually have the necessary skills to read such books and "teach yourself".
I always felt that textbooks in mathematics were more of a collection of notes (for instance Rudin's books; however, the learning happens in his exercises which are very good!) and I don't think that the logical presentation of a mathematical theory is necessarily the best pedagocical one.
I agree with heropup's answer. But this applies only for people who actually studied at university or something equivalent. For self-studying purposes, i.e. alone without a teacher/professor, most books in mathematics are ill-suited if you don't have the necessary (intellectual) maturity.
