Formal and rigid geometry