Gain and boot calculation
The calculation begins with the relinquished property's amount realized and adjusted tax basis to estimate realized gain. It then measures cash retained and net liability relief against replacement-property value, cash invested, and replacement debt to estimate boot. Recognized gain cannot exceed realized gain. The balance is treated as deferred gain, which reduces the replacement property's tax basis rather than disappearing.