A formal science is the academic study that is predominantly concerned with abstract formal systems, for instance, logic, mathematics, and the theoretical branches of computer science, information theory, and statistics.
Is it "Science"?
It is arguable whether formal science is, besides natural science and social science, the third branch of science and some of the disciplines of formal science like mathematics and statistics are often even referred as natural science. For instance, Carl Friedrich Gauss referred to mathematics as "the Queen of the Sciences". In some notable universities, e.g. Imperial College London and Tokyo University, their Department of mathematics/statistics run under the faculty of natural science/science.
The changing definition of the word 'science' maybe primarily induces such a confusion. In the original Latin Regina Scientiarum, as well as in German Königin der Wissenschaften, the word corresponding to science means (field of) knowledge. Indeed, this is also the original meaning in English, and there is no doubt that mathematics is in this sense a science. The specialization restricting the meaning to modern scientific method is of later date.
The notion that formal science is also science is also attributed to the close relation between formal science and disciplines such as physics or chemistry. Nowadays, mathematics and statistics are heavily applied in natural and social science and are deemed important and necessary by most of the scholars in those areas. Without adequate knowledge in mathematics, it is impossible to make sense of the subject matters. This close relation explains the notion and why formal science is often taught under the faculty of science in universities.
The original intention of scholars to study mathematics would be another reason for the notion. From the very early history of mathematics, until the recent centuries, mathematicians believed that the physical world is constructed according to mathematics. For example, Pythagoras believed that everything was related to mathematics and that numbers were the ultimate reality; he once said that "number is the ruler of forms and ideas and the cause of gods and demons." In later history, Isaac Newton also thought that God used mathematics to design the world. Therefore, the study of mathematics is identical to the study of nature. So it is not surprising that mathematics and other related formal science would be regarded as branches of natural science.
However, many scholars oppose including formal science as a branch of science. They admit that formal science is a very powerful tool to natural and social science, but it does not mean formal science is science. Most importantly, they define science as the discipline using scientific method which bases on observation and empirical study. As knowledge in formal science is a priori and always constructed by rules of deduction from axioms and definition without any empirical study, they refuse to classify formal science as a branch of science.
The study of formal science began much earlier than natural science and the invention of scientific method, with the most ancient mathematical texts available dates back to 1500BC-500 BC (ancient India), 1300-1200 BC (ancient Egypt), and 1800 BC (Mesopotamia). From then on different cultures such as the Indian, Greek, Islamic made major contributions to mathematics.
Besides mathematics, logic is another oldest subject in formal science. Logic as an explicit analysis of the methods of reasoning received sustained development originally in three places: India in the 6th century BC, China in the 5th century BC, and Greece between the 4th century BC and the 1st century BC. The formally sophisticated treatment of modern logic descends from the Greek tradition, being informed from the transmission of Aristotelian logic while the tradition from other cultures do not survive into the modern era.
As other disciplines of formal science rely heavily on mathematics, they did not exist until mathematics has developed into a relatively advanced level. Pierre de Fermat and Blaise Pascal (1654), and Christiaan Huygens (1657) started the earliest study of probability theory (statistics) in the 17th century.
Study on computer science and information theory did not begin until middle 20th century.