# Can you explain what "for which" means here in this sentence?

I'm learning "Composition of Functions" in Aleks and come across this sentence. But I can't understand what "for which" means in that sentence:"The domain of f.g is the set of all x in the domain of g for which g(x) is in the domain of f."

I found a similar answer here "Such that" versus "for which"

but I'm confused because I don't know which antecedents the word "which" in "for which" refer to: "the domain of f.g", "the set of all x" or "the domain of g" ???

Can you explain it to me? I'd appreciate it. • "p for which q" means "p that cause q to be true" Nov 8, 2017 at 19:11
• It’s the same as “for whom” except for things instead of people.
– Jim
Nov 8, 2017 at 19:22
• So if x is in the domain of g, and g(x) is in the domain of f, then (and only then) x is in the domain of f.g. Nov 8, 2017 at 20:42
• In your example, the antecedent of "which" is x. Nov 9, 2017 at 4:52
• That Question isn't about English. It's about maths or logic or some such but not English. Part of the problem is that you equate Such that and for which, when in fact they're nt the same at all. Nov 12, 2017 at 22:30

• The domain of `f·g` is the set of all `x` in the domain of `g`
for which `g(x)` is in the domain of `f`.

This is mathematical English, not colloquial English. In colloquial English for which and such that cannot be freely interchanged; but in mathematical phrasing like this, they can. This sentence means the same thing:

• The domain of `f·g` is the set of all `x` in the domain of `g`
such that `g(x)` is in the domain of `f`.

For which introduces a restrictive relative clause bound by the quantifier all; it restricts the set to only certain `x`'s, and the property those `x`'s share is stated the set phrase for which (or such that).

These set phrases are used when a simple relative clause won't do the job. If the sentence was

• The domain of `P` is the set of all `x` in `Q`
which are zeroes of the Zeta function.

there's no need to pied-pipe a preposition for, and there's no problem.

But in the example provided, all `x` isn't the subject of the restrictive relative,
so you can't use which as the subject, but rather posit some oblique relation,
and that calls for a preposition, which gets stranded when which is moved to the front

• *The domain of `f·g` is the set of all `x` in the domain of `g`
which `g(x)` is in the domain of `f` for.

which is so clumsy that it's promptly pied-piped and glued together with which into a fixed phrase.