No, it only works in one direction.
Consider this instance of Functor :
data Foo a = Foo Int a instance Functor Foo where fmap f (Foo _ x) = Foo 5 (fx)
It satisfies the second law, but not the first.
The last step in your proof is not valid - you have shown that fmap id x' = x' , but this is limited to x' , which are first returned from fmap , not arbitrary values.
source share