Education as a social agreement