The Structure of Economics: A Mathematical Analysis