# Notation in GBM package vignette: expected value of loss functions

Can anyone help with the understanding of this notation (and idea) from the vignette for GBM in R?

It starts with the following:

Question 1: I believe this is simply saying that we are looking for the function f(x) that minimizes the average value of the loss function (and that expected value is over all values of X and Y)?

Then this is shown:

Question 2: What are these two steps?

Is the first of these two equivalent to the one above by a law of expectations? And is it saying that we are seeking the expected value of the loss function over y, considering x fixed? Then the outer part of the expression is averaging over all values of x?

-