Matthew’s genealogy is about proving Jesus is the Son of David, the Messiah. Luke’s genealogy proves that Jesus is the Son of Man. There’s a third genealogy of Christ. Where is it and what’s the purpose of that one?
The third genealogy of Christ is in John 1:1-5. This is the genealogy of Jesus as the pre-existent Son of God.