Why does using images that are not really formed work in ray optics? It's all in the title. For instance, if I have two lenses , I have been taught to first find the position of the image formed by the first lens, and then use that image to find the final image formed by the 2nd lens, if the first image is formed beynd the 2nd lens. Why does this work?

edit:- image for reference
 A: I addressed this before but will elaborate further. Refer to the diagram here.
Suppose there is an object R on the axis a distance r to the left of a lens with focal length f and r<f. When the rays leave the lens they diverge as if coming from a point P a distance p to the left of the lens. So P is a virtual image. We have
1/r  + 1/p  =  1/f
1/p = (r-f)/rf
where r>0 and p<0.
Rays are reversible so consider rays from the right heading toward P i.e. P is now a virtual object. They have to converge at R. Your question is basically can we use the same lens equation for this case. Let's see if
1/p = (r-f)/rf
works. Well, f is the same, the absolute values of p and r are the same. In this case r > 0 as it's now a real image and still r<f. So we will end up with the right magnitude for p but it will be negative.
So we conclude that we can use a virtual object if the image distance is negative.
Edit: fixed equation for 1/p. Conclusion still holds.
A: Because the pattern of rays emerging from the first image is (more or less) the same as the pattern of rays that would emerge from a real object at that point.
