A Mathematical Framework for Consciousness in Neural Networks