finished theorems about the gap function