As has been pointed out, no specific aircraft or other weapon system can take credit for the defeat of the Japanese. If you want to talk specifically about the air war, the Japanese were primarily defeated, in my opinion, by a number of interrelated factors and decisions that can be loosely grouped into four main catagories: equipment, doctrine, training, and logistics.
Equipment: Put simply, the Japanese build the very best combat aircraft in the world...for the previous war. The sacrificing of firepower, horsepower, and durability in exchange for maneuverability and range resulted in combat aircraft that were quickly rendered obsolete and ineffective against an enemy that refused to fight the kind of fight the Japanese had prepared for. They were also, technologically, at the cutting edge of their industrial capability. As a result, they were unable to keep up (quantitatively) with the rapid advances in aviation and ordinance design. Sure, they could design and build prototypes of combat aircraft that were, on paper at least, on par with American designs; however, the did not have an industrial base of trained workers or readily available raw materials to produce them in quantity.
Doctrine: Tactically, the Japanese airmen in the beginning were superbly trained in ACM. They did not, however, spend any real time on wingman tactics. Once they lost the numerical advantage they initially held in the air when the war started, such lone-wolf tactics became ineffective and darn near suicidal. They were also not particularly adept at supporting bombers, or in close air support roles.
Training: While the aircrews the Japanese began the war with were incredibly skilled, their training methods and capabilities where not up to the task of rapidly replacing -- let alone expanding --their cadre. They did not appreciate or plan for either rapid and massive losses, or for the duration of sustained combat operations. Add to this the fact that they did not routinely rotate veteran combat pilots back home to pass on the hard-won lessons they'd learned, and poor or inconsistent methods to introduce newbies to combat with an eye to getting them through their first 10 or so missions.
Logistics: Volumes have been written about this issue, as it relates to the Japanese' fortunes (or lack of fortunes) in World War II. Needless to say, the Japanese did not have the resources to sustain combat across such a vast operational area. Even early in the war, a lack of skilled maintenance crews, spares, ammo and fuel constrained the Japanese considerably, even in the best of time. As they struggled to field more advance types of aircraft, this only got worse.
For what it's worth, the P-40 will always be the aircraft that symbolizes the Pacific war to me. Like the Wildcat, it was inferior in many ways to the Japanese aircraft they went up against early in the war. Both bore the brunt and held the line against the Japanese, through skill and valor, until their newer counterparts were available to take up the batton.