Discrete differential geometry in homotopy type theory