An axiomatic foundation of revealed preference theory is obtained by formulating conditions on the mapping from the space of choice functions into the space of preference relations. Dual conditions are applied on the inverse or dual mapping. The composition of both maps is shown to be an extension of the choice function. Next, we derive both the unique preference relation and the unique decision rule endogenously determined by the extended choice function. The decision rule turns out to select weakly undominated alternatives. A slightly stronger assumption on the choice function results in the well known revelation theorems, which are based upon choosing best alternatives.