Does the First Functor Law follow from the Second?
No
data Break a = Yes | No
instance Functor Break where
fmap f _ = No
clearly the second law holds
fmap (f . g) = const No = const No . fmap g = fmap f . fmap g
but, the first law does not. The problem with your argument is not all x'
are of the form fmap f x
No, it only works in one direction.
Consider this Functor
instance:
data Foo a = Foo Int a
instance Functor Foo where
fmap f (Foo _ x) = Foo 5 (f x)
It satisfies the second law but not the first one.
The last step in your proof is invalid -- you showed that fmap id x'
= x'
, but this is restricted to x'
s that are returned from fmap
in the first place, not arbitrary values.