In a formal manner.
He was dressed too formally for the occasion.
In accordance with official procedure.
He formally filed a complaint, which involved much paperwork.
In accordance with rigorous rules.
He proved it formally but gave his students no intuitive feel for the matter.