The article "Intuitionistic algebra and representations of rings" is fantastic; it develops the language, logic etc. for the topos $Sh(X)$, where $X$ is a fixed topological space, from scratch and thereby illuminating most of the known (and more) notions of sheaf theory in the sense that they become more natural. Thanks again [Peter Arndt][1] for this reference. On page 37, the rank of a module $M$ is introduced as a upper Dedekind cut in the sheaf $\mathbb{N}$, or equivalently as a upper semi-continuous function $r : X \to \mathbb{N} \cup \{\infty\}$. Now it is claimed that it is given explicitely by mapping $x$ to the minimal number of generators needed for the stalks $M_x$. However, I don't see why this should be upper semi-continuous. I can show that only in the case that $M$ is locally of finite type. In fact, when I track back the constructions I get, that $r(x)$ is the infimum of numbers of sections which generate $M|_U$, where $U$ varies over the open neighborhoods of $x$. Is this the correct definition of the rank? [1]: http://mathoverflow.net/questions/34228/does-every-nontrivial-sheaf-of-rings-have-a-maximal-ideal