Fyi, those sentences in your reasoning are already handled by a hypothetical flat tax percentage. It's the percentage that handles your cases as you stated them. For example, if a flat 15% tax was applied for everyone, the billionaire earning $30 million pays $4500000 in taxes, while the Walmart earning $20k pays $3000.
Mathematically, 4500000 is greater than 3000. In that case, the billionaire has paid more taxes which satisfies your reasoning.
On the other hand, the previous posters were emphasizing "progressive" taxes. That means that the percentages themselves are increased as income increases. Your rationale isn't specific to that. Probably the most common math rationale for progressive taxation is the concept of marginal utility of money[1]. In other words, a billionaire's $1 million of money made between $29 million and $30 million is less significant to him and therefore, can be taxed at a more "progressive" tax rate of 40% instead of 15%. On the other hand, the Walmart employees $1000 from $3000 to $4000 pays for food and rent and is not discretionary play money.