First principles of philosophy. The science of perfection