The second sentence is "We see the teacher in the girl" O_O
we don't get the same sentences nor the same type of questions
Why is the "Wir sehen den Lehrer im dem Restaurant" wrong ?
Im is a combination of "in + dem" so it takes the place of dem. You could either say "in dem Restaurant" or "im Restaurant."