Wright H, Jenks RA. Sex on the brain! Associations between sexual activity and cognitive function in older age. Age Ageing. 2016 Mar;45(2):313-7. doi: 10.1093/ageing/afv197.
In the real world, sex has been associated with improved cognitive function!