This essay unifies key epistemological concepts in a consistent mathematical framework built on two postulates: 1-information is finite; 2-knowledge is information compression. Knowledge is expressed by a function \( K(Y;X) \) and two fundamental operations, \( \oplus, \otimes \). This \( K \) function possesses fundamental properties that are intuitively ascribed to knowledge: it embodies Occam's razor, has one optimal level of accuracy, and declines with distance in time. Empirical knowledge differs from logico-deductive knowledge solely in having measurement error and therefore a "chaos horizon". The \( K \) function characterizes knowledge as a cumulation and manipulation of patterns. It allows to quantify the amount of knowledge gained by experience and to derive conditions that favour the increase of knowledge complexity. Scientific knowledge operates exactly as ordinary knowledge, but its patterns are conditioned on a "methodology" component. Analysis of scientific progress suggests that classic Popperian falsificationism only occurs under special conditions that are rarely realised in practice, and that reproducibility failures are virtually inevitable. Scientific "softness" is simply an encoding of weaker patterns, which are simultaneously cause and consequence of higher complexity of subject matter and methodology. Bias consists in information that is concealed in ante-hoc or post-hoc methodological choices. Disciplines typically classified as pseudosciences are sciences expressing extreme bias and therefore yield \( K(Y;X) \leq 0 \). All knowledge-producing activities can be ranked in terms of a parameter \(\Xi \in (-\infty,\infty) \), measured in bits, which subsumes all quantities defined in the essay.

This is an updated version with multiple typos corrected (a few of which within equations) and a few passages slightly edited to improve their clarity.

The author declares that they have no competing interests.

The following information was supplied regarding data availability:

The research in this article did not generate any raw data.