Of course - if Japan had not bombed Pear Harbor, the USA would have not gone to war vs Japan, and Japan would not have been nuked. But that's a big duuuuh.
What's really important is whether nuking Japan's civilians was necessary to win the war. Nor was the fire bombing of Tokyo
I argue that it wasn't. The nuking of Japan was in response to the Japanese not surrendering, and this was the preferred course of action over a ground invasion of the Japanese mainland. But I wonder what was so important about invading the mainland or the Japanese surrender at all? Thy had no planes left, no ships, and a much reduced capacity for fighting back. They were already defeated. What was the urgency of getting an actual surrender?