Your link is to something other than IRS Publication 590. The IRS states this:
A wash sale occurs when you sell or trade stock or securities at a loss and within 30 days before or after the sale you:
- Buy substantially identical stock or securities,
- Acquire substantially identical stock or securities in a fully taxable trade,
- Acquire a contract or option to buy substantially identical stock or securities, or
- Acquire substantially identical stock for your individual retirement arrangement (IRA) or Roth IRA.
If your loss was disallowed because of the wash sale rules, add the disallowed loss to the cost of the new stock or securities (except in (4) above). The result is your basis in the new stock or securities. This adjustment postpones the loss deduction until the disposition of the new stock or securities. Your holding period for the new stock or securities includes the holding period of the stock or securities sold.
As well as this:
You continue to have the burden of proving your basis in the specified shares at the time of sale or transfer.
FIFO. If your shares were acquired at different times or at different prices and you cannot identify which shares you sold, use the basis of the shares you acquired first as the basis of the shares sold. In other words, the oldest shares you own are considered sold first. You should keep a separate record of each purchase and any dispositions of the shares until all shares purchased at the same time have been disposed of completely. Table 4-2 illustrates the use of the FIFO method to figure the cost basis of shares sold, compared with the use of the average basis method (discussed next).
The underlying link provided seems to be expanding the IRS directions out with florid language, but is in fact keeping track of the disallowed loss by tying the basis to the corresponding shares and getting in the weeds describing these as "sub lots". I will admit I don't understand the point about "bites of apples"
On Day 2 you have a (1000) loss. On day 3, because it is within 30 days, day 2 is a wash sale. You defer the loss on day 2 and add 1000 so the position's new basis is 2000*95+1000, or 20,000, or one lot at 10,500 and one lot of 9,500.
On day 4, you sell at 9000. This is a loss and within 30 days, so loss is deferred and added to the basis of the remaining position. It does not matter which lot you use. You bought them on the same day, so they are both FIFO candidates.
Sell the 10,500 lot: loss of (10,500-9000) or 1,500 is deferred and added to the 9,500 basis of the other lot. Your basis for the 100 shares you continue to own is 11,000.
Or, sell the 9500 lot: loss of (9,500-9000) or 500 is deferred and added to the 10,500 basis of the other lot. Your basis for the 100 shares you continue to own is 11,000.