Solving for sustainability on Mars would almost by definition solve for sustainability on Earth.
(We should probably start with the moon, though)
(We should probably start with the moon, though)
An off planet colony would likely face the same issues of sustainability as soon as different factions start competing for resources.