“People in Sichuan think they would die without their chili peppers, but they can live without them,” said Chen Kerong, the production director at the Molycorp factory here. “People love dysprosium, but they can live without it, too.”

The global oil industry has similarly begun using less lanthanum, another rare earth, during oil refining. Only 1.5 percent of the latest catalyst formulations for oil refining are now lanthanum, down from 4 or 5 percent three years ago.

But the case before the World Trade Organization appears to have made a difference already by prompting a broad environmental cleanup. In a white paper issued in June last year, China’s cabinet described at length the environmental harm caused by the rare earth industry, an admission that although embarrassing for Beijing may have buttressed its case at the W.T.O. that the rare earth industry is a dirty business for which export restrictions are justified. “Excessive rare earth mining has resulted in landslides, clogged rivers, environmental pollution emergencies and even major accidents and disasters, causing great damage to people’s safety and health and the ecological environment,” the white paper said.

Chinese officials have repeatedly denied that their newfound concerns for the environmental consequences of rare earth mining and refining are driven by a desire to help avoid defeat at the W.T.O., although the cleanup could help on that.

Whole villages between the city of Baotou and the Yellow River in Inner Mongolia have been evacuated and resettled to apartment towers elsewhere after reports of high cancer rates and other health problems associated with the numerous rare earth refineries there.

The most hazardous refineries are those that crack the tight chemical bonds that tie rare earths found in mineral ores to a variety of hazardous materials, notably radioactive thorium. Many tons of extremely concentrated sulfuric acid are used to break the chemical bonds. Then the valuable rare earth metals, which are not radioactive themselves, can be purified. But a hazardous stew of toxic chemicals and low-level radioactive waste is left behind. Most of that waste has been dumped into the world’s largest mine tailings pond, which covers four square miles near the Yellow River on the western outskirts of Baotou.

Built in the 1950s under Mao Zedong, the tailings pond lacks a liner to prevent the leaking of radioactive waste and toxins into the groundwater, where they have been gradually seeping toward the Yellow River. There is no evidence that the waste and toxins have reached the river, but the Chinese government plans to spend hundreds of millions of dollars pumping out as much contaminated groundwater as possible and pumping enormous quantities of fresh water into the earth to dilute what is left before it reaches the Yellow River.