It looks like there are a couple of inaccuracies in your statement regarding the processes involving magma and rock formation.
-
Porosity of Magma: As magma heats in the mantle, it does not become more porous. Instead, it remains in a molten state, and it is the phase change that leads to the formation of rocks.
-
Formation of Rocks: When magma rises through the Earth’s crust and cools, it typically forms igneous rocks, not sedimentary rocks. Sedimentary rocks are formed from the accumulation and compaction of sediments, which can be derived from the weathering of pre-existing rocks, rather than from the cooling of magma.
A more accurate description would be:
"As magma heats in the mantle, it becomes less dense and begins to rise. This results in the magma traveling to the crust where it cools and solidifies into igneous rock."
If you have additional questions or need further clarification, feel free to ask!