During the latter part of the 1950s, the foundations of algebraic geometry were being rewritten; and it is here that the origins of the topos concept are to be found. At that time the Weil conjectures were an outstanding motivation to research. As we now know, the route towards their proof, and other advances, lay in the construction of etale cohomology[?].
With the benefit of hindsight, it can be said that algebraic geometry had been wrestling with two problems, for a long time. The first was to do with its points: back in the days of projective geometry it was clear that the absence of 'enough' points on an algebraic variety was a barrier to having a good geometric theory (in which it was somewhat like a compact manifold). There was also the difficulty, that was clear as soon as topology took form in the first half of the twentieth century, that the topology of algebraic varieties had 'too few' open sets.
The question of points was close to resolution by 1950; Grothendieck took a sweeping step (appealing to the Yoneda lemma) that disposed of it - naturally at a cost, that every variety or more general scheme should become a functor. It wasn't possible to add open sets, though. The way forward was otherwise.
The topos definition first appeared somewhat obliquely, in or about 1960. General problems of so-called 'descent' in algebraic geometry were considered, at the same period when the fundamental group was generalised to the algebraic geometry setting (as a pro-finite group). In the light of later work, 'descent' is part of the theory of comonads[?]; here we can see the way in which the Grothendieck school bifurcates in its approach from the 'pure' category theorists, a theme that is important for the understanding of how the topos concept was later treated.
There was perhaps a more direct route available: the abelian category concept had been introduced by Grothendieck in his foundational work on homological algebra, to unify categories of sheaves of abelian groups, and of modules. An abelian category is supposed to be closed under certain category-theoretic operations - by using this kind of definition one can focus entirely on structure, saying nothing at all about the nature of the objects involved. This type of definition can perhaps be traced back to the lattice concept. It was a possible question to pose, around 1957, about a similar purely category-theoretic characterisation, of categories of sheaves of sets.
This definition was eventually given, around 1962, by Grothendieck and Verdier (see Verdier's Bourbaki seminar Analysis Situs). The characterisation was by means of categories 'with enough colimits', and applied to what is now called a Grothendieck topos[?]. The theory rounded itself out, by establishing that a Grothendieck topos was a category of sheaves, where now the word sheaf had acquired an extended meaning with respect to the idea of Grothendieck topology.
The idea of a Grothendieck topology (also known as a site) has been characterised by John Tate as a bold pun on the two senses of Riemann surface. Technically speaking it enabled the construction of the sought-after etale cohomology[?] (as well as other refined theories such as flat cohomology and crystalline cohomology). At this point - about 1964 - the developments powered by algebraic geometry had run their course. The 'open set' discussion had effectively been summed up in the conclusion that varieties had a rich enough site of open sets in unramified covers of their (normal) Zariski-open sets.
The current definition of topos goes back to William Lawvere. While the timing follows closely on from that described above, the attitude is different, and the definition is more inclusive. That is, there are examples of toposes that are not a Grothendieck topos. What is more, these may be of interest for a number of logical disciplines.
Lawvere's definition picks out the central role in topos theory of the sub-object classifier. In the usual category of sets, this is the two-element set of Boolean truth-values, true and false. It is almost tautologous to say that the subsets of a given set X are the same as (just as good as) the functions on X to any such given two-element set: fix the 'first' element and make a subset Y correspond to the function sending Y there and its complement in X to the other element.
Now sub-object classifiers can be found in sheaf theory. Still tautologously, though certainly more abstractly, for a topological space X there is a direct description of a sheaf on X that plays the role with respect to all sheaves of sets on X. In fact in terms of the space associated with a sheaf it is attractively described as the union of disjoint copies of each open set U of X. This maps to X by an obvious local homeomorphism: it looks like a stack of all the open sets of X projecting down. The stalk for x in X has a point for each U containing x; so that this sheaf looks like the graph of the membership relation.
Lawvere therefore formulated axioms for a topos that assumed a sub-object classifier, and some limit conditions (to make a cartesian-closed category[?], at least). For a while this notion of topos was called 'elementary topos'.
Once the idea of a connection with logic was formulated, there were several development 'testing' the new theory:
There was some irony that in the pushing through of David Hilbert's long-range programme a natural home for intuitionistic logic's central ideas was found: Hilbert had detested, not even cordially, the school of Brouwer. Existence as 'local' existence in the sheaf-theoretic sense is a good match. On the other hand Brouwer's long efforts on 'species', as he called the intuitionistic theory of reals, are presumably in some way subsumed and deprived of status beyond the historical.
The later work on etale cohomology[?] has tended to suggest that the full, general topos theory isn't required. On the other hand, other sites are used, and the Grothendieck topos has taken its place within homological algebra.
The Lawvere programme was to write higher-order logic in terms of category theory. That this can be done cleanly is shown by the book treatment by Lambek and Scott. What results is essentially an intuitionistic (i.e. constructivist) theory, its content being clarified by the existence of a free topos. That is a set theory, in a broad sense, but also something belonging to the realm of pure syntax. The structure on its sub-object classifier is that of a Heyting algebra[?]. To get a more classical set theory one needs that to be upgraded to a Boolean algebra, a return to the case of two Boolean truth-values. In that book, the talk is about constructivist mathematics; but in fact this can be read as foundational computer science (which is not mentioned). If one wants to discuss set-theoretic operations, such as the formation of the image (range) of a function, a topos is guaranteed to be able to express this, entirely constructively.
The topos concept arose in algebraic geometry, as a consequence of combining the concept of sheaf and closure under categorical operations. It plays a certain definite role in cohomology theories.
The subsequent developments associated with logic are more interdisciplinary. They include examples drawing on homotopy theory[?] (classifying toposes). They involve links between category theory and mathematical logic, and also (as a high-level, organisational discussion) between category theory and theoretical computer science based on type theory. Granted the general view of Saunders Mac Lane[?] about ubiquity of concepts, this gives them a definite status. As a 'killer application' one falls back on etale cohomology[?].
They have also produced a spin-off in pointless topology, where the locale concept isolates some of more accessible insights found by treating topos as a significant development of topological space. The slogan is 'points come later': this brings discussion full circle on this page. The point of view is written up in Peter Johnstone's Stone Spaces, which has been called by a leader in the field of computer science 'a treatise on extensionality[?]'. The extensional is treated in mathematics as ambient - it is not something about which mathematicians really expect to have a theory. Perhaps this is why topos theory has been treated as an oddity; it goes beyond what the traditionally geometric way of thinking allows. The needs of thoroughly intensional theories such as untyped lambda calculus[?] have been met in denotational semantics. Topos theory has long looked like a possible 'master theory' in this area.