How do you get to worlds 4 and 7 in Mario brothers?

you have to beat boss world 2 as mini for world 4 you have to beat boss world 5 as mini for world 7