Donald Trump. AP At a rally Tuesday in Arizona, Donald Trump sought to blame Hillary Clinton for his own low tax bills. He asked:

"After years of failure, she complains about how I've used tax laws of this country to my benefit. Then I ask a simple question: Why didn't she ever try to change those laws so I couldn't use them?"

Well, maybe Clinton didn't just try to change laws Trump used, but actually got them changed, when she was in the Senate in 2002.

According to a Tuesday column by Lee Sheppard in the tax industry publication Tax Notes, Trump may have benefited greatly in the 1990s from a tax loophole related to forgiven debts — a loophole that would have allowed him to deduct business losses on his personal income tax return, even if those losses were actually borne by banks that loaned Trump money and never got it back.

People often use "loophole" to refer to tax deductions they don't like, but this one was a loophole in the true sense of the word: a tax break created by legislative accident.

This loophole was the subject of a 2001 Supreme Court case, Gitlitz v. Commissioner, in which the IRS argued the relevant tax law could not have possibly meant what it appeared to say, which was that business owners could in some cases deduct losses they had not actually borne.

After the IRS lost that case, the loophole was closed by the Job Creation and Worker Assistance Act of 2002, a bill that then Sen. Hillary Clinton voted for and President George W. Bush signed. But that law only stopped taxpayers from using the loophole going forward; they were still allowed to benefit from tax losses they had booked through it in prior years, such as 1995.

Here's how the loophole could have allowed Trump to create a paper tax loss that he could use to offset his real income for over a decade, avoiding hundreds of millions of dollars in taxes in the process.

I forgive you

In general, if someone cancels a debt you owe them, you're supposed to count the amount forgiven as income. Let's say you buy a building worth $1 million, using $200,000 in equity and an $800,000 mortgage. Then the building is destroyed, and you have no insurance. Now your investment is worthless, and the bank gives up all attempts to collect on the mortgage.

Your loss, for tax purposes, should generally be just $200,000, not $1 million.

One of the big mysteries about Trump's 1995 tax returns is how he managed to run up such a large tax loss ($916 million) when so many of the losses related to his business implosion of the early 1990s ended up being borne not by himself, but by banks and other creditors that forgave Trump's debts or otherwise didn't get paid back.

No debt parking

John Hempton of Bronte Capital has drawn some attention for his theory that Trump could have engaged in "debt parking." In essence, instead of Trump's debts being canceled, an entity controlled by Trump could have bought the debt for pennies on the dollar, and then held it without either forgiving it or trying to collect on it.

With the debt suspended in limbo like this, Hempton suggested, Trump could have claimed there was no debt forgiveness to report. In Hempton's theory, this would have allowed Trump to deduct from his taxes the full amount of losses related to his businesses, including those that really ended up being borne by the creditors who sold their debt for pennies on the dollar.

The main problem with Hempton's theory is that this strategy is illegal. The IRS is not perfect, but it is pretty good at identifying and disallowing such tax strategies, especially when they involve huge sums of money.

But what if the loophole at issue in the Gitlitz case allowed Trump to deduct his businesses' huge loss without needing to report the associated debt forgiveness as income — that is, what if Trump found a perfectly legal way to take credit on his personal income taxes for losing money he didn't really lose?

Donald Trump. AP

The theory

That Tax Notes column by Sheppard, a prominent tax commentator who previously practiced tax law, is behind a paywall. But it provides the best theory I've seen to date of how Trump could have come to run up such a big loss on paper, so I'm providing a summary below, and I'm hoping you'll bear with me.

The Gitlitz loophole — the one Congress closed in 2002 — was related to the taxation of S Corporations.

The S Corporation is corporate form for businesses that have only one or a few owners. Often, these are small businesses, but they don't have to be. S Corporations do not pay taxes directly — instead, they pass their profits and losses through to their owners, who pay tax on those profits (or deduct those losses) on their individual income-tax returns.

When an S Corporation loses money, its owners in general may deduct those losses against other income they report on their tax returns. However, there are supposed to be rules in place to ensure that taxpayers cannot deduct losses from an S Corporation that exceed what they invested in the S Corporation in the first place, plus the prior profits they have earned from the S Corporation.

That is, let's say you invest $100,000 into an S Corporation of which you are the sole owner. In the first year, the S Corporation earns profits of $50,000, of which you enjoy 100%. In the next year, the S Corporation loses money. Then, you may deduct these losses from your taxes, but not to the extent they exceed $150,000.

Or, at least, that's how it's supposed to work.

"You double-dipped the chip!" NBC via YouTube screengrab

The 'double dip'

Sheppard sketches out a situation in which an S Corporation owned by Trump is the general partner in his casino businesses, which went into bankruptcy in 1991 and 1992. That S Corporation likely lost a great deal of money. It also likely owed debts related to the casino businesses that it could not pay and that were canceled as part of the bankruptcies — and/or as part of Trump's subsequent out-of-bankruptcy restructurings, which continued into 1995.

Ordinarily, canceled debts would count as taxable income to the S Corporation. But if the S Corporation were insolvent (which you would have expected it to be, if its sole assets were its equity interests in Trump's bankrupt casinos), the debt cancellation would have been excluded from its taxable income.

This exclusion makes sense if you think about the personal case: Let's say you have $300,000 in debts and no assets, and you declare a Chapter 7 liquidation bankruptcy. Your debts would be discharged. It would be silly for the government to call that discharge $300,000 in income and seek around $100,000 in taxes from you, since you have no money.

In the situation described by Sheppard, the S Corporation's massive business losses would have passed through to Trump as personal losses. The offsetting debt forgiveness enjoyed by the S Corporation would not have passed through to Trump as taxable personal income because it was excluded from the S Corporation's taxable income. In total, Trump would have harvested a huge loss that exceeded his initial investment in and prior profits from the S Corporation.

"But wait!" I hope you are saying. "Wouldn't that put Trump afoul of the rule that his tax losses from the S Corporation can't exceed what he invested in it in the first place plus the prior profits?"

Yes, it would — except that, before the 2002 loophole fix, the debt forgiveness enjoyed by the S Corporation would have passed through to Trump for the purposes of calculating the amount of profit the S Corporation had earned on his behalf, even though the same debt forgiveness did not pass through as actual taxable profit to him.

Sheppard refers to this as a "double dip" — the tax loophole would have allowed Trump to claim losses on his individual income tax return that were ultimately borne by creditors, not by him.

The ultimate fix

If that rule sounds stupid, that's because it was stupid. The IRS sought to disallow such tax deductions since they were obviously contrary to the intent of the laws around S Corporations. But the Supreme Court ruled in 2001, in an 8-1 decision, that the letter of the law allowed investors to use this tax strategy even if it made no sense. The only way to close the loophole was to change the law.

So in 2002, as a part of a broader, bipartisan package of business tax reforms, Congress did that. The new law ensured that if the cancellation of an S Corporation's debt doesn't count as taxable income, it can't increase the shareholder's basis in the S Corporation, creating additional headroom for the shareholder to deduct other losses he didn't really bear.

This package of reforms passed the Senate by a vote of 85-9. One of the senators voting in favor was Hillary Clinton.

I don't know that Trump benefited from this loophole, but it would fit the available evidence very well. And it would help explain how he managed to run up a tax loss so big that it amounted to nearly 2% of all the net operating losses taken on individual income tax returns in the entire country in 1995.

It would also blow up the narrative that Trump's huge loss just reflects the tax code working properly, letting businesspeople offset their real profits with their real losses.

If Trump didn't use the Gitlitz loophole and he really did enjoy a bona fide economic loss of nearly $1 billion, he could prove that by releasing his tax returns in their entirety.

Until he does that, we can't just assume Trump "used the tax code just the way it's supposed to be used," as his running mate, Gov. Mike Pence, claimed Tuesday night. After all, like the rest of us, Pence has not seen the entire tax returns he is purporting to bless.