However, at the university, Lobachevsky was unable to attend Kartashevsky's lectures, as the latter was removed from his position in December 1806 by the director I.F. Yakovkin for having shown a spirit of disobedience and dissent. The mathematics courses were then taught by M.F. Bartels, who arrived in Kazan in 1808.
Lobachevsky's successes as a student, competing in his studies with I.P. Simonov, who later became a well-known astronomer and participant in a circumnavigation, consistently drew the approval of M.F. Bartels and other professors.
On August 3, 1811, Lobachevsky was established as a master. His supervisor, Professor M.F. Bartels, was a qualified mathematician and experienced teacher, but he did not engage in creative work. Under his supervision, Lobachevsky studied classical works on mathematics and mechanics: Gauss's "Theory of Numbers" (Disquisitiones Arithmeticae) and the first volumes of Laplace's "Celestial Mechanics". Having presented two scientific studies on mechanics and algebra ("The Theory of Elliptic Motion of Celestial Bodies" (1812) and "On the Solvability of the Algebraic Equation xn - 1 = 0" (1813)), he was promoted to adjunct professor (docent) ahead of schedule in 1814.
From the following year, he began independent teaching, gradually expanding the range of courses he offered and already contemplating a restructuring of the foundations of mathematics. Another year later, he received the title of professor extraordinarius.
However, a very challenging atmosphere for work soon developed at the university. In order to combat revolutionary sentiments and "free-thinking," the government of Alexander I adopted an increasingly reactionary policy, seeking ideological support in religion and mystico-Christian teachings. Universities were the first to undergo scrutiny.
In March 1819, a member of the Main Board of Schools, M. L. Magnitsky, was appointed to inspect Kazan University and he used his appointment for careerist purposes. In his report, he concluded that the university "causes public harm through the half-education of its students..." and therefore "should be destroyed in the form of its public demolition" as a cautionary example for other governments.
However, the university was not destroyed. Alexander I decided to reform it. Magnitsky became the Curator of the Kazan educational district and began an energetic "renewal of the university." His activities began with the dismissal of nine professors. Close surveillance of the content of lectures and student notes was established, and a strict barracks regime was introduced for students.
Seven years of this church-police system brought severe trials to Lobachevsky, but did not break his indomitable spirit. He managed to withstand this oppression through his extensive and diverse pedagogical, administrative, and research activities. He taught mathematics in all courses instead of Bartels, who had moved to Dorpat (Tartu); he filled in for Professor K. Bronner, who did not return to Kazan after his leave; he taught physics courses and managed the physics laboratory; he replaced astronomer I. P. Simonov, who went on a round-the-world voyage, and took charge of astronomy and geodesy, overseeing the observatory. For several years, he served as the dean of the physical-mathematical department. He dedicated colossal effort to organizing the library and expanding its physical and mathematical section. Simultaneously, he became one of the most active members, and later the chairman, of the construction committee responsible for building the university's main building. Finally, despite the thousands of ongoing tasks and responsibilities, Lobachevsky continued his intense creative work. He authored two textbooks for gymnasiums: "Geometry" (1823) and "Algebra" (1825). "Geometry" received negative feedback from academician N. I. Fuss, who did not appreciate the changes Lobachevsky made to traditional presentations and condemned the introduction of the metric system of measurements, as it originated in revolutionary France. "Algebra" also remained unpublished due to internal delays at the university.
Soon, conflicts began with the Curator. According to Magnitsky, Lobachevsky displayed audacity and violations of instructions. Magnitsky decided to impose special supervision over his actions.