Ananias lied to God, who is also identified as the Holy Spirit. According to the Bible, there is only one God: the Father.
"But to us there is but one God, the Father, of whom are all things,
and we in him; and one Lord Jesus Christ, by whom are all things, and
we by him." (1 Corinthians 8:6)
Jesus himself says as much (see John 17:1-3). And Jesus says that God is a spirit.
"God is a Spirit: and they that worship him must worship him in spirit
and in truth." (John 4:24)
The scriptures of Jesus' time made plain that God is holy:
"For I am the LORD thy God, the Holy One of Israel, thy Saviour:..."
Note that this also declares that God is "One."
Naturally, if "God is a Spirit" and God is "the Holy One," then God is a Holy Spirit, and the Holy Spirit is God.
"Speak unto all the congregation of the children of Israel, and say
unto them, Ye shall be holy: for I the LORD your God am holy."
Ananias and Sapphira thought they were concealing something from their church brethren, when in reality they were lying to God--who knows everything and who saw fit to reveal the matter to the church lest others do similarly. They were made to be examples to the others so that all would reverence God and fear to sin so boldly against Him.