"Didn't you have a lecture today?" vs "You didn't have a lecture today?"
Regarding the aforementioned clauses, from "experience", I can surmise different, subtle nuances. When I was taught English, the "grammatical construction" would be the former example.
"Didn't you have a lecture today?": Why are you here [to my dismay]? I thought you had a lecture today.
"You didn't have a lecture today?": You are here [to my surprise/I was wrong]! I thought you had a lecture today.
What would be the grammatical explanations for these different nuances?
Even though this post could be considered similar to Asking questions without subject-verb inversion — a new trend?, the difference is regarding the presence or absence of subject-verb inversion, not about whether such constructions are valid grammatically or colloquially accepted, or whether they have the same meaning. In both case, there exists do-support, so that is irrelevant. Does appending a question mark to a declarative sentence result in a valid sentence?, indeed, asks about appending a question mark, but in the context of whether it is a valid construction, not the -potential- difference in meaning.
Either could be a response and both arise from the same situation, in which the speaker's assumption that the (student?) had a lecture has somehow been put in doubt.
– Robbie Goodwin Sep 13 '23 at 15:54