If you take the internals from the 197 F4R and put them into the 172 block, and fit the 197 head, then yes it will fit, but bear in mind that the engine management isnt going to be an easy retrofit and the way the cam timing works is different between the two.
IMHO you would be better off just fitting a set of hotter cams and high comp pistons to the 172 engine, as those are the only significant differences other than the cam timing.