Waving the lulav represents our victorious emergence from the judgment of Rosh Hashanah/Yom Kippur.
The following Midrash appears in Midrash Tanchuma on Parshat Emor # 18:
ולקחתם לכם ביום הראשון זה שאמר הכתוב אז ירננו כל עצי יער לפני ה' כי בא
כי בא לשפוט הארץ במי הכתוב מדבר בישראל ובאומות העולם שהקדוש ברוך הוא
דן אותן ביום הכפורים אלו ואלו נכנסין לפני המלך ואין אנו יודעין מי היה
מנצח משל למה הדבר דומה לשני בני אדם שנכנסו לדין לפני המלך ולא היה יודע
אדם מה ביניהם אלא המלך בלבד דן המלך אותן ולא היו יודעין הבריות מי נוצח
לחברו אמר המלך כל מי שהוא יוצא ובידו אגין הוו יודעין שהוא נצח כך ישראל
ואומות העולם נכנסין לדין [בראש השנה] וביום הכפורים ואין הבריות יודעין
מי נצח אמר הקדוש ברוך הוא טלו לולביכם בידכם שידעו הכל שאתם זכיתם בדין
לפיכך אמר דוד אז ירננו כל עצי יער לפני ה' אימתי כי בא כי בא לשפוט הארץ
[בראש השנה] וביום הכפורים (מה ישראל עושין ממתינים עוד חמשה ימים כדי
שידעו הכל שישראל זכו) לפיכך כתיב ולקחתם לכם ביום הראשון
"And you shall take for yourself on the first day." This is what the
verse says, "then all the trees of the forest shall sing before
Hashem, because he comes, he comes to judge the land." About whom is
the verse speaking? About Israel and the nations of the world. For
The-Holy-One-Blessed-Be-He judges them on Yom Kippur. These and these
enter before the king, and we don't know who is victorious. A parable,
to what is this compared? To two people who enter for judgement before
the king, and no man knows what is between them except for the king
alone. The king judges them and the creatures don't know who was
victorious over his friend. The king says, "whoever goes out with the branch/javelin in
his hand, you know that he was victorious. So, too, Israel and the
nations of the world enter for judgement [on Rosh Hashana and] on Yom
Kippur, and the creatures do not know who was victorious.
The-Holy-One-Blessed-Be-He says take your lulavs in your hands so that
everyone will know that you have triumphed in judgment. Therefore,
David said, "then all the trees of the forest will sing before
Hashem". When? "When he comes, when he comes to judge the land" on
[Rosh Hashana and] on Yom Kippur. (What does Israel do? They wait
another five days so that everyone should know that Israel triumphed.)
Therefore it is written, "And you shall take for yourself on the first
day."
While this Midrash does not specifically mention the waving, it is cited by various authorities (in slightly modified form) as the source-reason for the waving. It is first cited, I believe, by R. Asher Ben Yechiel and R. David Abudraham, and later accepted as the reason by R. Joseph Karo. They interpret the singing of the trees as referring to the waving of the Lulav.
Rosh, Succah 3:26
ואיתא במדרש לפי שבר"ה באין לדין ישראל ואומות העולם ואין יודעין מי יצא
זכאי ומי יצא חייב נתן הקב"ה מצוה זו לישראל שיהו שמחים בלולביהם כאדם
היוצא מלפני השופט זכאי שהוא שמח והיינו דכתיב ירננו עצי היער כלומר
ירננו בעצי היער כאשר יצאו מלפני ה' זכאין כשבאין לשפוט את הארץ ובמה
ירננו בהודו ובהושיעה נא
Abudraham, Seder Tefillat Succot
ואיתא במדרש לפי שבר"ה באין לדון ישראל ואומות העולם ואין יודעין מי יצא
זכאי מי יצא חייב נתן הקב"ה מצוה זו לישראל שיהיו שמחים בלולביהם כאדם
היוצא מלפני השופט זכאי שהוא שמח וזהו שכתוב ירננו עצי היער כלומר בעצי
יער כאשר יצאו מלפני ה' זכאין כשבא לשפוט את הארץ ובמה ירננו בהודו
והושיעא נא
Beit Yosef O.C. 641
ואיתא במדרש לפי שבראש השנה באין לדין ישראל ואומות העולם ואין יודעין מי
יצא זכאי ומי יצא חייב נתן הקדוש ברוך הוא מצוה זו לישראל שיהיו שמחים
בלולביהם כאדם היוצא מלפני השופט זכאי שהוא שמח והיינו דכתיב ירננו עצי
היער כלומר ירננו בעצי היער כאשר יצאו מלפני יי' זכאין כשבא לשפוט את
הארץ ובמה ירננו בהודו ובהושיעה נא