High blood sugar affects cognitive function via lactate