Some notes on the Greek of Luke 3:23, in summary of an extract from
this pdf:
The entire sentence itranslated literally from the Greek reads, "And himself was Jesus beginning about years (old) thirty being son as was supposed of Joseph of Heli".
"And himself was Jesus beginning about thirty years"
"beginning about thirty years". This is an independent clause. Putting the verbs 'was' and 'beginning' together (was beginning) does not make sense in the context. 'Was' refers to something else (see below).
'beginning' needs an object; most translators insert something like 'his ministry'.
"being son, as was supposed, of Joseph". The word 'as' is a literal translation, and implies that Jesus
was the son of Joseph. This is inconsistent with the rest of the narrative, which tells us that he was not. Thus we should render it, "being son,
so it was supposed, of Joseph".
"being son, so it was supposed, of Joseph". This clause is also independent from "And Jesus was". It's also independent from "of Heli, of Matthat etc", since otherwise the text would say, 'Jesus himself was being, so it was supposed, son of Joseph, of Heli'. 'Was' and 'being' cannot be in apposition.
These two middle clauses being separated from the rest of the text, we are left with: "And Jesus himself was ... of Heli, of Matthat ... of Adam, of God".
In full, then: "And Jesus himself was [beginning (his ministry) about thirty years (old), being son, so it was supposed, of Joseph] of Heli, of Matthat ... of Adam, of God".
Or better, "And Jesus himself, beginning (his ministry) about thirty years (old), being son, so it was supposed, of Joseph, was of Heli, of Matthat ... of Adam, of God".
After 'Joseph', Luke hasn't used 'son' throughout the rest of the list. This confirms that the above rendering of Luke 3:23 is valid, since Heli did not beget Joseph, according to Matthew, and God did not beget Adam.
Conclusion: the Greek does support the hypothesis that Luke gives Mary's ancestry.