Don't understand past tense used as present perfect in Japanese


I'm reading a Japanese beginners book in which I have found a 'present
perfect' sentence for the first time, but I don't understand it very well:

The sentence

> 見たことがある女の人がいます

according to my book, is translated as:

> There is someone she has seen before

My understanding is that in Japanese there is no present perfect, past tense
is used instead and whether or not it is present perfect is infered by the
context (source: [this](https://www.wasabi-jpn.com/japanese-grammar/past-
tense-and-present-perfect-tense-with-the-ta-form/)).

I still don't understand very well the sentence parts:

  * Where is the 'before' in that sentence?
  * I don't see how is that inferred that that sentence is present perfect and not past perfect, that is: 'There is someone she saw'
  * How is that it has two が? It's like it has two subjects.
  * What does the `aru` do there?




There are several things going on in this sentence, so let's look at them one
by one.

> 見たことがある女の人がいます

First, there's a relative clause:

> 見たことがある

and then there's the main clause:

> 女の人がいます

The main clause just says

> There is a woman.

が here marks the subject of the main clause.

* * *

Regarding the _relative clause_

> 見たことがある

This is a special construction, which works as follows:

> < _past tense verb_ >ことがある

which means

> _Someone_ has had the experience of doing _verb_

Put another way, it means

> _Someone_ has **previously** experienced doing _verb_

So, in this particular case we have

> _Someone_ has **previously** seen _something_

* * *

If we put the relative clause together with the main clause, note that the
relative clause _modifies_ 女の人. So we have

> There is a woman who _someone_ has previously seen.

which then can be worked as

> There is a woman who [ _I,she,he,they_ ]'ve seen before.

The choice here between _I, she, he, they, etc_ all depends on who's in the
scope of conversation. Without further context, a native speaker would default
to understanding this as _I_. But, your book perhaps has provided a context or
assumes one, which is _she_ (a _she_ difference from this particular _woman_ )




You can see `～たことがある` as a fixed form meaning "To have done ~ before" (see
[here](https://jlptsensei.com/learn-japanese-
grammar/%E3%81%9F%E3%81%93%E3%81%A8%E3%81%8C%E3%81%82%E3%82%8B-ta-koto-ga-aru-
meaning/)).

If you are interested in the structure, ある is the usual ある, meaning something
exists; こと nominalizes the verb, something like "The fact of [doing verb]" in
English, like 食べること, "The fact of eating": since が as subject marker have to
follow a noun, you need something to make 見た a noun, and that's こと. So 見たこと is
something like "The fact of having seen in the past" ("in the past" because
the verb is in past form).

If you add がある, i.e. "exist", 見たことがある literally means "It exists the fact of
having seen [something] in the past"; but that, in a less literal and awkward
translation, means that in the past the subject saw the object - i.e., "I have
already seen".

There are two が because the first is linked to こと (as subject of ある), while
the second to 女の人 (as subject of います): there is one sentence with its subject
- 見たことがある - modifying another sentence with its subject - 女の人がいます.

