A lil' different take...
In theatrical criticism, one might define the two as these:
<i>Comedy</i>
The protagonist of the main conflict that permeates a script <i><b>wins</b></i> in the end, at the climax.
<i>Tragedy</i>
The protagonist of the main conflict that permeates the script <i><b>loses</b></i> in the end, at the climax.
This says nothing of funny. And possibly it doesn't work well in describing improv- or sketch-based comedy. It serves as one perspective on the word "comedy," or rather, one perspective on what we call "comedy."
"What is" questions much like Machine's don't reach final answers ... if one makes the question in E-Prime (English without be-verbs), other possibly intended meanings come up:
"What do we mean by 'comedy'?"
"What do we call 'comedy'?"
"What do we generally find comedic?"
Aristotle (lover of fine "is" questions) might have asked Machine's question in his native tongue, but what seemed to underlie Artistotle's thought (based on his writings) lived a belief that qualities existed inherently "in" things. He did not seem to regard that humans, more correctly, <i>experience</i> qualities, and that each human has a different experience of reality.
So? So, each person has a different experience of comedy, what makes something "comedic," etc., and finding a common strain for every person's <i>use of the word</i> "comedy" proves more accurate.
Maybe a collection of people's meanings when they refer to something as "comedy" suffices for an answer to the question "What is comedy?," as opposed to a search (albeit simply implied) for "the" definition of comedy.
Been