When you are at node , each child contributes down[v] to 's answer. You combine all children's contributions to get down[u]. This is the down pass. For the up pass, you need to exclude child 's contribution to compute up[v]. You cannot use down[u] directly because that already includes down[v].
You need down[u] minus down[v]. Trick: compute prefix and suffix products or sums of children's contributions. Then you can exclude any single child in time. This keeps the up pass linear.
Space complexity is for the data structures used.