Catalysis of the reaction: 2-amino-4-hydroxy-6-(D-erythro-1,2,3-trihydroxypropyl)-7,8-dihydropteridine = 2-amino-4-hydroxy-6-hydroxymethyl-7,8-dihydropteridine + glycolaldehyde.
2-amino-4-hydroxy-6-(D-erythro-1,2,3-trihydroxypropyl)-7,8-dihydropteridine glycolaldehyde-lyase activity