In Genesis 4, Cain's descendant Lamech is not a minor character. He brings with him a heavy dose of numerological symbolism.
Lamech said to his wives: 'Adah and Zillah, hear my voice; you wives of Lamech, listen to what I say: I have killed a man for wounding me, a young man for striking me. If Cain is avenged sevenfold, truly Lamech seventy-sevenfold.'
Mind you, Lamech is the seventh generation in this list.
I previously commented on the parallel genealogies in Genesis 4 and 5, where chapter 5 represents an alternate version of the same ancestry found in chapter 4. The redactor of the genealogy now found in Genesis 5 was unsatisfied with a murderer like Lamech having such a prominent place in the order of the genealogy. This explains why Seth and Enosh, placed after Lamech in Genesis 4, are used in Genesis 5 to pad out the revised genealogy, and why Enoch and Mehuyael/Mahalelel are flipped. Lamech is moved down to number nine, while the righteous Enoch becomes the seventh from Adam.
Even still, this posed another problem. If the two Lamechs are in fact the same Lamech, this means that the righteous Noah and his sons Shem, Ham, and Japheth are descended from the murderous Lamech found in Genesis 4. Contrary to an idea common in theological interpretations of Genesis, this means that Cain's lineage survived the flood. Why, then, does Genesis 4 have nothing to say about Noah being a son of Lamech?
Actually, it does.
Two things I wrote about in previous articles are relevant to this point. First, I mentioned before that Genesis 2-4 belongs to the 'J source', a series of folktales that lend symbolic value to the names of people and places. Second, I also mentioned that Genesis 6-9 contains two versions of the flood myth. Genesis 2-4 and Genesis 5 have very distinct literary styles and themes. When we get to Noah's birth in Genesis 5.28b-29 the style and themes inexplicably mirror that of Genesis 2-4, before suddenly reverting back to the more matter-of-fact style filling the rest of Genesis 5. This is because Genesis 5.28b-29 belongs to the J source. As with Genesis 2-4, the style is folkish, with symbolic naming, and a focus on humanity's relationship with the earth. This then leads seamlessly into the Yahwist form of the flood myth described in a previous article.
After the flood, readers are presented with a short story at the end of Genesis 9.18-27. What we have is etiological on two levels.
On the one hand, the little episode sets out to validate post-exodus Israel's subjugation of the Canaanites. In this story, Noah becomes drunk and passes out naked in his tent. Noah's son Ham discovers Noah naked and apparently gloats to his brothers about it. Upon waking, Noah curses Ham's son Canaan, declaring that he shall be a slave to Shem and Japheth. (The Israelites were descended from Shem.)
But wait. Why does Noah curse Ham's son, rather than Ham himself? This led to a popular interpretation that, when it says Ham 'saw the nakedness of his father', we're actually being told Ham slept with Noah's wife in euphemism (see Leviticus 18.7); Canaan was born from the affair, so Noah cursed him. However, this reading doesn't make much sense of the narration since it directly says Noah himself 'lay uncovered in his tent', not Noah's wife.
Noah's prophetic curse over Canaan is also problematic. Noah condemns Canaan to slavery, but in the prophecy Shem and Japheth are referred to as Canaan's brothers rather than his uncles:
'Cursed be Canaan; lowest of slaves shall he be to his brothers.' He also said, 'Blessed by Yahweh my God be Shem; and let Canaan be his slave. May God make space for Japheth, and let him live in the tents of Shem; and let Canaan be his slave.'
Speculation has endured that the prophecy either originally named Ham instead of Canaan, or that Canaan really was the third son of Noah and was, for whatever reason, split into two people (Ham and Ham's son) by the storyteller.
On the other hand, the little episode corresponds back to the style and themes of Genesis 2-4 and 5.28b-29. When these stories are reunited, the recurring theme is of humanity's relationship with the earth: Adam and Eve live in the garden of Eden, where food is provided for them; When they disobey God, the earth is cursed, and Adam is condemned to a difficult life of working the land to receive food; After murdering Abel, Cain is cursed to have an even worse relationship with the earth. The narration also follows the progression of human culture from the primitive professions of Cain and Abel to the more creative professions of Lamech's sons: Together, Cain and Abel act within the narrative as if priestly ritualism is an established concept; In opposition to one another, they encapsulate an ancient, long-enduring rivalry between farmers and herdsman; Cain is credited with building the first city; finally, Lamech's three sons are the respective 'forefathers' of nomadic herdsman, musicians, and blacksmiths. (As with the others, their names carry symbolic value related to their professions.)
The Noah of the 'J source' narrative — thus far found in Genesis 2-4, 5.28b-29, roughly half of the flood myth in 6-9, and now also in 9.20-27 — continues both the question of humanity's relationship to the earth, and the progression of human culture. First, he is so-named as Noah (rest) because 'Out of the ground that Yahweh has cursed this one shall bring us rest from our work and from the toil of our hands'. Humanity's relationship with the earth, which was ruined because of Adam, will be healed through Noah. That the curse has been lifted is made evident to the reader with the short episode of Noah's vineyard. Second, this vineyard also becomes Noah's own cultural contribution, adding to the list of creative professions founded by Lamech's first three sons.
Because the two genealogies in Genesis 4 and 5 are really the same genealogy told in different ways, the Lamech in either genealogy is the same Lamech. This mean Noah is the son of Lamech, descendant of Cain. Reuniting Lamech's four sons together, we see they act as an etiology for four ancient professions: nomadic herdsmen (Yabal), musicians (Yubal), blacksmiths (Tubalcain), and vinters (Noah). For the story being told in the 'J source', Noah is the most important of the four, not simply because he is the survivor of the flood, but because through Noah being a worker of the soil, God lifts the curse that had been placed on Adam and his descendants of a broken relationship with the earth.