Faced with the prospect of a long war with U.S regulators it seemed destined to lose, AT&T announced on Monday it would give up on its $39-billion attempt to purchase T-Mobile, even though the decision will cost the nation's number-two carrier at least $4 billion to walk away from the deal.