Building Formal Mathematics on Visual Imagery: A Case Study and a Theory.