You can't patch out a slow processor, but Apple does its best.
iPhone 4 - Wikipedia
iOS 7
Apple releases iOS 7.1 with CarPlay support
iOS 7.1.2 Update Released [IPSW Download Links]
If You Care About Security, Throw Away Your iPhone 4 Right Now
A few of the phones in my collection, from left to right: iPhone 4
Download iOS 7.1.2 For iPhone, iPad [Direct Download Links
iOS 7.1 on the iPhone 4: As good as it's going to get
Final Words - Apple iPhone 4S: Thoroughly Reviewed